Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Mizar/prel/j/     Datei vom 6.10.2026 mit Größe 39 kB image not shown  

Quelle  compl_sp.miz   Sprache: Mizar

 

:: Complete Spaces
::  by Karol P\c{a}k
::
:: Received October 12, 2007
:: Copyright (c) 2007-2026 Association of Mizar Users
::           (Stowarzyszenie Uzytkownikow Mizara, Bialystok, Poland).
:: This code can be distributed under the GNU General Public Licence
:: version 3.0 or later, or the Creative Commons Attribution-ShareAlike
:: License version 3.0 or later, subject to the binding interpretation
:: detailed in file COPYING.interpretation.
:: See COPYING.GPL and COPYING.CC-BY-SA for the full text of these
:: licenses, or see http://www.gnu.org/licenses/gpl.html and
:: http://creativecommons.org/licenses/by-sa/3.0/.

environ

 vocabularies NUMBERS, ORDINAL1, REAL_1, XBOOLE_0, METRIC_1, PROB_1, XXREAL_2,
      FUNCT_1, RELAT_1, STRUCT_0, PRE_TOPC, SUBSET_1, FUNCOP_1, XXREAL_0,
      MEASURE5, SEQ_1, CARD_1, ARYTM_1, ARYTM_3, VALUED_0, TARSKI, ORDINAL2,
      NAT_1, BHSP_3, COMPLEX1, RELAT_2, RCOMP_1, PCOMPS_1, ZFMISC_1, REWRITE1,
      SETFAM_1, SEQ_2, METRIC_6, FRECHET, FINSET_1, VALUED_1, CARD_3, TOPGEN_1,
      WELLORD1, ORDERS_2, PARTFUN1, WELLFND1, TBSP_1, WAYBEL23, RLVECT_3,
      COMPL_SP;
 notations METRIC_6, RELAT_2, BINOP_1, TOPMETR, CARD_1, FUNCOP_1, CANTOR_1,
      WELLORD1, XCMPLX_0, COMPLEX1, FINSET_1, SEQ_2, TARSKI, XBOOLE_0,
      SUBSET_1, RELAT_1, ORDINAL1, NUMBERS, ZFMISC_1, XXREAL_0, XREAL_0,
      REAL_1, SETFAM_1, DOMAIN_1, TOPS_2, FUNCT_1, VALUED_1, NAT_1, VALUED_0,
      STRUCT_0, PRE_TOPC, COMPTS_1, SEQ_1, TBSP_1, RELSET_1, PARTFUN1, FUNCT_2,
      METRIC_1, PCOMPS_1, CARD_3, PROB_1, FRECHET, KURATO_0, KURATO_2,
      WELLFND1, WAYBEL23, ORDERS_2, TOPGEN_1;
 constructors REAL_1, TBSP_1, FRECHET, COMPLEX1, SEQ_2, TOPS_2, WELLORD1,
      CANTOR_1, URYSOHN3, METRIC_6, WELLFND1, TOPGEN_4, WAYBEL23, TOPGEN_1,
      COMPTS_1, BINOP_2, KURATO_0, COMSEQ_2, BINOP_1;
 registrations TOPMETR, PRE_TOPC, PCOMPS_1, NAT_1, TBSP_1, XREAL_0, RELSET_1,
      SUBSET_1, STRUCT_0, TOPS_1, METRIC_1, HAUSDORF, MEMBERED, YELLOW13,
      CARD_1, XBOOLE_0, VALUED_1, FUNCT_2, NUMBERS, FINSET_1, SEQ_4, WELLFND1,
      VALUED_0, ORDINAL1;
 requirements REAL, SUBSET, BOOLE, NUMERALS, ARITHM;
 definitions TARSKI, TOPS_2, TBSP_1, PCOMPS_1, COMPTS_1;
 equalities TARSKI, SUBSET_1, STRUCT_0, PCOMPS_1, METRIC_1, ORDINAL1;
 expansions TARSKI, TOPS_2, TBSP_1, PCOMPS_1, COMPTS_1, METRIC_1;
 theorems NAT_1, FUNCT_2, PCOMPS_1, PCOMPS_2, NAGATA_1, SUBSET_1, METRIC_6,
      FUNCT_1, METRIC_1, XREAL_0, XCMPLX_1, ABSVALUE, TOPMETR, XBOOLE_1,
      TARSKI, SETFAM_1, XBOOLE_0, TOPS_1, TOPS_2, PRE_TOPC, CARD_4, ZFMISC_1,
      BINOP_1, SEQ_2, SEQ_4, SEQ_1, SEQM_3, PARTFUN1, WELLORD1, WELLORD2,
      TBSP_1, RELAT_1, RELAT_2, YELLOW_9, XREAL_1, XXREAL_0, ORDINAL1,
      FRECHET2, FRECHET, STIRL2_1, CARD_1, HAUSDORF, TOPMETR3, CARD_3,
      TOPGEN_4, DICKSON, RELSET_2, TOPGEN_1, WELLFND1, WAYBEL23, UNIFORM1,
      CARD_2, TOPREAL6, FINSET_1, PROB_1, FUNCOP_1, KURATO_0, XTUPLE_0;
 schemes WELLFND1, TREES_2, FUNCT_2, NAT_1, FRAENKEL, BINOP_1, SEQ_1;

begin :: Preliminaries

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

definition
  let M be non empty MetrStruct;
  let S be SetSequence of M;
  attr S is pointwise_bounded means
  :Def1:
  for i holds S.i is bounded;
end;

registration
  let M be non empty Reflexive MetrStruct;
  cluster pointwise_bounded non-empty for SetSequence of M;
  existence
  proof
    consider x being object such that
A1: x in the carrier of M by XBOOLE_0:def 1;
    reconsider x as Point of M by A1;
    reconsider X={x} as Subset of M;
    take S = NAT --> X;
A2: now
      let x1,x2 being Point of M such that
A3:   x1 in X and
A4:   x2 in X;
A5:   x2=x by A4,TARSKI:def 1;
      x1=x by A3,TARSKI:def 1;
      hence dist(x1,x2)<=1 by A5,METRIC_1:1;
    end;
A6: now
      let i;
      reconsider i9=i as Element of NAT by ORDINAL1:def 12;
      S.i9= X by FUNCOP_1:7;
      hence S.i is bounded by A2;
    end;
    for x being object st x in dom S holds S.x is non empty by FUNCOP_1:7;
    hence thesis by A6,FUNCT_1:def 9;
  end;
end;

definition
  let M be Reflexive non empty MetrStruct;
  let S be SetSequence of M;
  func diameter S -> Real_Sequence means
  :Def2:
  for i holds it.i = diameter S. i;
  existence
  proof
    defpred P[object,object] means for i st i=$1 holds $2=diameter (S.i);
A1: for x being object st x in NAT ex y being object st y in REAL & P[x,y]
    proof
      let x be object;
      assume x in NAT;
      then reconsider i=x as Nat;
      take diameter (S.i);
      thus thesis by XREAL_0:def 1 ;
    end;
    consider f be sequence of REAL such that
A2: for x being object st x in NAT holds P[x,f.x] from FUNCT_2:sch 1(A1);
    take f;
    let i;
    i in NAT by ORDINAL1:def 12;
    hence thesis by A2;
  end;
  uniqueness
  proof
    let D1,D2 be Real_Sequence such that
A3: for i holds D1.i = diameter S.i and
A4: for i holds D2.i = diameter S.i;
    now
      let x be Element of NAT;
      thus D1.x = diameter S.x by A3
        .= D2.x by A4;
    end;
    hence thesis by FUNCT_2:63;
  end;
end;

theorem Th1:
  for M be Reflexive non empty MetrStruct for S be pointwise_bounded
  SetSequence of M holds diameter S is bounded_below
proof
  let M be Reflexive non empty MetrStruct;
  let S be pointwise_bounded SetSequence of M;
  set d=diameter S;
  now
    let n be Nat;
A1: diameter (S.n)=d.n by Def2;
    S.n is bounded by Def1;
    then 0<=d.n by A1,TBSP_1:21;
    hence -1 < d.n by XXREAL_0:2;
  end;
  hence thesis by SEQ_2:def 4;
end;

registration
  let M be Reflexive non empty MetrStruct,
      S be SetSequence of M;
 cluster diameter S -> real-valued;
 coherence;
end;

theorem Th2:
  for M be Reflexive non empty MetrStruct for S be pointwise_bounded
  SetSequence of M st S is non-ascending holds diameter S is bounded_above &
  diameter S is non-increasing
proof
  let M be Reflexive non empty MetrStruct;
  let S be pointwise_bounded SetSequence of M such that
A1: S is non-ascending;
  set d=diameter S;
A2: now
    let n be Nat;
A3: d.0+0<d.0+1 by XREAL_1:8;
A4: diameter S.n=d.n by Def2;
A5: diameter S.0=d.0 by Def2;
A6: S.0 is bounded by Def1;
    S.n c= S.0 by A1,PROB_1:def 4;
    then d.n<=d.0 by A6,A4,A5,TBSP_1:24;
    hence d.n<d.0+1 by A3,XXREAL_0:2;
  end;
  now
    let m,n be Nat such that
    m in dom d and
    n in dom d and
A7: m <= n;
A8: S.m is bounded by Def1;
A9: diameter S.m=d.m by Def2;
A10: diameter S.n=d.n by Def2;
    S.n c= S.m by A1,A7,PROB_1:def 4;
    hence d.n<=d.m by A8,A10,A9,TBSP_1:24;
  end;
  hence thesis by A2,SEQM_3:def 4,SEQ_2:def 3;
end;

theorem
  for M be Reflexive non empty MetrStruct
  for S be pointwise_bounded SetSequence of M st
  S is non-descending holds diameter S is non-decreasing
proof
  let M be Reflexive non empty MetrStruct;
  let S be pointwise_bounded SetSequence of M such that
A1: S is non-descending;
  set d=diameter S;
  now
    let m,n be Nat such that
    m in dom d and
    n in dom d and
A2: m <= n;
A3: S.n is bounded by Def1;
A4: diameter S.m=d.m by Def2;
A5: diameter S.n=d.n by Def2;
    S.m c= S.n by A1,A2,PROB_1:def 5;
    hence d.n>=d.m by A3,A5,A4,TBSP_1:24;
  end;
 hence thesis by SEQM_3:def 3;
end;

theorem Th4:
  for M be non empty Reflexive MetrStruct for S be pointwise_bounded
  SetSequence of M st S is non-ascending & lim diameter S = 0 for F be sequence
  of M st for i holds F.i in S.i holds F is Cauchy
proof
  let M be non empty Reflexive MetrStruct;
  let S be pointwise_bounded SetSequence of M such that
A1: S is non-ascending and
A2: lim diameter S = 0;
  set d=diameter S;
A3: d is non-increasing by A1,Th2;
A4: d is bounded_below by Th1;
  let F be sequence of M such that
A5: for i holds F.i in S.i;
  let r;
  assume r>0;
  then consider n be Nat such that
A6: for m be Nat st n <= m holds |.d.m-0 .| < r by A2,A4,A3,
SEQ_2:def 7;
  take n;
  let m1,m2 be Nat such that
A7: n <= m1 and
A8: n <= m2;
A9: S.m2 c= S.n by A1,A8,PROB_1:def 4;
A10: F.m2 in S.m2 by A5;
A11: F.m1 in S.m1 by A5;
A12: |.d.n-0 .|<r by A6;
A13: diameter S.n=d.n by Def2;
A14: S.n is bounded by Def1;
  then 0 <= d.n by A13,TBSP_1:21;
  then
A15: d.n < r by A12,ABSVALUE:def 1;
  S.m1 c= S.n by A1,A7,PROB_1:def 4;
  then dist(F.m1,F.m2)<=d.n by A9,A11,A10,A14,A13,TBSP_1:def 8;
  hence thesis by A15,XXREAL_0:2;
end;

theorem Th5:
  for M be Reflexive symmetric triangle non empty MetrStruct for p
  be Point of M holds 0 <= r implies diameter cl_Ball(p,r) <= 2*r
proof
  let M be Reflexive symmetric triangle non empty MetrStruct;
  let p be Point of M;
A1: dist(p,p)=0 by METRIC_1:1;
  assume 0 <= r;
  then
A2: p in cl_Ball(p,r) by A1,METRIC_1:12;
A3: now
    let x,y be Point of M such that
A4: x in cl_Ball(p,r) and
A5: y in cl_Ball(p,r);
A6: dist(x,p)<=r by A4,METRIC_1:12;
A7: dist(x,y)<=dist(x,p)+dist(p,y) by METRIC_1:4;
    dist(p,y)<=r by A5,METRIC_1:12;
    then dist(x,p)+dist(p,y)<=r+r by A6,XREAL_1:7;
    hence dist(x,y)<=2*r by A7,XXREAL_0:2;
  end;
  cl_Ball(p,r) is bounded by TOPREAL6:59;
  hence thesis by A2,A3,TBSP_1:def 8;
end;

definition
  let M be MetrStruct;
  let U be Subset of M;
  attr U is open means

  U in Family_open_set M;
end;

