reserve a,b,c,d for Real;

theorem Th21:
  for f being continuous Function of I[01],I[01]
  ex x being Point of I[01] st f.x = x
proof
  let f be continuous Function of I[01],I[01];
  reconsider F = f as Function of [.0,1.], [.0,1.] by BORSUK_1:40;
  set A = {a where a is Real : a in [.0,1.] & F.a in [.0,a.]}, B = {b where b
  is Real : b in [.0,1.] & F.b in [.b,1.]};
  A c= REAL
  proof
    let x be object;
    assume x in A;
    then ex a being Real st a = x & a in [.0,1.] & F.a in [.0,a.];
    hence thesis;
  end;
  then reconsider A as Subset of REAL;
A1: Closed-Interval-TSpace(0,1) = TopSpaceMetr(Closed-Interval-MSpace(0,1))
  by TOPMETR:def 7;
A2: A c= [.0,1.]
  proof
    let x be object;
    assume
A3: x in A;
    then reconsider x as Real;
    ex a0 being Real st a0 = x & a0 in [.0,1.] & F.a0 in [.0,a0.] by A3;
    hence thesis;
  end;
  B c= REAL
  proof
    let x be object;
    assume x in B;
    then ex b being Real st b = x & b in [.0,1.] & F.b in [.b,1.];
    hence thesis;
  end;
  then reconsider B as Subset of REAL;
A4: the carrier of Closed-Interval-MSpace(0,1) = [.0,1.] by TOPMETR:10;
  0 in {w where w is Real: 0<=w & w<=1};
  then
A5: 0 in [.0,1.] by RCOMP_1:def 1;
A6: [.0,1.] <> {} by XXREAL_1:1;
  then [.0,1.] = dom F by FUNCT_2:def 1;
  then F.0 in rng F by A5,FUNCT_1:def 3;
  then
A7: 0 in B by A5;
A8: [.0,1.] = {q where q is Real: 0<=q & q<=1 } by RCOMP_1:def 1;
A9: [.0,1.] c= A \/ B
  proof
    let x be object;
    assume
A10: x in [.0,1.];
    then reconsider y = x as Real;
    ex p being Real st p = y & 0<=p & p<=1 by A8,A10;
    then
A11: [.0,1.] = [.0,y.] \/ [.y,1.] by XXREAL_1:174;
    [.0,1.] = dom F by A6,FUNCT_2:def 1;
    then
A12: F.y in rng F by A10,FUNCT_1:def 3;
    now
      per cases by A11,A12,XBOOLE_0:def 3;
      suppose
A13:    F.y in [.0,y.];
A14:    A c= A \/ B by XBOOLE_1:7;
        y in A by A10,A13;
        hence y in A \/ B by A14;
      end;
      suppose
A15:    F.y in [.y,1.];
A16:    B c= A \/ B by XBOOLE_1:7;
        y in B by A10,A15;
        hence y in A \/ B by A16;
      end;
    end;
    hence thesis;
  end;
  1 in {w where w is Real: 0<=w & w<=1};
  then
A17: 1 in [.0,1.] by RCOMP_1:def 1;
A18: B c= [.0,1.]
  proof
    let x be object;
    assume
A19: x in B;
    then reconsider x as Real;
    ex b0 being Real st b0 = x & b0 in [.0,1.] & F.b0 in [.b0,1.] by A19;
    hence thesis;
  end;
  assume
A20: for x being Point of I[01] holds f.x <> x;
A21: A /\ B = {}
  proof
    set x = the Element of A /\ B;
    assume
A22: A /\ B <> {};
    then
 x in A by XBOOLE_0:def 4;
    then
A23: ex z being Real st z = x & z in [.0,1.] & F.z in [.0,z.];
    reconsider x as Real;
    x in B by A22,XBOOLE_0:def 4;
    then ex b0 being Real st b0 = x & b0 in [.0,1.] & F.b0 in [.b0,1.];
    then
A24: F.x in [.0,x.] /\ [.x,1.] by A23,XBOOLE_0:def 4;
    x in {q where q is Real: 0<=q & q<=1 } by A23,RCOMP_1:def 1;
    then ex u being Real st u = x & 0<=u & u<=1;
    then F.x in {x} by A24,XXREAL_1:418;
    then F.x = x by TARSKI:def 1;
    hence contradiction by A20,A23,BORSUK_1:40;
  end;
  then
A25: A misses B by XBOOLE_0:def 7;
  [.0,1.] = dom F by A6,FUNCT_2:def 1;
  then F.1 in rng F by A17,FUNCT_1:def 3;
  then
