LeanMachineLearning

constructProofπŸ”—

Definition

Constructs a proof of equality between the original and transformed expressions using the provided proofs and finisher functions.

πŸ”—def
constructProof (eqProofType lhs rhs lhs_t rhs_t : Lean.Expr) (maxLvl : Lean.Level) (proofs : List Lean.Expr) (finisher_ref : IO.Ref (Array finisherMetadata)) : Lean.MetaM Lean.Expr
constructProof (eqProofType lhs rhs lhs_t rhs_t : Lean.Expr) (maxLvl : Lean.Level) (proofs : List Lean.Expr) (finisher_ref : IO.Ref (Array finisherMetadata)) : Lean.MetaM Lean.Expr

Code

def constructProof (eqProofType lhs rhs lhs_t rhs_t : Expr) (maxLvl : Level) (proofs : List Expr) (finisher_ref : IO.Ref (Array finisherMetadata)) : MetaM Expr := do let mvar ← mkFreshExprSyntheticOpaqueMVar eqProofType let mvarId := mvar.mvarId! let propext := mkConst ``propext match ← mvarId.apply propext with | [mvarId] => let proofs := proofs.reverse let mut mvarId := mvarId for proof in proofs do mvarId ← mvarId.nthRewrite 1 proof let handlers ← finisher_ref.get let e ← handlers.firstM (fun h => do let finisher ← h lhs rhs lhs_t rhs_t maxLvl unless ← isDefEq (← mvarId.getType) (← inferType finisher) do throwError "Type mismatch: expected {← mvarId.getType}, got {← inferType finisher}." mvarId.assign finisher instantiateMVars mvar ) <|> do throwError m!"No finisher found for {eqProofType}." return e | _ => throwError "Failed to apply propext while building kernel_lift equivalence proof for {eqProofType}."

Actions: Source Β· Open Issue

Meaning last changed in v4.34.0-rc2-1-g439785b (2026-08-23).

Self-contained, with its dependencies inlined and proofs replaced by sorry: download the raw file Β· open it in the Lean web editor.

Dependency graph

Audit surface: 2 project declarations, 110 external constants

βœ“ Proved: no sorry anywhere in its closure

This is the tool's own reading of one build's recorded axioms, and it is not robust against an author who wants it to pass. Checking meant to be relied on should go through Comparator, which replays the proof through the kernel from an export against an explicit list of permitted axioms.