Skip to content

Commit faffe86

Browse files
authored
chore: add failing grind tests from Mathlib (#8737)
1 parent c168d06 commit faffe86

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
-- These are test cases extracted from Mathlib, where `omega` works but `grind` does not (yet!)
2+
3+
example (n : Int) (n0 : ¬0 ≤ n) (a : Nat) : n ≠ (a : Int) := by grind
4+
5+
-- TODO: add to the library?
6+
attribute [grind] Int.negSucc_eq
7+
8+
example (p : Int) (n : Nat) (hmp : Int.negSucc (n + 1) + 1 = p)
9+
(hnm : Int.negSucc (n + 1 + 1) + 1 = Int.negSucc (n + 1)) : p = Int.negSucc n := by grind
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
-- These are test cases extracted from Mathlib, where `ring` works but `grind` does not (yet!)
2+
3+
example (n : Nat) :
4+
1 ^ (n / 3) * 2 ^ t = 2 ^ t := by grind
5+
6+
example (a b : Nat) : 3 * a * b = a * b * 3 := by grind
7+
8+
example (k z : Nat) : k * (z * 2 * (z * 2 + 1)) = z * (k * (2 * (z * 2 + 1))) := by grind
9+
10+
open Lean.Grind
11+
12+
example [Field R] (x : R) (cos : R → R) :
13+
(cos x ^ 2 + (2 * cos x ^ 2 - 1) ^ 2 + (4 * cos x ^ 3 - 3 * cos x) ^ 2 - 1) / 4 =
14+
cos x * (cos x ^ 2 - 1 / 2) * (4 * cos x ^ 3 - 3 * cos x) := by
15+
grind
16+
17+
example [Field R] {sqrtTwo a b c : R} :
18+
sqrtTwo / 32 * ((a - b) ^ 2 + (b - c) ^ 2 + (c - a) ^ 2 + (-(a + b + c)) ^ 2) ^ 2 =
19+
9 * sqrtTwo / 32 * (a ^ 2 + b ^ 2 + c ^ 2) ^ 2 := by
20+
grind
21+
22+
example [Field R] [LinearOrder R] [Ring.IsOrdered R] (x y z : R) (hx : x > 0) (hy : y > 0) (hz : z > 0) (h : x * y * z ≥ 1) :
23+
(x ^ 2 - y * z) / (x ^ 2 + y ^ 2 + z ^ 2) + (y ^ 2 - z * x) / (y ^ 2 + z ^ 2 + x ^ 2) +
24+
(z ^ 2 - x * y) / (z ^ 2 + x ^ 2 + y ^ 2) =
25+
1 / 2 * ((x - y) ^ 2 + (y - z) ^ 2 + (z - x) ^ 2) / (x ^ 2 + y ^ 2 + z ^ 2) := by grind

0 commit comments

Comments
 (0)