Are compact objects in presheaf categories finite colimits of representables? An object $x$ in a category $\mathsf{C}$ is called compact or finitely presentable if $$\mathrm{hom}(x,-) : \mathsf{C} \to \mathsf{Set}$$  preserves filtered colimits.  This concept behaves best when $\mathsf{C}$ has all filtered colimits, e.g. when it is the category of presheaves on some small category $\mathsf{X}$:
$$ \mathsf{C} = \mathsf{Set}^{\mathsf{X}^{\mathrm{op}}} $$
Every representable presheaf is compact.  In general, any finite colimit of compact objects is compact.  Thus, any finite colimit of representables is compact.
My question is about the converse: in the category of presheaves on a small category, is every compact object a finite colimit of representables?
 A: I think that Aurelien Djament's answer is essentially correct, but I want to nitpick a bit.


*

*If $\mathcal A$ is any locally finitely presentable category and $\mathcal C \subseteq \mathcal A$ is any strong generator of finitely-presentable objects, then every finitely-presentable object $X \in \mathcal A$ lies in the closure of $\mathcal C$ under finite colimits. So $X$ is a finite colimit of finite colimits of ... of finite colimits of objects of $\mathcal C$ -- an "$n$-fold" finite colimit of objects of $\mathcal C$. But $X$ need not be a "1-step" finite colimit of objects of $\mathcal C$. For example, I don't think every finitely-presented group is a finite colimit of copies of $\mathbb Z$.

*One might strengthen the hypotheses and ask: if $\mathcal A$ is a locally finitely presentable category and $\mathcal C \subseteq \mathcal A$ is a dense generator, then is every finitely-presentable object $X \in \mathcal A$ a finite colimit of objects of $\mathcal C$? I don't know the answer to this.

*But let's focus on the question at hand, i.e. the case where $\mathcal A = \hat {\mathcal C}$ is a presheaf category and $\mathcal C$ is the representables. Let $\tilde {\mathcal C}$ comprise the finite colimits of representables. Then indeed, $\tilde {\mathcal C}$ is closed under finite colimits. This is clear for finite coproducts -- just take the coproduct of the indexing diagrams for the colimits. Now let $A\rightrightarrows B \to C$ be a coequalizer where $A,B \in \tilde {\mathcal C}$. Then there is an epimorphism $\amalg_i X_i \to A$ and a coequalizer diagram $\amalg_j Y_j \rightrightarrows \amalg_k Z_k \to B$ where $X_i,Y_j,Z_k \in \mathcal C$ and the coproducts are finite. The composite maps $\amalg_i X_i \to A \rightrightarrows B$ lift to maps $\amalg_i X_i \rightrightarrows \amalg_k Z_k$. Then we have that $C$ is the coequalizer of the two induced maps $(\amalg_i X_i) \amalg (\amalg_j Y_j) \rightrightarrows \amalg_k Z_k$.
Now I claim that if $f,g \amalg_{i \in I} X_i \rightrightarrows \amalg_{k \in K} Z_k$ are two maps with coequalizer $C$, and if the $X_i$ are representable, then $C$ is the colimit of the following diagram. Indeed, for each $i \in I$, there is a unique $k = k_0(i) \in K$ such that $X_i \to \amalg_{i \in I} X_i \xrightarrow f \amalg_{k \in K} Z_k$ factors through $Z_k$, and similarly a $k_1(i)$ for $g$. The indexing set for our diagram has object set $I \amalg K$, and the nonidentity morphisms are a map $i \to k_0(i)$ and a map $i \to k_1(i)$ for each $i \in I$. Then $C$ is the colimit of the obvious diagram sending $i \mapsto X_i$ and $k \mapsto Z_k$. This diagram is finite if $I$ and $K$ are.
Thus in our case, $C \in \tilde{\mathcal C}$ as desired.
I want to emphasize that here we heavily used the fact that we're in a presheaf category.


*I agree that any category which has finite colimits and filtered colimits has all colimits. But Aurelien's second bullet seems to suggest something stronger -- that if $X$ is a colimit of objects of $\mathcal C$, then $X$ is a filtered colimit of finite colimits of objects of $\mathcal C$. I don't have a counterexample, but I'm not sure this is true. The closest I can convince myself of is that $X$ is a coequalizer of coproducts of objects of $\mathcal C$, and therefore a coequalizer of filtered colimits of finite coproducts of objects of $\mathcal C$ -- but this only ensures that $X$ is a finite colimit of filtered colimits of finite colimits of objects of $\mathcal C$.

*But using (3), Aurelien's third bullet goes through with some modification. As in any locally finitely presentable category $\mathcal A$ with strong generator $\mathcal C$, any finitely-presentable object is in the closure of the $\mathcal C$ under finite colimits. By (3), in the case $\mathcal A = \hat{\mathcal C}$, the closure of $\mathcal C$ under finite colimits consists exactly of $\tilde{\mathcal C}$, the objects which are "1-step" finite colimits of representables. Here, (3) is actually used in 2 places: first to ensure that the category $\tilde C \downarrow X$ is filtered (this being the diagram which indexes the canonical colimit for $X$), and second to ensure that $\tilde{\mathcal C}$ is closed under retracts.
A: Here is another perspective on the problem, using some big guns (Gabriel-Ulmer duality). 
Given a small category $C$, let $K$ be its free finite cocompletion. This means $K^{op}$ is the free finite completion of $C^{op}$, which means in turn that for any functor $F: C^{op} \to \mathbf{Set}$, there is a finitely continuous (or left exact) functor $\tilde{F}: K^{op} \to \mathbf{Set}$ that extends $F$ along the canonical inclusion $i: C^{op} \to K^{op}$, and this extension is unique up to unique isomorphism. Put differently, restriction along $i$ induces an equivalence 
$$\mathrm{Lex}(K^{op}, \mathbf{Set}) \to \mathrm{Cat}(C^{op}, \mathbf{Set}).$$ 
In particular, the presheaf category $\mathrm{Cat}(C^{op}, \mathbf{Set})$ is locally finitely presentable. By the way, it's well known that the free finite cocompletion $K$ of a small category $C$ is simply the category of finite colimits of representables: see section 5.9 of Kelly's Basic Concepts of Enriched Category Theory.  
On the other hand, Gabriel-Ulmer duality assures us that given a locally finitely presentable category $A$, there is up to equivalence only one finitely complete category $L$ for which $A \simeq \mathrm{Lex}(L, \mathbf{Set})$. Even better, Gabriel-Ulmer duality gives a recipe for obtaining $L$: it is the dual of the category of compact objects in $A$, meaning objects $a$ such that $A(a, -): A \to \mathbf{Set}$ preserves filtered colimits. 
Putting all this together, this shows that the category of compact objects in the category of presheaves over $C$ is equivalent to the free finite cocompletion of $C$, or to the category of finite colimits of representable presheaves. 
A: Yes, it is. The reason is:


*

*every object of your presheaf category is a colimit of representables;

*so, every object is a filtered colimit of objects which are finite colimits of representables;

*so, applying the definition of a compact object, you get a split monomorphism from your compact object $X$ to a finite colimit $T$ of representables. To conclude, write $X$ as the coequaliser of $Id_T$ and the idempotent of $T$ given by your split mono.

