An object $P$ in a category is projective if the Hom-set $Hom(P,-)$ preserves epi. Considering the presheaf topos $\hat{C}=\mathbf{Sets}^{C^{op}}$, how can I show that an object in this category is projective then the object is a retract of a coproduct of representables?
I know that a representable is projective and the coproduct of representables is projective. I also think of that a presheaf is a colimit of representables. But I'm not sure how to relate these two to solve the question.
In a category with the relevant coproducts, every colimit can be written as the coequalizer of a coproduct. In particular, every presheaf $P$ has the form of a coequalizer
$$ \coprod_i U_i \rightrightarrows \coprod_j V_j \xrightarrow{\rho} P $$
where the $U_i$ and $V_j$ are represenetables.
Coequalizers are epic, so we can apply the given property of $P$:
$$ \hom\left(P, \coprod_j V_j \right) \xrightarrow{\rho_*} \hom(P, P)$$
is surjective. In particular, there is a map $\lambda : P \to \coprod_j V_j$ such that $\rho \circ \lambda = 1_P$.