# Let $P$ and $Q$ are distinct prime ideals of the ring $R$ with $P \cap Q = 0$, then $R$ is isomorphic to a subring of the direct product of two fields

I need help with the following problem:

Problem: Let $$R$$ be a commutative ring with distinct prime ideals $$P$$ and $$Q$$ with $$P \cap Q = 0$$. Show that $$R$$ is isomorphic to a subring of the direct product of two fields.

Solution(my attempt): I am thinking that can we apply the Chinese Remainder Theorem?

If we assume $$P$$ and $$Q$$ are comaximal, i.e. $$P+Q=R$$, then $$P Q = P \cap Q = 0$$ and $$R = R/PQ \cong R/P \times R/Q$$ where $$R/P, R/Q$$ are integral domains because $$P, Q$$ are prime ideals.

I do not have other idea...can you write the solution, please?

One good place to start is to consider what happens when $$P \subset Q$$ or $$Q \subset P$$. The cases are basically the same, so let's assume that $$P \subset Q$$. Since $$P \cap Q = (0)$$, we must have that $$P = (0)$$, and so $$R$$ is an integral domain. Since any integral domain that is not a field has at least two distinct prime ideals, the problem then tells us that any integral domain that is not a field can be embedded in the product of two fields. That should lead you to believe that whatever construction we use is a very, very general way of obtaining fields and field-like things from integral domains. The obvious tool is to use the field of fractions!
So for an integral domain, the answer is now clear: Take the map $$R \mapsto \operatorname{Frac}(R) \times \operatorname{Frac}(R)$$, where I am using $$\operatorname{Frac}(R)$$ to denote the field of fractions of $$R$$, and the map can either put $$R$$ in the first copy, or the second, or the diagonal if you want.
What if $$R$$ is not an integral domain? In that case you have two ways to make it into one: quotient by $$P$$ or quotient by $$Q$$. Since $$P \cap Q = 0$$, the map $$R \mapsto R / P \times R / Q$$ has $$(0)$$ kernel, so $$R$$ is isomorphic to a subring of $$R / P \times R / Q$$. Now, $$R / P$$ and $$R / Q$$ might not be fields, but no matter, because they are integral domains! So we can just put $$R / P \times R / Q$$ into $$\operatorname{Frac}(R / P) \times \operatorname{Frac}(R / Q)$$, and composing the two maps together we get an injective ring homomorphism $$R \to \operatorname{Frac}(R / P) \times \operatorname{Frac}(R / Q)$$. The latter is the product of two fields, and $$R$$ is isomorphic to its image, which is a subring.
I suspect that this is beyond your background right now, but as inspiration for future studies, I'll point out that this is a completely natural thing to do in algebraic geometry: geometrically, a product of two fields is two closed points, and the condition that $$R$$ has two prime ideals whose intersection is $$0$$ means that $$R$$ is geometrically given by the union of two irreducible components. The map I described in my answer corresponds to taking each of the closed points of $$\kappa(P) \times \kappa(Q)$$ to the corresponding irreducible component of $$R$$, where $$\kappa(P)$$ is the residue field at $$P$$, and same for $$Q$$.