reserve n for Nat,
  a, b, r, w for Real,
  x, y, z for Point of TOP-REAL n,
  e for Point of Euclid n;
reserve V for RealLinearSpace,
        p,q,x for Element of V;

theorem
  x in halfline(p,q) & x <> p implies halfline(p,q) = halfline(p,x)
proof
  assume
A1: x in halfline(p,q);
  then consider R being Real such that
A2: x = (1-R)*p + R*q and
A3: 0 <= R;
  assume
A4: x <> p;
  thus halfline(p,q) c= halfline(p,x)
  proof
    let d be object;
    assume
A5: d in halfline(p,q);
    then reconsider d as Point of V;
    consider r being Real such that
A6: d = (1-r)*p + r*q and
A7: 0 <= r by A5;
    set o = r/R;
    R <> 0 by A2,A4,Th2;
    then o*R = r by XCMPLX_1:87;
    then d = (1-o + o*(1-R))*p + o*(R*q) by A6,RLVECT_1:def 7
      .= (1-o)*p + o*(1-R)*p + o*(R*q) by RLVECT_1:def 6
      .= (1-o)*p + o*((1-R)*p) + o*(R*q) by RLVECT_1:def 7
      .= (1-o)*p + (o*((1-R)*p) + o*(R*q)) by RLVECT_1:def 3
      .= (1-o)*p + o*((1-R)*p + R*q) by RLVECT_1:def 5;
    hence thesis by A2,A3,A7;
  end;
  thus thesis by A1,Th28;
end;
