# If $\dim(A+B)=\dim(A\cap B)+1$, then $A \subset B$ or $B \subset A$

Let $A,B$ be linear subspaces of $\mathbb R^n$. Show that if $$\dim(A+B) = \dim(A \cap B) + 1, \tag{1}$$ then one of the space is a subset of the other, $$A \subset B \text{ or } B \subset A. \tag{2}$$

By the dimension theorem, then (1) $$\dim(A+B)=\dim(A)+\dim(B)-\dim(A \cap B) = \dim(A \cap B) + 1, \tag{3}$$ so that $$\dim(A)+\dim(B)= 2\dim(A \cap B) + 1. \tag{4}$$

I can't see where to go next.

-

Since $A \cap B \subseteq A \subseteq A+B$, it follows that $$\dim A \cap B \leq \dim A \leq \dim(A+B) = \dim(A \cap B) + 1.$$ Hence, either $\dim A = \dim(A \cap B)$ or $\dim A = \dim(A+B)$. What follows from each of these two cases?
Hint: To prove the contraposative, suppose neither $A \subset B$ or $B\subset A$. Then $A\cap B$ is strictly contained in both $A$ and $B$, so $\dim(A\cap B) < \dim(A), \dim(B)$.