Part V

Category Theory and Homotopy Type Theory: Composition and Identity

math.CT · 24 pages

Abstract

This is Part V of a seven-part modular series that formalizes each mathematical domain as a physical-representation module. Parts I–IV built a representation stack: mathematical structures are sent by an abstraction map to abstract physical-information objects, realized by a channel into physical representations, and read off by an observation map , giving the master pipeline . Those modules used functoriality (topological quantum field theory as a functor ; realization channels as translations between worlds) without isolating the grammar that makes such translation coherent. The present module supplies that grammar. We treat category theory as the theory of composition and identity: the associativity and unit laws that let physical processes be chained, and functors and natural transformations as the structure-preserving translations and their uniform deformations. We then treat homotopy type theory (HoTT) as the theory of identity proper: identity types as paths, path induction as the sole generator of transport, and Voevodsky’s univalence axiom as the principle that equivalent representations are identified rather than merely related. Four theorems anchor the module. (T1) Univalence turns Part I’s Axiom (Equivalence) from a postulate into a theorem for every internally definable realization. (T2) The Curry–Howard–Lambek correspondence exhibits a single composite functor interpreting logic, code, and physical representation at once. (T3) In a dagger-compact category the existence of uniform natural copying forces cartesianness, giving a structural no-cloning theorem that explains why Part VI’s quantum high-availability encodings must be genuine embeddings rather than replications. (T4) The groupoid (higher) quotient is strictly finer than the set quotient , reconstructing the “stacks retain gauge information” phenomenon inside the truncation hierarchy of HoTT and setting up Part VI’s stacks. Throughout we preserve the S/H/P epistemic status discipline of the series, provide runnable Haskell encodings of the category/functor/composition structures, and sketch an idiomatic Lean formalization. Category theory and HoTT are thus the compositional glue of the whole library: they are the module in which the laws of composition and identity that bind Parts I–VI are made explicit.

1 Introduction

1.1 Where this module sits

The series A MathPhysics Representation Library formalizes the thesis that many physical quantities are not merely described by mathematics but are obtained as realizations of structured mathematical information. The organizing device is a representation stack together with a realization pipeline

(1)
compressed into the universal formula
(2)
Each entry of the library carries an epistemic status label : S (standard mathematics or mathematical physics), H (strong heuristic dictionary entry), P (speculative ontological extension); composite labels and denote entries that are standard as mathematics but heuristic or speculative in their physical reading. This labelling is part of the formalism, not decoration, and we apply it verbatim throughout.

The modular ladder is Part IV exhibited one rigorous instance of “physics as a functor”: a topological quantum field theory (TQFT) is a symmetric monoidal functor [10, 6]. But Part IV used the word “functor” without developing the general theory of functors, and it used “equivalent realizations describe the same physics” without a formal notion of identity of structures. Part V is exactly the abstraction step that provides both:

category theory is the grammar of physical composition;
HoTT is the logic of spaces, paths, equivalences, and higher identity.

Because every realization channel , every duality, and every symmetry of Parts I–IV is a morphism, functor, or equivalence, Part V is the compositional glue of the whole library: it is where the laws of composition and identity that bind Parts I–VI are isolated and proved. It also sets up Part VI, whose stacks are groupoid-valued sheaves built from the categorical and truncation machinery introduced here.

1.2 Contributions

  1. A categorical recasting of the realization pipeline (2). We show that (1) is literally a composite of functors between the groupoids of a representation prestack, so that the associativity and unit laws of the library are the associativity and unit laws of a category (4). This turns Part I’s informal “composition of compatible translations” into a theorem.

  2. The composition/identity core (3, 4). We give precise definitions of categories, functors, natural transformations, functor categories, and monoidal and dagger-compact structure, with the interchange law and an Eckmann–Hilton argument (13) that already exhibits the interaction of two compositions with a shared identity—the thematic centre of the module.

  3. Univalence discharges the Equivalence axiom (27, T1). We prove that any internally definable realization respects equivalence of structures, so Part I’s Axiom (Equivalence) becomes a theorem in a univalent model.

  4. A single functor for logic, code, and physics (29, T2). The Curry–Howard–Lambek correspondence yields a composite functor interpreting the three-way dictionary (proof program physical realization) as one categorical translation.

  5. A structural no-cloning theorem (31, T3). In a dagger-compact category, uniform natural copying forces the monoidal product to be a categorical product; since the tensor product of finite-dimensional Hilbert spaces is not a product, quantum high availability (Part VI) is representationally forced to be encoding, not replication.

  6. Groupoid quotients are finer than set quotients (33, T4). We reconstruct “stacks retain gauge information” purely inside the HoTT truncation hierarchy: is a -type retaining stabilizer loops, while is its -truncation, forgetting them.

  7. Formal artifacts. A runnable Haskell package encoding categories, functors, natural transformations, dagger-compact structure, and groupoid-vs-set quotients (8), and an idiomatic Lean sketch of the category/functor/identity-law types (9).

