let n be Element of NAT ; :: thesis: for e being Real
for g being Function of I,()
for p1, p2 being Element of () st e > 0 & g is continuous holds
ex h being FinSequence of REAL st
( h . 1 = 0 & h . (len h) = 1 & 5 <= len h & rng h c= the carrier of I & h is increasing & ( for i being Nat
for Q being Subset of I
for W being Subset of () st 1 <= i & i < len h & Q = [.(h /. i),(h /. (i + 1)).] & W = g .: Q holds
diameter W < e ) )

1 in { r where r is Real : ( 0 <= r & r <= 1 ) } ;
then A1: 1 in [.0,1.] by RCOMP_1:def 1;
{1} c= [.0,1.] by ;
then A2: [.0,1.] \/ {1} = [.0,1.] by XBOOLE_1:12;
Closed-Interval-TSpace (0,1) = TopSpaceMetr () by TOPMETR:def 7;
then A3: the carrier of I = the carrier of () by
.= [.0,1.] by TOPMETR:10 ;
let e be Real; :: thesis: for g being Function of I,()
for p1, p2 being Element of () st e > 0 & g is continuous holds
ex h being FinSequence of REAL st
( h . 1 = 0 & h . (len h) = 1 & 5 <= len h & rng h c= the carrier of I & h is increasing & ( for i being Nat
for Q being Subset of I
for W being Subset of () st 1 <= i & i < len h & Q = [.(h /. i),(h /. (i + 1)).] & W = g .: Q holds
diameter W < e ) )

let g be Function of I,(); :: thesis: for p1, p2 being Element of () st e > 0 & g is continuous holds
ex h being FinSequence of REAL st
( h . 1 = 0 & h . (len h) = 1 & 5 <= len h & rng h c= the carrier of I & h is increasing & ( for i being Nat
for Q being Subset of I
for W being Subset of () st 1 <= i & i < len h & Q = [.(h /. i),(h /. (i + 1)).] & W = g .: Q holds
diameter W < e ) )

let p1, p2 be Element of (); :: thesis: ( e > 0 & g is continuous implies ex h being FinSequence of REAL st
( h . 1 = 0 & h . (len h) = 1 & 5 <= len h & rng h c= the carrier of I & h is increasing & ( for i being Nat
for Q being Subset of I
for W being Subset of () st 1 <= i & i < len h & Q = [.(h /. i),(h /. (i + 1)).] & W = g .: Q holds
diameter W < e ) ) )

assume that
A4: e > 0 and
A5: g is continuous ; :: thesis: ex h being FinSequence of REAL st
( h . 1 = 0 & h . (len h) = 1 & 5 <= len h & rng h c= the carrier of I & h is increasing & ( for i being Nat
for Q being Subset of I
for W being Subset of () st 1 <= i & i < len h & Q = [.(h /. i),(h /. (i + 1)).] & W = g .: Q holds
diameter W < e ) )

