When calculating with numbers from a $\mathbb{Z}/2\mathbb{Z}$ how do you deal with unknown variables? For example, if I have the following term:
$(a - 1)(a - 1) - (a - 1) - (a - 1) = a^2 + 1$
Or is this incorrect?
When calculating with numbers from a $\mathbb{Z}/2\mathbb{Z}$ how do you deal with unknown variables? For example, if I have the following term:
$(a - 1)(a - 1) - (a - 1) - (a - 1) = a^2 + 1$
Or is this incorrect?
$\mathbb{Z}/2\mathbb{Z}$ is a ring with characteristic $2$, so that means that, for any $x\in\mathbb{Z}/2\mathbb{Z}n$, then $x+x=0$. From this, we know directly that the part $-(a-1)-(a-1)=0$, so we're left with
$$(a-1)(a-1),$$ and calculating it normally we get that $$(a-1)(a-1)=a^2-2a+1,$$ but $2 \equiv 0$ in $\mathbb{Z}/2\mathbb{Z}$, so we conclude that $$(a - 1)(a - 1) - (a - 1) - (a - 1) = a^2 + 1$$ and you were right.
$\newcommand{\Z}{\mathbb{Z}}$First note that \begin{align*} (a-1)(a-1) - (a-1) - (a-1) &= a^2 + 1 - a + 1 - a + 1\\ &= a^2 - 2a + 3 \end{align*} At least under more normal circumstances. In $\Z/2\Z$, though, $2x=0$ for every $x \in \Z / 2 \Z$. This does, in fact, include variables. (After all, the variables are eventually elements from $\Z / 2 \Z$, we just don't know which ones.) Thus,
$$-2a = -(2a) = 0 \qquad 3 = 2 + 1 = 0 + 1 = 1$$
(This might be easier to grasp if you recall that $\Z/2\Z$ is, in reality, sets of equivalence classes rather than strictly numbers: that is, the statement $3=1$ means, rather, "$3$ and $1$ share the same equivalence class in $\Z/2\Z$.")
And thus,
$$(a-1)(a-1) - (a-1) - (a-1) = a^2 + 1$$
as you would expect.
Notice that $a^2\equiv a$ in $\mathbb Z/2\mathbb Z\quad$ (since $0^2=0$ and $1^2=1$).
So you can also simplify this way
$\require{cancel}\underbrace{(a-1)(a-1)}_{=(a-1)}-(a-1)-(a-1)\equiv \cancel{(a-1)}-\cancel{(a-1)}-(a-1)\equiv 1-a\pmod 2$
Since $2a\equiv 0$ you also have $1-a\equiv 1-a+2a\equiv 1+a\pmod 2$
Which is the same as $\quad 1+a^2\equiv 1+a\pmod 2\quad$ by the way.
We can go further and write this $\tilde a$ since $1+a$ will just invert the parity of $a$.