reserve M for non empty MetrSpace,
  c,g1,g2 for Element of M;
reserve N for non empty MetrStruct,
  w for Element of N,
  G for Subset-Family of N,
  C for Subset of N;
reserve R for Reflexive non empty MetrStruct;
reserve T for Reflexive symmetric triangle non empty MetrStruct,
  t1 for Element of T,
  Y for Subset-Family of T,
  P for Subset of T;
reserve f for Function,
  n,m,p,n1,n2,k for Nat,
  r,s,L for Real,
  x,y for set;
reserve S1 for sequence of M,
  S2 for sequence of N;

theorem
  for f being Contraction of M st M is complete ex c st f.c = c & for y
  being Element of M st f.y=y holds y=c
proof
  let f be Contraction of M;
  consider L such that
A1: 0<L and
A2: L<1 and
A3: for x,y being Point of M holds dist(f.x,f.y)<=L*dist(x,y) by ALI2:def 1;
A4: 1-L>0 by A2,XREAL_1:50;
  ex S1 st for n holds S1.(n+1)=f.(S1.n)
  proof
    set z = the Element of M;
    deffunc U(Nat,Element of M) = f.$2;
    ex h being sequence of the carrier of M st h.0 = z & for n being
    Nat holds h.(n+1) = U(n,h.n) from NAT_1:sch 12;
    then consider h being sequence of the carrier of M such that
    h.0 = z and
A5: for n being Nat holds h.(n + 1) = f.(h.n);
    take h;
    let n;
    thus thesis by A5;
  end;
  then consider S1 such that
A6: for n holds S1.(n+1)=f.(S1.n);
  set r = dist(S1.1,S1.0);
A7: 0<=r by METRIC_1:5;
A8: 1-L<>0 by A2;
  assume
A9: M is complete;
  now
    per cases;
    suppose
A10:  0=r;
A11:  f.(S1.0) = S1.(0+1) by A6
        .= S1.0 by A10,METRIC_1:2;
      for y being Element of M st f.y=y holds y=S1.0
      proof
        let y be Element of M;
        assume
A12:    f.y=y;
A13:    dist(y,S1.0)>=0 by METRIC_1:5;
        assume y<>S1.0;
        then dist(y,S1.0)<>0 by METRIC_1:2;
        then L*dist(y,S1.0)<dist(y,S1.0) by A2,A13,XREAL_1:157;
        hence contradiction by A3,A11,A12;
      end;
      hence thesis by A11;
    end;
    suppose
A14:  0<>r;
A15:  for n holds dist(S1.(n+1),S1.n)<=r*L to_power n
      proof
        defpred X[Nat] means
  dist(S1.($1+1),S1.$1)<=r*L to_power $1;
A16:    for k st X[k] holds X[k+1]
        proof
          let k be Nat;
          assume dist(S1.(k+1),S1.k)<=r*L to_power k;
          then
A17:      L*dist(S1.(k+1),S1.k)<=L*(r*L to_power k) by A1,XREAL_1:64;
          dist(S1.((k+1)+1),S1.(k+1)) = dist(f.(S1.(k+1)),S1.(k+1)) by A6
            .= dist(f.(S1.(k+1)),f.(S1.k)) by A6;
          then
A18:      dist(S1.((k+1)+1),S1.(k+1)) <= L*dist(S1.(k+1),S1.k) by A3;
          L*(r*L to_power k) = r*(L*L to_power k)
            .= r*(L to_power k*L to_power 1) by POWER:25
            .= r*L to_power (k+1) by A1,POWER:27;
          hence thesis by A18,A17,XXREAL_0:2;
        end;
        dist(S1.(0+1),S1.0) = r*1 .= r*L to_power 0 by POWER:24;
        then
A19:    X[0];
        thus for k holds X[k] from NAT_1:sch 2(A19,A16);
      end;
A20:  for k holds dist(S1.k,S1.0)<=r*((1-L to_power k)/(1-L))
      proof
        defpred X[Nat] means
dist(S1.$1,S1.0)<=r*((1-L to_power $1)
        /(1-L));
