# Math Help - Congruence

1. ## Congruence

Prove that a congruent b(modn) if and only if a^2 + b^2 congruent 2ab(mod n^2)

2. Originally Posted by empressA
Prove that a congruent b(modn) if and only if a^2 + b^2 congruent 2ab(mod n^2)

Hint: $a= b\!\!\!\pmod n\Longleftrightarrow a-b= 0\!\!\!\pmod n\Longrightarrow (a-b)^2= 0\!\!\!\pmod {n^2}\Longleftrightarrow$ ...take it from here (two little steps left).

Tonio

3. Originally Posted by empressA
Prove that a congruent b(modn) if and only if a^2 + b^2 congruent 2ab(mod n^2)

$a \equiv b(mod n) \Leftrightarrow a^2 + b^2 \equiv 2ab (mod n)$

let's take first $\Rightarrow$

we have $a \equiv b (mod n)$ want the right side

$a \equiv b (mod n )$ this mean $n \mid a-b$ and this mean there exist an integer x such that $a-b = x n$
so

$(a-b)^2 = x^2 n^2$

$n^2 \mid (a-b)^2$

$(a-b)^2 \equiv 0 (mod n)$ simplify the left side

now $\Leftarrow$ we have

$a^2 + b^2 = 2ab (mod n^2 )$

$a^2 - 2ab + b^2 \equiv 0 (mod n^2 )$

$(a-b)^2 \equiv 0 (mod n^2 )$

so there exist an integer y such that

$(a-b)^2 = y n^2$ note that y is square can you prove it ??

so we can write y=c^2

$(a-b)^2 = c^2 n^2$ by taking square root

$(a-b) = c n$

$a-b \equiv 0 (mod n)$ proof ends