completion of category is idempotent

The question belongs to elementary category theory, so please forgive me if this is trivial. I think I even read a proof for this some weeks ago, but I can't find it.

In topology, you have the equation $\overline{\overline{A}}=\overline{A}$ for subsets $A$ of a topological space $X$. An analogous theorem in category theory would be: let $X$ be a complete category, and $A$ be a full subcategory of $X$. define $\overline{A}$ as the full subcategory of $X$ consisting of those objects that are limits of small diagrams in $C$, whose objects are in $A$. Do we have $\overline{\overline{A}}=\overline{A}$?

Let's try it: assume $x_i$ is a diagram in $\overline{A}$ and $(y_{ij})_j$ is a diagram in $A$ such that $x_i = \lim_j y_{ij}$. then $\lim_i x_i = \lim_i \lim_j y_{ij}$ and we want to interchange limits. But to do this, we have to make $y_{ij}$ to a diagram in two parameters $i,j$. Perhaps the claim can't be proved in that naive way?

It is easy to see that $\overline{A}$ is closed under products: with the notation above, a morphism $(i,j) \to (i',j')$ corresponds to $i=i'$ and a morphism $j \to j'$. Then $y_{ij}$ is a diagram in two parameters with limit $lim_i x_i$. so it remains to consider equalizers, but how? The problem is here that morphisms between two limits cannot be described in terms of the factors.

Perhaps one should look at examples. Let $X$ be the category of groups, and $A$ the category of finite groups. Then $\overline{A}$ consists of the groups which come from profinite groups, which are exactly the compact, hausdorff, totally disconnected topological groups. Now the category of profinite groups is complete (due to this description) and the forgetful functor to groups preserves limits. Thus in this case, $\overline{\overline{A}} = \overline{A}$. if we put $A=\{\mathbb{Z}/n\}$, $X$ as before, then a similar argument works with the help of $\mathbb{Z}/n$-modules.

EDIT: ok david has given a counterexample. does anyone have an idea how to "fix" this? So what is the "right" definition of $\overline{A}$, so that $\overline{\overline{A}} = \overline{A}$? also, Harry asked for a condition in order this becomes true with my definition.

-
ncatlab.org/nlab/show/limit . Please read the whole page. I found at least the answer to your "let's try it", but in fact, I believe the total answer is there. – Harry Gindi Jan 3 '10 at 10:56
I know this. please read my question carefully! – Martin Brandenburg Jan 3 '10 at 11:00
Please read the page carefully. What you're talking about is constructed explicitly! – Harry Gindi Jan 3 '10 at 11:12
as I said, in order to interchange limits, we have to start with a functor which has two parameters. in the nlab page, there is no discussion going beyond that. the problem is that in the situation above, there is no obvious way to make $y_{ij}$ functorial in both $i$ and $j$. – Martin Brandenburg Jan 3 '10 at 11:18
you miss the dependancy between the diagrams. in the notation of my post, the diagram $(y_{ij})_j$ depends on $i$. – Martin Brandenburg Jan 3 '10 at 11:38

The answer is no. Here is my counterexample:

ARGUMENT SIMPLIFIED, THANKS TO SUGGESTIONS BY Reid, Scott Carnahan AND t3suji

Let $X$ be the category of abelian groups. Let $A$ be the full subcategory on groups of the form $(\mbox{finite group}) \oplus (\mathbb{Q}-\mbox{vector space})$.

Let $D$ be any diagram in $A$. Every object $G$ in $D$ decomposes as $G_{\mathrm{fin}} \oplus G_{\mathbb{Q}}$. Because there are no nonzero homs from a finite group to $\mathbb{Q}$ or vice versa, the diagram $D$ decomposes correspondingly as $D_{\mathrm{fin}} \oplus D_{\mathbb{Q}}$. Let $P$ be the limit of $D_{\mathrm{fin}}$; this is a pro-finite group. Let $V$ be the limit of $D_{\mathbb{Q}}$; this is a $\mathbb{Q}$ vector space. Then $P \oplus V$ is the limit of $D$.

