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 Th7:
  max(max(f,g),h) = max(f,max(g,h)) & min(min(f,g),h) = min(f,min(g ,h))
proof
A1: C = dom min(min(f,g),h) & C = dom min(f,min(g,h)) by FUNCT_2:def 1;
A2: for x being Element of C st x in C holds max(max(f,g),h).x = max(f,max(g
  ,h)).x
  proof
    let x be Element of C;
    max(max(f,g),h).x = max(max(f,g).x,h.x) by Def4
      .= max(max(f.x,g.x),h.x) by Def4
      .= max(f.x,max(g.x,h.x)) by XXREAL_0:34
      .= max(f.x,max(g,h).x) by Def4
      .= max(f,max(g,h)).x by Def4;
    hence thesis;
  end;
A3: for x being Element of C st x in C holds min(min(f,g),h).x = min(f,min(g
  ,h)).x
  proof
    let x be Element of C;
    min(min(f,g),h).x = min(min(f,g).x,h.x) by Def3
      .= min(min(f.x,g.x),h.x) by Def3
      .= min(f.x,min(g.x,h.x)) by XXREAL_0:33
      .= min(f.x,min(g,h).x) by Def3
      .= min(f,min(g,h)).x by Def3;
    hence thesis;
  end;
  C = dom max(max(f,g),h) & C = dom max(f,max(g,h)) by FUNCT_2:def 1;
  hence thesis by A1,A2,A3,PARTFUN1:5;
end;
