reserve z,z1,z2 for Complex;
reserve r,x1,x2 for Real;
reserve p0,p,p1,p2,p3,q for Point of TOP-REAL 2;

theorem Th48:
  for n being Element of NAT,p1,p2,p3,p being Point of TOP-REAL n
st p in plane(p1,p2,p3)
ex a1,a2,a3 being Real st a1+a2+a3=1 & p=a1*p1+a2
  *p2+a3*p3
proof
  let n be Element of NAT,p1,p2,p3,p be Point of TOP-REAL n;
  assume
A1: p in plane(p1,p2,p3);
  now
    per cases by A1,XBOOLE_0:def 3;
    case
      p in outside_of_triangle(p1,p2,p3);
      then
      ex p4 being Point of TOP-REAL n st p4=p &
ex a1,a2,a3 being Real st (
      0>a1 or 0>a2 or 0>a3) & a1+a2+a3=1 & p4= a1*p1+a2*p2+a3*p3;
      hence thesis;
    end;
    case
      p in closed_inside_of_triangle(p1,p2,p3);
      then
      ex p4 being Point of TOP-REAL n st p4=p &
ex a1,a2,a3 being Real st 0
      <=a1 & 0<=a2 & 0<=a3 & a1+a2+a3=1 & p4=a1 *p1+a2*p2+a3*p3;
      hence thesis;
    end;
  end;
  hence thesis;
end;
