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

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