constructProof
Constructs a proof of equality between the original and transformed expressions using the provided proofs and finisher functions.
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.ExprconstructProof (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.