Understanding the definition the norm of a principal ideal of a number field Hi I'm a grad student and I was re reading the lecture notes my professor from a previous semester posted for algebraic number theory.
The lecture notes state: "If $O_K$ is a number field and $I$ is an ideal of $O_K$, then $N(I)$ is defined as $N(I) = |O_K : I|$."
I took this definition to mean, if $N(I) = n$ then there are $n$ elements $a_1, a_2, \cdots a_n \in O_K$ such that every element of $a \in O_k$ is of the form $i + a_j$ where $i \in I$, and $1 \leq j \leq n$.
Later on the lecture notes state:
"Let $\gamma \in O_K$, and $\{\beta_1, \cdots \beta_n \}$ be an integral basis of $O_K$. Let $$\gamma\beta_j = \sum_{k = 1}^n a_{j,k}\beta_k, \, \, \, \, \, j = 1, 2, \cdots, n,$$
then \begin{equation*} \begin{bmatrix} 
\gamma \beta_1 \\
\vdots \\
\gamma \beta_n 
\end{bmatrix} = A\begin{bmatrix} 
 \beta_1 \\
\vdots \\
\beta_n 
\end{bmatrix}, \, \, \, \, \, A = [a_{j,k}] \in \mathbb{Z}^{n \times n} \end{equation*}
Let $I=\langle \gamma \rangle$.
Now $N(I) = |O_K :I| = |det(A)|$."
So I'm having trouble seeing why $|O_K :I| = |det(A)|$?
 A: First, consider the case where $A$ is diagonal with positive diagonal entries $d_1,\dots,d_n$. Note that if
$$
\pmatrix{\gamma \beta_1 \\ \vdots \\ \gamma \beta_n} = \pmatrix{d_1 \beta_1\\ \vdots \\ d_n \beta_n},
$$
Then the elements of the form $a= \sum_i c_i \beta_i$ with $c_i \in \{0,1,\dots,d_i-1\}$ are such that every element of $O_K$ is of the form $m + a$ for some $m \in \langle \gamma\rangle$ and some such element $a$. There are $d_1d_2 \cdots d_n$ such elements, so $|O_K:I| = |\det(A)|$ holds.

For the general case, note that $A$ has a smith normal form decomposition $A = UDV$ with $U,V$ unimodular and $D$ diagonal with positive diagonal entries. Define $\delta_1,\dots,\delta_n$ such that
$$
\pmatrix{\delta_1\\ \vdots \\ \delta_n} = V \pmatrix{\beta_1\\ \vdots \\ \beta_n}.
$$
Note that $\delta_1,\dots,\delta_n$ is another integral basis of $O_K$. We have
$$
\pmatrix{\gamma\beta_1\\ \vdots \\ \gamma \beta_n} =  U\pmatrix{d_1 \delta_1 \\ \vdots \\ d_n \delta _n}.
$$
Note that for $c = (c_1,\dots,c_n) \in \Bbb Z^n$, $\gamma \sum_i c_i \beta_i$ can be computed as
$$
\pmatrix{c_1 & \cdots & c_n}\pmatrix{\gamma\beta_1\\ \vdots \\ \gamma \beta_n}
= c^TA \pmatrix{\beta_1 \\ \vdots \\ \beta_n}.
$$
Thus, each element of $\langle \gamma \rangle$ can be expressed in the form
$$
c^TU\pmatrix{d_1 \delta_1 \\ \vdots \\ d_n \delta _n} = (U^Tc)^T \pmatrix{d_1 \delta_1 \\ \vdots \\ d_n \delta _n},
$$
which is to say that the set $\{d_i \delta_i\}$ forms an integral basis for $\langle \gamma \rangle$. So, the elements of the form $a= \sum_i c_i \delta_i$ with $c_i \in \{0,1,\dots,d_i-1\}$ are such that every element of $O_K$ is of the form $m + a$ for some $m \in \langle \gamma\rangle$ and some such element $a$. There are $d_1d_2 \cdots d_n$ such elements, so $|O_K:I| = \det(D) = |\det(A)|$ holds, which was what we wanted.
A: See Theorem 5.19 here.  The point is that if $M$ is a finite-free $\mathbf Z$-module and $N$ is a submodule of finite index, then $[M:N]$ can be computed as $|{\rm det}(A)|$ where $A$ is the matrix expressing an arbitrary basis of $N$ in terms of an arbitrary basis of $M$.
Here is the basic idea. There is a pair of aligned bases in $M$ and $N$: there's a basis $e_1,\ldots,e_n$ of $M$ and nonzero integers $a_1,\ldots,a_n$ such that $a_1e_1,\ldots,a_ne_n$ is a basis of $N$.  That means
$$
M/N \cong \prod_{i=1}^n \mathbf Z/(a_i),
$$
so $[M:N] = |a_1\cdots a_n|$. The matrix expressing $a_1e_1,\ldots,a_ne_n$ in terms of $e_1,\ldots,e_n$ is a diagonal matrix ${\rm diag}(a_1,\ldots,a_n)$, which has determinant $\prod a_i$, so the absolute value of this determinant is $[M:N]$.  What if we used other bases for $M$ and $N$?
The transition matrix between two bases of the same finite-free abelian group has determinant $\pm 1$, so the transition matrix $A$ between a new basis of $N$ and new basis of $M$ differs from the transition matrix between the aligned bases of $N$ and $M$ by matrices with determinant $\pm 1$, so $|\det A| = |\prod a_i| = [M:N]$.