1.3 Epistemic status and limitations

We reproduce the series-wide limitations in the form relevant to this module. Category theory and HoTT are status S mathematics; their status becomes or only when we read a specific categorical or type-theoretic construction as a claim about physics. In particular: (i) we do not claim a single universal functor —the representation approach is deliberately domain-indexed (2); (ii) reading a type as a “space of physical possibilities” is a heuristic semantic layer (status ), flagged as such; (iii) univalence is a theorem-generating principle about mathematical structures, and its physical reading (“equivalent representations are the same physical content”) is . These flags are carried explicitly in the dictionary of 7 and 12.

1.4 Outline

2 recalls the representation-stack framework and casts the pipeline categorically. 3 develops categories, functors, natural transformations, and the interchange/Eckmann–Hilton phenomena. 4 develops monoidal, symmetric, compact-closed and dagger-compact structure and string diagrams. 5 develops HoTT: identity types, path induction, transport, equivalence, and univalence. 6 proves the four theorems T1–T4. 7 presents the category-theory/HoTT representation dictionary with S/H/P labels. 8, 9 give the Haskell and Lean formalizations. 10 discusses composition in the ladder and limitations; 11 concludes. 12 contains the full dictionary longtables.

2 Mathematical framework: the representation stack, categorically

We recall the minimum from Part I and immediately reorganize it so that the categorical language of 3 applies.

Definition 1 (Representation entry, Part I). A representation entry is a quadruple where is a mathematical structure in a domain , is a proposed physical representation, is a semantic translation datum (a functor, a natural transformation, an equivalence class of models, or a weaker interpretation map), and is the epistemic status label.

Definition 2 (Representation prestack, Part I). A representation prestack is a pseudofunctor assigning to each domain a groupoid of representation entries, and to a domain refinement a restriction functor , functorial up to coherent natural isomorphism.

The words “groupoid”, “functor”, “natural isomorphism”, and “pseudofunctor” in 2 are precisely the notions 3 makes rigorous; Part I used them on trust. We keep the realization pipeline (1) but now name its stages as morphisms in categories.

Definition 3 (Realization data). Fix a domain . A realization datum of level consists of: an abstraction functor into a category of abstract physical-information objects; a realization functor ; and an observation functor into a category of measurement data. The pipeline of level is the composite functor

Theorem 4 (The pipeline is a composite of functors). With the data of 3, is a functor, and its formation is associative and unital: for composable domain refinements the restriction functors compose (up to coherent isomorphism), and the identity refinement acts as the identity functor. Consequently the master formula (2) is the object-level shadow of a genuine composition of morphisms in , and Part I’s closure operation “composition of compatible translations” is the composition law of the category of categories.

Proof. Functors compose: if and preserve identities and composition, then and , so is a functor. Applying this twice to , , gives that is a functor. Associativity of in is inherited from associativity of function composition on objects and on hom-sets; the identity functor is a two-sided unit for the same reason. The pseudofunctoriality clause of 2 states exactly that and , which is associativity and unitality up to coherent isomorphism. Reading (2) on objects, is the value of the composite functor at , i.e. the object component of the composition in . ◻

4 is the reason category theory belongs at Level V of the ladder: the entire library was already, implicitly, a diagram in . The remaining sections make the ingredients precise and extract the four physical consequences T1–T4. The pipeline as a commuting diagram is:

3 Categories, functors, and natural transformations

3.1 Categories: composition and identity

Definition 5 (Category). A category consists of a collection of objects; for each ordered pair a set of morphisms; a composition operation ; and for each object an identity morphism , subject to the two axioms

(3–4)

Physically (status ), objects are systems or state spaces, morphisms are processes or transitions, is “do , then ”, and is the do-nothing process. (3) says that grouping of a process chain is physically immaterial; (4) says that inserting a trivial step changes nothing. These two laws are the entire content of “composition and identity” at the -categorical level.

Example 6 (Groups and representations as one-object categories). A monoid is a category with one object and , with composition the monoid product and identity the unit. A group is such a category in which every morphism is invertible—a one-object groupoid, written (the delooping). A linear representation is exactly a functor : it sends the unique object to and each group element to an invertible linear map, and functoriality , is the definition of a representation. This is the first place the slogan “a physical theory is a functor” becomes literal: a symmetry action is a functor out of a delooping.

Example 7 (Preorders, spaces, and ). (i) A preorder is a category with at most one morphism , present iff ; composition is transitivity, identities are reflexivity. (ii) has sets as objects and functions as morphisms; has vector spaces and linear maps; has finite-dimensional Hilbert spaces and linear maps. (iii) The bordism category has closed -manifolds as objects and -dimensional cobordisms (up to diffeomorphism) as morphisms; a TQFT is a functor (7 feeds 4).

