After several years of absence, I seem to have lost track of the very basic of number theory. In my head, I know what I am allowed to do, but not why I am allowed to do it. I have been consulting Wikipedia's list of properties of modular arithmetic, but I can't find any property that matches up to the following:
What property of modular arithmetic lets us conclude that $a^{2b}\mod{n} \equiv a^{b}\mod{n} \cdot a^{b}\mod{n}$ for $a,b,n \in \mathbb{Z}$? I worry that I've confused the Computer Science style of "mod as in remainder upon division" and the mathematics style of "mod as in congruence", but I was sure that this worked for both. For example, I am confident that $5^4\mod{3} = 5^{2}\mod{3} \cdot 5^{2}\mod{3}=(5^{2}\mod{3})^2=(5\mod{3})^4 =(2\mod{3})^4 =(2)^4\mod{3} = 16 \mod{3} = 1\mod{3}$ is completely valid.