Below is the proof of : Prove that for any two ideals $A$ and $B$ of ring $R$,$A+B=\langle A \cup B~\rangle$ .
By theorem (for any two ideals of a ring $R$ ,then the set $A+B$ is an ideal of $R$) such that ,$A \subseteq A+B$ and $B \subseteq A+B$ , so $A\cup B \subseteq A+B.$
Let $X$ be any ideal of $R$ such that $A\cup B \subseteq X.$ If $z \in A+B$ then $z = a+b$, $a \in A$,$b \in B$. Now $a \in A\cup B~~$,$~~b \in A\cup B \implies a,b \in X \implies z \in X.$
Hence,$A+B \subseteq X$.Consequently ,by definition $A+B=\langle A \cup B \rangle$
The thing I can't understand is where did we use the fact that $X$ is an ideal.Won't the proof work if $X$ is just a subset of $R$ such that $A\cup B \subseteq X.$?