module Cat.Instances.FinSets where
The category of finite setsđ
Throughout this page, let be a natural number and denote the standard ordinal. The category of finite sets, is the category with set of objects the natural numbers, with set of maps the set of functions This category is not univalent, but it is weakly equivalent to the full subcategory of on those objects which are merely isomorphic to a finite ordinal. The reason for this âskeletalâ definition is that is a small category, so that presheaves on are a Grothendieck topos.
: Precategory lzero lzero
FinSets .Precategory.Ob = Nat
FinSets .Precategory.Hom j k = Fin j â Fin k
FinSets .Precategory.Hom-set x y = hlevel 2
FinSets .Precategory.id x = x
FinSets .Precategory._â_ f g x = f (g x)
FinSets .Precategory.idr f = refl
FinSets .Precategory.idl f = refl
FinSets .Precategory.assoc f g h = refl FinSets
The category of finite sets can be seen as a full subcategory of the category of sets via the fully faithful inclusion functor that sends to
: Functor FinSets (Sets lzero)
FinâSets .Fâ n = el! (Fin n)
FinâSets .Fâ f = f
FinâSets .F-id = refl
FinâSets .F-â _ _ = refl
FinâSets
: is-fully-faithful FinâSets
FinâSets-is-ff = id-equiv FinâSets-is-ff
As we said earlier, FinSets
is
skeletal: this follows directly
from the injectivity of Fin
.
: is-skeletal FinSets
FinSets-is-skeletal = path-from-has-isoâis-skeletal _ $ rec! λ is â
FinSets-is-skeletal (isoâequiv (F-map-iso FinâSets is)) Fin-injective
Finite limits and colimitsđ
The nice closure properties of finite sets, along with the fact that fully faithful functors reflect (co)limits, imply that the category admits finite products and coproducts, equalisers and coequalisers, making it finitely complete and finitely cocomplete.
: Finitely-complete FinSets
FinSets-finitely-complete = with-equalisers _ terminal products equalisers where
FinSets-finitely-complete : Terminal FinSets
terminal = ffâreflects-Terminal FinâSets FinâSets-is-ff
terminal
Sets-terminal(equivâiso (is-contrââ (hlevel 0) Finite-one-is-contr))
: has-products FinSets
products = ffâreflects-Product FinâSets FinâSets-is-ff
products a b (Sets-products _ _)
(equivâiso Finite-multiply)
: has-equalisers FinSets
equalisers = ffâreflects-Equaliser FinâSets FinâSets-is-ff
equalisers f g (Sets-equalisers f g)
(equivâiso (Finite-subset (λ x â f x ⥠g x) .snd eâ»Âč))
: Finitely-cocomplete FinSets
FinSets-finitely-cocomplete = with-coequalisers _ initial coproducts coequalisers where
FinSets-finitely-cocomplete : Initial FinSets
initial = ffâreflects-Initial FinâSets FinâSets-is-ff
initial
Sets-initial(equivâiso (Lift-â âe Finite-zero-is-initial eâ»Âč))
: has-coproducts FinSets
coproducts = ffâreflects-Coproduct FinâSets FinâSets-is-ff
coproducts a b (Sets-coproducts _ _)
(equivâiso Finite-coproduct)
: has-coequalisers FinSets
coequalisers = ffâreflects-Coequaliser FinâSets FinâSets-is-ff
coequalisers f g (Sets-coequalisers f g)
(equivâiso (Finite-coequaliser f g .snd eâ»Âč))