Fix a prime $p$. Let $R \subset \mathbb{Q}$ be the abelian group of rational numbers whose denominator is relatively prime to $p$. Notice that $R = \mathbb{Q} \cap \mathbb{Z}_p$, where the intersection takes place in $\mathbb{Q}_p$. The group $R$ is not an object of $\overline{A}$, because it is not of the form $P \oplus V$ as above.

Let $W$ be the set of all linear maps $\mathbb{Q}_p \to \mathbb{Q}$ for which the element $1$ of $\mathbb{Q}_p$ is sent to the element $1$ in $\mathbb{Q}$. Assuming the axiom of choice, the subspace of $\mathbb{Q}_p$ where all the maps in $W$ coincide is $\mathbb{Q}$.

Consider the diagram in $\overline{A}$ whose objects are $\mathbb{Z}_p$ and $\mathbb{Q}$, and whose maps are the restrictions to $\mathbb{Z}_p$ of the maps in $W$. Then the equalizer of this diagram is $\mathbb{Z}_p \cap \mathbb{Q}$. As observed above, this is $R$, which is not in $\overline{A}$.

-
For those concerned about set theoretic issues: I only need a countable sequence of finite abelian groups to get to Z_p. As a tensor product of sets, X is a set. Hom(X,Q) is a subset of 2^{X \times Q}, so it is a set, and W is a subset of Hom(X,Q). – David Speyer Jan 3 '10 at 16:55
Couldn't you just use Q_p instead of defining X? – S. Carnahan Jan 3 '10 at 17:26
Can I suggest the following modification of your modification :) Each group $G$ in $A$ can be written as a direct sum (=product) $G_1\oplus G_2$ where $G_1$ is finite and $G_2$ is a vector space: one of these two subgroups always vanish. Morphisms of $A$ respect such decomposition, thus a projective limit in $A$ can be written as a projective limit of products=product of projective limits. This is exactly what you do. – t3suji Jan 3 '10 at 18:48
@Martin: The morphism you describe does not arise from a diagram in the category A, so it is not a counterexample. The existence of morphisms in $\overline{A}$ that are not limits of maps in A is the main reason why the answer to your question is negative, and the nontriviality of W is one manifestation of that. – S. Carnahan Jan 3 '10 at 21:05
@Martin: "there exists an injective homomorphism $\prod_{p \text{prime}} \mathbb{Z}/p \to \mathbb{C}$". Certainly not: if so, it would restrict to an injection on the direct sum, and we would have an embedding of an infinite torsion abelian group into a torsionfree abelian group. (I didn't really follow the whole discussion, but maybe you meant "nontrivial" instead of "injective"?) – Pete L. Clark Jan 3 '10 at 23:05

The right definition is rather trivial: take $\bar A$ to be the intersection of all full subcategories of C containing A and which are closed in C under limits. Clearly, if A was already closed under limits, then $A = \bar A$.

The question is then, when can one give a more concrete description of $\bar A$.

-
then $\overline{A} = \overline{\overline{A}}$ is equivalent to that $\overline{A}$ is closed under taking limits. when I want to prove this, I get the same difficulties as before. – Martin Brandenburg Jan 4 '10 at 0:14
Hmm? the intersection of full subcategories closed under limits is itself closed under limits... – Reid Barton Jan 4 '10 at 0:22
... and I can't prove this. – Martin Brandenburg Jan 4 '10 at 1:11
There's nothing to it. To show the limit of a diagram in the intersection of subcategories closed under limits is again in the intersection, we need to show it is in each subcategory, but it is, because the limit is also composed of objects in that category. – Reid Barton Jan 4 '10 at 1:44
But if X is small and complete, then X is a poset, so in fact the sequence stabilizes at A(1). – Reid Barton Jan 4 '10 at 2:18