open import Cat.Functor.Base open import Cat.Prelude import Cat.Diagram.Idempotent as CI module Cat.Instances.Karoubi {o h} (C : Precategory o h) where
Karoubi envelopesπ
We give a construction of the Karoubi envelope of a precategory , a formal construction which adds a choice of splittings for every idempotent in . Furthermore, the Karoubi envelope is the smallest idempotent-complete category which admits a map from , in the sense that any into an idempotent-complete category factors through :
Furthermore, the embedding functor is fully faithful.
The objects
in are given by pairs of an object and an idempotent . A map between and is given by a map which absorbs from the left and from the right: .
private KOb : Type (o β h) KOb = Ξ£[ c β C.Ob ] Ξ£[ f β C.Hom c c ] (is-idempotent f) KHom : KOb β KOb β Type h KHom (c , f , _) (d , g , _) = Ξ£[ Ο β C.Hom c d ] ((Ο C.β f β‘ Ο) Γ (g C.β Ο β‘ Ο)) KHβ‘ : β {a b : C.Ob} {af : C.Hom a a} {bf : C.Hom b b} {ai : is-idempotent af} {bi : is-idempotent bf} {f g : KHom (a , af , ai) (b , bf , bi)} β fst f β‘ fst g β f β‘ g KHβ‘ = Ξ£-prop-path (Ξ» _ β hlevel 1)
We can see that these data assemble into a precategory. However, note that the identity on in isnβt the identity in , itβs the chosen idempotent !
Karoubi : Precategory (o β h) h Karoubi .Ob = KOb Karoubi .Hom = KHom Karoubi .Hom-set _ _ = hlevel 2 Karoubi .id {x = c , e , i} = e , i , i Karoubi ._β_ (f , fp , fp') (g , gp , gp') = f C.β g , C.pullr gp , C.pulll fp' Karoubi .idr {x = _ , _ , i} {_ , _ , j} (f , p , q) = KHβ‘ {ai = i} {bi = j} p Karoubi .idl {x = _ , _ , i} {_ , _ , j} (f , p , q) = KHβ‘ {ai = i} {bi = j} q Karoubi .assoc {w = _ , _ , i} {z = _ , _ , j} _ _ _ = KHβ‘ {ai = i} {bi = j} (C.assoc _ _ _)
We can now define the embedding functor from C to its Karoubi envelope. It has object part ; The morphism part of the functor has to send to some which absorbs on either side; But this is just again.
Embed : Functor C Karoubi Embed .Fβ x = x , C.id , C.idr _ Embed .Fβ f = f , C.idr _ , C.idl _ Embed .F-id = KHβ‘ {ai = C.idl _} {bi = C.idl _} refl Embed .F-β f g = KHβ‘ {ai = C.idl _} {bi = C.idl _} refl
An elementary argument shows that the morphism part of Embed has an inverse given by projecting the first component of the pair; Hence, Embed
is fully faithful.
Embed-is-fully-faithful : is-fully-faithful Embed Embed-is-fully-faithful = is-isoβis-equiv $ iso fst (Ξ» _ β Ξ£-prop-path (Ξ» _ β hlevel 1) refl) Ξ» _ β refl
Idempotent-completenessπ
We now show that any idempotent admits a splitting in . First, note that since is (by assumption) idempotent, we have an object given by ; Weβll split as a map
The first map is given by the underlying map of . We must show that , but we have this by the definition of maps in . In the other direction, we can again take , which also satisfies .
is-idempotent-complete-Karoubi : CI.is-idempotent-complete Karoubi is-idempotent-complete-Karoubi {A = A , e , i} (f , p , q) idem = spl where open CI.is-split f-idem : f C.β f β‘ f f-idem i = idem i .fst spl : CI.is-split Karoubi (f , p , q) spl .F = A , f , f-idem spl .project = f , p , f-idem spl .inject = f , f-idem , q
For this to be a splitting of , we must show that as a map , which we have by assumption; And we must show that as a map . But recall that the identity on is , so we also have this by assumption!
spl .pβi = KHβ‘ {ai = f-idem} {bi = f-idem} f-idem spl .iβp = KHβ‘ {ai = i} {bi = i} f-idem
Hence is an idempotent-complete category which admits as a full subcategory.