Hartshorne II Prop. 6.9 
Prop. 6.9: Let $X \to Y$ be a finite morphism of non-singular curves, then for any divisor $D$ on $Y$ we have $\deg f^*D=\deg f\deg D$.

I can not understand two points in the proof:
(1) (Line 9) Now $A'$ is torsion free, and has rank equal to $r=[K(X):K(Y)]$.
Since it is a torsion-free module over PID $O_Q$, I see it is free, but how to calculate its rank?
(2) (Line 15) Clearly $tA'=\bigcap(tA'_{\mathfrak m_i}\cap A')$ so ... I don't know how to show the claim ? 
 A: I like @SomeEE's answer for Line 15. I want to give a different justification for Line 9, because I wasn't able to justify to myself the statement 'Passing to quotient fields.' Unfortunately in my notation below, B = A' and A is the local ring at Q; noting that normalization commutes with localization we see that A ‎⊂ B in my notation below is indeed an integral extension of rings.
We have an extension of function fields of curves over an algebraically closed field k.
In fact we may reduce to the setting of k ‎⊂ A ‎⊂ B where B is the integral closure of the PID A, and is finite as an A-module.
Since k is alg. closed it is perfect hence K(B) is sep./k hence over K(A).
Now a beautiful theorem:

Thm    If L/K is separable and A is a PID, then every f.g. B-submodule M ≠ 0 of L is a free A-module of rank [L : K]. In particular, B admits an integral basis over A.

(One can find this theorem, for example, in the first few pages of Neukirch.)
Hence B has rank [K(B) : K(A)].
Thank you!
P.S. I was also at first stumped by the isomorphism
$$A'/(tA_{\mathfrak m_i}\cap A')\cong A_{\mathfrak m_i}/tA_{\mathfrak m_i},$$
but this isn't so mysterious once one takes into account that the ring on the left is already local with maximal ideal $\mathfrak m_i$, by @SomeEE's 'Dedekind' comment.
A: Line 9
$A'$ is a localization of the ring A which is defined as the integral closure of B in K(X).  This gives us $Quot(A) = Quot(A') = K(X)$ and so $Quot(A')$ is $r$ dimensional over $Quot(B)$.  $A'$ is torsion free and finitely generated over the PID $\mathcal{O}_{Q}$ so $A' = \mathcal{O}_{Q}^{\oplus n}$ for some $n$.  Passing to quotient fields we see that $n=r$.
Line 15
For this, I think it may be easiest to use the Dedekind property.  You know that $tA' = Q^e = m_1^{n_1}...m_j^{n_j}$, $tA'_{m_i} = m_i^{n_i}$, and that $tA'_{m_i} \cap A' = m_i^{n_i}$.
