Obtaining a permutation associated to a matrix
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(A)$ 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_1(A,j),...,r_{i-1}(A,j) \} \}.$
Is there an easy way to obtain this permutation?
I have already problems to define the subspace generated by $\{r_i(A,j),...,r_{i-1}(A,j) \}$ using Sage.
Latex works fine here, but you need to double each backslash - e.g. use
\\{
for opening brace $\{$.Thank you, I did not know this. I do not have to do this when I use texmaker or overleaf.
Btw, you don't need to create lists like
[0..j-1]
unless they are truly needed, it's more efficient to use generators like(0..j-1)
.