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
  f is_strictly_convex_on X implies f is_convex_on X
proof
  assume
A1: f is_strictly_convex_on X;
A2: for p being Real
  st 0<=p & p<=1 holds for r,s being Real st r in X & s
  in X & p*r + (1-p)*s in X holds f.(p*r + (1-p)*s) <= p*f.r + (1-p)*f.s
  proof
    let p be Real;
    assume
A3: 0<=p & p<=1;
    for r,s being Real
   st r in X & s in X & p*r+(1-p)*s in X holds f.(p*r
    + (1-p)*s) <= p*f.r + (1-p)*f.s
    proof
      let r,s be Real;
      assume
A4:   r in X & s in X & p*r+(1-p)*s in X;
      now
        per cases by A3,XXREAL_0:1;
        suppose
          p=0;
          hence thesis;
        end;
        suppose
          p=1;
          hence thesis;
        end;
        suppose
A5:       0<p & p<1;
          now
            per cases;
            suppose
              r=s;
              hence thesis;
            end;
            suppose
              r<>s;
              hence thesis by A1,A4,A5;
            end;
          end;
          hence thesis;
        end;
      end;
      hence thesis;
    end;
    hence thesis;
  end;
  X c= dom f by A1;
  hence thesis by A2,RFUNCT_3:def 12;
end;
