unimath2024/Lecture6.typ

144 lines
5.3 KiB
Text
Raw Permalink Normal View History

2024-08-01 22:56:54 +00:00
#import "prooftree.typ": *
#import "@preview/showybox:2.0.1": showybox
#import "@preview/commute:0.2.0": node, arr, commutative-diagram
#import "@preview/cetz:0.2.2": *
#set page(width: 5.6in, height: 9in, margin: 0.4in)
#let isofhlevel = $sans("isofhlevel")$
#let idtoeqv = $sans("idtoeqv")$
#let idtoiso = $sans("idtoiso")$
#let Nat = $sans("Nat")$
#let Vect = $sans("Vect")$
#let Bool = $sans("Bool")$
#let carrier = $sans("carrier")$
#let iseqclass = $sans("iseqclass")$
#let isInjective = $sans("isInjective")$
#let Type = $sans("Type")$
#let reflexive = $sans("reflexive")$
#let Even = $sans("Even")$
#let isEven = $sans("isEven")$
#let Prop = $sans("Prop")$
#let isProp = $sans("isProp")$
#let Set = $sans("Set")$
#let isContr = $sans("isContr")$
#let isIso = $sans("isIso")$
#let isEquiv = $sans("isEquiv")$
#let isSet = $sans("isSet")$
#let zero = $sans("zero")$
#let suc = $sans("suc")$
#let Monoid = $sans("Monoid")$
#let MonoidStr = $sans("MonoidStr")$
#let MonoidAxioms = $sans("MonoidAxioms")$
#let refl = $sans("refl")$
#let defeq = $equiv$
#let propeq = $=$
= Category Theory in UniMath
== Introduction
*Definition (precategory).*
This is the most straightforward translation from category into type theory.
#let CC = $cal(C)$
A precategory $CC$ consists of:
- a type $CC_0$ of objects
- For $x, y : CC_0$ , a type $CC_1 (x, y)$ of morphisms
- For $x : CC_0$ an identity morphism $id_x : CC_1 (x, x)$
- For $x,y,z:CC_0$ and $f:CC_1 (x,y) $ and $g : CC_1(y,z)$ a composition $f dot g : CC_1 (x ,z)$
such that
- $f dot id_x propeq f$
- $id_y dot f propeq f$
- $f dot (g dot h) propeq (f dot g) dot h$
This is not what you want in a category in UF. This is because there are higher structures on the paths. There's too much structure.
We want the equality of morphisms to be trivial. We can use the notion of sets to re-define this:
*Definition (category).*
- a type $CC_0$ of objects
- For $x, y : CC_0$ , a *set* $CC_1 (x, y)$ of morphisms
- For $x : CC_0$ an identity morphism $id_x : CC_1 (x, x)$
- For $x,y,z:CC_0$ and $f:CC_1 (x,y) $ and $g : CC_1(y,z)$ a composition $f dot g : CC_1 (x ,z)$
Examples of categories:
#let SET = $bold("SET")$
- The category $SET$ of sets and functions
- This is a category because we can compose functions and have identity functions
- Category of pointed sets and point preserving maps
- Example of a set with additional structure. A morphism is a function that preserves the structure
- Defined: #[
Pointed set $(X : Set), (x : X)$. Morphism from $(X, x)$ to $(Y, y)$, give $f : X -> Y$ such that $f(x) equiv y$
]
- Category of monoids and homomorphisms
== Isomorphisms
We actually want something stronger than morphisms. There are several definitions of isomorphisms.
*Definition.* A morphism $f : CC_1 (x, y)$ is an isomorphism if the map $lambda (g : CC_1 (y,z)). f dot g$ is an equivalence for every $z : CC_0$
This might seem strange. This is strange because it was developed in a way that it works with precategories. The statement says "precomposition is an equivalence".
The one you might actually want is that you have an inverse map such as both of their compositions is the identity. This is more standard. However, this is only well-behaved if they are sets. Otherwise we can't guarantee there is a unique proof of isomorphism without further coherences.
(UniMath: `z_iso`)
== Univalent categories
*Definition (univalence).* For all types $X, Y$ we have a map $ idtoeqv(X, Y) : X propeq Y -> X tilde.eq Y $
The _univalence axiom_ says that this map is an equivalence.
For categories we can copy-paste this definition.
*Definition (univalent categories).* Let $CC$ be a category.
For all objects $x, y$ we have a map $ idtoiso_(x, y) : x propeq y -> x tilde.equiv y $
A category $CC$ is _univalent_ if for all $x, y : CC_0$ the map is an equivalence.
Question: are the two different definitions of a category equivalent? \
Answer: yes.
We don't have a category of all types. We are restricting ourselves to 1-categories, no interesting structure higher than morphisms.
== Why is this good?
Most important reason is that in category theory, we view objects up to isomorphism. Objects should have the same properties if they are isomorphic.
In set-theoretic foundations, you would have to prove that the properties hold under isomorphism manually. With univalent categories, you would get this for free.
In set theory, uniqueness also means unique up to isomorphism. In univalent categories, this uniqueness becomes "real" uniqueness. We can say things like "the type of initial objects is a proposition".
There's also a semantic aspect. If we just stayed in categories without univalence, we would not get something that corresponds to ...
== $SET$ is univalent
How to prove $SET$ is univalent: we can factor $idtoiso$
#align(center)[#commutative-diagram(
node((0,-1),$x propeq y$),
node((0,1),$x tilde.equiv y$),
node((1,0), $x tilde.eq y$),
arr($x propeq y$, $x tilde.equiv y$, $idtoiso_(x,y)$),
arr($x propeq y$, $x tilde.eq y$, $tilde.eq$),
arr($x tilde.eq y$, $x tilde.equiv y$, $tilde.eq$)
)]
This way, $idtoiso$ is equal to an equivalence.
In univalence, equivalence is related to isomorphism. This is related to SIP: equality is the same as isomorphism.
Monoids have more complicated structure, so we need something else to help us do the proofs.
== Displayed categories