I'm currently reading some stuff on Hopf algebras, specifically Hopf Algebras: An Introduction by Sorin Dascalescu, Constantin Nastasescu and Serban Raianu. One proof involves showing that for a Hopf algebra $H$ with antipode $S$ that $$\Delta(S(h)) = \sum S(h^{(2)})\otimes S(h^{(1)})$$ In part of the proof a map $G : H\to H\otimes H$ is defined to be $(S\otimes S)\circ \Delta^{op}$ and the goal is to show that $\Delta$ is a right convolution inverse of $G$. That is that $G\star \Delta = (\eta_{H}\otimes \eta_{H})\circ \varepsilon_H$. The proof given runs as follows: \begin{align*} (G\star \Delta)(h) = \sum G(h^{(1)})\Delta(h^{(2)}) = \sum (S((h^{(1)})^{(2)})\otimes S((h^{(1)})^{(1)})((h^{(2)})^{(1)}\otimes (h^{(2)})^{(2)}) \end{align*} $$=\sum (S(h^{(2)})\otimes S(h^{(1)}))(h^{(3)}\otimes h^{(4)}) = \sum S(h^{(2)})h^{(3)}\otimes S(h^{(1)})h^{(4)}$$ $$= \sum S((h^{(2)})^{(1)})(h^{(2)})^{(2)}\otimes S(h^{(1)})h^{(3)} = \sum \varepsilon(h^{(2)})1\otimes S(h^{(1)})h^{(3)}$$ $$= \sum 1\otimes S(h^{(1)})\varepsilon((h^{(2)})^{(1)})(h^{(2)})^{(2)} = \sum 1\otimes S(h^{(1)})h^{(2)} = 1\otimes \varepsilon(h)1$$ $$= ((\eta_{H}\otimes \eta_{H})\circ \varepsilon_{H})(h)$$ Now, the first line makes sense, but after that seems to turn into magic. I know that Sweedler notation is being heavily used, but it seems they are just magically making the computation work with all the nifty switching of Sweedler indices. Can anyone help clarify what is going on here? Thanks in advance.

As you rightly observed, the poof has much to do with the formalism of the Sweedler notation. I'll try to explain the usuage. Let's start with the identity
$$\Delta_2 := (\Delta \otimes id) \circ \Delta =(id \otimes \Delta) \circ \Delta$$
Depending on the position of the outer $\Delta$ one has respective structural identities: Similarly, we have $$\Delta_3 := (id \otimes \Delta \otimes id) \circ \Delta_2= (\Delta \otimes \Delta) \circ \Delta $$ Again, there are structural identities $$\begin{array}{rl} \Delta_3(h) = & \sum h^{(1)} \otimes h^{(2)} \otimes h^{(3)} \otimes h^{(4)}& \newline = & \sum h^{(1)} \otimes (h^{(2)})^{(1)}\otimes (h^{(2)})^{(2)} \otimes h^{(3)} \newline = & \sum (h^{(1)})^{(1)} \otimes (h^{(1)})^{(2)} \otimes (h^{(2)})^{(1)} \otimes (h^{(2)})^{(2)} \newline \end{array}$$ Now let's have a look at the proof in question. Denote the multiplication by $\mu$. The third equality, for example, is obtained by $$\begin{array}{ll} & \sum (S((h^{(1)})^{(2)})\otimes S((h^{(1)})^{(1)})((h^{(2)})^{(1)}\otimes (h^{(2)})^{(2)}) \newline = & \big (\mu \circ ( (S \otimes S)^{op} \otimes id \otimes id)\big )\big (\sum (h^{(1)})^{(2)}\otimes (h^{(1)})^{(1)} \otimes (h^{(2)})^{(1)}\otimes (h^{(2)})^{(2)}\big) \newline = & \big (\mu \circ ( (S \otimes S)^{op} \otimes id \otimes id)\big ) (\sum h^{(1)} \otimes h^{(2)} \otimes h^{(3)} \otimes h^{(4)} ) \newline = & \sum \big(S(h^{(2)}) \otimes S(h^{(1)})\big)\big(h^{(3)} \otimes h^{(4)}\big) \end{array}$$ To obtain the the fith equation, let $$T(h^{(1)} \otimes h^{(2)} \otimes h^{(3)} \otimes h^{(4)}) = h^{(2)} \otimes h^{(3)} \otimes h^{(1)} \otimes h^{(4)}$$ Then: $$\begin{array}{ll} & \sum S(h^{(2)})h^{(3)}\otimes S(h^{(1)})h^{(4)} \newline = & \big( (\mu \circ (S \otimes id) \otimes \mu \circ (S \otimes id)) \circ T\big) \big( \sum h^{(1)} \otimes h^{(2)} \otimes h^{(3)} \otimes h^{(4)} \big) \end{array}$$ Now applying the 2nd structural identity for $\Delta_3$ above yields $$\sum S(h^{(2)})h^{(3)}\otimes S(h^{(1)})h^{(4)} = \sum S((h^{(2)})^{(1)})(h^{(2)})^{(2)}\otimes S(h^{(1)})h^{(3)} $$ Remark: Of course, one usually doesn't make a detour around expressing everything in the form $$\text{homomorphism}(\sum h^{(1)} \otimes h^{(2)} \otimes h^{(3)} \otimes h^{(4)})$$ but directly applies the homomorphisms elementwise. But I hope the principal becomes clearer that way. 

