This question (and especially this answer and the comments on it) actually made me think about a sort of generalized modulo arithmetic that would deal with all modulos at once and would basically make all the notations equally valid.
Here's the formal definition:
Consider the set $\mathbb Z\times\mathbb N$. Now on that set define the equivalence relation $$(a,b) \sim (c,d) \text{ iff } b=d \text{ and } b|(a-c)$$ where the convention is used that $0|n$ iff $n=0$, so $(a,0)=(b,0)$ iff $a=b$. Be $M$ the set of equivalence classes under this relation. In the following I write the members of $M$ with square brackets, that is, $$[a,b] = \{x \in \mathbb Z\times\mathbb N: x \sim (a,b)\}$$
Now define addition as $$[a,b] + [c,d] = [a + c, \gcd(b,d)]$$ and $$[a,b]\,[c,d] = [ac, \gcd(b,d)]$$ where $\operatorname{lcd}(0,n)=n$.
Clearly the set $\{[z,0]: z\in Z\}$ is equivalent to the integers (and will in the following be identified with them, so $z=[z,0]$), and the set $\{(z,n): z\in Z\}$ is equivalent to the classes modulo $n$ (with the extreme case $n=1$ which contains only a single element).
Now we define an unary operator $\mod: \mathbb N\to M, z\mapsto [1,z]$. Moreover, in a slight abuse of notation, we define $$[a,b] \equiv [c,d] \text{ iff } [a,\gcd(b,d)] = [c,\gcd(b,d)]$$ This is a slight abuse in notation because here $\equiv$ is of course no equivalence relation (but then, the use of $\equiv$ for equivalence is a convention; we also normally use $+$ for commutative operations, yet on the ordinals $+$ is not commutative).
Now with those definitions, in $m \equiv n \pmod k$ the left hand side in an integer, identified with $[m,0]$, and the right hand side is the product of $[n,0]$ with $[1,k]$ (the result of the unary $\mod{}$ operator), which gives $[n,k]$. Now according to above definition of $\equiv$, $[m,0]\equiv[n,k]$ just means $[m,k] = [n,k]$ which is exactly what the ordinary interpretation of the above expression says. On the other hand, in this interpretation it would be equally correct to write $m \pmod k\equiv n\pmod k$ or even $m\pmod k = n\pmod k$ (however not $m = n \pmod k$).
Now my question is twofold:
- Does the above actually make sense? Or is there some fundamental problem with this that I didn't notice?
- Has such a construction (not necessarily the same, but in the same spirit, and also allowing mixing of different modulos in the same equation) already been considered? Does it possibly even have some practical use?