Definition 8 (Isomorphism, groupoid). A morphism is an isomorphism if there is with and ; then is unique and written . A groupoid is a category in which every morphism is an isomorphism. Physically (status ) an isomorphism is a reversible equivalence: “the same structure in different coordinates.”

3.2 Functors: translation between worlds

Definition 9 (Functor). A functor assigns to each object an object and to each morphism a morphism , preserving identities and composition:

(5)

A functor is the structure-preserving translation of the composition/identity laws from one world to another; a physical theory, a quantization, or a realization channel is such a translation (status  for TQFT; for a general realization functor). (5) is precisely what makes pipeline cd commute stagewise.

Definition 10 (Natural transformation). Given functors , a natural transformation is a family of morphisms (its components) such that for every the naturality square commutes:

If each is an isomorphism, is a natural isomorphism and . Physically (status ) a natural transformation is a uniform deformation of one translation into another—a field redefinition or theory equivalence that acts coherently on all systems at once.

Definition 11 (Functor category). For categories , the functor category has functors as objects and natural transformations as morphisms, with vertical composition and identity the identity natural transformation. There is also horizontal composition of natural transformations along a composite of functors.

3.3 Interchange and Eckmann–Hilton

In the functor -category , objects are categories, -morphisms are functors, and -morphisms are natural transformations. These -morphisms carry two composition laws. Their compatibility is the single most important coherence in the module, because “composition and identity” now appears twice—two compositions sharing one family of identities.

Proposition 12 (Interchange law). In any -category, for -morphisms arranged so that both sides are defined,

(6)
where is vertical and is horizontal composition. In particular horizontal and vertical composition of natural transformations satisfy (6).

Proof. Both sides are computed by evaluating components and using naturality naturality. Writing the horizontal composite of (along ) with (along ) as (the two expressions agree by naturality of at ), one expands both sides of (6) on an object and finds each equal to the common diagonal of the evident commuting square; the equality is forced by the naturality of the four transformations. A full component computation is standard [1]. ◻

Proposition 13 (Eckmann–Hilton). Let a set carry two unital binary operations and sharing a common unit and satisfying the interchange law . Then the two operations coincide, are associative, and are commutative.

Proof. First . Interchange gives, for all , so ; call it . Then , giving commutativity, and interchange collapses to associativity. ◻

Remark 14 (Why this belongs to a module titled “composition and identity”). 13 is the algebraic reason that the second homotopy group of a space is abelian, and in HoTT it is the statement that the higher identity types (paths between paths) are commutative: the two ways to compose -dimensional identities—horizontally and vertically—share the constant identity and interchange, hence agree and commute. Thus “composition” and “identity” are not two topics but one: at each new dimension the identity laws constrain how compositions may interact, and Eckmann–Hilton is the first nontrivial constraint. This directly forecasts the higher-identity content of 5.

3.4 Yoneda: a system is known by its probes

Lemma 15 (Yoneda). For a locally small category , an object , and a functor , there is a bijection natural in both and ,

(7)
In particular the Yoneda embedding , , is full and faithful, so iff .

Proof. Given a natural transformation , set . Naturality at any (viewed as an element of ) forces , so is determined by ; and any defines a natural by this formula. The two assignments are mutually inverse, giving (7). Naturality in is a direct check. Taking yields , i.e. full faithfulness of ; reflection of isomorphisms follows because full and faithful functors reflect isomorphisms. ◻

Physically (status ) the Yoneda lemma is the statement that a system is completely determined by the totality of its responses to all probes: knowing —all ways of mapping into —determines up to isomorphism. This is the categorical form of an operational/measurement-based identity criterion and reappears as the “univalence for representables” motif in 5.

4 Monoidal and dagger-compact structure

Parallel composition of systems—putting two experiments side by side—is not captured by alone. It is captured by a tensor product, and the reversal of processes by a dagger. These structures make into the ambient category of finite quantum mechanics and give the string-diagram calculus used in Part VI.

Definition 16 (Monoidal category). A monoidal category is a category with a functor , a unit object , and natural isomorphisms , , satisfying Mac Lane’s pentagon and triangle coherence axioms. It is symmetric if it also has a natural isomorphism with and the hexagon coherence.

That is a bifunctor means it respects composition in each argument and satisfies the interchange law : sequential and parallel composition of processes commute, which is the algebra of quantum circuits. Physically (status ) is the composite system, is the trivial system, and is the swap—bosonic-like exchange when it squares to the identity, anyonic braiding when it does not.

