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

theorem
  max(a,min(b,c)) = min(max(a,b),max(a,c))
proof
  per cases;
  suppose
A1: b <= c;
    then
A2: max(a,b) <= max(a,c) by Th26;
    thus max(a,min(b,c)) = max(a,b) by A1,Def8
      .= min(max(a,b),max(a,c)) by A2,Def8;
  end;
  suppose
A3: c <= b;
    then
A4: max(a,c) <= max(a,b) by Th26;
    thus max(a,min(b,c)) = max(a,c) by A3,Def8
      .= min(max(a,b),max(a,c)) by A4,Def8;
  end;
end;
