Let $A \subset B$ be integral domains and assume $B$ is a free $A$-module of rank $m$. Define the discriminant of $m$ elements $b_1,\dots,b_m\in B$ as $D(b_1,\dots,b_m)=\det(\operatorname{Tr}_{B/A}(b_ib_j))$. A standard result says that if $c_j=\sum a_{ji}b_i$ then $$D(c_1,\dots,c_m)=\det(a_{ij})^2 D(b_1,\dots,b_m).$$ However, there's a result I don't understand. Milne states that if $A=\mathbb{Z}$, then the elements $\gamma_1,\dots, \gamma_m$ generate a submodule $N$ of finite index if and only if $D(\gamma_1, \dots, \gamma_m)\neq 0$. So far so good. However, he then claims that $$D(\gamma_1,\dots, \gamma_n)=(B:N)^2 \operatorname{disc}(B/\mathbb{Z}).$$ I don't see how the determinant of a change-of-basis matrix relates to the index of a submodule. Could someone explain this?
Thanks. (NB: This is from page 28 in Milne's notes)