Definition 17 (Compact closed and dagger-compact category). A compact closed category is a symmetric monoidal category in which every object has a dual equipped with a unit (coevaluation, a “cup”) and counit (evaluation, a “cap”) satisfying the snake (zig-zag) equations

(8)
A dagger-compact category adds an involutive, identity-on-objects, contravariant functor that is monoidal and compatible with the compact structure, so that up to the canonical isomorphisms. Physically is the adjoint/time-reversal.

Example 18 ( as the arena of finite quantum mechanics). is dagger-compact: is the tensor product of Hilbert spaces, , is the dual space, is the (unnormalized) Bell state, is the pairing, and is the Hermitian adjoint. The snake equations (8) are the statement that a maximally entangled pair can be created and then partially annihilated to yield an identity wire—the diagrammatic engine of quantum teleportation [4, 3].

The snake equation admits the string-diagram reading in which a cup followed by a cap straightens a bent wire:

5 Homotopy type theory: identity as path

We now pass from composition (category theory) to identity proper. HoTT is a dependent type theory in which the identity type is interpreted homotopically and Voevodsky’s univalence axiom governs identity of structures.

5.1 Types, terms, and dependent types

We use the judgement (“ is a term of type ”). A dependent type (a type family) assigns a type to each . From it we form the dependent pair and function types

(9)
Physically (status ), is a space of states or possibilities, a witnessing state, a fibre of field data over the base point , the total configuration space, and the space of fields (sections) assigning data at every point.

5.2 Identity types and path induction

Definition 19 (Identity type). For and there is a type , written , whose terms are identifications (paths) from to . It is generated by the constructor , subject to the following induction principle.

Definition 20 (Path induction, the J-rule). To define a section of a family it suffices to define it on reflexivity: given there is a unique (up to identification) term Path induction is the only elimination rule for identity types.

Lemma 21 (Transport). For any and there is an equivalence , with , and is functorial: for , .

Proof. Apply 20 to the family with ; this yields with . That each is an equivalence follows by path induction on (it holds at , hence everywhere), with inverse . Functoriality is again path induction: fix and induct on ; the case reduces to , which holds definitionally. ◻

Lemma 22 (Action on paths). Every function acts on identifications: there is with , respecting inverses and concatenation. Thus functions automatically preserve identity—the type-theoretic counterpart of functoriality (5).

Proof. Path induction on the family with . Preservation of concatenation and inverses is a further path induction. ◻

5.3 Equivalence and univalence

Definition 23 (Equivalence). A function is an equivalence, written , if its fibres are contractible; equivalently if it has a two-sided homotopy-inverse. The type of equivalences is . The canonical map

(10)
sends to the identity equivalence (by path induction).

Definition 24 (Univalence axiom, Voevodsky). A universe is univalent if for all the map of (10) is itself an equivalence:

(11)
Its inverse is written .

Univalence is the exact formal content of the representation-theoretic slogan “equivalent representations can be treated as the same physical content”: identity of structures and equivalence of structures are themselves identified. It is used in 6 to discharge Part I’s Axiom (Equivalence).

Definition 25 (Truncation levels). A type is contractible (level ) if is inhabited; a mere proposition (level ) if all its terms are identified; a set (level ) if each identity type is a mere proposition; a groupoid (level ) if each is a set; and so on up the -truncation hierarchy. Each level carries an idempotent truncation modality universally forcing a type to level .

Example 26 (The circle). The higher inductive type is generated by a point and a path . It is a -type, not a set: its loop space is , so is provable synthetically. Physically (status ) models a phase circle or winding sector, and its integer loop space is the winding number/topological charge.

6 Results: the four theorems

We now prove the four theorems that give this module its physical payload. T1 and T2 concern identity and translation; T3 and T4 concern quantum information and gauge, feeding Part VI.

6.1 T1: univalence discharges the Equivalence axiom

Theorem 27 (Univalence respects realization). Let be a univalent universe modelling Part I’s , and let be any internally definable realization, i.e. a function definable in the type theory (equivalently, a term ). Then for all , and moreover along the induced path is an equivalence . Hence any internally definable realization assigns the same physical representation to equivalent mathematical structures: Part I’s Axiom (Equivalence) is a theorem, not a postulate.

Proof. Let . By univalence (11), is an identification of and in . Apply 22 to : , which is the required identification of physical representations. To obtain an equivalence we transport along the path in the base , using the type family (with read as a universe of types): by 21, is an equivalence, invertible with inverse the transport along . (Equivalently, applying to the path in yields the same equivalence directly.) Since , the construction sends the identity equivalence to reflexivity, so it is the identity on the diagonal, as required for a bona fide discharge of the axiom. ◻

