reserve r,lambda for Real,
  i,j,n for Nat;
reserve p,p1,p2,q1,q2 for Point of TOP-REAL 2,
  P, P1 for Subset of TOP-REAL 2;
reserve T for TopSpace;

theorem Th5:
  for p,p1,p2 being Point of TOP-REAL n st p in LSeg(p1,p2) holds
  LSeg(p1,p2) = LSeg(p1,p) \/ LSeg(p,p2)
proof
  let p,p1,p2 be Point of TOP-REAL n;
  now
    assume
A1: p in LSeg(p1,p2);
    then consider r such that
A2: p = (1-r)*p1 + r*p2 and
A3: 0 <= r and
A4: r <= 1;
    now
      per cases;
      suppose
A5:     0 <> r & r <> 1;
        now
          let q be object;
          assume q in LSeg(p1,p2);
          then consider b being Real such that
A6:       q = (1-b)*p1 + b*p2 and
A7:       0 <= b and
A8:       b <= 1;
          now
            per cases;
            suppose
A9:           b <= r;
              set x = b*(1/r);
              x <= r*(1/r) by A3,A9,XREAL_1:64;
              then
A10:          x <= 1 by A5,XCMPLX_1:106;
              (1-x)*p1 + x*p = (1-x)*p1 + (x*((1-r)*p1) + x*(r*p2)) by A2,
RLVECT_1:def 5
                .= (1-x)*p1 + x*((1-r)*p1) + x*(r*p2) by RLVECT_1:def 3
                .= (1-x)*p1 + x*(1-r)*p1 + x*(r*p2) by RLVECT_1:def 7
                .= (1-x)*p1 + x*(1-r)*p1 + x*r*p2 by RLVECT_1:def 7
                .= ((1-x) + x*(1-r))*p1 + x*r*p2 by RLVECT_1:def 6
                .= (1 -x*r)*p1 + b*p2 by A5,XCMPLX_1:109
                .= q by A5,A6,XCMPLX_1:109;
              then
              q in { (1-lambda)*p1 + lambda*p : 0 <= lambda & lambda <= 1
              } by A3,A7,A10;
              hence q in LSeg(p1,p) \/ LSeg(p,p2) by XBOOLE_0:def 3;
            end;
            suppose
A11:          not b <= r;
              set bp =1-b,rp=1-r;
              set x=bp*(1/rp);
A12:          0 <> rp by A5;
              r-r=0;
              then
A13:          0 <= rp by A4,XREAL_1:9;
              bp <= rp by A11,XREAL_1:10;
              then x <= rp*(1/rp) by A13,XREAL_1:64;
              then
A14:          x <= 1 by A12,XCMPLX_1:106;
A15:          0 <= bp by A8,XREAL_1:48;
A16:          1-0=1;
              (1-x)*p2 + x*p = (1-x)*p2 + (x*((1-rp)*p2) + x*(rp*p1)) by A2,
RLVECT_1:def 5
                .= (1-x)*p2 + x*((1-rp)*p2) + x*(rp*p1) by RLVECT_1:def 3
                .= (1-x)*p2 + x*(1-rp)*p2 + x*(rp*p1) by RLVECT_1:def 7
                .= (1-x)*p2 + x*(1-rp)*p2 + x*rp*p1 by RLVECT_1:def 7
                .= ((1-x) + x*(1-rp))*p2 + x*rp*p1 by RLVECT_1:def 6
                .= (1 -x*rp)*p2 + bp*p1 by A5,A16,XCMPLX_1:109
                .= (1-bp)*p2 + bp*p1 by A12,XCMPLX_1:109
                .= q by A6;
              then q in { (1-lambda)*p2 + lambda*p: 0 <= lambda & lambda <= 1
              } by A15,A13,A14;
              then q in LSeg(p,p2) by RLTOPSP1:def 2;
              hence q in LSeg(p1,p) \/ LSeg(p,p2) by XBOOLE_0:def 3;
            end;
          end;
          hence q in LSeg(p1,p) \/ LSeg(p,p2);
        end;
        then
A17:    LSeg(p1,p2) c= LSeg(p1,p) \/ LSeg(p,p2);
A18:    LSeg(p,p2) c= LSeg(p1,p2) by A1,Lm1;
        LSeg(p1,p) c= LSeg(p1,p2) by A1,Lm1;
        then LSeg(p1,p) \/ LSeg(p,p2) c= LSeg(p1,p2) by A18,XBOOLE_1:8;
        hence thesis by A17;
      end;
      suppose
A19:    not (0<>r & r<>1);
        now
          per cases by A19;
          suppose
A20:        r = 0;
A21:        p in LSeg(p,p2) by RLTOPSP1:68;
A22:        p = 1*p1 + 0.TOP-REAL n by A2,A20,RLVECT_1:10
              .= p1 + 0.TOP-REAL n by RLVECT_1:def 8
              .= p1 by RLVECT_1:4;
            then LSeg(p1,p) = {p} by RLTOPSP1:70;
            then LSeg(p1,p) c= LSeg(p,p2) by A21,ZFMISC_1:31;
            hence LSeg(p1,p2) = LSeg(p1,p) \/ LSeg(p,p2) by A22,XBOOLE_1:12;
          end;
          suppose
A23:        r = 1;
A24:        p in LSeg(p1,p) by RLTOPSP1:68;
A25:        p = 0.TOP-REAL n + 1*p2 by A2,A23,RLVECT_1:10
              .= 0.TOP-REAL n + p2 by RLVECT_1:def 8
              .= p2 by RLVECT_1:4;
            then LSeg(p,p2) = {p} by RLTOPSP1:70;
            then LSeg(p,p2) c= LSeg(p1,p) by A24,ZFMISC_1:31;
            hence LSeg(p1,p2) = LSeg(p1,p) \/ LSeg(p,p2) by A25,XBOOLE_1:12;
          end;
        end;
        hence thesis;
      end;
    end;
    hence thesis;
  end;
  hence thesis;
end;
