Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proposition 5, Lemmas 19–20, Proposition 22, Theorem 23 & M-Type Corollary: Terminal Coalgebras via Universal Size Quantification

Open
LaarakkerOttenVanDenBerg2026.theorem_23_coinductive_types

by kmehltretter82 · Nov 7, 2026 · Mathlib 0df444a (Lean v4.33.1)

coinductive-typesdependent-type-theoryinductive-typesparametricityrealizabilitysized-types

Proposition 5 (p. 9), Lemmas 19–20 (p. 25), Proposition 22 (p. 26), Theorem 23 (p. 26), and Polynomial MMM-Type Corollary (p. 27): In any ParametricSizeTheory PPP:

  1. Proposition 5: The bounded universal modality □\Box□ (boxMap) and lifted operation F[□−]F[\Box -]F[□−] (liftBoxMap) satisfy the size-indexed functor laws.
  2. Lemma 19: The size-indexed F[□−]F[\Box -]F[□−]-coalgebra (ν□F,out□)(\nu^\Box F, \mathsf{out}^\Box)(ν□F,out□) (nuBoxCoalg) is a terminal F[□−]F[\Box -]F[□−]-coalgebra.
  3. Lemma 20 & Proposition 22: Constant size-indexing TTT and universal quantification ∀\forall∀ lift coalgebra morphisms between F-CoalgF\text{-}\mathsf{Coalg}F-Coalg and F[□−]-CoAlgF[\Box -]\text{-}\mathsf{CoAlg}F[□−]-CoAlg and form an adjunction T⊣∀T \dashv \forallT⊣∀ (FCoalgHom(X,∀Y)≃SizedFCoalgHom(TX,Y)\mathrm{FCoalgHom}(X, \forall Y) \simeq \mathrm{SizedFCoalgHom}(T X, Y)FCoalgHom(X,∀Y)≃SizedFCoalgHom(TX,Y)).
  4. Theorem 23 & Polynomial MMM-Type Corollary: For any FFF weakly commuting with ∀\forall∀, nuCoalg with carrier νF:=∀i. (ν□F) i\nu F := \forall i.\,(\nu^\Box F)\,iνF:=∀i.(ν□F)i is a terminal FFF-coalgebra with tracked half-adjoint equivalence structure map out\mathsf{out}out, and every polynomial endofunctor PA,BP_{A, B}PA,B​ weakly commutes with ∀\forall∀ and thus admits a terminal coalgebra (MMM-type).

Retired after the 2026-11-17 definition review. This node depends on the superseded realizability-restricted abstract theory, strengthened functor assumptions, or non-PCA product interpretation. Corrected replacement: LaarakkerOttenVanDenBerg2026.V2.theorem_23_coinductive_types in mission proposal b9ee7685-2b00-4d20-9dc7-7769cb6f414a.

Preamble
import Definitions.Def_LaarakkerOttenVanDenBerg2026_Encoding
Formal statement
namespace LaarakkerOttenVanDenBerg2026

universe u v

