 reserve x,X for set,
         n, m, i for Nat,
         p, q for Point of TOP-REAL n,
         A, B for Subset of TOP-REAL n,
         r, s for Real;
reserve N for non zero Nat,
        u,t for Point of TOP-REAL(N+1);

theorem Th7:
  r>0 implies ind Sphere(p,r) = n-1
proof
  set TR=TOP-REAL n;
A1: ind A <= i & ind B <=i & A is closed implies ind (A\/B)<=i
  proof
    set TT=the TopStruct of TR;
    assume that
A2:     ind A <= i
      and
A3:     ind B <=i
      and
A4:     A is closed;
    reconsider a=A, b=B, AB=A\/B as Subset of TT;
A5: a is closed by A4,PRE_TOPC:31;
A6: TT|AB is second-countable;
A7: TT = TopSpaceMetr Euclid n by EUCLID:def 8;
A8: TT = TR| [#]TR by TSEP_1:93;
    then
A9:   ind b<=i by TOPDIM_1:22,A3;
    ind a<= i by A8,TOPDIM_1:22,A2;
    then ind AB <= i by A9,A5,A8, A7,A6,TOPDIM_2:5;
    hence thesis by TOPDIM_1:22,A8;
  end;
  assume
A10: r>0;
  per cases by NAT_1:25;
  suppose
A11:  n=0;
    then
A12:  p=0.TR by EUCLID:77;
    Sphere(p,r)={}
    proof
      assume Sphere(p,r) <>{};
      then consider x be object such that
A13:    x in Sphere(p,r) by XBOOLE_0:def 1;
      reconsider x as Point of TR by A13;
      x = 0.TR by A11,EUCLID:77
       .= 0*n by EUCLID:66;
      then |.x.| = 0 by EUCLID:7;
      hence contradiction by A12,A13,TOPREAL9:12,A10;
    end;
    hence thesis by TOPDIM_1:6,A11;
  end;
  suppose
A15:  n=1;
    then consider u be Real such that
A16:  p=<*u*> by JORDAN2B:20;
    set u1=|[u-r]|,u2=|[u+r]|;
    card {u2}=1 by CARD_1:30;
    then
A17:  ind {u2} = 0 by TOPDIM_1:8, NAT_1:14;
    card {u1}=1 by CARD_1:30;
    then ind {u1}=0 by TOPDIM_1:8, NAT_1:14;
    then
A18:  ind ({u1}\/{u2}) = 0 by A17,A15,A1;
    {<*u qua ExtReal-r*>,<*u qua ExtReal+r*>} = Fr Ball(p,r)
    by A15,TOPDIM_2:18,A16,A10
                     .= Sphere(p,r) by A15,A10,JORDAN:24;
    hence thesis by A18,ENUMSET1:1,A15;
  end;
  suppose
A19:  n>1;
    then reconsider n1=n-1 as Element of NAT by NAT_1:20;
    reconsider n1 as non zero Element of NAT by A19;
    set n2=n1+1;
    set Tn1=TOP-REAL n1,Tn2=TOP-REAL n2,S=Sphere(0.Tn2,1);
    set Sp = {s where s is Point of Tn2: s.n2>=0 & |.s.|=1},
        Sn = {t where t is Point of Tn2: t.n2<=0 & |.t.|=1};
A20: Sp c= S
    proof
      let x be object;
      assume x in Sp;
      then consider s be Point of Tn2 such that
A21:      x=s
        and
          s.n2>=0
        and
A22:      |.s.|=1;
      s-0.Tn2 = s by RLVECT_1:13;
      hence thesis by A22,A21;
    end;
A23: [#](TR |cl_Ball(p,r)) = cl_Ball(p,r) by PRE_TOPC:def 5;
    reconsider Spr=Sphere(p,r) as Subset of TR |cl_Ball(p,r)
      by A23,TOPREAL9:17;
A24: cl_Ball(0.Tn2,1) is compact non boundary by Lm2;
    cl_Ball(p,r) is compact non boundary by Lm2, A10;
    then consider h be Function of TR | cl_Ball(p,r), Tn2 |cl_Ball(0.Tn2,1)
          such that
A25:    h is being_homeomorphism
      and
A26:    h.:Fr cl_Ball(p,r) = Fr cl_Ball(0.Tn2,1) by A24,BROUWER2:7;
A27: ind Spr = ind (h.:Spr) by A25,METRIZTS:3,TOPDIM_1:27;
A28: Sn c= S
    proof
      let x be object;
      assume x in Sn;
      then consider s be Point of Tn2 such that
A29:      x=s
        and
          s.n2<=0
        and
A30:      |.s.|=1;
      s-0.Tn2 = s by RLVECT_1:13;
      hence thesis by A30,A29;
    end;
    then reconsider Sp,Sn as Subset of TOP-REAL n2 by A20,XBOOLE_1:1;
A31: S c= Sp\/Sn
    proof
      let x be object;
      assume
A32:    x in S;
      then reconsider x as Point of Tn2;
A33:  x.n2 >=0 or x.n2<=0;
      |.x.|=1 by A32,TOPREAL9:12;
      then x in Sp or x in Sn by A33;
      hence thesis by XBOOLE_0:def 3;
    end;
A34: Sn= {t where t is Point of TOP-REAL n2: t.n2<=0 & |.t.|=1};
    then
A35: Sp is closed by Th2;
A36: Sp = {s where s is Point of TOP-REAL n2: s.n2>=0 & |.s.|=1};
A37: Sp,cl_Ball(0.Tn1,1) are_homeomorphic &
      Sn,cl_Ball(0.Tn1,1) are_homeomorphic
    proof
      set TD=Tdisk(0.Tn1,1);
      deffunc ff(Nat)=PROJ(n2,$1);
      consider FF be FinSequence such that
A38:    len FF = n1 & for k be Nat st k in dom FF holds FF.k=ff(k)
        from FINSEQ_1:sch 2;
      rng FF c= Funcs(the carrier of Tn2,the carrier of R^1)
      proof
        let x be object;
        assume x in rng FF;
        then consider i be object such that
A39:        i in dom FF
          and
A40:        FF.i = x by FUNCT_1:def 3;
        reconsider i as Nat by A39;
        ff(i) in Funcs(the carrier of Tn2,the carrier of R^1) by FUNCT_2:8;
        hence thesis by A38,A39,A40;
      end;
      then reconsider FF as FinSequence of
        Funcs(the carrier of Tn2,the carrier of R^1) by FINSEQ_1:def 4;
      reconsider FF as Element of n1-tuples_on
        Funcs(the carrier of Tn2,the carrier of R^1) by A38,FINSEQ_2:92;
      set FFF=<:FF:>;
A41:  [#]TD = cl_Ball(0.Tn1,1) by PRE_TOPC:def 5;
      FFF.:Sp= cl_Ball(0.Tn1,1) by A38,Th1,A34;
      then
A42:    rng (FFF|Sp) c= the carrier of TD by RELAT_1:115,A41;
A43:  dom FFF=the carrier of Tn2 by FUNCT_2:def 1;
      then Sn/\dom FFF=Sn by XBOOLE_1:28;
      then
A44:    dom (FFF|Sn)= Sn by RELAT_1:61;
      Sp/\dom FFF=Sp by A43,XBOOLE_1:28;
      then
A45:    dom (FFF|Sp)= Sp by RELAT_1:61;
      [#](Tn2|Sp) = Sp by PRE_TOPC:def 5;
      then
      reconsider Fsp=FFF|Sp as Function of Tn2|Sp,TD by A42,A45,FUNCT_2:2;
A46:  [#] (Tn2|Sn) = Sn by PRE_TOPC:def 5;
      FFF.:Sn= cl_Ball(0.Tn1,1) by A38,Th1,A36;
      then rng (FFF|Sn) c= the carrier of TD by RELAT_1:115, A41;
      then reconsider Fsn=FFF|Sn as Function of Tn2|Sn,TD by A46,FUNCT_2:2,A44;
A47:  Fsn is being_homeomorphism by A38,Th1,A36;
      Fsp is being_homeomorphism by A38,Th1,A34;
      hence thesis by A47,T_0TOPSP:def 1,METRIZTS:def 1;
    end;
A48: ind cl_Ball(0.Tn1,1) = n1 by Lm2,Th6;
    then
A49:  ind Sp=n1 by A37,TOPDIM_1:27;
    Sp c= Sp\/Sn by XBOOLE_1:7;
    then
A50:  n1 <= ind (Sp\/Sn) by A49, TOPDIM_1:19;
    ind Sn=n1 by A37,A48,TOPDIM_1:27;
    then ind (Sp\/Sn) <= n1 by A35,A49,A1;
    then
A51:  ind (Sp\/Sn) = n1 by A50,XXREAL_0:1;
    Fr cl_Ball(p,r) = Sphere(p,r) by BROUWER2:5,A10;
    then h.:Spr = S by A26, BROUWER2:5;
    then
A52:  ind (h.:Spr) = ind S by TOPDIM_1:21;
    Sp\/Sn c= S by A20,A28,XBOOLE_1:8;
    then ind S= n1 by A31,XBOOLE_0:def 10,A51;
    hence thesis by TOPDIM_1:21,A52,A27;
  end;
end;
