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 Th18:
  for D be non empty set, A be Matrix of n,m,D, B be Matrix of n,k
  ,D for pA,pB be FinSequence of D st len pA = width A & len pB = width B holds
  ReplaceLine(A^^B,i,pA^pB) = ReplaceLine(A,i,pA) ^^ ReplaceLine(B,i,pB)
proof
  let D be non empty set, A be Matrix of n,m,D, B be Matrix of n,k,D;
  let pA,pB be FinSequence of D such that
A1: len pA = width A and
A2: len pB = width B;
  set RB=RLine(B,i,pB);
  set RA=RLine(A,i,pA);
  set AB=A^^B;
  set RAB=RLine(AB,i,pA^pB);
  set Rab=RA^^RB;
A3: now
    pA is Element of (width A)-tuples_on D & pB is Element of (width B)
    -tuples_on D by A1,A2,FINSEQ_2:92;
    then pA^pB is Tuple of width A+width B, D;
    then pA^pB is Element of (width A+width B)-tuples_on D by FINSEQ_2:131;
    then
A4: len (pA^pB)=width A+width B by CARD_1:def 7;
    let j such that
A5: 1<=j & j<=n;
A6: j in Seg n by A5;
A7: width AB=width A+width B by A5,MATRIX_0:23;
A8: now
      per cases;
      suppose
A9:     i=j;
        then
A10:    Line(RB,j)=pB by A2,A6,MATRIX11:28;
        Line(RAB,j)=pA^pB & Line(RA,j)=pA by A1,A6,A4,A7,A9,MATRIX11:28;
        hence Line(RAB,j)=Line(Rab,j) by A6,A10,Th15;
      end;
      suppose
A11:    i<>j;
        then
A12:    Line(RB,j)=Line(B,j) by A6,MATRIX11:28;
        Line(RAB,j)=Line(AB,j) & Line(RA,j)=Line(A,j) by A6,A11,MATRIX11:28;
        hence Line(RAB,j) = Line(RA,j)^Line(RB,j) by A6,A12,Th15
          .= Line(Rab,j) by A6,Th15;
      end;
    end;
    thus RAB.j = Line(RAB,j) by A6,MATRIX_0:52
      .= Rab.j by A6,A8,MATRIX_0:52;
  end;
  len RAB=n & len Rab=n by MATRIX_0:def 2;
  hence thesis by A3;
end;