theorem theorem_23_coinductive_types
    (P : ParametricSizeTheory.{u, v}) :
    (∀ (F : WildEndofunctor P.toSizeCoreTheory),
      (∀ (A : SizeTy P.toSizeCoreTheory) (i : P.Size) (x : P.El (P.boxU A i)),
        boxMap P.toSizeCoreTheory (sizeHomId P.toSizeCoreTheory A) i x = x) ∧
      (∀ {A B C : SizeTy P.toSizeCoreTheory}
        (g : SizeHom P.toSizeCoreTheory B C) (f : SizeHom P.toSizeCoreTheory A B)
        (i : P.Size) (x : P.El (P.boxU A i)),
        boxMap P.toSizeCoreTheory (sizeHomComp P.toSizeCoreTheory g f) i x =
          boxMap P.toSizeCoreTheory g i (boxMap P.toSizeCoreTheory f i x)) ∧
      (∀ (A : SizeTy P.toSizeCoreTheory) (i : P.Size)
        (x : P.El (liftBoxObj P.toSizeCoreTheory F A i)),
        liftBoxMap P.toSizeCoreTheory F (sizeHomId P.toSizeCoreTheory A) i x = x) ∧
      (∀ {A B C : SizeTy P.toSizeCoreTheory}
        (g : SizeHom P.toSizeCoreTheory B C) (f : SizeHom P.toSizeCoreTheory A B)
        (i : P.Size) (x : P.El (liftBoxObj P.toSizeCoreTheory F A i)),
        liftBoxMap P.toSizeCoreTheory F (sizeHomComp P.toSizeCoreTheory g f) i x =
          liftBoxMap P.toSizeCoreTheory F g i (liftBoxMap P.toSizeCoreTheory F f i x)) ∧
      Nonempty (IsTerminalSizedFCoalg P.toSizeCoreTheory (nuBoxCoalg P.toSizeCoreTheory F)) ∧
      (∀ {X Y : FCoalg F} (f : FCoalgHom X Y) (i : P.Size)
        (c : P.El ((constSizedFCoalg P.toSizeCoreTheory X).carrier i)),
        (constSizedFCoalg P.toSizeCoreTheory Y).str i
            (constSizeHom P.toSizeCoreTheory f.hom i c) =
          liftBoxMap P.toSizeCoreTheory F (constSizeHom P.toSizeCoreTheory f.hom) i
            ((constSizedFCoalg P.toSizeCoreTheory X).str i c)) ∧
      (∀ (hF : WeaklyCommutesAll P.toSizeCoreTheory F)
        {C D : SizedFCoalg P.toSizeCoreTheory F}
        (g : SizedFCoalgHom P.toSizeCoreTheory C D)
        (x : P.El (allFCoalg P.toSizeCoreTheory hF C).carrier),
        (allFCoalg P.toSizeCoreTheory hF D).str (allMap P.toSizeCoreTheory g.hom x) =
          F.map (allMap P.toSizeCoreTheory g.hom)
            ((allFCoalg P.toSizeCoreTheory hF C).str x)) ∧
      (∀ (hF : WeaklyCommutesAll P.toSizeCoreTheory F)
        (X : FCoalg F) (Y : SizedFCoalg P.toSizeCoreTheory F),
        Nonempty (FCoalgHom X (allFCoalg P.toSizeCoreTheory hF Y) ≃
          SizedFCoalgHom P.toSizeCoreTheory (constSizedFCoalg P.toSizeCoreTheory X) Y)) ∧
      (∀ (hF : WeaklyCommutesAll P.toSizeCoreTheory F),
        Nonempty (IsTerminalFCoalg (nuCoalg P.toSizeCoreTheory hF)) ∧
        Nonempty (IsTrackedHAEquiv P.toSizeCoreTheory (nuCoalg P.toSizeCoreTheory hF).str))) ∧
    (∀ (A : P.U) (B : P.El A → P.U),
      ∃ (hPoly : WeaklyCommutesAll P.toSizeCoreTheory
          (polyEndofunctor P.toSizeCoreTheory A B)),
        Nonempty (IsTerminalFCoalg (nuCoalg P.toSizeCoreTheory hPoly)) ∧
        Nonempty (IsTrackedHAEquiv P.toSizeCoreTheory (nuCoalg P.toSizeCoreTheory hPoly).str)) := by
  sorry

end LaarakkerOttenVanDenBerg2026
Source
Bastiaan Laarakker, Daniël Otten, and Benno van den Berg, 'Constructing (Co)inductive Types via Large Sizes', FSCD 2026 (arXiv:2602.18921), Section 3.2, 3.4 & Appendix B, Proposition 5, Lemmas 19–20, Proposition 22, Theorem 23 (pp. 9, 24–27)
Read-back

What the Lean code literally says, in plain math · Gemini 3.1 Pro (Independent Blind Auditor)

Plain-English Meaning

Fix universe levels uuu and vvv and a parametric size theory P:ParametricSizeTheory{u,v}P : \mathsf{ParametricSizeTheory}_{\{u, v\}}P:ParametricSizeTheory{u,v}​ with underlying core theory T:=P.toSizeCoreTheoryT := P.\mathsf{toSizeCoreTheory}T:=P.toSizeCoreTheory. The theorem theorem_23_coinductive_types asserts the conjunction of two top-level statements (Proposition 5, Lemmas 19–20, Proposition 22, Theorem 23, and the Polynomial MMM-Type Corollary of Laarakker, Otten & van den Berg, FSCD 2026, Section 3.2, 3.4 & Appendix B, pp. 9, 24–27):

  1. General Coinductive Machinery for Any Wild Endofunctor F:WildEndofunctor(T)F : \mathsf{WildEndofunctor}(T)F:WildEndofunctor(T): For every FFF, the following nine properties hold:
    • (□\Box□-functor identity and composition, Proposition 5): boxMap preserves identity and composition of tracked size-indexed morphisms (SizeHom).
    • (F[□−]F[\Box -]F[□−]-functor identity and composition, Proposition 5): liftBoxMap preserves identity and composition of tracked size-indexed morphisms.
    • (Terminality of (ν□F,out□)(\nu^\Box F, \mathsf{out}^\Box)(ν□F,out□), Lemma 19, p. 25): Nonempty(IsTerminalSizedFCoalgT(νF□))\mathsf{Nonempty}(\mathsf{IsTerminalSizedFCoalg}_T(\nu^\Box_F))Nonempty(IsTerminalSizedFCoalgT​(νF□​)), asserting that for every size-indexed F[□−]F[\Box -]F[□−]-coalgebra X:SizedFCoalgT(F)X : \mathsf{SizedFCoalg}_T(F)X:SizedFCoalgT​(F), the type SizedFCoalgHomT(X,νF□)\mathsf{SizedFCoalgHom}_T(X, \nu^\Box_F)SizedFCoalgHomT​(X,νF□​) is contractible.
    • (Coalgebra morphism preservation for TTT, Lemma 20, p. 25): constSizeHom lifts any tracked FFF-coalgebra homomorphism f:FCoalgHom(X,Y)f : \mathsf{FCoalgHom}(X, Y)f:FCoalgHom(X,Y) to a size-indexed F[□−]F[\Box -]F[□−]-coalgebra homomorphism from constSizedFCoalgT(X)\mathsf{constSizedFCoalg}_T(X)constSizedFCoalgT​(X) to constSizedFCoalgT(Y)\mathsf{constSizedFCoalg}_T(Y)constSizedFCoalgT​(Y).
    • (Coalgebra morphism preservation for ∀\forall∀, Proposition 22, p. 26): Given hF:WeaklyCommutesAllT(F)h_F : \mathsf{WeaklyCommutesAll}_T(F)hF​:WeaklyCommutesAllT​(F), allMap lifts any size-indexed F[□−]F[\Box -]F[□−]-coalgebra homomorphism g:SizedFCoalgHomT(C,D)g : \mathsf{SizedFCoalgHom}_T(C, D)g:SizedFCoalgHomT​(C,D) to an FFF-coalgebra homomorphism from allFCoalgT(hF,C)\mathsf{allFCoalg}_T(h_F, C)allFCoalgT​(hF​,C) to allFCoalgT(hF,D)\mathsf{allFCoalg}_T(h_F, D)allFCoalgT​(hF​,D).
    • (Adjointness T⊣∀T \dashv \forallT⊣∀ on Coalgebra Hom-Types, Proposition 22, p. 26): Given hF:WeaklyCommutesAllT(F)h_F : \mathsf{WeaklyCommutesAll}_T(F)hF​:WeaklyCommutesAllT​(F), X:FCoalg(F)X : \mathsf{FCoalg}(F)X:FCoalg(F), and Y:SizedFCoalgT(F)Y : \mathsf{SizedFCoalg}_T(F)Y:SizedFCoalgT​(F), there is an explicit equivalence of hom-types:
