reserve n,m for Nat,
  r,r1,r2,s,t for Real,
  x,y for set;

theorem
  for F,G be PartFunc of REAL,REAL, X be set st F is_convex_on X & G
  is_convex_on X holds F+G is_convex_on X
proof
  let F,G be PartFunc of REAL,REAL, X be set;
A1: dom(F+G) = dom F /\ dom G by VALUED_1:def 1;
  assume
A2: F is_convex_on X & G is_convex_on X;
  then X c= dom F & X c= dom G;
  hence
A3: X c= dom(F+G) by A1,XBOOLE_1:19;
  let p be Real;
  assume
A4: 0<=p & p<=1;
  let x,y be Real;
  assume that
A5: x in X and
A6: y in X and
A7: p*x + (1-p)*y in X;
  F.(p*x+(1-p)*y) <= p*F.x + (1-p)*F.y & G.(p*x+(1-p)*y) <= p*G.x + (1-p)
  *G.y by A2,A4,A5,A6,A7;
  then
  F.(p*x+(1-p)*y) + G.(p*x+(1-p)*y) <= p*F.x + (1-p)*F.y + (p*G.x + (1-p)
  *G.y) by XREAL_1:7;
  then
A8: (F+G).(p*x+(1-p)*y) <= p*F.x + (1-p)*F.y + (p*G.x + (1-p)*G.y) by A3,A7,
VALUED_1:def 1;
  p*F.x+(1-p)*F.y + (p*G.x+(1-p)*G.y) = p*(F.x+G.x) + (1-p)*F.y + (1-p)*G . y
    .= p*(F+G).x + (1-p)*F.y + (1-p)*G.y by A3,A5,VALUED_1:def 1
    .= p*(F+G).x + (1-p)*(F.y + G.y);
  hence thesis by A3,A6,A8,VALUED_1:def 1;
end;
