The rank of a matrix. Inequality and eqality proofs I'm asked to try to prove this corollary given in our slides. But not sure about how to go about it.
This is one of the fundamental theorem on rank in matrices and this among others like $r(AB)\le\min(m,n)$, $r(A)=r(A^T)=r(A^*)=r(\overline A)$, etc. are all given and they all have their respective proofs. I am interested in how the below question is proved as I realized that most teachers like to mention it when they teach ranks in matrices. It would be very helpful if someone could help me prove it.
Question: The rank-sum inequality: Let $A,B$ be two same-size matrices and $r$ represent rank. Then prove that $r(A+B)\le r(A)+r(B)$.
 A: Just by the definition of the rank of a matrix as the dimension of its image (the "image" means the same as column space), we have the first and last equality in the following chain:
$$
\operatorname{rank}(A + B)
= \dim \operatorname{im} (A + B)
\leq \dim (\operatorname{im} A + \operatorname{im} B)
\leq (\dim \operatorname{im} A) + (\dim \operatorname{im} B)
= \operatorname{rank} A + \operatorname{rank} B.
$$
It just remains to justify the two "$\leq$" signs. The first follows because $\operatorname{im} (A + B) \subset \operatorname{im} A + \operatorname{im} B$ as sets: if $v \in \operatorname{im}(A + B)$ then by definition there exists $u$ such that $(A + B) u = v$, and since $A u \in \operatorname{im} A$ and $B u \in \operatorname{im} B$ we conclude that $v = A u + B u \in \operatorname{im} A + \operatorname{im} B$.
The second is just a general fact about the sum of vector subspaces: if $U, W \subset V$ are vector subspaces, then in fact $\dim (U + W) \leq \dim U + \dim W$. This follows because we can choose a basis $\mathfrak{B}_U$ for $U$ and a basis $\mathfrak{B}_W$ for $W$, and consider the union $S = \mathfrak{B}_U \cup \mathfrak{B}_W$. Then the set $S$ is a set of (at most) $\dim U + \dim W$ vectors which we claim spans $U + W$ (but need not itself be linearly independent). This will complete the proof, since if $S \subset U + W$ is spanning then necessarily $\dim (U + W) \leq \lvert S \rvert \leq \dim U + \dim W$ as we desire.
To show that the set $S$ is spanning, let $v \in U + W$ be arbitrary, so that there is some $u \in U$ and $w \in W$ such that $v = u + w$. Then $u \in \operatorname{span} \mathfrak{B}_U$ and $w \in \operatorname{span} \mathfrak{B}_W$ because $\mathfrak{B}_U$ and $\mathfrak{B}_W$ are both bases for $U$ and $W$ respectively. Thus $u + w \in \operatorname{span}(\mathfrak{B}_U \cup \mathfrak{B}_W) = \operatorname{span} S$, which completes the proof.
