let R be non empty Subset of REAL; :: thesis: ( R is bounded_above implies ex s being Real_Sequence st
( s is non-decreasing & s is convergent & rng s c= R & lim s = upper_bound R ) )

reconsider rs = upper_bound R as Real ;
defpred S1[ Nat, Real] means ( \$2 in R & ( for r00 being Real st r00 = \$2 holds
rs - (1 / (\$1 + 1)) < r00 ) );
assume A1: R is bounded_above ; :: thesis: ex s being Real_Sequence st
( s is non-decreasing & s is convergent & rng s c= R & lim s = upper_bound R )

A2: for n being Element of NAT ex r being Element of REAL st S1[n,r]
proof
let n be Element of NAT ; :: thesis: ex r being Element of REAL st S1[n,r]
(n + 1) " > 0 ;
then 1 / (n + 1) > 0 by XCMPLX_1:215;
then consider r0 being Real such that
A3: r0 in R and
A4: rs - (1 / (n + 1)) < r0 by ;
for r00 being Real st r00 = r0 holds
rs - (1 / (n + 1)) < r00 by A4;
hence ex r being Element of REAL st S1[n,r] by A3; :: thesis: verum
end;
ex s1 being sequence of REAL st
for n being Element of NAT holds S1[n,s1 . n] from then consider s1 being sequence of REAL such that
A5: for n being Element of NAT holds
( s1 . n in R & ( for r0 being Real st r0 = s1 . n holds
rs - (1 / (n + 1)) < r0 ) ) ;
defpred S2[ set , set , set ] means ( ( \$2 is Real implies for r1, r2 being Real
for n1 being Nat st r1 = \$2 & r2 = s1 . (n1 + 1) & n1 = \$1 holds
( ( r1 >= r2 implies \$3 = \$2 ) & ( r1 < r2 implies \$3 = s1 . (n1 + 1) ) ) ) & ( \$2 is not Real implies \$3 = 1 ) );
A6: for n being Nat
for x being set ex y being set st S2[n,x,y]
proof
let n be Nat; :: thesis: for x being set ex y being set st S2[n,x,y]
thus for x being set ex y being set st S2[n,x,y] :: thesis: verum
proof
let x be set ; :: thesis: ex y being set st S2[n,x,y]
now :: thesis: ( ( x is not Real & ex y being set st S2[n,x,y] ) or ( x is Real & ex y being set st S2[n,x,y] ) )
per cases ( not x is Real or x is Real ) ;
case x is not Real ; :: thesis: ex y being set st S2[n,x,y]
hence ex y being set st S2[n,x,y] ; :: thesis: verum
end;
case A7: x is Real ; :: thesis: ex y being set st S2[n,x,y]
then reconsider r10 = x as Real ;
reconsider r20 = s1 . (n + 1) as Real ;
now :: thesis: ( ( r10 >= r20 & ex y being set st S2[n,x,y] ) or ( r10 < r20 & ex y being set st S2[n,x,y] ) )
per cases ( r10 >= r20 or r10 < r20 ) ;
case r10 >= r20 ; :: thesis: ex y being set st S2[n,x,y]
then for r1, r2 being Real
for n1 being Nat st r1 = x & r2 = s1 . (n1 + 1) & n1 = n holds
( ( r1 >= r2 implies x = x ) & ( r1 < r2 implies x = s1 . (n1 + 1) ) ) ;
hence ex y being set st S2[n,x,y] by A7; :: thesis: verum
end;
case r10 < r20 ; :: thesis: ex y being set st S2[n,x,y]
then for r1, r2 being Real
for n1 being Nat st r1 = x & r2 = s1 . (n1 + 1) & n1 = n holds
( ( r1 >= r2 implies s1 . (n + 1) = x ) & ( r1 < r2 implies s1 . (n + 1) = s1 . (n1 + 1) ) ) ;
hence ex y being set st S2[n,x,y] by A7; :: thesis: verum
end;
end;
end;
hence ex y being set st S2[n,x,y] ; :: thesis: verum
end;
end;
end;
hence ex y being set st S2[n,x,y] ; :: thesis: verum
end;
end;
ex f being Function st
( dom f = NAT & f . 0 = s1 . 0 & ( for n being Nat holds S2[n,f . n,f . (n + 1)] ) ) from then consider s2 being Function such that
A8: dom s2 = NAT and
A9: s2 . 0 = s1 . 0 and
A10: for n being Nat holds S2[n,s2 . n,s2 . (n + 1)] ;
A11: rng s2 c= REAL
proof
defpred S3[ Nat] means s2 . \$1 in REAL ;
let y be object ; :: according to TARSKI:def 3 :: thesis: ( not y in rng s2 or y in REAL )
assume y in rng s2 ; :: thesis:
then consider x being object such that
A12: x in dom s2 and
A13: y = s2 . x by FUNCT_1:def 3;
reconsider n = x as Nat by ;
A14: for k being Nat st S3[k] holds
S3[k + 1]
proof
let k be Nat; :: thesis: ( S3[k] implies S3[k + 1] )
reconsider r2 = s1 . (k + 1) as Real ;
assume A15: s2 . k in REAL ; :: thesis: S3[k + 1]
then reconsider r1 = s2 . k as Real ;
now :: thesis: ( ( r1 >= r2 & S3[k + 1] ) or ( r1 < r2 & S3[k + 1] ) )
per cases ( r1 >= r2 or r1 < r2 ) ;
case r1 >= r2 ; :: thesis: S3[k + 1]
hence S3[k + 1] by ; :: thesis: verum
end;
case r1 < r2 ; :: thesis: S3[k + 1]
then s2 . (k + 1) = s1 . (k + 1) by A10;
hence S3[k + 1] ; :: thesis: verum
end;
end;
end;
hence S3[k + 1] ; :: thesis: verum
end;
A16: S3[ 0 ] by A9;
for m being Nat holds S3[m] from then s2 . n in REAL ;
hence y in REAL by A13; :: thesis: verum
end;
then reconsider s3 = s2 as Real_Sequence by ;
defpred S3[ Nat] means s1 . \$1 <= s3 . \$1;
A17: for k being Nat st S3[k] holds
S3[k + 1]
proof
let k be Nat; :: thesis: ( S3[k] implies S3[k + 1] )
A18: k in NAT by ORDINAL1:def 12;
assume s1 . k <= s3 . k ; :: thesis: S3[k + 1]
reconsider r2 = s1 . (k + 1) as Real ;
s2 . k in rng s2 by ;
then reconsider r1 = s2 . k as Real by A11;
now :: thesis: ( ( r1 >= r2 & S3[k + 1] ) or ( r1 < r2 & S3[k + 1] ) )
per cases ( r1 >= r2 or r1 < r2 ) ;
case r1 >= r2 ; :: thesis: S3[k + 1]
hence S3[k + 1] by A10; :: thesis: verum
end;
case r1 < r2 ; :: thesis: S3[k + 1]
hence S3[k + 1] by A10; :: thesis: verum
end;
end;
end;
hence S3[k + 1] ; :: thesis: verum
end;
A19: S3[ 0 ] by A9;
A20: for n4 being Nat holds S3[n4] from defpred S4[ Nat] means ( 0 <= \$1 implies s3 . 0 <= s3 . \$1 );
A21: for n4 being Nat holds s3 . n4 <= s3 . (n4 + 1)
proof
let n4 be Nat; :: thesis: s3 . n4 <= s3 . (n4 + 1)
reconsider r2 = s1 . (n4 + 1) as Real ;
dom s3 = NAT by FUNCT_2:def 1;
then reconsider r1 = s2 . n4 as Real ;
now :: thesis: ( ( r1 >= r2 & s3 . n4 <= s3 . (n4 + 1) ) or ( r1 < r2 & s3 . n4 <= s3 . (n4 + 1) ) )
per cases ( r1 >= r2 or r1 < r2 ) ;
case r1 >= r2 ; :: thesis: s3 . n4 <= s3 . (n4 + 1)
hence s3 . n4 <= s3 . (n4 + 1) by A10; :: thesis: verum
end;
case r1 < r2 ; :: thesis: s3 . n4 <= s3 . (n4 + 1)
hence s3 . n4 <= s3 . (n4 + 1) by A10; :: thesis: verum
end;
end;
end;
hence s3 . n4 <= s3 . (n4 + 1) ; :: thesis: verum
end;
A22: for k being Nat st S4[k] holds
S4[k + 1]
proof
let k be Nat; :: thesis: ( S4[k] implies S4[k + 1] )
assume A23: ( 0 <= k implies s3 . 0 <= s3 . k ) ; :: thesis: S4[k + 1]
now :: thesis: ( 0 <= k + 1 implies s3 . 0 <= s3 . (k + 1) )
assume 0 <= k + 1 ; :: thesis: s3 . 0 <= s3 . (k + 1)
A24: s3 . k <= s3 . (k + 1) by A21;
now :: thesis: ( ( 0 < k & s3 . 0 <= s3 . (k + 1) ) or ( 0 = k & s3 . 0 <= s3 . (k + 1) ) )
per cases ( 0 < k or 0 = k ) ;
case 0 < k ; :: thesis: s3 . 0 <= s3 . (k + 1)
thus s3 . 0 <= s3 . (k + 1) by ; :: thesis: verum
end;
case 0 = k ; :: thesis: s3 . 0 <= s3 . (k + 1)
hence s3 . 0 <= s3 . (k + 1) by A21; :: thesis: verum
end;
end;
end;
hence s3 . 0 <= s3 . (k + 1) ; :: thesis: verum
end;
hence S4[k + 1] ; :: thesis: verum
end;
defpred S5[ Nat] means for n4 being Nat st \$1 <= n4 holds
s3 . \$1 <= s3 . n4;
A25: for k being Nat st S5[k] holds
S5[k + 1]
proof
let k be Nat; :: thesis: ( S5[k] implies S5[k + 1] )
assume for n5 being Nat st k <= n5 holds
s3 . k <= s3 . n5 ; :: thesis: S5[k + 1]
defpred S6[ Nat] means ( k + 1 <= \$1 implies s3 . (k + 1) <= s3 . \$1 );
A26: for i being Nat st S6[i] holds
S6[i + 1]
proof
let i be Nat; :: thesis: ( S6[i] implies S6[i + 1] )
A27: i in NAT by ORDINAL1:def 12;
reconsider r2 = s1 . (i + 1) as Real ;
s2 . i in rng s2 by ;
then reconsider r1 = s2 . i as Real by A11;
A28: now :: thesis: ( ( r1 >= r2 & s3 . i <= s3 . (i + 1) ) or ( r1 < r2 & s3 . i <= s3 . (i + 1) ) )
per cases ( r1 >= r2 or r1 < r2 ) ;
case r1 >= r2 ; :: thesis: s3 . i <= s3 . (i + 1)
hence s3 . i <= s3 . (i + 1) by A10; :: thesis: verum
end;
case r1 < r2 ; :: thesis: s3 . i <= s3 . (i + 1)
hence s3 . i <= s3 . (i + 1) by A10; :: thesis: verum
end;
end;
end;
assume A29: ( k + 1 <= i implies s3 . (k + 1) <= s3 . i ) ; :: thesis: S6[i + 1]
now :: thesis: ( k + 1 <= i + 1 implies s3 . (k + 1) <= s3 . (i + 1) )
assume A30: k + 1 <= i + 1 ; :: thesis: s3 . (k + 1) <= s3 . (i + 1)
now :: thesis: ( ( k + 1 < i + 1 & s3 . (k + 1) <= s3 . (i + 1) ) or ( k + 1 = i + 1 & s3 . (k + 1) <= s3 . (i + 1) ) )
per cases ( k + 1 < i + 1 or k + 1 = i + 1 ) by ;
case k + 1 < i + 1 ; :: thesis: s3 . (k + 1) <= s3 . (i + 1)
hence s3 . (k + 1) <= s3 . (i + 1) by ; :: thesis: verum
end;
case k + 1 = i + 1 ; :: thesis: s3 . (k + 1) <= s3 . (i + 1)
hence s3 . (k + 1) <= s3 . (i + 1) ; :: thesis: verum
end;
end;
end;
hence s3 . (k + 1) <= s3 . (i + 1) ; :: thesis: verum
end;
hence S6[i + 1] ; :: thesis: verum
end;
A31: S6[ 0 ] ;
for n4 being Nat holds S6[n4] from hence S5[k + 1] ; :: thesis: verum
end;
A32: S4[ 0 ] ;
for n4 being Nat holds S4[n4] from then A33: S5[ 0 ] ;
for m4 being Nat holds S5[m4] from then for m4, n4 being Nat st m4 in dom s3 & n4 in dom s3 & m4 <= n4 holds
s3 . m4 <= s3 . n4 ;
then A34: s3 is non-decreasing by SEQM_3:def 3;
A35: rng s3 c= R
proof
defpred S6[ set ] means s3 . \$1 in R;
let y be object ; :: according to TARSKI:def 3 :: thesis: ( not y in rng s3 or y in R )
assume y in rng s3 ; :: thesis: y in R
then A36: ex x being object st
( x in dom s3 & y = s3 . x ) by FUNCT_1:def 3;
A37: for k being Nat st S6[k] holds
S6[k + 1]
proof
let k be Nat; :: thesis: ( S6[k] implies S6[k + 1] )
A38: k in NAT by ORDINAL1:def 12;
reconsider r2 = s1 . (k + 1) as Real ;
s2 . k in rng s2 by ;
then reconsider r1 = s2 . k as Real by A11;
assume A39: s3 . k in R ; :: thesis: S6[k + 1]
now :: thesis: ( ( r1 >= r2 & S6[k + 1] ) or ( r1 < r2 & S6[k + 1] ) )
per cases ( r1 >= r2 or r1 < r2 ) ;
case r1 >= r2 ; :: thesis: S6[k + 1]
hence S6[k + 1] by ; :: thesis: verum
end;
case r1 < r2 ; :: thesis: S6[k + 1]
then s2 . (k + 1) = s1 . (k + 1) by A10;
hence S6[k + 1] by A5; :: thesis: verum
end;
end;
end;
hence S6[k + 1] ; :: thesis: verum
end;
A40: S6[ 0 ] by A5, A9;
for nn being Nat holds S6[nn] from hence y in R by A36; :: thesis: verum
end;
for n being Nat holds s3 . n < () + 1
proof
let n be Nat; :: thesis: s3 . n < () + 1
A41: n in NAT by ORDINAL1:def 12;
s3 . n in rng s3 by ;
then A42: s3 . n <= upper_bound R by ;
upper_bound R < () + 1 by XREAL_1:29;
hence s3 . n < () + 1 by ; :: thesis: verum
end;
then A43: s3 is bounded_above by SEQ_2:def 3;
A44: for r being Real st r > 0 holds
() - r < lim s3
proof
let r be Real; :: thesis: ( r > 0 implies () - r < lim s3 )
assume A45: r > 0 ; :: thesis: () - r < lim s3
consider n2 being Nat such that
A46: 1 / r < n2 by SEQ_4:3;
A47: n2 in NAT by ORDINAL1:def 12;
n2 < n2 + 1 by XREAL_1:29;
then 1 / r < n2 + 1 by ;
then (1 / r) * r < (n2 + 1) * r by ;
then 1 < (n2 + 1) * r by ;
then 1 / (n2 + 1) < ((n2 + 1) * r) / (n2 + 1) by XREAL_1:74;
then 1 / (n2 + 1) < r by XCMPLX_1:89;
then rs - (1 / (n2 + 1)) > rs - r by XREAL_1:10;
then A48: rs - r < s1 . n2 by ;
A49: s3 . n2 <= lim s3 by ;
s1 . n2 <= s3 . n2 by A20;
then rs - r < s3 . n2 by ;
hence (upper_bound R) - r < lim s3 by ; :: thesis: verum
end;
A50: now :: thesis: not upper_bound R > lim s3
reconsider r = () - (lim s3) as Real ;
assume upper_bound R > lim s3 ; :: thesis: contradiction
then r > 0 by XREAL_1:50;
then (upper_bound R) - r < lim s3 by A44;
hence contradiction ; :: thesis: verum
end;
A51: for n being Nat holds s3 . n <= upper_bound R
proof end;
for n being Nat holds s3 . n < () + 1
proof
let n be Nat; :: thesis: s3 . n < () + 1
( upper_bound R < () + 1 & s3 . n <= upper_bound R ) by ;
hence s3 . n < () + 1 by XXREAL_0:2; :: thesis: verum
end;
then A53: s3 is bounded_above by SEQ_2:def 3;
then lim s3 <= upper_bound R by ;
hence ex s being Real_Sequence st
( s is non-decreasing & s is convergent & rng s c= R & lim s = upper_bound R ) by ; :: thesis: verum