Remark 28 (Gauge-dependent vs. gauge-invariant). 27 applies only to internally definable realizations. A realization defined by an external choice—picking a basis, a gauge, or a coordinate patch—need not be a term of the type theory and may fail to respect equivalence. This is exactly the physical distinction between gauge-invariant quantities (internally definable; equivalence-respecting) and gauge-dependent quantities (externally defined; not). Univalence thereby draws the gauge-invariance line as a definability condition, anticipating Part VI’s treatment of gauge redundancy.

6.2 T2: one functor for logic, code, and physics

Theorem 29 (Curry–Howard–Lambek semantics of the pipeline). Let be a Martin-Löf dependent type theory with -, -, and identity types, and let be its syntactic category (objects: contexts; morphisms: substitutions up to definitional equality). For any locally cartesian closed category modelling there is an interpretation functor sending types to objects and terms to (global) sections, and it is sound: it preserves the type-forming operations up to canonical isomorphism. Composing with a realization functor yields a single composite that interprets, simultaneously and by one categorical translation, the logical reading (propositions as types, proofs as terms), the computational reading (programs as terms, evaluation as normalization), and the physical reading (state spaces as types, processes as terms, realization as ).

Proof. The existence and soundness of is the Curry–Howard–Lambek/Seely correspondence between Martin-Löf type theory with , and identity types and locally cartesian closed categories [5, 1, 2]: -types interpret as dependent sums (left adjoint to pullback), -types as dependent products (right adjoint to pullback), and identity types as the relevant path objects; functoriality of is precisely the statement that substitution is interpreted by pullback and composes, i.e. soundness of the substitution calculus. Since functors compose (4), is a functor. The three readings are three names for the values of this one functor: the logical reading names the objects of as propositions, the computational reading names its morphisms as programs, and the physical reading names applied to them as realizations. The equalities among these readings are literal equalities of the functor’s values, which is the content of the “theorem specification, proof implementation, physical process realization” slogan. ◻

Corollary 30 (Composition is quadruply the same law). Under 29, given and , the composite is simultaneously: logical-implication composition, proof/term composition, program composition, and—after —composition of physical processes. The associativity (3) of is one law shared by all four readings.

Proof. Immediate from 29: composition in is substitution composition, sent by the two functors to composition in and then in ; each named reading is the same morphism under a different name, and associativity is inherited from 5. ◻

6.3 T3: no cloning forces encoding

Theorem 31 (Structural no-cloning). Let be a symmetric monoidal category and suppose there is a uniform copying operation: writing for the diagonal functor, a natural transformation with components , together with a natural deleting , making each a cocommutative comonoid compatibly with and the symmetry. Then is a categorical product: is cartesian monoidal. Consequently, in —where the tensor product is not a categorical product—no such uniform copying exists, and quantum high availability cannot be replication.

Proof. The hypotheses are exactly Fox’s theorem: a symmetric monoidal category equipped with a natural, coherent, cocommutative comonoid structure on every object, compatible with , is cartesian, with the product, the terminal object, the unique map , and the diagonal; naturality of and supplies the universal property of the product on morphisms. Now suppose, for contradiction, that admitted such a uniform copying. Then its monoidal product would be the categorical product. But the categorical product (equivalently, in , the biproduct) of Hilbert spaces is the direct sum , with , whereas . For these are and only coincidentally; taking gives , so as bifunctors. This contradiction shows no uniform natural copying exists in : the no-cloning theorem. Because copying is unavailable, protecting a quantum state cannot proceed by replication; the only representational option is an embedding into a larger physical Hilbert space—encoding—which is precisely Part VI’s quantum high-availability construction . ◻

Remark 32 (Classical structures as the copiable objects). The objects of a dagger-compact category that do admit natural copying are exactly the classical structures: special commutative dagger-Frobenius algebras, whose comultiplication is a copying map. In these correspond to a choice of orthonormal basis—the “classical” pointer states one may copy. Thus T3 also explains why classical high availability (replication) works for classical data and fails for genuinely quantum data: only basis states are copiable [4].

6.4 T4: groupoid quotients are finer than set quotients

Theorem 33 (Truncation reconstruction of “stacks retain gauge information”). Let be a -type (a set carrying a group structure) acting on a -type (set) . Form the groupoid quotient (a higher inductive type) , whose points are those of , with a path for each , subject to the groupoid coherences. Then:

  1. is a -type, and for each the loop space retains the stabilizer as nontrivial automorphisms;

  2. the set quotient is the -truncation , which forgets exactly those stabilizer loops;

  3. hence whenever some stabilizer is nontrivial, is strictly finer than : there is no equivalence .

This is a purely type-theoretic reconstruction of the source proposition “stacks retain gauge information” () and of Part III’s finer-moduli phenomenon.

