It is a well know fact that given a ring $A$ setting $S := A\setminus P$, where $P$ is a prime ideal in $A$, there is a corrispondence between the prime ideals of $A_P$ (this is the notation I use for localization) and the prime ideals of $A$ contained in $P$.
I'd like to know whether this bijection is height preserving, i.e given a $Q \subset A$ prime ideal, if $\text{ht}(Q) = \text{ht}(QA_P)$. What I can see, is that there is an inequality: calling $\sigma : A \to A_P$ and taking a prime $\tilde{Q} \subset A_P$ and a chain which realizes the height $Q_1 \subset Q_2 \subset \cdots Q_r \subset Q$, the preimage under $\sigma$ are prime ideals of $A$ strictly contained in the prime $\sigma^{-1}(Q)$, hence the inequality.
In general seems to me that this chain could be extended to the left of $\sigma^{-1}(Q_1)$, making $\text{ht}(\sigma^{-1}(Q_1)) > r$. Where my reasoning fails or how to complete the proof?
Any help on my misunderstanding or solution would be appreciated.