Categories.AW-MSciProject
Anna Williams, March 2026 This file corresponds to the paper https://anna-maths.xyz/assets/papers/disp-categories.pdf{-# OPTIONS --safe --without-K #-} open import Categories.Wild open import Categories.Pre open import Categories.Univalent open import Categories.Examples.Set open import Categories.Examples.Magma open import Categories.Functor open import Categories.Functor-Composition open import Categories.NaturalTransformation open import Categories.Adjoint open import Categories.Notation.Wild open import Categories.Notation.Pre open import Categories.Displayed.Pre open import Categories.Displayed.Univalent open import Categories.Displayed.Examples.Magma open import Categories.Displayed.Functor open import Categories.Displayed.Total open import Categories.Displayed.Notation.Pre module Categories.AW-MSciProject where open import MLTT.Spartan open import Notation.UnderlyingType open import UF.DependentEquality open import UF.FunExt open import UF.Sets open import UF.Subsingletons open import UF.Univalence## Chapter 3: Category Theory ### Section 3.1: CategoriesDefinition-3-1 : (๐ค ๐ฅ : Universe) โ (๐ค โ ๐ฅ) โบ ฬ Definition-3-1 = WildCategory Example-3-2 : WildCategory (๐ค โบ) ๐ค Example-3-2 = SetWildCategory Example-3-3 : Fun-Ext โ WildCategory (๐ค โบ) ๐ค Example-3-3 = MagmaWildCategory Definition-3-4 : (W : WildCategory ๐ค ๐ฅ) โ (A B : obj W) โ ๐ฅ ฬ Definition-3-4 W A B = A โ B where open WildCategoryNotation W module _ (W : WildCategory ๐ค ๐ฅ) where open WildCategoryNotation W Proposition-3-5 : (A B : obj W) โ (f : A โ B) โ (g h : inverse โ f โ) โ prโ g ๏ผ prโ h Proposition-3-5 _ _ _ = at-most-one-inverse Definition-3-6 : (W : WildCategory ๐ค ๐ฅ) (p : is-precategory W) โ Precategory ๐ค ๐ฅ Definition-3-6 W p = W , p Proposition-3-7 : (W : WildCategory ๐ค ๐ฅ) โ Fun-Ext โ is-prop (is-precategory W) Proposition-3-7 = being-precat-is-prop Example-3-8-Set : Fun-Ext โ Precategory (๐ค โบ) ๐ค Example-3-8-Set = SetPrecategory Example-3-8-Magma : Fun-Ext โ Precategory (๐ค โบ) ๐ค Example-3-8-Magma = MagmaPrecategory module _ (P : Precategory ๐ค ๐ฅ) where open PrecategoryNotation P Proposition-3-9-prop : {a b : obj P} (f : hom a b) โ is-prop (inverse f) Proposition-3-9-prop = being-iso-is-prop P Proposition-3-9-set : {a b : obj P} โ is-set (a โ b) Proposition-3-9-set = isomorphism-type-is-set P Corollary-3-10 : {a b : obj P} {f f' : a โ b} โ โ f โ ๏ผ โ f' โ โ f ๏ผ f' Corollary-3-10 = to-โ -๏ผ Proposition-3-11 : (a b : obj P) โ (a ๏ผ b โ a โ b) Proposition-3-11 a b = id-to-iso a b Definition-3-12 : (P : Precategory ๐ค ๐ฅ) (p : is-category P) โ Category ๐ค ๐ฅ Definition-3-12 P p = P , p Corollary-3-13 : (C : Category ๐ค ๐ฅ) โ ((a b : obj C) โ is-set (a ๏ผ b)) Corollary-3-13 = cat-objs-form-a-1-type Example-3-15 : is-univalent ๐ค โ Fun-Ext โ Category (๐ค โบ) ๐ค Example-3-15 = SetCategory Example-3-16 : Fun-Ext โ is-univalent ๐ค โ Category (๐ค โบ) ๐ค Example-3-16 = MagmaCategory### FunctorsDefinition-3-17 : (P : Precategory ๐ค ๐ฅ) (Q : Precategory ๐ฆ ๐ฃ) โ ๐ค โ ๐ฅ โ ๐ฆ โ ๐ฃ ฬ Definition-3-17 P Q = Functor P Q Example-3-19 : (P : Precategory ๐ค ๐ฅ) โ Functor P P Example-3-19 P = id-functor P module _ {A : Precategory ๐ค ๐ฅ} {B : Precategory ๐ค' ๐ฅ'} {C : Precategory ๐ฆ ๐ฃ} {D : Precategory ๐ฆ' ๐ฃ'} where Definition-3-20 : (G : Functor B C) (F : Functor A B) โ Functor A C Definition-3-20 G F = G Fโ F Proposition-3-21-left : Fun-Ext โ (F : Functor A B) โ F Fโ (id-functor A) ๏ผ F Proposition-3-21-left = id-left-neutral-Fโ Proposition-3-21-right : Fun-Ext โ (F : Functor A B) โ (id-functor B) Fโ F ๏ผ F Proposition-3-21-right = id-right-neutral-Fโ Proposition-3-22 : Fun-Ext โ (F : Functor A B) (G : Functor B C) (H : Functor C D) โ H Fโ (G Fโ F) ๏ผ (H Fโ G) Fโ F Proposition-3-22 = assoc-Fโ### Section 3.3: Natural Transformationsmodule _ {A : Precategory ๐ค ๐ฅ} {B : Precategory ๐ฆ ๐ฃ} {C : Precategory ๐ค' ๐ฅ'} where Definition-3-23 : (F G : Functor A B) โ ๐ค โ ๐ฅ โ ๐ฃ ฬ Definition-3-23 F G = NaturalTransformation F G Example-3-25 : (F : Functor A B) โ NaturalTransformation F F Example-3-25 F = id-natural-transformation F Definition-3-26 : {G H : Functor B C} (ฮผ : NaturalTransformation G H) (F : Functor A B) โ NaturalTransformation (G Fโ F) (H Fโ F) Definition-3-26 = _ยท_ Definition-3-27 : {F G H : Functor A B} (ฮณ : NaturalTransformation G H) (ฮผ : NaturalTransformation F G) โ NaturalTransformation F H Definition-3-27 = _Nโ_### Section 3.4: AdjointsDefinition-3-28 : (F : Functor A B) โ Fun-Ext โ ๐ค โ ๐ฅ โ ๐ฆ โ ๐ฃ ฬ Definition-3-28 F = LeftAdjoint F## Chapter 4: Displayed Category Theory ### Section 4.1: Displayed CategoriesDefinition-4-1 : (๐ฆ ๐ฃ : Universe) (P : Precategory ๐ค ๐ฅ) โ (๐ฆ โ ๐ฃ โ ๐ค โ ๐ฅ) โบ ฬ Definition-4-1 ๐ฆ ๐ฃ P = DisplayedPrecategory ๐ฆ ๐ฃ P Example-4-2 : {fe : Fun-Ext} โ DisplayedPrecategory ๐ค ๐ค (SetPrecategory fe) Example-4-2 {๐ค} {fe} = DispPreMagma {๐ค} {fe} module _ {P : Precategory ๐ฆ ๐ฃ} {a b : obj P} where open PrecategoryNotation P Definition-4-3 : (D : DisplayedPrecategory ๐ค ๐ฅ P) (x : obj[ a ] D) (y : obj[ b ] D) (f : a โ b) โ ๐ฅ ฬ Definition-4-3 D x y f = x โ [ f ] y where open DisplayedPrecategoryNotation D module _ {D : DisplayedPrecategory ๐ค ๐ฅ P} where open DisplayedPrecategoryNotation D Proposition-4-4 : {x : obj[ a ] D} {y : obj[ b ] D} {f : a โ b} (๐ : x โ [ f ] y) (g h : D-inverse f D-โ ๐ โ) โ D-โ g โ ๏ผ D-โ h โ Proposition-4-4 ๐ g h = at-most-one-D-inverse D g h Proposition-4-5 : {x : obj[ a ] D} {y : obj[ b ] D} {f : a โ b} {๐ ๐ : x โ [ f ] y} โ D-โ ๐ โ ๏ผ D-โ ๐ โ โ ๐ ๏ผ ๐ Proposition-4-5 = to-โ [-]-๏ผ Proposition-4-6 : (x : obj[ a ] D) (y : obj[ b ] D) (e : a ๏ผ b) โ x ๏ผโฆ (ฮป - โ obj[ - ] D) , e โง y โ x โ [ id-to-iso a b e ] y Proposition-4-6 x y e = D-id-to-iso D e x y Definition-4-7 : (D : DisplayedPrecategory ๐ค ๐ฅ P) โ is-displayed-category D โ DisplayedCategory ๐ค ๐ฅ P Definition-4-7 D p = D , p Example-4-8 : {fe : Fun-Ext} โ DisplayedCategory ๐ค ๐ค (SetPrecategory fe) Example-4-8 {๐ค} {fe} = DispCatMagma {๐ค} {fe}### Section 4.2: Displayed FunctorDefinition-4-9 : {P : Precategory ๐ฆ ๐ฃ} {P' : Precategory ๐ฆ' ๐ฃ'} (F : Functor P P') (D : DisplayedPrecategory ๐ค ๐ฅ P) (D' : DisplayedPrecategory ๐ค' ๐ฅ' P') โ ๐ฆ โ ๐ฃ โ ๐ค โ ๐ค' โ ๐ฅ โ ๐ฅ' ฬ Definition-4-9 F D D' = DisplayedFunctor F D D'### Section 4.3: Total CategoryProposition-4-10 : (P : Precategory ๐ค ๐ฅ) (D : DisplayedPrecategory ๐ฆ ๐ฃ P) โ Precategory (๐ค โ ๐ฆ) (๐ฅ โ ๐ฃ) Proposition-4-10 P D = TotalPrecategory D Proposition-4-11 : (C : Category ๐ค ๐ฅ) (D : DisplayedCategory ๐ฆ ๐ฃ โจ C โฉ) โ Category (๐ค โ ๐ฆ) (๐ฅ โ ๐ฃ) Proposition-4-11 C D = TotalCategory {_} {_} {_} {_} {C} D Example-4-12-pre : {๐ค : Universe} {fe : Fun-Ext} โ Precategory (๐ค โบ) ๐ค Example-4-12-pre {๐ค} {fe} = MagmaTotalPre {๐ค} {fe} Example-4-12-univ : {๐ค : Universe} {fe : Fun-Ext} โ is-univalent ๐ค โ Category (๐ค โบ) ๐ค Example-4-12-univ {๐ค} {fe} = TotCatMagma {๐ค} {fe}