Theorem 23 and preceding lemmas: Canonical coinductive encodings
OpenLaarakkerOttenVanDenBerg2026.V2.theorem_23_coinductive_typesThe dual sized infrastructure uses the prescribed bounded-universal modality, its underlying morphism laws, and the recursively constructed internally terminal sized coalgebra. Constant size-indexing and universal quantification lift full coalgebra morphisms with their prescribed underlying actions. For every wild functor weakly commuting with the universal quantifier, the specified coalgebra on is internally terminal and its structure map is an internal half-adjoint equivalence. All small polynomial signatures supply the required functor and weak-commutation witnesses, including infinitely branching signatures. The lifting laws concern underlying arrows and do not impose unspecified higher coherence on square witnesses.
import Definitions.Def_LaarakkerOttenVanDenBerg2026_EncodingRevision2
namespace LaarakkerOttenVanDenBerg2026.V2
universe u v w t
open Theory
theorem theorem_23_coinductive_types {C : CwF.{u,v,w,t}} (T : ParametricTheory C) :
T.toCoreTheory.CoinductiveInfrastructure ∧
(∀ (Γ : C.Ctx) (D : WildEndofunctor T.univ T.functions T.identities Γ)
(h : T.toCoreTheory.WeaklyCommutesAll D),
T.toCoreTheory.CoinductiveEncoding D h) ∧
T.toCoreTheory.PolynomialCoinductiveEncodings := by
sorry
end LaarakkerOttenVanDenBerg2026.V2Read-back
What the Lean code literally says, in plain math · Codex / GPT-6 (independent fresh-context read-back)
At arbitrary universe levels , let be a category with families whose contexts, substitutions, contextual types, and contextual terms lie respectively in those universes, with a terminal empty context, context extension, and the stated identity, composition, substitution, and comprehension equations. A core package on supplies contextual dependent products and sums with their introduction, elimination/projection, and computation rules; nondependent arrows compatible with the corresponding dependent products; internal identity types with reflexivity and based identity elimination and its computation rule; a Tarski universe with decoding, closed under small dependent products, sums, and identities; small empty, unit, and Boolean types with their constructors and dependent eliminators; and the indicated substitution equations for all these operations and witnesses. It also supplies a large type of sizes with zero, successor, a small relation , witnesses of , , reflexivity and transitivity, and internal equality of any two witnesses of the same comparison. Write for the decoded type , without assuming any additional external order properties. The core includes a contextual size recursor for every possibly large family and step , with an internal pointwise unfolding witness and substitution laws for the recursor and that witness. It includes primitive small size quantifiers and : has contextual abstraction/application and both computation equations, while has pairing and dependent elimination into small motives with its computation equation, together with their stated substitution laws. Finally the identity-elimination-defined map from equality of dependent functions to pointwise equality has a substitution-stable internal half-adjoint-equivalence witness. All products, sums, arrows, and identities in what follows are these internal types; small types are decoded contextual universe codes, not arbitrary metatheoretic sets, and contextual terms are not identified with all external functions. For an internal arrow , a half-adjoint-equivalence witness consists internally of , , , and , with derived by identity elimination. An equivalence between two types additionally includes its forward arrow. Write ; this contracts the whole type , including any witness components. Existence of a contextual term of one of these types is an external nonemptiness assertion, not an identification of internal identities with external equality. A parametric package means such a core package together with substitution-stable internal half-adjoint-equivalence witnesses for four prescribed maps, at every context and every indicated small family: , sending a common bound and bounded witnesses to their unbounded witnesses; , sending to the family ; , forgetting the outer size and comparison witness; and , restricting a family. Here in the first two schemas may depend on the ambient context but not on the newly introduced size, and may depend on both and that size. A wild endofunctor at a context means an operation on small codes and internal arrows in every context over by a substitution , commuting with further substitution, together with internal identities and in their generic code/arrow contexts; no higher coherence is a field. For a small size family , put and . A sized arrow is a contextual term of , with pointwise identity and composition; the modal arrow actions preserve the size and comparison witness and apply the given arrow to the -component, or postcompose the bounded function, respectively. A universal weak-commutation witness is one contextual term of the internal product over of the half-adjoint-equivalence type of the prescribed map , sending to the family , where restricts to . Thus the family quantification and all inverses, homotopies, and coherence of this hypothesis are internal. The prescribed family is the output of the chosen primitive size recursor on universe codes with step , where the recursive input is and may depend on the comparison witness. Its actual unfolding witness gives an internal universe path . The prescribed sized structure is transport along that path, formed by identity elimination. For every supplied parametric package , the header asserts the conjunction of the infrastructure stated next, the prescribed coinductive conclusion for every context , wild endofunctor , and universal weak-commutation term , and the polynomial clause below. The infrastructure conclusion is the following sixfold conjunction. First, for every context and every small size family, the prescribed arrow action has an internal identity witnessing preservation of identity, and for every three such families and externally supplied composable sized arrows , an internal identity witnessing preservation of . Second, for every context and wild endofunctor , the pointwise composite has those same witnesses, and the specified sized coalgebra has an internal terminality term ; the square is an identity of sized arrows. Third, the prescribed constant-family action has an internal identity law for every small carrier and an internal composition law for every triple of small carriers, in every context. Fourth, for all contexts , wild at , substitutions , and ordinary coalgebras over , there is an internal function from their complete coalgebra-morphism type to that between the prescribed constant sized coalgebras, with an internal pointwise identity identifying its underlying arrow with . An ordinary coalgebra has and complete morphism type ; its constant sized coalgebra has structure , where is the constant function. A sized-coalgebra morphism is a sized arrow with square . Fifth, the prescribed universal arrow action sends a family to and has an internal identity law for every size family and internally quantified composition law for every triple of size families. Sixth, for all , every universal weak-commutation term for reindexed along , and all sized coalgebras over , there is an internal function from their complete morphism type to that between their prescribed universally quantified coalgebras, with an internal pointwise identity identifying its underlying-arrow action with . The quantified coalgebra on has carrier and structure using the supplied witness. Each lift type is exactly and retains both square witnesses. The clauses assert underlying-arrow identity/composition and existence of full morphism lifts; they do not assert identity/composition for a chosen lift on square witnesses, a hom-type equivalence, a natural adjunction, or substitution coherence of selected output witnesses. For the specified , set and , using exactly the inverse extracted from . The asserted coinductive conclusion is the conjunction of existence of a term of and existence of an internal half-adjoint-equivalence witness for this particular . Carrier and structure-map quantification in terminality is internal, and the contractible morphism type includes the commuting-square path. The polynomial clause quantifies externally over every context , every small code in , and every small code in . It asserts existence of a wild endofunctor whose entire object/morphism data is externally equal to the prescribed polynomial data , with arrow action and its specified substitution operations, and existence of a universal weak-commutation term for that functor for which the preceding prescribed coinductive conclusion holds. Functor-law witnesses and are existential outputs, not additional hypotheses on the signature. There is no extra finiteness, nonemptiness, monotonicity, decidability, external well-foundedness, or consistency hypothesis on the abstract model or small families; empty signatures and empty or infinite small branching types are included whenever represented by its universe. Assertions quantified over a supplied package are conditional on such a package, and implications quantified over a weak-commutation term impose no conclusion for a functor with no such term. Internal quantifiers range over all internal values, including values available only in extended contexts. This is a readback of the asserted header; its proof body is a placeholder, so no proof is certified here.