reserve V for RealLinearSpace;
reserve p,q,u,v,w,y for VECTOR of V;
reserve a,b,c,d for Real;

theorem Th18:
  p<>v & v,p // p,w implies ex y st u,p // p,y & u,v // w,y
proof
  assume
A1: p<>v & v,p // p,w;
A2: now
    assume p<>w;
    then consider a,b such that
A3: a*(p-v)=b*(w-p) and
A4: 0<a and
A5: 0<b by A1;
    set y=(b"*a)*(p-u)+p;
A6: y-p=(b"*a)*(p-u) by RLSUB_2:61
      .=b"*(a*(p-u)) by RLVECT_1:def 7;
A7: y-w=(y-p)+(p-w) by Th1
      .=(y-p)-(w-p) by RLVECT_1:33;
    v-u=(p-u)+(v-p) by Th1
      .=(p-u)-(p-v) by RLVECT_1:33;
    then a*(v-u)=a*(p-u)-a*(p-v) by RLVECT_1:34
      .=b*(y-p)-b*(w-p) by A3,A5,A6,Th6
      .=b*(y-w) by A7,RLVECT_1:34;
    then
A8: u,v // w,y by A4,A5;
    0<b" by A5;
    then
A9: 0<b"*a by A4,XREAL_1:129;
    jj*(y-p)=y-p by RLVECT_1:def 8
      .=(b"*a)*(p-u) by RLSUB_2:61;
    then u,p // p,y by A9;
    hence thesis by A8;
  end;
  now
    assume
A10: p=w;
    take y=p;
    thus u,p // p,y & u,v // w,y by A10;
  end;
  hence thesis by A2;
end;
