This PR ensures that `Nat.cast` and `Int.cast` of numerals are normalized by `grind`. It also adds a `simp` flag for controlling how bitvector literals are represented. By default, the bitvector simprocs use `BitVec.ofNat`. This representation is problematic for the `grind ring` and `grind cutsat` modules. The new flag allows the use of `OfNat.ofNat` and `Neg.neg` to represent literals, consistent with how they are represented for other commutative rings. Closes #9321
15 lines
676 B
Text
15 lines
676 B
Text
example (z : Int) : z + (Int.cast (R := Int) (-2)) = z - 2 := by grind
|
||
|
||
attribute [local instance] Lean.Grind.Semiring.natCast Lean.Grind.Ring.intCast
|
||
|
||
example {α : Type} [Lean.Grind.Field α] {z : α} : z / ↑(0 : Nat) = 0 := by grind
|
||
|
||
example {α : Type} [Lean.Grind.Field α] {z : α} : z / ↑(-0 : Int) = 0 := by grind
|
||
|
||
example {α : Type} [Lean.Grind.Field α] {z : α} : z + ↑(1 : Nat) = z + 1 := by grind
|
||
|
||
example {α : Type} [Lean.Grind.Field α] {z : α} : z + ↑(1 : Int) = z + 1 := by grind
|
||
|
||
example (a : Fin 2) : a + ↑(1 : Nat) = a + 1 := by grind
|
||
|
||
example {α : Type} [Lean.Grind.Ring α] {z : α} : z + (Int.cast (R := α) (-2) : α) = z - 2 := by grind
|