Skip to content

Commit ad7d44e

Browse files
committed
feat: grind_pattern natCast_nonneg
1 parent 5326530 commit ad7d44e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Init/Grind/Ordered/Ring.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ theorem natCast_le_natCast_of_le (a b : Nat) : a ≤ b → (a : R) ≤ (b : R) :
151151
simp [Semiring.natCast_add, Semiring.natCast_one]
152152
exact OrderedAdd.add_le_left_iff _ |>.mp ih
153153

154+
theorem natCast_nonneg {a : Nat} : 0 ≤ (a : R) := by
155+
simpa [Semiring.natCast_zero] using natCast_le_natCast_of_le (R := R) _ _ (Nat.zero_le a)
156+
157+
grind_pattern natCast_nonneg => (a : R)
158+
154159
theorem natCast_lt_natCast_of_lt (a b : Nat) : a < b → (a : R) < (b : R) := by
155160
induction a generalizing b <;> cases b <;> simp
156161
next n =>

0 commit comments

Comments
 (0)