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;
reserve p, q, x for Point of TOP-REAL n;
reserve s, t for Point of TOP-REAL 2;

theorem
 for V being RealLinearSpace, p1,p2,p3 being Point of V holds
  p1,p2,p3 are_collinear iff
   p1 in LSeg(p2,p3) or p2 in LSeg(p3, p1) or p3 in LSeg(p1,p2)
proof let V be RealLinearSpace, p1,p2,p3 be Point of V;
 thus p1,p2,p3 are_collinear implies
   p1 in LSeg(p2,p3) or p2 in LSeg(p3, p1) or p3 in LSeg(p1,p2)
 proof assume p1,p2,p3 are_collinear;
   then consider L being line of V such that
A1: p1 in L and
A2: p2 in L and
A3: p3 in L;
  consider x1,x2 being Point of V such that
A4: L = Line(x1,x2) by RLTOPSP1:def 15;
  per cases;
  suppose p2 = p3;
   hence thesis by RLTOPSP1:68;
  end;
  suppose p2 <> p3;
   then
A5: Line(p2,p3) = L by A2,A3,RLTOPSP1:75,A4;
  per cases;
  suppose p1 in halfline(p2,p3);
  hence thesis by Th64;
  end;
  suppose
A6:  not p1 in halfline(p2,p3);
   L = halfline(p2,p3) \/ halfline(p3,p2) by Th63,A5;
   then p1 in halfline(p3,p2) by A1,XBOOLE_0:def 3,A6;
  hence thesis by Th64;
  end;
 end;
 end;
 assume p1 in LSeg(p2,p3) or p2 in LSeg(p3, p1) or p3 in LSeg(p1,p2);
  then per cases;
  suppose
A7:  p1 in LSeg(p2,p3);
   take Line(p2,p3);
    LSeg(p2,p3) c= Line(p2,p3) by RLTOPSP1:73;
   hence p1 in Line(p2,p3) by A7;
   thus p2 in Line(p2,p3) by RLTOPSP1:72;
   thus p3 in Line(p2,p3) by RLTOPSP1:72;
  end;
  suppose
A8:  p2 in LSeg(p3, p1);
   take Line(p3,p1);
   thus p1 in Line(p3,p1) by RLTOPSP1:72;
    LSeg(p3,p1) c= Line(p3,p1) by RLTOPSP1:73;
   hence p2 in Line(p3,p1) by A8;
   thus p3 in Line(p3,p1) by RLTOPSP1:72;
  end;
  suppose
A9:  p3 in LSeg(p1,p2);
   take Line(p1,p2);
   thus p1 in Line(p1,p2) by RLTOPSP1:72;
   thus p2 in Line(p1,p2) by RLTOPSP1:72;
    LSeg(p1,p2) c= Line(p1,p2) by RLTOPSP1:73;
   hence p3 in Line(p1,p2) by A9;
  end;
end;
