reserve x for set;
reserve a,b,c,d for ExtReal;

theorem Th37:
  a <= c implies max(a,min(b,c)) = min(max(a,b),c)
proof
  assume
A1: a <= c;
  per cases;
  suppose
A2: a <= b;
    then a <= min(b,c) by A1,Def8;
    hence max(a,min(b,c)) = min(b,c) by Def9
      .= min(max(a,b),c) by A2,Def9;
  end;
  suppose
A3: b <= a;
    then b <= c by A1,Th2;
    hence max(a,min(b,c)) = max(a,b) by Def8
      .= a by A3,Def9
      .= min(a,c) by A1,Def8
      .= min(max(a,b),c) by A3,Def9;
  end;
end;
