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;

theorem
  X is real-bounded iff ex s st 0<s & for r st r in X holds |.r.|<s
proof
  thus X is real-bounded implies ex s st 0<s & for r st r in X holds |.r.|<s
  proof
    assume
A1: X is real-bounded;
    then consider s1 such that
A2:  s1 is UpperBound of X by XXREAL_2:def 10;
A3: for r st r in X holds r<=s1 by A2,XXREAL_2:def 1;
    consider s2 such that
A4: s2 is LowerBound of X by A1,XXREAL_2:def 9;
A5: for r st r in X holds s2<=r by A4,XXREAL_2:def 2;
    take s=|.s1.|+|.s2.|+1;
A6: 0<=|.s1.| by COMPLEX1:46;
A7: 0<=|.s2.| by COMPLEX1:46;
    hence 0<s by A6;
    let r such that
A8: r in X;
    s1<=|.s1.| & r<=s1 by A3,A8,ABSVALUE:4;
    then r<=|.s1.| by XXREAL_0:2;
    then r+(0 qua Nat)<=|.s1.|+|.s2.| by A7,XREAL_1:7;
    then
A9: r<s by XREAL_1:8;
    -|.s2.|<=s2 & s2<=r by A5,A8,ABSVALUE:4;
    then -|.s2.|<=r by XXREAL_0:2;
    then -|.s1.|+-|.s2.|<=(0 qua Nat)+r by A6,XREAL_1:7;
    then
A10: -|.s1.|-|.s2.|+-1<r+(0 qua Nat) by XREAL_1:8;
    -|.s1.|-|.s2.|-1=-(|.s1.|+|.s2.|+1);
    hence thesis by A9,A10,SEQ_2:1;
  end;
  given s such that
  0<s and
A11: for r st r in X holds |.r.|<s;
  thus X is bounded_below
  proof
    take -s;
    let r be ExtReal;
    assume
A12:   r in X;
     then reconsider r as Real;
    |.r.|<s by A11,A12;
    then
A13: -s<-|.r.| by XREAL_1:24;
    -|.r.|<=r by ABSVALUE:4;
    hence thesis by A13,XXREAL_0:2;
  end;
    take s;
    let r be ExtReal;
    assume
A14:   r in X;
     then reconsider r as Real;
     r<=|.r.| by ABSVALUE:4;
    hence thesis by A11,A14,XXREAL_0:2;
end;
