# How does an unpivoted QR fail to reveal rank?

An unpivoted QR factorization produces a triangular factor $R$. A rank-revealing QR factorization is typically done with column pivoting. My question is, how does an unpivoted QR factorization fail to reveal rank? If a matrix is singular, then a diagonal element of $R$ must be zero or tiny. And this element is almost always (as far as I can tell) the bottom left element.

• There is a clear exposition in Golub, Van Loan, Section 5.4 (of the 4th edition). TL;DR: what do you expect the rank of $\begin{bmatrix}1 & 1 & 1 & 1 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 1\\0 & 0 & 0 & 1 \end{bmatrix}$ to be? – Federico Poloni May 2 '15 at 7:42
• Ok, I see. But matrices of this type are rather pathological. In the case of a general fully dense square matrix that has at most one small eigenvalue, is it possible to say something stronger about the $R$ factor? – Victor Liu May 4 '15 at 17:36
• No, there are counterexamples even with only one small eigenvalue. Take that matrix and premultiply it by a random 4x4 orthogonal matrix $Q$. The resulting matrix (for most choices of $Q$) has only one small eigenvalue, since the product has rank $3$. (pre-multiplying with $Q$ does not preserve eigenvalues). – Federico Poloni May 4 '15 at 19:26