This PR adds a `HPow \a Int \a` field to `Lean.Grind.Field`, and sufficient axioms to connect it to the operations, so that in future we can reason about exponents in `grind`. To avoid collisions, we also move the `HPow \a Nat \a` field in `Semiring` from the extends clause to a field. Finally, we add some failing tests about normalizing exponents.
27 lines
612 B
Text
27 lines
612 B
Text
open Lean.Grind
|
|
|
|
section IntModule
|
|
|
|
variable (M : Type) [IntModule M]
|
|
|
|
example (x y : M) : 2 * x + 3 * y + x = 3 * (x + y) := by grind
|
|
|
|
variable [LinearOrder M] [OrderedAdd M]
|
|
|
|
example {x y : M} (h : x ≤ y) : 2 * x + y ≤ 3 * y := by grind
|
|
|
|
end IntModule
|
|
|
|
-- We could solve these problems by embedding the NatModule in its Grothendieck completion.
|
|
section NatModule
|
|
|
|
variable (M : Type) [NatModule M] [AddRightCancel M]
|
|
|
|
example (x y : M) : 2 * x + 3 * y + x = 3 * (x + y) := by grind
|
|
|
|
variable [LinearOrder M] [OrderedAdd M]
|
|
|
|
example {x y : M} (h : x ≤ y) : 2 * x + y ≤ 3 * y := by grind
|
|
|
|
|
|
end NatModule
|