reserve n,k,k1,m,m1,n1,n2,l for Nat;
reserve r,r1,r2,p,p1,g,g1,g2,s,s1,s2,t for Real;
reserve seq,seq1,seq2 for Real_Sequence;
reserve Nseq for increasing sequence of NAT;
reserve x for set;
reserve X,Y for Subset of REAL;
reserve k,n for Nat,
  r,r9,r1,r2 for Real,
  c,c9,c1,c2,c3 for Element of COMPLEX;
reserve z,z1,z2 for FinSequence of COMPLEX;
reserve x,z,z1,z2,z3 for Element of COMPLEX n,
  A,B for Subset of COMPLEX n;
reserve
  v,v1,v2 for FinSequence of REAL,
  n,m,k for Nat,
  x for set;

theorem
  for A,B being non empty bounded_above Subset of REAL holds upper_bound(A
  \/ B) = max(upper_bound A,upper_bound B)
proof
  let A,B be non empty bounded_above Subset of REAL;
  set r = max(upper_bound A,upper_bound B);
A1: r >= upper_bound B by XXREAL_0:25;
A2: for r1 being Real st for t being Real st t in A \/ B holds
  t <= r1 holds r <= r1
  proof
    let r1 be Real;
    assume
A3: for t being Real st t in A \/ B holds t <= r1;
    now
      let t be Real;
      assume t in B;
      then t in A \/ B by XBOOLE_0:def 3;
      hence t <= r1 by A3;
    end;
    then
A4: upper_bound B <= r1 by Th45;
    now
      let t be Real;
      assume t in A;
      then t in A \/ B by XBOOLE_0:def 3;
      hence t <= r1 by A3;
    end;
    then upper_bound A <= r1 by Th45;
    hence thesis by A4,XXREAL_0:28;
  end;
A5: r >= upper_bound A by XXREAL_0:25;
  for t being Real st t in A \/ B holds t <= r
  proof
    let t be Real;
    assume t in A \/ B;
    then t in A or t in B by XBOOLE_0:def 3;
    then upper_bound A >= t or upper_bound B >= t by Def1;
    hence thesis by A5,A1,XXREAL_0:2;
  end;
  hence thesis by A2,Th46;
end;
