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 Th27:
  a1+a2+a3=1 implies a1*x1+a2*x2+a3*x3=x1+a2*(x2-x1)+a3*(x3-x1)
proof
  assume a1+a2+a3=1;
  then a1=1-a2-a3;
  hence 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
    .= x1 + a2*(x2-x1) + a3*(x3-x1) by Th12;
end;