A21:    for k st X[k] holds X[k+1]
        proof
          let k be Nat such that
A22:      dist(S1.k,S1.0)<=r*((1-L to_power k)/(1-L));
          dist(S1.(k+1),S1.k)<=r*L to_power k by A15;
          then
A23:      dist(S1.(k+1),S1.0) <= dist(S1.(k+1),S1.k) + dist(S1.k,S1.0) &
dist(S1.(k+1) ,S1.k) + dist(S1.k,S1.0) <= r*L to_power k + r*((1-L to_power k)/
          (1-L)) by A22,METRIC_1:4,XREAL_1:7;
          r*L to_power k + r*((1-L to_power k)/(1-L)) = r*(L to_power k +
          (1-L to_power k)/(1-L))
            .= r*(L to_power k/(1-L)*(1-L) + (1-L to_power k)/(1-L)) by A8,
XCMPLX_1:87
            .= r*((1-L)*L to_power k/(1-L) + (1-L to_power k)/(1-L)) by
XCMPLX_1:74
            .= r*((1*L to_power k-L*L to_power k + (1-L to_power k))/(1-L))
          by XCMPLX_1:62
            .= r*((1-L*L to_power k)/(1-L))
            .= r*((1-L to_power k*L to_power 1)/(1-L)) by POWER:25
            .= r*((1-L to_power (k+1))/(1-L)) by A1,POWER:27;
          hence thesis by A23,XXREAL_0:2;
        end;
        r*((1-L to_power 0)/(1-L)) = r*((1-1)/(1-L)) by POWER:24
          .= 0;
        then
A24:    X[0] by METRIC_1:1;
        thus for k holds X[k] from NAT_1:sch 2(A24,A21);
      end;
A25:  for k holds dist(S1.k,S1.0)<=r/(1-L)
      proof
        let k be Nat;
        0 < L to_power k by A1,A2,Th2;
        then 1-L to_power k<=1 by XREAL_1:44;
        then (1-L to_power k)/(1-L) <= 1/(1-L) by A4,XREAL_1:72;
        then
A26:    r*((1-L to_power k)/(1-L)) <= r*(1/(1-L)) by A7,XREAL_1:64;
        dist(S1.k,S1.0)<=r*((1-L to_power k)/(1-L)) by A20;
        then dist(S1.k,S1.0)<=r*(1/(1-L)) by A26,XXREAL_0:2;
        hence thesis by XCMPLX_1:99;
      end;
A27:  for n,k holds dist(S1.(n+k),S1.n)<=L to_power n*dist(S1.k,S1.0)
      proof
        defpred X[Nat] means
        for k holds dist(S1.($1+k),S1.$1)<=L
        to_power $1*dist(S1.k,S1.0);
A28:    for n st X[n] holds X[n+1]
        proof
          let n such that
A29:      for k holds dist(S1.(n+k),S1.n)<=L to_power n*dist(S1.k,S1. 0);
          let k be Nat;
A30:      L*(L to_power n*dist(S1.k,S1.0)) = L*L to_power n*dist(S1.k,S1. 0)
            .= L to_power n*L to_power 1*dist(S1.k,S1.0) by POWER:25
            .= L to_power (n+1)*dist(S1.k,S1.0) by A1,POWER:27;
          dist(S1.((n+1)+k),S1.(n+1)) = dist(S1.((n+k)+1),S1.(n+1))
            .= dist(f.(S1.(n+k)),S1.(n+1)) by A6
            .= dist(f.(S1.(n+k)),f.(S1.n)) by A6;
          then
A31:      dist(S1.((n+1)+k),S1.(n+1))<=L*dist(S1.(n+k),S1.n) by A3;
          L*dist(S1.(n+k),S1.n) <=L*(L to_power n*dist(S1.k,S1.0)) by A1,A29,
XREAL_1:64;
          hence thesis by A31,A30,XXREAL_0:2;
        end;
A32:    X[0]
        proof
          let n;
          L to_power 0*dist(S1.n,S1.0) = 1*dist(S1.n,S1.0) by POWER:24
            .= dist(S1.n,S1.0);
          hence thesis;
        end;
        thus for k holds X[k] from NAT_1:sch 2(A32,A28);
      end;
