Solution (source code)

= Solution

The statement that limits of shape $\mathcal I$ commute with colimits of shape $\mathcal J$ means that for every $D:\mathcal I\times\mathcal J\to\mathcal C$, the canonical <commutation of limits and colimits> map
$$
\operatorname*{colim}_{j\in\mathcal J}\operatorname*{lim}_{i\in\mathcal I}D(i,j)
\longrightarrow
\operatorname*{lim}_{i\in\mathcal I}\operatorname*{colim}_{j\in\mathcal J}D(i,j)
$$
is an isomorphism whenever the iterated limits and colimits exist.

A <filtered category> is a nonempty category in which every finite diagram has a cocone. Equivalently, any two objects map to a common object and any parallel pair becomes equal after postcomposition. A <weakly filtered category> requires cocones only for finite connected diagrams; equivalently, each connected component is filtered.

Write a weakly filtered category as the disjoint union $\coprod_s\mathcal J_s$ of its filtered connected components. Its colimit is the coproduct of the filtered colimits over the $\mathcal J_s$. In sets, a connected finite limit commutes with coproducts: connectedness forces all coordinates of a compatible tuple to lie in the same coproduct summand. By the assumed theorem, the filtered colimit over each $\mathcal J_s$ commutes with every finite limit. Applying these two facts successively proves that weakly filtered colimits commute with connected finite limits in $\mathbf{Set}$.

The forgetful functor from <abelian group> to sets creates finite limits and filtered colimits and reflects isomorphisms. The comparison map for a filtered colimit and a finite limit therefore becomes the corresponding isomorphism of sets, so filtered colimits commute with finite limits in $\mathbf{AbGp}$.

The dual claim fails because <inverse limit> need not preserve epimorphisms. Take the inverse systems
$$
A_n=\mathbb Z,
\qquad B_n=\mathbb Z/2^n\mathbb Z,
$$
with identity bonding maps on $A_n$, reduction maps on $B_n$, and levelwise epimorphisms $q_n:A_n\to B_n$. Then
$$
\varprojlim A_n=\mathbb Z,
\qquad
\varprojlim B_n=\mathbb Z_2,
$$
and the induced map $\mathbb Z\to\mathbb Z_2$ is not surjective. Since an epimorphism in <abelian group>[abelian groups] is a finite-colimit cokernel, cofiltered limits do not commute with finite colimits in $\mathbf{AbGp}$.