I asked a question here [order of a permutation and lexicographic order](https://mathoverflow.net/questions/306572/order-of-a-permutation-and-lexicographic-order) but it seems\*\*\* that a very powerful and rich generalization can be made!


Let $A$ be a finite ring together with an arbitrary **total order** $<^\*$ and let $L: M\_n(A)\to M\_n(A)$ be the application that sorts the rows of a matrix according to the (increasing) lexicographic order (induced by $<^\*$) and the columns of the matrice we get, according to the increasing lexicographic order (increasingly too). We then define $L\_Q(M):=L(M).Q$ for any $Q\in M\_n(A)$.



> 
> Suppose that $Q^q=Id$ for some $q\in \mathbb N$ and $Q\in GL\_n(A)$. Is is true that for any $M\in M\_n(A)$, there exists $r\in \mathbb N$ such that for any $i\in \mathbb N$, we have $L\_Q^r(M)=L\_Q^{r+iq}(M)$ ?
> 
> 
> 


[edit : it is not true for $A=\mathbb Z$, but it seems asymptotically true up to a scalar multiplication of matrices, anyway I edited and ask $A$ to be finite]



root of identity matrix and lexicographic order
Iterating $\mathsf L\_Q$ over an initial matrix shall always yield a periodic sequence at some point because there is only finitely many possible matrices, but the period is not necessarily $q$ or a multiple or divisor of $q$.


Here is an example where the period is $4$ while $q=3$. It is a modification of [yours](https://mathoverflow.net/questions/306572/order-of-a-permutation-and-lexicographic-order "yours") where now $Q$ permutes the 3 first columns.


$Q=
\;\;\begin{matrix}0&1&0&0\\0&0&1&0\\1&0&0&0\\0&0&0&1\end{matrix}\;\; $
and 
$\;M=
\;\;\begin{matrix}0&0&1&1\\1&0&0&1\\0&1&1&0\\1&1&1&0\end{matrix}\;\;$


$ $


$ \xrightarrow{\mathsf R}
\;\;\begin{matrix}0&0&1&1\\0&1&1&0\\1&0&0&1\\1&1&1&0\end{matrix}\;\; \xrightarrow{\mathsf C}
\;\;\begin{matrix}0&0&1&1\\0&1&0&1\\1&0&1&0\\1&1&0&1\end{matrix}\;\; \xrightarrow{\mathsf Q} \color{red}{
\;\;\begin{matrix}1&0&0&1\\0&0&1&1\\1&1&0&0\\0&1&1&1\end{matrix}\;\; }
$


$ $


$ \xrightarrow{\mathsf R}
\;\;\begin{matrix}0&0&1&1\\0&1&1&1\\1&0&0&1\\1&1&0&0\end{matrix}\;\; \xrightarrow{\mathsf C}
\;\;\begin{matrix}0&0&1&1\\0&1&1&1\\1&0&0&1\\1&1&0&0\end{matrix}\;\; \xrightarrow{\mathsf Q}
\;\;\begin{matrix}1&0&0&1\\1&0&1&1\\0&1&0&1\\0&1&1&0\end{matrix}\;\; 
$


$ $


$ \xrightarrow{\mathsf R}
\;\;\begin{matrix}0&1&0&1\\0&1&1&0\\1&0&0&1\\1&0&1&1\end{matrix}\;\; \xrightarrow{\mathsf C}
\;\;\begin{matrix}0&0&1&1\\0&1&0&1\\1&0&1&0\\1&1&1&0\end{matrix}\;\; \xrightarrow{\mathsf Q}
\;\;\begin{matrix}1&0&0&1\\0&0&1&1\\1&1&0&0\\1&1&1&0\end{matrix}\;\; 
$


$ $


$ \xrightarrow{\mathsf R}
\;\;\begin{matrix}0&0&1&1\\1&0&0&1\\1&1&0&0\\1&1&1&0\end{matrix}\;\; \xrightarrow{\mathsf C}
\;\;\begin{matrix}0&0&1&1\\0&1&0&1\\1&1&0&0\\1&1&1&0\end{matrix}\;\; \xrightarrow{\mathsf Q}
\;\;\begin{matrix}1&0&0&1\\0&0&1&1\\0&1&1&0\\1&1&1&0\end{matrix}\;\; 
$


$ $


$ \xrightarrow{\mathsf R}
\;\;\begin{matrix}0&0&1&1\\0&1&1&0\\1&0&0&1\\1&1&1&0\end{matrix}\;\; \xrightarrow{\mathsf C}
\;\;\begin{matrix}0&0&1&1\\0&1&0&1\\1&0&1&0\\1&1&0&1\end{matrix}\;\; \xrightarrow{\mathsf Q} \color{red}{
\;\;\begin{matrix}1&0&0&1\\0&0&1&1\\1&1&0&0\\0&1&1&1\end{matrix}\;\; }
$


