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

theorem Th41:
  for M be symmetric triangle Reflexive non empty MetrStruct for a
  be Point of M holds M is complete implies WellSpace(a,X) is complete
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;
  assume
A1: M is complete;
  let S9 be sequence of W such that
A2: S9 is Cauchy;
  defpred P[object,object] means ex x st S9.$1=[x,$2];
A3: for x being object st x in NAT
ex y being object st y in the carrier of M & P[x,y]
  proof
    let x be object;
    assume x in NAT;
    then reconsider i=x as Nat;
    consider s1 be set,s2 be Point of M such that
A4: S9.i=[s1,s2] and
    s1 in X & s2<>a or s1 = X & s2 = a by Th37;
    take s2;
    thus thesis by A4;
  end;
  consider S be sequence of M such that
A5: for x being object st x in NAT holds P[x,S.x] from FUNCT_2:sch 1(A3);
  S is Cauchy
  proof
    let r;
    assume r>0;
    then consider p be Nat such that
A6: for n,m be Nat st p<=n & p<=m holds dist(S9.n,S9.m)<r
    by A2;
    take p;
    let n,m be Nat such that
A7: p<=n and
A8: p<=m;
A9:  n in NAT & m in NAT by ORDINAL1:def 12;
    consider x such that
A10: S9.n=[x,S.n] by A5,A9;
    consider y such that
A11: S9.m=[y,S.m] by A5,A9;
    per cases;
    suppose
      x=y;
      then dist(S9.n,S9.m)=dist(S.n,S.m) by A10,A11,Def10;
      hence thesis by A6,A7,A8;
    end;
    suppose
A12:  x<>y;
A13:  dist(S.n,S.m) <= dist(S.n,a)+dist(a,S.m) by METRIC_1:4;
A14:  dist(S9.n,S9.m)<r by A6,A7,A8;
      dist(S9.n,S9.m)=dist(S.n,a)+dist(a,S.m) by A10,A11,A12,Def10;
      hence thesis by A13,A14,XXREAL_0:2;
    end;
  end;
  then S is convergent by A1;
  then consider L being Element of M such that
A15: for r st r>0 ex n be Nat st for m be Nat st n
  <=m holds dist(S.m,L)<r;
  per cases by A2,Th40;
  suppose
A16: L=a;
    take Xa;
A17: dist(a,a)=0 by METRIC_1:1;
    let r;
    assume r > 0;
    then consider n be Nat such that
A18: for m be Nat st n<=m holds dist(S.m,L)<r by A15;
    take n;
    let m be Nat such that
A19: m >=n;
A20:  n in NAT & m in NAT by ORDINAL1:def 12;
    consider x such that
A21: S9.m=[x,S.m] by A5,A20;
    x=X or x<>X;
    then dist(S9.m,Xa)=dist(S.m,L) or dist(S9.m,Xa)=dist(S.m,L)+0 by A16,A21
,A17,Def10;
    hence dist(S9.m,Xa)<r by A18,A19;
  end;
  suppose
A22: for Xa be Point of W st Xa=[X,a] for r st r > 0 ex n st for m st
    m >= n holds dist(S9.m,Xa) < r;
    take Xa;
    let r;
    assume r > 0;
    then consider n such that
A23: for m st m >= n holds dist(S9.m,Xa) < r by A22;
    reconsider n as Nat;
    take n;
    let m be Nat;
    assume m >= n;
    hence dist(S9.m,Xa) < r by A23;
  end;
  suppose
A24: a<>L & ex n,Y st for m st m >= n ex p be Point of M st S9.m = [Y, p];
    then consider n,Y such that
A25: for m st m >= n ex p be Point of M st S9.m = [Y,p];
A26: ex s3 be Point of M st S9.n = [Y,s3] by A25;
A27: ex s1 be set,s2 be Point of M st S9.n=[s1,s2] &( s1 in X & s2<>a or
    s1 = X & s2 = a) by Th37;
    per cases by A27,A26,XTUPLE_0:1;
    suppose
      Y in X;
      then reconsider YL=[Y,L] as Point of W by A24,Th37;
      take YL;
      let r;
      assume r > 0;
      then consider p be Nat such that
A28:  for m be Nat st p<=m holds dist(S.m,L)<r by A15;
      reconsider mm=max(p,n) as Nat by TARSKI:1;
      take mm;
      let m be Nat such that
A29:  m >= mm;
A30:  n in NAT & m in NAT by ORDINAL1:def 12;
      consider x such that
A31:  S9.m=[x,S.m] by A5,A30;
      mm >= n by XXREAL_0:25;
      then ex pm be Point of M st S9.m = [Y,pm] by A25,A29,XXREAL_0:2;
      then x=Y by A31,XTUPLE_0:1;
      then
A32:  dist(S9.m,YL)=dist(S.m,L) by A31,Def10;
      mm >= p by XXREAL_0:25;
      then m>=p by A29,XXREAL_0:2;
      hence dist(S9.m,YL)<r by A28,A32;
    end;
    suppose
A33:  Y=X;
      reconsider n as Nat;
      take Xa;
      let r such that
A34:  r > 0;
      take n;
      let m be Nat;
      assume m >= n;
      then
A35:  ex t3 be Point of M st S9.m = [Y,t3] by A25;
      consider t1 be set,t2 be Point of M such that
A36:  S9.m=[t1,t2] and
A37:  t1 in X & t2<>a or t1 = X & t2 = a by Th37;
      Y=t1 by A36,A35,XTUPLE_0:1;
      hence dist(S9.m,Xa)<r by A33,A34,A36,A37,METRIC_1:1;
    end;
  end;
end;