Proof. (a) By construction the only generating paths of at a point are the loops, and the higher inductive coherences make loop concatenation match group multiplication; the loops fixing are precisely those with , i.e. , giving . Since is a -type, each stabilizer is a set, so every loop space is a set and is -truncated; here the set hypotheses on and are exactly what bounds at truncation level  (a with higher homotopy, such as a delooped Lie group, would raise the level regardless of stabilizers). (b) The set quotient is defined as the -truncation of (equivalently the quotient of by the orbit equivalence relation), and -truncation identifies all parallel paths, so all stabilizer loops collapse to reflexivity, retaining only orbits. (c) If some then is a nontrivial set while the corresponding loop space in the -type is contractible; an equivalence would induce an equivalence on loop spaces (equivalences preserve all homotopy structure), a contradiction. Reading a stabilizer loop as a residual gauge automorphism of the configuration , (a)–(c) are exactly the statement with the coarse quotient forgetting , which is the source’s “stacks retain gauge information.” ◻

Corollary 34 (One fact, four proofs). The proposition “passing to the stack/groupoid quotient retains stabilizer data that the coarse quotient forgets” now has a type-theoretic proof (33) via truncation levels, complementing Part I’s informal gluing argument, Part III’s algebro-geometric moduli argument, and Part VI’s forthcoming descent-theoretic proof. These are one theorem with four proofs at increasing rigor—the headline “closure” motif of the synthesis paper.

The truncation tower relating the two quotients is:

7 The category-theory and HoTT representation dictionary

We collect the core dictionary entries with S/H/P labels; the full longtables are in 12. The discipline is that of the whole series: an entry is when it is a standard mathematical fact used verbatim in mathematical physics, and or when its physical reading is a heuristic layer.

Category theory Physical representation Status
ObjectPhysical system / state spaceS/H
Morphism Process, transition, evolutionS
Composition Sequential processS
Identity morphismDo-nothing processS
IsomorphismReversible equivalenceS
Equivalence of categoriesSame theory, dual descriptionsS
FunctorPhysical theory / quantizationS
Natural transformationUniform field redefinitionS/H
Monoidal product Parallel composition of systemsS
Dagger-compact categoryQuantum process calculusS
TraceFeedback / partition functionS/H
Yoneda lemmaSystem known by its probesS/H
HoTT / type theory Physical representation Status
Type Space of states / possibilitiesS/H
Term State / event / witnessS/H
Dependent type Field / fibre over base pointS/H
Identity type Path / equivalence of statesS/H
TransportParallel transport / coordinate changeS/H
Equivalence Duality / gauge-equivalent descriptionH
UnivalenceEquivalent systems identifiedS/H
-truncationClassical coarse-grainingH
Groupoid quotient Gauge configuration spaceS/H
Circle HIT Winding / phase sectorH
Cohesive HoTTSynthetic geometry for fieldsS/H

8 Haskell formalization

The package src/category-theory-hott-composition/ encodes the composition/identity structures of 3, 4 and the groupoid-vs-set quotient of 33. We reproduce the type-class skeleton; the runnable Main.hs exercises the identity/associativity laws, a functor, a natural-transformation naturality check, a dagger-compact no-cloning obstruction, and the two quotients.

class Category cat where
identity :: cat a a
compose  :: cat b c -> cat a b -> cat a c
class (Category c, Category d) => CFunctor c d f where
fmapC :: c a b -> d (f a) (f b)
newtype NatTrans d f g = NatTrans component :: forall a. d (f a) (g a)

Here NatTrans is parameterized by the target category d, so a natural transformation’s components are morphisms in d—not hardcoded Haskell functions—which keeps the encoding honest for non-Hask targets such as or .

Main.hs checks numerically that compose identity f == f == compose f identity for a concrete category (functions), that a chosen functor preserves composition, that a naturality square commutes, that the tensor-vs-biproduct dimension mismatch of 31 holds ( but ), and that the groupoid quotient retains a stabilizer that the set quotient discards. The whole package compiles with ghc.

9 Lean formalization (best-effort sketch)

The directory lean/category-theory-hott-composition/ contains an idiomatic Lean 4 sketch capturing the category, functor, and identity-law types, plus signatures for T1 and T4. It reuses Mathlib’s CategoryTheory where convenient and states the physics-facing wrappers (a PhysicalCategory interpretation, a univalence-respects-realization signature, and a groupoid-quotient-finer-than-set-quotient signature). It is a best-effort sketch, not build-gated.

10 Discussion

10.0.0.1 Composition in the ladder.

Parts I–IV produced translations—abstraction, realization, observation, TQFT, homology—each of which is a functor. 4 shows the library was always a diagram in ; Part V simply names the ambient grammar. The associativity and unit laws (3)(4) are the reason the pipeline may be assembled from stages at all, and 30 shows the same law governs logical, computational, and physical composition.

10.0.0.2 Identity in the ladder.

