







In mathematics, The fundamental theorem of topos theory states that the slice E / X {\displaystyle \mathbf {E} /X} of a topos E {\displaystyle \mathbf {E} } over any one of its objects X {\displaystyle X} is itself a topos. Moreover, if there is a morphism f : A → B {\displaystyle f:A\rightarrow B} in E {\displaystyle \mathbf {E} } then there is a functor f ∗ : E / B → E / A {\displaystyle f^{*}:\mathbf {E} /B\rightarrow \mathbf {E} /A} which preserves exponentials and the subobject classifier.
Basic Category Theory
This short introductory category theory textbook is for readers with relatively little mathematical background (e.g. the first half of an undergraduate mathematics degree). At its heart is the concept of a universal property, important throughout mathematics. After a chapter introducing the basic definitions, separate chapters present three ways of expressing universal properties: via adjoint functors, representable functors, and limits. A final chapter ties the three together. For each new categorical concept, a generous supply of examples is provided, taken from different parts of mathematics. At points where the leap in abstraction is particularly great (such as the Yoneda lemma), the reader will find careful and extensive explanations.

emilyriehl/yoneda
comparative formalizations of the Yoneda lemma for 1-categories and infinity-categories
Horismos: Self-representation and the Derived Constitutional Boundary in Enriched Cognitive Systems
We present a theory of self-representing cognitive systems grounded in $$([0,\infty ],+)$$([0,∞],+)-enriched category theory and the Yoneda lemma. The central object is a self-representing $$([0,\infty ],+)$$([0,∞],+)-enriched category $$\mathcal{C}$$C—a Lawvere metric space whose objects are complete epistemic architectures, whose hom-values record directed informational upgrade costs, and which is separated, closed under internal homs, and bilaterally Cauchy complete—together with a contractive cognitive endofunctor $$F:\mathcal{C}\rightarrow \mathcal{C}$$F:C→Cmodelling iterative self-improvement. We establish eight results in a single logical arc. The Horizon Theorem shows that the Yoneda embedding $$\varphi (A)=\mathcal{C}(-,A)$$φ(A)=C(-,A)is never essentially surjective: $$\mathcal{C}$$C sits strictly inside its own free Cauchy completion $$\mathcal{P}(\mathcal{C})$$P(C), with the non-representable presheaves forming a topologically dense family, proved via a reflexivity argument. The Lawvere–Banach Attractor Theorem shows that every contractive endofunctor on a bilaterally complete, separated $$([0,\infty ],+)$$([0,∞],+)-enriched category converges to a unique fixed point $$\mathbf {\Omega }$$Ωat a geometric rate. The Boundary Derivation Theorem shows that $$\mathbf {\Omega }$$Ωis the minimal F-invariant substructure of $$\mathcal{C}$$C, with all of $$\mathcal{C}$$Cas its basin of attraction—the constitutional boundary, derived rather than postulated. The Horizon Expansion Theorem shows that each strictly ascending self-modification produces a new, quantitatively distinct non-representable witness. Beyond these four central results, we prove that Kleene and Bourbaki–Witt conditions yield only non-expansiveness when metrised, that contractive endofunctors form a monoid, and that the Yoneda horizon admits an observable diagnostic stabilising in finite time. The architectural section derives structural corrigibility and the alignment-incompleteness duality among five implications. The organising duality is exact: the non-surjectivity of $$\varphi $$φ and the existence of $$\mathbf {\Omega }$$Ωare two faces of the same $$([0,\infty ],+)$$([0,∞],+)-enriched structure. $$\mathbf {\Omega }$$Ωinhabits the space between them—not as a postulate, but as a proof. We argue that the eight theorems constitute universal laws of contractive cognitive systems: a stable constitutional boundary is not an engineering design choice but a topological inevitability for any reliably self-improving agent operating within a self-representing enriched metric space. The postulate becomes a theorem. The boundary is not imposed. It emerges.

