Let $C(n,k)$ and $C'(n,k)$ be two linear codes. Show that $C\cap C'$ and $C + C'= \{u +u'|u\in C , u'\in C'\}$ are linear codes. Determine conditions under which $C\cup C'$ is also linear.
My try: Let $c_1 , c_2 \in C\cap C'$. So we have $$c_1,c_2 \in C \\ c_1,c_2 \in C'$$Since $C$ and $C'$ are linear $$c_1 + c_2 \in C \\ c_1 + c_2 \in C'$$This implies $c_1 + c_2 \in C\cap C'$ and $C\cap C'$ is linear code. Now let $c_1 , c_2 \in C + C'$. By definition $$\exists u_1\in C, u_2\in C' : c_1 = u_1 + u_2 \\ \exists u_3\in C, u_4\in C' : c_2 = u_3 + u_4$$ Then we have $$c_1 + c_2 = (u_1 + u_3) + (u_2 + u_4)$$The first term belongs to $C$ and the second one belongs to $C'$. By definition $c_1 + c_2 \in C + C'$ and this shows $C + C'$ is linear code.
I think the sufficient and necessary condition for $C\cup C'$ to be linear is that $C\subseteq C'$ or $C'\subseteq C$ because of "The union of two subspaces is a subspace if and only if one of the subspaces is contained in the other" but I'm not sure about this. Gerry Myerson's argument relies on the existence of $-x$ but I don't know whether additive inverse makes sense for linear codes.
Also are two other proofs correct?