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 Th22:
  for A,B be Matrix of K st len A = len B & width A = 0 holds A ^^
  B = B & B ^^ A = B
proof
  let A,B be Matrix of K such that
A1: len A = len B and
A2: width A =0;
A3: Seg width A = {} by A2;
  set L=len A;
  reconsider B9=B as Matrix of L,width B,K by A1,MATRIX_0:51;
  reconsider A9=A as Matrix of L,width A,K by MATRIX_0:51;
  set AB=A9^^B9;
  set BA=B9^^A9;
  per cases;
  suppose
A4: L=0;
    then len BA=0 by MATRIX_0:def 2;
    then
A5: BA={};
    len AB=0 by A4,MATRIX_0:def 2;
    then AB={};
    hence thesis by A1,A4,A5;
  end;
  suppose
A6: L>0;
    then width AB=width B & len AB=L by A2,MATRIX_0:23;
    hence A^^B = Segm(AB,Seg L,Seg width B\Seg width A) by A3,MATRIX13:46
      .= B by A2,Th19;
    width BA=width B & len BA=L by A2,A6,MATRIX_0:23;
    hence B^^A = Segm(BA,Seg L,Seg width B) by MATRIX13:46
      .=B by Th19;
  end;
end;