Seven Sketches in Compositionality: An Invitation to Applied Category Theory
This book is an invitation to discover advanced topics in category theory through concrete, real-world examples. It aims to give a tour: a gentle, quick introduction to guide later exploration. The tour takes place over seven sketches, each pairing an evocative application, such as databases, electric circuits, or dynamical systems, with the exploration of a categorical structure, such as adjoint functors, enriched categories, or toposes. No prior knowledge of category theory is assumed. A feedback form for typos, comments, questions, and suggestions is available here: https://docs.google.com/document/d/160G9OFcP5DWT8Stn7TxdVx83DJnnf7d5GML0_FOD5Wg/edit

Categories for the Working Mathematician
Categories for the Working Mathematician provides an array of general ideas useful in a wide variety of fields. Starting from the foundations, this book illuminates the concepts of category, functor, natural transformation, and duality. The book then turns to adjoint functors, which provide a description of universal constructions, an analysis of the representations of functors by sets of morphisms, and a means of manipulating direct and inverse limits. These categorical concepts are extensively illustrated in the remaining chapters, which include many applications of the basic existence theorem for adjoint functors. The categories of algebraic systems are constructed from certain adjoint-like data and characterized by Beck's theorem. After considering a variety of applications, the book continues with the construction and exploitation of Kan extensions. This second edition includes a number of revisions and additions, including two new chapters on topics of active interest. One is onsymmetric monoidal categories and braided monoidal categories and the coherence theorems for them. The second describes 2-categories and the higher dimensional categories which have recently come into prominence. The bibliography has also been expanded to cover some of the many other recent advances concerning categories.

Introduction To Category Theory
Introduction To Category Theory by Steve Awodey, 2010, Oxford University Press, USA, Oxford University Press edition,

Internal type theory
We introduce categories with families as a new notion of model for a basic framework of dependent types. This notion is close to ordinary syntax and yet has a clean categorical description. We also present categories with families as a generalized algebraic theory. Then we define categories with families formally in Martin-Löf's intensional intuitionistic type theory. Finally, we discuss the coherence problem for these internal categories with families.

Homotopical patch theory | ACM SIGPLAN Notices
Homotopy type theory is an extension of Martin-Löf type theory, based on a correspondence with homotopy theory and higher category theory. In homotopy type theory, the propositional equality type becomes proof-relevant, and corresponds to paths in a ...

Categories of Containers
We introduce the notion of containers as a mathematical formalisation of the idea that many important datatypes consist of templates where data is stored. We show that containers have good closure properties under a variety of constructions including the formation of initial algebras and final coalgebras. We also show that containers include strictly positive types and shapely types but that there are containers which do not correspond to either of these. Further, we derive a representation result classifying the nature of polymorphic functions between containers. We finish this paper with an application to the theory of shapely types and refer to a forthcoming paper which applies this theory to differentiable types.

Category theory for computing science
Category theory for computing science by Michael Barr, 1990, Prentice Hall edition, in English

What you needa know about Yoneda: profunctor optics and the Yoneda lemma (functional pearl) | Proceedings of the ACM on Programming Languages
Profunctor optics are a neat and composable representation of bidirectional data accessors, including lenses, and their dual, prisms. The profunctor representation exploits higher-order functions and higher-kinded type constructor classes, but the ...

F. William Lawvere, Stephen H. Schanuel Conceptual Mathematics A First Introduction To Categories ( 2009, Cambridge University Press) ( 1)
Category Theory first introduction

Limits and Colimits in a Category of Lenses
Lenses are an important tool in applied category theory. While individual lenses have been widely used in applications, many of the mathematical properties of the corresponding categories of lenses have remained unknown. In this paper, we study the category of small categories and asymmetric delta lenses, and prove that it has several good exactness properties. These properties include the existence of certain limits and colimits, as well as so-called imported limits, such as imported products and imported pullbacks, which have arisen previously in applications. The category is also shown to be extensive, and it has an image factorisation system.

Categories of Optics
Bidirectional data accessors such as lenses, prisms and traversals are all instances of the same general 'optic' construction. We give a careful account of this construction and show that it extends to a functor from the category of symmetric monoidal categories to itself. We also show that this construction enjoys a universal property: it freely adds counit morphisms to a symmetric monoidal category. Missing in the folklore is a general definition of 'lawfulness' that applies directly to any optic category. We provide such a definition and show that it is equivalent to the folklore profunctor optic laws.
