reserve n,m for Nat,
  x,X,X1 for set,
  s,g,r,p for Real,
  S,T for RealNormSpace,
  f,f1,f2 for PartFunc of S, T,
  s1,s2,q1 for sequence of S,
  x0,x1, x2 for Point of S,
  Y for Subset of S;

theorem
  for f, Y st Y is compact & f is_continuous_on Y holds f
  is_uniformly_continuous_on Y
proof
  let f, Y such that
A1: Y is compact and
A2: f is_continuous_on Y;
A3: Y c= dom f by A2,NFCONT_1:def 7;
  assume not thesis;
  then consider r such that
A4: 0<r and
A5: for s st 0<s ex x1,x2 st x1 in Y & x2 in Y & ||.x1 -x2.|| < s & not
  ||.f/.x1 - f/.x2.||< r by A3;
  defpred P[Nat,Point of S] means $2 in Y & ex x2 st x2 in Y & ||.
  $2-x2.||<1/($1+1) & not ||.f/.($2)-f/.x2.|| < r;
A6: for n holds 0 < 1/(n+1) by XREAL_1:139;
A7: now
    let n be Element of NAT;
    consider x1 such that
A8: ex x2 st x1 in Y & x2 in Y & ||.x1 -x2.|| < 1/(n+1) & not ||.f/.
    x1 - f/.x2.||< r by A5,A6;
    take x1;
    thus P[n,x1] by A8;
  end;
  consider s1 such that
A9: for n being Element of NAT holds P[n,s1.n] from FUNCT_2:sch 3(A7);
  defpred P[Nat, Point of S] means $2 in Y & ||.s1.$1-$2.|| < 1/($1
  +1) & not ||.f/.(s1.$1)-f/.$2.|| < r;
A10: for n being Element of NAT ex x2 st P[n,x2] by A9;
  consider s2 such that
A11: for n being Element of NAT holds P[n,s2.n] from FUNCT_2:sch 3(A10);
  now
    let x be object;
    assume x in rng s1;
    then consider n such that
A12:   x=s1.n by NFCONT_1:6;
     n in NAT by ORDINAL1:def 12;
    hence x in Y by A9,A12;
  end;
  then
A13: rng s1 c= Y by TARSKI:def 3;
  then consider q1 such that
A14: q1 is subsequence of s1 and
A15: q1 is convergent and
A16: (lim q1) in Y by A1,NFCONT_1:def 2;
  consider Ns1 be increasing sequence of NAT such that
A17: q1=s1*Ns1 by A14,VALUED_0:def 17;
  set q2 = q1 - (s1-s2)*Ns1;
A18: f|Y is_continuous_in (lim q1) by A2,A16,NFCONT_1:def 7;
  now
    let x be object;
    assume x in rng s2;
    then consider n such that
A19:   x=s2.n by NFCONT_1:6;
     n in NAT by ORDINAL1:def 12;
    hence x in Y by A11,A19;
  end;
  then
A20: rng s2 c= Y by TARSKI:def 3;
  now
    let n be Element of NAT;
    thus q2.n = (s1*Ns1).n - ((s1-s2)*Ns1).n by A17,NORMSP_1:def 3
      .= 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 NORMSP_1:def 3
      .= (s1.(Ns1.n) - s1.(Ns1.n)) + s2.(Ns1.n) by RLVECT_1:29
      .= 0.S + s2.(Ns1.n) by RLVECT_1:15
      .= s2.(Ns1.n) by RLVECT_1:4
      .= (s2*Ns1).n by FUNCT_2:15;
  end;
  then
A21: q2 = s2*Ns1 by FUNCT_2:63;
  then rng q2 c= rng s2 by VALUED_0:21;
  then
A22: rng q2 c= Y by A20,XBOOLE_1:1;
  then rng q2 c= dom f by A3,XBOOLE_1:1;
  then rng q2 c= dom f /\ Y by A22,XBOOLE_1:19;
  then
A23: rng q2 c= dom (f|Y) by RELAT_1:61;
A24: now
    let p be Real such that
A25: 0<p;
    consider k be Nat such that
A26: p" < k by SEQ_4:3;
    take k;
    let m be Nat;
A27:  m in NAT by ORDINAL1:def 12;
    assume k <= m;
    then k+1 <= m+1 by XREAL_1:6;
    then 1/(m+1) <= 1/(k+1) by XREAL_1:118;
    then
