 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
  for p,q be Point of TOP-REAL (n+1)
    for r,s st s <= r & r <= |.p-q.| & s < |.p-q.| &
                              |.p-q.|< s+ r
    ex h be Function of (TOP-REAL (n+1)) | (Sphere(p,r)/\ cl_Ball(q,s)),
                        Tdisk(0.TOP-REAL n,1)
      st h is being_homeomorphism &
         h.:(Sphere(p,r) /\ Sphere(q,s)) = Sphere(0.TOP-REAL n,1)
 proof
   N:n in NAT by ORDINAL1:def 12;
   set n1=n+1,TR=TOP-REAL n,TR1=TOP-REAL n1;
   let p,q be Point of TR1;
   let r,s be Real such that
       A1: s <= r
    and
       A2: r <= |.p-q.|
    and
       A3: s < |.p-q.|
    and
       A4: |.p -q.|< s+r;
   reconsider r1=1/r as Real;
   A5:r>0 by A1,A4;
   then A6:r*r1=1 by XCMPLX_1:87;
   set A=Sphere(p,r)/\ cl_Ball(q,s);
   set TR=TOP-REAL n;
   set y=(1/r)*(q-p);
   set T=transl(-p,TR1),M= mlt(r1,TR1);
   A7: 0*n1 = 0.TR1 by EUCLID:70;
   A8: -p + p = 0.TR1 by RLVECT_1:5;
   A9: |.y.| = |. r1 .|*|.q-p.| by EUCLID:11
       .= r1*|.q-p.| by A5,ABSVALUE:def 1;
   set Y=0*n1 +*(n1,|.y.|);
   rng Y c= REAL;
   then
