reserve i,n,m for Nat,
  x,y,X,Y for set,
  r,s for Real;

theorem Th40:
  for M be symmetric triangle Reflexive non empty MetrStruct for a
be Point of M for S be sequence of WellSpace(a,X) st S is Cauchy holds (for Xa
  be Point of WellSpace(a,X) st Xa=[X,a] for r st r > 0 ex n st for m st m >= n
holds dist(S.m,Xa) < r) or ex n,Y st for m st m >= n ex p be Point of M st S.m
  = [Y,p]
proof
  let M be symmetric triangle Reflexive non empty MetrStruct;
  let a be Point of M;
  set W=WellSpace(a,X);
  reconsider Xa=[X,a] as Point of W by Th37;
  let S be sequence of W such that
A1: S is Cauchy;
  per cases;
  suppose
    for r st r > 0 ex n st for m st m >= n holds dist(S.m,Xa) < r;
    hence thesis;
  end;
  suppose
    ex r st r > 0 & for n ex m st m >= n & dist(S.m,Xa) >= r;
    then consider r be Real such that
A2: r > 0 and
A3: for n ex m st m >= n & dist(S.m,Xa) >= r;
    consider p be Nat such that
A4: for n,m be Nat st n>=p & m>=p holds dist(S.n,S.m)<r by A1,A2;
    consider p9 be Nat such that
A5: p9 >= p and
A6: dist(S.p9,Xa) >= r by A3;
    consider Y be set,y be Point of M such that
A7: S.p9=[Y,y] and
    Y in X & y<>a or Y = X & y = a by Th37;
    ex n,Y st for m st m >= n ex p be Point of M st S.m = [Y,p]
    proof
      take p9,Y;
      let m such that
A8:   m >= p9;
      consider Z be set,z be Point of M such that
A9:   S.m=[Z,z] and
      Z in X & z<>a or Z = X & z = a by Th37;
      Y = Z
      proof
A10:    dist(a,z) >=0 by METRIC_1:5;
A11:    dist(a,a)=0 by METRIC_1:1;
        X=Y or X<>Y;
        then dist(S.p9,Xa)=dist(y,a) or dist(S.p9,Xa)=dist(y,a)+0 by A7,A11
,Def10;
        then
A12:    dist(y,a)+dist(a,z)>=r+0 by A6,A10,XREAL_1:7;
        assume Y<>Z;
        then
A13:    dist(S.p9,S.m)>=r by A7,A9,A12,Def10;
        m>=p by A5,A8,XXREAL_0:2;
        hence thesis by A4,A5,A13;
      end;
      hence thesis by A9;
    end;
    hence thesis;
  end;
end;
