reserve a,b,p,r,r1,r2,s,s1,s2,x0,x for Real;
reserve f,g for PartFunc of REAL,REAL;
reserve X,Y for set;

theorem
  for a,b be Real, f be PartFunc of REAL,REAL holds f
is_strictly_convex_on [.a,b.] iff
  [.a,b.] c= dom f & for p be Real st 0<p & p<1
 for r,s be Real
      st r in [.a,b.] & s in [.a,b.] & r <> s holds f.(p*r+(1-p
  )*s) < p*f.r + (1-p)*f.s
proof
  let a,b be Real, f be PartFunc of REAL,REAL;
  set ab = {r: a<=r & r<=b};
A1: [.a,b.]= ab by RCOMP_1:def 1;
  thus f is_strictly_convex_on [.a,b.] implies [.a,b.] c= dom f &
  for p be Real st 0<p & p<1
  for x,y be Real st x in [.a,b.] & y in [.a,b.] & x <> y
  holds f.(p*x + (1-p)*y) < p*f.x + (1-p)*f.y
  proof
    assume
A2: f is_strictly_convex_on [.a,b.];
    hence [.a,b.] c= dom f;
    let p be Real;
    assume that
A3: 0<p and
A4: p<1;
A5: 0<=1-p by A4,XREAL_1:48;
A6: p*b+(1-p)*b=b;
A7: p*a+(1-p)*a=a;
    let x,y be Real;
    assume that
A8: x in [.a,b.] and
A9: y in [.a,b.] and
A10: x <> y;
A11: ex r2 st r2=y & a<=r2 & r2<=b by A1,A9;
    then
A12: (1-p)*y<=(1-p)*b by A5,XREAL_1:64;
A13: ex r1 st r1=x & a<=r1 & r1<=b by A1,A8;
    then p*x<=p*b by A3,XREAL_1:64;
    then
A14: p*x+(1-p)*y<=b by A12,A6,XREAL_1:7;
A15: (1-p)*a<=(1-p)*y by A5,A11,XREAL_1:64;
    p*a<=p*x by A3,A13,XREAL_1:64;
    then a<=p*x+(1-p)*y by A15,A7,XREAL_1:7;
    then p*x+(1-p)*y in ab by A14;
    hence thesis by A1,A2,A3,A4,A8,A9,A10;
  end;
  assume that
A16: [.a,b.] c= dom f and
A17: for p be Real st 0<p & p<1
  for x,y be Real st x in [.a,b.] &
  y in [.a,b.] & x <> y holds f.(p*x + (1-p)*y) < p*f.x + (1-p)*f.y;
  thus [.a,b.] c= dom f by A16;
  let p be Real;
  assume
A18: 0<p & p<1;
  let x,y be Real;
  assume that
A19: x in [.a,b.] & y in [.a,b.] and
  p*x + (1-p)*y in [.a,b.];
  thus thesis by A17,A18,A19;
end;
