 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 Th4:
   not p in A & r>0 implies
     ex h be Function of (TOP-REAL n) |A,(TOP-REAL n) |Sphere(p,r) st
       h is continuous & h|Sphere(p,r) = id (A/\Sphere(p,r))
proof
  set TR=TOP-REAL n;
  assume that
A1:   not p in A
    and
A2:   r>0;
  set S=Sphere(p,r);
  per cases;
  suppose
A3:   A is empty;
    set h = the continuous Function of TR|A,TR;
    reconsider H=h as Function of TR|A,TR|S by A3;
    take H;
   thus thesis by A3,PRE_TOPC:27;
  end;
  suppose
A4:   A is non empty;
    A<>{p} by A1,TARSKI:def 1;
    then
A5:   A\{p} <>{} by A4,ZFMISC_1:58;
    set TRS=TR|S;
    set nN=n NormF,t=transl(-p,TR),P=transl(p,TR);
A6: A\{p} c= (the carrier of TR)\{p} by XBOOLE_1:33;
    (the carrier of TR)\{p}={p}` by SUBSET_1:def 4;
    then reconsider cTRp=(the carrier of TR)\{p} as
      non empty open Subset of TR by A5,A6;
    set TRp=TR|cTRp,tt=t|TRp;
A7: [#]TRp = cTRp by PRE_TOPC:def 5;
    then reconsider AA=A as Subset of TRp by A1,ZFMISC_1:57,A6;
    reconsider Ir=tt[#]r as Function of TRp,TR by TOPREALC:37;
    reconsider IrNt=Ir</>(nN*tt) as Function of TRp,TR by TOPREALC:46;
    A8: tt = t|the carrier of TRp by TMAP_1:def 4;
    not 0 in rng(nN*tt)
    proof
      assume 0 in rng(nN*tt);
      then consider x be object such that
A9:       x in dom (nN*tt)
        and
A10:     (nN*tt).x=0 by FUNCT_1:def 3;
      tt.x in dom nN by A9,FUNCT_1:11;
      then reconsider Tx=tt.x as Point of TR;
      reconsider Tx as Element of REAL n by EUCLID:22;
A11:  x in dom tt by A9,FUNCT_1:11;
      then
A12:    t.x=tt.x by A8,FUNCT_1:47;
      x in dom t by A11,A8,RELAT_1:57;
      then reconsider X=x as Point of TR;
      0 = nN.Tx by A9,FUNCT_1:12,A10
       .= |.Tx.| by JGRAPH_4:def 1;
      then 0*n=Tx by EUCLID:8;
      then 0.TR = Tx by EUCLID:70
               .= -p+X by A12,RLTOPSP1:def 10;
      then X = --p by RLVECT_1:def 10
            .=p;
      then x in {p} by TARSKI:def 1;
      hence contradiction by A9,A7,XBOOLE_0:def 5;
    end;
    then nN*tt is non-empty by RELAT_1:def 9;
    then reconsider IrNt as continuous Function of TRp,TR;
    set h=(P*IrNt) | (TRp|AA);
A13: h= (P*IrNt) | the carrier of (TRp|AA) by TMAP_1:def 4;
    reconsider h as continuous Function of (TRp|AA),TR by A4;
    (TRp|AA) = TR|A by PRE_TOPC:7, A7;
    then reconsider h as continuous Function of (TR|A),TR;
A14: [#](TR|A)=A by PRE_TOPC:def 5;
    then
A15:  dom h = A by FUNCT_2:def 1;
A16: dom tt = cTRp by A7,FUNCT_2:def 1;
A17: rng h c= S
    proof
      let y be object;
      assume y in rng h;
      then consider x be object such that
A18:      x in dom h
        and
A19:      h.x=y by FUNCT_1:def 3;
      reconsider x as Point of TR by A18,A15;
      tt.x=t.x by A7,A18,A15,FUNCT_1:47,A8,A16;
      then
A20:    tt.x = -p+x by RLTOPSP1:def 10;
      dom (nN*tt) = cTRp by A7,FUNCT_2:def 1;
      then (nN*tt).x = nN.(tt.x) by A7,A18,A15,FUNCT_1:12;
      then
A21:    (nN*tt).x = |.-p+x.| by A20,JGRAPH_4:def 1;
A22:  x in dom (P*IrNt) by A13,A18,RELAT_1:57;
      then x in dom IrNt by FUNCT_1:11;
      then
A23:    IrNt.x = Ir.x (/) (nN*tt).x by VALUED_2:72;
      dom Ir = cTRp by A7,FUNCT_2:def 1;
      then Ir.x = r*(-p+x) by A20, A7,A18,A15,VALUED_2:def 39;
      then
A24:    IrNt.x = (1 / |.-p+x.|)*(r*(-p+x)) by A21,A23,VALUED_2:def 32;
      then reconsider Fx=IrNt.x as Point of TR;
      h.x = (P*IrNt).x by A13,A18,FUNCT_1:47;
      then
A25:    h.x = P.Fx by A22,FUNCT_1:12
           .= p+Fx by RLTOPSP1:def 10;
      --p=p;
      then -p+x<>0.TR by A18,A1,A15,RLVECT_1:6;
      then
A26:    -p+x<>0*n by EUCLID:70;
A27:  -p+x is Element of REAL n by EUCLID:22;
A28:  p+Fx-p = Fx+(p+-p) by RLVECT_1:def 3
            .= Fx+0.TR by RLVECT_1:def 10
            .= Fx by RLVECT_1:def 4;
      |.Fx.| = |.((1 / |.-p+x.|)*r)*(-p+x).| by A24,RLVECT_1:def 7
            .= |. (1 / |.-p+x.|)*r .|* |.-p+x.| by EUCLID:11
            .= |. 1 / |.-p+x.| .|* |.r.|* |.-p+x.| by COMPLEX1:65
            .= |.1 / |.-p+x.|.|*r*|.-p+x.| by ABSVALUE:def 1,A2
            .= |.1 / |.-p+x.|.|*r*|.|.-p+x.|.| by ABSVALUE:def 1
            .= |.1 / |.-p+x.|.|*|.|.-p+x.|.|*r
            .= 1*r by ABSVALUE:6, A26,EUCLID:8,A27
            .=r;
      hence thesis by A28,A25,A19;
    end;
    [#]TRS = S by PRE_TOPC:def 5;
    then reconsider h as Function of TR|A,TR|S by A17,A14,A15,FUNCT_2:2;
A29: dom (h|S) = A/\S by A15,RELAT_1:61;
A31: for x be object st x in dom (h|S) holds (h|S).x = id(A/\S).x
    proof
      let y be object;
      assume
A32:    y in dom (h|S);
      then reconsider x=y as Point of TR by A29;
A33:  x in dom h by A32,RELAT_1:57;
      then
A34:    h.x = (P*IrNt).x by A13,FUNCT_1:47;
      tt.x=t.x by A7,A33,A15,FUNCT_1:47,A8,A16;
      then
A35:    tt.x = -p+x by RLTOPSP1:def 10;
      x-p = -p+x;
      then
A36:    |.-p+x.| =r by A32,TOPREAL9:9;
A37:  x in dom (P*IrNt) by A13,A33,RELAT_1:57;
      then x in dom IrNt by FUNCT_1:11;
      then
A38:    IrNt.x = Ir.x (/) (nN*tt).x by VALUED_2:72;
      dom (nN*tt) = cTRp by A7, FUNCT_2:def 1;
      then (nN*tt).x = nN.(tt.x) by A7,A33,A15,FUNCT_1:12;
      then
A39:    (nN*tt).x = |.-p+x.| by A35,JGRAPH_4:def 1;
      dom Ir = cTRp by A7,FUNCT_2:def 1;
      then Ir.x = r*(-p+x) by A35, A7,A33,A15,VALUED_2:def 39;
      then
A40:    IrNt.x = (1 / |.-p+x.|)*(r*(-p+x)) by A39,A38,VALUED_2:def 32
              .= (1/r *r) *(-p+x) by A36,RLVECT_1:def 7
              .= 1*(-p+x) by XCMPLX_1:87,A2
              .= -p+x by RLVECT_1:def 8;
      thus (h|S).y=h.x by A32,FUNCT_1:47
                 .=P.(-p+x) by A34, A37,FUNCT_1:12,A40
                 .= p+(-p+x) by RLTOPSP1:def 10
                 .= (p+-p)+x by RLVECT_1:def 3
                 .= 0.TR+x by RLVECT_1:def 10
                 .= x by RLVECT_1:def 4
                 .= id(A/\S).y by A32,A29,FUNCT_1:17;
    end;
    take h;
    thus thesis by A31,A15,PRE_TOPC:27,RELAT_1:61;
  end;
end;
