module Cat.Finite where
Finite precategoriesπ
A precategory is finite if both its type of objects and its total space of morphisms are finite.
record is-finite-precategory {o β} (D : Precategory o β) : Type (o β β) where
constructor finite-cat
field
: Finite (Ob D)
β¦ has-finite-Ob β¦ : Finite (Arrows D)
β¦ has-finite-Arrows β¦
open is-finite-precategory
_ = Finite-Ξ£
_ = Finite-PathP
Conveniently, because finite types are closed
under Ξ£
, it suffices that each Hom
set be finite:
finite-cat-hom: β {o β} {D : Precategory o β}
β β¦ Finite (Ob D) β¦
β (β a b β Finite (Hom D a b))
β is-finite-precategory D
{D = D} f = finite-cat where
finite-cat-hom instance
: β {a b} β Finite (Hom D a b)
finite-Hom {a} {b} = f a b finite-Hom
Thanks to even more instance magic (path types of a finite type are finite
),
the discrete category on a finite set
is finite:
: β {β} {A : Type β} {isg : is-groupoid A} β β¦ Finite A β¦
Disc-finite β is-finite-precategory (Disc A isg)
= finite-cat Disc-finite