reserve

  k,n,m,i,j for Element of NAT,
  K for Field;
reserve L for non empty addLoopStr;
reserve G for non empty multLoopStr;

theorem Th40:
  for A being Matrix of n,K st n>0 & A*(1,1)<>0.K ex P being
Matrix of n,K st P is invertible & (P*A)*(1,1)=1.K & (for i st 1<i & i<=n holds
  (P*A)*(i,1)= 0.K)& for j st 1<j & j<=n & A*(1,j)= 0.K holds (P*A)*(1,j)= 0.K
proof
  let A be Matrix of n,K;
  assume that
A1: n>0 and
A2: A*(1,1)<>0.K;
  set B=A@;
A3: 0+1<=n by A1,NAT_1:13;
  then [1,1] in Indices A by MATRIX_0:31;
  then B*(1,1)=A*(1,1) by MATRIX_0:def 6;
  then consider P0 being Matrix of n,K such that
A4: P0 is invertible and
A5: (B*P0)*(1,1)=1.K and
A6: for i st 1<i & i<=n holds (B*P0)*(1,i)= 0.K and
A7: for j st 1<j & j<=n & B*(j,1)= 0.K holds (B*P0)*(j,1)= 0.K by A1,A2,Th39;
A8: [1,1] in Indices (B*P0) by A3,MATRIX_0:31;
A9: for j st 1<j & j<=n & A*(1,j)= 0.K holds ((P0@)*A)*(1,j)= 0.K
  proof
    let j;
    assume that
A10: 1<j & j<=n and
A11: A*(1,j)= 0.K;
    [1,j] in Indices A by A3,A10,MATRIX_0:31;
    then B*(j,1)=A*(1,j) by MATRIX_0:def 6;
    then
A12: (B*P0)*(j,1)= 0.K by A7,A10,A11;
    [j,1] in Indices (B*P0) by A3,A10,MATRIX_0:31;
    then ((B*P0)@)*(1,j)= 0.K by A12,MATRIX_0:def 6;
    then ((P0@)*(B@))*(1,j)= 0.K by Th30;
    hence thesis by MATRIXR2:29;
  end;
A13: for i st 1<i & i<=n holds ((P0@)*A)*(i,1)= 0.K
  proof
    let i;
    assume 1<i & i<=n;
    then
A14: [1,i] in Indices (B*P0) & (B*P0)*(1,i)= 0.K by A3,A6,MATRIX_0:31;
    (B*P0)@=(P0@)*(B@) by Th30
      .=(P0@)*A by MATRIXR2:29;
    hence thesis by A14,MATRIX_0:def 6;
  end;
A15: P0@ is invertible by A4;
  ((P0@)*A)*(1,1)=((P0@)*(B@))*(1,1) by MATRIXR2:29
    .=((B*P0)@)*(1,1) by Th30
    .=1.K by A5,A8,MATRIX_0:def 6;
  hence thesis by A13,A15,A9;
end;
