I want to simplify the following boolean function:
$$Z=A\bar B \bar{C_i} + \bar A B \bar{C_i} + \bar A\bar B {C_i} + A B {C_i}$$
Here's my attempt:
\begin{align} Z &= A\bar B \bar{C_i} + \bar A B \bar{C_i} + \bar A\bar B {C_i} + A B {C_i} \\ & = \bar{C_i}(A \bar B + \bar A B) + C_i(\bar A \bar B + AB) \\ & = \bar C_i(A \oplus B) + C_i(A \equiv B) \end{align}
I thought this was the end of it but in my textbook it continues and has: \begin{align} Z &= A\bar B \bar{C_i} + \bar A B \bar{C_i} + \bar A\bar B {C_i} + A B {C_i} \\ & = \bar{C_i}(A \bar B + \bar A B) + C_i(\bar A \bar B + AB) \\ & = \bar C_i(A \oplus B) + C_i(A \equiv B) \\ & = A \oplus B \oplus C_i \\ & = A \equiv B \equiv C_i \end{align}
I'm confused about what happened between the third and fourth step. What boolean algebra rules are being used here?