Part I postulated that equivalent representations carry the same physical content (Axiom Equivalence). 27 derives it for every internally definable realization, and 28 reads the residue—realizations that fail it—as exactly the gauge-dependent quantities. This is the module’s central payoff: identity of structures, formalized by univalence, is the correct home for the “same physics, different description” principle that recurs through the series.

10.0.0.3 Forecasting Part VI.

31 forces quantum high availability to be encoding, and 33 produces the stabilizer-retention phenomenon inside the truncation hierarchy. Both are the categorical/type-theoretic inputs Part VI turns into stacks (groupoid-valued sheaves) and quantum error-correcting codes. 34 records that the stabilizer-retention fact will then have four proofs at increasing rigor—the synthesis paper’s “closure theorem.”

10.0.0.4 Limitations.

Category theory and HoTT are status S mathematics; their physical readings carry the flags of 7. We reiterate the series limitations in this module’s terms. (i) We claim no single universal functor ; 4 is domain-indexed by , matching Part I’s deliberate locality. (ii) The reading of a type as a “space of physical possibilities” is heuristic (status ). (iii) 27 requires a genuinely univalent model and an internally definable realization; externally chosen realizations are outside its scope by design, which is the gauge-dependence caveat, not a defect. (iv) The no-cloning argument is stated for ; infinite-dimensional refinements need additional analytic hypotheses. (v) Univalence is a foundational axiom (with computational content in cubical type theory) rather than a physical measurement, so its physical reading remains .

11 Conclusion

Part V isolates the compositional glue of the representation library. Category theory supplies the laws of composition: associativity, units, functoriality, naturality, the interchange law, and (via Eckmann–Hilton) the first constraint linking two compositions through a shared identity. HoTT supplies the theory of identity: identity types as paths, path induction as the sole generator of transport, and univalence as the identification of identity with equivalence. Four theorems give the physics. Univalence turns Part I’s Equivalence axiom into a theorem (T1); the Curry–Howard–Lambek correspondence exhibits one functor interpreting logic, code, and physics (T2); a structural no-cloning theorem forces quantum high availability to be encoding (T3); and the groupoid quotient’s strict refinement of the set quotient reconstructs “stacks retain gauge information” inside the truncation hierarchy (T4). Together they make explicit the universal grammar that Parts I–IV used implicitly and that Part VI will use to build stacks and quantum codes. In the compressed slogans of the series, mathematics is the syntax of physical representation and categories/types are the grammar of its composition and identity.

[1] S. Mac Lane, Categories for the Working Mathematician, Graduate Texts in Mathematics 5, 2nd ed., Springer, 1998.

[2] The Univalent Foundations Program, Homotopy Type Theory: Univalent Foundations of Mathematics, Institute for Advanced Study, 2013.

[3] J. C. Baez and M. Stay, Physics, topology, logic and computation: A Rosetta Stone, arXiv:0903.0340 (2009); Lecture Notes in Physics 813 (2010), 95–172.

[4] S. Abramsky and B. Coecke, A categorical semantics of quantum protocols, arXiv:quant-ph/0402130 (2004); Proc. 19th IEEE Symposium on Logic in Computer Science (LiCS), 2004.

[5] J. Lambek and P. J. Scott, Introduction to Higher Order Categorical Logic, Cambridge Studies in Advanced Mathematics 7, Cambridge University Press, 1986.

[6] J. Lurie, On the classification of topological field theories, arXiv:0905.0465 (2009); Current Developments in Mathematics 2008, 129–280.

[7] J. Lurie, Higher Topos Theory, Annals of Mathematics Studies 170, Princeton University Press, 2009.

[8] U. Schreiber, Differential cohomology in a cohesive -topos, arXiv:1310.7930 (2013).

[9] E. Riehl and D. Verity, Elements of -Category Theory, Cambridge Studies in Advanced Mathematics, Cambridge University Press, 2022.

[10] M. Atiyah, Topological quantum field theories, Publications Mathématiques de l’IHÉS 68 (1988), 175–186.

[11] E. Riehl, Category Theory in Context, Aurora: Dover Modern Math Originals, Dover Publications, 2017.

12 Full category-theory and HoTT representation library

The following longtables reproduce the module’s dictionary (source Appendix E), with epistemic status labels carried verbatim. Each row is a representation entry in the sense of 1.