A6: e / 2 > 0 by ;
A7: TopStruct(# the carrier of (), the topology of () #) = TopSpaceMetr () by EUCLID:def 8;
then reconsider h = g as Function of I,() ;
reconsider f = h as Function of (),() by ;
A8: dom g = the carrier of I by FUNCT_2:def 1;
h is continuous by ;
then f is uniformly_continuous by ;
then consider s1 being Real such that
A9: 0 < s1 and
A10: for u1, u2 being Element of () st dist (u1,u2) < s1 holds
dist ((f /. u1),(f /. u2)) < e / 2 by A6;
set s = min (s1,(1 / 2));
defpred S1[ Nat, object ] means \$2 = ((min (s1,(1 / 2))) / 2) * (\$1 - 1);
A11: 0 <= min (s1,(1 / 2)) by ;
then reconsider j = [/(2 / (min (s1,(1 / 2))))\] as Element of NAT by INT_1:53;
A12: 2 / (min (s1,(1 / 2))) <= j by INT_1:def 7;
A13: min (s1,(1 / 2)) <= s1 by XXREAL_0:17;
A14: for u1, u2 being Element of () st dist (u1,u2) < min (s1,(1 / 2)) holds
dist ((f /. u1),(f /. u2)) < e / 2
proof
let u1, u2 be Element of (); :: thesis: ( dist (u1,u2) < min (s1,(1 / 2)) implies dist ((f /. u1),(f /. u2)) < e / 2 )
assume dist (u1,u2) < min (s1,(1 / 2)) ; :: thesis: dist ((f /. u1),(f /. u2)) < e / 2
then dist (u1,u2) < s1 by ;
hence dist ((f /. u1),(f /. u2)) < e / 2 by A10; :: thesis: verum
end;
A15: 2 / (min (s1,(1 / 2))) <= [/(2 / (min (s1,(1 / 2))))\] by INT_1:def 7;
then (2 / (min (s1,(1 / 2)))) - j <= 0 by XREAL_1:47;
then 1 + ((2 / (min (s1,(1 / 2)))) - j) <= 1 + 0 by XREAL_1:6;
then A16: ((min (s1,(1 / 2))) / 2) * (1 + ((2 / (min (s1,(1 / 2)))) - j)) <= ((min (s1,(1 / 2))) / 2) * 1 by ;
A17: for k being Nat st k in Seg j holds
ex x being object st S1[k,x] ;
consider p being FinSequence such that
A18: ( dom p = Seg j & ( for k being Nat st k in Seg j holds
S1[k,p . k] ) ) from A19: Seg (len p) = Seg j by ;
rng (p ^ <*1*>) c= REAL
proof
let y be object ; :: according to TARSKI:def 3 :: thesis: ( not y in rng (p ^ <*1*>) or y in REAL )
A20: len (p ^ <*1*>) = (len p) + () by FINSEQ_1:22
.= (len p) + 1 by FINSEQ_1:40 ;
assume y in rng (p ^ <*1*>) ; :: thesis:
then consider x being object such that
A21: x in dom (p ^ <*1*>) and
A22: y = (p ^ <*1*>) . x by FUNCT_1:def 3;
reconsider nx = x as Element of NAT by A21;
A23: dom (p ^ <*1*>) = Seg (len (p ^ <*1*>)) by FINSEQ_1:def 3;
then A24: nx <= len (p ^ <*1*>) by ;
A25: 1 <= nx by ;
A26: 1 <= nx by ;
per cases ( nx < (len p) + 1 or nx >= (len p) + 1 ) ;
suppose nx < (len p) + 1 ; :: thesis:
then A27: nx <= len p by NAT_1:13;
then nx in Seg j by ;
then A28: p . nx = ((min (s1,(1 / 2))) / 2) * (nx - 1) by A18;
y = p . nx by ;
hence y in REAL by ; :: thesis: verum
end;
end;
end;
then reconsider h1 = p ^ <*1*> as FinSequence of REAL by FINSEQ_1:def 4;
A30: len h1 = (len p) + () by FINSEQ_1:22
.= (len p) + 1 by FINSEQ_1:40 ;
A31: len p = j by ;
A32: min (s1,(1 / 2)) <> 0 by ;
then 2 / (min (s1,(1 / 2))) >= 2 / (1 / 2) by ;
then 4 <= j by ;
then A33: 4 + 1 <= (len p) + 1 by ;
A34: (min (s1,(1 / 2))) / 2 > 0 by ;
A35: for i being Nat
for r1, r2 being Real st 1 <= i & i < len p & r1 = p . i & r2 = p . (i + 1) holds
( r1 < r2 & r2 - r1 = (min (s1,(1 / 2))) / 2 )
proof
let i be Nat; :: thesis: for r1, r2 being Real st 1 <= i & i < len p & r1 = p . i & r2 = p . (i + 1) holds
( r1 < r2 & r2 - r1 = (min (s1,(1 / 2))) / 2 )

let r1, r2 be Real; :: thesis: ( 1 <= i & i < len p & r1 = p . i & r2 = p . (i + 1) implies ( r1 < r2 & r2 - r1 = (min (s1,(1 / 2))) / 2 ) )
assume that
A36: ( 1 <= i & i < len p ) and
A37: r1 = p . i and
A38: r2 = p . (i + 1) ; :: thesis: ( r1 < r2 & r2 - r1 = (min (s1,(1 / 2))) / 2 )
( 1 < i + 1 & i + 1 <= len p ) by ;
then i + 1 in Seg j by ;
then A39: r2 = ((min (s1,(1 / 2))) / 2) * ((i + 1) - 1) by ;
i < i + 1 by NAT_1:13;
then A40: i - 1 < (i + 1) - 1 by XREAL_1:9;
A41: i in Seg j by ;
then r1 = ((min (s1,(1 / 2))) / 2) * (i - 1) by ;
hence r1 < r2 by ; :: thesis: r2 - r1 = (min (s1,(1 / 2))) / 2
r2 - r1 = (((min (s1,(1 / 2))) / 2) * i) - (((min (s1,(1 / 2))) / 2) * (i - 1)) by A18, A37, A41, A39
.= (min (s1,(1 / 2))) / 2 ;
hence r2 - r1 = (min (s1,(1 / 2))) / 2 ; :: thesis: verum
end;
0 < min (s1,(1 / 2)) by ;
then 0 < j by ;
then A42: 0 + 1 <= j by NAT_1:13;
then 1 in Seg j by FINSEQ_1:1;
then p . 1 = ((min (s1,(1 / 2))) / 2) * (1 - 1) by A18
.= 0 ;
then A43: h1 . 1 = 0 by ;
2 * (min (s1,(1 / 2))) <> 0 by ;
then A44: ( ((min (s1,(1 / 2))) / 2) * (2 / (min (s1,(1 / 2)))) = (2 * (min (s1,(1 / 2)))) / (2 * (min (s1,(1 / 2)))) & (2 * (min (s1,(1 / 2)))) / (2 * (min (s1,(1 / 2)))) = 1 ) by ;
then A45: 1 - (((min (s1,(1 / 2))) / 2) * (j - 1)) = ((min (s1,(1 / 2))) / 2) * (1 + ((2 / (min (s1,(1 / 2)))) - [/(2 / (min (s1,(1 / 2))))\])) ;
A46: for r1 being Real st r1 = p . (len p) holds
1 - r1 <= (min (s1,(1 / 2))) / 2 by ;
A47: for i being Nat st 1 <= i & i < len h1 holds
(h1 /. (i + 1)) - (h1 /. i) <= (min (s1,(1 / 2))) / 2
proof
let i be Nat; :: thesis: ( 1 <= i & i < len h1 implies (h1 /. (i + 1)) - (h1 /. i) <= (min (s1,(1 / 2))) / 2 )
assume that
A48: 1 <= i and
A49: i < len h1 ; :: thesis: (h1 /. (i + 1)) - (h1 /. i) <= (min (s1,(1 / 2))) / 2
A50: i + 1 <= len h1 by ;
A51: 1 < i + 1 by ;
A52: i <= len p by ;
now :: thesis: ( ( i < len p & (h1 /. (i + 1)) - (h1 /. i) <= (min (s1,(1 / 2))) / 2 ) or ( i >= len p & (h1 /. (i + 1)) - (h1 /. i) <= (min (s1,(1 / 2))) / 2 ) )
per cases ( i < len p or i >= len p ) ;
case A53: i < len p ; :: thesis: (h1 /. (i + 1)) - (h1 /. i) <= (min (s1,(1 / 2))) / 2
then i + 1 <= len p by NAT_1:13;
then A54: h1 . (i + 1) = p . (i + 1) by ;
A55: h1 . i = p . i by ;
( h1 . i = h1 /. i & h1 . (i + 1) = h1 /. (i + 1) ) by ;
hence (h1 /. (i + 1)) - (h1 /. i) <= (min (s1,(1 / 2))) / 2 by A35, A48, A53, A55, A54; :: thesis: verum
end;
case i >= len p ; :: thesis: (h1 /. (i + 1)) - (h1 /. i) <= (min (s1,(1 / 2))) / 2
then A56: i = len p by ;
A57: h1 /. i = h1 . i by
.= p . i by ;
h1 /. (i + 1) = h1 . (i + 1) by
.= 1 by ;
hence (h1 /. (i + 1)) - (h1 /. i) <= (min (s1,(1 / 2))) / 2 by ; :: thesis: verum
end;
end;
end;
hence (h1 /. (i + 1)) - (h1 /. i) <= (min (s1,(1 / 2))) / 2 ; :: thesis: verum
end;
[/(2 / (min (s1,(1 / 2))))\] < (2 / (min (s1,(1 / 2)))) + 1 by INT_1:def 7;
then [/(2 / (min (s1,(1 / 2))))\] - 1 < ((2 / (min (s1,(1 / 2)))) + 1) - 1 by XREAL_1:9;
then A58: ((min (s1,(1 / 2))) / 2) * (j - 1) < ((min (s1,(1 / 2))) / 2) * (2 / (min (s1,(1 / 2)))) by ;
A59: for i being Nat
for r1 being Real st 1 <= i & i <= len p & r1 = p . i holds
r1 < 1
proof
let i be Nat; :: thesis: for r1 being Real st 1 <= i & i <= len p & r1 = p . i holds
r1 < 1

let r1 be Real; :: thesis: ( 1 <= i & i <= len p & r1 = p . i implies r1 < 1 )
assume that
A60: 1 <= i and
A61: i <= len p and
A62: r1 = p . i ; :: thesis: r1 < 1
i - 1 <= j - 1 by ;
then A63: ((min (s1,(1 / 2))) / 2) * (i - 1) <= ((min (s1,(1 / 2))) / 2) * (j - 1) by ;
i in Seg j by ;
then r1 = ((min (s1,(1 / 2))) / 2) * (i - 1) by ;
hence r1 < 1 by ; :: thesis: verum
end;
A64: for i being Nat st 1 <= i & i < len h1 holds
h1 /. i < h1 /. (i + 1)
proof
let i be Nat; :: thesis: ( 1 <= i & i < len h1 implies h1 /. i < h1 /. (i + 1) )
assume that
A65: 1 <= i and
A66: i < len h1 ; :: thesis: h1 /. i < h1 /. (i + 1)
A67: 1 < i + 1 by ;
A68: i <= len p by ;
A69: i + 1 <= len h1 by ;
per cases ( i < len p or i >= len p ) ;
suppose A70: i < len p ; :: thesis: h1 /. i < h1 /. (i + 1)
then i + 1 <= len p by NAT_1:13;
then A71: h1 . (i + 1) = p . (i + 1) by ;
A72: h1 . i = p . i by ;
( h1 . i = h1 /. i & h1 . (i + 1) = h1 /. (i + 1) ) by ;
hence h1 /. i < h1 /. (i + 1) by A35, A65, A70, A72, A71; :: thesis: verum
end;
suppose i >= len p ; :: thesis: h1 /. i < h1 /. (i + 1)
then A73: i = len p by ;
A74: h1 /. i = h1 . i by
.= p . i by ;
h1 /. (i + 1) = h1 . (i + 1) by
.= 1 by ;
hence h1 /. i < h1 /. (i + 1) by A59, A65, A68, A74; :: thesis: verum
end;
end;
end;
A75: e / 2 < e by ;
A76: for i being Nat
for Q being Subset of I
for W being Subset of () st 1 <= i & i < len h1 & Q = [.(h1 /. i),(h1 /. (i + 1)).] & W = g .: Q holds
diameter W < e
proof
let i be Nat; :: thesis: for Q being Subset of I
for W being Subset of () st 1 <= i & i < len h1 & Q = [.(h1 /. i),(h1 /. (i + 1)).] & W = g .: Q holds
diameter W < e

let Q be Subset of I; :: thesis: for W being Subset of () st 1 <= i & i < len h1 & Q = [.(h1 /. i),(h1 /. (i + 1)).] & W = g .: Q holds
diameter W < e

let W be Subset of (); :: thesis: ( 1 <= i & i < len h1 & Q = [.(h1 /. i),(h1 /. (i + 1)).] & W = g .: Q implies diameter W < e )
assume that
A77: ( 1 <= i & i < len h1 ) and
A78: Q = [.(h1 /. i),(h1 /. (i + 1)).] and
A79: W = g .: Q ; :: thesis:
h1 /. i < h1 /. (i + 1) by ;
then A80: Q <> {} by ;
A81: for x, y being Point of () st x in W & y in W holds
dist (x,y) <= e / 2
proof
let x, y be Point of (); :: thesis: ( x in W & y in W implies dist (x,y) <= e / 2 )
assume that
A82: x in W and
A83: y in W ; :: thesis: dist (x,y) <= e / 2
consider x3 being object such that
A84: x3 in dom g and
A85: x3 in Q and
A86: x = g . x3 by ;
reconsider x3 = x3 as Element of () by ;
reconsider r3 = x3 as Real by ;
A87: (h1 /. (i + 1)) - (h1 /. i) <= (min (s1,(1 / 2))) / 2 by ;
consider y3 being object such that
A88: y3 in dom g and
A89: y3 in Q and
A90: y = g . y3 by ;
reconsider y3 = y3 as Element of () by ;
reconsider s3 = y3 as Real by ;
A91: ( f . x3 = f /. x3 & f . y3 = f /. y3 ) ;
|.(r3 - s3).| <= (h1 /. (i + 1)) - (h1 /. i) by ;
then |.(r3 - s3).| <= (min (s1,(1 / 2))) / 2 by ;
then A92: dist (x3,y3) <= (min (s1,(1 / 2))) / 2 by HEINE:1;
(min (s1,(1 / 2))) / 2 < min (s1,(1 / 2)) by ;
then dist (x3,y3) < min (s1,(1 / 2)) by ;
hence dist (x,y) <= e / 2 by A14, A86, A90, A91; :: thesis: verum
end;
then W is bounded by ;
then diameter W <= e / 2 by ;
hence diameter W < e by ; :: thesis: verum
end;
A93: rng p c= [.0,1.]
proof
let y be object ; :: according to TARSKI:def 3 :: thesis: ( not y in rng p or y in [.0,1.] )
assume y in rng p ; :: thesis: y in [.0,1.]
then consider x being object such that
A94: x in dom p and
A95: y = p . x by FUNCT_1:def 3;
reconsider nx = x as Element of NAT by A94;
A96: p . nx = ((min (s1,(1 / 2))) / 2) * (nx - 1) by ;
then reconsider ry = p . nx as Real ;
A97: x in Seg (len p) by ;
then A98: 1 <= nx by FINSEQ_1:1;
then A99: nx - 1 >= 1 - 1 by XREAL_1:9;
nx <= len p by ;
then ry < 1 by ;
then y in { rs where rs is Real : ( 0 <= rs & rs <= 1 ) } by A11, A95, A96, A99;
hence y in [.0,1.] by RCOMP_1:def 1; :: thesis: verum
end;
rng <*1*> = {1} by FINSEQ_1:38;
then rng h1 = (rng p) \/ {1} by FINSEQ_1:31;
then A100: rng h1 c= [.0,1.] \/ {1} by ;
h1 . (len h1) = 1 by ;
hence ex h being FinSequence of REAL st
( h . 1 = 0 & h . (len h) = 1 & 5 <= len h & rng h c= the carrier of I & h is increasing & ( for i being Nat
for Q being Subset of I
for W being Subset of () st 1 <= i & i < len h & Q = [.(h /. i),(h /. (i + 1)).] & W = g .: Q holds
diameter W < e ) ) by A30, A33, A43, A2, A100, A3, A64, A76, Lm7; :: thesis: verum