Let $R$ be a commutative ring with $1$. Let $I$ be an ideal of $R$ and $x$ be an element in the ring $R.$ If $p_1, \ldots,p_n $ be prime ideals in $R$ with $x+ I \subset p_1 \cup \cdots \cup p_n$ then for some $i$, $x + I \subset p_i.$
It is well known when $x=0,$ the prime avoidance theorem. Can someone give me some idea to prove this. Thanks.
We can view this as a corollary to the statement with $x = 0$. What you want is:
Proof: Suppose $x + I \subseteq p_1 \cup \cdots \cup p_n$. In particular $x$ must be contained in at least one of the $p_i$. Reorder the $p_i$ and pick $k$ such that $x \in p_1 \cap \cdots \cap p_k$ but $x \notin p_{k+1} \cup \cdots \cup p_{n}$. If $I$ were contained in $p_1 \cup \cdots \cup p_k$, then by prime avoidance we'd have $I$ in some $p_j$, and we'd be done (since then $x, I \subseteq p_j$. Similarly, if $x$ were contained in all of the $p_i$, then we would find that $I \subseteq p_1 \cup \cdots \cup p_n$ and conclude similarly.
In fact these are the only possible scenarios. In the remaining case, we would have that $1 \leq k < n$ and that $I \nsubseteq p_1 \cup \cdots \cup p_k$. Moreover we can safely assume that there are no comparability relations among the $p_i$, i.e. $p_i \nsubseteq p_j$ for all $i,j$ (otherwise just remove the redundant ideal). These assumptions would allow us to choose firstly an element $$a \in I \setminus (p_1 \cup \cdots \cup p_k)$$ and secondly an element $$b \in (p_{k+1} \cap \cdots \cap p_n) \setminus (p_{1} \cup \cdots \cup p_k)$$
In more detail, we can choose this $b$ because otherwise we'd have $p_{k+1} \cap \cdots \cap p_n \subseteq p_{1} \cup \cdots \cup p_k$, and since $p_i \subseteq p_{k+1} \cap \cdots \cap p_n$ for $k+1 \leq i \leq n$ (by primeness), another application of prime avoidance would then imply a relation $p_i \subseteq p_j$. Now by our choice of $a,b$, we have that $ab \in (I \cap p_{k+1} \cap \cdots \cap p_n) \setminus (p_1 \cup \cdots \cup p_k)$. Since $x \in (p_1 \cap \cdots \cap p_k) \setminus (p_{k+1} \cup \cdots \cup p_n)$, we then have $x + ab \in x + I \setminus (p_1 \cup \cdots \cup p_n)$, which is the desired contradiction. $\square$
Two things that are notable about this proof:
(1) whereas the standard prime avoidance can be stated with the weakened assumption that at least $n-2$ of the $p_i$ are prime, our choice of $b$ did depend on the primeness of all the $p_i$.
(2) whereas the standard prime avoidance can be stated with $I$ generalized to a subrng of $R$ (not necessarily containing $1$), the construction of the absurd $x + ab$ in the proof depended on $ab \in I$, which in turn depended on $I$ having an ideal structure.