let f be PartFunc of REAL,REAL; :: thesis: for Y being Subset of REAL st Y c= dom f & Y is compact & f | Y is continuous holds
f | Y is uniformly_continuous

let Y be Subset of REAL; :: thesis: ( Y c= dom f & Y is compact & f | Y is continuous implies f | Y is uniformly_continuous )
assume that
A1: Y c= dom f and
A2: Y is compact and
A3: f | Y is continuous ; :: thesis: f | Y is uniformly_continuous
assume not f | Y is uniformly_continuous ; :: thesis: contradiction
then consider r being Real such that
A4: 0 < r and
A5: for s being Real st 0 < s holds
ex x1, x2 being Real st
( x1 in dom (f | Y) & x2 in dom (f | Y) & abs (x1 - x2) < s & not abs ((f . x1) - (f . x2)) < r ) by Th1;
defpred S1[ Element of NAT , Real] means ( $2 in Y & ex x2 being Real st
( x2 in Y & abs ($2 - x2) < 1 / ($1 + 1) & not abs ((f . $2) - (f . x2)) < r ) );
A6: now
let n be Element of NAT ; :: thesis: ex x1 being Real st S1[n,x1]
consider x1 being Real such that
A7: ex x2 being Real st
( x1 in dom (f | Y) & x2 in dom (f | Y) & abs (x1 - x2) < 1 / (n + 1) & not abs ((f . x1) - (f . x2)) < r ) by A5, XREAL_1:139;
take x1 = x1; :: thesis: S1[n,x1]
dom (f | Y) = Y by A1, RELAT_1:62;
hence S1[n,x1] by A7; :: thesis: verum
end;
consider s1 being Real_Sequence such that
A8: for n being Element of NAT holds S1[n,s1 . n] from FUNCT_2:sch 3(A6);
now
let x be set ; :: thesis: ( x in rng s1 implies x in Y )
assume x in rng s1 ; :: thesis: x in Y
then ex n being Element of NAT st x = s1 . n by FUNCT_2:113;
hence x in Y by A8; :: thesis: verum
end;
then A9: rng s1 c= Y by TARSKI:def 3;
then consider q1 being Real_Sequence such that
A10: q1 is subsequence of s1 and
A11: q1 is convergent and
A12: lim q1 in Y by A2, RCOMP_1:def 3;
lim q1 in dom (f | Y) by A1, A12, RELAT_1:57;
then A13: f | Y is_continuous_in lim q1 by A3, FCONT_1:def 2;
rng q1 c= rng s1 by A10, VALUED_0:21;
then A14: rng q1 c= Y by A9, XBOOLE_1:1;
then rng q1 c= dom f by A1, XBOOLE_1:1;
then rng q1 c= (dom f) /\ Y by A14, XBOOLE_1:19;
then A15: rng q1 c= dom (f | Y) by RELAT_1:61;
then A16: (f | Y) . (lim q1) = lim ((f | Y) /* q1) by A11, A13, FCONT_1:def 1;
A17: (f | Y) /* q1 is convergent by A11, A13, A15, FCONT_1:def 1;
defpred S2[ Element of NAT , real number ] means ( $2 in Y & abs ((s1 . $1) - $2) < 1 / ($1 + 1) & not abs ((f . (s1 . $1)) - (f . $2)) < r );
A18: for n being Element of NAT ex x2 being Real st S2[n,x2] by A8;
consider s2 being Real_Sequence such that
A19: for n being Element of NAT holds S2[n,s2 . n] from FUNCT_2:sch 3(A18);
now
let x be set ; :: thesis: ( x in rng s2 implies x in Y )
assume x in rng s2 ; :: thesis: x in Y
then ex n being Element of NAT st x = s2 . n by FUNCT_2:113;
hence x in Y by A19; :: thesis: verum
end;
then A20: rng s2 c= Y by TARSKI:def 3;
consider Ns1 being V38() sequence of NAT such that
A21: q1 = s1 * Ns1 by A10, VALUED_0:def 17;
set q2 = q1 - ((s1 - s2) * Ns1);
A22: now
let n be Element of NAT ; :: thesis: (q1 - ((s1 - s2) * Ns1)) . n = (s2 * Ns1) . n
thus (q1 - ((s1 - s2) * Ns1)) . n = ((s1 * Ns1) . n) - (((s1 - s2) * Ns1) . n) by A21, RFUNCT_2:1
.= (s1 . (Ns1 . n)) - (((s1 - s2) * Ns1) . n) by FUNCT_2:15
.= (s1 . (Ns1 . n)) - ((s1 - s2) . (Ns1 . n)) by FUNCT_2:15
.= (s1 . (Ns1 . n)) - ((s1 . (Ns1 . n)) - (s2 . (Ns1 . n))) by RFUNCT_2:1
.= (s2 * Ns1) . n by FUNCT_2:15 ; :: thesis: verum
end;
then A23: q1 - ((s1 - s2) * Ns1) = s2 * Ns1 by FUNCT_2:63;
q1 - ((s1 - s2) * Ns1) is subsequence of s2 by A22, FUNCT_2:63, VALUED_0:def 17;
then rng (q1 - ((s1 - s2) * Ns1)) c= rng s2 by VALUED_0:21;
then A24: rng (q1 - ((s1 - s2) * Ns1)) c= Y by A20, XBOOLE_1:1;
then rng (q1 - ((s1 - s2) * Ns1)) c= dom f by A1, XBOOLE_1:1;
then rng (q1 - ((s1 - s2) * Ns1)) c= (dom f) /\ Y by A24, XBOOLE_1:19;
then A25: rng (q1 - ((s1 - s2) * Ns1)) c= dom (f | Y) by RELAT_1:61;
A26: now
let p be real number ; :: thesis: ( 0 < p implies ex k being Element of NAT st
for m being Element of NAT st k <= m holds
abs (((s1 - s2) . m) - 0) < p )

assume A27: 0 < p ; :: thesis: ex k being Element of NAT st
for m being Element of NAT st k <= m holds
abs (((s1 - s2) . m) - 0) < p

consider k being Element of NAT such that
A28: p " < k by SEQ_4:3;
take k = k; :: thesis: for m being Element of NAT st k <= m holds
abs (((s1 - s2) . m) - 0) < p

let m be Element of NAT ; :: thesis: ( k <= m implies abs (((s1 - s2) . m) - 0) < p )
assume k <= m ; :: thesis: abs (((s1 - s2) . m) - 0) < p
then k + 1 <= m + 1 by XREAL_1:6;
then 1 / (m + 1) <= 1 / (k + 1) by XREAL_1:118;
then A29: abs ((s1 . m) - (s2 . m)) < 1 / (k + 1) by A19, XXREAL_0:2;
k < k + 1 by NAT_1:13;
then p " < k + 1 by A28, XXREAL_0:2;
then 1 / (k + 1) < 1 / (p ") by A27, XREAL_1:76;
then A30: 1 / (k + 1) < p by XCMPLX_1:216;
abs (((s1 - s2) . m) - 0) = abs ((s1 . m) - (s2 . m)) by RFUNCT_2:1;
hence abs (((s1 - s2) . m) - 0) < p by A30, A29, XXREAL_0:2; :: thesis: verum
end;
then A31: s1 - s2 is convergent by SEQ_2:def 6;
A32: (s1 - s2) * Ns1 is subsequence of s1 - s2 by VALUED_0:def 17;
then A33: (s1 - s2) * Ns1 is convergent by A31, SEQ_4:16;
lim (s1 - s2) = 0 by A26, A31, SEQ_2:def 7;
then lim ((s1 - s2) * Ns1) = 0 by A31, A32, SEQ_4:17;
then A34: lim (q1 - ((s1 - s2) * Ns1)) = (lim q1) - 0 by A11, A33, SEQ_2:12
.= lim q1 ;
A35: q1 - ((s1 - s2) * Ns1) is convergent by A11, A33, SEQ_2:11;
then A36: (f | Y) /* (q1 - ((s1 - s2) * Ns1)) is convergent by A13, A34, A25, FCONT_1:def 1;
then A37: ((f | Y) /* q1) - ((f | Y) /* (q1 - ((s1 - s2) * Ns1))) is convergent by A17, SEQ_2:11;
(f | Y) . (lim q1) = lim ((f | Y) /* (q1 - ((s1 - s2) * Ns1))) by A13, A35, A34, A25, FCONT_1:def 1;
then A38: lim (((f | Y) /* q1) - ((f | Y) /* (q1 - ((s1 - s2) * Ns1)))) = ((f | Y) . (lim q1)) - ((f | Y) . (lim q1)) by A17, A16, A36, SEQ_2:12
.= 0 ;
now
let n be Element of NAT ; :: thesis: contradiction
consider k being Element of NAT such that
A39: for m being Element of NAT st k <= m holds
abs (((((f | Y) /* q1) - ((f | Y) /* (q1 - ((s1 - s2) * Ns1)))) . m) - 0) < r by A4, A37, A38, SEQ_2:def 7;
A40: q1 . k in rng q1 by VALUED_0:28;
A41: (q1 - ((s1 - s2) * Ns1)) . k in rng (q1 - ((s1 - s2) * Ns1)) by VALUED_0:28;
abs (((((f | Y) /* q1) - ((f | Y) /* (q1 - ((s1 - s2) * Ns1)))) . k) - 0) = abs ((((f | Y) /* q1) . k) - (((f | Y) /* (q1 - ((s1 - s2) * Ns1))) . k)) by RFUNCT_2:1
.= abs (((f | Y) . (q1 . k)) - (((f | Y) /* (q1 - ((s1 - s2) * Ns1))) . k)) by A15, FUNCT_2:108
.= abs (((f | Y) . (q1 . k)) - ((f | Y) . ((q1 - ((s1 - s2) * Ns1)) . k))) by A25, FUNCT_2:108
.= abs ((f . (q1 . k)) - ((f | Y) . ((q1 - ((s1 - s2) * Ns1)) . k))) by A15, A40, FUNCT_1:47
.= abs ((f . (q1 . k)) - (f . ((q1 - ((s1 - s2) * Ns1)) . k))) by A25, A41, FUNCT_1:47
.= abs ((f . (s1 . (Ns1 . k))) - (f . ((s2 * Ns1) . k))) by A21, A23, FUNCT_2:15
.= abs ((f . (s1 . (Ns1 . k))) - (f . (s2 . (Ns1 . k)))) by FUNCT_2:15 ;
hence contradiction by A19, A39; :: thesis: verum
end;
hence contradiction ; :: thesis: verum