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