**Proof plan.** The argument uses the **[Steinitz Exchange Lemma](/theorems/373)**: if $v$ is not in the span of some vectors, it can replace one of them without losing the spanning property. By systematically replacing basis vectors, we show $m \leq n$; by symmetry, $n \leq m$.
**Step 1.** Since $\mathcal{B}$ spans $V$, each $f_j$ is a linear combination of $e_1, \ldots, e_n$. In particular, $f_1 = \sum_i c_i e_i$ with some $c_k \neq 0$ (since $f_1 \neq \mathbf{0}$). Relabelling if necessary, assume $c_1 \neq 0$. Then $e_1 = c_1^{-1}(f_1 - c_2e_2 - \cdots - c_ne_n)$, so $\{f_1, e_2, \ldots, e_n\}$ still spans $V$.
**Step 2.** Repeat: express $f_2$ in terms of $\{f_1, e_2, \ldots, e_n\}$. Since $f_2$ is not a multiple of $f_1$ (by independence of $\mathcal{B}'$), at least one coefficient of the $e_i$'s is nonzero. Swap that $e_i$ for $f_2$.
**Step 3.** After $m$ steps, we have replaced $m$ of the $e_i$'s with $f_1, \ldots, f_m$. If $m > n$, we would run out of $e_i$'s to replace, meaning $f_{n+1}$ would be a linear combination of $f_1, \ldots, f_n$, contradicting the independence of $\mathcal{B}'$. Hence $m \leq n$. By the symmetric argument (exchanging the roles of $\mathcal{B}$ and $\mathcal{B}'$), $n \leq m$.