Category theory library (physical representation dictionary).
Category theory Physical representation Semantic meaning Status
ObjectPhysical system / state spaceThing capable of processesS/H
Morphism Process, transition, evolutionPhysical transformationS
Composition Sequential processOne process after anotherS
Identity morphismDo-nothing processPersistence / trivial evolutionS
IsomorphismReversible equivalenceSame structure, new coordinatesS
Equivalence of categoriesSame theory structurallyDual physical descriptionsS
FunctorTranslation between worldsPhysical theory / quantizationS
Natural transformationUniform deformationTheory equivalence / field redefinitionS/H
Category of statesState-system universeObjects systems, arrows evolutionsH
Category of observablesMeasurement-algebra universeArrows observable transformationsH
Monoidal categoryParallel compositionComposite systemsS
Tensor product Combine systemsParallel physical compositionS
Unit object Vacuum / trivial systemNo-system baselineS/H
Symmetric monoidalExchangeable systemsBosonic-like swap symmetryS/H
Braided monoidalNontrivial exchangeAnyonic / braided statisticsS
Ribbon categoryBraiding plus twistTopological quantum computationS
Compact closedDualizable inputs/outputsProcess–state dualityS
Dagger categoryReversal / adjointQuantum adjoint, time reversalS
Dagger-compactQuantum process calculusTeleportation, cups/capsS
String diagramDiagrammatic processCircuit / Feynman grammarS
TraceFeedback loopClosed process, partition functionS/H
Dual object Antisystem / dual spaceBra/ket, particle/antiparticleS/H
Evaluation mapPairingMeasurement, annihilationS/H
Coevaluation mapPair creationEntangled pair / vacuum insertionS/H
LimitUniversal compatible solutionConstraint satisfactionS
ColimitUniversal gluingGlobal system from partsS
PullbackFibered constraintSimultaneous conditionsS
PushoutGluing along boundaryCoupled systemsS
Adjunction Dual translation pairFree/forgetful, prep/measureS/H
MonadDynamics with effectsState update, computation effectS/H
ComonadContext extractionObservation / coarse environmentH
Algebra over monadSystem obeying effectsDynamics closed under updateH
CoalgebraState-transition systemObservable unfolding / branchingS/H
OperadMulti-input composition lawInteraction vertices / couplingsS
PROPMulti-in/out networkCircuit / Feynman process algebraS
Enriched categoryStructured hom-spacesDistances, probabilities, Hilbert homsS/H
2-categoryObjects, processes, transformationsTheories, defects, transformationsS
-categoryAll higher coherencesHistories, higher gauge dataS
Higher categoryNested process hierarchyParticles, strings, branes, defectsS
-category-level process systemExtended TQFT codimensionS
ToposUniverse of variable setsContextual world of observationH
Sheaf toposLocal-to-global universeObserver-dependent gluingS/H
Internal languageLogic of a categoryNative reasoning of a universeH
Yoneda lemmaObject known by probesSystem determined by observationsS/H
Homotopy type theory library (physical representation dictionary).
HoTT / type theory Physical representation Semantic meaning Status
Type Space of states / propositionsDomain of possible inhabitantsS/H
Term State / event / witnessActual instance of a possibilityS/H
Dependent type Fibre over configurationField degrees over base pointS/H
-typeTotal spaceConfiguration plus dependent dataS
-typeSpace of sectionsField assigning data everywhereS
Identity type Path from to Equivalence / evolution of statesS/H
Higher identity typeHomotopy between pathsCoherence between evolutionsS/H
Path inductionReasoning from identityTransport laws from equivalenceS/H
TransportMove structure along pathParallel transport / coordinate changeS/H
Equivalence Same physics, new representationDuality / gauge equivalenceH
UnivalenceEquivalence treated as identityEquivalent systems identifiedS/H
Universe Type of systems / theoriesMeta-space of descriptionsH
Higher inductive typeGenerated points/paths/cellsSynthetic topological spacesS/H
Circle HIT Generated loop spaceWinding sector / phase circleH
Sphere HIT Generated -charge carrierHigher topological chargeH
Pushout typeGlued systemBoundary coupling / fusionS/H
Pullback typeConstraint-matched systemSimultaneous compatibilityS/H
Quotient typeIdentified statesGauge quotient / equivalence classesH
TruncationForget higher identityClassical approximationH
Mere propositionYes/no observableProof-irrelevant physical factH
Set-truncationClassical state setNo higher path informationH
Groupoid levelGauge-state structureStates plus equivalencesS/H
-groupoidFull homotopy state spaceStates, paths, paths-between-pathsS/H
Contractible typeUnique state up to equivalenceTrivial phase / vacuum sectorH
Fiber sequenceStructured dependencyGauge fibre over baseS/H
Modal type theoryObservation / filtering modesCoarse-graining, localizationH
Cohesive HoTTSynthetic smooth geometryInternal language for fieldsS/H
Shape modalityUnderlying homotopy typeForget geometry, keep topologyS/H
Flat modalityDiscrete / codified formLocally constant representationH
Sharp modalityCodiscrete / crisp formPurely formal / global representationH
Differential cohesionSmooth infinitesimal structureSynthetic differential geometryS/H
Download PDF