reserve p1,p2,p3,p4,p5,p6,p,pc for Point of TOP-REAL 2;
reserve a,b,c,r,s for Real;

theorem Th8:
  p in LSeg(p1,p2) & p<>p1 & p<>p2 implies angle(p1,p,p2) = PI
proof
  set c1=euc2cpx(p1-p);
  set c2=euc2cpx(p2-p);
  assume p in LSeg(p1,p2);
  then consider l be Real such that
A1: p=(1-l)*p1+l*p2 and
A2: 0<=l and
A3: l<=1;
   reconsider l as Real;
A4: p2-p = p2-((1+(-l))*p1 +l*p2) by A1
    .= p2-((1)*p1+(-l)*p1 +l*p2) by RLVECT_1:def 6
    .= p2+(-1)*((1)*p1+(-l)*p1 +l*p2)
    .= p2+((-1)*((1)*p1+(-l)*p1)+(-1)*(l*p2)) by RLVECT_1:def 5
    .= p2+((-1)*(p1+(-l)*p1)+(-1)*(l*p2)) by RLVECT_1:def 8
    .= p2+((-1)*(p1+(-l)*p1)+((-1)*l)*p2) by RLVECT_1:def 7
    .= p2+((-1)*p1+(-1)*((-l)*p1)+(-l)*p2) by RLVECT_1:def 5
    .= p2+((-1)*p1+((-1)*(-l))*p1+(-l)*p2) by RLVECT_1:def 7
    .= p2+((-1)*p1+(l*p1+(-l)*p2)) by RLVECT_1:def 3
    .= p2+(-p1+(l*p1+(-l)*p2))
    .= (-p1+p2)+(l*(p1)+(-l)*p2) by RLVECT_1:def 3
    .= (-p1+p2)+(l*(--p1)+(-l)*p2)
    .= (-p1+p2)+(l*((-1)*(-p1))+(-l)*p2)
    .= (-p1+p2)+(l*(-1)*(-p1)+(-l)*p2) by RLVECT_1:def 7
    .= (-p1+p2)+(-l)*(-p1+p2) by RLVECT_1:def 5
    .= (1)*(-p1+p2)+(-l)*(-p1+p2) by RLVECT_1:def 8
    .= (1+(-l))*(-p1+p2) by RLVECT_1:def 6
    .= (1-l)*(-p1+p2);
  assume
A5: p<>p1;
A6: l<>0
  proof
    assume l=0;
    then p =1*p1+0.TOP-REAL 2 by A1,RLVECT_1:10
      .=1*p1 by RLVECT_1:4
      .=p1 by RLVECT_1:def 8;
    hence contradiction by A5;
  end;
  assume
A7: p<>p2;
  l<>1
  proof
    assume l=1;
    then p = 0.TOP-REAL 2+1*p2 by A1,RLVECT_1:10
      .= 1*p2 by RLVECT_1:4
      .= p2 by RLVECT_1:def 8;
    hence contradiction by A7;
  end;
  then l<1 by A3,XXREAL_0:1;
  then -1 < -l by XREAL_1:24;
  then
A8: -1+1 < -l+1 by XREAL_1:6;
A9: -c2<>0
  proof
    assume -c2 = 0;
    then |.p2-p.| = 0 by COMPLEX1:44,EUCLID_3:25;
    then p2-p = 0.TOP-REAL 2 by EUCLID_2:42;
    hence contradiction by A7,RLVECT_1:21;
  end;
  set r = -l/(1-l);
A10: p1-p = p1-((1+(-l))*p1 +l*p2) by A1
    .= p1-((1)*p1+(-l)*p1 +l*p2) by RLVECT_1:def 6
    .= p1+(-1)*((1)*p1+(-l)*p1 +l*p2)
    .= p1+((-1)*((1)*p1+(-l)*p1)+(-1)*(l*p2)) by RLVECT_1:def 5
    .= p1+((-1)*(p1+(-l)*p1)+(-1)*(l*p2)) by RLVECT_1:def 8
    .= p1+((-1)*(p1+(-l)*p1)+((-1)*l)*p2) by RLVECT_1:def 7
    .= p1+((-1)*p1+(-1)*((-l)*p1)+(-l)*p2) by RLVECT_1:def 5
    .= p1+((-1)*p1+((-1)*(-l))*p1+(-l)*p2) by RLVECT_1:def 7
    .= p1+((-1)*p1+(l*p1+(-l)*p2)) by RLVECT_1:def 3
    .= p1+(-p1+(l*p1+(-l)*p2))
    .= (p1+(-p1))+(l*p1+(-l)*p2) by RLVECT_1:def 3
    .= 0.TOP-REAL 2 +(l*p1+(-l)*p2) by RLVECT_1:5
    .= l*p1+(l*(-1))*p2 by RLVECT_1:4
    .= l*p1+l*((-1)*p2) by RLVECT_1:def 7
    .= l*p1+l*(-p2)
    .= l*(p1-p2) by RLVECT_1:def 5;
  cpx2euc(c2 * r) = r*cpx2euc(c2) by EUCLID_3:19
    .= (-l/(1-l))*((1-l)*(-p1+p2)) by A4,EUCLID_3:2
    .= ((-l/(1-l))*(1-l))*(-p1+p2) by RLVECT_1:def 7
    .= (((-l)/(1-l))*(1-l))*(-p1+p2) by XCMPLX_1:187
    .= (((1-l)/(1-l))*(-l))*(-p1+p2) by XCMPLX_1:75
    .= ((1)*(-l))*(-p1+p2) by A8,XCMPLX_1:60
    .= (l*(-1))*(-p1+p2)
    .= l*((-1)*(-p1+p2)) by RLVECT_1:def 7
    .= l*((-1)*(-p1)+(-1)*p2) by RLVECT_1:def 5
    .= l*(--p1+(-1)*p2)
    .= l*(--p1+-p2)
    .= l*(--p1+(-p2))
    .= l*(p1+(-p2))
    .= cpx2euc(c1) by A10,EUCLID_3:2;
  then c1 = c2*r by EUCLID_3:3;
  then
A11: Arg(-c2) = Arg c1 by A2,A6,A8,COMPLEX2:28;
  angle(c1,-c2) = 0
  proof
    per cases;
    suppose
      Arg(-c2) - Arg c1 < 0;
      hence thesis by A11;
    end;
    suppose
      Arg(-c2) - Arg c1 >= 0;
      hence thesis by A11,A9,Lm11;
    end;
  end;
  then angle(c1,-(-c2)) = PI by A9,COMPLEX2:68;
  hence thesis by Lm7;
end;
