## Transitivity of subdirect products

Let $S$ be a semigroup. Suppose $S$ is a subdirect product of the family $\{S_a\}_A$, and that for each $a \in A$, $S_a$ is a subdirect product of the family $\{S_{b,a}\}_{B_a}$. Show that $S$ is a subdirect product of the family $\{S_{b,a}\}_{B_a,A}$. (Roughly speaking, subdirect productness is transitive.)

By definition, we have injective semigroup homomorphisms $\varphi : S \rightarrow \prod_A S_a$ and $\psi_a : S_a \rightarrow \prod_{B_a} S_{b,a}$ which are surjective in each component. Now for each $a \in A$ and $b \in B_a$, $\zeta_{b,a} = \pi_{b,a} \circ \psi_a \circ \pi_a \circ \varphi : S \rightarrow S_{b,a}$ is a surjective homomorphism (being the composite of two surjective homomorphisms).

Consider the induced family of congruences $\sigma_{b,a} = \mathsf{ker}\ \zeta_{b,a}$. Let $x,y \in S$; since $S$ is a subdirect product of the $S_a$, there exist $a_1$, $a_2$ such that $(\pi_{a_1} \circ \varphi)(x) \neq (\pi_{a_2} \circ \varphi)(y)$, and so in particular $x$ and $y$ are separated by the congruences $\sigma_{b,a}$. By Proposition II.1.4, $S$ is a subdirect product of the family $S/\sigma_{b,a}$, which are naturally isomorphic to $S_{b,a}$ by the First Isomorphism Theorem. So $S$ is a subdirect product of the $S_{b,a}$.