constructUnitors
Construct the left or right unitor morphism.
constructUnitors (X ex₀ : Lean.Expr) (xLvl y₀Lvl punitLvl : Lean.Level) (offset : ℕ) : Lean.MetaM (Lean.Expr × Lean.Expr)constructUnitors (X ex₀ : Lean.Expr) (xLvl y₀Lvl punitLvl : Lean.Level) (offset : ℕ) : Lean.MetaM (Lean.Expr × Lean.Expr)
Code
def constructUnitors (X ex₀ : Expr) (xLvl y₀Lvl punitLvl : Level) (offset : Nat) :
MetaM (Expr × Expr) := do
let left ← if offset == 0 then pure true
else if offset == 1 then pure false
else throwError "Invalid offset for unitors."
let SX ← computeSFinkerOf X xLvl
let unitor ← if left then mkAppM ``leftUnitor #[SX]
else mkAppM ``rightUnitor #[SX]
let unitor_hom_const :=
if left then mkConst ``leftUnitor_hom [xLvl, y₀Lvl, xLvl, punitLvl]
else mkConst ``rightUnitor_hom [xLvl, y₀Lvl, xLvl, punitLvl]
let unitor_hom_proof ←
if left then mkAppM' unitor_hom_const #[SX, ← idME X, ex₀]
else mkAppM' unitor_hom_const #[SX, ← idME X, ex₀]
return (← mkAppM ``Iso.hom #[unitor], unitor_hom_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: 3 project declarations, 96 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.