reserve i, k, m, n for Nat,
  r, s for Real,
  rn for Real,
  x, y , z, X for set,
  T, T1, T2 for non empty TopSpace,
  p, q for Point of T,
  A, B, C for Subset of T,
  A9 for non empty Subset of T,
  pq for Element of [:the carrier of T,the carrier of T:],
  pq9 for Point of [:T,T:],
  pmet,pmet1 for Function of [:the carrier of T,the carrier of T:],REAL,
  pmet9,pmet19 for RealMap of [:T,T:] ,
  f,f1 for RealMap of T,
  FS2 for Functional_Sequence of [:the carrier of T,the carrier of T:],REAL,
  seq for Real_Sequence;

theorem Th21:
  for T st T is metrizable ex Un be FamilySequence of T st Un is
  Basis_sigma_discrete
proof
  let T such that
A1: T is metrizable;
  consider metr be Function of [:the carrier of T,the carrier of T:],REAL such
  that
A2: metr is_metric_of the carrier of T and
A3: Family_open_set(SpaceMetr (the carrier of T,metr)) = the topology of
  T by A1,PCOMPS_1:def 8;
  set bbcT=bool bool the carrier of T;
  reconsider PM = SpaceMetr(the carrier of T,metr) as non empty MetrSpace by A2
,PCOMPS_1:36;
  deffunc BALL(object)=
   {Ball(x, 1/(2 |^ (In($1,NAT)))) where x is Point of PM: x
  is Point of PM};
A4: for k be object st k in NAT holds BALL(k) in bool bool the carrier of T
  proof
    let k be object;
    assume k in NAT;
    then reconsider k as Element of NAT;
    BALL(k) c= bool the carrier of T
    proof
      let B be object;
      assume B in BALL(k);
      then ex x be Point of PM st B=Ball(x,1/(2|^k)) & x is Point of PM;
      then B in Family_open_set PM by PCOMPS_1:29;
      hence thesis by A3;
    end;
    hence thesis;
  end;
  consider FB be FamilySequence of T such that
A5: for k be object st k in NAT holds FB.k= BALL(k) from FUNCT_2:sch 2(A4);
  defpred U[set,set] means ex FS be FamilySequence of T st $2 = FS & Union FS
  is open & Union FS is Cover of T & Union FS is_finer_than FB.$1 & FS is
  sigma_discrete;
  set TPM = TopSpaceMetr PM;
