Rank of a module over an integral domain Suppose $A$ be an integral domain. The rank of an $A$-module $M$ is defined to be the maximal number of $A$-linear independent elements of $M$.
Let $S=A-\{0\}$. Then $S^{-1}A:=k$ is a field and it can be proved that rank $M=$ the $k$-vector space dimension of $M\otimes_{A}k$. Hence rank is well defined.
Now suppose $B\supset A$, where $B$ is also a domain. Let $T=B-\{0\}$ and $L=T^{-1}B$. It is also given that $L/k$ is finite algebraic extension. Let $[L:k]=r$.
I want to prove that $\operatorname{rank}B$ as an $A$-module is equals to $r$. Clearly $k\subset S^{-1}B\subset L$. Hence $\operatorname{rank}B\leq r$.
How to prove that rank is exactly equals to $r$?
Thank you in advance.
 A: There is a canonical map of $Q(A)$-vector spaces $\iota: B \otimes_A Q(A) \to Q(B) \otimes_{Q(A)} Q(A)$ where $Q(A)$ denotes the fraction field of a domain $A$. The map just sends $b \otimes \frac as$ to $\frac b1 \otimes \frac as$. This map induces an isomorphism of $Q(B)$-modules
$$
Q(B) \otimes_B (B \otimes_A Q(A)) \simeq Q(B) \otimes_B (Q(B) \otimes_{Q(A)} Q(A)) 
$$
because both are naturally isomorphic to $Q(B)$ by the multiplication map, and this natural isomorphism commutes with $Q(B) \otimes_B \iota$. If $\iota$ had a non-zero kernel or cokernel, then by exactness of localization so would $Q(B) \otimes_B \iota$, a contradiction (this is an exercise: use the existence of an exact sequence of the form $0 \to B \to \ker \iota \to B \otimes_A Q(A)$ of $B$-modules to derive the contradiction). It follows that $\iota$ is an isomorphism.
This is in some way the algebraization of the proof that says that a basis of $Q(B)$ over $Q(A)$ gives a maximally $A$-linearly independent subset of $B$ by clearing denominators; tensoring with $Q(B)$ over $B$ is what allows us to clear denominators.
Hope that helps,
