Let $A$ be an invertible $n \times n$ matrix and denote by $r_i(A,j)$ the vector with entries as in row $i$ of $A$ with columns from $1,...,j$. We can obtain $r_i(A,j)$ in Sage as follows:
def givesubmatrix(A,i,j):
B=A[[i-1],[0..j-1]]
return(B)
I want to find the permutation $p(M)$ of the set $[ 1,...,n ]$ (it seems set brackets dont work in this forum using latex? So I use [ and ] instead for the set brackets) defined by the condition: $p(A,i):=\min [ j \mid r_i(A,j) \text{ is not in the span of } [{r_i(A,j),...,r_{i-1}(A,j)] } ].$ Is there an easy way to obtain this permutation?
I have already problems to define the subspace $[{r_i(A,j),...,r_{i-1}(A,j)] }$.