I'm stuck on proving the following theorem:
"Let $B = \{u_1,u_2, . . . ,u_m\}$ and $B' = \{v_1, v_2, . . . , v_k\}$ be bases for a non-zero subspace $S$ of $\mathbb R^n$. Then $m = k$. That is, any two bases for a subspace have the same cardinality."
I have thought about doing a proof by contradiction for the statement, doing cases where $m \gt k$ and $m \lt k$. Let us assume that B and B' are bases of S. Suppose that $m \gt k$ without loss of generality, then is it true that either $B$ is linearly dependent or $B'$ does not span S? If so, how would you prove it because I've tried so many different ways and I can't seem to find on that works.
It's not enough to prove by extending or reducing any of the sets since there is the possibility that $B \cap B' = \emptyset$
Any help would be much appreciated. Thank you in advance.