Let $A$ be an integral domain with the quotient field $K=S^{-1} A$, where $S=A\setminus\{0\}$. Then in $K$ the following equalities hold: $A=\bigcap_{P\in Spec A} A_P = \bigcap_{M \in Spm A} A_M$.
The above question is from my assignment in commutative algebra and I have tried it two times.
I think the method should assuming taking element in 1 set and proving it to be in another set. I want to prove that $A=\bigcap_{P\in Spec A} A_P$--(1) and $\bigcap_{P\in Spec A} A_P = \bigcap_{M \in Spm A} A_M$--(2).
For 1st equality: Let $x\in A$. But I am not really sure how should I proceed.
If $x\in \bigcap_{P\in SpecA} A_P$, then x lies in $A_P$ for all prime ideals P.Again I am confused how to approach.
I shall be really grateful if you can give some hints on this problem. I am really unable to proceed. I have been following atiyah and macdonald.
Given $x\in K$ you have an ideal $I_x\subseteq A$ consisting of elements $b$ such that $bx\in A$. For any $x\in K$ there are two possibilities: $I_x=A$ or $I_x\subseteq M$ for some $M\in {\rm Spm}(A)$.
In the first case $x\in A$, and in the second case $x\notin A_M$. Thus $$\cap_{M\in {\rm Spm(A)}} A_M\subseteq A.$$
The inclusions: $$A\subseteq\cap_{P\in {\rm Spec}(A)} A_P\subseteq\cap_{M\in {\rm Spm}(A)} A_M,$$ follow trivially from $A\subseteq A_P$ for all primes $P$ and ${\rm Spm}(A)\subseteq {\rm Spec}(A)$.