File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ module
2+
3+ /-!
4+ https://github.com/leanprover/lean4/issues/14440
5+ It has already been fixed by #14390
6+ -/
7+
8+ set_option warn.sorry false
9+
10+ open Lean.Grind
11+
12+ example {S : Type } [CommRing S] (a b v : S)
13+ (ha : a ^ 3 = 0 ) (hab : a ^ 2 * b + 2 = 0 ) (hv : v ^ 2 = a ^ 2 * v) :
14+ (v * (1 + b * v)) ^ 2 = a ^ 2 * (v * (1 + b * v)) := by
15+ grind
16+
17+ -- Simple consequences in the same ring.
18+ example {S : Type } [CommRing S] (a b : S)
19+ (ha : a ^ 3 = 0 ) (hab : a ^ 2 * b + 2 = 0 ) : 2 * a = 0 := by
20+ grind
21+
22+ example {S : Type } [CommRing S] (a b : S)
23+ (ha : a ^ 3 = 0 ) (hab : a ^ 2 * b + 2 = 0 ) : (a * b) ^ 2 * a ^ 2 = 0 := by
24+ grind
25+
26+ -- Goals requiring coefficient cancellation are not provable without `NoNatZeroDivisors`
27+ -- (`NoNatZeroDivisors` is false in this ring: `2 • (2 * b) = 0` with `2 ≠ 0`).
28+ -- They must fail gracefully, not with an internal error.
29+ example {S : Type } [CommRing S] (a b : S)
30+ (ha : a ^ 3 = 0 ) (hab : a ^ 2 * b + 2 = 0 ) : a = 0 := by
31+ fail_if_success grind
32+ sorry
33+
34+ -- Disequality path.
35+ example {S : Type } [CommRing S] (a b : S)
36+ (ha : a ^ 3 = 0 ) (hab : a ^ 2 * b + 2 = 0 ) (h : 2 * b ≠ 0 ) : b = 0 := by
37+ fail_if_success grind
38+ sorry
You can’t perform that action at this time.
0 commit comments