The dependent-pair (Σ) parametricity rule #
The container rules of ParamData.lean (×, Option, List) lift a relation
through non-dependent type formers. This file adds the dependent pair
Σ a, B a: the type of the second component depends on the value of the first.
It is the dependent generalization of the product × combinator, and the
value-level companion of the dependent-Π rule in ParamForall.lean.
A dependent pair is related when the bases are related by PA and, at the
induced witness, the fibers are related by the family PB — exactly the shape
of the heterogeneous congruence hcongr_hetero (Congruence/HCongrConnection):
the second projection of a related pair is a heterogeneous-congruence instance.
The AdapTT functor law #
AdapTT (Adjedj–Lennon-Bertrand–Benjamin–Maillard, POPL 2026) makes type-cast
adapters functorial over type formers: Adapt (F X) = F (Adapt X). For the
dependent pair that law is sigma_cast_eq below — the Σ-cast is the pair of the
base cast and the fiber cast. In AdapTT it holds definitionally (a cast
calculus); here the forward map is built as that pair, so the law is rfl.
Unlike the non-dependent × (ParamData), the Σ-cast's second component depends
on the witness produced by casting the first — so it needs the base relation at
forward level map2a (a map whose graph is included in R, giving the witness),
which is the univalence-free level. No map4/univalence is used: this is the
value-level dependent former, below the universe.
Two dependent pairs are related when their bases are PA-related (by some
witness aR) and, at that witness, their fibers are (PB … aR)-related. The
fiber relation is a family indexed by the base witness — the dependent
analogue of the product relation R_prod. Only R fields are touched, so the
base levels stay polymorphic.
Equations
Instances For
The univalence-free forward map #
Cast the base with PA.fwd.map, take the witness its graph provides
(PA.fwd.map_in_R … rfl), and cast the fiber with the family's forward map at
that witness. Needs the base forward at map2a (map + map_in_R) and the fiber
forward at map2a (a map). No map4/univalence.
Equations
Instances For
Param-level assembly at (map1, map0) #
The dependent-pair Param: forward structure map1 (via Map1_sigma),
backward structure map0. This is the level the univalence-free forward map
supports — the value-level dependent former, mirroring paramForall on the
Π side.
Equations
- Transfer.Param.paramSigma PA PB = { R := Transfer.Param.R_sigma PA PB, fwd := Transfer.Param.Map1_sigma PA PB, bwd := { } }
Instances For
The AdapTT functor law (cast form): Adapt (Σ) = Σ (Adapt) #
Functoriality of the dependent pair over the adapters. The Σ-cast is the
pair of the base cast and the fiber cast: casting ⟨a, b⟩ yields
⟨cast a, cast b⟩ with the fiber cast taken at the witness the base cast
induces. This is AdapTT's Adapt (Σ F) = Σ (Adapt F) in cast form — here rfl,
because Map1_sigma is built as exactly that pair (in AdapTT it is a
definitional cast-reduction rule). Univalence-free.
Demo: a dependent cast (Σ n, Fin (n+1) → Σ n, ℕ) #
The fiber type Fin (n+1) depends on the base n, and the two sides' fibers are
different types (Fin (n+1) vs ℕ), bridged by Fin.val. The Σ-cast carries
the base unchanged and the fiber through Fin.val.
Fiber family Fin (a+1) ↦ Nat at map2a, forward map Fin.val.
Equations
Instances For
Composition (AdapTT AdaptComp for Σ) #
Two Σ-transfers compose through the generic Param_trans machinery — no bespoke
Σ-composition rule is needed. The composite Σ-cast is the composition of the two
Σ-casts, so AdaptComp holds for the dependent pair as it does for →/×.
Compose two dependent-pair transfers at (map1, map0) — the generic relation
composition specialized to the level paramSigma produces.
Equations
- Transfer.Param.paramSigmaTrans S₁ S₂ = { R := Transfer.Param.R_trans S₁ S₂, fwd := Transfer.Param.Map1_trans S₁ S₂, bwd := { } }
Instances For
AdapTT AdaptComp for Σ. Casting through the composite of two dependent
pairs equals casting through each in turn — the Σ-cast composes. rfl, because
Map1_trans's forward map is the composition of the two forward maps.
Why composition goes through the maps, not a composed fiber family #
The non-dependent product has a relational functor law
ParamCoherence.prod_trans_rel: the composite relation equals the composite of the
relations. Its dependent analogue would ask for a composed fiber family
∀ a c, (R_trans PA QA).R a c → Param .map2a .map0 (BA a) (BC c) — a Type-valued
Param produced from the base's composed relation. But that relation is the
existential glue ∃ b, PA.R a b ∧ QA.R b c, a Prop, and producing a Type from
it is large elimination of Exists, which Lean forbids. So the dependent
composition cannot be phrased as a composed fiber family over the glued
base relation — it must compose the Params (which carry the fibers as data), as
paramSigmaTrans does. This is a shadow of the same Prop/Type boundary that
caps the universe fiber (map4) by UnivalenceStatus.univalence_inconsistent.