A6: TPM = TopStruct (#the carrier of PM,Family_open_set PM#) by PCOMPS_1:def 5;
  then
A7: [#]T=[#]TPM by A2,PCOMPS_2:4;
A8: for n be Element of NAT ex Un be Element of Funcs(NAT,bbcT) st U[n,Un]
  proof
    let n be Element of NAT;
    now
      let U be Subset of T;
      assume U in (FB.n);
      then U in BALL(n) by A5;
      then ex x be Point of PM st U = Ball(x,1/(2|^ n)) & x is Point of PM;
      then U in the topology of T by A3,PCOMPS_1:29;
      hence U is open by PRE_TOPC:def 2;
    end;
    then
A9: FB.n is open;
A10: [#]TPM c= union (FB.n)
    proof
      let x be object;
      assume x in [#]TPM;
      then reconsider x9=x as Element of PM by A6;
      2|^n > 0 by NEWTON:83;
      then
A11:  x9 in Ball(x9,1/(2|^ n)) by TBSP_1:11,XREAL_1:139;
      Ball(x9,1/(2|^ n)) in BALL(n);
      then Ball(x9,1/(2|^ n)) in FB.n by A5;
      hence thesis by A11,TARSKI:def 4;
    end;
    union (FB.n) c= [#]TPM
    proof
      given x being object such that
A12:  x in union (FB.n) and
A13:  not x in [#]TPM;
      consider A be set such that
A14:  x in A and
A15:  A in (FB.n) by A12,TARSKI:def 4;
      A in BALL(n) by A5,A15;
      then
      ex y be Point of PM st A=Ball(y,1/(2|^n)) & y is Point of PM;
      hence thesis by A6,A13,A14;
    end;
    then [#]TPM = union (FB.n) by A10;
    then (FB.n) is Cover of T by A7,SETFAM_1:45;
    then consider Un be FamilySequence of T such that
A16: Union Un is open & Union Un is Cover of T & Union Un
    is_finer_than FB. n & Un is sigma_discrete by A1,A9,Th20;
    Un in Funcs(NAT,bbcT) by FUNCT_2:8;
    hence thesis by A16;
  end;
  consider Un be sequence of Funcs(NAT,bbcT) such that
A17: for n be Element of NAT holds U[n,Un.n] from FUNCT_2:sch 3(A8);
  defpred X[object,object] means
   for n,m st PairFunc.[n,m]=$1 for Unn be
  FamilySequence of T st Unn=Un.n holds $2=Unn.m;
A18: for k be object st k in NAT ex Ux be object st Ux in bbcT & X[k,Ux]
  proof
    let k be object;
    assume k in NAT;
    then reconsider k9=k as Element of NAT;
    NAT =rng PairFunc by Th2,FUNCT_2:def 3;
    then consider nm be object such that
A19: nm in dom PairFunc and
A20: k9=PairFunc.nm by FUNCT_1:def 3;
    consider n,m be object such that
A21: n in NAT and
A22:    m in NAT and
A23: nm=[n,m] by A19,ZFMISC_1:def 2;
    reconsider Unn=Un.n as FamilySequence of T by A21,FUNCT_2:5,66;
    take Ux=Unn.m;
     dom Unn = NAT by PARTFUN1:def 2;
     then m in dom Unn by A22;
     then Ux in rng Unn by FUNCT_1:3;
    hence Ux in bbcT;
      let n1,m1 be Nat such that
A24:  PairFunc.[n1,m1]=k;
      reconsider nn1=n1,mm1=m1 as Element of NAT by ORDINAL1:def 12;
      now
        let Unn be FamilySequence of T such that
A25:    Unn=Un.nn1;
A26:    [n,m]=[nn1,mm1] by A19,A20,A23,A24,Th2,FUNCT_2:19;
        then n1=n by XTUPLE_0:1;
        hence Ux=Unn.mm1 by A25,A26,XTUPLE_0:1;
      end;
      hence for Unn be FamilySequence of T st Unn=Un.n1 holds Ux=Unn.m1;
  end;
  consider UX be sequence of bbcT such that
A27: for k be object st k in NAT holds X[k,UX.k] from FUNCT_2:sch 1(A18);
A28: for A st A is open for p st p in A ex B st B in Union UX & p in B & B c= A
  proof
    let A;
    assume A is open;
    then
A29: A in Family_open_set PM by A3,PRE_TOPC:def 2;
    let p such that
A30: p in A;
    reconsider p as Element of PM by A30,A29;
    consider r such that
A31: r>0 and
A32: Ball(p,r) c=A by A30,A29,PCOMPS_1:def 4;
    consider n such that
A33: 1/(2|^n)<=r by A31,PREPOWER:92;
    consider Unn1 be FamilySequence of T such that
A34: Un.(n+1) = Unn1 and
    Union Unn1 is open and
A35: Union Unn1 is Cover of T and
A36: Union Unn1 is_finer_than FB.(n+1) and
    Unn1 is sigma_discrete by A17;
    union (Union Unn1) = [#]T by A35,SETFAM_1:45;
    then consider B be set such that
A37: p in B and
A38: B in (Union Unn1) by TARSKI:def 4;
    reconsider B as Subset of PM by A2,A38,PCOMPS_2:4;
    consider B1 be set such that
A39: B1 in FB.(n+1) and
A40: B c= B1 by A36,A38,SETFAM_1:def 2;
    consider k such that
A41: B in Unn1.k by A38,PROB_1:12;
    n + 1 = In(n+1,NAT) & B1 in BALL(n+1) by A5,A39;
    then consider q be Point of PM such that
A42: B1=Ball(q,(1/(2|^(n+1)))) and
    q is Element of PM;
    now
      let s be Element of PM;
      assume s in B;
      then
A43:  dist(q,s)<1/(2|^(n+1)) by A40,A42,METRIC_1:11;
      dist(q,p)<1/(2|^(n+1)) by A37,A40,A42,METRIC_1:11;
      then dist(p,s)<=dist(q,p)+dist(q,s) & dist(q,p)+dist(q,s)<1/(2|^(n+1))+
      1/(2|^(n+1 )) by A43,METRIC_1:4,XREAL_1:8;
      then dist(p,s)<2*(1/(2|^(n+1))) by XXREAL_0:2;
      then dist(p,s)<(1/(2|^n * 2))*2 by NEWTON:6;
      then dist(p,s)<(1/(2|^n)) by XCMPLX_1:92;
      then dist(p,s)<r by A33,XXREAL_0:2;
      hence s in Ball(p,r) by METRIC_1:11;
    end;
    then
A44: B c= Ball(p,r);
    reconsider kk= k as Element of NAT by ORDINAL1:def 12;
    UX.(PairFunc.[n+1,kk])=Unn1.kk by A27,A34;
    then B in Union UX by A41,PROB_1:12;
    hence thesis by A32,A37,A44,XBOOLE_1:1;
  end;
  for k being Element of NAT holds UX.k is discrete
  proof
    let k;
A45:  k in NAT by ORDINAL1:def 12;
    NAT = rng PairFunc by Th2,FUNCT_2:def 3;
    then consider nm be object such that
A46: nm in dom PairFunc and
A47: k=PairFunc.nm by FUNCT_1:def 3,A45;
    consider n,m be object such that
A48: n in NAT and
A49: m in NAT and
A50: nm=[n,m] by A46,ZFMISC_1:def 2;
    consider FS be FamilySequence of T such that
A51: Un.n = FS and
    Union FS is open and
    Union FS is Cover of T and
    Union FS is_finer_than FB.n and
A52: FS is sigma_discrete by A17,A48;
    dom FS = NAT by PARTFUN1:def 2;
    then m in dom FS by A49;
    then FS.m in rng FS by FUNCT_1:3;
    then FS.m in bbcT;
    then reconsider FSm = FS.m as Subset-Family of T;
    FSm is discrete by A49,A52,NAGATA_1:def 2;
    hence thesis by A27,A47,A48,A49,A50,A51;
  end;
  then
A53: UX is sigma_discrete by NAGATA_1:def 2;
  Union UX c= the topology of T
  proof
    let UXk be object;
    assume UXk in Union UX;
    then consider k such that
A54: UXk in UX.k by PROB_1:12;
    reconsider UXk9=UXk as Subset of T by A54;
A55:  k in NAT by ORDINAL1:def 12;
    NAT =rng PairFunc by Th2,FUNCT_2:def 3;
    then consider nm be object such that
A56: nm in dom PairFunc and
A57: k=PairFunc.nm by FUNCT_1:def 3,A55;
    consider n,m be object such that
A58: n in NAT and
A59: m in NAT and
A60: nm=[n,m] by A56,ZFMISC_1:def 2;
    reconsider Unn=Un.n as FamilySequence of T by A58,FUNCT_2:5,66;
    UXk in Unn.m by A27,A54,A57,A58,A59,A60,A55;
    then
A61: UXk in Union Unn by A59,PROB_1:12;
    ex FS be FamilySequence of T st Un.n = FS & Union FS is open & Union
FS is Cover of T & Union FS is_finer_than FB.n & FS is sigma_discrete by A17
,A58;
    then UXk9 is open by A61;
    hence thesis by PRE_TOPC:def 2;
  end;
  then Union UX is Basis of T by A28,YELLOW_9:32;
  then UX is Basis_sigma_discrete by A53,NAGATA_1:def 5;
  hence thesis;
end;