A33:  for n,k holds dist(S1.(n+k),S1.n)<=(r/(1-L))*L to_power n
      proof
        let n,k be Nat;
        0 <= L to_power n by A1,A2,Th2;
        then
A34:    L
 to_power n*dist(S1.k,S1.0) <= L to_power n*(r/(1-L)) by A25,XREAL_1:64;
        dist(S1.(n+k),S1.n)<=L to_power n*dist(S1.k,S1.0) by A27;
        hence thesis by A34,XXREAL_0:2;
      end;
      for s st s>0 ex p st for n,k st p<=n holds dist(S1.(n+k),S1.n)<s
      proof
A35:    (1-L)/r>0 by A4,A7,A14,XREAL_1:139;
        let s;
        assume s>0;
        then (1-L)/r*s>0 by A35,XREAL_1:129;
        then consider p such that
A36:    L to_power p<(1-L)/r*s by A1,A2,Th3;
        take p;
        let n,k be Nat;
        assume p<=n;
        then L to_power n<=L to_power p by A1,A2,Th1;
        then
A37:    L to_power n<(1-L)/r*s by A36,XXREAL_0:2;
        r/(1-L)>0 by A4,A7,A14,XREAL_1:139;
        then
A38:    (r/(1-L))*L to_power n<(r/(1-L))*((1-L)/r*s) by A37,XREAL_1:68;
A39:    dist(S1.(n+k),S1.n)<=(r/(1-L))*L to_power n by A33;
        (r/(1-L))*((1-L)/r*s) = ((r/(1-L))*((1-L)/r))*s
          .= ((r*(1-L))/(r*(1-L)))*s by XCMPLX_1:76
          .= 1*s by A8,A14,XCMPLX_1:6,60
          .= s;
        hence thesis by A38,A39,XXREAL_0:2;
      end;
      then S1 is Cauchy by Th6;
      then S1 is convergent by A9;
      then consider x being Element of M such that
A40:  for r st r>0 ex n st for m st n<=m holds dist(S1.m,x)<r;
A41:  f.x = x
      proof
        set a = dist(x,f.x)/4;
        assume x <> f.x;
        then
A42:    dist(x,f.x) <> 0 by METRIC_1:2;
A43:    dist(x,f.x) >= 0 by METRIC_1:5;
        then consider n such that
A44:    for m st n<=m holds dist(S1.m,x)<a by A40,A42,XREAL_1:224;
        dist(S1.(n+1),f.x) = dist(f.(S1.n),f.x) by A6;
        then
A45:    dist(S1.(n+1),f.x) <= L*dist(S1.n,x) by A3;
A46:    dist(S1.n,x)<a by A44;
        L*dist(S1.n,x)<=dist(S1.n,x) by A2,METRIC_1:5,XREAL_1:153;
        then dist(S1.(n+1),f.x)<= dist(S1.n,x) by A45,XXREAL_0:2;
        then
A47:    dist(S1.(n+1),f.x)<a by A46,XXREAL_0:2;
A48:    dist(x,f.x)<=dist(x,S1.(n+1))+dist(S1.(n+1),f.x) & dist(x,f.x)/2
        < dist(x,f. x) by A42,A43,METRIC_1:4,XREAL_1:216;
        dist(x,S1.(n+1))<a by A44,NAT_1:11;
        then dist(x,S1.(n+1))+dist(S1.(n+1),f.x)<a+a by A47,XREAL_1:8;
        hence contradiction by A48,XXREAL_0:2;
      end;
      for y being Element of M st f.y=y holds y=x
      proof
        let y be Element of M;
        assume
A49:    f.y=y;
A50:    dist(y,x)>=0 by METRIC_1:5;
        assume y<>x;
        then dist(y,x)<>0 by METRIC_1:2;
        then L*dist(y,x)<dist(y,x) by A2,A50,XREAL_1:157;
        hence contradiction by A3,A41,A49;
      end;
      hence thesis by A41;
    end;
  end;
  hence thesis;
end;
