Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Init/Grind/Norm.lean
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ theorem natCast_mod (a b : Nat) : (NatCast.natCast (a % b) : Int) = (NatCast.nat
theorem natCast_add (a b : Nat) : (NatCast.natCast (a + b : Nat) : Int) = (NatCast.natCast a : Int) + (NatCast.natCast b : Int) := rfl
theorem natCast_mul (a b : Nat) : (NatCast.natCast (a * b : Nat) : Int) = (NatCast.natCast a : Int) * (NatCast.natCast b : Int) := rfl
theorem natCast_pow (a b : Nat) : (NatCast.natCast (a ^ b : Nat) : Int) = (NatCast.natCast a : Int) ^ b := by simp
theorem natCast_id (a : Nat) : NatCast.natCast a = a := rfl

theorem Nat.pow_one (a : Nat) : a ^ 1 = a := by
simp
Expand Down Expand Up @@ -184,7 +185,7 @@ init_grind_norm
Int.ediv_zero Int.emod_zero
Int.ediv_one Int.emod_one
Int.negSucc_eq
natCast_div natCast_mod
natCast_div natCast_mod natCast_id
natCast_add natCast_mul natCast_pow
Int.one_pow
Int.pow_zero Int.pow_one
Expand Down
6 changes: 6 additions & 0 deletions tests/lean/run/grind_natCast.lean
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ example (x : Nat) : NatCast.natCast x ≥ 0 := by grind
example (x : Nat) : x ≥ (-1 : Int) := by grind
example (x : Nat) : Int.ofNat x ≥ (-1 : Int) := by grind
example (x : Nat) : NatCast.natCast x ≥ -1 := by grind

example (n : Nat) : Nat.cast n = n := by
grind

example (n m a : Nat) : n = m → Nat.cast n - a = m - a := by
grind
Loading