This PR implements the basic tactics for the new `grind` interactive
mode. While many additional `grind` tactics will be added later, the
foundational framework is already operational. The following `grind`
tactics are currently implemented: `skip`, `done`, `finish`, `lia`, and
`ring`.
This PR also removes the notion of `grind` fallback procedure since it
is subsumed by the new framework. Examples:
```lean
example (x y : Nat) : x ≥ y + 1 → x > 0 := by
grind => skip; lia; done
open Lean Grind
example [CommRing α] (a b c : α)
: a + b + c = 3 →
a^2 + b^2 + c^2 = 5 →
a^3 + b^3 + c^3 = 7 →
a^4 + b^4 + c^4 = 9 := by
grind => ring
```
27 lines
768 B
Text
27 lines
768 B
Text
module
|
||
def g {α : Sort u} (a : α) := a
|
||
|
||
/--
|
||
error: `grind` failed
|
||
case grind
|
||
β : Type v
|
||
α : Type u
|
||
a c : α
|
||
b d : β
|
||
h : g (a, b) = (c, d)
|
||
h_1 : g (g (a, b)) = (c, d)
|
||
⊢ False
|
||
[grind] Goal diagnostics
|
||
[facts] Asserted facts
|
||
[prop] g (a, b) = (c, d)
|
||
[prop] g (g (a, b)) = (c, d)
|
||
[eqc] Equivalence classes
|
||
[eqc] {c, (g (g (a, b))).fst, (g (a, b)).fst}
|
||
[eqc] {(c, d).fst}
|
||
[eqc] {d, (g (g (a, b))).snd, (g (a, b)).snd}
|
||
[eqc] {(c, d).snd}
|
||
[eqc] {g (g (a, b)), g (a, b), (c, d), ((g (g (a, b))).fst, (g (g (a, b))).snd), ((g (a, b)).fst, (g (a, b)).snd)}
|
||
-/
|
||
#guard_msgs in
|
||
example {β : Type v} {α : Type u} (a c : α) (b d : β) : g.{max u v + 1} (a, b) = (c, d) → g (g.{max (u+1) (v+1)} (a, b)) = (c, d) → False := by
|
||
grind
|