transformEquality
Lifts or unlifts an equality expression by transforming both sides using the registered lifting/ unlifting functions. Returns the transformed equality and a proof of equality between the original and transformed expressions.
transformEquality (getLvl : Lean.Expr β Lean.MetaM Lean.Level) (lift_ref : IO.Ref (Array liftMetadata)) (finisher_ref : IO.Ref (Array finisherMetadata)) (eq : Lean.Expr) : Lean.MetaM (Lean.Expr Γ Lean.Expr)transformEquality (getLvl : Lean.Expr β Lean.MetaM Lean.Level) (lift_ref : IO.Ref (Array liftMetadata)) (finisher_ref : IO.Ref (Array finisherMetadata)) (eq : Lean.Expr) : Lean.MetaM (Lean.Expr Γ Lean.Expr)
Code
def transformEquality (getLvl : Expr β MetaM Level) (lift_ref : IO.Ref (Array liftMetadata))
(finisher_ref : IO.Ref (Array finisherMetadata)) (eq : Expr) : MetaM (Expr Γ Expr) := do
let e β whnfR <| β zetaReduce <| β instantiateMVars eq
let e := e.consumeMData
let lvl β getLvl eq
let some (_, lhs, rhs) := e.eq? | throwError "Expected an equality, got: {e}."
let (lhs_transformed, proofs) β transformExpr lhs lvl [] lift_ref
let (rhs_transformed, proofs) β transformExpr rhs lvl proofs lift_ref
let eq_transformed β mkEq lhs_transformed rhs_transformed
let eq_proof_type β mkEq eq eq_transformed
let proof β constructProof
eq_proof_type
lhs rhs
lhs_transformed rhs_transformed
lvl
proofs
finisher_ref
return (eq_transformed, proof)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: 5 project declarations, 122 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.