reserve x, X, Y for set;

theorem
  for L being antisymmetric transitive with_suprema RelStr for X, Y
being set st ex_sup_of X,L & ex_sup_of Y,L holds ex_sup_of (X \/ Y),L & "\/"(X
  \/ Y, L) = "\/"(X, L) "\/" "\/"(Y, L)
proof
  let L be antisymmetric transitive with_suprema RelStr;
  let X, Y be set such that
A1: ex_sup_of X,L and
A2: ex_sup_of Y,L;
  set a = "\/"(X, L) "\/" "\/"(Y, L);
A3: X \/ Y is_<=_than a
  proof
    let x be Element of L;
    assume
A4: x in X \/ Y;
    per cases by A4,XBOOLE_0:def 3;
    suppose
A5:   x in X;
      X is_<=_than "\/"(X, L) by A1,YELLOW_0:30;
      then
A6:   x <= "\/"(X, L) by A5;
      "\/"(X, L) <= a by YELLOW_0:22;
      hence thesis by A6,ORDERS_2:3;
    end;
    suppose
A7:   x in Y;
      Y is_<=_than "\/"(Y, L) by A2,YELLOW_0:30;
      then
A8:   x <= "\/"(Y, L) by A7;
      "\/"(Y, L) <= a by YELLOW_0:22;
      hence thesis by A8,ORDERS_2:3;
    end;
  end;
  for b being Element of L st X \/ Y is_<=_than b holds a <= b
  proof
    let b be Element of L;
    assume
A9: X \/ Y is_<=_than b;
    Y c= X \/ Y by XBOOLE_1:7;
    then Y is_<=_than b by A9;
    then
A10: "\/"(Y, L) <= b by A2,YELLOW_0:30;
    X c= X \/ Y by XBOOLE_1:7;
    then X is_<=_than b by A9;
    then "\/"(X, L) <= b by A1,YELLOW_0:30;
    hence thesis by A10,YELLOW_0:22;
  end;
  hence thesis by A3,YELLOW_0:30;
end;
