Power of RREF of Matrix equals RREF of Power of Matrix

Let $$A$$ be a square matrix. Then $$\operatorname{RREF}(A^n)=(\operatorname{RREF}(A))^n$$ for any nonnegative integer $$n$$. [Edit: this is False]

I've tested this computationally for a couple thousand pseudorandom real matrices, and it seems to be true, it's just that I don't really know how to prove it. Any help would be much appreciated!

• False for $n=2$ and $A = \begin{pmatrix} 1 & 1 & 2 \\ 0 & 0 & 1 \\ 0 & 0 & 0 \end{pmatrix}$. – darij grinberg Jun 12 at 16:26
• I wouldn't be too surprised if it holds under some conditions such as "all pivots lie in the first $k$ columns, where $k$ is the number of pivots". The trick should be to prove that $\operatorname{RREF} A$ is a projection matrix in this case, and that $\operatorname{RREF} \left(A^n\right) = \operatorname{RREF} A$. No guarantee, just my best guess at how to salvage your claim. – darij grinberg Jun 12 at 16:27
• Hmm, and here I thought my humble computational tests would save me such embarrassment (I did some more now and of course there are many counterexamples (though maybe less than one'd expect)). Well, nonetheless, thank you very much! – BlondCafé Jun 12 at 17:39
• I suspect a better way to sample a random matrix is to pick a random rook matrix (i.e., a matrix where each entry is $0$ or $1$, and each row has at most one $1$, and each column has at most one $1$), and multiply it from both sides by triangular matrices. Otherwise, you'll almost always get full-rank matrices, and those have a really boring RREF. – darij grinberg Jun 12 at 19:05
• Okay, the way I tried to salvage your claim doesn't work either. Counterexample: $A = \begin{pmatrix} 0 & 0 \\ 1 & 0 \end{pmatrix}$ and $n = 2$. Again, it seems that the "generic" matrix whose pivots lie in the first $k$ columns, where $k$ is the number of pivots, will satisfy $\operatorname{RREF} \left(A^n\right) = \operatorname{RREF} A$, but the best meaning of "generic" for which I can prove this is $\operatorname{rank}\left(A^n\right) = \operatorname{rank}A$, which makes the claim fairly trivial. – darij grinberg Jun 13 at 4:52