A26: 1 in A by A17;
  ex P,Q being Subset of I[01] st [#] I[01] = P \/ Q & P <> {}I[01] & Q
  <> {}I[01] & P is closed & Q is closed & P misses Q
  proof
    reconsider P = A, Q = B as Subset of I[01] by A2,A18,BORSUK_1:40;
    take P,Q;
    thus
A27: [#]I[01] = P \/ Q by A9,BORSUK_1:40,XBOOLE_0:def 10;
    thus P <> {}I[01] & Q <> {}I[01] by A26,A7;
    thus P is closed
    proof
      set z = the Element of (Cl P) /\ Q;
      assume not P is closed;
      then
A28:  Cl P <> P by PRE_TOPC:22;
A29:  (Cl P) /\ Q <> {}
      proof
        assume (Cl P) /\ Q = {};
        then (Cl P) misses Q by XBOOLE_0:def 7;
        then
A30:    Cl P c= Q` by SUBSET_1:23;
        P c= Cl P & P = Q` by A25,A27,PRE_TOPC:5,18;
        hence contradiction by A28,A30,XBOOLE_0:def 10;
      end;
      then
A31:  z in Cl P by XBOOLE_0:def 4;
A32:  z in Q by A29,XBOOLE_0:def 4;
      reconsider z as Point of I[01] by A31;
      reconsider t0 = z as Real;
A33:  ex c being Real st c = t0 & c in [.0,1.] & F.c in [.c,1.] by A32;
      then reconsider s0 = F.t0 as Real;
      t0 <= s0 by A33,XXREAL_1:1;
      then
A34:  0 <= s0 - t0 by XREAL_1:48;
      set r = (s0 - t0) * 2";
      reconsider m = z, n = f.z as Point of Closed-Interval-MSpace(0,1) by
BORSUK_1:40,TOPMETR:10;
      reconsider W = Ball(n,r) as Subset of I[01] by BORSUK_1:40,TOPMETR:10;
A35:  W is open & f is_continuous_at z by A1,TMAP_1:50,TOPMETR:14,20;
A36:  s0 - t0 <> 0 by A20;
      then
A37:  0 / 2 < (s0 - t0) / 2 by A34,XREAL_1:74;
      then f.z in W by TBSP_1:11;
      then consider V being Subset of I[01] such that
A38:  V is open & z in V and
A39:  f.:V c= W by A35,TMAP_1:43;
      consider s being Real such that
A40:  s > 0 and
A41:  Ball(m,s) c= V by A1,A38,TOPMETR:15,20;
      reconsider s as Real;
      set r0 = min(s,r);
      reconsider W0 = Ball(m,r0) as Subset of I[01] by BORSUK_1:40,TOPMETR:10;
      r0 > 0 by A37,A40,XXREAL_0:15;
      then
A42:  z in W0 by TBSP_1:11;
      set w = the Element of P /\ W0;
      W0 is open by A1,TOPMETR:14,20;
      then P meets W0 by A31,A42,PRE_TOPC:24;
      then
A43:  P /\ W0 <> {}I[01] by XBOOLE_0:def 7;
      then
A44:  w in P by XBOOLE_0:def 4;
A45:  w in W0 by A43,XBOOLE_0:def 4;
      then reconsider w as Point of Closed-Interval-MSpace(0,1);
      reconsider w1 = w as Point of I[01] by A44;
      reconsider d = w1 as Real;
A46:  d in A by A43,XBOOLE_0:def 4;
      Ball(m,r0) = {q where q is Element of Closed-Interval-MSpace(0,1):
      dist(m,q)<r0} by METRIC_1:17;
      then r0 <= r & ex p being Element of Closed-Interval-MSpace(0,1) st p =
      w & dist( m,p)<r0 by A45,XXREAL_0:17;
      then dist(w,m) < r by XXREAL_0:2;
      then
A47:  |.d - t0.| < r by HEINE:1;
      d - t0 <= |.d - t0.| by ABSVALUE:4;
      then t0 + r = s0 - r & d - t0 < r by A47,XXREAL_0:2;
      then
A48:  d < s0 - r by XREAL_1:19;
A49:  r < (s0 - t0) * 1 by A34,A36,XREAL_1:68;
A50:  Ball(n,r) c= [.t0,1.]
      proof
        let x be object;
        assume
A51:    x in Ball(n,r);
        then reconsider u = x as Point of Closed-Interval-MSpace(0,1);
        x in [.0,1.] by A4,A51;
        then reconsider t = x as Real;
        Ball(n,r)= {q where q is Element of Closed-Interval-MSpace(0,1):
        dist(n,q)<r} by METRIC_1:17;
        then
        ex p being Element of Closed-Interval-MSpace(0,1) st p = u & dist
        (n,p)<r by A51;
        then |.s0 - t.| < r by HEINE:1;
        then
A52:    |.s0 - t.| < s0 - t0 by A49,XXREAL_0:2;
        s0 - t <= |.s0 - t.| by ABSVALUE:4;
        then s0 - t < s0 - t0 by A52,XXREAL_0:2;
        then
A53:    t0 <= t by XREAL_1:10;
        t <= 1 by A4,A51,XXREAL_1:1;
        then t in {q where q is Real: t0<=q & q<=1 } by A53;
        hence thesis by RCOMP_1:def 1;
      end;
A54:  Ball(n,r) c= [.d,1.]
      proof
        let x be object;
        assume
A55:    x in Ball(n,r);
        then reconsider v = x as Point of Closed-Interval-MSpace(0,1);
        x in [.0,1.] by A4,A55;
        then reconsider t = x as Real;
        Ball(n,r)= {q where q is Element of Closed-Interval-MSpace(0,1):
        dist(n,q)<r} by METRIC_1:17;
        then ex p being Element of Closed-Interval-MSpace(0,1) st p = v &
        dist(n,p)<r by A55;
        then
A56:    |.s0 - t.| < r by HEINE:1;
A57:    now
          per cases;
          suppose
            t <= s0;
            then 0 <= s0 - t by XREAL_1:48;
            then s0 - t < r by A56,ABSVALUE:def 1;
            then s0 < r + t by XREAL_1:19;
            then s0 - r < t by XREAL_1:19;
            hence d < t by A48,XXREAL_0:2;
          end;
          suppose
A58:        s0 < t;
            s0 - r < s0 by A37,XREAL_1:44;
            then d < s0 by A48,XXREAL_0:2;
            hence d < t by A58,XXREAL_0:2;
          end;
        end;
        t <= 1 by A50,A55,XXREAL_1:1;
        then t in {w0 where w0 is Real: d<=w0 & w0<=1} by A57;
        hence thesis by RCOMP_1:def 1;
      end;
      Ball(m,r0) c= Ball(m,s) by PCOMPS_1:1,XXREAL_0:17;
      then W0 c= V by A41;
      then f.w1 in f.:V by A45,FUNCT_2:35;
      then f.w1 in W by A39;
      then d in B by A54,BORSUK_1:40;
      hence contradiction by A25,A46,XBOOLE_0:3;
    end;
    thus Q is closed
    proof
      set z = the Element of (Cl Q) /\ P;
      assume not Q is closed;
      then
A59:  Cl Q <> Q by PRE_TOPC:22;
A60:  (Cl Q) /\ P <> {}
      proof
        assume (Cl Q) /\ P = {};
        then (Cl Q) misses P by XBOOLE_0:def 7;
        then
A61:    Cl Q c= P` by SUBSET_1:23;
        Q c= Cl Q & Q = P` by A25,A27,PRE_TOPC:5,18;
        hence contradiction by A59,A61,XBOOLE_0:def 10;
      end;
      then
A62:  z in Cl Q by XBOOLE_0:def 4;
A63:  z in P by A60,XBOOLE_0:def 4;
      reconsider z as Point of I[01] by A62;
      reconsider t0 = z as Real;
A64:  ex c being Real st c = t0 & c in [.0,1.] & F.c in [.0,c.] by A63;
      then reconsider s0 = F.t0 as Real;
      s0 <= t0 by A64,XXREAL_1:1;
      then
A65:  0 <= t0 - s0 by XREAL_1:48;
      set r = (t0 - s0) * 2";
      reconsider m = z, n = f.z as Point of Closed-Interval-MSpace(0,1) by
BORSUK_1:40,TOPMETR:10;
      reconsider W = Ball(n,r) as Subset of I[01] by BORSUK_1:40,TOPMETR:10;
A66:  W is open & f is_continuous_at z by A1,TMAP_1:50,TOPMETR:14,20;
A67:  t0 - s0 <> 0 by A20;
      then
A68:  0 / 2 < (t0 - s0) / 2 by A65,XREAL_1:74;
      then f.z in W by TBSP_1:11;
      then consider V being Subset of I[01] such that
A69:  V is open & z in V and
A70:  f.:V c= W by A66,TMAP_1:43;
      consider s being Real such that
A71:  s > 0 and
A72:  Ball(m,s) c= V by A1,A69,TOPMETR:15,20;
      reconsider s as Real;
      set r0 = min(s,r);
      reconsider W0 = Ball(m,r0) as Subset of I[01] by BORSUK_1:40,TOPMETR:10;
      r0 > 0 by A68,A71,XXREAL_0:15;
      then
A73:  z in W0 by TBSP_1:11;
      set w = the Element of Q /\ W0;
      W0 is open by A1,TOPMETR:14,20;
      then Q meets W0 by A62,A73,PRE_TOPC:24;
      then
A74:  Q /\ W0 <> {}I[01] by XBOOLE_0:def 7;
      then
A75:  w in Q by XBOOLE_0:def 4;
A76:  w in W0 by A74,XBOOLE_0:def 4;
      then reconsider w as Point of Closed-Interval-MSpace(0,1);
      reconsider w1 = w as Point of I[01] by A75;
      reconsider d = w1 as Real;
A77:  d in B by A74,XBOOLE_0:def 4;
      Ball(m,r0) = {q where q is Element of Closed-Interval-MSpace(0,1):
      dist(m,q)<r0} by METRIC_1:17;
      then r0 <= r & ex p being Element of Closed-Interval-MSpace(0,1) st p =
      w & dist( m,p)<r0 by A76,XXREAL_0:17;
      then dist(m,w) < r by XXREAL_0:2;
      then
A78:  |.t0 - d.| < r by HEINE:1;
      t0 - d <= |.t0 - d.| by ABSVALUE:4;
      then t0 + - d < r by A78,XXREAL_0:2;
      then t0 < r - (-d) by XREAL_1:20;
      then s0 + r = t0 - r & t0 < r + - (-d);
      then
A79:  s0 + r < d by XREAL_1:19;
A80:  r < (t0 - s0) * 1 by A65,A67,XREAL_1:68;
A81:  Ball(n,r) c= [.0,t0.]
      proof
        let x be object;
        assume
A82:    x in Ball(n,r);
        then reconsider u = x as Point of Closed-Interval-MSpace(0,1);
        x in [.0,1.] by A4,A82;
        then reconsider t = x as Real;
        Ball(n,r)={q where q is Element of Closed-Interval-MSpace(0,1):
        dist(n,q)<r} by METRIC_1:17;
        then ex p being Element of Closed-Interval-MSpace(0,1) st p = u &
        dist(n,p)<r by A82;
        then |.t - s0.| < r by HEINE:1;
        then
A83:    |.t - s0.| < t0 - s0 by A80,XXREAL_0:2;
        t - s0 <= |.t - s0.| by ABSVALUE:4;
        then t - s0 < t0 - s0 by A83,XXREAL_0:2;
        then
A84:    t <= t0 by XREAL_1:9;
        0 <= t by A4,A82,XXREAL_1:1;
        then t in {q where q is Real: 0<=q & q<=t0 } by A84;
        hence thesis by RCOMP_1:def 1;
      end;
A85:  Ball(n,r) c= [.0,d.]
      proof
        let x be object;
        assume
A86:    x in Ball(n,r);
        then reconsider v = x as Point of Closed-Interval-MSpace(0,1);
        x in [.0,1.] by A4,A86;
        then reconsider t = x as Real;
        Ball(n,r)= {q where q is Element of Closed-Interval-MSpace(0,1):
        dist(n,q)<r} by METRIC_1:17;
        then ex p being Element of Closed-Interval-MSpace(0,1) st p = v &
        dist(n,p)<r by A86;
        then
A87:    |.t - s0.| < r by HEINE:1;
A88:    now
          per cases;
          suppose
            s0 <= t;
            then 0 <= t - s0 by XREAL_1:48;
            then t - s0 < r by A87,ABSVALUE:def 1;
            then t < s0 + r by XREAL_1:19;
            hence t < d by A79,XXREAL_0:2;
          end;
          suppose
A89:        t < s0;
            s0 < s0 + r by A68,XREAL_1:29;
            then s0 < d by A79,XXREAL_0:2;
            hence t < d by A89,XXREAL_0:2;
          end;
        end;
        0 <= t by A81,A86,XXREAL_1:1;
        then t in {w0 where w0 is Real: 0<=w0 & w0<=d} by A88;
        hence thesis by RCOMP_1:def 1;
      end;
      Ball(m,r0) c= Ball(m,s) by PCOMPS_1:1,XXREAL_0:17;
      then W0 c= V by A72;
      then f.w1 in f.:V by A76,FUNCT_2:35;
      then f.w1 in W by A70;
      then d in A by A85,BORSUK_1:40;
      hence contradiction by A25,A77,XBOOLE_0:3;
    end;
    thus thesis by A21,XBOOLE_0:def 7;
  end;
  hence contradiction by Th19,CONNSP_1:10;
end;