A28: ||.s1.m - s2.m.|| < 1/(k+1) by A11,XXREAL_0:2,A27;
    k < k+1 by NAT_1:13;
    then p" < k+1 by A26,XXREAL_0:2;
    then 1/(k+1) < 1/p" by A25,XREAL_1:76;
    then
A29: 1/(k+1) < p by XCMPLX_1:216;
    ||.(s1-s2).m - 0.S.|| = ||.s1.m - s2.m - 0.S.|| by NORMSP_1:def 3
      .= ||.s1.m - s2.m .|| by RLVECT_1:13;
    hence ||.(s1-s2).m - 0.S.|| < p by A29,A28,XXREAL_0:2;
  end;
  then
A30: s1-s2 is convergent by NORMSP_1:def 6;
  then
A31: (s1-s2)*Ns1 is convergent by LOPBAN_3:7;
  then
A32: q2 is convergent by A15,NORMSP_1:20;
  rng q1 c= rng s1 by A14,VALUED_0:21;
  then
A33: rng q1 c= Y by A13,XBOOLE_1:1;
  then rng q1 c= dom f by A3,XBOOLE_1:1;
  then rng q1 c= dom f /\ Y by A33,XBOOLE_1:19;
  then
A34: rng q1 c= dom (f|Y) by RELAT_1:61;
  then
A35: (f|Y)/.(lim q1)=lim((f|Y)/*q1) by A15,A18,NFCONT_1:def 5;
A36: (f|Y)/*q1 is convergent by A15,A18,A34,NFCONT_1:def 5;
  lim (s1-s2) = 0.S by A24,A30,NORMSP_1:def 7;
  then lim ((s1-s2)*Ns1) = 0.S by A30,LOPBAN_3:8;
  then
A37: lim q2 = lim q1 - 0.S by A15,A31,NORMSP_1:26
    .= lim q1 by RLVECT_1:13;
  then
A38: (f|Y)/*q2 is convergent by A18,A32,A23,NFCONT_1:def 5;
  then
A39: (f|Y)/*q1 - (f|Y)/*q2 is convergent by A36,NORMSP_1:20;
  (f|Y)/.(lim q1) = lim ((f|Y)/*q2) by A18,A32,A37,A23,NFCONT_1:def 5;
  then
A40: lim ((f|Y)/*q1 - (f|Y)/*q2) = (f|Y)/.(lim q1) - (f|Y)/.(lim q1) by A36,A35
,A38,NORMSP_1:26
    .= 0.T by RLVECT_1:15;
  now
    let n;
    reconsider r as Real;
    consider k be Nat such that
A41: for m being Nat st k<=m
      holds ||.((f|Y)/*q1 - (f|Y)/*q2).m-0.T .||<r by A4,A39,A40,
NORMSP_1:def 7;
A42:  k in NAT by ORDINAL1:def 12;
A43: q1.k in rng q1 by NFCONT_1:6;
A44: q2.k in rng q2 by NFCONT_1:6;
    ||.((f|Y)/*q1 - (f|Y)/*q2).k - 0.T .|| = ||.((f|Y)/*q1 - (f|Y)/*q2).k
    .|| by RLVECT_1:13
      .= ||.((f|Y)/*q1).k - ((f|Y)/*q2).k.|| by NORMSP_1:def 3
      .= ||.(f|Y)/.(q1.k) - ((f|Y)/*q2).k.|| by A34,FUNCT_2:109,A42
      .= ||.(f|Y)/.(q1.k) - (f|Y)/.(q2.k) .|| by A23,FUNCT_2:109,A42
      .= ||.f/.(q1.k) - (f|Y)/.(q2.k).|| by A34,A43,PARTFUN2:15
      .= ||.f/.(q1.k) - f/.(q2.k).|| by A23,A44,PARTFUN2:15
      .= ||.f/.(s1.(Ns1.k)) - f/.((s2*Ns1).k).|| by A17,A21,FUNCT_2:15,A42
      .= ||.f/.(s1.(Ns1.k)) - f/.(s2.(Ns1.k)).|| by FUNCT_2:15,A42;
    hence contradiction by A11,A41;
  end;
  hence contradiction;
end;
