Skip to content

Commit 655fc81

Browse files
committed
feat: construct proof for diseq split
1 parent 56fe961 commit 655fc81

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Lean.Meta.Tactic.Grind.Arith.Util
88
import Lean.Meta.Tactic.Grind.Arith.CommRing.Proof
99
import Lean.Meta.Tactic.Grind.Arith.Linear.Util
1010
import Lean.Meta.Tactic.Grind.Arith.Linear.ToExpr
11+
import Lean.Meta.Tactic.Grind.Arith.Linear.DenoteExpr
1112

1213
namespace Lean.Meta.Grind.Arith.Linear
1314

@@ -214,6 +215,13 @@ partial def IneqCnstr.toExprProof (c' : IneqCnstr) : ProofM Expr := caching c' d
214215
let h' := mkApp5 h' (← mkRingExprDecl la) (← mkRingExprDecl lb) (← mkRingPolyDecl p') reflBoolTrue (← mkEqProof a b)
215216
let h ← mkIntModPreOrdThmPrefix ``Grind.Linarith.le_of_eq
216217
return mkApp5 h (← mkExprDecl lhs') (← mkExprDecl .zero) (← mkPolyDecl c'.p) reflBoolTrue h'
218+
| .dec h => return mkFVar h
219+
| .ofDiseqSplit c₁ fvarId h _ =>
220+
let hFalse ← h.toExprProofCore
221+
let lt := (← getStruct).ltFn
222+
let hNot := mkLambda `h .default (mkApp2 lt (← c₁.p.denoteExpr) (← getZero)) (hFalse.abstract #[mkFVar fvarId])
223+
let h ← mkIntModLinOrdThmPrefix ``Grind.Linarith.diseq_split_resolve
224+
return mkApp5 h (← mkPolyDecl c₁.p) (← mkPolyDecl c'.p) reflBoolTrue (← c₁.toExprProof) hNot
217225
| _ => throwError "NIY"
218226

219227
partial def DiseqCnstr.toExprProof (c' : DiseqCnstr) : ProofM Expr := caching c' do

0 commit comments

Comments
 (0)