Skip to content

Commit bb32c6c

Browse files
authored
test: for issues #14440 (#14445)
This PR just adds test for issue #14440. It has already been fixed on master. PR #14390 Closes #14440
1 parent ca190c9 commit bb32c6c

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

tests/elab/grind_14440.lean

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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

0 commit comments

Comments
 (0)