Source:
​https://en.wikipedia.org/wiki/Modular_arithmetic
Source for operator vs. equivalence relation notation:
​http://www.math.wm.edu/~vinroot/307ModNote.pdf
Example in Operator Notation:
Let
n
be a fixed positive integer greater than 1. If
amodn=a'
and
bmodn=b'
, prove that
(a+b)modn=(a'+b')modn
and
(ab)modn=(a'b')modn
.
Example in Equivalence Relation Notation
(as in Disquisitiones Arithmeticae, Gauss 1801):
Let
n
be a fixed positive integer greater than 1. If
a≡a'(modn)
and
b≡b'(modn)
, prove that
(a+b)≡(a'+b')(modn)
and
(ab)≡(a'b')(modn)
.
In the first version, the symbol
modn
acts like an operation, where
amodn=a'
means that if one applies the division algorithm to
a
divided by
n
, then
a'
is the unique non-negative remainder less than
n
. In the second version,
≡...(modn)
acts as an equivalence relation, where
a≡a'(modn)
means that
n
divides
a-a'
.
This is the operator notation (infix):
In[]:=
TraditionalForm[b≡Mod[a+c,m]]
Out[]//TraditionalForm=
b≡(a+c)modm
Here is a mimic of the equivalence relation notation:
In[]:=
Format[mod[a_,m_]]:=Row[{Infix[mod[a,m],"(mod"],")"}]
In[]:=
Framed[Column[{Row[{"The ",Style["Congruence relation",Bold]," is an equivalence relation:"}],Row[{Style["Reflexivity: ",Bold],TraditionalForm[a≡mod[a,m]]}],Row[{Style["Symmetry: ",Bold],TraditionalForm[a≡mod[b,m]]," if ",TraditionalForm[b≡mod[a,m]]}],​​Row[{Style["Transivity: ",Bold],TraditionalForm[a≡mod[b,m]]," and ",TraditionalForm[b≡mod[c,m]]," than ",TraditionalForm[a≡mod[c,m]]}]}],RoundingRadius5,BackgroundLightBlue]
Out[]=
The Congruence relation is an equivalence relation:
Reflexivity: a≡a(modm)
Symmetry: a≡b(modm) if b≡a(modm)
Transivity: a≡b(modm) and b≡c(modm) than a≡c(modm)
some more examples:
In[]:=
Column[TraditionalForm/@{Mod[7,2]≡mod[7,2],HoldForm[
2
(ab)
]≡mod[HoldForm[
2
(a'b')
],m],PrecedenceForm[ab,100]≡mod[a'b',n],PrecedenceForm[a+b,100]≡mod[a'+b',n]}]
Out[]=
1≡7(mod2)
2
(ab)
≡
2
(
′
a
′
b
)
(modm)
(ab)≡(
′
a
′
b
)(modn)
(a+b)≡(
′
a
+
′
b
)(modn)