reserve x,y for object,X,Y for set,
  D for non empty set,
  i,j,k,l,m,n,m9,n9 for Nat,
  i0,j0,n0,m0 for non zero Nat,
  K for Field,
  a,b for Element of K,
  p for FinSequence of K,
  M for Matrix of n,K;
reserve A for (Matrix of D),
  A9 for Matrix of n9,m9,D,
  M9 for Matrix of n9, m9,K,
  nt,nt1,nt2 for Element of n-tuples_on NAT,
  mt,mt1 for Element of m -tuples_on NAT,
  M for Matrix of K;
reserve P,P1,P2,Q,Q1,Q2 for without_zero finite Subset of NAT;
reserve v,v1,v2,u,w for Vector of n-VectSp_over K,
  t,t1,t2 for Element of n -tuples_on the carrier of K,

  L for Linear_Combination of n-VectSp_over K,
  M,M1 for Matrix of m,n,K;

theorem Th122:
  for U be Subset of n-VectSp_over K st U c= lines M ex P st P c=
  Seg m & lines Segm(M,P,Seg n) = U & Segm(M,P,Seg n) is without_repeated_line
proof
  defpred P[object,object] means
    ex i st i in Seg m & Line(M,i)=$1 & $2=i;
  let U be Subset of n-VectSp_over K such that
A1: U c= lines M;
A2: for x being object st x in U ex y being object st y in Seg m & P[x,y]
  proof
    let x be object;
    assume x in U;
    then consider i such that
A3: i in Seg m and
A4: x=Line(M,i) by A1,Th103;
    take i;
    thus thesis by A3,A4;
  end;
  consider f be Function of U,Seg m such that
A5: for x being object st x in U holds P[x,f.x] from FUNCT_2:sch 1(A2);
A6: rng f c= Seg m by RELAT_1:def 19;
  then not 0 in rng f;
  then reconsider P=rng f as without_zero finite Subset of NAT by A6,
MEASURE6:def 2,XBOOLE_1:1;
  set S=Segm(M,P,Seg n);
A7: rng Sgm P=P by FINSEQ_1:def 14;
A8: lines S c= U
  proof
A9: rng Sgm P=P by FINSEQ_1:def 14;
    let x be object;
A10: dom S = Seg len S by FINSEQ_1:def 3
      .= Seg card P by MATRIX_0:def 2;
    assume
A11: x in lines S;
    then consider y being object such that
A12: y in dom S and
A13: S.y=x by FUNCT_1:def 3;
    lines S c= lines M by A6,Th118;
    then
A14: M<>{} by A11;
    len M=m by MATRIX_0:def 2;
    then
A15: width M=n by A14,Th1;
    reconsider y as Element of NAT by A12;
    dom Sgm P = Seg card P by FINSEQ_3:40;
    then Sgm P.y in rng Sgm P by A12,A10,FUNCT_1:def 3;
    then consider z be object such that
A16: z in dom f and
A17: f.z=Sgm P.y by A9,FUNCT_1:def 3;
    ex i st i in Seg m & Line(M,i)=z & f.z=i by A5,A16;
    then z = Line(S,y) by A12,A10,A17,A15,Th48
      .= x by A12,A13,A10,MATRIX_0:52;
    hence thesis by A16;
  end;
  take P;
  thus P c= Seg m by RELAT_1:def 19;
  U c= lines S
  proof
    let x be object;
A18: dom Sgm P=Seg card P by FINSEQ_3:40;
    assume
A19: x in U;
    then consider i such that
A20: i in Seg m and
A21: Line(M,i)=x and
A22: f.x=i by A5;
    dom f=U by A20,FUNCT_2:def 1;
    then i in P by A19,A22,FUNCT_1:def 3;
    then i in rng Sgm P by FINSEQ_1:def 14;
    then consider y being object such that
A23: y in dom Sgm P and
A24: Sgm P.y=i by FUNCT_1:def 3;
    reconsider y as Element of NAT by A23;
    m <> 0 by A20;
        then
    width M=n by Th1;
    then Line(S,y)=x by A21,A23,A24,A18,Th48;
    hence thesis by A23,A18,Th103;
  end;
  hence U=lines S by A8,XBOOLE_0:def 10;
  let x1,x2 be object such that
A25: x1 in dom S and
A26: x2 in dom S and
A27: S.x1=S.x2;
A28: dom S = Seg len S by FINSEQ_1:def 3
    .= Seg card P by MATRIX_0:def 2;
  then
A29: dom Sgm P=dom S by FINSEQ_3:40;
  reconsider i1=x1,i2=x2 as Element of NAT by A25,A26;
A30: dom Sgm P = Seg card P by FINSEQ_3:40;
  then Sgm P.i1 in rng Sgm P by A25,A28,FUNCT_1:def 3;
  then consider y1 be object such that
A31: y1 in dom f and
A32: f.y1=Sgm P.i1 by A7,FUNCT_1:def 3;
A33: ex j1 be Nat st j1 in Seg m & Line(M,j1)=y1 & f.y1=j1 by A5,A31;
        then m <> 0;
        then
A34: width M=n by Th1;
  Sgm P.i2 in rng Sgm P by A26,A28,A30,FUNCT_1:def 3;
  then consider y2 be object such that
A35: y2 in dom f and
A36: f.y2=Sgm P.i2 by A7,FUNCT_1:def 3;
  ex j2 be Nat st j2 in Seg m & Line(M,j2)=y2 & f.y2=j2 by A5,A35;
  then
A37: Line(S,i2)=y2 by A26,A28,A36,A34,Th48;
A38: Sgm P is one-to-one by FINSEQ_3:92;
A39: Line(S,i1)=S.i1 by A25,A28,MATRIX_0:52;
  Line(S,i1)=y1 by A25,A28,A32,A33,A34,Th48;
  then Sgm P.i1=Sgm P.i2 by A26,A27,A28,A32,A36,A37,A39,MATRIX_0:52;
  hence thesis by A25,A26,A29,A38;
end;
