reserve p,p1,p2,p3,p11,p22,q,q1,q2 for Point of TOP-REAL 2,
  f,h for FinSequence of TOP-REAL 2,
  r,r1,r2,s,s1,s2 for Real,
  u,u1,u2,u5 for Point of Euclid 2,
  n,m,i,j,k for Nat,
  N for Nat,
  x,y,z for set;
reserve lambda for Real;

theorem Th30:
  LSeg(p,|[q`1,p`2]|) /\ LSeg(|[q`1,p`2]|,q) ={|[q`1,p`2]|}
proof
  set p3 = |[q`1,p`2]|;
  set l23 = LSeg(p,p3), l = LSeg(p3,q);
  thus l23 /\ l c= {p3}
  proof
    let x be object;
    assume
A1: x in l23 /\ l;
    then x in l23 by XBOOLE_0:def 4;
    then consider d1 be Real such that
A2: x = (1-d1)*p + d1*p3 and
    0 <= d1 and
    d1 <= 1;
    x in l by A1,XBOOLE_0:def 4;
    then consider d2 be Real such that
A3: x = (1-d2)*p3 + d2*q and
    0 <= d2 and
    d2 <= 1;
    set t = (1-d1)*p + d1*p3;
A4: t`2 = ((1-d1)*p) `2 + (d1*p3) `2 by Th2
      .= (1-d1)*(p `2) + (d1*p3) `2 by Th4
      .= (1-d1)*(p `2) + d1*(p3 `2) by Th4
      .= (1-d1)*(p3 `2) + d1*(p3 `2)
      .= p3 `2;
    t`1 = ((1-d2)*p3) `1 + (d2*q) `1 by A2,A3,Th2
      .= (1-d2)*(p3 `1) + (d2*q) `1 by Th4
      .= (1-d2)*(p3 `1) + d2*(q`1) by Th4
      .= (1-d2)*(p3`1) + d2*(p3`1)
      .= p3`1;
    then t = p3 by A4,Th6;
    hence thesis by A2,TARSKI:def 1;
  end;
  let x be object;
  assume x in {p3};
  then
A5: x=p3 by TARSKI:def 1;
  p3 in l23 & p3 in l by RLTOPSP1:68;
  hence thesis by A5,XBOOLE_0:def 4;
end;