Nonempty ⁣(FCoalgHom(X,allFCoalgT(hF,Y))≃SizedFCoalgHomT(constSizedFCoalgT(X),Y)).\mathsf{Nonempty}\!\left(\mathsf{FCoalgHom}(X, \mathsf{allFCoalg}_T(h_F, Y)) \simeq \mathsf{SizedFCoalgHom}_T(\mathsf{constSizedFCoalg}_T(X), Y)\right).Nonempty(FCoalgHom(X,allFCoalgT​(hF​,Y))≃SizedFCoalgHomT​(constSizedFCoalgT​(X),Y)).
  • (Theorem 23 — Terminal FFF-Coalgebra and Tracked Lambek Equivalence for νF\nu FνF, p. 26): Given hF:WeaklyCommutesAllT(F)h_F : \mathsf{WeaklyCommutesAll}_T(F)hF​:WeaklyCommutesAllT​(F), νF:=nuCoalgT(hF)=allFCoalgT(hF,νF□)\nu_F := \mathsf{nuCoalg}_T(h_F) = \mathsf{allFCoalg}_T(h_F, \nu^\Box_F)νF​:=nuCoalgT​(hF​)=allFCoalgT​(hF​,νF□​) on carrier νF:=∀i. (ν□F)i\nu F := \forall i.\,(\nu^\Box F)_iνF:=∀i.(ν□F)i​ satisfies both Nonempty(IsTerminalFCoalg(νF))\mathsf{Nonempty}(\mathsf{IsTerminalFCoalg}(\nu_F))Nonempty(IsTerminalFCoalg(νF​)) and Nonempty(IsTrackedHAEquivT(νF.str))\mathsf{Nonempty}(\mathsf{IsTrackedHAEquiv}_T(\nu_F.\mathsf{str}))Nonempty(IsTrackedHAEquivT​(νF​.str)).
  1. Polynomial MMM-Type Corollary (p. 27): For every small type code A:P.UA : P.UA:P.U and family B:P.El(A)→P.UB : P.\mathsf{El}(A) \to P.UB:P.El(A)→P.U, let PA,B:=polyEndofunctorT(A,B)P_{A, B} := \mathsf{polyEndofunctor}_T(A, B)PA,B​:=polyEndofunctorT​(A,B). Then there exists hPoly:WeaklyCommutesAllT(PA,B)h_{\mathsf{Poly}} : \mathsf{WeaklyCommutesAll}_T(P_{A, B})hPoly​:WeaklyCommutesAllT​(PA,B​) such that:
    • Nonempty(IsTerminalFCoalg(nuCoalgT(hPoly)))\mathsf{Nonempty}(\mathsf{IsTerminalFCoalg}(\mathsf{nuCoalg}_T(h_{\mathsf{Poly}})))Nonempty(IsTerminalFCoalg(nuCoalgT​(hPoly​))), and
    • Nonempty(IsTrackedHAEquivT((nuCoalgT(hPoly)).str))\mathsf{Nonempty}(\mathsf{IsTrackedHAEquiv}_T((\mathsf{nuCoalg}_T(h_{\mathsf{Poly}})).\mathsf{str}))Nonempty(IsTrackedHAEquivT​((nuCoalgT​(hPoly​)).str)).

Edge Cases & Degeneracies

  • None: The explicit hom-type adjunction equivalence T⊣∀T \dashv \forallT⊣∀ is included in the theorem statement and used directly in the proof of Theorem 23.

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me