This PR adds support for `NatModule` equalities and inequalities in
`grind linarith`. Examples:
```lean
open Lean Grind Std
example [NatModule α] [LE α] [LT α]
[LawfulOrderLT α] [IsLinearOrder α] [OrderedAdd α]
(x y : α) : x ≤ y → 2 • x + y ≤ 3 • y := by
grind
example [NatModule α] [AddRightCancel α] [LE α] [LT α]
[LawfulOrderLT α] [IsLinearOrder α] [OrderedAdd α]
(a b c d : α) : a ≤ b → a ≥ c + d → d ≤ 0 → d ≥ 0 → b = c → a = b := by
grind
```
13 lines
300 B
Text
13 lines
300 B
Text
open Std Lean.Grind
|
|
|
|
section NatModule
|
|
|
|
variable (M : Type) [NatModule M] [AddRightCancel M]
|
|
|
|
example (x y : M) : 2 • x + 3 • y + x = 3 • (x + y) := by grind
|
|
|
|
variable [LE M] [IsLinearOrder M] [OrderedAdd M]
|
|
|
|
example {x y : M} (h : x ≤ y) : 2 • x + y ≤ 3 • y := by grind
|
|
|
|
end NatModule
|