definition
  let M be MetrStruct;
  let A be Subset of M;
  attr A is closed means

  A` is open;
end;

registration
  let M be MetrStruct;
  cluster empty -> open for Subset of M;
  coherence
  proof
    let S be Subset of M;
A1: TopSpaceMetr(M) = TopStruct (#the carrier of M,Family_open_set M#);
    assume S is empty;
    then S in Family_open_set M by A1,PRE_TOPC:1;
    hence thesis;
  end;
  cluster empty -> closed for Subset of M;
  coherence
  proof
    let S be Subset of M;
    assume S is empty;
    then
A2: [#]M = S`;
    [#]M in Family_open_set M by PCOMPS_1:30;
    then [#]M is open;
    hence thesis by A2;
  end;
end;

registration
  let M be non empty MetrStruct;
  cluster open non empty for Subset of M;
  existence
  proof
    [#]M in Family_open_set M by PCOMPS_1:30;
    then [#]M is open;
    hence thesis;
  end;
  cluster closed non empty for Subset of M;
  existence
  proof
    ({}M)` is closed;
    hence thesis;
  end;
end;

theorem Th6:
  for M be MetrStruct for A be Subset of M, A9 be Subset of
TopSpaceMetr M st A9 = A holds ( A is open iff A9 is open ) & ( A is closed iff
  A9 is closed )
proof
  let M be MetrStruct;
  let A be Subset of M, A9 be Subset of TopSpaceMetr M such that
A1: A9 = A;
  thus A is open implies A9 is open
  by A1,PRE_TOPC:def 2;
  thus A9 is open implies A is open
  by PRE_TOPC:def 2,A1;
  thus A is closed implies A9 is closed
  proof
    assume A is closed;
    then A` is open;
    then A` in Family_open_set M;
    then A9` is open by A1,PRE_TOPC:def 2;
    hence thesis by TOPS_1:3;
  end;
  assume A9 is closed;
  then A` in Family_open_set M by A1,PRE_TOPC:def 2;
  then A` is open;
  hence thesis;
end;

definition
  let T be TopStruct;
  let S be SetSequence of T;
  attr S is open means

  for i holds S.i is open;
  attr S is closed means
  :Def6:
  for i holds S.i is closed;
end;

Lm1: for T be TopSpace ex S be SetSequence of T st S is open & S is closed & (
T is non empty implies S is non-empty)
proof
  let T be TopSpace;
  take S = NAT --> [#]T;
A1: for i holds S.i is closed by FUNCOP_1:7,ORDINAL1:def 12;
   for i holds S.i is open by FUNCOP_1:7,ORDINAL1:def 12;
  hence S is open & S is closed by A1;
  assume T is non empty;
  then for x being object st x in dom S holds S.x is non empty by FUNCOP_1:7;
  hence thesis by FUNCT_1:def 9;
end;

registration
  let T be TopSpace;
  cluster open for SetSequence of T;
  existence
  proof
    ex S be SetSequence of T st S is open & S is closed & (T is non empty
    implies S is non-empty) by Lm1;
    hence thesis;
  end;
  cluster closed for SetSequence of T;
  existence
  proof
    ex S be SetSequence of T st S is open & S is closed & (T is non empty
    implies S is non-empty) by Lm1;
    hence thesis;
  end;
end;

registration
  let T be non empty TopSpace;
  cluster open non-empty for SetSequence of T;
  existence
  proof
    ex S be SetSequence of T st S is open & S is closed & (T is non empty
    implies S is non-empty) by Lm1;
    hence thesis;
  end;
  cluster closed non-empty for SetSequence of T;
  existence
  proof
    ex S be SetSequence of T st S is open & S is closed & (T is non empty
    implies S is non-empty) by Lm1;
    hence thesis;
  end;
end;

definition
  let M be MetrStruct;
  let S be SetSequence of M;
  attr S is open means

  for i holds S.i is open;
  attr S is closed means
  :Def8:
  for i holds S.i is closed;
end;

registration
  let M be non empty MetrSpace;
  cluster non-empty pointwise_bounded open for SetSequence of M;
  existence
  proof
    consider x being object such that
A1: x in the carrier of M by XBOOLE_0:def 1;
    reconsider x as Point of M by A1;
    set B=Ball(x,1);
    take S = NAT --> B;
A2: now
      let y be object;
      assume y in dom S;
      then reconsider n=y as Element of NAT;
A3:   B=S.n by FUNCOP_1:7;
      dist(x,x)=0 by METRIC_1:1;
      hence S.y is non empty by A3,METRIC_1:11;
    end;
A4: now
      let i;
      i in NAT by ORDINAL1:def 12;
      then
A5:   S.i=B by FUNCOP_1:7;
      B in Family_open_set(M) by PCOMPS_1:29;
      hence S.i is open by A5;
    end;
    for i holds S.i is bounded by FUNCOP_1:7,ORDINAL1:def 12;
    hence thesis by A2,A4,FUNCT_1:def 9;
  end;
  cluster non-empty pointwise_bounded closed for SetSequence of M;
  existence
  proof
    consider x being object such that
A6: x in the carrier of M by XBOOLE_0:def 1;
    reconsider x as Point of M by A6;
    set B=cl_Ball(x,1);
    take S = NAT --> B;
A7: now
      let y be object;
      assume y in dom S;
      then reconsider n=y as Element of NAT;
A8:   B=S.n by FUNCOP_1:7;
      dist(x,x)=0 by METRIC_1:1;
      hence S.y is non empty by A8,METRIC_1:12;
    end;
A9: now
      let i;
      i in NAT by ORDINAL1:def 12;
      then
A10:  S.i=B by FUNCOP_1:7;
      [#]M\B in Family_open_set(M) by NAGATA_1:14;
      then B` is open;
      hence S.i is closed by A10;
    end;
    now
      let i;
A11:  i in NAT by ORDINAL1:def 12;
      B is bounded by TOPREAL6:59;
      hence S.i is bounded by A11,FUNCOP_1:7;
    end;
    hence thesis by A7,A9,FUNCT_1:def 9;
  end;
end;

theorem Th7:
  for M be MetrStruct for S be SetSequence of M, S9 be SetSequence
of TopSpaceMetr M st S9 = S holds ( S is open iff S9 is open ) & ( S is closed
  iff S9 is closed )
proof
  let M be MetrStruct;
  let S be SetSequence of M, S9 be SetSequence of TopSpaceMetr M such that
A1: S9 = S;
  thus S is open implies S9 is open
  proof
    assume
A2: S is open;
    let i;
    S.i is open by A2;
    hence thesis by A1,Th6;
  end;
  thus S9 is open implies S is open
  proof
    assume
A3: S9 is open;
    let i;
    S9.i is open by A3;
    hence thesis by A1,Th6;
  end;
  thus S is closed implies S9 is closed
  proof
    assume
A4: S is closed;
    let i;
    S.i is closed by A4;
    hence thesis by A1,Th6;
  end;
  assume
A5: S9 is closed;
  let i;
  S9.i is closed by A5;
  hence thesis by A1,Th6;
end;

theorem Th8:
  for M be Reflexive symmetric triangle non empty MetrStruct for S,
CL be Subset of M st S is bounded for S9 be Subset of TopSpaceMetr M st S = S9
  & CL = Cl S9 holds CL is bounded & diameter S = diameter CL
proof
  let M be Reflexive symmetric triangle non empty MetrStruct;
  let S,CL be Subset of M such that
A1: S is bounded;
  set d=diameter S;
  set T=TopSpaceMetr M;
  let S9 be Subset of T such that
A2: S = S9 and
A3: CL = Cl S9;
  per cases;
  suppose
A4: S<>{};
A5: now
      let x,y be Point of M such that
A6:   x in CL and
A7:   y in CL;
      reconsider X=x,Y=y as Point of T;
      set dxy=dist(x,y);
      set dd=dxy-d;
      set dd2=dd/2;
      set Bx=Ball(x,dd2);
      set By=Ball(y,dd2);
      reconsider BX=Bx,BY=By as Subset of T;
      assume dist(x,y) > d;
      then dd > d-d by XREAL_1:14;
      then
A8:   dd2>0/2 by XREAL_1:74;
      By in Family_open_set M by PCOMPS_1:29;
      then
A9:   BY is open by PRE_TOPC:def 2;
      Bx in Family_open_set M by PCOMPS_1:29;
      then
A10:  BX is open by PRE_TOPC:def 2;
      dist(y,y)=0 by METRIC_1:1;
      then Y in BY by A8,METRIC_1:11;
      then BY meets S9 by A3,A7,A9,TOPS_1:12;
      then consider y1 be object such that
A11:  y1 in BY and
A12:  y1 in S9 by XBOOLE_0:3;
      dist(x,x)=0 by METRIC_1:1;
      then X in BX by A8,METRIC_1:11;
      then BX meets S9 by A3,A6,A10,TOPS_1:12;
      then consider x1 be object such that
A13:  x1 in BX and
A14:  x1 in S9 by XBOOLE_0:3;
      reconsider x1,y1 as Point of M by A13,A11;
A15:  dist(x,x1)<dd2 by A13,METRIC_1:11;
      dist(x1,y1)<=d by A1,A2,A14,A12,TBSP_1:def 8;
      then
A16:  dist(x,x1)+dist(x1,y1)<dd2+ d by A15,XREAL_1:8;
A17:  dist(y,y1)<dd2 by A11,METRIC_1:11;
      dist(x,y1)<=dist(x,x1)+dist(x1,y1) by METRIC_1:4;
      then dist(x,y1)<dd2+d by A16,XXREAL_0:2;
      then dist(x,y1)+dist(y1,y)< dd2+d+ dd2 by A17,XREAL_1:8;
      hence contradiction by METRIC_1:4;
    end;
A18: now
A19:  d+0<d+1 by XREAL_1:8;
      let x,y be Point of M such that
A20:  x in CL and
A21:  y in CL;
      dist(x,y)<=d by A5,A20,A21;
      hence dist(x,y) <= d+1 by A19,XXREAL_0:2;
    end;
A22: now
      let s such that
A23:  for x,y be Point of M st x in CL & y in CL holds dist(x,y)<=s;
      now
        let x,y be Point of M such that
A24:    x in S and
A25:    y in S;
        S c= CL by A2,A3,PRE_TOPC:18;
        hence dist(x,y)<=s by A23,A24,A25;
      end;
      hence d <= s by A1,A4,TBSP_1:def 8;
    end;
A26: CL<>{} by A2,A3,A4,PCOMPS_1:2;
    d+1>0+0 by A1,TBSP_1:21,XREAL_1:8;
    then CL is bounded by A18;
    hence thesis by A26,A5,A22,TBSP_1:def 8;
  end;
  suppose
    S={};
    hence thesis by A2,A3,PCOMPS_1:2;
  end;
end;

begin :: Cantor's theorem on complete spaces

theorem Th9:
  for M be non empty MetrSpace for C be sequence of M ex S be
non-empty closed SetSequence of M st S is non-ascending & ( C is Cauchy implies
S is pointwise_bounded & lim diameter S = 0 ) &
for i ex U be Subset of TopSpaceMetr M st
  U = { C.j where j is Nat: j >= i } & S.i = Cl U
proof
  let M be Reflexive symmetric triangle non empty MetrSpace;
  set T=TopSpaceMetr(M);
  let C be sequence of M;
  defpred P[object,object] means
for i st i=$1 ex S be Subset of T st S={C.j where j
  is Nat: j >= i} & $2=Cl S;
A1: for x being object st x in NAT
   ex y being object st y in bool the carrier of M & P[x,y]
  proof
    let x be object;
    assume x in NAT;
    then reconsider x9=x as Nat;
    set S={C.j where j is Nat: j >= x9};
    S c= the carrier of T
    proof
      let y be object;
      assume y in S;
      then ex j be Nat st C.j=y & j>=x9;
      hence thesis;
    end;
    then reconsider S as Subset of T;
    take Cl S;
    thus thesis;
  end;
  consider S be SetSequence of M such that
A2: for x being object st x in NAT holds P[x,S.x] from FUNCT_2:sch 1(A1);
A3: now
    let x be object;
    assume x in dom S;
    then reconsider i=x as Element of NAT;
    consider U be Subset of T such that
A4: U={C.j where j is Nat: j >= i} and
A5: S.i=Cl U by A2;
A6: U c= S.i by A5,PRE_TOPC:18;
    C.i in U by A4;
    hence S.x is non empty by A6;
  end;
  now
    let i;
    i in NAT by ORDINAL1:def 12;
    then
    ex U be Subset of T st U={C.j where j is Nat: j >= i} & S.
    i=Cl U by A2;
    hence S.i is closed by Th6;
  end;
  then reconsider S as non-empty closed SetSequence of M by A3,Def8,
FUNCT_1:def 9;
  take S;
  now
    let i be Nat;
    i in NAT by ORDINAL1:def 12;
    then consider U be Subset of T such that
A7: U={C.j where j is Nat: j >= i} and
A8: S.i=Cl U by A2;
    consider U1 be Subset of T such that
A9: U1={C.j where j is Nat: j >= i+1} and
A10: S.(i+1)=Cl U1 by A2;
    U1 c= U
    proof
      let x be object;
      assume x in U1;
      then consider j be Nat such that
A11:  x=C.j and
A12:  j>=i+1 by A9;
      j>= i by A12,NAT_1:13;
      hence thesis by A7,A11;
    end;
    hence S.(i+1) c= S.i by A8,A10,PRE_TOPC:19;
  end;
  hence
A13: S is non-ascending by KURATO_0:def 3;
  thus C is Cauchy implies S is pointwise_bounded & lim diameter S = 0
  proof
    assume
A14: C is Cauchy;
A15: now
      let i;
      i in NAT by ORDINAL1:def 12;
      then consider U be Subset of T such that
A16:  U={C.j where j is Nat: j >= i} and
A17:  S.i=Cl U by A2;
      reconsider U9=U as Subset of M;
      U c= rng C
      proof
        let x be object;
        assume x in U;
        then consider j be Nat such that
A18:     x=C.j & j>=i by A16;
A19:     j in NAT by ORDINAL1:def 12;
        dom C=NAT by FUNCT_2:def 1;
        hence thesis by A18,FUNCT_1:def 3,A19;
      end;
      then U9 is bounded by A14,TBSP_1:14,26;
      hence S.i is bounded by A17,Th8;
    end;
    then reconsider S9=S as non-empty pointwise_bounded closed SetSequence of M
    by Def1;
    set d=diameter S9;
A20: for r be Real st 0<r ex n be Nat st for m be
    Nat st n<=m holds |.d.m-0 .|<r
    proof
      let r be Real such that
A21:  0<r;
      reconsider R=r as Real;
      set R2=R/2;
      R2>0 by A21,XREAL_1:139;
      then consider p be Nat such that
A22:  for n,m be Nat st p<=n & p<=m holds dist(C.n,C.m)<R2
      by A14;
      take p;
      let m be Nat such that
A23:  p<=m;
      m in NAT by ORDINAL1:def 12;
      then consider U be Subset of T such that
A24:  U={C.j where j is Nat: j >= m} and
A25:  S.m=Cl U by A2;
      reconsider U9=U as Subset of M;
A26:  now
        let x,y being Point of M such that
A27:    x in U9 and
A28:    y in U9;
        consider j be Nat such that
A29:    y=C.j and
A30:    j>=m by A24,A28;
A31:    j>=p by A23,A30,XXREAL_0:2;
        consider i be Nat such that
A32:    x = C.i and
A33:    i>=m by A24,A27;
        i>=p by A23,A33,XXREAL_0:2;
        hence dist(x,y)<=R2 by A22,A32,A29,A31;
      end;
A34:  U c= rng C
      proof
        let x be object;
        assume x in U;
        then consider j be Nat such that
A35:     x=C.j & j>=m by A24;
A36:     j in NAT by ORDINAL1:def 12;
        dom C=NAT by FUNCT_2:def 1;
        hence thesis by A35,FUNCT_1:def 3,A36;
      end;
      then
A37:  U9 is bounded by A14,TBSP_1:14,26;
      then
A38:  diameter U9=diameter S.m by A25,Th8;
      C.m in U by A24;
      then
A39:  diameter U9<=R2 by A37,A26,TBSP_1:def 8;
      rng C is bounded by A14,TBSP_1:26;
      then diameter S.m>=0 by A34,A38,TBSP_1:14,21;
      then
A40:  |.diameter S.m.|<=R2 by A39,A38,ABSVALUE:def 1;
      R2<R by A21,XREAL_1:216;
      then |.diameter S.m.|<R by A40,XXREAL_0:2;
      hence thesis by Def2;
    end;
    thus S is pointwise_bounded by A15;
A41: d is bounded_below by Th1;
    d is non-increasing by A13,Th2;
    hence thesis by A41,A20,SEQ_2:def 7;
  end;
  let i;
  i in NAT by ORDINAL1:def 12;
  hence thesis by A2;
end;

theorem Th10:
  for M be non empty MetrSpace holds M is complete iff for S be
non-empty pointwise_bounded closed SetSequence of M st S is non-ascending &
lim diameter S = 0 holds meet S is non empty
proof
  let M be non empty MetrSpace;
  set T=TopSpaceMetr(M);
  thus M is complete implies
  for S be non-empty pointwise_bounded closed SetSequence of
  M st S is non-ascending & lim diameter S = 0 holds meet S is non empty
  proof
    assume
A1: M is complete;
    let S be non-empty pointwise_bounded closed SetSequence of M such that
A2: S is non-ascending and
A3: lim diameter S = 0;
    defpred P[object,object] means $2 in S.$1;
   :: Funkcja Kuratowskiego !!!
A4: for x being object st x in NAT
ex y being object st y in the carrier of M & P[x,y]
    proof
A5:   dom S=NAT by FUNCT_2:def 1;
      let x being object such that
A6:   x in NAT;
      S.x is non empty by A6,A5,FUNCT_1:def 9;
      then
A7:   ex y being object st y in S.x by XBOOLE_0:def 1;
      S.x in rng S by A6,A5,FUNCT_1:def 3;
      hence thesis by A7;
    end;
    consider F be sequence of the carrier of M such that
A8: for x being object st x in NAT holds P[x,F.x] from FUNCT_2:sch 1(A4);
    for i holds F.i in S.i by A8,ORDINAL1:def 12;
    then F is Cauchy by A2,A3,Th4;
    then F is convergent by A1;
    then consider x be Point of M such that
A9: F is_convergent_in_metrspace_to x by METRIC_6:10;
    reconsider F9 = F as sequence of T;
    reconsider x9 = x as Point of T;
    now
      let i be Nat;
      set F1=F9^\i;
      reconsider Si=S.i as Subset of T;
A10:  rng F1 c= Si
      proof
        let x be object;
        assume x in rng F1;
        then consider y being object such that
A11:    y in dom F1 and
A12:    F1.y=x by FUNCT_1:def 3;
        reconsider y as Element of NAT by A11;
        i<=y+i by NAT_1:11;
        then
A13:    S.(y+i) c= S.i by A2,PROB_1:def 4;
A14:     y+i in NAT by ORDINAL1:def 12;
        x=F.(y+i) by A12,NAT_1:def 3;
        then x in S.(y+i) by A8,A14;
        hence thesis by A13;
      end;
      F9 is_convergent_to x9 by A9,FRECHET2:28;
      then F1 is_convergent_to x9 by FRECHET2:15;
      then
A15:  x in Lim F1 by FRECHET:def 5;
      S.i is closed by Def8;
      then Si is closed by Th6;
      then Lim F1 c= Si by A10,FRECHET2:9;
      hence x in S.i by A15;
    end;
    hence thesis by KURATO_0:3;
  end;
  assume
A16: for S be non-empty pointwise_bounded closed SetSequence of M st S is
  non-ascending & lim diameter S = 0 holds meet S is non empty;
  let F be sequence of M such that
A17: F is Cauchy;
  consider S be non-empty closed SetSequence of M such that
A18: S is non-ascending and
A19: F is Cauchy implies S is pointwise_bounded & lim diameter S = 0 and
A20: for i ex U be Subset of T st U={ F.j where j is Nat:j >=
  i} & S.i = Cl U by Th9;
  set d=diameter S;
A21: d is non-increasing by A17,A18,A19,Th2;
  meet S is non empty by A16,A17,A18,A19;
  then consider x being object such that
A22: x in meet S by XBOOLE_0:def 1;
A23: d is bounded_below by A17,A19,Th1;
  reconsider x as Point of M by A22;
  take x;
  let r;
  assume r>0;
  then consider n be Nat such that
A24: for m be Nat st n<=m holds |.d.m-0 .|<r by A17,A19,A23,A21,
SEQ_2:def 7;
  take n;
  let m be Nat;
  assume n<=m;
  then
A25: |.d.m-0 .|<r by A24;
A26: S.m is bounded by A17,A19;
A27: x in S.m by A22,KURATO_0:3;
A28: diameter (S.m)=d.m by Def2;
  consider U be Subset of T such that
A29: U = { F.j where j is Nat: j >= m } and
A30: S.m = Cl U by A20;
A31: U c= Cl U by PRE_TOPC:18;
  F.m in U by A29;
  then
A32: dist(F.m,x) <= diameter (S.m) by A30,A31,A27,A26,TBSP_1:def 8;
  diameter (S.m)>=0 by A26,TBSP_1:21;
  then d.m <r by A28,A25,ABSVALUE:def 1;
  hence thesis by A32,A28,XXREAL_0:2;
end;

theorem Th11:
  for T be non empty TopSpace for S be non-empty SetSequence of T
  st S is non-ascending for F be Subset-Family of T st F = rng S holds F is
  centered
proof
  let T be non empty TopSpace;
  let S be non-empty SetSequence of T such that
A1: S is non-ascending;
  let F be Subset-Family of T such that
A2: F = rng S;
A3: now
    defpred P[object,object] means $1=S.$2;
  :: !!!
    let G be set such that
A4: G <> {} and
A5: G c= F and
A6: G is finite;
A7: for x being object st x in G ex y being object st y in NAT & P[x,y]
    proof
      let x be object;
      assume x in G;
      then ex y being object st y in dom S & S.y=x by A2,A5,FUNCT_1:def 3;
      hence thesis;
    end;
    consider f be Function of G,NAT such that
A8: for x being object st x in G holds P[x,f.x] from FUNCT_2:sch 1(A7);
    consider i be Nat such that
A9: for j be Nat st j in rng f holds j<=i by A6,STIRL2_1:56;
A10:  i in NAT by ORDINAL1:def 12;
    dom S=NAT by FUNCT_2:def 1;
    then S.i<>{} by A10,FUNCT_1:def 9;
    then consider x being object such that
A11: x in S.i by XBOOLE_0:def 1;
A12: dom f=G by FUNCT_2:def 1;
    now
      let Y be set;
      assume
A13:  Y in G;
      then
A14:  f.Y in rng f by A12,FUNCT_1:def 3;
      reconsider fY=f.Y as Nat;
A15:  fY <= i by A9,A14;
      Y=S.fY by A8,A13;
      then S.i c= Y by A1,A15,PROB_1:def 4;
      hence x in Y by A11;
    end;
    hence meet G<>{} by A4,SETFAM_1:def 1;
  end;
  dom S=NAT by FUNCT_2:def 1;
  then F<>{} by A2,RELAT_1:42;
  hence thesis by A3,FINSET_1:def 3;
end;

theorem Th12:
  for M be non empty MetrStruct for S be SetSequence of M for F be
  Subset-Family of TopSpaceMetr M st F = rng S holds ( S is open implies F is
  open ) & ( S is closed implies F is closed )
proof
  let M be non empty MetrStruct;
  let S be SetSequence of M;
  set T=TopSpaceMetr(M);
  let F be Subset-Family of T such that
A1: F = rng S;
  thus S is open implies F is open
  proof
    assume
A2: S is open;
    let P be Subset of T;
    assume P in F;
    then consider x being object such that
A3: x in dom S and
A4: S.x=P by A1,FUNCT_1:def 3;
    reconsider x as Nat by A3;
    S.x is open by A2;
    hence thesis by A4,Th6;
  end;
  assume
A5: S is closed;
  let P be Subset of T;
  assume P in F;
  then consider x being object such that
A6: x in dom S and
A7: S.x=P by A1,FUNCT_1:def 3;
  reconsider x as Nat by A6;
  S.x is closed by A5;
  hence thesis by A7,Th6;
end;

theorem Th13:
  for T be non empty TopSpace for F be Subset-Family of T for S be
SetSequence of T st rng S c= F ex R be SetSequence of T st R is non-ascending &
( F is centered implies R is non-empty ) & ( F is open implies R is open ) & (
  F is closed implies R is closed ) &
for i holds R.i = meet {S.j where j is  Element of NAT: j <= i}
proof
  let T be non empty TopSpace;
  let F be Subset-Family of T;
  let S be SetSequence of T such that
A1: rng S c= F;
A2: for i holds {S.j where j is Element of NAT: j <= i} c= F
  proof
    let i;
    let x be object;
    assume x in {S.j where j is Element of NAT : j <= i};
    then consider j be Element of NAT such that
A3:  x=S.j & j<=i;
    dom S=NAT by FUNCT_2:def 1;
    then x in rng S by A3,FUNCT_1:def 3;
    hence thesis by A1;
  end;
  defpred P[object,object] means
for i st i=$1 holds $2=meet {S.j where j is Element
  of NAT:j<=i};
A4: for x being object st x in NAT
  ex y being object st y in bool(the carrier of T) & P[x,y]
  proof
    let x be object;
    assume x in NAT;
    then reconsider i=x as Element of NAT;
    set SS={S.j where j is Element of NAT:j<=i};
    SS c= F by A2;
    then reconsider SS as Subset-Family of T by XBOOLE_1:1;
    take meet SS;
    thus thesis;
  end;
  consider R be SetSequence of T such that
A5: for x being object st x in NAT holds P[x,R.x] from FUNCT_2:sch 1(A4);
  take R;
  now
    let i be Nat;
A6:  i in NAT by ORDINAL1:def 12;
    set SS={S.j where j is Element of NAT:j<=i};
    set S1={S.j where j is Element of NAT:j<=i+1};
A7: SS c= S1
    proof
      let x be object;
      assume x in SS;
      then consider j be Element of NAT such that
A8:   x=S.j and
A9:   j<=i;
      j<=i+1 by A9,NAT_1:13;
      hence thesis by A8;
    end;
A10: meet SS=R.i by A5,A6;
    S.0 in SS;
    then meet S1 c= meet SS by A7,SETFAM_1:6;
    hence R.(i+1) c= R.i by A5,A10;
  end;
  hence R is non-ascending by KURATO_0:def 3;
A11: for i holds {S.j where j is Element of NAT:j<=i} is finite
  proof
    deffunc F(set)=S.$1;
    let i;
    set SS={S.j where j is Element of NAT:j<=i};
A12: SS c= {F(j)where j is Element of NAT:j in i+1}
    proof
      let x be object;
      assume x in SS;
      then consider j be Element of NAT such that
A13:  x=S.j and
A14:  j<=i;
      j<i+1 by A14,NAT_1:13;
      then j in Segm(i+1) by NAT_1:44;
      hence thesis by A13;
    end;
A15: i+1 is finite;
    {F(j)where j is Element of NAT:j in i+1} is finite from FRAENKEL:sch
    21(A15);
    hence thesis by A12;
  end;
  thus F is centered implies R is non-empty
  proof
    assume
A16: F is centered;
    now
      let x be object;
      assume x in dom R;
      then reconsider i=x as Element of NAT;
      set SS={S.j where j is Element of NAT:j<=i};
A17:  S.0 in SS;
A18:  SS c= F by A2;
      SS is finite by A11;
      then meet SS<>{} by A16,A17,A18,FINSET_1:def 3;
      hence R.x is non empty by A5;
    end;
    hence thesis by FUNCT_1:def 9;
  end;
  thus F is open implies R is open
  proof
    assume
A19: F is open;
    let i;
    set SS={S.j where j is Element of NAT:j<=i};
A20: SS c= F by A2;
    then reconsider SS as Subset-Family of T by XBOOLE_1:1;
    SS is finite by A11;
    then
A21: meet SS is open by A19,A20,TOPS_2:11,20;
    i in NAT by ORDINAL1:def 12;
    hence thesis by A5,A21;
  end;
  thus F is closed implies R is closed
  proof
    assume
A22: F is closed;
    let i;
    set SS={S.j where j is Element of NAT:j<=i};
A23: i in NAT by ORDINAL1:def 12;
A24: SS c= F by A2;
    then reconsider SS as Subset-Family of T by XBOOLE_1:1;
    meet SS is closed by A22,A24,TOPS_2:12,22;
    hence thesis by A5,A23;
  end;
  let i;
  i in NAT by ORDINAL1:def 12;
  hence thesis by A5;
end;

theorem
  for M be non empty MetrSpace holds M is complete iff for F be
Subset-Family of TopSpaceMetr M st F is closed & F is centered &
 for r be Real
  st r > 0 ex A be Subset of M st A in F & A is bounded & diameter A < r holds
  meet F is non empty
proof
  let M be non empty MetrSpace;
  set T=TopSpaceMetr(M);
  thus M is complete implies for F be Subset-Family of T st F is closed & F is
centered & for r st r>0 ex A be Subset of M st A in F & A is bounded & diameter
  A < r holds meet F is non empty
  proof
    reconsider NULL=0 as Real;
    deffunc F(Nat)=1/(1+$1);
    assume
A1: M is complete;
    consider seq be Real_Sequence such that
A2: for n be Nat holds seq.n=F(n) from SEQ_1:sch 1;
    set Ns=NULL(#)seq;
    let F be Subset-Family of T such that
A3: F is closed and
A4: F is centered and
A5: for r st r>0 ex A be Subset of M st A in F & A is bounded & diameter A<r;
A6: for n be Nat holds seq.n=1/(n+1) by A2;
    then
A7: Ns is convergent by SEQ_2:7,SEQ_4:31;
    defpred P[object,object] means
for i st i=$1 for A be Subset of M st A=$2 holds
    A in F & A is bounded & diameter A <1/(i+1);
A8: for x being object st x in NAT
ex y being object st y in bool(the carrier of M) & P[x,y]
    proof
      let x be object;
      assume x in NAT;
      then reconsider i=x as Nat;
      consider A be Subset of M such that
A9:   A in F and
A10:  A is bounded and
A11:  diameter A < 1/(i+1) by A5,XREAL_1:139;
      take A;
      thus thesis by A9,A10,A11;
    end;
    consider f be SetSequence of M such that
A12: for x being object st x in NAT holds P[x,f.x] from FUNCT_2:sch 1(A8);
    rng f c= F
    proof
      let x be object;
      assume x in rng f;
      then consider y being object such that
A13:  y in dom f and
A14:  f.y=x by FUNCT_1:def 3;
      reconsider y as Element of NAT by A13;
      f.y in F by A12;
      hence thesis by A14;
    end;
    then consider R be SetSequence of T such that
A15: R is non-ascending and
A16: F is centered implies R is non-empty and
    F is open implies R is open and
A17: F is closed implies R is closed and
A18: for i holds R.i = meet {f.j where j is Element of NAT: j<=i} by Th13;
    reconsider R9=R as non-empty SetSequence of M by A4,A16;
    now
      let i;
      f.0 in {f.j where j is Element of NAT: j <= i};
      then meet {f.j where j is Element of NAT: j <= i} c= f.0 by SETFAM_1:3;
      then R.i c= f.0 by A18;
      hence R9.i is bounded by A12,TBSP_1:14;
    end;
    then reconsider R9 as non-empty pointwise_bounded SetSequence of M by Def1;
    set dR=diameter R9;
A19: now
      let n be Nat;
A20:    n in NAT by ORDINAL1:def 12;
      set Sn={f.j where j is Element of NAT:j<=n};
A21:  f.n in Sn by A20;
      R.n=meet Sn by A18;
      then
A22:  R.n c= f.n by A21,SETFAM_1:3;
      then diameter R9.n <= diameter f.n by A12,TBSP_1:24,A20;
      then
A23:  diameter R9.n <= F(n) by A12,XXREAL_0:2,A20;
      f.n is bounded by A12,A20;
      then
A24:  0<= diameter R9.n by A22,TBSP_1:14,21;
A25:  Ns.n=NULL*seq.n by SEQ_1:9;
      F(n)=seq.n by A2;
      hence Ns.n <= dR.n & dR.n<=seq.n by A24,A23,A25,Def2;
    end;
A26: lim seq=0 by A6,SEQ_4:31;
    then
A27: lim Ns=NULL*0 by A6,SEQ_2:8,SEQ_4:31;
A28: seq is convergent by A6,SEQ_4:31;
    then
A29: lim dR=0 by A26,A7,A27,A19,SEQ_2:20;
A30: R9 is closed by A3,A17,Th7;
    then meet R9<>{} by A1,A15,A29,Th10;
    then consider x0 be object such that
A31: x0 in meet R9 by XBOOLE_0:def 1;
    reconsider x0 as Point of M by A31;
A32: dR is convergent by A28,A26,A7,A27,A19,SEQ_2:19;
A33: now
      let y;
      assume
A34:  y in F;
      then reconsider Y=y as Subset of T;
      defpred P9[object,object] means
       for i st i=$1 holds $2=R.i/\Y;
A35:  for x being object st x in NAT
ex z be object st z in bool(the carrier of M) & P9[x ,z]
      proof
        let x be object;
        assume x in NAT;
        then reconsider i=x as Nat;
        take R.i/\Y;
        thus thesis;
      end;
      consider f9 be SetSequence of M such that
A36:  for x being object st x in NAT holds P9[x,f9.x] from FUNCT_2:sch 1(A35);
A37:  now
        deffunc F(object)=f.$1;
        let x be object;
        assume x in dom f9;
        then reconsider i=x as Element of NAT;
        set SS={f.j where j is Element of NAT:j<=i};
A38:    f.i in SS;
A39:    SS c= {F(j) where j is Element of NAT:j in i+1}
        proof
          let x be object;
          assume x in SS;
          then consider j be Element of NAT such that
A40:      x=f.j and
A41:      j<=i;
          j<i+1 by A41,NAT_1:13;
          then j in Segm(i+1) by NAT_1:44;
          hence thesis by A40;
        end;
A42:    {Y}\/SS c= F
        proof
          let z be object such that
A43:      z in {Y}\/SS;
          per cases by A43,XBOOLE_0:def 3;
          suppose
            z in {Y};
            hence thesis by A34,TARSKI:def 1;
          end;
          suppose
            z in SS;
            then ex j be Element of NAT st z=f.j & j<=i;
            hence thesis by A12;
          end;
        end;
A44:    i+1 is finite;
        {F(j)where j is Element of NAT:j in i+1} is finite from FRAENKEL:
        sch 21(A44);
        then meet({Y}\/SS)<>{} by A4,A42,A39,FINSET_1:def 3;
        then meet {Y} /\ meet SS <> {} by A38,SETFAM_1:9;
        then Y /\meet SS<>{} by SETFAM_1:10;
        then Y/\R.i<>{} by A18;
        hence f9.x is non empty by A36;
      end;
A45:  now
        let i;
        reconsider Ri=R.i as Subset of T;
        i in NAT by ORDINAL1:def 12;
        then
A46:    f9.i=Ri/\Y by A36;
        R9.i is closed by A30;
        then
A47:    Ri is closed by Th6;
        Y is closed by A3,A34;
        hence f9.i is closed by A47,A46,Th6;
      end;
      now
        let i;
        i in NAT by ORDINAL1:def 12;
        then
A48:    f9.i=R9.i /\ Y by A36;
        R9.i is bounded by Def1;
        hence f9.i is bounded by A48,TBSP_1:14,XBOOLE_1:17;
      end;
      then reconsider f9 as non-empty pointwise_bounded closed SetSequence of M
      by A37,A45,Def1,Def8,FUNCT_1:def 9;
A49:  f9.0=R.0/\Y by A36;
      set df=diameter f9;
      now
        reconsider Y9=Y as Subset of M;
        let n be Nat;
A50:    Ns.n=NULL*seq.n by SEQ_1:9;
        n in NAT by ORDINAL1:def 12;
        then
A51:    R.n/\Y9=f9.n by A36;
A52:    R9.n is bounded by Def1;
        then diameter f9.n <= diameter R9.n by A51,TBSP_1:24,XBOOLE_1:17;
        then
A53:    diameter f9.n <= dR.n by Def2;
        R.n/\Y c= R.n by XBOOLE_1:17;
        then 0<=diameter f9.n by A52,A51,TBSP_1:14,21;
        hence Ns.n <= df.n & df.n<=dR.n by A53,A50,Def2;
      end;
      then
A54:  lim df=0 by A7,A27,A32,A29,SEQ_2:20;
      now
        let i be Nat;
     i in NAT by ORDINAL1:def 12;
        then
A55:    f9.i = R.i/\Y by A36;
A56:    R.(i+1) c= R.i by A15,KURATO_0:def 3;
        f9.(i+1) =R.(i+1)/\Y by A36;
        hence f9.(i+1) c= f9.i by A55,A56,XBOOLE_1:26;
      end;
      then f9 is non-ascending by KURATO_0:def 3;
      then meet f9<>{} by A1,A54,Th10;
      then consider z be object such that
A57:  z in meet f9 by XBOOLE_0:def 1;
      reconsider z as Point of M by A57;
A58:  x0 = z
      proof
        assume x0<>z;
        then dist(x0,z)<>0 by METRIC_1:2;
        then dist(x0,z)>0 by METRIC_1:5;
        then consider i be Nat such that
A59:    for j be Nat st i<=j holds |.dR.j-0.|<dist(x0,z)
        by A32,A29,SEQ_2:def 7;
A60:     i in NAT by ORDINAL1:def 12;
A61:    f9.i=R.i/\Y by A36,A60;
        z in f9.i by A57,KURATO_0:3;
        then
A62:    z in R.i by A61,XBOOLE_0:def 4;
A63:    R9.i is bounded by Def1;
        then
A64:    0<=diameter (R9.i) by TBSP_1:21;
        x0 in R.i by A31,KURATO_0:3;
        then dist(x0,z)<=diameter (R9.i) by A62,A63,TBSP_1:def 8;
        then
A65:    |.diameter (R9.i).|>=dist(x0,z) by A64,ABSVALUE:def 1;
        |.dR.i-0.|<dist(x0,z) by A59;
        hence thesis by A65,Def2;
      end;
      z in f9.0 by A57,KURATO_0:3;
      hence x0 in y by A58,A49,XBOOLE_0:def 4;
    end;
    F<>{} by A4,FINSET_1:def 3;
    hence thesis by A33,SETFAM_1:def 1;
  end;
  assume
A66: for F be Subset-Family of T st F is closed & F is centered & for r
st r > 0 ex A be Subset of M st A in F & A is bounded&diameter A<r holds meet F
  is non empty;
  now
    let S be non-empty pointwise_bounded closed SetSequence of M such that
A67: S is non-ascending and
A68: lim diameter S = 0;
    reconsider RS=rng S as Subset-Family of T;
A69: now
      set d=diameter S;
A70:  dom S=NAT by FUNCT_2:def 1;
A71:  d is bounded_below by Th1;
A72:  d is non-increasing by A67,Th2;
      let r;
      assume r > 0;
      then consider n be Nat such that
A73:  for m be Nat st n<=m holds |.d.m-0 .|<r by A68,A71,A72,
SEQ_2:def 7;
       reconsider nn=n as Element of NAT by ORDINAL1:def 12;
      take Sn=S.nn;
A74:  d.n=diameter Sn by Def2;
      Sn is bounded by Def1;
      then
A75:  diameter Sn>=0 by TBSP_1:21;
      |.d.n-0 .|<r by A73;
      hence Sn in RS & Sn is bounded & diameter Sn <r by A74,A75,A70,Def1,
ABSVALUE:def 1,FUNCT_1:def 3;
    end;
    RS is closed by Th12;
    then meet RS is non empty by A66,A67,A69,Th11;
    then consider x being object such that
A76: x in meet RS by XBOOLE_0:def 1;
    now
      let i be Nat;
A77:     i in NAT by ORDINAL1:def 12;
      dom S=NAT by FUNCT_2:def 1;
      then S.i in RS by FUNCT_1:def 3,A77;
      hence x in S.i by A76,SETFAM_1:def 1;
    end;
    hence meet S is non empty by KURATO_0:3;
  end;
  hence thesis by Th10;
end;

theorem Th15:
  for M be non empty MetrSpace,A be non empty Subset of M for B be
Subset of M, B9 be Subset of M|A st B = B9 holds B9 is bounded iff B is bounded
proof
  let M be non empty MetrSpace,A be non empty Subset of M;
  let B be Subset of M, B9 be Subset of M|A such that
A1: B = B9;
  thus B9 is bounded implies B is bounded by A1,HAUSDORF:17;
  assume
A2: B is bounded;
  per cases;
  suppose
    B9={}(M|A);
    hence thesis;
  end;
  suppose
    B9<>{}(M|A);
    then consider p be object such that
A3: p in B9 by XBOOLE_0:def 1;
    reconsider p as Point of (M|A) by A3;
A4: now
      let q be Point of (M|A) such that
A5:   q in B9;
      reconsider p9=p,q9=q as Point of M by TOPMETR:8;
A6:   dist(p,q) = dist(p9,q9) by TOPMETR:def 1;
A7:   diameter B+0<=diameter B+1 by XREAL_1:8;
      dist(p9,q9)<=diameter B by A1,A2,A3,A5,TBSP_1:def 8;
      hence dist(p,q)<=diameter B+1 by A6,A7,XXREAL_0:2;
    end;
    0+0 < diameter B+1 by A2,TBSP_1:21,XREAL_1:8;
    hence thesis by A4,TBSP_1:10;
  end;
end;

theorem Th16:
  for M be non empty MetrSpace,A be non empty Subset of M for B be
Subset of M, B9 be Subset of M|A st B = B9 & B is bounded holds diameter B9 <=
  diameter B
proof
  let M be non empty MetrSpace,A be non empty Subset of M;
  let B be Subset of M, B9 be Subset of M|A such that
A1: B = B9 and
A2: B is bounded;
A3: B9 is bounded by A1,A2,Th15;
  per cases;
  suppose
A4: B9={}(M|A);
    then diameter B9=0 by TBSP_1:def 8;
    hence thesis by A1,A4,TBSP_1:def 8;
  end;
  suppose
A5: B9<>{}(M|A);
    now
      let x,y be Point of (M|A) such that
A6:   x in B9 and
A7:   y in B9;
      reconsider x9=x,y9=y as Point of M by TOPMETR:8;
      dist(x,y) = dist(x9,y9) by TOPMETR:def 1;
      hence dist(x,y)<=diameter B by A1,A2,A6,A7,TBSP_1:def 8;
    end;
    hence thesis by A3,A5,TBSP_1:def 8;
  end;
end;

theorem Th17:
  for M be non empty MetrSpace, A be non empty Subset of M for S
  be sequence of (M|A) holds S is sequence of M
proof
  let M be non empty MetrSpace, A be non empty Subset of M;
  let S be sequence of (M|A);
  A c= the carrier of M;
  then the carrier of (M|A) c= the carrier of M by TOPMETR:def 2;
  hence thesis by FUNCT_2:7;
end;

theorem Th18:
  for M be non empty MetrSpace, A be non empty Subset of M for S
be sequence of (M|A),S9 be sequence of M st S = S9 holds S9 is Cauchy iff S is
  Cauchy
proof
  let M be non empty MetrSpace, A be non empty Subset of M;
  let S be sequence of (M|A),S9 be sequence of M such that
A1: S = S9;
  thus S9 is Cauchy implies S is Cauchy
  proof
    assume
A2: S9 is Cauchy;
    let r;
    assume r>0;
    then consider p be Nat such that
A3: 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
A4: p<=n and
A5: p<=m;
    dist(S.n,S.m) = dist(S9.n,S9.m) by A1,TOPMETR:def 1;
    hence thesis by A3,A4,A5;
  end;
  assume
A6: S is Cauchy;
  let r;
  assume r>0;
  then consider p be Nat such that
A7: for n,m be Nat st p<=n & p<=m holds dist(S.n,S.m)<r by A6;
  take p;
  let n,m be Nat such that
A8: p <= n and
A9: p <= m;
  dist(S.n,S.m) = dist(S9.n,S9.m) by A1,TOPMETR:def 1;
  hence thesis by A7,A8,A9;
end;

theorem
  for M be non empty MetrSpace st M is complete for A be non empty
Subset of M, A9 be Subset of TopSpaceMetr M st A = A9 holds M|A is complete iff
  A9 is closed
proof
  let M be non empty MetrSpace such that
A1: M is complete;
  set T=TopSpaceMetr(M);
  let A be non empty Subset of M, A9 be Subset of TopSpaceMetr(M) such that
A2: A = A9;
  set MA=M|A;
  set TA=TopSpaceMetr(MA);
  thus MA is complete implies A9 is closed
  proof
    assume
A3: MA is complete;
A4: Cl A9 c= A9
    proof
      let p be object such that
A5:   p in Cl A9;
      reconsider p as Point of M by A5;
      defpred P[object,object] means
for i st i=$1 holds $2=A /\ cl_Ball(p,1/(i+1));
A6:   for x being object st x in NAT
ex y being object st y in bool(the carrier of MA) & P[x,y]
      proof
        let x be object;
        assume x in NAT;
        then reconsider i=x as Nat;
        take A/\cl_Ball(p,1/(i+1));
        A/\cl_Ball(p,1/(i+1)) c= A by XBOOLE_1:17;
        then A/\cl_Ball(p,1/(i+1)) c= the carrier of MA by TOPMETR:def 2;
        hence thesis;
      end;
      consider f be SetSequence of MA such that
A7:   for x being object st x in NAT holds P[x,f.x] from FUNCT_2:sch 1(A6);
A8:   now
        let x be object;
        assume x in dom f;
        then reconsider i=x as Element of NAT;
        reconsider B=Ball(p,1/(i+1)) as Subset of T;
        Ball(p,1/(i+1)) in Family_open_set M by PCOMPS_1:29;
        then
A9:     B is open by PRE_TOPC:def 2;
        p in B by TBSP_1:11,XREAL_1:139;
        then B meets A9 by A5,A9,PRE_TOPC:24;
        then consider y being object such that
A10:    y in B and
A11:    y in A9 by XBOOLE_0:3;
        reconsider y as Point of M by A10;
        dist(p,y)< 1/(i+1) by A10,METRIC_1:11;
        then y in cl_Ball(p,1/(i+1)) by METRIC_1:12;
        then y in A/\cl_Ball(p,1/(i+1)) by A2,A11,XBOOLE_0:def 4;
        hence f.x is non empty by A7;
      end;
A12:  now
        let i;
        reconsider cB=cl_Ball(p,1/(i+1)) as Subset of T;
        reconsider fi=f.i as Subset of TA;
A13:    i in NAT by ORDINAL1:def 12;
        [#]M\cB in Family_open_set(M) by NAGATA_1:14;
        then cB` is open by PRE_TOPC:def 2;
        then
A14:    cB is closed by TOPS_1:3;
A15:    TA=T|A9 by A2,HAUSDORF:16;
        then [#](T|A9)=A by TOPMETR:def 2;
        then fi=cB/\[#](T|A9) by A7,A13;
        then fi is closed by A14,A15,PRE_TOPC:13;
        hence f.i is closed by Th6;
      end;
      now
        let i;
        set ACL=A/\cl_Ball(p,1/(i+1));
        cl_Ball(p,1/(i+1)) is bounded by TOPREAL6:59;
        then
A16:    ACL is bounded by TBSP_1:14,XBOOLE_1:17;
        i in NAT by ORDINAL1:def 12;
        then f.i=ACL by A7;
        hence f.i is bounded by A16,Th15;
      end;
      then reconsider f as non-empty pointwise_bounded closed SetSequence of MA
      by A8,A12,Def1,Def8,FUNCT_1:def 9;
      set df=diameter f;
      reconsider NULL=0,TWO=2 as Real;
      deffunc F(Nat)=1/(1+$1);
      consider seq be Real_Sequence such that
A17:  for n be Nat holds seq.n=F(n) from SEQ_1:sch 1;
      now
        let i be Nat;
        set i1=i+1;
        cl_Ball(p,1/(i1+1)) c= cl_Ball(p,1/i1)
        proof
          let x be object such that
A18:      x in cl_Ball(p,1/(i1+1));
          reconsider q=x as Point of M by A18;
          i1<i1+1 by NAT_1:13;
          then
A19:      1/(i1+1)<1/i1 by XREAL_1:76;
          dist(p,q)<=1/(i1+1) by A18,METRIC_1:12;
          then dist(p,q)<=1/i1 by A19,XXREAL_0:2;
          hence thesis by METRIC_1:12;
        end;
        then
A20:    A/\cl_Ball(p,1/(i1+1)) c= A/\cl_Ball(p,1/i1) by XBOOLE_1:26;
        i in NAT by ORDINAL1:def 12;
        then f.i=A/\cl_Ball(p,1/i1) by A7;
        hence f.(i+1) c= f.i by A7,A20;
      end;
      then
A21:  f is non-ascending by KURATO_0:def 3;
      set Ts=TWO(#)seq;
      set Ns=NULL(#)seq;
A22:  for n be Nat holds seq.n=1/(n+1) by A17;
      then
A23:  Ns is convergent by SEQ_2:7,SEQ_4:31;
A24:  now
        let n be Nat;
        set cB=cl_Ball(p,1/(n+1));
A25:    Ns.n=NULL*seq.n by SEQ_1:9;
A26:    Ts.n=TWO*seq.n by SEQ_1:9;
A27:    cB is bounded by TOPREAL6:59;
        then
A28:    A/\cB is bounded by TBSP_1:14,XBOOLE_1:17;
A29:    diameter(A/\cB)<= diameter cB by A27,TBSP_1:24,XBOOLE_1:17;
        diameter cB <= 2*F(n) by Th5;
        then
A30:    diameter(A/\cB)<=2*F(n) by A29,XXREAL_0:2;
        n in NAT by ORDINAL1:def 12;
        then
A31:    f.n=A/\cB by A7;
        then f.n is bounded by A28,Th15;
        then
A32:    0<= diameter f.n by TBSP_1:21;
        diameter (f.n) <= diameter(A/\cB) by A28,A31,Th16;
        then
A33:    diameter f.n <= 2*F(n) by A30,XXREAL_0:2;
        F(n)=seq.n by A17;
        hence Ns.n <= df.n & df.n<=Ts.n by A32,A33,A25,A26,Def2;
      end;
A34:  Ts is convergent by A22,SEQ_2:7,SEQ_4:31;
A35:  lim seq=0 by A22,SEQ_4:31;
      then
A36:  lim Ts= TWO*0 by A22,SEQ_2:8,SEQ_4:31;
      lim Ns=NULL*0 by A22,A35,SEQ_2:8,SEQ_4:31;
      then lim df = 0 by A23,A34,A36,A24,SEQ_2:20;
      then meet f is non empty by A3,A21,Th10;
      then consider q be object such that
A37:  q in meet f by XBOOLE_0:def 1;
      reconsider q as Point of M by A37,TOPMETR:8;
A38:  seq is convergent by A22,SEQ_4:31;
      p = q
      proof
        assume p <> q;
        then dist(p,q)<>0 by METRIC_1:2;
        then dist(p,q)>0 by METRIC_1:5;
        then consider n be Nat such that
A39:    for m be Nat st n<=m holds |.seq.m-0.|<dist(p,q)
        by A38,A35,SEQ_2:def 7;
        set cB=cl_Ball(p,1/(n+1));
A40:    q in f.n by A37,KURATO_0:3;
        n in NAT by ORDINAL1:def 12;
        then f.n = A/\cB by A7;
        then q in cB by A40,XBOOLE_0:def 4;
        then
A41:    dist(p,q) <= F(n) by METRIC_1:12;
        seq.n = F(n) by A17;
        then |.seq.n-0.|=F(n) by ABSVALUE:def 1;
        hence thesis by A39,A41;
      end;
      then
A42:  p in f.0 by A37,KURATO_0:3;
      f.0=A/\cl_Ball(p,1/(0+1)) by A7;
      hence thesis by A2,A42,XBOOLE_0:def 4;
    end;
    A9 c= Cl A9 by PRE_TOPC:18;
    hence thesis by A4,XBOOLE_0:def 10;
  end;
  assume
A43: A9 is closed;
  let S be sequence of MA such that
A44: S is Cauchy;
  reconsider S9=S as sequence of M by Th17;
  S9 is Cauchy by A44,Th18;
  then
A45: S9 is convergent by A1;
A46: now
    let n be Nat;
    S.n in the carrier of (M|A);
    hence S9.n in A9 by A2,TOPMETR:def 2;
  end;
  the carrier of (M|A)=A9 by A2,TOPMETR:def 2;
  then reconsider limS=lim S9 as Point of (M|A) by A43,A45,A46,TOPMETR3:1;
  take limS;
  let r;
  assume r>0;
  then consider n be Nat such that
A47: for m be Nat st m>=n holds dist(S9.m,lim S9)<r by A45,
TBSP_1:def 3;
  take n;
  let m be Nat such that
A48: m>=n;
  dist(S.m,limS) = dist(S9.m,lim S9) by TOPMETR:def 1;
  hence thesis by A47,A48;
end;

begin :: Countable compact spaces

definition
  let T be TopStruct;
  attr T is countably_compact means

  for F being Subset-Family of T st F
  is Cover of T & F is open & F is countable ex G being Subset-Family of T st G
  c= F & G is Cover of T & G is finite;
end;

theorem
  for T be TopStruct st T is compact holds T is countably_compact;

theorem Th21:
  for T being non empty TopSpace holds T is countably_compact iff
for F being Subset-Family of T st F is centered & F is closed & F is countable
  holds meet F <> {}
proof
  let T be non empty TopSpace;
  thus T is countably_compact implies for F be Subset-Family of T st F is
  centered &F is closed &F is countable holds meet F <> {}
  proof
    assume
A1: T is countably_compact;
    let F be Subset-Family of T such that
A2: F is centered and
A3: F is closed and
A4: F is countable;
    assume
A5: meet F = {};
    F <> {} by A2,FINSET_1:def 3;
    then union COMPLEMENT(F) = (meet F)` by TOPS_2:7
      .= [#] T by A5;
    then
A6: COMPLEMENT(F) is Cover of T by SETFAM_1:45;
A7: COMPLEMENT(F) is countable by A4,TOPGEN_4:1;
    COMPLEMENT(F) is open by A3,TOPS_2:9;
    then consider G9 be Subset-Family of T such that
A8: G9 c= COMPLEMENT(F) and
A9: G9 is Cover of T and
A10: G9 is finite by A1,A6,A7;
A11: COMPLEMENT(G9) is finite by A10,TOPS_2:8;
A12: COMPLEMENT(G9) c= F
    proof
      let x be object such that
A13:  x in COMPLEMENT(G9);
      reconsider x9=x as Subset of T by A13;
      x9` in G9 by A13,SETFAM_1:def 7;
      then x9`` in F by A8,SETFAM_1:def 7;
      hence thesis;
    end;
    G9 <> {} by A9,TOPS_2:3;
    then
A14: COMPLEMENT(G9) <> {} by TOPS_2:5;
    meet COMPLEMENT(G9) = (union G9)` by A9,TOPS_2:3,6
      .= ([#] T) \ ([#] T) by A9,SETFAM_1:45
      .= {} by XBOOLE_1:37;
    hence contradiction by A2,A12,A14,A11,FINSET_1:def 3;
  end;
  assume
A15: for F being Subset-Family of T st F is centered & F is closed & F
  is countable holds meet F <> {};
  let F be Subset-Family of T such that
A16: F is Cover of T and
A17: F is open and
A18: F is countable;
A19: COMPLEMENT(F) is countable by A18,TOPGEN_4:1;
  F <> {} by A16,TOPS_2:3;
  then
A20: COMPLEMENT(F) <> {} by TOPS_2:5;
A21: COMPLEMENT(F) is closed by A17,TOPS_2:10;
  meet COMPLEMENT(F) = (union F)` by A16,TOPS_2:3,6
    .= ([#] T) \ ([#] T) by A16,SETFAM_1:45
    .= {} by XBOOLE_1:37;
  then not COMPLEMENT(F) is centered by A15,A19,A21;
  then consider G9 being set such that
A22: G9 <> {} and
A23: G9 c= COMPLEMENT(F) and
A24: G9 is finite and
A25: meet G9 = {} by A20,FINSET_1:def 3;
  reconsider G9 as Subset-Family of T by A23,XBOOLE_1:1;
  take F9=COMPLEMENT(G9);
  thus F9 c= F
  proof
    let x be object such that
A26: x in F9;
    reconsider x9=x as Subset of T by A26;
    x9` in G9 by A26,SETFAM_1:def 7;
    then x9`` in F by A23,SETFAM_1:def 7;
    hence thesis;
  end;
  union F9 = (meet G9)` by A22,TOPS_2:7
    .= [#] T by A25;
  hence thesis by A24,SETFAM_1:45,TOPS_2:8;
end;

theorem Th22:
  for T being non empty TopSpace holds T is countably_compact iff
  for S be non-empty closed SetSequence of T st S is non-ascending holds meet S
  <> {}
proof
  let T being non empty TopSpace;
  thus T is countably_compact implies for S be non-empty closed SetSequence of
  T st S is non-ascending holds meet S <> {}
  proof
    assume
A1: T is countably_compact;
    let S be non-empty closed SetSequence of T such that
A2: S is non-ascending;
    reconsider rngS=rng S as Subset-Family of T;
    dom S=NAT by FUNCT_2:def 1;
    then
A3: rngS is countable by CARD_3:93;
    now
      let D be Subset of T;
      assume D in rngS;
      then ex x being object st x in dom S & S.x=D by FUNCT_1:def 3;
      hence D is closed by Def6;
    end;
    then
A4: rngS is closed;
    rngS is centered by A2,Th11;
    then meet rngS<>{} by A1,A3,A4,Th21;
    then consider x being object such that
A5: x in meet rngS by XBOOLE_0:def 1;
    now
      let n be Nat;
A6:    n in NAT by ORDINAL1:def 12;
      dom S=NAT by FUNCT_2:def 1;
      then S.n in rngS by FUNCT_1:def 3,A6;
      hence x in S.n by A5,SETFAM_1:def 1;
    end;
    hence thesis by KURATO_0:3;
  end;
  assume
A7: for S be non-empty closed SetSequence of T st S is non-ascending
  holds meet S <> {};
  now
    let F be Subset-Family of T such that
A8: F is centered and
A9: F is closed and
A10: F is countable;
A11: card F c= omega by A10,CARD_3:def 14;
    now
      per cases by A11,CARD_1:3;
      suppose
        card F = omega;
        then NAT,F are_equipotent by CARD_1:5,47;
        then consider s be Function such that
        s is one-to-one and
A12:    dom s = NAT and
A13:    rng s = F by WELLORD2:def 4;
        reconsider s as SetSequence of T by A12,A13,FUNCT_2:2;
        consider R be SetSequence of T such that
A14:    R is non-ascending and
A15:    F is centered implies R is non-empty and
        F is open implies R is open and
A16:    F is closed implies R is closed and
A17:    for i holds R.i=meet{s.j where j is Element of NAT:j<=i}by A13,Th13;
        meet R<>{} by A7,A8,A9,A14,A15,A16;
        then consider x being object such that
A18:    x in meet R by XBOOLE_0:def 1;
A19:    now
          let y;
          assume y in F;
          then consider z be object such that
A20:      z in dom s and
A21:      s.z=y by A13,FUNCT_1:def 3;
          reconsider z as Element of NAT by A20;
A22:      s.z in {s.j where j is Element of NAT:j<=z};
A23:      x in R.z by A18,KURATO_0:3;
          R.z=meet {s.j where j is Element of NAT:j<=z} by A17;
          then R.z c= s.z by A22,SETFAM_1:3;
          hence x in y by A21,A23;
        end;
        F is non empty by A12,A13,RELAT_1:42;
        hence meet F is non empty by A19,SETFAM_1:def 1;
      end;
      suppose
A24:    card F in omega;
        F is finite by A24;
        hence meet F is non empty by A8,FINSET_1:def 3;
      end;
    end;
    hence meet F<>{};
  end;
  hence thesis by Th21;
end;

theorem Th23:
  for T being non empty TopSpace for F be Subset-Family of T for S
  be SetSequence of T st rng S c= F & S is non-empty ex R be non-empty closed
  SetSequence of T st R is non-ascending & ( F is locally_finite & S is
  one-to-one implies meet R = {} ) & for i ex Si be Subset-Family of T st R.i =
  Cl union Si & Si = {S.j where j is Element of NAT: j >= i}
proof
  let T being non empty TopSpace;
  let F be Subset-Family of T;
  let S be SetSequence of T such that
A1: rng S c= F and
A2: S is non-empty;
  defpred r[object,object] means
  for i st i=$1 ex SS be Subset-Family of T st SS c=
  F & SS = {S.j where j is Element of NAT:j >= i} & $2=Cl(union SS);
A3: for x being object st x in NAT
ex y being object st y in bool(the carrier of T) & r[x,y]
  proof
    let x be object;
    assume x in NAT;
    then reconsider x9=x as Nat;
    set SS={S.j where j is Element of NAT:j >= x9};
    SS c= bool(the carrier of T)
    proof
      let y be object;
      assume y in SS;
      then ex j be Element of NAT st S.j=y & j>=x9;
      hence thesis;
    end;
    then reconsider SS as Subset-Family of T;
    take Cl union SS;
    SS c= F
    proof
      let y be object;
      assume y in SS;
      then consider  j be Element of NAT such that
A4:    S.j=y & j>=x9;
      dom S=NAT by FUNCT_2:def 1;
      then y in rng S by A4,FUNCT_1:def 3;
      hence thesis by A1;
    end;
    hence thesis;
  end;
  consider R be SetSequence of T such that
A5: for x being object st x in NAT holds r[x,R.x] from FUNCT_2:sch 1(A3);
A6: now
    let n be object;
    assume n in dom R;
    then reconsider n9=n as Element of NAT;
A7: S.n9 c= Cl(S.n9) by PRE_TOPC:18;
    consider SS be Subset-Family of T such that
    SS c= F and
A8: SS = {S.j where j is Element of NAT:j>=n9} and
A9: R.n9=Cl(union SS) by A5;
    S.n9 in SS by A8;
    then
A10: Cl(S.n9) c= Cl(union SS) by PRE_TOPC:19,ZFMISC_1:74;
    dom S=NAT by FUNCT_2:def 1;
    hence R.n is non empty by A2,A9,A7,A10,FUNCT_1:def 9;
  end;
  now
    let n;
    reconsider n9=n as Element of NAT by ORDINAL1:def 12;
    ex SS be Subset-Family of T st SS c= F & SS = {S.j where j is Element
    of NAT:j>=n9} & R.n9=Cl(union SS) by A5;
    hence R.n is closed;
  end;
  then reconsider R as non-empty closed SetSequence of T by A6,Def6,
FUNCT_1:def 9;
  take R;
  now
    let n be Nat;
A11:  n in NAT by ORDINAL1:def 12;
    consider Sn be Subset-Family of T such that
    Sn c= F and
A12: Sn = {S.j where j is Element of NAT:j>=n} and
A13: R.n=Cl(union Sn) by A5,A11;
    consider Sn1 be Subset-Family of T such that
    Sn1 c= F and
A14: Sn1 = {S.j where j is Element of NAT:j>=n+1} and
A15: R.(n+1)=Cl(union Sn1) by A5;
    Sn1 c= Sn
    proof
      let y be object;
      assume y in Sn1;
      then consider j be Element of NAT such that
A16:  y=S.j and
A17:  j>=n+1 by A14;
      j>=n by A17,NAT_1:13;
      hence thesis by A12,A16;
    end;
    then union Sn1 c= union Sn by ZFMISC_1:77;
    hence R.(n+1) c= R.n by A13,A15,PRE_TOPC:19;
  end;
  hence R is non-ascending by KURATO_0:def 3;
  thus F is locally_finite & S is one-to-one implies meet R = {}
  proof
A18: dom S=NAT by FUNCT_2:def 1;
    then reconsider rngS=rng S as non empty Subset-Family of T by RELAT_1:42;
    reconsider Sp=S as sequence of rngS by A18,FUNCT_2:1;
    assume that
A19: F is locally_finite and
A20: S is one-to-one;
    reconsider S9=Sp" as Function;
    reconsider S9 as Function of rngS,NAT by A20,FUNCT_2:25;
    deffunc s9(Element of rngS)=S9.$1;
    assume meet R <> {};
    then consider x being object such that
A21: x in meet R by XBOOLE_0:def 1;
    reconsider x as Point of T by A21;
    rng S is locally_finite by A1,A19,PCOMPS_1:9;
    then consider W be Subset of T such that
A22: x in W and
A23: W is open and
A24: { V where V is Subset of T: V in rngS & V meets W } is finite;
    set X={ V where V is Subset of T: V in rngS & V meets W };
    set Y={s9(z) where z is Element of rngS:z in X};
A25: Y is finite from FRAENKEL:sch 21(A24);
    Y c= NAT
    proof
      let y be object;
      assume y in Y;
      then ex z be Element of rngS st y =s9(z) & z in X;
      hence thesis;
    end;
    then reconsider Y as Subset of NAT;
    consider n be Nat such that
A26: for k be Nat st k in Y holds k <= n by A25,STIRL2_1:56;
    set n1=n+1;
A27: x in R.n1 by A21,KURATO_0:3;
    consider Sn be Subset-Family of T such that
A28: Sn c= F and
A29: Sn ={S.j where j is Element of NAT:j>=n1} and
A30: R.n1=Cl(union Sn) by A5;
    Cl(union Sn)=union(clf Sn) by A19,A28,PCOMPS_1:9,20;
    then consider CLF be set such that
A31: x in CLF and
A32: CLF in clf Sn by A30,A27,TARSKI:def 4;
    reconsider CLF as Subset of T by A32;
    consider U be Subset of T such that
A33: CLF = Cl U and
A34: U in Sn by A32,PCOMPS_1:def 2;
    consider j be Element of NAT such that
A35: U=S.j and
A36: j>=n1 by A29,A34;
A37: Sp.j in rngS;
    Sp.j meets W by A22,A23,A31,A33,A35,TOPS_1:12;
    then
A38: Sp.j in X by A37;
    (S").(S.j) = j by A20,FUNCT_2:26;
    then j in Y by A38;
    then j <=n by A26;
    hence thesis by A36,NAT_1:13;
  end;
  let i;
  i in NAT by ORDINAL1:def 12;
  then ex SS be Subset-Family of T st SS c= F & SS = {S.j where j is Element
  of NAT:j >= i} & R.i=Cl(union SS) by A5;
  hence thesis;
end;

Lm2: for T being non empty TopSpace st T is countably_compact for F be
Subset-Family of T st F is locally_finite & F is with_non-empty_elements holds
F is finite
proof
  let T be non empty TopSpace such that
A1: T is countably_compact;
  given F be Subset-Family of T such that
A2: F is locally_finite and
A3: F is with_non-empty_elements and
A4: F is infinite;
  consider f be sequence of  F such that
A5: f is one-to-one by A4,DICKSON:3;
A6: rng f c= F;
  reconsider f as SetSequence of T by A4,FUNCT_2:7;
  now
    let x be object;
    assume x in dom f;
    then f.x in rng f by FUNCT_1:def 3;
    hence f.x is non empty by A3,A6;
  end;
  then f is non-empty by FUNCT_1:def 9;
  then ex R be non-empty closed SetSequence of T st R is non-ascending & ( F
  is locally_finite & f is one-to-one implies meet R = {})& for i ex fi be
Subset-Family of T st R.i = Cl union fi &
  fi = {f.j where j is Element of NAT:
  j >= i} by A6,Th23;
  hence thesis by A1,A2,A5,Th22;
end;

Lm3: for T be non empty TopSpace st for F be Subset-Family of T st F is
locally_finite & F is with_non-empty_elements holds F is finite for F be
Subset-Family of T st F is locally_finite & for A be Subset of T st A in F
holds card A = 1 holds F is finite
proof
  let T be non empty TopSpace such that
A1: for F be Subset-Family of T st F is locally_finite & F is
  with_non-empty_elements holds F is finite;
  let F be Subset-Family of T such that
A2: F is locally_finite and
A3: for A be Subset of T st A in F holds card A = 1;
  not {}T in F by A3,CARD_1:27;
  then F is with_non-empty_elements by SETFAM_1:def 8;
  hence thesis by A1,A2;
end;

Lm4: for T be non empty TopSpace st for F be Subset-Family of T st F is
locally_finite & for A be Subset of T st A in F holds card A = 1 holds F is
finite for A be Subset of T st A is infinite holds Der A is non empty
proof
  deffunc P(set)=meet $1;
  let T be non empty TopSpace such that
A1: for F be Subset-Family of T st F is locally_finite & for A be Subset
  of T st A in F holds card A = 1 holds F is finite;
  let A be Subset of T such that
A2: A is infinite;
  set F={{x} where x is Element of T: x in A};
  reconsider F as Subset-Family of T by RELSET_2:16;
  set PP={P(y) where y is Element of bool(the carrier of T):y in F};
A3: A c= PP
  proof
    let y be object such that
A4: y in A;
    reconsider y9=y as Point of T by A4;
    {y9} in F by A4;
    then P({y9}) in PP;
    hence thesis by SETFAM_1:10;
  end;
  assume
A5: Der A is empty;
A6: F is locally_finite
  proof
    let x be Point of T;
    consider U be open Subset of T such that
A7: x in U and
A8: for y being Point of T st y in A /\ U holds x = y by A5,TOPGEN_1:17;
    set M={ V where V is Subset of T: V in F & V meets U};
    take U;
    M c= {{x}}
    proof
A9:   {x} in {{x}} by TARSKI:def 1;
      let v be object;
      assume v in M;
      then consider V be Subset of T such that
A10:  v=V and
A11:  V in F and
A12:  V meets U;
      consider y be Point of T such that
A13:  V = {y} and
A14:  y in A by A11;
      y in U by A12,A13,ZFMISC_1:50;
      then y in A/\U by A14,XBOOLE_0:def 4;
      hence thesis by A8,A10,A13,A9;
    end;
    hence thesis by A7;
  end;
  now
    let a be Subset of T;
    assume a in F;
    then ex y be Point of T st a={y} & y in A;
    hence card a = 1 by CARD_1:30;
  end;
  then
A15: F is finite by A1,A6;
  PP is finite from FRAENKEL:sch 21(A15);
  hence thesis by A2,A3;
end;

::$CT

theorem Th24:
  for X be non empty set, F be SetSequence of X st F is
non-ascending for S be sequence of X st for n holds S.n in F.n holds rng S
  is finite implies meet F is non empty
proof
  let X be non empty set, F be SetSequence of X such that
A1: F is non-ascending;
  let S be sequence of X such that
A2: for n holds S.n in F.n;
A3: dom S=NAT by FUNCT_2:def 1;
  assume rng S is finite;
  then consider x being object such that
  x in rng S and
A4: S"{x} is infinite by A3,CARD_2:101;
  now
    let n be Nat;
    ex i st x in F.i & i >= n
    proof
      assume
A5:   for i st x in F.i holds i<n;
      S"{x} c= Segm n
      proof
        let y be object such that
A6:     y in S"{x};
        reconsider i=y as Nat by A6;
        S.i in {x} by A6,FUNCT_1:def 7;
        then
A7:     S.i=x by TARSKI:def 1;
        S.i in F.i by A2;
        then i<n by A5,A7;
        hence thesis by NAT_1:44;
      end;
      hence thesis by A4;
    end;
    then consider i such that
A8: x in F.i and
A9: i>=n;
    F.i c= F.n by A1,A9,PROB_1:def 4;
    hence x in F.n by A8;
  end;
  hence thesis by KURATO_0:3;
end;

Lm5: for T be T_1 non empty TopSpace st for A be Subset of T st A is infinite
countable holds Der A is non empty holds T is countably_compact
proof
  let T be T_1 non empty TopSpace such that
A1: for A be Subset of T st A is infinite countable holds Der A is non empty;
  assume not T is countably_compact;
  then consider S be non-empty closed SetSequence of T such that
A2: S is non-ascending and
A3: meet S = {} by Th22;
  defpred P[object,object] means $2 in S.$1;
:: Funkcja Kuratowskiego
A4: for x being object st x in NAT
ex y being object st y in the carrier of T & P[x,y]
  proof
    let x be object;
    assume x in NAT;
    then reconsider x9=x as Element of NAT;
    dom S=NAT by FUNCT_2:def 1;
    then S.x9 is non empty by FUNCT_1:def 9;
    then consider y being object such that
A5: y in S.x9 by XBOOLE_0:def 1;
    take y;
    thus thesis by A5;
  end;
  consider F be sequence of T such that
A6: for x being object st x in NAT holds P[x,F.x] from FUNCT_2:sch 1(A4);
  reconsider rngF=rng F as Subset of T;
A7: for n holds F.n in S.n by A6,ORDINAL1:def 12;
  dom F=NAT by FUNCT_2:def 1;
  then rng F is countable by CARD_3:93;
  then Der rngF is non empty by A1,A2,A3,A7,Th24;
  then consider p be object such that
A8: p in Der rngF by XBOOLE_0:def 1;
  reconsider p as Point of T by A8;
  consider n be Nat such that
A9: not p in S.n by A3,KURATO_0:3;
A10: p in (S.n)` by A9,XBOOLE_0:def 5;
  deffunc f(set)=F.$1;
  set F1n={f(i) where i is Element of NAT:i in n+1};
A11: F1n c= the carrier of T
  proof
    let x be object;
    assume x in F1n;
    then ex i be Element of NAT st x=F.i & i in n+1;
    hence thesis;
  end;
A12: n+1 is finite;
A13: F1n is finite from FRAENKEL:sch 21(A12);
  reconsider F1n as Subset of T by A11;
  set U=((S.n)`)\(F1n\{p});
  reconsider U as Subset of T;
  p in {p} by TARSKI:def 1;
  then not p in F1n\{p} by XBOOLE_0:def 5;
  then
A14: p in U by A10,XBOOLE_0:def 5;
  (S.n) is closed by Def6;
  then U is open by A13,FRECHET:4;
  then consider q be Point of T such that
A15: q in rngF /\ U and
A16: q <> p by A8,A14,TOPGEN_1:17;
  q in rngF by A15,XBOOLE_0:def 4;
  then consider i be object such that
A17: i in dom F and
A18: F.i=q by FUNCT_1:def 3;
  reconsider i as Element of NAT by A17;
  per cases;
  suppose
    i<=n;
    then i < n+1 by NAT_1:13;
    then i in Segm(n+1) by NAT_1:44;
    then q in F1n by A18;
    then q in F1n\{p} by A16,ZFMISC_1:56;
    then not q in U by XBOOLE_0:def 5;
    hence contradiction by A15,XBOOLE_0:def 4;
  end;
  suppose
    i>n;
    then
A19: S.i c= S.n by A2,PROB_1:def 4;
    q in S.i by A6,A18;
    then not q in (S.n)` by A19,XBOOLE_0:def 5;
    then not q in U by XBOOLE_0:def 5;
    hence contradiction by A15,XBOOLE_0:def 4;
  end;
end;

Lm6: for T being non empty TopSpace st for F be Subset-Family of T st F is
locally_finite & for A be Subset of T st A in F holds card A = 1 holds F is
finite holds T is countably_compact
proof
  deffunc P(set)=meet $1;
  let T being non empty TopSpace such that
A1: for F be Subset-Family of T st F is locally_finite & for A be Subset
  of T st A in F holds card A = 1 holds F is finite;
  assume not T is countably_compact;
  then consider S be non-empty closed SetSequence of T such that
A2: S is non-ascending and
A3: meet S = {} by Th22;
  defpred P[object,object] means $2 in S.$1;
    :: Funkcja Kuratowskiego !!!
A4: for x being object st x in NAT
ex y being object st y in the carrier of T & P[x,y]
  proof
    let x be object;
    assume x in NAT;
    then reconsider x9=x as Element of NAT;
    dom S=NAT by FUNCT_2:def 1;
    then S.x9 is non empty by FUNCT_1:def 9;
    then consider y being object such that
A5: y in S.x9 by XBOOLE_0:def 1;
    take y;
    thus thesis by A5;
  end;
  consider F be sequence of T such that
A6: for x being object st x in NAT holds P[x,F.x] from FUNCT_2:sch 1(A4);
  reconsider rngF=rng F as Subset of T;
  set A={{x} where x is Element of T: x in rngF};
  reconsider A as Subset-Family of T by RELSET_2:16;
A7: A is locally_finite
  proof
    deffunc f(set)={F.$1};
    let x be Point of T;
    consider i be Nat such that
A8: not x in S.i by A3,KURATO_0:3;
    take Si9=(S.i)`;
    S.i is closed by Def6;
    hence x in Si9 & Si9 is open by A8,SUBSET_1:29;
    set meetS={ V where V is Subset of T: V in A & V meets Si9 };
    set SI={f(j) where j is Element of NAT:j in i};
A9: meetS c= SI
    proof
      let v be object;
      assume v in meetS;
      then consider V be Subset of T such that
A10:  V=v and
A11:  V in A and
A12:  V meets Si9;
      consider y be Point of T such that
A13:  V={y} and
A14:  y in rng F by A11;
      consider z be object such that
A15:  z in dom F and
A16:  y=F.z by A14,FUNCT_1:def 3;
      reconsider z as Element of NAT by A15;
      z in Segm i
      proof
        assume not z in Segm i;
        then z>=i by NAT_1:44;
        then
A17:    S.z c= S.i by A2,PROB_1:def 4;
A18:    y in Si9 by A12,A13,ZFMISC_1:50;
        y in S.z by A6,A16;
        hence thesis by A17,A18,XBOOLE_0:def 5;
      end;
      hence thesis by A10,A13,A16;
    end;
A19: i is finite;
    SI is finite from FRAENKEL:sch 21(A19);
    hence thesis by A9;
  end;
  set PP={P(y) where y is Element of bool(the carrier of T):y in A};
A20: rngF c= PP
  proof
    let y be object such that
A21: y in rngF;
    reconsider y9=y as Point of T by A21;
    {y9} in A by A21;
    then P({y9}) in PP;
    hence thesis by SETFAM_1:10;
  end;
A22: for n holds F.n in S.n by A6,ORDINAL1:def 12;
  now
    let a be Subset of T;
    assume a in A;
    then ex y be Point of T st a={y} & y in rngF;
    hence card a = 1 by CARD_1:30;
  end;
  then
A23: A is finite by A1,A7;
  PP is finite from FRAENKEL:sch 21(A23);
  hence thesis by A2,A3,A22,A20,Th24;
end;

theorem Th25:
  for T be non empty TopSpace holds T is countably_compact iff for
  F be Subset-Family of T st F is locally_finite & F is with_non-empty_elements
  holds F is finite
proof
  let T be non empty TopSpace;
  thus T is countably_compact implies for F be Subset-Family of T st F is
  locally_finite & F is with_non-empty_elements holds F is finite by Lm2;
  assume for F be Subset-Family of T st F is locally_finite & F is
  with_non-empty_elements holds F is finite;
  then
  for F be Subset-Family of T st F is locally_finite & for A be Subset of
  T st A in F holds card A = 1 holds F is finite by Lm3;
  hence thesis by Lm6;
end;

theorem Th26:
  for T be non empty TopSpace holds T is countably_compact iff for
F be Subset-Family of T st F is locally_finite & for A be Subset of T st A in F
  holds card A = 1 holds F is finite
proof
  let T be non empty TopSpace;
  thus T is countably_compact implies for F be Subset-Family of T st F is
  locally_finite & for A be Subset of T st A in F holds card A=1 holds F is
  finite
  proof
    assume T is countably_compact;
    then for F be Subset-Family of T st F is locally_finite & F is
    with_non-empty_elements holds F is finite by Th25;
    hence thesis by Lm3;
  end;
  thus thesis by Lm6;
end;

theorem Th27:
  for T be T_1 non empty TopSpace holds T is countably_compact iff
  for A be Subset of T st A is infinite holds Der A is non empty
proof
  let T be T_1 non empty TopSpace;
  thus T is countably_compact implies for A be Subset of T st A is infinite
  holds Der A is non empty
  proof
    assume T is countably_compact;
    then for F be Subset-Family of T st F is locally_finite & for A be Subset
    of T st A in F holds card A=1 holds F is finite by Th26;
    hence thesis by Lm4;
  end;
  assume for A be Subset of T st A is infinite holds Der A is non empty;
  then
  for A be Subset of T st A is infinite countable holds Der A is non empty;
  hence thesis by Lm5;
end;

theorem
  for T be T_1 non empty TopSpace holds T is countably_compact iff for A
be Subset of T st A is infinite countable holds Der A is non empty by Lm5,Th27;

scheme
  Th39{X()->non empty set,P[set,set]}: ex A be Subset of X() st ( for x,y be
Element of X() st x in A & y in A & x <> y holds P[x,y] ) & for x be Element of
  X() ex y be Element of X() st y in A & not P[x,y]
provided
A1: for x,y be Element of X() holds P[x,y] iff P[y,x] and
A2: for x be Element of X() holds not P[x,x]
proof
  set bX=bool X();
  consider R be Relation such that
A3: R well_orders X() by WELLORD2:17;
  R/\[:X(),X():]c=[:X(),X():] by XBOOLE_1:17;
  then reconsider R2=R |_2 X() as Relation of X() by WELLORD1:def 6;
  reconsider RS=RelStr(#X(),R2#) as non empty RelStr;
  set cRS=the carrier of RS;
  defpred H[object,object,object] means
  for p be Element of X(), f be PartFunc of cRS,
bX st $1=p & $2=f holds ( (for q be Element of X() st q in union(rng f) holds P
  [p,q]) implies $3=union (rng f) \/ {p} ) & ( (ex q be Element of X() st q in
  union (rng f) & not P[p,q]) implies $3=union (rng f) );
A4: for x,y being object st x in cRS & y in PFuncs(cRS, bX)
    ex z be object st z in bX & H[x,y,z]
  proof
    let x,y be object such that
A5: x in cRS and
A6: y in PFuncs(cRS, bX);
    reconsider f=y as PartFunc of cRS,bX by A6,PARTFUN1:46;
    reconsider p=x as Element of X() by A5;
    per cases;
    suppose
A7:   for q be Element of X() st q in union(rng f) holds P[p,q];
      take union (rng f) \/ {p};
      thus thesis by A7;
    end;
    suppose
A8:   ex q be Element of X() st q in union (rng f) & not P[p,q];
      take union (rng f);
      thus thesis by A8;
    end;
  end;
  consider h be Function of [:cRS,PFuncs(cRS, bX):],bX such that
A9: for x,y being object st x in cRS & y in PFuncs(cRS, bX)
      holds H[x,y,h.(x,y)]
  from BINOP_1:sch 1(A4);
  set IRS=the InternalRel of RS;
A10: R2 well_orders X() by A3,PCOMPS_2:1;
  then R2 is_well_founded_in X() by WELLORD1:def 5;
  then
A11: RS is well_founded by WELLFND1:def 2;
  then consider f be Function of cRS, bX such that
A12: f is_recursively_expressed_by h by WELLFND1:11;
  defpred S[set] means f.$1 c= (IRS-Seg $1)\/{$1} & ($1 in f.$1 implies for r
be Element of X() st r in union(rng (f|IRS-Seg $1)) holds P[$1,r])& (not $1 in
f.$1 implies ex r be Element of X() st r in union(rng (f|IRS-Seg $1)) & not P[
  $1,r]);
  reconsider rngf=rng f as Subset of bX;
  take A=union rngf;
A13: field R2 = X() by A3,PCOMPS_2:1;
  then
A14: R2 is well-ordering by A10,WELLORD1:4;
A15: for x be Element of RS st for y be Element of RS st y <> x & [y,x] in
  IRS holds S[y] holds S[x]
  proof
    let x be Element of RS such that
A16: for y be Element of RS st y <> x & [y,x] in IRS holds S[y];
    set fIx=f|IRS-Seg x;
A17: union rng fIx c= IRS-Seg x
    proof
      let y be object;
      assume y in union rng fIx;
      then consider z be set such that
A18:  y in z and
A19:  z in rng fIx by TARSKI:def 4;
      consider t be object such that
A20:  t in dom fIx and
A21:  fIx.t=z by A19,FUNCT_1:def 3;
A22:  t in IRS-Seg x by A20,RELAT_1:57;
      reconsider t as Element of RS by A20;
A23:  {t} c= IRS-Seg(x) by A22,ZFMISC_1:31;
A24:  [t,x] in IRS by A22,WELLORD1:1;
      then IRS-Seg(t)c=IRS-Seg(x) by A13,A14,WELLORD1:29;
      then
A25:  (IRS-Seg t)\/{t} c= IRS-Seg(x) by A23,XBOOLE_1:8;
      t<>x by A22,WELLORD1:1;
      then
A26:  f.t c= (IRS-Seg t)\/{t} by A16,A24;
      fIx.t=f.t by A20,FUNCT_1:47;
      then y in (IRS-Seg t)\/{t} by A18,A21,A26;
      hence thesis by A25;
    end;
A27: fIx in PFuncs(cRS,bX) by PARTFUN1:45;
A28: f.x=h.(x,fIx) by A12,WELLFND1:def 5;
    per cases;
    suppose
A29:  for q be Element of X() st q in union(rng fIx) holds P[x,q];
      then
A30:  f.x=union(rng fIx)\/{x} by A9,A28,A27;
      hence f.x c= IRS-Seg x\/{x} by A17,XBOOLE_1:9;
      thus x in f.x implies for r be Element of X() st r in union(rng (f|IRS
      -Seg x)) holds P[x,r] by A29;
A31:  x in {x} by TARSKI:def 1;
      assume not x in f.x;
      hence thesis by A30,A31,XBOOLE_0:def 3;
    end;
    suppose
A32:  ex q be Element of X() st q in union (rng fIx) & not P[x,q];
      then
A33:  f.x c= IRS-Seg x by A9,A17,A28,A27;
      IRS-Seg x c= IRS-Seg x\/{x} by XBOOLE_1:7;
      hence f.x c= IRS-Seg x\/{x} by A33;
      thus thesis by A32,A33,WELLORD1:1;
    end;
  end;
A34: for x being Element of RS holds S[x] from WELLFND1:sch 3(A15,A11);
  thus for x,y be Element of X() st x in A & y in A & x <> y holds P[x,y]
  proof
A35: now
      let x be Element of X();
      assume x in A;
      then consider y such that
A36:  x in y and
A37:  y in rng f by TARSKI:def 4;
      defpred T[set] means x in f.$1;
      consider z be object such that
A38:  z in dom f and
A39:  f.z=y by A37,FUNCT_1:def 3;
      reconsider z as Element of RS by A38;
A40:  T[z] by A36,A39;
      consider p being Element of RS such that
A41:  T[p] and
A42:  not ex q being Element of RS st p <> q & T[q] & [q,p] in IRS
      from WELLFND1:sch 2(A40,A11);
      p = x
      proof
        set fIp=f|IRS-Seg p;
A43:    fIp in PFuncs(cRS, bX) by PARTFUN1:45;
A44:    f.p=h.(p,fIp) by A12,WELLFND1:def 5;
        assume
A45:    p<>x;
        now
          per cases;
          suppose
A46:        for q be Element of X() st q in union(rng fIp) holds P[p, q];
A47:        not x in {p} by A45,TARSKI:def 1;
            f.p=union(rng fIp)\/{p} by A9,A44,A43,A46;
            hence x in union(rng fIp) by A41,A47,XBOOLE_0:def 3;
          end;
          suppose
            ex q be Element of X() st q in union (rng fIp) & not P[p, q];
            hence x in union(rng fIp) by A9,A41,A44,A43;
          end;
        end;
        then consider y9 be set such that
A48:    x in y9 and
A49:    y9 in rng fIp by TARSKI:def 4;
        consider z9 be object such that
A50:    z9 in dom fIp and
A51:    fIp.z9=y9 by A49,FUNCT_1:def 3;
        reconsider z9 as Point of RS by A50;
A52:    z9 in IRS-Seg p by A50,RELAT_1:57;
        then
A53:    z9<> p by WELLORD1:1;
A54:    [z9,p] in IRS by A52,WELLORD1:1;
        T[z9] by A48,A50,A51,FUNCT_1:47;
        hence thesis by A42,A53,A54;
      end;
      hence x in f.x by A41;
    end;
A55: now
A56:  dom f = cRS by FUNCT_2:def 1;
      let x,y be Element of X() such that
A57:  x in A and
A58:  y in A and
A59:  x <> y and
A60:  [x,y] in IRS;
A61:  y in f.y by A35,A58;
      set fIy=f|IRS-Seg y;
      x in IRS-Seg y by A59,A60,WELLORD1:1;
      then
A62:  x in dom fIy by A56,RELAT_1:57;
      then
A63:  fIy.x in rng fIy by FUNCT_1:def 3;
A64:  fIy.x=f.x by A62,FUNCT_1:47;
      x in f.x by A35,A57;
      then x in union(rng fIy) by A63,A64,TARSKI:def 4;
      then P[y,x] by A34,A61;
      hence P[x,y] by A1;
    end;
    let x,y be Element of X() such that
A65: x in A and
A66: y in A and
A67: x <> y;
    R2 well_orders X() by A3,PCOMPS_2:1;
    then R2 is_connected_in X() by WELLORD1:def 5;
    then [x,y] in IRS or [y,x] in IRS by A67,RELAT_2:def 6;
    then P[x,y] or P[y,x] by A55,A65,A66,A67;
    hence thesis by A1;
  end;
  let x be Element of X();
  per cases;
  suppose
A68: x in A;
    take x;
    thus thesis by A2,A68;
  end;
  suppose
A69: not x in A;
    not x in f.x
    proof
      dom f=cRS by FUNCT_2:def 1;
      then
A70:  f.x in rng f by FUNCT_1:def 3;
      assume x in f.x;
      hence thesis by A69,A70,TARSKI:def 4;
    end;
    then consider r be Element of X() such that
A71: r in union(rng (f|IRS-Seg x)) and
A72: not P[x,r] by A34;
    take r;
    union rng (f|IRS-Seg x) c= A by RELAT_1:70,ZFMISC_1:77;
    hence thesis by A71,A72;
  end;
end;

scheme
  Th39{X()->non empty set,P[set,set]}: ex A be Subset of X() st ( for x,y be
Element of X() st x in A & y in A & x <> y holds P[x,y] ) & for x be Element of
  X() ex y be Element of X() st y in A & not P[x,y]
provided
A1: for x,y be Element of X() holds P[x,y] iff P[y,x] and
A2: for x be Element of X() holds not P[x,x]
proof
  set bX=bool X();
  consider R be Relation such that
A3: R well_orders X() by WELLORD2:17;
  R/\[:X(),X():]c=[:X(),X():] by XBOOLE_1:17;
  then reconsider R2=R |_2 X() as Relation of X() by WELLORD1:def 6;
  reconsider RS=RelStr(#X(),R2#) as non empty RelStr;
  set cRS=the carrier of RS;
  defpred H[object,object,object] means
   for p be Element of X(), f be PartFunc of cRS,
bX st $1=p & $2=f holds ( (for q be Element of X() st q in union(rng f) holds P
  [p,q]) implies $3=union (rng f) \/ {p} ) & ( (ex q be Element of X() st q in
  union (rng f) & not P[p,q]) implies $3=union (rng f) );
A4: for x,y being object st x in cRS & y in PFuncs(cRS, bX)
    ex z be object st z in bX & H[x,y,z]
  proof
    let x,y be object such that
A5: x in cRS and
A6: y in PFuncs(cRS, bX);
    reconsider f=y as PartFunc of cRS,bX by A6,PARTFUN1:46;
    reconsider p=x as Element of X() by A5;
    per cases;
    suppose
A7:   for q be Element of X() st q in union(rng f) holds P[p,q];
      take union (rng f) \/ {p};
      thus thesis by A7;
    end;
    suppose
A8:   ex q be Element of X() st q in union (rng f) & not P[p,q];
      take union (rng f);
      thus thesis by A8;
    end;
  end;
  consider h be Function of [:cRS,PFuncs(cRS, bX):],bX such that
A9: for x,y being object st x in cRS & y in PFuncs(cRS, bX)
    holds H[x,y,h.(x,y)] from BINOP_1:sch 1(A4);
  set IRS=the InternalRel of RS;
A10: R2 well_orders X() by A3,PCOMPS_2:1;
  then R2 is_well_founded_in X() by WELLORD1:def 5;
  then
A11: RS is well_founded by WELLFND1:def 2;
  then consider f be Function of cRS, bX such that
A12: f is_recursively_expressed_by h by WELLFND1:11;
  defpred S[set] means f.$1 c= (IRS-Seg $1)\/{$1} & ($1 in f.$1 implies for r
be Element of X() st r in union(rng (f|IRS-Seg $1)) holds P[$1,r])& (not $1 in
f.$1 implies ex r be Element of X() st r in union(rng (f|IRS-Seg $1)) & not P[
  $1,r]);
  reconsider rngf=rng f as Subset of bX;
  take A=union rngf;
A13: field R2 = X() by A3,PCOMPS_2:1;
  then
A14: R2 is well-ordering by A10,WELLORD1:4;
A15: for x be Element of RS st for y be Element of RS st y <> x & [y,x] in
  IRS holds S[y] holds S[x]
  proof
    let x be Element of RS such that
A16: for y be Element of RS st y <> x & [y,x] in IRS holds S[y];
    set fIx=f|IRS-Seg x;
A17: union rng fIx c= IRS-Seg x
    proof
      let y be object;
      assume y in union rng fIx;
      then consider z be set such that
A18:  y in z and
A19:  z in rng fIx by TARSKI:def 4;
      consider t be object such that
A20:  t in dom fIx and
A21:  fIx.t=z by A19,FUNCT_1:def 3;
A22:  t in IRS-Seg x by A20,RELAT_1:57;
      reconsider t as Element of RS by A20;
A23:  {t} c= IRS-Seg(x) by A22,ZFMISC_1:31;
A24:  [t,x] in IRS by A22,WELLORD1:1;
      then IRS-Seg(t)c=IRS-Seg(x) by A13,A14,WELLORD1:29;
      then
A25:  (IRS-Seg t)\/{t} c= IRS-Seg(x) by A23,XBOOLE_1:8;
      t<>x by A22,WELLORD1:1;
      then
A26:  f.t c= (IRS-Seg t)\/{t} by A16,A24;
      fIx.t=f.t by A20,FUNCT_1:47;
      then y in (IRS-Seg t)\/{t} by A18,A21,A26;
      hence thesis by A25;
    end;
A27: fIx in PFuncs(cRS,bX) by PARTFUN1:45;
A28: f.x=h.(x,fIx) by A12,WELLFND1:def 5;
    per cases;
    suppose
A29:  for q be Element of X() st q in union(rng fIx) holds P[x,q];
      then
A30:  f.x=union(rng fIx)\/{x} by A9,A28,A27;
      hence f.x c= IRS-Seg x\/{x} by A17,XBOOLE_1:9;
      thus x in f.x implies for r be Element of X() st r in union(rng (f|IRS
      -Seg x)) holds P[x,r] by A29;
A31:  x in {x} by TARSKI:def 1;
      assume not x in f.x;
      hence thesis by A30,A31,XBOOLE_0:def 3;
    end;
    suppose
A32:  ex q be Element of X() st q in union (rng fIx) & not P[x,q];
      then
A33:  f.x c= IRS-Seg x by A9,A17,A28,A27;
      IRS-Seg x c= IRS-Seg x\/{x} by XBOOLE_1:7;
      hence f.x c= IRS-Seg x\/{x} by A33;
      thus thesis by A32,A33,WELLORD1:1;
    end;
  end;
A34: for x being Element of RS holds S[x] from WELLFND1:sch 3(A15,A11);
  thus for x,y be Element of X() st x in A & y in A & x <> y holds P[x,y]
  proof
A35: now
      let x be Element of X();
      assume x in A;
      then consider y such that
A36:  x in y and
A37:  y in rng f by TARSKI:def 4;
      defpred T[set] means x in f.$1;
      consider z be object such that
A38:  z in dom f and
A39:  f.z=y by A37,FUNCT_1:def 3;
      reconsider z as Element of RS by A38;
A40:  T[z] by A36,A39;
      consider p being Element of RS such that
A41:  T[p] and
A42:  not ex q being Element of RS st p <> q & T[q] & [q,p] in IRS
      from WELLFND1:sch 2(A40,A11);
      p = x
      proof
        set fIp=f|IRS-Seg p;
A43:    fIp in PFuncs(cRS, bX) by PARTFUN1:45;
A44:    f.p=h.(p,fIp) by A12,WELLFND1:def 5;
        assume
A45:    p<>x;
        now
          per cases;
          suppose
A46:        for q be Element of X() st q in union(rng fIp) holds P[p, q];
A47:        not x in {p} by A45,TARSKI:def 1;
            f.p=union(rng fIp)\/{p} by A9,A44,A43,A46;
            hence x in union(rng fIp) by A41,A47,XBOOLE_0:def 3;
          end;
          suppose
            ex q be Element of X() st q in union (rng fIp) & not P[p, q];
            hence x in union(rng fIp) by A9,A41,A44,A43;
          end;
        end;
        then consider y9 be set such that
A48:    x in y9 and
A49:    y9 in rng fIp by TARSKI:def 4;
        consider z9 be object such that
A50:    z9 in dom fIp and
A51:    fIp.z9=y9 by A49,FUNCT_1:def 3;
        reconsider z9 as Point of RS by A50;
A52:    z9 in IRS-Seg p by A50,RELAT_1:57;
        then
A53:    z9<> p by WELLORD1:1;
A54:    [z9,p] in IRS by A52,WELLORD1:1;
        T[z9] by A48,A50,A51,FUNCT_1:47;
        hence thesis by A42,A53,A54;
      end;
      hence x in f.x by A41;
    end;
A55: now
A56:  dom f = cRS by FUNCT_2:def 1;
      let x,y be Element of X() such that
A57:  x in A and
A58:  y in A and
A59:  x <> y and
A60:  [x,y] in IRS;
A61:  y in f.y by A35,A58;
      set fIy=f|IRS-Seg y;
      x in IRS-Seg y by A59,A60,WELLORD1:1;
      then
A62:  x in dom fIy by A56,RELAT_1:57;
      then
A63:  fIy.x in rng fIy by FUNCT_1:def 3;
A64:  fIy.x=f.x by A62,FUNCT_1:47;
      x in f.x by A35,A57;
      then x in union(rng fIy) by A63,A64,TARSKI:def 4;
      then P[y,x] by A34,A61;
      hence P[x,y] by A1;
    end;
    let x,y be Element of X() such that
A65: x in A and
A66: y in A and
A67: x <> y;
    R2 well_orders X() by A3,PCOMPS_2:1;
    then R2 is_connected_in X() by WELLORD1:def 5;
    then [x,y] in IRS or [y,x] in IRS by A67,RELAT_2:def 6;
    then P[x,y] or P[y,x] by A55,A65,A66,A67;
    hence thesis by A1;
  end;
  let x be Element of X();
  per cases;
  suppose
A68: x in A;
    take x;
    thus thesis by A2,A68;
  end;
  suppose
A69: not x in A;
    not x in f.x
    proof
      dom f=cRS by FUNCT_2:def 1;
      then
A70:  f.x in rng f by FUNCT_1:def 3;
      assume x in f.x;
      hence thesis by A69,A70,TARSKI:def 4;
    end;
    then consider r be Element of X() such that
A71: r in union(rng (f|IRS-Seg x)) and
A72: not P[x,r] by A34;
    take r;
    union rng (f|IRS-Seg x) c= A by RELAT_1:70,ZFMISC_1:77;
    hence thesis by A71,A72;
  end;
end;

theorem Th29:
  for M be Reflexive symmetric non empty MetrStruct for r be Real
  st r > 0 ex A be Subset of M st (for p,q be Point of M st p <> q & p in A & q
in A holds dist(p,q) >= r) & for p be Point of M ex q be Point of M st q in A &
  p in Ball(q,r)
proof
  let M be Reflexive symmetric non empty MetrStruct;
  let r be Real such that
A1: r > 0;
  set cM=the carrier of M;
  defpred P[set,set] means for p,q be Point of M st p=$1 & q=$2 holds dist(p,q
  )>=r;
A2: for x be Element of cM holds not P[x,x]
  proof
    let x be Element of cM;
    dist(x,x)=0 by METRIC_1:1;
    hence thesis by A1;
  end;
A3: for x,y be Element of cM holds P[x,y] iff P[y,x];
  consider A be Subset of cM such that
A4: for x,y be Element of cM st x in A & y in A & x <> y holds P[x,y] and
A5: for x be Element of cM ex y be Element of cM st y in A & not P[x,y]
  from Th39(A3,A2);
  take A;
  thus for p,q be Point of M st p <> q & p in A & q in A holds dist(p,q) >= r
  by A4;
  let p be Point of M;
  consider y be Element of cM such that
A6: y in A and
A7: not P[p,y] by A5;
  take y;
  thus thesis by A6,A7,METRIC_1:11;
end;

theorem Th30:
  for M be Reflexive symmetric triangle non empty MetrStruct holds
  M is totally_bounded iff for r be Real,A be Subset of M st r>0 & for p,q be
  Point of M st p <> q & p in A & q in A holds dist(p,q) >= r holds A is finite
proof
  let M be Reflexive symmetric triangle non empty MetrStruct;
  thus M is totally_bounded implies for r be Real,A be Subset of M st r>0 &
for p,q be Point of M st p <> q & p in A & q in A holds dist(p,q) >= r holds A
  is finite
  proof
    assume
A1: M is totally_bounded;
    let r be Real,A be Subset of M such that
A2: r>0 and
A3: for p,q be Point of M st p <> q & p in A & q in A holds dist(p,q) >=r;
    r/2>0 by A2,XREAL_1:215;
    then consider G be Subset-Family of M such that
A4: G is finite and
A5: the carrier of M = union G and
A6: for C be Subset of M st C in G ex w be Point of M st C = Ball(w,r/
    2) by A1;
    defpred f[object,object] means
     ex D2 being set st D2 = $2 & $1 in D2 & $2 in G;
A7: for x being object st x in A
      ex y being object st y in bool(the carrier of M) & f[x,y]
    proof
      let x be object;
      assume x in A;
      then consider y such that
A8:   x in y and
A9:   y in G by A5,TARSKI:def 4;
      reconsider y as Subset of M by A9;
      take y;
      thus thesis by A8,A9;
    end;
    consider F be Function of A, bool the carrier of M such that
A10: for x being object st x in A holds f[x,F.x] from FUNCT_2:sch 1(A7);
    now
      let x1,x2 be object such that
A11:  x1 in A and
A12:  x2 in A and
A13:  F.x1 = F.x2;
      reconsider p1=x1,p2=x2 as Point of M by A11,A12;
A14:   f[x1,F.x1] by A10,A11;
      then F.x1 in G;
      then consider w be Point of M such that
A15:  F.x1 = Ball(w,r/2) by A6;
      p1 in Ball(w,r/2) by A15,A14;
      then
A16:  dist(p1,w)<r/2 by METRIC_1:11;
A17:  dist(p1,p2)<=dist(p1,w)+dist(w,p2) by METRIC_1:4;
      f[x2,F.x2] by A10,A12;
      then p2 in Ball(w,r/2) by A13,A15;
      then dist(w,p2)<r/2 by METRIC_1:11;
      then dist(p1,w)+dist(w,p2)<r/2+r/2 by A16,XREAL_1:8;
      then dist(p1,p2)<r/2+r/2 by A17,XXREAL_0:2;
      hence x1 = x2 by A3,A11,A12;
    end;
    then
A18: F is one-to-one by FUNCT_2:19;
A19: rng F c= G
    proof
      let x be object;
      assume x in rng F;
      then consider y being object such that
A20:     y in dom F & x=F.y by FUNCT_1:def 3;
       f[y,F.y] by A10,A20;
       then consider D2 being set such that
A21:      D2 = F.y & y in D2 & F.y in G;
      thus thesis by A20,A21;
    end;
    dom F=A by FUNCT_2:def 1;
    then A,rng F are_equipotent by A18,WELLORD2:def 4;
    hence thesis by A4,A19,CARD_1:38;
  end;
  assume
A22: for r be Real,A be Subset of M st r>0 & for p,q be Point of M st p
  <> q & p in A & q in A holds dist(p,q) >= r holds A is finite;
  let r such that
A23: r>0;
  reconsider r as Real;
  consider A be Subset of M such that
A24: for p,q be Point of M st p <> q & p in A & q in A holds dist(p,q) >= r and
A25: for p be Point of M ex q be Point of M st q in A& p in Ball(q,r) by A23
,Th29;
  deffunc B(Point of M)=Ball($1,r);
  set BA={B(p) where p is Point of M:p in A};
A26: A is finite by A22,A23,A24;
A27: BA is finite from FRAENKEL:sch 21(A26);
  BA c= bool the carrier of M
  proof
    let x be object;
    assume x in BA;
    then ex p be Point of M st x = B(p) & p in A;
    hence thesis;
  end;
  then reconsider BA as Subset-Family of M;
  take BA;
  the carrier of M c= union BA
  proof
    let x be object;
    assume x in the carrier of M;
    then reconsider p=x as Point of M;
    consider q be Point of M such that
A28: q in A and
A29: p in B(q) by A25;
    B(q) in BA by A28;
    hence thesis by A29,TARSKI:def 4;
  end;
  hence BA is finite & union BA = the carrier of M by A27,XBOOLE_0:def 10;
  let C be Subset of M;
  assume C in BA;
  then ex p be Point of M st C=B(p) & p in A;
  hence thesis;
end;

Lm7: for M be Reflexive symmetric triangle non empty MetrStruct
  for r be Real,
A be Subset of M st r>0 & for p,q be Point of M st p <> q & p in A & q in A
holds dist(p,q) >= r for F be Subset-Family of TopSpaceMetr M st F={{x} where x
is Element of TopSpaceMetr M: x in A} holds F is locally_finite
proof
  let M be Reflexive symmetric triangle non empty MetrStruct;
  set T=TopSpaceMetr M;
  let r be Real, A be Subset of M such that
A1: r>0 and
A2: for p,q be Point of M st p <> q & p in A & q in A holds dist(p,q) >= r;
A3: r/2>0 by A1,XREAL_1:215;
  let F be Subset-Family of T such that
A4: F={{x} where x is Element of T: x in A};
  let x be Point of T;
  reconsider x9=x as Point of M;
  reconsider B=Ball(x9,r/2) as Subset of T;
  take B;
A5: dist(x9,x9)=0 by METRIC_1:1;
  B in Family_open_set M by PCOMPS_1:29;
  hence x in B & B is open by A5,A3,METRIC_1:11,PRE_TOPC:def 2;
  set VV={ V where V is Subset of T: V in F & V meets B};
  per cases;
  suppose
A6: for p be Point of M st p in A holds dist(p,x9) >= r/2;
    VV is empty
    proof
      assume VV is non empty;
      then consider v be object such that
A7:   v in VV by XBOOLE_0:def 1;
      consider V be Subset of T such that
      v=V and
A8:   V in F and
A9:   V meets B by A7;
      consider y be Point of T such that
A10:  V = {y} and
A11:  y in A by A4,A8;
      reconsider y as Point of M;
      y in B by A9,A10,ZFMISC_1:50;
      then dist(x9,y)<r/2 by METRIC_1:11;
      hence thesis by A6,A11;
    end;
    hence thesis;
  end;
  suppose
    ex p be Point of M st p in A & dist(p,x9) < r/2;
    then consider p be Point of M such that
A12: p in A and
A13: dist(p,x9) < r/2;
    VV c= {{p}}
    proof
      let v be object;
      assume v in VV;
      then consider V be Subset of T such that
A14:  v=V and
A15:  V in F and
A16:  V meets B;
      consider y be Point of T such that
A17:  V = {y} and
A18:  y in A by A4,A15;
      reconsider y as Point of M;
      y in B by A16,A17,ZFMISC_1:50;
      then dist(x9,y)<r/2 by METRIC_1:11;
      then
A19:  dist(p,x9)+dist(x9,y)<r/2+r/2 by A13,XREAL_1:8;
      dist(p,y)<=dist(p,x9)+dist(x9,y) by METRIC_1:4;
      then dist(p,y)<r/2+r/2 by A19,XXREAL_0:2;
      then p = y by A2,A12,A18;
      hence thesis by A14,A17,TARSKI:def 1;
    end;
    hence thesis;
  end;
end;

theorem Th31:
  for M be Reflexive symmetric triangle non empty MetrStruct st
  TopSpaceMetr M is countably_compact holds M is totally_bounded
proof
  deffunc P(set)=meet $1;
  let M be Reflexive symmetric triangle non empty MetrStruct such that
A1: TopSpaceMetr M is countably_compact;
  set T=TopSpaceMetr M;
  assume not M is totally_bounded;
  then consider r be Real, A be Subset of M such that
A2: r>0 and
A3: for p,q be Point of M st p <> q & p in A & q in A holds dist(p,q) >= r and
A4: A is infinite by Th30;
  reconsider A as Subset of T;
  set F={{x} where x is Element of T: x in A};
  reconsider F as Subset-Family of T by RELSET_2:16;
A5: now
    let a be Subset of T;
    assume a in F;
    then ex y be Point of T st a={y} & y in A;
    hence card a = 1 by CARD_1:30;
  end;
  set PP={P(y) where y is Subset of T:y in F};
A6: A c= PP
  proof
    let y be object such that
A7: y in A;
    reconsider y9=y as Point of T by A7;
    {y9} in F by A7;
    then P({y9}) in PP;
    hence thesis by SETFAM_1:10;
  end;
  F is locally_finite by A2,A3,Lm7;
  then
A8: F is finite by A1,A5,Th26;
  PP is finite from FRAENKEL:sch 21(A8);
  hence thesis by A4,A6;
end;

theorem Th32:
  for M be non empty MetrSpace st M is totally_bounded holds
  TopSpaceMetr M is second-countable
proof
  let M be non empty MetrSpace such that
A1: M is totally_bounded;
  set T=TopSpaceMetr M;
  defpred F[object,object] means
   for i st i=$1 for G be Subset-Family of T st $2=G
holds G is finite & the carrier of M = union G & for C be Subset of M st C in G
  ex w be Point of M st C = Ball(w,1/(i+1));
A2: for x being object st x in NAT
ex y being object st y in bool bool(the carrier of T) & F[x,y]
  proof
    let x be object;
    assume x in NAT;
    then reconsider i=x as Nat;
    1/(i+1)>0 by XREAL_1:139;
    then consider G be Subset-Family of T such that
A3: G is finite and
A4: the carrier of M = union G and
A5: for C be Subset of M st C in G ex w be Point of M st C=Ball(w,1/(i
    +1 )) by A1;
    take G;
    thus thesis by A3,A4,A5;
  end;
  consider f be sequence of bool bool(the carrier of T) such that
A6: for x being object st x in NAT holds F[x,f.x] from FUNCT_2:sch 1(A2);
  set U = Union f;
A7: dom f=NAT by FUNCT_2:def 1;
A8: for A be Subset of T st A is open for p be Point of T st p in A ex a be
  Subset of T st a in U & p in a & a c= A
  proof
    let A be Subset of T such that
A9: A is open;
    let p be Point of T such that
A10: p in A;
    reconsider p9=p as Point of M;
    consider r be Real such that
A11: r>0 and
A12: Ball(p9,r) c= A by A9,A10,TOPMETR:15;
    reconsider r as Real;
    consider n be Nat such that
A13: n>0 and
A14: 1/n<r/2 by A11,UNIFORM1:1,XREAL_1:215;
A15: 1/n+1/n<r/2+r/2 by A14,XREAL_1:8;
    reconsider n1=n-1 as Element of NAT by A13,NAT_1:20;
    reconsider fn=f.n1 as Subset-Family of T;
    the carrier of M = union fn by A6;
    then consider x be set such that
A16: p in x and
A17: x in fn by TARSKI:def 4;
    reconsider x as Subset of M by A17;
    consider w be Point of M such that
A18: x=Ball(w,1/(n1+1)) by A6,A17;
    reconsider B=Ball(w,1/n) as Subset of T;
    take B;
    f.n1 in rng f by A7,FUNCT_1:def 3;
    then B in union rng f by A17,A18,TARSKI:def 4;
    hence B in U & p in B by A16,A18,CARD_3:def 4;
    let q be object such that
A19: q in B;
    reconsider q9=q as Point of M by A19;
A20: dist(q9,w)<1/n by A19,METRIC_1:11;
    dist(w,p9)<1/(n1+1) by A16,A18,METRIC_1:11;
    then
A21: dist(q9,w)+dist(w,p9)<1/n+1/n by A20,XREAL_1:8;
    dist(q9,p9)<=dist(q9,w)+dist(w,p9) by METRIC_1:4;
    then dist(q9,p9)<1/n+1/n by A21,XXREAL_0:2;
    then dist(q9,p9)<r/2+r/2 by A15,XXREAL_0:2;
    then q in Ball(p9,r) by METRIC_1:11;
    hence thesis by A12;
  end;
  set CB=the set of all card B where B is Basis of T ;
  U c= the topology of T
  proof
    let x be object;
    assume x in U;
    then x in union rng f by CARD_3:def 4;
    then consider y such that
A22: x in y and
A23: y in rng f by TARSKI:def 4;
    reconsider X=x as Subset of T by A22,A23;
    consider z be object such that
A24: z in dom f and
A25: f.z=y by A23,FUNCT_1:def 3;
    reconsider z as Element of NAT by A24;
    f.z=y by A25;
    then ex w be Point of M st X=Ball(w,1/(z+1)) by A6,A22;
    hence thesis by PCOMPS_1:29;
  end;
  then U is Basis of T by A8,YELLOW_9:32;
  then
A26: card U in CB;
  now
    let x;
    assume x in dom f;
    then reconsider i=x as Element of NAT;
    reconsider fx=f.i as Subset-Family of T;
    fx is finite by A6;
    hence f.x is countable by CARD_4:1;
  end;
  then U is countable by A7,CARD_4:2,11;
  then
A27: card U c= omega by CARD_3:def 14;
  weight T = meet CB by WAYBEL23:def 5;
  then weight T c= card U by A26,SETFAM_1:3;
  then weight T c= omega by A27;
  hence thesis by WAYBEL23:def 6;
end;

theorem Th33:
  for T be non empty TopSpace holds T is second-countable implies
  for F being Subset-Family of T st F is Cover of T & F is open ex G being
  Subset-Family of T st G c= F & G is Cover of T & G is countable
proof
  let T be non empty TopSpace;
  assume T is second-countable;
  then consider B being Basis of T such that
A1: B is countable by TOPGEN_4:57;
A2: card B c= omega by A1,CARD_3:def 14;
  let F being Subset-Family of T such that
A3: F is Cover of T and
A4: F is open;
  defpred P[object,object] means
   ex D2 being set st D2 = $2 &
for b be Subset of T st b=$1 holds ((ex y st y in F
  & b c= y) implies ($2 in F & b c= D2)) & ((for y st y in F holds not b c= y)
  implies $2={});
A5: for x being object st x in B
ex y being object st y in bool(the carrier of T) & P[x,y]
  proof
    let x be object;
    assume x in B;
    then reconsider b=x as Subset of T;
    per cases;
    suppose
      ex y st y in F & b c= y;
      then consider y such that
A6:   y in F and
A7:   b c= y;
      reconsider y as Subset of T by A6;
      take y;
      thus y in bool the carrier of T;
      take y;
      thus thesis by A6,A7;
    end;
    suppose
A8:   for y st y in F holds not b c= y;
      take y={}T;
      thus y in bool the carrier of T;
      take y;
      thus thesis by A8;
    end;
  end;
  consider p be Function of B,bool(the carrier of T) such that
A9: for x being object st x in B holds P[x,p.x] from FUNCT_2:sch 1(A5);
  take RNG=rng p\{{}};
A10: dom p=B by FUNCT_2:def 1;
  thus RNG c= F
  proof
    let y be object such that
A11: y in RNG;
    y in rng p by A11,XBOOLE_0:def 5;
    then consider z be object such that
A12: z in dom p and
A13: p.z=y by FUNCT_1:def 3;
    reconsider z as Subset of T by A10,A12;
A14: P[z,p.z] by A9,A12;
     (ex y st y in F & z c= y) or for y st y in F holds not z c= y;
    then p.z in F & z c= p.z or p.z={} by A14;
    hence thesis by A11,A13,ZFMISC_1:56;
  end;
  the carrier of T c= union RNG
  proof
    let y be object;
    assume y in the carrier of T;
    then reconsider q=y as Point of T;
    consider W be Subset of T such that
A15: q in W and
A16: W in F by A3,PCOMPS_1:3;
    W is open by A4,A16;
    then consider U be Subset of T such that
A17: U in B and
A18: q in U and
A19: U c= W by A15,YELLOW_9:31;
A20: p.U in rng p by A10,A17,FUNCT_1:def 3;
    then reconsider pU=p.U as Subset of T;
    P[U,p.U] by A9,A17;
    then
A21: U c= pU by A16,A19;
    then pU in RNG by A18,A20,ZFMISC_1:56;
    hence thesis by A18,A21,TARSKI:def 4;
  end;
  then [#]T=union RNG by XBOOLE_0:def 10;
  hence RNG is Cover of T by SETFAM_1:45;
  card rng p c= card B by A10,CARD_2:61;
  then card rng p c= omega by A2;
  then rng p is countable by CARD_3:def 14;
  hence thesis by CARD_3:95;
end;

begin :: The main theorem

theorem Th34:
  for M be non empty MetrSpace holds TopSpaceMetr M is compact iff
  TopSpaceMetr M is countably_compact
proof
  let M be non empty MetrSpace;
  set T=TopSpaceMetr M;
  thus T is compact implies T is countably_compact;
  assume
A1: T is countably_compact;
  let F be Subset-Family of T such that
A2: F is Cover of T and
A3: F is open;
  M is totally_bounded by A1,Th31;
  then T is second-countable by Th32;
  then consider G be Subset-Family of T such that
A4: G c= F and
A5: G is Cover of T and
A6: G is countable by A2,A3,Th33;
  G is open by A3,A4;
  then ex H be Subset-Family of T st H c= G & H is Cover of T & H is
  finite by A1,A5,A6;
  hence thesis by A4,XBOOLE_1:1;
end;

theorem Th35:
  for X be set, F be Subset-Family of X st F is finite for A be
  Subset of X st A is infinite & A c= union F ex Y be Subset of X st Y in F & Y
  /\ A is infinite
proof
  defpred P[object,object] means
    ex D2 being set st D2 = $2 & $1 in D2;
:: Choice !!!
  let X be set, F be Subset-Family of X such that
A1: F is finite;
  let A be Subset of X such that
A2: A is infinite and
A3: A c= union F;
  set I=INTERSECTION (F,{A});
  card [:F,{A}:] =card F by CARD_1:69;
  then card I c= card F by TOPGEN_4:25;
  then
A4: I is finite by A1;
A5: for x being object st x in A ex y being object st y in I & P[x,y]
  proof
    let x be object such that
A6: x in A;
    consider y such that
A7: x in y and
A8: y in F by A3,A6,TARSKI:def 4;
    take y/\A;
    A in {A} by TARSKI:def 1;
    hence y/\A in I by A8,SETFAM_1:def 5;
    take y/\A;
    thus thesis by A6,A7,XBOOLE_0:def 4;
  end;
  consider p be Function of A,I such that
A9: for x being object st x in A holds P[x,p.x] from FUNCT_2:sch 1(A5);
  consider x being object such that
A10: x in A by A2,XBOOLE_0:def 1;
  ex y being object st y in I & P[x,y] by A5,A10;
  then dom p=A by FUNCT_2:def 1;
  then consider t be object such that
A11: t in rng p and
A12: p"{t} is infinite by A2,A4,CARD_2:101;
  consider Y,Z be set such that
A13: Y in F and
A14: Z in {A} and
A15: t=Y/\Z by A11,SETFAM_1:def 5;
  reconsider Y as Subset of X by A13;
  take Y;
A16: Z = A by A14,TARSKI:def 1;
  p"{t} c= Y/\A
  proof
    let z be object such that
A17: z in p"{t};
    p.: detailed in :: See COPYING.GPL and COPYING.CC-BY:: licenses, or see http://www.gnu.org/by-sa/3.0/.
    then
A18:  p.z=t by TARSKI:def 1
    [pz  A9,
    henceRLVECT_3,RLSUB_1, ,
  end
  hence thesis by A12,A13;



  for M be Carrier(L =A \/BbyRLVECT_2:ef6
  A7:   x in Carrier(L) and
proof
  let M be non empty MetrSpace;
=M
 implies  &Miscomplete byTBSP_18,9
  assume that
A1A14:w inrngF by,A12,RLVECT_5:3;
A2: M is complete;
  now
  Fw  ^ Fw2
    deffunc     A11A14,
=  M
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 34
for a,b be Subset of M st $1=a & $2=b holds b c=
    a & diameter b <= (diameter a)/2;
    defpred Q[object] means
for a be Subset of M st a=$1 holds a is bounded & a
    is infinite & a is closed;
    consider seq be Real_Sequence such that
A3: for n be Nat holds seq.n=F(n) from SEQ_1:sch 1;
    set Ns=NULL(#)seq;
A4: for x being object st x in bool cM & Q[x]
   ex y being object st y in bool cM & P[x,y] & Q[y]
    proof
      let x being object such that
A5:   x in bool cM and
A6:   Q[x];
      reconsider X=x as Subset of M by A5;
      reconsider X9=X as Subset of T;
      set d=diameter X;
      per cases by A6,TBSP_1:21;
      suppose
A7:     d=0;
        take Y=X;
        thus thesis by A6,A7;
      end;
      suppose
A8:     d>0;
        then d/4>0 by XREAL_1:224;
        then consider F be    .= (L (#)Fw1) ^ * a*Fw2) by RLVECT_226;
A9:     F is finite . SumL# )+((* a* >)  ( #) )by41
    .= SumL()Fw1) +(L() Fw2 +a*w RLVECT_144
. ( ()Fw1^ Fw2) + aw by:;
        (w,d/4) byjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
y;
        then consider Y be Subset of M such that
A12:    Y in F and
A13:    Y /\ X  = Lin(\/ )
YXY/X
A14:    ex w be Point of M st Y = Ball(w,d/4) by A11,A12;
        then
A15:    Y is bounded;
         B linearly-;
 <diameterY byTBSP_1:4X:;
diameter Y<2(d /) A8,14,:23X:224;
        then
A17:    diameter YX<=d/2 by A16,XXREAL_0:2;
             consider C being finite Subset of V such that
         Cl     M
        java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 17
:18
A19:    yx c= X9 by java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 15
         closed A6
then
:X9isclosedbyTh6;
        YX is bounded by A15. w\ (Bv\{w} \/ {)4
        hence thesis by A23: Bv c= B & C = Cw \/ {w} by A17,Lm1,XBOOLE_1:36;
      end;
    end       x inB \ Cw or {}by :def 3java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
considerGbe Family ofMsuchthat
A21: G is finite and
A25 the  V=Lin( /Cw byA12,24
: forCSubset  stCin exBall(w,1/
    2A28:cardB = 0 and
    e Subsetof T
    A30:for being Nat holdsP[m]from NAT_1sch ( A1)
then X Subset M  that
 XGand
,A22,Th35;
    reconsider XA=X/\A as Subset of M;
XA as  T
    reconsider CXA=Cl xa as Subset of M;
A26:XAis  &diameter XA <1
    roof
M X =w12 byA23,;
n
A28:  diameter X<=2*(1/2) by TBSP_1:23;
A29:    proof
thenXA<  :2417
hence thesisby ,A28,TBSP_1:14,XBOOLE_1:17,XXREAL_0:2;
    end;

    thenassume v  (.;
A30:    L)by 1;
    xa c= Cl xa by PRE_TOPC:18;
    then
A31:A7:    CarrierLA)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
    consider f be then ex i being object i  &w  .ibyA2,FUNCT_1d3
NAT  f c and
A33: f.0 =        hence thesis;
 thenex being Linear_Combination ofC  ( =LC) 
    TREES_2:sch 5(A31,A4);
    reconsider f as SetSequence of M by A32,FUNCT_2:2;
A35: for n holds f.n is bounded by A34;
A36: now
      let x be object;
      assume x in dom f;
      then reconsider i=x as Element of NAT;
      f.i is infinite by A34;
      hence f.x is non empty;
    end;
    for n holds f.n is closed by A34;
    then reconsider f as non-empty pointwise_bounded closed SetSequence of M
    by A36,A35,Def1,Def8,FUNCT_1:def 9;
A37: Ns.0=NULL*seq.0 by SEQ_1:9;
    for n be Nat holds f.(n+1) c= f.n
     by A34;
    then
A38: f is non-ascending by KURATO_0:def 3;
    set df=diameter f;
    defpred N[Nat] means Ns.$1 <= df.$1 & df.$1<=seq.$1;
A39: for n be Nat st N[n] holds N[n+1]
    proof
      let n be Nat;
      assume N[n];
      then df.n<=F(n) by A3;
      then
A40:  (df.n)/2<=F(n)/2 by XREAL_1:72;
      set n1=n+1;
A41:  diameter (f.n)=df. n by Def2;
      diameter (f.n1)<=(diameter (f.n))/2 by A34;
      then df.n1<=(df.n)/2 by A41,Def2;
      then
A42:  df.n1<=F(n)/2 by A40,XXREAL_0:2;
A43:  Ns.n1=NULL*seq.n1 by SEQ_1:9;
      f.n1 is bounded by Def1;
      then
A44:  0<= diameter (f.n1) by TBSP_1:21;
      n1+1<=(n1+1)+n by NAT_1:11;
      then
A45:  F(n1)>=1/(2*n1) by XREAL_1:118;
      1/(2*n1)=F(n)/2 by XCMPLX_1:78;
      then F(n1)>=df.n1 by A42,A45,XXREAL_0:2;
      hence thesis by A3,A44,A43,Def2;
    end;
A46: seq.0=1/(1+0) by A3;
A47: for n be Nat holds seq.n=1/(n+1) by A3;
    then
A48: seq is convergent by SEQ_4:31;
    diameter CXA <= 1 by A26,Th8;
    then
A49      hence v in Lin(C by A6R:1;
   beNat []fromNAT_1: 2A49A39);
A51: Ns is convergent by A47,SEQ_2:7,SEQ_4:31;
A52:limseq0 A47S31
    then
A53:     thenexv objectst v B& not inC;
    
 lim df  0  A48,A52,A51A50,:;
    then meet f is non empty by A2,A38,Th10;
    then consider p be object such that
A55: p in meet f by XBOOLE_0:def 1;
    reconsider p as Point of T by A55;
    reconsider p9=p as Point of M;
A56: df is convergent by A48,A52,A51,A53,A50,SEQ_2:19;
    now
      let U be open Subset of T;
      assume p in U;
      then consider r be Real such that
A57:  r>0 and
A58:  Ball(p9,r) c= U by TOPMETR:15;
      r/2 >0 by A57,XREAL_1:215;
      then consider n be Nat such that
A59:  for m be Nat st n<=m holds |.df.m-0.|<r/2 by A54,A56,
SEQ_2:def 7;
      p in f.n by A55,KURATO_0:3;
      then
A60:  {p} c= f.n by ZFMISC_1:31;
      f.n is infinite by A34;
      then {p} c<f.n by A60,XBOOLE_0:def 8;
      then f.n\{p} <>{} by XBOOLE_1:105;
      then consider q be object such that
A61:  q in f.n\{p} by XBOOLE_0:def 1;
      reconsider q as Point of T by A61;
A62:  q in f.n by A61,ZFMISC_1:56;
A63:  q in f.n by A61,ZFMISC_1:56;
      reconsider q9=q as Point of M;
      q<>p by A61,ZFMISC_1:56;
      then
A64:  dist(p9,q9)<>0 by METRIC_1:2;
      reconsider B=Ball(q9,dist(p9,q9)) as Subset of T;
A65:  dist(p9,q9)>=0 by METRIC_1:5;
      dist(q9,q9)=0 by METRIC_1:1;
      then
A66:  q in B by A64,A65,METRIC_1:11;
      Ball(q9,dist(p9,q9)) in Family_open_set M by PCOMPS_1:29;
      then
A67:  B is open by proof
fn c=Cl xa A33A38,def 4
 xa A67A66,PRE_TOPC:;
      then consider s be object such that
   inBand
A69:  s in xa by XBOOLE_0:3;
reconsider  Point  M byA68;
      reconsider s9=A18:dom   dom by FINSEQ_1:3;
      take s9;
A70:  Ns.n=NULL*seq.n by SEQ_1:9;
A71:  |.df.n-0.|<r/2 by A59;
A72:  f.n is bounded by A34;
      df.n>=Ns.n by A50;
      then df.n<r/2 by A70,A71,ABSVALUE:def 1;
      then
A73:  diameter (f.n) < r/2 by Def2;
      p in f.n by A55,KURATO_0:3;
      then dist(p9,q9)<=diameter (f.n) by A63,A72,TBSP_1:def 8;
      then
A74:  dist(p9,q9)<r/2 by A73,XXREAL_0:2;
      dist(q9,s)<dist(p9,q9) by A68,METRIC_1:11;
      then dist(q9,s)<r/2 by A74,XXREAL_0:2;
      then
A75:  dist(p9,q9)+dist(q9,s)< r/2+r/2 by A74,XREAL_1:8;
      dist(p9,s)<=dist(p9,q9)+dist(q9,s) by METRIC_1:4;
      then dist(p9,s)<r by A75,XXREAL_0:2;
      
A76:A21:P[i y2];
      s in A by A69,XBOOLE_0:def 4;
      hence s9 in A/\U & s9<>p by A58,A68,A76,METRIC_1:11,XBOOLE_0:def 4;
    end;
    hence Der A is non empty by TOPGEN_1:17;
  end;
  then T is countably_compact by Th27;
  hence thesis by Th34;
end;

begin :: Well spaces

theorem Th37:
  for M be MetrStruct, a be Point of M,x holds x in [:X,(the
carrier of M)\{a}:]\/{[X,a]} iff ex y be set,b be Point of M st x=[y,b] & (y in
  X & b<>a or y = X & b = a)
proof
  let M be MetrStruct,a be Point of M, x;
  thus x in [:X,(the carrier of M)\{a}:]\/{[X,a]} implies ex y be set,b be
  Point of M st x=[y,b] & (y in X & b<>a or y = X & b = a)
  proof
    assume
A1: x in [:X,(the carrier of M)\{a}:]\/{[X,a]};
    per cases by A1,XBOOLE_0:def 3;
    suppose
      x in [:X,(the carrier of M)\{a}:];
     of that
:x1inX and
:x2(of ){} and
A4:   x=[x1,x2] by ZFMISC_1:def 2    consider i  ElementofNAT such
      reconsider  rngq by,A26,UNCT_1:def 3java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
      java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 6
       ,x2;
s,,ZFMISC_1:;
e;
    suppose
      x in
      then x card  B
      hence thesis;
java.lang.StringIndexOutOfBoundsException: Range [6, 4) out of bounds for length 8
  ;
  given y be Vbeing 0V  
A5: x=[y,b] and
A6: y in X & b<>.= {0.V9} by RUSUB_1
     
  theoremTh7:
A7: y in Xjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
     Ac=
    proof
       proof
A8:   thelet  djava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 47
      then a={} by java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 11
      java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 36
    then b in cA being finite Subset of V such that
thenin[X,the arrierM){}]by A5A7ZFMISC_1:java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
    def ;
 ;
  suppose
   y =  b=a
    then x in {    be
    hencejava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 72
  end;
 card=cardIbyA1,Th2


  let M be MetrStruct;
  let a be Point of M;
  let X be set;
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 76
   
  :Def10:
  for x,:(mega).   RUSUB_1def
   ,beobject,x2,y2 be ofM
   [,]&   y1]holdsx1 = y1it(,y =distx2y2)) &
  (x1 <> y1 implies it.(x,y) =   holds dim V = dim W iff (Omega).VV W  OmegaV = Omega.W

  
    XX[,t ofM\a:\{Xa]}

   for x,y be Element of XX st x=$1 & y=$2
   for x1,y1 be object, x2,y2 be Point of M
   st x=[x1,x2] & y=[y1,y2] holds (x1=y1 implies
    $3=dist(x2,y2))&(x1<>y1 implies $3=dist(x2,a)+dist(a,y2));
A1: for x,y being object st x in XX & y in XX
     ex z be object st z in REAL & P[x   byDef2;
    proof
      let x,y be object such that
A2:   x in XX     (Omega).V = t UNITSTRof VbyRUSUB_1:def3
A3:   y in XX;
      consider y1 be set,y2 be Point of M such that
A4:   y=[y1,y2] and
      y1 in X & y2<>a or y1 = X & y2 = a by A3,Th37;
      consider x1 be set,x2 be Point of M such that
A5:   x=[x1,x2] and
      x1 in X & x2<>a or x1 = X & x2 = a by A2,Th37;
        per cases;
        suppose
A6:       x1 = y1;
          take d=dist(x2,y2);
          thus d in REAL by XREAL_0:def 1;
          let x9,y9 be Element of XX such that
A7:       x9 = x and
A8:      .= the UNITSTR of W by RUSUB_3:def 2
          let       .= (Omega.W by :def3java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
A9:       x9 =  . the   by RUSUB_1def 3;
A10:      y9 = [y19,y29];
A11:      x29=x2 by A5,A7,A9   B of ;
          x19=x1. Lin()by A7Th9
          hence (x19    V finite-imensionalRealUnitarySpaceholds   = 0
          = dist( considerIbeingfinite Subsetof V  that
        end;
        suppose
A12:. Lin(I byA2RUSUB_3def
takeddist(,)+dist(a,2;
          thus d in REAL by XREAL_0:def 1;
let,beElementof Xsuch that
end
A14:      y9=y;
let x19,y19 be object, x29,y29    M that
A15 x9 =[x29 and
A16:      y9 = [y19,y29];
A17:      x29=x2 by A5,A13,A15,XTUPLE_0:1;
          x19=x1 by A5,A13,A15,XTUPLE_0:1;
          hence (x19 = y19 implies d = dist(x29,y29) ) & (x19 <> y19 implies d
          = dist(x29,a)+dist(a,y29)) by A4,A12RUSUB_1def;
        end;
    end;
    consider f being Function of [:XX,XX:],REAL such that
A18: for x,y being object st x in XX & y in XX holds P[x,y,f.(x,y)]
    from BINOP_1:sch 1( A1 );
    take f;
    thus thesis by A18;
  end;
  uniqueness
  proof
    set XX=[:X,(the carrier of M)\{a}:]\/{[X,a]};
    let w1,w2 be Function of [:XX,XX:],REAL such that
A19hereby
for x1,y1 be  I Basisof  byDef1java.lang.StringIndexOutOfBoundsException: Range [28, 29) out of bounds for length 28
x = [x1,x2assumeIc {;
    )+(ay2  and
: forxy be Element of XX
for x1,y1 be object, x2,y2 be Point of vasVECTORofV byA4;
x = [x1,x2] :notw in{, v};
    <  implies w2(x,y  (x2,a+dist(ay));
    
      let x,y such that
A21:        hence;
A22:  y in XX;
      consider y1 be t
23y[1y2 and
y1  <a   X    aby 22,;
 setx2bePointof  suchthat
A24:  xTh15:
      x1inX& x2<aor =X& =a A21,h37
      reconsider x2,y2 as Point of M;
      x1=y1 or x1<>y1;
      then:I is Basisof / W2java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
      w1.(x,y)=dist java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 46
      dist(a,y2) & w2.(x,y)=dist(x2,a)+dist(    then reconsider I19  as java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 79
       (,)=w2.x,y)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
;
    hence thesis by BINOP_1:1;
  ;
end;

      t yinthe  of  ory  A9,:def 1
   M  MetrStruct, Point   for be non   holds(
  java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
   impliesM  symmetric )&(well_dist(,) is triangle Reflexive
implies M is triangle ) & (well_dist(a,X) is discerning java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 42
  discerning     
proof
  let M be     then x in thethen x in the UNITSTR of W2 by RUSUB_3:def 2;
  let X be non empty set;
  consider x0 be object such that
A1: x0 in X by XBOOLE_0:def 1;
  well_dist(X;
  setXX:,the  of M){}]/[,];
  thus
A2: w      {x    x by :40
  proof
    assume
A3: w is Reflexive;
    now
      let a be Element of M;
      now
        per cases;
        suppose
  set A=I1\ ;
          then
inXXby Th37java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
          hence dist(a,a) = w.([X,a],[X,a]) by Def10
            .= 0 by A3,A4;
        end;
suppose
          a<>A;
          then
A5:       [x0,a] in XX by A1  end
          (,a  w.(x0,][,a)byDef10
 .  by ,A5;
        end;
      end;
      hence dist(a,a) = 0;
    end;
    hence thesis by METRIC_1:1;
  end;
   M is 
  :SumL = L()Fby RLVECT_2:def8java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
    
A6: w is symmetric;
    now
      let a, rng  =rng java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
      
       per cases
        suppose
          a=A & b=A;
      = B by XBOOLE_1:java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
        end;
        suppose
A7:       a=A & b<>A;
          then
A8:       [x0,b] in XX by A1,Th37;
A9:       [X,A] in XX by Th37;
          reconsider xx = x0 as set by TARSKI:1;
          not xx in xx; then
 X>x0by ;
          AA+(Ab  w(XA,x0])byA9A8,Def10,
            .= w.= (  byXBOOLE_1:;
            .= dist(b,A)+dist(A,A) by A9,A8,A10,Def10;
          hence dist(a,b)dist(b,)byA;
        end;
        suppose
A11:      a<>A & b=A;
          then
A12:      [x0A30 (L1missesCarrier(;
      X,A]  XX  ;
          reconsider xx = Carrier(L2)c   ,,BOOLE_143
          not:SumK2) =Sum(L2) by RUSUB_3:20,BOOLE_1:;
A14:      X<>x0 by A1;
          thendistAA)A,a  (X,A,x0,a])byA13A12,ef10
            =w.[x0,][,A)  A13,A12
            .= dist(a,A)+dist(A,A) by A13,A12,A14,Def10;
          hence dist(a,b)=dist(b,a) by A11;
        end;
        suppose
      a<> & >;
          then
:[x0,]in XX A1,Th37;
      x0a]inXX by,,Th37;
          hence        A,:def3;
            . w.(x0],[0,]  A6A17Ajava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
            .= dist(b,a) by A17,A16,Def10      endjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
        end;
      end;
      hence dist(a,b) = dist(b,a);
    end;
    hence thesis by METRIC_1:3;
  end;
  thus w is triangle Reflexive implies M is triangle
  proof
    assume
A18: w is triangle Reflexive;
    now
      let a,b,c be Point of M;
      now
        per cases;
        suppose
          a=A & b=A & c =A;
          then reconsider Xa=[X,a],Xb=[X,b],Xc =[X,c] as Element of XX by Th37;
A19:      dist(a,c)=w.(Xa,Xc) by Def10;
A20:      dist(a,b)=w.(Xa,Xb) by Def10;
          w.(Xa,Xc)<=w.(Xa,Xb)+w.(Xb,Xc) by A18;
          hence dist(a,c)<=dist(a,b)+dist(b,c) by A19,A20,Def10;
        end;
        suppose
A21:      a=A & b=A & c <> A;
          dist(a,a)=0 by A2,A18,METRIC_1:1;
          hence dist(a,c)<=dist(a,b)+dist(b,c) by A21;
        end;
        suppose
:      =A&b> & c 
          then A46: I \/ I2 = I2 by A2:12
,Th37;
          A49: Carrier(LI) = Carrier(KI) and
          not xx in xx; then
A23:      x0<>X by A1;
          then
A24:      dist(b,c)then Carrier(I+L2  Carrier()/Carrier() & (LI)\
A25:      dist(a,a)=0 A52:Carrier(I  L2) c=I2;
:w.(aXc<=w.(aXb+w.(Xb,c) y A18;
dist,a+ab=.Xa) A22,23,Def10;
    .  (LI + L2)by A35,36,A50,:5
        ;
        suppose
A27:      a=A & b<>A & c <> A;
          then reconsider
          Xa=[X,a],Xb=[x0,b],Xc =[x0,c] as Element of XX by A1,Th37;
          reconsiderxx=x0 as set byTARSKI:;
          not xx in xx; then
A28:      x0<>X by A1;
          java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
A29:      dist(a,a)VECTOR of W2 byA58
A30:      dist(a,a)=0 by A2,A18,METRIC_1:1;
A31:      w.(Xa,Xc)<=w.(Xa,Xb)+w.(Xb,Xc) A61:w2=SumK2 byRUSUB_3:1;
          dist(a,a)+dist(A63:Sum(L2)=Sum(2 by 19
         ac)=dist,)dist(b,c A31A29,A30Def10
        end;
        suppose
A32:      a thenCarrier()c=I1 \ ;
          dist(c,c)=0 by A2,A18,METRIC_1:1;
          hence dist(a,c)<=dist(a,b)+dist(  end;
        
        suppose
A33:      a<>A & b=A & c <>A;
          then  by A15,A67,Def2
Xa[,a]Xb[,b, [,c Element XX A1;
          reconsider xx = x0 as set by TARSKI:1;
notxxinxx; thenFUNCOP_1,  FOMODEL0 ,FOMODEL3,
:x0<  ;
          
A35  let V be finite-dimensional RealUnitarySpace;
      dist()0by,,METRIC_1;
:.Xa,)<w(a,+.Xb,Xc) byA18;
distb+(bb=.X,Xb  A33,,;
hencedist(,c<dist(,+dist(b,c)      java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
      RE,XREAL_1,CARD_1,WAYBEL12,COHSP_1 ,java.lang.StringIndexOutOfBoundsException: Range [0, 69) out of bounds for length 7
        suppose
 &c  
thenreconsider
          Xa=[x0,a  then
SKI:1;
          not xx in xx; then
A39:      x0<>X by A1;
          java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
:distb,+ ofS ,t1t2t3 fortermalof
A41:      dist(c,c)=0 by A2,;
A42:java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
a)dc=(,Xcby A38,39Def10;
          hence dist(a,c;
end

          a<A  <A  c>A;
          then java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 9
          Xa=[x0,a],Xb=[y being wff string of S suA1:z[,y& x ;
      ac=.,  Def10java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
A44:      dist(a,b)=w.(Xa xisS-sequent-like
          w.SX
           (ac<(b)bA43Def10
       
      end;
hence dist(a,c)<=dist(a,b)+dist(b,c);
    endefinition
hencethesis yMETRIC_14java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
   R  isb S-sequents,bool(S-sequents));
  assume
A45: w is discerning Reflexive;
  now
letabbePointofM
    
A46: dist    =n;
    ow
      per cases;
      suppose
        a=A & b=A;
        b
      java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 10
      java.lang.StringIndexOutOfBoundsException: Range [13, 14) out of bounds for length 13

        thenend;
          reconsidercluster [, >Ss-;
          not       consider  being finite Subset of  such that
        x0<>X by A1;
        then
A5:x= LinA by ,RUSUB_3:ef
        ist,)0  A2AM:1java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
          uniqueness
e=b by XTUPLE_0:1;
wff ofS
      supposeAFAllFormulasOf S;  =hi1phi22phi2 
A49    hence thesisAF; [phi2 isS-like
thenjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
          reconsiderxx=x0assetby TARSKI;
 xxthen
x0> by;
        then
    ab+b,)w(Xa,Xb byA49Def10
)=0b A2A45,METRIC_1:;
        then Xa=Xb by A45    Def3;
        java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 32
      end;
      suppose
        a  let n beElement ofNAT;
A2let ,phijava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
        distuSubspaces_of V clusternullS >S-java.lang.StringIndexOutOfBoundsException: Range [36, 37) out of bounds for length 36
        thenhence by ,
        hence a=b by XTUPLE_0:1;
      end;
    end;
    hence a=b;
  end;
  hence thesis by METRIC_1:2;
end;

definition
  let M be MetrStruct;
  let a be Point of M;
  let X be set;
  func WellSpace(a,X) -> strict MetrStruct equals
  MetrStruct ([:X(he
    carrier of M)\{a}:]\/{[X,a]},well_dist(a,X)#);
  java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
end;

registration
  let end;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  let registr
  cluster \H2-S   n by A2Def3java.lang.StringIndexOutOfBoundsException: Range [36, 37) out of bounds for length 36
  coherence;
end

Lm8: for M be MetrStructL.   (unionD). S};
a,X)reconsider RR=nion  asRelation of  Qby FOMODEL0;
ofbool,    being Elementof bool Q
(  discerningXjava.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
is discerning)
proof
    be a  M,java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
  sethence  :3java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
  set w=well_dist(a,XiterODm=(-)&dom(D /
setWWjava.lang.StringIndexOutOfBoundsException: Range [40, 19) out of bounds for length 40
  thus M is Reflexive implies W is Reflexive

    assume
:is Reflexivejava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
    java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 5
      let java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 y  ,b   such
:A[, 
      y in X & b<>a or y = X & b = a by Th37;
      thus w.(A,A) = dist(b,b) by A2,Def10
        .= 0 by A1,METRIC_1:1;
    end;
    then w is Reflexive;
    hence thesis;
  end;
  thusjava.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 43
  proof
ssumeM symmetric;
    hen reconsider  as  ;
    reconsider a as Point     {}V;
    now
      let A,B be Element of XXend;  let  be , W  Subspace 
      consider
A3:by :;
   in  b1<a  y1 =X&b1  by Th37java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
      isotone
A5:   B=[y2,b2] and
A6:   y2 cluster {M}
now
        per cases by A4,A6;
        suppose
ajava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
          hence w.(A,B)=w.(B,A) by A3,A5;
        end    olds attr Seqts i D- means    (}D-erivable
        suppose
        >;
          hence w(A1 x (W) 
            =(a,1)+dist(,b2)
            .=
            .= w.(B,A) yA3,,7,Def10;
        java.lang.StringIndexOutOfBoundsException: Range [0, 11) out of bounds for length 5
        suppose
A8:      b1<>a & b2<ejava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
          w(take ;
        .=dist,b1)
            ..BA V , ofVsVinA
       ;
      end;
      hence w.(A,B)=w.(B
   being V  beingRealstina*injava.lang.StringIndexOutOfBoundsException: Range [66, 67) out of bounds for length 66
java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 24
 thesis
  end;
  thus M is triangle symmetric Reflexive java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 4
  proof
    assume
: trianglejava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
now
      let  coherencebyLm3java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
      consider y1 be set,b1 be Point of M such that
{t,t2 where t2    :
      in &<a y1 X&=abyTh37;
     y2 be, bePoint ofMsuch 
:B[y2,2]and
      y2 in X & b2<>a or y2 = X & b2 = a by Th37;
3 be of M such that
A12:  CaA1  isexpanded
      x   by x Xby :31
     
 cases
        end
13:     =2redefine (D-ermEq->Relationof(AllTermsOfS;
          then
b3)=w.(B,)byA11,A12,Def10
:distb1=.AB) ,A11,A13,Def10;
          hence A is-likeby java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
          hence w.(A,C)<=w.(A,    letx beobject;
        ;
        suppose
A16:  in[AllTermsOf S,  ];
          then
      (2a)+(,b3=.BC ,Djava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
      dist(b1,b2)=dist(redefine  [x phi ] >of -sequentsjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
A19:hencethesis;
        (,)+(,2=.(,) by A10,A11,A16,;
          java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 5
 b1,)dist(2,b3)=w.AB+   thesis A7java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
A21:      java.lang.StringIndexOutOfBoundsException: Range [0, 14) out of bounds for length 7
          dist(b1,b3)=w.(A,C) by A10,A12,A16,Def10;
          hence w.(A,C)<=w.(A,B)+w.(B;
        end;

A22:      =2&y1>;
A23:      dist(b1,a)<=dist(b1,b2) + dist(b2,a) by A9,METRIC_1:4;
          dist(b1,a)+dist(a,b3)=w.(A,C) by A10,A12,A22,Def10;
          then
A24:      w.(A,C)<=dist(b1,b2)+dist(b2,a)A2:yinUp()java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
A25:      dist(b2, xin by A1
          dist(b1,b2)=w.(A,B) by A10,A11,A22,Def10;
          hencewAC<w(,B+.,  ,24
        end;
        suppose
A26:      y1<>y2 & y1<>y3 & y2<>y3;
A27:      0<=dist(b2,a) by A9,METRIC_1:5;
          dist(b2,a)+dist(a,  let Vbe;
          then
A28:      0+dist(a,b3)<=w.(B,C) by   for x being st x  the carrier of Lin()holds in 
A29:      0<=dist(a,b2) by A9,METRIC_1:5;
          dist(b1,a)+dist(a,b2)= w.A2:exbeingof A x  l by :1;
          then
A30:      dist(b1,a)+0<=w.(A,B) by A29,XREAL_1:6;
          dist(b1,a)+dist(a,b3)=w.(A,C) by A10,A12,A26,Def10;
          hence w.(A,C)<=w.(A,B)+w.  then
        end;
        suppose
A31:      y1<>y2 & y1<>y3 & y2=y3;
A32:      dist(a,b3)<  for being  st x in A holds x in the carrier of Lin()
          dist(b1   Ac thecarrier ofLin)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
          then
A33:      w.(A,C)<let be  ofVjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
A34    x,y being Element of V, a being Real
          dist(,a+,) (AB  A10A11,31Def10;
          hence .(,C)=w(,)w(,)  A34,A33;
        end;
      end;
      hence w.then f=}by : 2;then .Xc  by:2java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
    end;
    then w is triangle;
hencethesis;
endjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
  assume
A35: M is triangle {R.:{X} where R is Subset[bool(-),bool(-)]R inD})
 now
,   ofXXjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
     y1beset,    M suchthat
A36
:  X> or     
    consider y2 be set,b2 be Point of M such that
A38 =y2,2 
A39: y2 in X & b2<>a or y2 = X &     then
    assume
:w(,B)0java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
    now

      suppose
:   =java.lang.StringIndexOutOfBoundsException: Range [14, 15) out of bounds for length 14
        then w.(A,B)=Y such that A1: y in Y Y  (([*]).:X;
        :2;
      end;
      suppose
        >java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
        then
A42:    w(AB=(,a)dist(,2 byA36,ef10
A43:    dist(b1,a)>=0 by A35,METRIC_1:5;
        dist(a,b2)     reconsider X SubsetV;
        then dist(b1,a)=0 
        henceAyinY&Y Im(iterOm),)by , 2,A4 3
      end is(,java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 34
    endA1    Om)by java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
    =B
  end;
   is;
  hence thesis;
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4

registration
  let M be Reflexive MetrStruct;
  let a be Point of M;
  let X be set;
  cluster WellSpace(a,X) -> Reflexive;
 java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 19
;

registration
  let     Q   SeqtsXas  of ;
  let a be Point of M;
  letthenconsider u being Element of V such that
  cluster WellSpace(a,X) -> symmetric;
  coherence by Lm8;
end;

java.lang.StringIndexOutOfBoundsException: Range [35, 36) out of bounds for length 12
  let M be symmetric triangle Reflexive MetrStruct;
  a  of;
  let X be set;
cluster WellSpace(,X >
  reconsideryyyset1;
end;

for V being Abelian add-associative vector-distributive scalar-distributive
    empty RLSStruct, MbeingAffine Subset of, being  of  holds v +M
  let a be Point of M;
  let X be set;
  cluster WellSpace(a,X) -> discerning;
  coherence by    st x in v +  & y inv+M(a*  a* in+M
end;

theorem
  for M be triangle Reflexive non empty MetrStruct for a be Point of M
  for X be non empty set holds WellSpace(a,X) is complete implies M is complete
proof
  let M be triangle Reflexive non empty .= (1-a)*v + (1-a)*x9 + (a*v + a*y9) by RLVEC 5
  a be Point ofM;
  let X be non empty set;
  consider x0 be object suchthat
A1: x0 in X by XBOOLE_0:def 1;
  set W=WellSpace(a,X  end;
  assume
:WellSpace(a,)complete;
  let S be sequence of M such that
A3: S is Cauchy;
  defpred P[object,  assume
 implies $2=X,.$1]);
A4 x    xin AT
ex y being object st y in the carrier of W & P[x,y]
  proof
    let x be object;
    assume x in NAT;
    then reconsider i=x as Nat;
    per cases;
    suppose
A5:   S.i<>a;
      take[,.;
      thus thesis by A1,A5,Th37;
    end;
    suppose
A6:   Sx=;
      take [ proof
      thus thesis by A6,Th37;
    end;
  end;
  consider S9 be sequence of W such that
:forxbeing  st x NAT holds [x,S9x] from FUNCT_2: 1A4)
   
  proof
    let r;
 >;
  u+ uvis : in M java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
A8: java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
    take pjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
letn  suchjava.lang.StringIndexOutOfBoundsException: Range [28, 29) out of bounds for length 28
A9: p <= n and
A10: p <= m;
A11:  n in NAT & m in NAT by ORDINAL1:def 12;
    per cases;
    suppose
:Sna  m=;
      then
A13:  [Xjava.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 20
     [,S.]
      then       then dist D1  indomjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 22
       A8,9,java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
    java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
    
A14  .<a&S.=java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
then
  X.]S. by,A11
A16:  dist(S.m,S.m)=0 by METRIC_1:1;
x=x0  TARSKIjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
          not xx in xx; then.X2  unionF2 
A17:  X<>x0 by A1;

hendist(.nS9m=distSnS.)SmSm byA14,,A17,Def10java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
      A8A9,10,16java.lang.StringIndexOutOfBoundsException: Range [36, 37) out of bounds for length 36
   ;
    suppose

     then
A19:  [x0,S.m]=S9. (n+,-X1(iterO1n)X1 by:.java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
:dist(nS.)byMETRIC_1:1java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
reconsiderxx  asby 1;
             then
  X> ;
      [X,S.n]=S9.n by A7,A18,A11;
thendistS.S9m=(.Sn+Sn,S.m)by ,19,21,;
      hence thesis by A8,A9,A10,A20;
    end;
    
A22:  S.n<>a & S.m<>
then
A23:set O1=O O2OneStep ,Qequents union(O1[):X}java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
[,.=9.nbyA7,,;
      then dist(S9.n,S9.m)=dist(S.n,S.m) by A23,Def10;
      java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 6
    java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
  end;
  then S9 is convergent by A2;
  Elementof suchthat
>  n  forbe java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 50
  <=m holds dist(S9.m,L)<r:v1 in{} 
  consider L1 be set,L2 be Point of;
A25: L=[L1,L2] and
 X&ar  java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 45
takeL2java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
  let r;
  assume r>0;
    RLSStructMAffineSubset of Seqts in bool Q & dom R=bool Q by FUNCT_2:def 1; then
A26:for m be NatR}RR. A1 RELAT_1:;;then
  taken;
  let     be Subset of java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
A27: n<=m;
A28:  n in NAT & m in NAT by 
  per cases;
  suppose
.=  =;
    then (n-Yc nD3-YbyA3, A1, Lm16; then
    then dist(S9.m,L)=dist(S.m,(mn,1\D)derivablesX =
    pjava.lang.StringIndexOutOfBoundsException: Range [7, 8) out of bounds for length 7
  end;  M/\&yin M  ;
  suppose
A30: S.m=a & L1<>X;
    then S9.m=[X,a] by A7,A28;
    then
:dist(.,)dist.m,m)dist(S.,L2 by ,A30,Def10java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
    dist(S.m,S.m)=0 by METRIC_1:1;
 by,A27A31;
  end;
  suppose
A32: S.m <> a & L1=x0;
      proof
    then 
      ,A27;
  end;
  suppose
A33 in inNbyA2
    then S9.m=[x0,S.m] by A7,A28;
    then
A34: dist(mL=dist(.m,a+dist(L2) by ,A33,java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
A35:     (1 - a) * u1 + a * u2 in M & (1 - a) * v1 + a * v2 in N by A4,A6,Def4;
    dist(S9.m,L)<r by A26,end;
    hence thesis by A34,A35,XXREAL_0:2;
  end;
end;

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 end;
A1: S is Cauchy;
  per cases;
  suppose
t > n st form   =n  distSm,a  java.lang.StringIndexOutOfBoundsException: Range [66, 67) out of bounds for length 66
    hence thesis;

  suppose
    exfromRELSET_1 (A15;
    java.lang.StringIndexOutOfBoundsException: Range [0, 8) out of bounds for length 0
: >  
A3: for n ex m st m >considerRbeingRelationbool(-,S- such  :
    consider p be Nat such  R;
 , Natstn>  >p  (S.Sm< byA1A2;
    consider p9 be Nat such that
 p9>  
A6: dist(S.p9,Xa) >= r by A3;
    consider Y be set,y be Point    consider Y be set,y be Point ,bjava.lang.StringIndexOutOfBoundsException: Range [56, 57) out of bounds for length 56
A7: S.Rbeingofbool(-equents) sequents  A19java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
    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(,+(,)=+0byA6,XREAL_17java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
        assume Y<>Z;
        java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
A13:    dist(S.p9,S.m)>=r by A7y ElementofS- holds[,]inIT2iffPxy]java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
        m>=p by A5,4S)- ofbool(-), S-  Def41
h  A4,A5java.lang.StringIndexOutOfBoundsException: Range [34, 35) out of bounds for length 34
      end;
      hence thesis by A9;
   
    ;
  
end;

:
  for [set Elementof Ssequents  $ $java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
PointMholdsiscompleteimpliesWellSpaceaX)is complete
proof
  let M be symmetric triangle Reflexive thesisfrom :sch4AA)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
  let a be PointforSeqtsbeing fbool(-,seqt
  set W=WellSpace(a,X);
  reconsiderR
  assume
A1: M is complete;
  let S9 be sequence of W such that
: is;
assume: being  bool(-)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
A3: for x being java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 4
 & Py]
  proof
    ;
meinNATjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
    then reconsider i=x as Nat;
    s1 bes Point Msuch
A4: S9.i=[s1,s2] and
    s1  being ElementSsequents[, IT1 Px,;
    take s2;
    thus    thus 
end
  consider S be sequence of M such existence
:x objectstx in NAT holds P[x,S.x] from FUNCT_2:sch 1(A3);
  S is Cauchy
  proof
    let r;
    assume r>0;
thenpbeNatthat
A6: for n,m be Nat st p<=n & p<=
    by A2;
    take p;
    let n,m be Nat java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 3
 =
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
S9m[,.]  A5A;
percases
    suppose
      x=y;
      then dist(S9.n,S9.m)=dist(S.n,S.m) A4 =x& [,]inR,A1 thusthesis by A4;
      hence thesis by inF  ;java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
    end;
    suppose
A12:  x< A1 :7 def 2;
A13:  distsuppose  boolQ  Xas boolQ;
A14:  dist(S9.n,S9.m)<r by A6,A7,A8;
      dist(S9
      hence thesis by A13;
    end;
  end;
  then S is java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 10
  then consider L being Element of M such that
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
  <fR5S  ofSequals(#();
  per casescoherence;
  suppose
A16: L=a;
    take Xacjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
A17: dist(a,a)=0 by METRIC_1:1;
    let r;
    assume r > 0;
    then consider n be Nat such that
A18:#( > ;
    take n;
    letA1: c=Y;
A19: m >=n;
 inNAT&NAT ORDINAL1: 12;
    consider x such that
 S9m[,.m]byA5,A20;
    x=X or x<>X;
    then dist(S9.m,Xa nd;
,A17,Def10;
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
  end;
  suppose
A22: for Xa A2:x inQ& Xx  
    m >= n holds dist(S9.m,Xa) < r;
    take Xa;
    let r;
    assume r > 0;
    then  n that
A23: for m st m >= n holds endjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
    reconsider n as Nat;
tn
    let m be Nat;
    assume m >n;
    hence dist(S9.m,Xa) < r by A23;
  end;
  suppose
A24: a<>L & end
    thenclusterR3(S)-  java.lang.StringIndexOutOfBoundsException: Range [41, 42) out of bounds for length 41
A25: for m st m >= n ex p be Point of M st S9.m = [Y,p];
letx be ;assume
A27: ex s1 be set,s2 be PointXseqt P()byA1  
    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 hence x in R.Y by;
A29:  m >= mm;
A30:  n in NAT & m in NAT by ORDINAL1
        
A31:  S9.m=[x,S.m] by A5,A30;
      mm >= n by XXREAL_0:25;
 MstS9. Y]A25A29,;
      then x=Y by A31,XTUPLE_0:1;
      then
A32:  dist(S9.m,java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 4
      mm >= p by XXREAL_0:25;
      then m>=p by A29,XXREAL_0:2;
      hence dist(S9.m,YL)<r by A28,A32;

    suppose
A33:  Y=X;
      reconsider n as Nat;
      take Xa;
      let r such that
A34:  r > 0;
      take n;
      let m be Nat;end;
      assume m >= n;
      then
A35:  ex t3 be Point of M st S9.m = [Y,t3] byreconsider Phi{ finiteSubset of AF by XBOOLE_1:2;
      consider t1 java.lang.StringIndexOutOfBoundsException: Range [0, 20) out of bounds for length 4
m[t1t2] 
A37:  java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
      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;

theorem Th42:
forM  non  M
is complete*(compound(T)(-compound(U);
  infinite set holds WellSpace(a,X) is complete &
  ex S be non-empty pointwise_bounded
SetSequenceof WellSpace(,  is &S  -  S 
  empty
proof
  let M be symmetric triangle Reflexive non empty MetrStruct such that
A1: M is complete;
  let a be Point of Mn
  RR3() =-equentsjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
  then consider b be Pointseqt   by ;then
A2: dist(a,b)<>0;
  letX infinite setjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
  set W=then seqt Rule3e Y;
  thus W is complete by A1,Th41;
  set TW=TopSpaceMetr W;
  consider f being sequence ofend;
A3: f is java.lang.StringIndexOutOfBoundsException: Range [0, 12) out of bounds for length 9
  defpred p[object,object] means $2=[f.$1,b];
A4: b<>a by A2,METRIC_1:1;
A5: for x being object st x in NAT
ex y being suppose f  K1 considergsuch that
  proof
    etx beobjectjava.lang.StringIndexOutOfBoundsException: Range [20, 21) out of bounds for length 20
    assume in NAT;
   then x   fby FUNCT_2def;
    then
A6: f.x in rngjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    take [f.x,b];
    thus thesis by A4,A6,Th37;

  consider s be sequence of  the carrier of TW such that
A7: for x being object st x in NAT holds 
  deffunc P(object)={s.$1};
A8: for x being object sty22= < TheNorSymbOfS*>^phi2   java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
  proof
A9: dom s=NAT by FUNCT_2:def 1;
     x ;
  assumex in;
    then s.x in rng s by A9,FUNCT_1:def 3;
    then P(xlet Sjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
    hence thesis;
  end;
  consider S be SetSequence of TW such that
A10: for xreconsider seqt=x as  ofQ  A2;
A11: now
    let x1,A3y1Seqts  in &y1`y`  2phi1&
A12: x1 in NAT and
A13: x2 in NAT and
 x1=.;
A15java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
A16: s.x1=[f.x1,b] by A7,A12java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
: ;
A18: s.x2=[f.x2,b] by A7,A13;
    S.x1={s.x1} by A10,A12;
    then s.x1=s.x2 by A14,A15,A17,TARSKI:def 1;
    then f.x1=f.x2 by A16,A18,XTUPLE_0:1;
hencex1   byA3A,FUNCT_219java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
;
  reconsider rngs=rng s as end;
  set F={{x} where x is Element of TW: x in rngs};
  reconsider F as Subset-Family of TWjava.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
  dist(a,b)>0 by A2,METRIC_1:5;
tjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
A19{null  is-sequentslike;then
:Sc=F
  proof
    let x be object;
    assume x in rng S;
    then consider ylet S , H2,phi;
A21: y in dom S and
A22: S.y=x by FUNCT_1:def 3;
    dom s=NAT by FUNCT_2:def ofQjava.lang.StringIndexOutOfBoundsException: Range [43, 44) out of bounds for length 43
    then
A23: s.y in rngs by A21,FUNCT_1:def 3;
    x={s.y} by A10,A21,A22;
    hence thesis by A23;
  end;
  now
    let x be object;
    x  domS
    then S.x={s.x} by A10;
     . is non emptyjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
  end;
 9;
  then  #S. Th3java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
A24: R is non-ascending and
: locally_finite    one =}java.lang.StringIndexOutOfBoundsException: Range [66, 67) out of bounds for length 66
A26 thesis A1
  where j is Element of java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  reconsider R9=R as cluster [(H\/{<*l1*>^phi1}) null l2, phi2] ->
A27: now
    let x,y be Point
A28: x in rngs and
   
A30: x <> y;
    consider y1 be object such that
A31: y1let ,SH1 H2,
A32: s.y1=y by java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
A33: y=[f.y1,b] by A7,A31,A32;
    consider x1 be object such that
A34: x1 in dom s and
A35: s.x1=x by A28,FUNCT_1;
    x=[f.x1,b] by A7l S;
    then well_dist(a,X).(x,y)=dist(b,a)+dist(a,b) by A30,A33,end
    hence dist(x,y)=2*dist(a,b);
  end;
  now
    let i;
    java.lang.StringIndexOutOfBoundsException: Range [0, 12) out of bounds for length 11
ClSi
A37: Si = {S.j where j is Element of NAT: j >v,literalS ,pjava.lang.StringIndexOutOfBoundsException: Range [47, 48) out of bounds for length 47
    reconsider SI=union Si as Subset of W;
    now
      let x,y being Point of W such;
A38:  x in SI and
A39:  y in SI;
      consider xS be    for ;
A40:  x inproof Q=S-sequents, psi=(l,t) SubstIn phi;
A41:  xS in Si by A38,TARSKI:def 4;
      consider j1 be Element of NAT such that
A42:  xS=S.j1 and
      j1 >= i by A37,A41;
A43:  S.j1={s.j1} by A10;
A44:  dom s=NAT by FUNCT_2:def 1;
      hensj1 in rngs by FUNCT_1:ef 3;
      then
A45:  x in rngs by A40,A42,A43,TARSKI:def {H{,]H/,* *>phi2}
      consider yS be set such that
A46:  y in yS and

       ofNAT such that
A48:  yS=y12+\phi1={} & y22+psi={ &Sq\+\H=} & Sq`2\+\(xnot phi)={};
      j2then   &in &y11H1&y2`= & `=hi1&y22psi&
A49:  S.j2={s.j2} by A10;
      j2rngs d 3java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
      then
   in by,A48d ;
      x=y or x<>y;
      hence dist(x,y)<=2*dist(a,b) by A19,A27,A45,A50,METRIC_1 =#4(S), Q=S-;
    end;
    then SI is bounded by A19;
    hence R9.i is bounded by A36,Th8;
  end;
  thenasnon-emptypointwise_bounded ofWDef1
  ;
  thus R9  S 
  for x,y be Point of W st x<>y & x in rngs & y in rngs holds dist(x,y)>=
  2*dist(a,b) by A27;
  hence thesis by A25,A19,hence thesisjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
end;

theorem
  ex M be non set AT=AllTermsOf S=java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 71
pointwise_bounded SetSequence of M st S is closed & SA2:X Dexpanded
t S is empty
proof
  reconsider D=DiscreteSpace 2 as non empty MetrSpace;
       Segm NAT_144java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
  then reconsider a=0,b=1 as Point of D;
  TopSpaceMetr D is compact;
  then
A1: D is complete by TBSP_1:8;
A2: 1=dist(a,b) by METRIC_1:def 10;
  then
A3: ex S be non-empty pointwise_bounded SetSequence of WellSpace(a,NAT) st
    S is closed
  & S is non-ascending & meet S is empty by A1,Th42;
  WellSpace(a,NAT) is complete by A2,A1,Th42;
  hence thesis by A3;
end;

Messung
CHZG
8010010093

¤ Dauer der Verarbeitung: 0.200 Sekunden  (vorverarbeitet am  2026-11-24) ¤

*© Formatika GbR, Deutschland