module Cat.Finite whereFinite 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
β¦ has-finite-Ob β¦ : Finite (Ob D)
β¦ has-finite-Arrows β¦ : Finite (Arrows D)
open is-finite-precategory_ = Finite-Ξ£
_ = Finite-PathPConveniently, 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
finite-cat-hom {D = D} f = finite-cat where
instance
finite-Hom : β {a b} β Finite (Hom D a b)
finite-Hom {a} {b} = f a bThanks to even more instance magic (path types of a finite type are finite),
the discrete category on a finite set
is finite:
Disc-finite : β {β} {A : Type β} {isg : is-groupoid A} β β¦ Finite A β¦
β is-finite-precategory (Disc A isg)
Disc-finite = finite-cat