module Cat.Diagram.Projective
{o β}
(C : Precategory o β)
where

# Projective objectsπ

Let be a precategory. An object is projective if for every morphism and epimorphism there merely exists a such that as in the following diagram:

More concisely, is projective if it has the left-lifting property relative to epimorphisms in

is-projective : (P : Ob) β Type _
is-projective P =
β {X Y} (p : Hom P Y) (e : X β  Y)
β β[ s β Hom P X ] (e .mor β s β‘ p)

If we take the perspective of generalized elements, then a projective object lets us pick a of from the preimage of a along every This endows with an internal version of the axiom of choice.

This intuition can be made more precise by noticing that every object of is projective if and only if every epimorphism (merely) splits. For the forward direction, let have a section and note that factorizes through

epis-splitβall-projective
: (β {X Y} β (e : X β  Y) β β₯ has-section (e .mor) β₯)
β β {P} β is-projective P
epis-splitβall-projective epi-split p e = do
s β epi-split e
pure (s .section β p , cancell (s .is-section))
where open has-section

Conversely, given an epi we can factorize to get our desired section

all-projectiveβepis-split
: (β {P} β is-projective P)
β β {X Y} β (e : X β  Y) β β₯ has-section (e .mor) β₯
all-projectiveβepis-split pro e = do
(s , p) β pro id e
pure (make-section s p)

This suggests that projective objects are quite hard to come by in constructive foundations! For the most part, this is true: constructively, the category of sets has very few projectives1, and many categories inherit their epimorphisms from However, it is still possible to have projectives if epis in are extremely structured, or there are very few maps out of some

For instance, observe that every epi splits in a pregroupoid, so every every object in a pregroupoid must be projective.

pregroupoidβall-projective
: is-pregroupoid C
β β {P} β is-projective P
pregroupoidβall-projective pregroupoid =
epis-splitβall-projective Ξ» e β
pure (invertibleβto-has-section (pregroupoid (e .mor)))

Likewise, if has an initial object then is projective, as there is a unique map out of

module _ (initial : Initial C) where
open Initial initial

initial-projective : is-projective bot
initial-projective p e = pure (Β‘ , Β‘-uniqueβ (e .mor β Β‘) p)

## A functorial definitionπ

Some authors prefer to define projective objects via a functorial approach. In particular, an object is projective if and only if the preserves epimorphisms.

For the forward direction, recall that in epis are surjective. This means that if is an epi in then is surjective, as preserves epis. This directly gives us the factorization we need!

preserves-episβprojective
: β {P}
β preserves-epis (Hom-from C P)
β is-projective P
preserves-episβprojective {P = P} hom-epi {X = X} {Y = Y} p e =
epiβsurjective (el! (Hom P X)) (el! (Hom P Y))
(e .mor β_)
(Ξ» {c} β hom-epi (e .epic) {c = c})
p

For the reverse direciton, let be projective, be an epi, and be a pair of functions into an arbitrary set such that for any To show that preserves epis, we must show that which follows directly from the existence of a lift for every

projectiveβpreserves-epis
: β {P}
β is-projective P
β preserves-epis (Hom-from C P)
projectiveβpreserves-epis pro {f = f} f-epi g h p =
ext Ξ» k β
rec!
(Ξ» s s-section β
g k       β‘Λ
g (f β s) β‘
h (f β s) β‘
h k       β)
(pro k (record { epic = f-epi }))

## Closure of projectivesπ

Projective objects are equipped with a mapping-out property, so they tend to interact nicely with other constructions that also have a mapping-out property. For instance, f and are both projective, then their coproduct is projective (if it exists).

coproduct-projective
: β {P Q P+Q} {ΞΉβ : Hom P P+Q} {ΞΉβ : Hom Q P+Q}
β is-projective P
β is-projective Q
β is-coproduct C ΞΉβ ΞΉβ
β is-projective P+Q
coproduct-projective {ΞΉβ = ΞΉβ} {ΞΉβ = ΞΉβ} P-pro Q-pro coprod p e = do
(sβ , sβ-factor) β P-pro (p β ΞΉβ) e
(sβ , sβ-factor) β Q-pro (p β ΞΉβ) e
pure $[ sβ , sβ ] , uniqueβ (pullr []βΞΉβ β sβ-factor) (pullr []βΞΉβ β sβ-factor) refl refl where open is-coproduct coprod We can extend this result to indexed coproducts, provided that the indexing type is set projective. indexed-coproduct-projective : β {ΞΊ} {Idx : Type ΞΊ} β {P : Idx β Ob} {βP : Ob} {ΞΉ : β i β Hom (P i) βP} β is-set-projective Idx β β (β i β is-projective (P i)) β is-indexed-coproduct C P ΞΉ β is-projective βP indexed-coproduct-projective {P = P} {ΞΉ = ΞΉ} Idx-pro P-pro coprod {X = X} {Y = Y} p e = do s β Idx-pro (Ξ» i β Ξ£[ sα΅’ β Hom (P i) X ] (e .mor β sα΅’ β‘ p β ΞΉ i)) (Ξ» i β hlevel 2) (Ξ» i β P-pro i (p β ΞΉ i) e) pure (match (Ξ» i β s i .fst) , uniqueβ (Ξ» i β pullr commute β s i .snd)) where open is-indexed-coproduct coprod Note that this projectivity requirement is required: if projective objects were closed under arbitrary coproducts, then we would immediately be able to prove the axiom of choice: the singleton set is both a projective object and a dense separator in so closure under arbitrary coproducts would mean that every set is projective, which is precisely the axiom of choice. Putting coproducts aside for a moment, note that projectives are closed under retracts. This follows by a straightforward bit of algebra. retractβprojective : β {R P} β is-projective P β (s : Hom R P) β has-retract s β is-projective R retractβprojective P-pro s r p e = do (t , t-factor) β P-pro (p β r .retract) e pure (t β s , pulll t-factor β cancelr (r .is-retract)) A nice consequence of this is that if has a zero object and a projective coproduct indexed by a discrete type, then each component of the coproduct is also projective. zero+indexed-coproduct-projectiveβprojective : β {ΞΊ} {Idx : Type ΞΊ} β¦ Idx-Discrete : Discrete Idx β¦ β {P : Idx β Ob} {βP : Ob} {ΞΉ : β i β Hom (P i) βP} β Zero C β is-indexed-coproduct C P ΞΉ β is-projective βP β β i β is-projective (P i) This follows immediately from the fact that if has a zero object and is indexed by a discrete type, then each coproduct inclusion has a retract. zero+indexed-coproduct-projectiveβprojective {ΞΉ = ΞΉ} z coprod βP-pro i = retractβprojective βP-pro (ΞΉ i)$
zeroβΞΉ-has-retract C coprod z i

## Enough projectivesπ

A category is said to have enough projectives if for object there is some with projective. We will refer to these projectives as projective presentations of

Note that there are two variations on this condition: one where there merely exists a projective presentation for every and another where those presentations are provided as structure. We prefer to work with the latter, as it tends to be less painful to work with.

record Projectives : Type (o β β) where
field
Pro : Ob β Ob
present : β {X} β Pro X β  X
projective : β {X} β is-projective (Pro X)

1. In fact, it is consistent that the only projective sets are the finite sets!β©οΈ