Let be a ring. The (Krull) dimension of is defined to be
Theorem 18.1 (prime avoidance):
Let be ideals within a ring such that at most two of the ideals are not prime ideals. If , then there exists an such that .
We prove the theorem directly. First consider the case . Let and . Then , and . In case , we have and in case we have . Both are contradictions.
Now consider the case . Without loss of generality, we may assume are not prime and all the other ideals are prime. If , the claim follows by what we already proved. Otherwise, there exists an element . Without loss of generality, we may assume . We claim that . First assume
Assume otherwise. If there exists (or ), then .
We prove the theorem by induction on . The case we take from the preceding proof. Let . By induction, we have that is not contained within any of , where the hat symbol means that the -th ideal is not counted in the union, for each . Hence, we may choose for each . Since , at least one of the ideals is prime; say is this prime ideal. Consider the element of
For , is not contained in because otherwise would be contained within . For , is also not contained within , this time because otherwise , contradicting being prime. Hence, we have a contradiction to the hypothesis.