Order of some quotient ring of Gaussian integers [duplicate]

I'm trying to get through a proof of Gauss' that certain primes can be written as the sum of two squares. An assumption is that

the order of $\mathbb{Z}[i]/(a+bi)$ is $a^2+b^2$.

I get that $(a+bi)(a-bi)=a^2+b^2$, so this places a bound on the order of integers with no imaginary part. But since $b$ isn't a unit, it doesn't seem like this finishes the proof.

Any hints?


HINT $\ $ If $\rm\ (a,b) = 1\ $ then $\rm\ x^2 = -1,\ a = b\:x\ \iff\ a^2 = -b^2,\ x = a/b\:.\ $ Therefore

$$\rm\mathbb Z[i]/(a-b\:i)\ \cong\ \mathbb Z[x]/(x^2+1,\ a-b\:x)\ \cong\ \mathbb Z[x]/(a^2+b^2,x-a/b)\ \cong\ \mathbb Z/(a^2+b^2) $$


Expanding on Qiaochu's comment, but trying to leave you some room to think:

$\mathbb{Z}[i]$ is a square lattice in the complex plane, and the ideal $(a+bi)$ is a square sublattice. (Why?) The index of $(a+bi)$ in $\mathbb{Z}[i]$ is the number of elements of $\mathbb{Z}[i]$ inside a fundamental square of $(a+bi)$, including part but not all of its boundary. (Why? And what's with the boundary funny business?) This is the same as the ratio of the area of the fundamental square of $\mathbb{Z}[i]$ to the area of the fundamental square of the sublattice $(a+bi)$. (Why?)

$\mathbb{Z}[i]$'s fundamental square is a unit square, so the question is really about the area of $(a+bi)$'s fundamental square. The line from $0$ to $a+bi$ is a side of this square...


Hint: The Gaussian integers are a Euclidean domain with respect to the norm. Hence given $z\in \mathbb Z[i]$ there are $q$ and $r$ in $\mathbb Z[i]$ such that $z=q(a+bi)+r$, with $r=0$ or $N(r)<N(a+bi)$.