Lift tactic #
This file defines the lift_eq tactic, which lifts an equality to a common universe level. It
propagates the lifting through the structure of the equality. The tactic is implemented in a way
that it can be easily extended to support new types of expressions by registering new lifting
functions.
Registers a new lifting function for expressions. The function should take an expression, a universe level (most likely the common universe level where the equality is being lifted), and a list of proofs, and return a new expression and an updated list of proofs.
Equations
- registerLiftExpr f = ST.Ref.modify liftImplRef✝ fun (x : Array liftMetadata) => x.push f
Instances For
Registers a new finisher function for constructing the final proof of equality after lifting inner expressions. The function should take the original left-hand side and right-hand side, the transformed left-hand side and right-hand side, the common universe level, and return a proof of equality.
Equations
- registerLiftFinisher f = ST.Ref.modify liftFinisherRef✝ fun (x : Array finisherMetadata) => x.push f
Instances For
Lifts an expression to a common universe level using the registered lifting functions.
Equations
- liftExpr a b c = transformExpr a b c liftImplRef✝
Instances For
Gets the maximum universe level from an equality expression by collecting all universe levels from the left-hand side and right-hand side of the equality.
Equations
- getMaxLvl eq = do let univs ← collectExprUniverses eq computeMaxLevel univs
Instances For
Lifts an equality expression to a common universe level using the registered lifting functions and finisher functions.
Instances For
Same as liftEquality, but allows specifying a universe level that will be taken into account
when computing the maximum universe level.
Equations
- liftEqualityWithLevel Lvl eq = transformEquality (fun (e : Lean.Expr) => do let univs ← collectExprUniverses e computeMaxLevel (Lvl :: univs)) liftImplRef✝ liftFinisherRef✝ eq
Instances For
Transforms an equality expression by lifting both sides to a common universe level.
The tactic supports location specifiers like rw or simp:
lift_eq— applies to the goallift_eq at h— applies to hypothesishlift_eq at h₁ h₂— applies to multiple hypotheseslift_eq at h ⊢— applies to hypothesishand the goallift_eq at *— applies to all hypotheses and the goal
Equations
- One or more equations did not get rendered due to their size.