reserve x,y,y1,y2 for set;
reserve C for non empty set;
reserve c for Element of C;
reserve f,h,g,h1 for Membership_Func of C;

theorem
  f = max(g,h) iff g c= f & h c= f & for h1 st g c= h1 & h c= h1 holds f c= h1
proof
  hereby
    assume
A1: f = max(g,h);
    hence g c= f & h c= f by Th16;
    let h1;
    assume
A2: g c= h1 & h c= h1;
    thus f c= h1
    proof
      let x be Element of C;
      g.x <= h1.x & h.x <= h1.x by A2;
      then max(g.x,h.x) <= h1.x by XXREAL_0:28;
      hence thesis by A1,Def4;
    end;
  end;
  assume that
A3: g c= f & h c= f and
A4: for h1 st g c= h1 & h c= h1 holds f c= h1;
  g c= max(g,h) & h c= max(g,h) by Th16;
  then
A5: f c= max(g,h) by A4;
  max(g,h) c= f by A3,Th18;
  hence thesis by A5,Lm1;
end;
