reserve x, y for object, X for set,
  i, j, k, l, n, m for Nat,
  D for non empty set,
  K for commutative Ring,
  a,b for Element of K,
  perm, p, q for Element of Permutations(n),
  Perm,P for Permutation of Seg n,
  F for Function of Seg n,Seg n,
  perm2, p2, q2, pq2 for Element of Permutations(n+2),
  Perm2 for Permutation of Seg (n+2);
reserve s for Element of 2Set Seg (n+2);
reserve pD for FinSequence of D,
  M for Matrix of n,m,D,
  pK,qK for FinSequence of K,
  A for Matrix of n,K;

theorem Th28:
  for l,M,pD,i st i in Seg n holds (i = l & len pD = width M
  implies Line(RLine(M,l,pD),i) = pD) & (i <> l implies Line(RLine(M,l,pD),i) =
  Line(M,i))
proof
  let l,M,pD,i such that
A1: i in Seg n;
  set R=RLine(M,l,pD);
  set LR=Line(R,i);
  thus i=l & len pD=width M implies LR=pD
  proof
    assume that
A2: i=l and
A3: len pD=width M;
A4: width R=len pD by A3,Def3;
A5: now
      let j be Nat such that
A6:   1 <=j and
A7:   j <= len pD;
A8:   j in Seg width R by A4,A6,A7;
      n=len R by MATRIX_0:def 2;
      then i in dom R by A1,FINSEQ_1:def 3;
      then
A9:   [i,j] in Indices R by A8,ZFMISC_1:87;
A10:  Indices R=Indices M by Lm4;
      LR.j=R*(i,j) by A8,MATRIX_0:def 7;
      hence LR.j=pD.j by A2,A3,A9,A10,Def3;
    end;
    len LR=len pD by A4,MATRIX_0:def 7;
    hence thesis by A5;
  end;
  set LM=Line(M,i);
A11: width M=len LM by MATRIX_0:def 7;
A12: width M=width R by Lm4;
  assume
A13: i<>l;
A14: now
    let j be Nat such that
A15: 1 <=j and
A16: j <= len LM;
A17: j in Seg len LM by A15,A16;
    then
A18: LM.j=M*(i,j) by A11,MATRIX_0:def 7;
    i in Seg len M by A1,MATRIX_0:def 2;
    then i in dom M by FINSEQ_1:def 3;
    then
A19: [i,j] in Indices M by A11,A17,ZFMISC_1:87;
A20: LR.j=R*(i,j) by A12,A11,A17,MATRIX_0:def 7;
    now
      per cases;
      case
        len pD=width M;
        hence LM.j=LR.j by A13,A18,A20,A19,Def3;
      end;
      case
        len pD<>width M;
        hence LM.j=LR.j by Def3;
      end;
    end;
    hence LM.j=LR.j;
  end;
  len LR=width R by MATRIX_0:def 7;
  hence thesis by A12,A11,A14;
end;
