Skip to content

Commit a3a9f2a

Browse files
leodemourakim-em
authored andcommitted
fix: proof construction in grind ring (#11273)
This PR fixes a bug during proof construction in `grind`.
1 parent c4b424c commit a3a9f2a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/Lean/Meta/Tactic/Grind/Arith/CommRing/Proof.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ private structure NormResult where
383383
vars : Array Expr
384384

385385
private def norm (vars : PArray Expr) (lhs rhs lhs' rhs' : RingExpr) : NormResult :=
386-
let usedVars := lhs.collectVars >> lhs.collectVars >> lhs'.collectVars >> rhs'.collectVars <| {}
386+
let usedVars := lhs.collectVars >> rhs.collectVars >> lhs'.collectVars >> rhs'.collectVars <| {}
387387
let vars' := usedVars.toArray
388388
let varRename := mkVarRename vars'
389389
let vars := vars'.map fun x => vars[x]!
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
example [LE α] [LT α] [Std.IsLinearOrder α] [Std.LawfulOrderLT α] [Lean.Grind.CommRing α] [DecidableLE α] [Lean.Grind.OrderedRing α] (a b c : α) :
2+
(if a - b ≤ -(a - b) then -(a - b) else a - b) ≤
3+
((if a - c ≤ -(a - c) then -(a - c) else a - c) + if c - d ≤ -(c - d) then -(c - d) else c - d) +
4+
if b - d ≤ -(b - d) then -(b - d) else b - d := by
5+
split <;> split <;> split <;> split <;> grind

0 commit comments

Comments
 (0)