reserve x,y for set,
  i,j,k,l,m,n for Nat,
  K for Field,
  N for without_zero finite Subset of NAT,
  a,b for Element of K,
  A,B,B1,B2,X,X1,X2 for (Matrix of K),
  A9 for (Matrix of m,n,K),
  B9 for (Matrix of m,k,K);

theorem Th23:
  for A,B be Matrix of K st B = 0.(K,len A,m) holds the_rank_of A
  = the_rank_of (A^^B)
proof
  let A,B be Matrix of K such that
A1: B = 0.(K,len A,m);
A2: len B = len A by A1,MATRIX_0:def 2;
  set L=len A;
  reconsider B9=B as Matrix of L,width B,K by A2,MATRIX_0:51;
  reconsider A9=A as Matrix of L,width A,K by MATRIX_0:51;
  set AB=A9^^B9;
  per cases;
  suppose
    width B=0;
    hence thesis by A2,Th22;
  end;
  suppose
    width B>0;
    then
A3: L>0 by A2,MATRIX_0:def 3;
    then
A4: width AB=width A+width B by MATRIX_0:23;
A5: len AB=L by A3,MATRIX_0:23;
A6: now
      set L0=len AB |-> 0.K;
      let i such that
A7:   i in Seg width AB \ Seg width A;
A8:   i in Seg width AB by A7,XBOOLE_0:def 5;
      not i in Seg width A by A7,XBOOLE_0:def 5;
      then
A9:   i<1 or i>width A;
      then reconsider n=i-width A as Element of NAT by A8,FINSEQ_1:1,NAT_1:21;
A10:  i=n+width A;
      n<>0 by A8,A9,FINSEQ_1:1;
      then
A11:  n in Seg width B by A4,A8,A10,FINSEQ_1:61;
A12:  now
        let i such that
A13:    1<=i & i<=L;
A14:    i in Seg L by A13;
        then
A15:    L0.i=0.K by A5,FINSEQ_2:57;
        Seg L=dom B by A2,FINSEQ_1:def 3;
        then Col(B9,n).i=B9*(i,n) & [i,n] in Indices B by A11,A14,
MATRIX_0:def 8,ZFMISC_1:87;
        hence Col(B9,n).i=L0.i by A1,A15,MATRIX_3:1;
      end;
A16:  len Col(B,n)=L & len L0=L by A2,A5,CARD_1:def 7;
      Col(AB,i)=Col(B9,n) by A10,A11,Th17;
      hence Col(AB,i) = len AB |-> 0.K by A16,A12;
    end;
    width A <= width AB by A4,NAT_1:11;
    then Seg width A c= Seg width AB by FINSEQ_1:5;
    hence the_rank_of (A^^B) = the_rank_of Segm(AB,Seg len AB,Seg width A) by
A6,Th12
      .= the_rank_of A by A5,Th19;
  end;
end;