W: Y is FinSequence of REAL by FINSEQ_1:def 4;
A10: len Y = n1 by CARD_1:def 7;
   then Y is Element of REAL n1 by W,FINSEQ_2:92;
   then reconsider Y as Point of TR1 by EUCLID:22;
   set S=Sphere(0.TR1,1),CL=cl_Ball(Y,s*r1);
   A11: [#](TR1| (S/\CL)) = S/\CL by PRE_TOPC:def 5;
   A12: |.Y.| = |. |.y.| .| by TOPREALC:13,FINSEQ_1:3;
   then A13: |.Y.| = |.y.| by ABSVALUE:def 1;
   ex ROT be homogeneous additive rotation Function of TR1,TR1 st
     ROT is being_homeomorphism & ROT.y=Y
   proof
     per cases;
       suppose n=0;
         then ex ROT be homogeneous additive Function of TR1,TR1 st
          ( ROT is rotation)& ROT.y = Y &
          (AutMt ROT = AxialSymmetry(n1,n1) or AutMt ROT = 1.(F_Real,n1))
           by A13,MATRTOP3:40;
         hence thesis;
      end;
       suppose n>0;
         then n1<>1;
         then ex ROT be homogeneous additive Function of TR1,TR1 st
          ( ROT is base_rotation)& ROT.y = Y by A13,MATRTOP3:41;
       hence thesis;
      end;
    end;
   then consider ROT be homogeneous additive rotation Function of TR1,TR1
     such that
       ROT is being_homeomorphism
    and
       A14: ROT.y=Y;
   set h=ROT*M*T;
   A15: |.ROT.(0.TR1).| = |. 0.TR1.| by MATRTOP3:def 4
       .= |.0*n1.| by EUCLID:70
       .= 0 by EUCLID:7;
   A16: h.:Sphere(q,s) = (ROT*M).:(T.:Sphere(q,s))by RELAT_1:126
       .= (ROT*M).:(Sphere(-p+q,s)) by Th15
       .= ROT.:(M.:(Sphere(-p+q,s))) by RELAT_1:126
       .= ROT.:(Sphere(r1*(q-p),s*r1)) by Th16, A5
       .= Sphere(Y,s*r1) by A14,Th17;
   ROT.(0.TR1) is Element of REAL n1 by EUCLID:22;
   then A17: ROT.(0.TR1) = 0.TR1 by A15,A7,EUCLID:8;
   A18: h.:Sphere(p,r) = (ROT*M).:(T.:Sphere(p,r))by RELAT_1:126
       .= (ROT*M).:(Sphere(-p+p,r)) by Th15
       .= ROT.:(M.:(Sphere(0.TR1,r))) by A8,RELAT_1:126
       .= ROT.:(Sphere(r1*0.TR1,r*r1)) by Th16, A5
       .= ROT.:(Sphere(r1*0.TR1,1)) by A5,XCMPLX_1:87
       .= ROT.:(Sphere(0.TR1,1)) by RLVECT_1:10
       .= Sphere(0.TR1,1) by Th17,A17;
   reconsider hA=h|A as Function of TR1|A,TR1| (h.:A) by JORDAN24:12;
    ROT*M is being_homeomorphism by A5,TOPS_2:57;
   then A19: h is being_homeomorphism by TOPS_2:57;
   then A20:hA is being_homeomorphism by METRIZTS:2;
   reconsider TD = Tdisk(0.TR,1) as non empty TopSpace;
   A21: the carrier of Tdisk(0.TR,1) = cl_Ball(0.TR,1) by N,BROUWER:3;
    h.:cl_Ball(q,s) = (ROT*M).:(T.:cl_Ball(q,s))by RELAT_1:126
       .= (ROT*M).:(cl_Ball(-p+q,s)) by Th15
       .= ROT.:(M.:(cl_Ball(-p+q,s))) by RELAT_1:126
       .= ROT.:(cl_Ball(y,s*r1)) by Th16, A5
       .= cl_Ball(Y,s*r1) by A14,Th17;
   then A22:h.:A = S/\CL by A18,A5,FUNCT_1:62;
    |.p-q.| - s < s+r-s by A4,XREAL_1:9;
   then A23: r1*(|.p-q.|-s) < 1 by A6, A5,XREAL_1:68;
   A24:dom (0*n1) = Seg n1;
    q-p = - (p-q) by RLVECT_1:33;
   then A25: |.p-q.| = |.q-p.| by EUCLID:10;
    |.p-q.|+s >= r+s by A2,XREAL_1:6;
   then |.p-q.|+s > |.p-q.| by A4,XXREAL_0:2;
   then |.p-q.|+s > r by A2,XXREAL_0:2;
   then A26: r1*(|.p-q.|+s) > 1 by A6, A5,XREAL_1:68;
   A27:s>0
   proof
     assume s <=0;
     then s+r <= r+0 by XREAL_1:6;
     hence thesis by A4,XXREAL_0:2,A2;
    end;
   per cases;
     suppose
A28: n=0;
     set E=Euclid n1;
     reconsider YY=Y as Point of E by EUCLID:67;
      Y.1 = |.y.| by A24,FINSEQ_1:3,A28,FUNCT_7:31;
     then A29:YY = <*|.y.|*> by CARD_1:def 7,A28,FINSEQ_1:40;
     then
     A30: cl_Ball(YY,s*r1) =
         {<*w*> where w is Real: |.y.| qua ExtReal -(s qua ExtReal*r1) <= w &
         w <= |.y.| qua ExtReal + (s qua ExtReal*r1)}
       by A28,TOPDIM_2:17;
     A31:[#]TR = {0.TR} by A28,EUCLID:22,EUCLID:77;
     then reconsider ZZ = 0.TR as Point of TD by A21,ZFMISC_1:33;
     A32: [#]Tdisk(0.TR,1) ={0.TR} by A21,A31,ZFMISC_1:33;
     reconsider z=0,yy=|.y.| as Real;
     0.TR1 = <* z *> by A7,A28,FINSEQ_2:59;
     then A33: Fr Ball(0.TR1,1) = {<*z qua ExtReal-1*>,<*z qua ExtReal+1*>}
     by A28,TOPDIM_2:18;
     A34: Fr Ball(0.TR1,1) = S by JORDAN:24;
     then A35: <*z+1*> in S by A33,TARSKI:def 2;
     A36: cl_Ball(YY,s*r1) = cl_Ball(Y,s*r1) by TOPREAL9:14;
     then A37: <*z qua ExtReal+1*> in CL by A23,A9,A25,A26,A30;
     then A38: A is non empty by A22, A35,XBOOLE_0:def 4;
     reconsider SCL=S/\CL as non empty Subset of TR1 by A35,A37,XBOOLE_0:def 4;
     reconsider zz= <* 1 *> as Point of TR1| SCL
       by A35,A37,XBOOLE_0:def 4,A11;
     set h1 = TR1| SCL --> ZZ,h2 = TD --> zz;
     S/\CL c= {<*z+1*>}
     proof
       let v be object;
       assume
  A39: v in Sphere(0.TR1,1)/\cl_Ball(Y,s*r1);
       then v in Sphere(0.TR1,1) by XBOOLE_0:def 4;
       then A40:v = <*z+1*> or v = <*z-1*> by A34,A33,TARSKI:def 2;
       assume
  A41: not v in {<*z+1*>};
       v in cl_Ball(Y,s*r1) by A39, XBOOLE_0:def 4;
       then ex w be Real st <*z-1*>=<*w*> & |.y.| -s*r1 <= w &
        w <= |.y .| + s*r1 by A41,A40,TARSKI:def 1,A30,A36;
       then r1*(|.p-q.|-s) <= - r1*r by FINSEQ_1:76,A9,A25,A6;
       then r1*(|.p-q.|-s) <= r1*(-r);
       then A42: r <= -(|.p-q.|-s) by A5,XREAL_1:68,XREAL_1:25;
        s - |.p-q.| < |.p-q.|-|.p-q.| by A3,XREAL_1:14;
       hence thesis by A42, A5;
      end;
     then A43:h1 = zz .--> 0.TR by A11,ZFMISC_1:33;
     then rng h1 = {0.TR} by FUNCOP_1:88;
     then h1 is onto by A32,FUNCT_2:def 3;
     then A44: h1" = (zz .--> 0.TR )" by A43,TOPS_2:def 4;
     reconsider HA=hA as Function of TR1|A,TR1| SCL by A22;
     reconsider HH =h1*HA as Function of TR1 | (Sphere(p,r)/\ cl_Ball(q,s)),
       Tdisk(0. TR,1);
     take HH;
     A45: dom h1 = [#](TR1| (S/\CL));
     A46:HA is being_homeomorphism by A19,METRIZTS:2,A22;
      h2 = 0.TR .--> zz by A21,A31,ZFMISC_1:33;
     then A47: h1" is continuous by NECKLACE:9,A44;
      rng h1 = [#]Tdisk(0.TR,1) by ZFMISC_1:33,A32;
     then h1 is being_homeomorphism by A45, A43,A47,TOPS_2:def 5;
     hence HH is being_homeomorphism by A38, TOPS_2:57,A46;
     A48: Fr Ball(Y,s*r1) = Sphere(Y,s*r1) by A1,A27,JORDAN:24;
     A49: Fr Ball(Y,s qua ExtReal*r1) =
     {<*|.y.| qua ExtReal-s *r1*>,<*|.y.|qua ExtReal+s *r1*>}
       by A1,A27,A29,A28,TOPDIM_2:18;
      S /\ Sphere(Y,s*r1) ={}
     proof
       assume S /\ Sphere(Y,s*r1) <>{};
       then consider z be object such that
  A50: z in S /\ Sphere(Y,s*r1) by XBOOLE_0:def 1;
       A51: z in Sphere(Y,s*r1) by A50,XBOOLE_0:def 4;
       A52: z in S by A50,XBOOLE_0:def 4;
       per cases by A52,A34,A33, TARSKI:def 2, A51, A48,A49;
         suppose z = <* 1 *> & z = <*|.y.|-s*r1*>;
         hence thesis by FINSEQ_1:76, A23,A9,A25;
        end;
         suppose z = <* 1 *> & z = <*|.y.|+s*r1*>;
         hence thesis by FINSEQ_1:76, A26,A9,A25;
        end;
         suppose z = <* -1 *> & z = <*|.y.|-s*r1*>;
         then -1 = r1*(|.p-q.|-s) by FINSEQ_1:76,A9,A25;
         then |.p-q.|-s < 0 by A5;
         then |.p-q.|-s+s < 0+ s by XREAL_1:6;
         hence thesis by A3;
        end;
         suppose z = <* -1 *> & z = <*|.y.|+s*r1*>;
         hence thesis by FINSEQ_1:76, A26,A9,A25;
        end;
      end;
     then h .: (Sphere(p,r) /\ Sphere(q,s)) = {} by A18,A16,FUNCT_1:62,A5;
     then HA.: (Sphere(p,r) /\ Sphere(q,s)) ={} by XBOOLE_1:3,RELAT_1:128;
     then A53: HH.:(Sphere(p,r) /\ Sphere(q,s))= h1.:{} by RELAT_1:126
         .= {};
      Sphere(0.TR,1)={}
     proof
       assume Sphere(0.TR,1) <>{};
       then consider w be object such that
           A54: w in Sphere(0.TR,1) by XBOOLE_0:def 1;
        w = 0.TR by A54, A28,EUCLID:77;
       then A55: |.0.TR.| = 1 by A54, TOPREAL9:12;
        0.TR = 0*n by EUCLID:70;
       hence contradiction by A55,EUCLID:7;
      end;
     hence thesis by A53;
     reconsider P=p,Q=q as Point of E by EUCLID:67;
    end;
     suppose
         A56:n>0;
     A57:len (0*n) = n by CARD_1:def 7;
      r1*|.p-q.| < r1*(s+r) by A27,A1,A4,XREAL_1:68;
     then |.Y.| < r1*r + r1*s by A9,A25, A12,ABSVALUE:def 1;
     then A58: |.Y.| < 1 +r1*s by A1,A27, XCMPLX_1:106;
     A59:n < n1 by NAT_1:13;
     then A60: len (Y|n) = n by A10,FINSEQ_1:59;
     A61: now
       let k be Nat;
       assume that
           A64: 1<= k
        and
           A65: k <= n;
       A66: Y.k = (0*n1).k by A65,A59,FUNCT_7:32;
       (Y|n).k = Y.k by A64,A65,FINSEQ_1:1,FUNCT_1:49;
       hence (Y|n).k = (0*n).k by A66;
      end;
     A68: r1 * r = 1 by A1,A27, XCMPLX_1:106;
     then A69:r1*s <=1 by A1,XREAL_1:64,A27;
      |.y.| >= 1 by XREAL_1:64,A27,A1,A2,A9,A25,A68;
     then A70: |.Y.| >=1 by A12,ABSVALUE:def 1;
      Y.n1 >0 by A2, A5,A9,A25, FINSEQ_1:3,FUNCT_7:31,A24;
     then consider c be Real, H be Function of TR1| (S/\ CL),
       Tdisk(0.TR,c) such that
         A71: c>0
      and
         A72: H is being_homeomorphism
      and
         A73: H.:(S /\ Sphere(Y,r1*s)) = Sphere(0.TR,c)
     by A56,Lm4,A69,A70,A58,A61,FINSEQ_1:14,A57,A60;
      rng H = [#]Tdisk(0.TR,c) by A72,TOPS_2:def 5;
     then A74:A is non empty by A71,A22;
     then reconsider HH=H*hA as Function of TR1|A,Tdisk(0.TR,c) by A22;
     A75: HH is being_homeomorphism by A71,A72,A74,A20,A22,TOPS_2:57;
     reconsider c1=1/c as Real;
     set MM= mlt(c1,TR);
     A76: c1 * 0.TR = 0.TR by RLVECT_1:10;
     A77:c1*c = 1 by A71,XCMPLX_1:106;
     then A78: MM.:cl_Ball(0.TR,c) = cl_Ball(0.TR,1) by A71,A76,Th16;
     then reconsider MM1=MM |cl_Ball(0.TR,c) as
       Function of Tdisk(0.TR,c), Tdisk(0.TR,1) by JORDAN24:12;
     reconsider MH=MM1*HH as Function of TR1|A,Tdisk(0.TR,1) by A71;
     take MH;
      MM1 is being_homeomorphism by METRIZTS:2,A71,A78;
     hence MH is being_homeomorphism by A75, A71,A74,TOPS_2:57;
      Sphere(q,s) c= cl_Ball(q,s) by TOPREAL9:17;
     then hA.:(Sphere(p,r) /\ Sphere(q,s)) = h.:(Sphere(p,r) /\ Sphere(q,s))
       by XBOOLE_1:27,RELAT_1:129;
     then HH.:(Sphere(p,r) /\ Sphere(q,s))
          = H.:(h.:(Sphere(p,r) /\ Sphere(q,s))) by RELAT_1:126
         .= Sphere(0.TR,c) by A73,A18,A16,FUNCT_1:62,A5;
     hence MH.:(Sphere(p,r) /\ Sphere(q,s)) = MM1.:Sphere(0.TR,c)
           by RELAT_1:126
         .= MM.:Sphere(0.TR,c) by TOPREAL9:17,RELAT_1:129
         .= Sphere(0.TR,1) by Th16,A71,A76,A77;
    end;
end;
