feat: grind_pattern natCast_nonneg (#11574)
This PR adds a lemma that the cast of a natural number into any ordered ring is non-negative. We can't annotate this directly for `grind`, but will probably add this to `grind`'s linarith interrnals.
This commit is contained in:
parent
f88e503f3d
commit
124e34ef5a
1 changed files with 3 additions and 0 deletions
|
|
@ -151,6 +151,9 @@ theorem natCast_le_natCast_of_le (a b : Nat) : a ≤ b → (a : R) ≤ (b : R) :
|
|||
simp [Semiring.natCast_add, Semiring.natCast_one]
|
||||
exact OrderedAdd.add_le_left_iff _ |>.mp ih
|
||||
|
||||
theorem natCast_nonneg {a : Nat} : 0 ≤ (a : R) := by
|
||||
simpa [Semiring.natCast_zero] using natCast_le_natCast_of_le (R := R) _ _ (Nat.zero_le a)
|
||||
|
||||
theorem natCast_lt_natCast_of_lt (a b : Nat) : a < b → (a : R) < (b : R) := by
|
||||
induction a generalizing b <;> cases b <;> simp
|
||||
next n =>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue