reserve a,a1,a2,a3,b,b1,b2,b3,r,s,t,u for Real;
reserve n for Nat;
reserve x0,x,x1,x2,x3,y0,y,y1,y2,y3 for Element of REAL n;

theorem Th28:
  x=x1+a2*(x2-x1)+a3*(x3-x1) implies ex a1 be Real st x=a1*x1+a2*
  x2+a3*x3 & a1+a2+a3=1
proof
  assume
A1: x=x1+a2*(x2-x1)+a3*(x3-x1);
  reconsider a1 = 1-a2-a3 as Real;
  take a1;
  a1*x1+a2*x2+a3*x3 = 1 * x1 - a2*x1 - a3*x1 + a2*x2 + a3*x3 by Th13
    .= x1 + -a2*x1 - a3*x1 + a2*x2 + a3*x3 by EUCLID_4:3
    .= x1 + -a2*x1 + a2*x2 + -a3*x1 + a3*x3 by RVSUM_1:15
    .= x1 + (a2*x2 + -a2*x1) + -a3*x1 + a3*x3 by RVSUM_1:15
    .= x1 + (a2*x2 + -a2*x1) + (a3*x3 + -a3*x1) by RVSUM_1:15
    .= x1 + a2*(x2-x1) + (a3*x3 + -a3*x1) by Th12
    .= x by A1,Th12;
  hence thesis;
end;
