Is there a proof of the irrationality of $\sqrt{2}$ that involves modular arithmetic? I was reading Ian Stewart's Concepts of Modern Mathematics.

Using congruences, It's possible to explain why all perfect squares end in $0,1,4,5,6,9$ but not in $2,3,7,8$. 

With this I had the idea of exploring the congruences for both sides of $n^2=2m^2$ in Mathematica:
Table[Mod[n^2, 9], {n, 0, 20}]
Table[Mod[2 m^2, 9], {n, 0, 20}]
And had the results:
{0, 1, 4, 0, 7, 7, 0, 4, 1, 0, 1, 4, 0, 7, 7, 0, 4, 1, 0, 1, 4}
{0, 2, 8, 0, 5, 5, 0, 8, 2, 0, 2, 8, 0, 5, 5, 0, 8, 2, 0, 2, 8}
But I'm still not sure if the outputs really show what I'm looking for, I have also tried $mod \;10$. The idea is still pretty loose in my mind, I'm stuck on deciding if this proves something or what directions I could take in this enterprise.
 A: This is just the standard proof, rewritten in modular arithmetic:
The key here is that $\gcd(m,n)=1$.
Now, look at
$$n^2=2m^2 \pmod{4},$$
in all three cases:


*

*$m,n$ both odd.

*$m$ even, $n$ odd

*$m$ odd, $n$ even


This proof is pretty artificial though.
A: $x^2-2$ is irreducible over $\mathbb{Z}$ by reduction since it is irreducible over $\mathbb{F}_3$. Check directly $0^2-2 \equiv 1, 1^2-2 \equiv 2, 2^2-2 \equiv 2 \bmod 3$.
Another alternative: If $z \in \mathbb{Z}$ with $z^2=2$, then the $2$-adic valuation gives $2 \cdot  v_2(z)=v_2(2)=1$, contradiction.
A: (1). The set of congruences of squares, modulo $10$, is $A=\{0,1,4,5,6,9\}$ And the set of congrences,  modulo $10,$ of $\{2 x: x\in A\}$ is $B=\{0,2,8\}.$ And $A\cap B=\{0\}$. So, modulo $10,$ we have $$(2). \quad n^2-2 m^2\equiv 0\iff n^2\equiv 2 m^2\equiv 0\iff ((n\equiv 0 \land  (m\equiv 0\lor m\equiv 5)).$$ (3). Observe that $n\equiv 0\pmod {10}\iff n^2\equiv 0\pmod {100},$ but that $m\equiv 5\pmod {10} \implies 2 m^2\equiv 50 \pmod {100}.$ And also $m^2\equiv 0 \pmod {10}\iff m\equiv 0 \pmod {10}.$
(4). So $n^2=2 m^2\implies n \equiv m\equiv 0 \pmod {10}.$ 
(5). Suppose  $0\ne (n_1)^2=2(m_1)^2.$ Let $n_{j+1}=n_j/10$ and $m_{j+1}=m_j/10.$ We have $0\ne (n_j)^2=2( m_j)^2$ for each $j\in N.$ And from (4) we have $n_j ,m_j\in N\implies n_{j+1},m_{j+1}\in N.$
(6). Conclusion : Suppose there exist $n_1,m_1\in N$ with $n_1^2=2 m_1^2.$ Then $(n_1,n_2,n_3,...)$ is an infinite descending sequence in $N$, which is impossible. Or,without mentioning infinite sequences, we have  $0<n_1/10^j<1$ for some (large enough)  $j\in N,$ implying that $n_j\in N \land 0<n_j<1 ,$ which is absurd.  Or by the well-ordering of $N$ :  If such $n_1,m_1$ exist there would be a least possible $n_1, $ implying $0<n_1\leq n_2=n_1/10, $ which is absurd.  
