Discriminant of $\mathbb{Z}$-submodule in number field $K$.

I'm working on the following problem, and would really appreciate some clarification.

Problem: Let $K$ be a number field with $[K:\mathbb{Q}] = n$ with ring of integers $\mathcal{O}_k$. Let $M$ be a $\mathbb{Z}$-submodule in $K$ with $\dim_n(M \otimes_\mathbb{Z} \mathbb{Q}) = n$. Why is $M$ free? Let $\alpha_1, \dots, \alpha_n$ be a $\mathbb{Z}$-basis of $M$. Show that the discriminant $d(M) := d(\alpha_1, \dots, \alpha_n) \in \mathbb{Z}$ and that it is independent of the choice of the basis.

It is clear to me that a $\mathbb{Z}$-basis of $M$ (if $M$ is free) is also a $\mathbb{Q}$-basis of $K$, thus we can talk about the discriminant. It is also clear to me that $d(M)$ must be independent of choice of basis. However I have two questions:

i.) Why does $M$ have to be free? It is torsion-free, so it would suffice to show that is is finitely generated (or to show that it is a finitely generated $\mathcal{O}_k$-module). But why is this the case?

ii.) Why does $d(M)$ have to be an element of $\mathbb{Z}$? Suppose we have the basis $\alpha_1, \dots, \alpha_n$ of $M$, then $\alpha_i = \displaystyle \frac{b_i}{c_i}$ for some $b_i \in \mathcal{O}_k, c_i \in \mathbb{Z}$. Then $$d(\alpha_1, \dots, \alpha_n) = \underbrace{d(b_1, \dots, b_n)}_{\in \mathbb{Z}} \cdot \det(A)^2$$, where $A$ is change of basis matrix, i.e. $\det(A) = \displaystyle\frac{1}{c_1 \cdot \cdots \cdot c_n}$. But $\displaystyle\frac{d(b_1, \dots, b_n)}{c_1^2 \cdot \cdots \cdot c_n^2}$ does not necessarily have to lie in $\mathbb{Z}$.

Thank you very much for any help and hints!

• Further comment: the given criterion does not guarantee that $M$ is finitely generated. Indeed, take $M$ to be $K$ itself! – Starfall Oct 31 '16 at 11:17
• @Starfall Of course! How did I not see that. Maybe this is why I had been so confused. Thx. – johnnycrab Oct 31 '16 at 12:57

For your first question, show that the span of a $\mathbf Q$ basis of $K$ lying in $\mathcal O_K$ has finite index in the ring of integers. Deduce that the ring of integers is a submodule of a free $\mathbf Z$-module, and thus is itself free. Then, show that $aM$ lies in the ring of integers for some integer $a$, conclude.
• Thanks. For the second part: why does the matrix have integer entries, if $M$ is an arbitrary module, and not $\mathcal{O}_K$ itself? I thought that the trace is in $\mathbb{Z}$ is only neceassarily true for elements in the ring of integers. – johnnycrab Oct 31 '16 at 10:41
• Hm, but then I don't understand why $d(M)$ is in $\mathbb{Z}$. Would you mind explaining it a bit further? – johnnycrab Oct 31 '16 at 10:55
• The claim in the question is simply not true. Consider the integer span of $1/2$ and $\sqrt{3}/2$ in $\mathbf Q(\sqrt {3})$, for instance. The discriminant of this basis is $3/4$. – Starfall Oct 31 '16 at 11:00