# Prime avoidance lemma

In algebra, the prime avoidance lemma says that if an ideal I in a commutative ring R is contained in a union of finitely many prime ideals P$_i$'s, then it is contained in P$_i$ for some i.
There are many variations of the lemma (cf. Hochster); for example, if the ring R contains an infinite field or a finite field of sufficiently large cardinality, then the statement follows from a fact in linear algebra that a vector space over an infinite field or a finite field of large cardinality is not a finite union of its proper vector subspaces.

## Statement and proof

The following statement and argument are perhaps the most standard.
Statement: Let E be a subset of R that is an additive subgroup of R and is multiplicatively closed. Let $I_{1},I_{2},\dots ,I_{n},n\geq 1$ be ideals such that $I_{i}$ are prime ideals for $i\geq 3$. If E is not contained in any of $I_{i}$'s, then E is not contained in the union $\cup I_{i}$.
Proof by induction on n: The idea is to find an element that is in E and not in any of $I_{i}$'s. The basic case n = 1 is trivial. Next suppose n ≥ 2. For each i, choose
    $z_{i}\in E-\cup _{j\neq i}I_{j}$
where the set on the right is nonempty by inductive hypothesis. We can assume $z_{i}\in I_{i}$ for all i; otherwise, some $z_{i}$ avoids all the $I_{i}$'s and we are done. Put
    $z=z_{1}\dots z_{n-1}+z_{n}$.
Then z is in E but not in any of $I_{i}$'s. Indeed, if z is in $I_{i}$ for some $i\leq n-1$, then $z_{n}$ is in $I_{i}$, a contradiction. Suppose z is in $I_{n}$. Then $z_{1}\dots z_{n-1}$ is in $I_{n}$. If n is 2, we are done. If n > 2, then, since $I_{n}$ is a prime ideal, some $z_{i},i<n$ is in $I_{n}$, a contradiction.

## E. Davis' prime avoidance

There is the following variant of prime avoidance due to E. Davis.
Theorem — Let A be a ring, ${\mathfrak {p}}_{1},\dots ,{\mathfrak {p}}_{r}$ prime ideals, x an element of A and J an ideal. For the ideal $I=xA+J$, if $I\not \subset {\mathfrak {p}}_{i}$ for each i, then there exists some y in J such that $x+y\not \in {\mathfrak {p}}_{i}$ for each i.
Proof: We argue by induction on r. Without loss of generality, we can assume there is no inclusion relation between the ${\mathfrak {p}}_{i}$'s; since otherwise we can use the inductive hypothesis.
Also, if $x\not \in {\mathfrak {p}}_{i}$ for each i, then we are done; thus, without loss of generality, we can assume $x\in {\mathfrak {p}}_{r}$. By inductive hypothesis, we find a y in J such that $x+y\in I-\cup _{1}^{r-1}{\mathfrak {p}}_{i}$. If $x+y$ is not in ${\mathfrak {p}}_{r}$, we are done. Otherwise, note that $J\not \subset {\mathfrak {p}}_{r}$ (since $x\in {\mathfrak {p}}_{r}$) and since ${\mathfrak {p}}_{r}$ is a prime ideal, we have:
    ${\mathfrak {p}}_{r}\not \supset J\,{\mathfrak {p}}_{1}\cdots {\mathfrak {p}}_{r-1}$.
Hence, we can choose $y'$ in $J\,{\mathfrak {p}}_{1}\cdots {\mathfrak {p}}_{r-1}$ that is not in ${\mathfrak {p}}_{r}$. Then, since $x+y\in {\mathfrak {p}}_{r}$, the element $x+y+y'$ has the required property. $\square$

### Application

Let A be a Noetherian ring, I an ideal generated by n elements and M a finite A-module such that $IM\neq M$. Also, let $d=\operatorname {depth} _{A}(I,M)$ = the maximal length of M-regular sequences in I = the length of every maximal M-regular sequence in I. Then $d\leq n$; this estimate can be shown using the above prime avoidance as follows. We argue by induction on n. Let $\{{\mathfrak {p}}_{1},\dots ,{\mathfrak {p}}_{r}\}$ be the set of associated primes of M. If $d>0$, then $I\not \subset {\mathfrak {p}}_{i}$ for each i. If $I=(y_{1},\dots ,y_{n})$, then, by prime avoidance, we can choose
    $x_{1}=y_{1}+\sum _{i=2}^{n}a_{i}y_{i}$
for some $a_{i}$ in $A$ such that $x_{1}\not \in \cup _{1}^{r}{\mathfrak {p}}_{i}$ = the set of zero divisors on M. Now, $I/(x_{1})$ is an ideal of $A/(x_{1})$ generated by $n-1$ elements and so, by inductive hypothesis, $\operatorname {depth} _{A/(x_{1})}(I/(x_{1}),M/x_{1}M)\leq n-1$. The claim now follows.