QR decomposition for rank-deficient matrix Say $A = Q\begin{bmatrix}
R\\
0\\
\end{bmatrix}$ where $A$ is $m \times n, m>n$ and $\operatorname{rank}(A) = k, k<n$ and $Q$ is $m \times m$ and $R$ is $n \times n$. Can we say $\operatorname{span} \lbrace a_1,\ldots,a_k \rbrace = \operatorname{span} \lbrace q_1,\ldots, q_k \rbrace$ where $a_j$ and $q_j$ are the $j$th columns of $A$ and $Q$ respectively?

I came across your question while trying to answer my own question of how one extends QR decompositions to rank deficient matrices. I spent a little while looking at how QR decomposition is arrived at in the case of rank deficient matrices and it seems to me like it can be naturally extended. Having looked at that, I think I can answer your question.
I think the answer is no to what you explicitly asked. This follows simply by supposing A is such that the first k columns are not linearly independent (I assume your question was for any general rank deficient A?). By definition for Q to be orthogonal span{$q_1, \ldots , q_k$} must be equivalent to $\mathbb{R}^k$, however by assumption of {$a_i$}, $i=1, \ldots k$ not being linearly independent, they cannot span something equivalent to $\mathbb{R}^k$
However, if you assumed A was ordered such that the first columns are the linearly independent columns than I believe the answer to your question would be yes.
