constructWhiskersArgs
Construct the relevant data for converting a kernel expression to its whisker morphism representation.
constructWhiskersArgs (e X Y : Lean.Expr) (left : Bool) : Lean.MetaM (Lean.Expr × Lean.Expr × Lean.Expr × Lean.Expr × Lean.Expr × Lean.Expr × Lean.Expr)constructWhiskersArgs (e X Y : Lean.Expr) (left : Bool) : Lean.MetaM (Lean.Expr × Lean.Expr × Lean.Expr × Lean.Expr × Lean.Expr × Lean.Expr × Lean.Expr)
Code
def constructWhiskersArgs (e X Y : Expr) (left : Bool) :
MetaM (Expr × Expr × Expr × Expr × Expr × Expr × Expr) := do
let (Z, zLvl, X, xLvl) ← match X.getAppFn with
| Expr.const ``Prod univs =>
let args := X.getAppArgs
pure (args[left.toNat]!, univs[left.toNat]!, args[1 - left.toNat]!, univs[1 - left.toNat]!)
| _ =>
if left then throwError "Expected left whisker with source Z × X, got: {X}."
else throwError "Expected right whisker with source X × Z, got: {X}."
let (Y, yLvl) ← match Y.getAppFn with
| Expr.const ``Prod univs =>
let args := Y.getAppArgs
pure (args[1 - left.toNat]!, univs[1 - left.toNat]!)
| _ =>
if left then throwError "Expected left whisker with target Z × Y, got: {Y}."
else throwError "Expected right whisker with target Y × Z, got: {Y}."
let κ ← match e.getAppFn with
| Expr.const ``Kernel.parallelComp _ =>
let args := e.getAppArgs
pure args[args.size - (left.toNat + 1)]!
| _ =>
if left then throwError "Expected left whisker with parallelComp, got: {e}."
else throwError "Expected right whisker with parallelComp, got: {e}."
let SZ ← computeSFinkerOf Z zLvl
let SX ← computeSFinkerOf X xLvl
let SY ← computeSFinkerOf Y yLvl
return (SZ, Z, SX, X, SY, Y, κ)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, 116 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.