  reserve n,m,i for Nat,
          p,q for Point of TOP-REAL n,
          r,s for Real,
          R for real-valued FinSequence;
reserve T1,T2,S1,S2 for non empty TopSpace,
        t1 for Point of T1, t2 for Point of T2,
        pn,qn for Point of TOP-REAL n,
        pm,qm for Point of TOP-REAL m;
reserve T,S for TopSpace,
        A for closed Subset of T,
        B for Subset of S;

theorem Th22:
  for T,A st T is normal
  for f being Function of (T | A),
                          (TOP-REAL n) | ClosedHypercube(0.TOP-REAL n,n|->1)
      st f is continuous
    ex g being Function of T,
                          (TOP-REAL n) | ClosedHypercube(0.TOP-REAL n,n|->1)
      st g is continuous & g|A = f
proof
  let T,A such that
A1:T is normal;
  set TR=TOP-REAL n;
  set N = 0.TOP-REAL n;
  set H=ClosedHypercube(N,n |-> 1);
  let f be Function of T|A, TR | H such that
A2: f is continuous;
A3: [#](TR | H) = H by PRE_TOPC:def 5;
A4: [#](T|A) = A by PRE_TOPC:def 5;
  per cases;
  suppose
A5:   A is empty;
    reconsider TRH=TR|H as non empty TopSpace;
    set g=the continuous Function of T,TRH;
A6:   g|A={} by A5;
    f={} by A5;
    hence thesis by A6;
  end;
  suppose
A7:   A is non empty;
    set CC=Closed-Interval-TSpace(-1,1);
    per cases;
    suppose
A8:   n=0;
      reconsider TRH=TR|H as non empty TopSpace;
A9:   {0.TOP-REAL n} = the carrier of TR by EUCLID:22,A8,JORDAN2C:105;
      then reconsider Z=0.TOP-REAL n as Point of TRH by A3,ZFMISC_1:33;
      H = the carrier of TR by A9,ZFMISC_1:33;
      then
A10:  rng f = the carrier of TR by A4,A7,A3,A9,ZFMISC_1:33;
      reconsider g = T --> Z as Function of T,TR|H;
      take g;
A11:  (the carrier of T)/\A=A by XBOOLE_1:28;
      dom f = A by FUNCT_2:def 1,A4;
      then
      f = A --> 0.TOP-REAL n
        by A10,FUNCOP_1:9,EUCLID:22,A8,JORDAN2C:105;
      hence thesis by A11,FUNCOP_1:12;
    end;
    suppose n<>0;
      then reconsider nn=n as non zero Element of NAT by ORDINAL1:def 12;
      set CC=Closed-Interval-TSpace(-1,1);
      reconsider F=f as Function of T|A,TR by FUNCT_2:7,A3;
      defpred F[Nat,object] means ex g be continuous Function of T, R^1 st
        $2=g & rng g c= [#]CC & g|A = PROJ(n,$1)*F;
A12:  dom f = A by A4,FUNCT_2:def 1;
      N = 0*n by EUCLID:70;
      then
A13:    N = n|->0 by EUCLID:def 4;
A14:  for k be Nat st k in Seg n ex x be object st F[k,x]
      proof
A15:    the carrier of CC = [. -1,1.] by TOPMETR:18;
A16:    T is non empty by A7;
        let k be Nat such that
A17:    k in Seg n;
        rng f c= H by A3;
        then PROJ(n,k).:rng F c= PROJ(n,k).:H by RELAT_1:123;
        then
A18:    PROJ(n,k).:rng F c=[. N.k -(n|->1).k, N.k +(n|->1).k .]
          by A17,Th7;
A19:    dom (PROJ(n,k)*F) = the carrier of (T|A) by FUNCT_2:def 1;
A20:    N.k = 0 by A13;
        (n|->1).k = 1 by A17,FINSEQ_2:57;
        then rng (PROJ(n,k)*F) c= [. -1,1.] by A20,A18,RELAT_1:127;
        then reconsider PF=PROJ(n,k)*F as Function of (T|A),CC
          by A19,A15,FUNCT_2:2;
A21:    F is continuous by A2,PRE_TOPC:26;
        PROJ(n,k) is continuous by TOPREALC:57,A17;
        then consider g be continuous Function of T, CC such that
A22:    g|A = PF by A21,A16, A7,PRE_TOPC:27,A1,TIETZE:23;
A23:    rng g c= REAL;
        dom g =the carrier of T by FUNCT_2:def 1;
        then
        reconsider G=g as Function of T, R^1 by A23,TOPMETR:17,FUNCT_2:2;
A24:    G is continuous by PRE_TOPC: 26;
        rng g c= the carrier of CC by RELAT_1:def 19;
        hence thesis by A24,A22;
      end;
      consider pp be FinSequence such that
A25:    dom pp = Seg n
      and
A26:    for k be Nat st k in Seg n holds F[k,pp.k]
        from FINSEQ_1:sch 1(A14);
A27:  len pp = nn by A25,FINSEQ_1:def 3;
      rng pp c= Funcs(the carrier of T, the carrier of R^1)
      proof
        let y be object;
        assume y in rng pp;
        then consider k be object such that
A28:    k in dom pp
        and
A29:    pp.k = y by FUNCT_1:def 3;
        reconsider k as Nat by A28;
        consider g be continuous Function of T, R^1 such that
A30:      pp.k=g
        and
          rng g c= [#]CC
        and
          g|A = PROJ(n,k)*F by A25,A26,A28;
A31:    rng g c= the carrier of R^1 by RELAT_1:def 19;
        dom g = the carrier of T by FUNCT_2 :def 1;
        hence thesis by A31,FUNCT_2:def 2,A29,A30;
      end;
      then
      pp is FinSequence of Funcs(the carrier of T, the carrier of R^1)
        by FINSEQ_1:def 4;
      then reconsider pp as Element of nn-tuples_on
        Funcs(the carrier of T, the carrier of R^1) by A27,FINSEQ_2:92;
A32:  dom <:pp:> = the carrier of T by FUNCT_2:def 1;
A33:  the carrier of CC = [.-1,1.] by TOPMETR:18;
      rng <:pp:> c= H
      proof
        let y be object;
        assume
A34:      y in rng <:pp:>;
        then consider x be object such that
A35:      x in dom <:pp:>
        and
A36:      <:pp:>.x = y by FUNCT_1:def 3;
        reconsider p = <:pp:>.x as Point of TR by A34,A36;
        now
          let j be Nat;
A37:      N.j =0 by A13;
          assume
A38:      j in Seg n;
          then consider g be continuous Function of T, R^1 such that
A39:        g=pp.j
          and
A40:        rng g c= [#]CC
          and
            g|A = PROJ(n,j)*F by A26;
A41:      dom g = the carrier of T by FUNCT_2:def 1;
          g.x = p.j by Th20,A39;
          then
A42:      p.j in rng g by A41,A35,FUNCT_1:def 3;
          (n|->1).j = 1 by A38,FINSEQ_2:57;
          hence p.j in [.N.j-(n|->1).j,N.j+(n|->1).j.]
            by A37,A42,A40,A33;
        end;
        hence thesis by Def2,A36;
      end;
      then reconsider G=<:pp:> as Function of T,TR|H by A3,A32,FUNCT_2:2;
      take G;
      for i st i in dom pp for h be Function of T,R^1 st
        h = pp.i holds h is continuous
      proof
        let k be Nat such that
A43:      k in dom pp;
        ex g be continuous Function of T, R^1 st pp.k=g & rng g c= [#]CC &
          g|A = PROJ(n,k)*F by A25,A26,A43;
        hence thesis;
      end;
      hence G is continuous by Th21, PRE_TOPC:27;
A44:  dom (G|A) = A by A32,RELAT_1:62;
      for e be set st e in dom f holds (G|A).e = f.e
      proof
        let e be set;
A45:    rng F c= the carrier of TR;
        assume
A46:    e in dom f;
        then G.e in rng G by A32,A12,FUNCT_1:def 3;
        then
A47:    G.e in H by A3;
        f.e in rng f by A46,FUNCT_1:def 3;
        then reconsider Ge=G.e,fe=f.e as Point of TR by A45,A47;
A48:    len fe = n by CARD_1:def 7;
A49:    now
A50:       dom fe = Seg n by A48,FINSEQ_1:def 3;
           let w be Nat;
           assume that
A51:         1<= w
           and
A52:         w <= n;
           consider g be continuous Function of T, R^1 such that
A53:         g=pp.w
           and
             rng g c= [#]CC
           and
A54:         g|A = PROJ(n,w)*F by A51,A52,FINSEQ_1:1,A26;
A55:       Ge.w = g.e by Th20,A53;
A56:       e in dom (g|A) by A46,A12,FUNCT_2:def 1;
           (g|A).e = g.e by A46, A4,FUNCT_1:49;
           then Ge.w = PROJ(n,w).fe by A55,A56,A54,FUNCT_1:12;
           hence Ge.w = fe/.w by TOPREALC:def 6
                     .= fe.w by PARTFUN1:def 6, A51,A52,FINSEQ_1:1,A50;
        end;
A57:    len Ge = n by CARD_1:def 7;
        (G|A).e = G.e by A46,A44, A4,FUNCT_1:47;
         hence thesis by A49,FINSEQ_1:14,A57,A48;
       end;
       hence thesis by A44,A12;
     end;
   end;
end;
