# Number theory notation

I am confused with the below notations .

I know that

($a \equiv b \mod {n} )\iff ( n|(a-b)$ )

but what the below notation says ?

$a = b \mod {n}$

and in theorem 16 in this ,it's given as below

if $g \in\mathbb{Z_n^*} , r_1,r_2 \in \mathbb{Z_n}$ and $m_1,m_2 \in \mathbb{Z_n}$

($g^{m_1}r_1^n =g^{m_2}r_2^n \mod {n^2}) \implies (g^{m_1-m_2}r_1^n=r_2^n \mod{n^2}$)

In the above equation , both sides are divided with $g^{m_2}$

When we can divide both sides of a modular expression as in the above equation with a number ?

• This is wrong, $a\equiv b\mod n\iff n|(a-b)$ not the other way around. – Adam Hughes Jul 2 '14 at 17:29
• When the number we are dividing by is relatively prime to the modulus. – André Nicolas Jul 2 '14 at 17:31
• @AdamHughes yeah , edited . – hanugm Jul 2 '14 at 17:31
• You can use the Euclidean algorithm to see that "division" is legal when $gcd(g,n)=1$. – Adam Hughes Jul 2 '14 at 17:33
• @hanu $\ a = b\ {\rm mod}\ n\$ could mean either $\ a\equiv b\pmod n\$ or $\ a = (b\ {\rm mod}\ n),\,$ i.e. the former combined with $\,0\le a < n.\ \$ – Bill Dubuque Jul 2 '14 at 17:45

$$g^{m_1}r_1^{n} \equiv g^{m_2}r_2^{n} \pmod {n^2} \Rightarrow n^2 \mid g^{m_1}r_1^{n} - g^{m_2}r_2^{n} \\ \Rightarrow n^2 \mid g^{-m_2} \cdot (g^{m_1}r_1^{n} - g^{m_2}r_2^{n}) \Rightarrow n^2 \mid g^{m_1-m_2}r_1^n-r_2^n$$
EDIT: We can multiply with $g^{-m_2}$,because, we know that $g \in \mathbb{Z}^*$,so it is a unit,therefore $g^{-1}$ exists.
In general, if $m \mid a-b \Rightarrow m \mid x(a-b), \forall x \in \mathbb{Z}$
• but is $g^{-m_2} \in \mathbb{Z}$ ? – hanugm Jul 2 '14 at 17:39
• Yeah , understood . what about the notation $a=b \mod {n}$ , is it same as $a \equiv b \mod{n}$ – hanugm Jul 2 '14 at 17:45
• Nice! it is the same,but it is better to write it like that : $$a \equiv b \pmod n$$ because it isn't exactly an equality!!!We are working $\mod n$.. – evinda Jul 2 '14 at 17:47