reserve E, F, G,S,T,W,Y for RealNormSpace;
reserve f,f1,f2 for PartFunc of S,T;
reserve Z for Subset of S;
reserve i,n for Nat;

theorem Th23:
  for E,F,G be RealNormSpace,
      Z be Subset of E,
      T be Subset of F,
      u be PartFunc of E,F,
      v be PartFunc of F,G
   st u.:Z c= T
    & u is_differentiable_on Z
    & u `| Z is_continuous_on Z
    & v is_differentiable_on T
    & v `| T is_continuous_on T
  holds
     v*u is_differentiable_on Z
   & v*u `| Z is_continuous_on Z
proof
  let E,F,G be RealNormSpace,
      Z be Subset of E,
      T be Subset of F,
      u be PartFunc of E,F,
      v be PartFunc of F,G;

  assume that
  A1: u.:Z c= T and
  A2: u is_differentiable_on Z
    & u `| Z is_continuous_on Z and
  A3: v is_differentiable_on T
    & v `| T is_continuous_on T;

  A4: u is_continuous_on Z by A2,NDIFF_1:45;

  A5: v*u is_differentiable_on Z
    & for x be Point of E st x in Z
      holds (v*u `| Z)/.x = ((v`| T)/.(u/.x)) * ((u`| Z)/.x)
    by A1,A2,A3,Th19;

  set f = v*u `| Z;
  set g = u`| Z;
  set h = v`| T;

  A6: now
    let x0,x1 be Point of E;
    assume A7: x0 in Z & x1 in Z;

    A8: now
      let dx be Point of E;
      assume
      A9: ||.dx.|| <= 1;

      reconsider gx1 = g/.x1 as Lipschitzian LinearOperator of E,F
        by LOPBAN_1:def 9;
      A10: dom(gx1) = the carrier of E by FUNCT_2:def 1;
      reconsider hux1 = h/.(u/.x1) as Lipschitzian LinearOperator of F,G
        by LOPBAN_1:def 9;
      reconsider hux0 = h/.(u/.x0) as Lipschitzian LinearOperator of F,G
        by LOPBAN_1:def 9;

      A11: modetrans(h/.(u/.x1),F,G) = hux1 by LOPBAN_1:def 11;
      A12: hux0 is additive;
      A13: (f/.x1).dx
       = ((h/.(u/.x1)) * (g/.x1)).dx by A1,A2,A3,A7,Th19
      .= (hux1*gx1).dx by A11,LOPBAN_1:def 11
      .= (h/.(u/.x1)).((g/.x1).dx) by A10,FUNCT_1:13;

      reconsider gx0 = g/.x0 as Lipschitzian LinearOperator of E,F
        by LOPBAN_1:def 9;
      reconsider gx1 = g/.x1 as Lipschitzian LinearOperator of E,F
        by LOPBAN_1:def 9;

      A14: dom(gx0) = the carrier of E by FUNCT_2:def 1;
      A15: modetrans(g/.x0,E,F) = gx0 by LOPBAN_1:def 11;

      A16: (f/.x0).dx
          = ((h/.(u/.x0)) * (g/.x0)).dx by A1,A2,A3,A7,Th19
        .= (hux0 * gx0).dx by A15,LOPBAN_1:def 11
        .= (h/.(u /.x0)).((g/.x0).dx) by A14,FUNCT_1:13;

      A17: (f/.x1 - f/.x0).dx
         = (f/.x1).dx - (f/.x0).dx by LOPBAN_1:40
        .= (h/.(u/.x1)).((g/.x1).dx)
            - (h/.(u/.x0)).((g/.x1).dx)
            + (h/.(u/.x0)).((g/.x1).dx)
            - (h/.(u/.x0)).((g/.x0).dx) by A13,A16,RLVECT_4:1
        .= (h/.(u/.x1)).((g/.x1).dx)
            - (h/.(u/.x0)).((g/.x1).dx)
            + ( (h/.(u/.x0)).((g/.x1).dx)
              - (h/.(u/.x0)).((g/.x0).dx) ) by RLVECT_1:28
        .= (h/.(u/.x1) - h/.(u/.x0)).((g/.x1).dx)
            + ( (h/.(u/.x0)).((g/.x1).dx)
              - (h/.(u/.x0)).((g/.x0).dx) ) by LOPBAN_1:40
        .= (h/.(u/.x1) - h/.(u/.x0)).((g/.x1).dx)
            + ( (h/.(u/.x0)).((g/.x1).dx)
              + (-1)*(h/.(u/.x0)).((g/.x0).dx) ) by RLVECT_1:16
        .= (h/.(u/.x1) - h/.(u/.x0)).((g/.x1).dx)
            + ( hux0.((g/.x1).dx)
              + hux0.((-1)*(g/.x0).dx) ) by LOPBAN_1:def 5
        .= (h/.(u/.x1) - h/.(u/.x0)).((g/.x1).dx)
            + hux0.((g/.x1).dx + (-1)*(g/.x0).dx) by A12
        .= (h/.(u/.x1) - h/.(u/.x0)).((g/.x1).dx)
            + (h/.(u/.x0)).((g/.x1).dx - (g/.x0).dx) by RLVECT_1:16
        .= (h/.(u/.x1) - h/.(u/.x0)).((g/.x1).dx)
            + (h/.(u/.x0)).((g/.x1 - g/.x0).dx) by LOPBAN_1:40;
      reconsider h10 = h/.(u/.x1) - h/.(u/.x0)
        as Lipschitzian LinearOperator of F,G by LOPBAN_1:def 9;
      reconsider g10 = g/.x1 - g/.x0
        as Lipschitzian LinearOperator of E,F by LOPBAN_1:def 9;

      A18: ||. (f/.x1 - f/.x0).dx .||
        <= ||.h10.(gx1.dx).|| + ||.hux0.(g10.dx).|| by A17,NORMSP_1:def 1;

      A19: ||.h10.(gx1.dx).||
        <= ||.(h/.(u/.x1)) - (h/.(u/.x0)).|| * ||.gx1.dx.|| by LOPBAN_1:32;

      0 <= ||.(h/.(u/.x1)) - (h/.(u/.x0)).|| by NORMSP_1:4;

      then ||. h/.(u/.x1) - h/.(u/.x0) .|| * ||. gx1.dx .||
        <= ||. h/.(u/.x1) - h/.(u/.x0) .|| * (||. g/.x1 .|| * ||.dx.||)
          by LOPBAN_1:32,XREAL_1:64;
      then
      A20: ||.h10 .(gx1.dx).||
        <= ||. h/.(u/.x1) - h/.(u/.x0) .|| * ||. g/.x1 .|| * ||.dx.||
          by A19,XXREAL_0:2;

      A21: ||.hux0.(g10.dx).|| <= ||. h/.(u/.x0) .|| * ||.g10.dx.||
          by LOPBAN_1:32;

      0 <= ||. h/.(u/.x0) .|| by NORMSP_1:4;
      then ||. h/.(u/.x0) .|| * ||.g10.dx.||
        <= ||. h/.(u/.x0) .|| * (||.g/.x1 - g/.x0.|| * ||.dx.||)
        by LOPBAN_1:32,XREAL_1:64;
      then ||.hux0.(g10.dx ).||
        <= ||. h/.(u/.x0) .|| * ||.g/.x1 - g/.x0.|| * ||.dx.||
        by A21,XXREAL_0:2;
      then ||.h10.(gx1.dx).|| + ||.hux0.(g10.dx ).||
        <= ||.h/.(u/.x1) - h/.(u/.x0).|| * ||. g/.x1 .|| * ||.dx.||
          + ||.h/.(u/.x0).|| * ||.g/.x1 - g/.x0.|| * ||.dx.||
        by A20,XREAL_1:7;
      then
      A22: ||. (f/.x1 - f/.x0 ).dx .||
        <= ( ||.h/.(u/.x1) - h/.(u/.x0).|| * ||.g/.x1.||
          + ||.h/.(u/.x0).|| * ||.g/.x1 - g/.x0.|| ) * ||.dx.||
        by A18,XXREAL_0:2;

        0 <= ||.h/.(u/.x1) - h/.(u/.x0).||
      & 0 <= ||. g/.x1 .|| by NORMSP_1:4;
      then
      A23: 0 * ||. g/.x1 .||
        <= ||.h/.(u/.x1) - h/.(u/.x0).|| * ||. g/.x1 .|| by XREAL_1:64;

      0 <= ||. h/.(u/.x0) .|| & 0 <= ||.g/.x1 - g/.x0.|| by NORMSP_1:4;
      then 0 * ||.g/.x1 - g/.x0.||
        <= ||.h/.(u/.x0).|| * ||.g/.x1 - g/.x0.|| by XREAL_1:64;
      then 0 + 0
        <= ||.h/.(u/.x1) - h/.(u/.x0).|| * ||.g/.x1 .||
        + ||. h/.(u/.x0) .|| * ||.g/.x1 - g/.x0.|| by A23,XREAL_1:7;
      then ( ||.h/.(u/.x1) - h/.(u/.x0).|| * ||.g/.x1.||
            + ||.h/.(u/.x0).|| * ||.g/.x1 - g/.x0.|| ) * ||.dx.||
        <= ( ||.h/.(u/.x1) - h/.(u/.x0).|| * ||. g/.x1 .||
            + ||.h/.(u/.x0).|| * ||.g/.x1 - g/.x0.|| ) * 1 by A9,XREAL_1:64;

      hence ||.(f/.x1 - f/.x0).dx.||
          <= ||.h/.(u/.x1) - h/.(u/.x0).|| * ||.g/.x1.||
          + ||.h/.(u/.x0).|| * ||.g/.x1 - g/.x0.|| by A22,XXREAL_0:2;
    end;

    set K = ||.h/.(u/.x1) - h/.(u/.x0).|| * ||.g/.x1.||
          + ||.h/.(u/.x0).|| * ||.g/.x1 - g/.x0.||;

    reconsider f10 = f/.x1 - f/.x0
      as Lipschitzian LinearOperator of E,G
      by LOPBAN_1:def 9;

    A24: (for s be Real st s in PreNorms(f10) holds s <= K)
          implies upper_bound PreNorms(f10) <= K by SEQ_4:45;

    now
      let s be Real;
      assume s in PreNorms(f10);
      then consider dx be VECTOR of E such that
      A25: s = ||.f10.dx.|| & ||.dx.|| <= 1;
      thus s <= K by A8,A25;
    end;

    hence ||.f/.x1 - f/.x0.||
        <= ||.h/.(u/.x1) - h/.(u/.x0).|| * ||.g/.x1.||
        + ||.h/.(u/.x0).|| * ||.g/.x1 - g/.x0.|| by A24,LOPBAN_1:30;
  end;

  A26: Z = dom f by A5,NDIFF_1:def 9;

  for x0 be Point of E
  for r be Real st x0 in Z & 0 < r
  holds
    ex s be Real
    st 0 < s
     & for x1 be Point of E
        st x1 in Z & ||.x1 - x0.|| < s
       holds ||.f/.x1 - f/.x0.|| < r
  proof
    let x0 be Point of E;
    let r be Real;
    assume A27: x0 in Z & 0 < r;
    set r0 = r/2;
    A28: 0 < r0 & r0 < r by A27,XREAL_1:215,216;
    set r1 = r0/2;
    A29: 0 < r1 & r1 < r0 by A28,XREAL_1:215,216;

    consider s10 be Real such that
    A30: 0 < s10
       & for x1 be Point of E
          st x1 in Z & ||.x1 - x0.|| < s10
         holds ||.g/.x1 - g/.x0.|| < 1 by A2,A27,NFCONT_1:19;

    A31: now
      let x1 be Point of E;
      assume x1 in Z & ||.x1 - x0.|| < s10;
      then A32: ||.g/.x1 - g/.x0.|| < 1 by A30;
      g/.x1 = g/.x1 - g/.x0 + g/.x0 by RLVECT_4:1;
      then A33: ||. g/.x1 .|| <= ||.g/.x1 - g/.x0.|| + ||.g/.x0.||
      by NORMSP_1:def 1;

      ||.g/.x1 - g/.x0.|| + ||.g/.x0.|| <= 1 + ||.g/.x0.|| by A32,XREAL_1:7;
      hence ||.g/.x1.|| <= 1 + ||.g/.x0 .|| by A33,XXREAL_0:2;
    end;
    A34: 0 + 0 < 1 + ||.g/.x0.|| by XREAL_1:8,NORMSP_1:4;
    set r10 = r1 /(1 + ||.g/.x0.|| );
    u.x0 in u.:Z by A2,A27,FUNCT_1:def 6;
    then u.x0 in T by A1;
    then u/.x0 in T by A2,A27,PARTFUN1:def 6;
    then consider d be Real such that
    A35: 0 < d
       & for y1 be Point of F
         st y1 in T & ||.y1 - u/.x0.|| < d
         holds ||.h/.y1 - h/.(u/.x0).|| < r10
      by A3,A29,A34,XREAL_1:139,NFCONT_1:19;

    consider s11 be Real such that
    A36: 0 < s11
       & for x1 be Point of E
         st x1 in Z & ||.x1 - x0.|| < s11
         holds ||.u/.x1 - u/.x0.|| < d
      by A4,A27,A35,NFCONT_1:19;

    A37:
    now
      let x1 be Point of E;
      assume A38: x1 in Z & ||.x1 - x0.|| < s11;
      then A39: ||.u/.x1 - u/.x0.|| < d by A36;
      u.x1 in u.:Z by A2,A38,FUNCT_1:def 6;
      then u.x1 in T by A1;
      then u/.x1 in T by A2,A38,PARTFUN1:def 6;
      hence ||.h/.(u/.x1) - h/.(u/.x0).|| < r10 by A35,A39;
    end;

    reconsider s1=min(s10,s11) as Real;

    A40: 0 < s1
       & for x1 be Point of E
         st x1 in Z & ||.x1 - x0.|| < s1
         holds ||.h/.(u/.x1) - h/.(u/.x0).|| * ||.g/.x1.|| <= r1
    proof
      thus 0 < s1 by A30,A36,XXREAL_0:15;
      let x1 be Point of E;
      assume A41: x1 in Z & ||.x1 - x0.|| < s1;
      s1 <= s10 by XXREAL_0:17;
      then ||.x1 - x0.|| < s10 by A41,XXREAL_0:2;
      then A42: ||.g/.x1.|| <= 1 + ||.g/.x0.|| by A31,A41;
      s1 <= s11 by XXREAL_0:17;
      then ||.x1 - x0.|| < s11 by A41,XXREAL_0:2;
      then A43: ||.h/.(u/.x1) - h/.(u/.x0).|| < r10 by A37,A41;

        0 <= ||.g/.x1 .||
      & 0 <= ||.h/.(u/.x1) - h/.(u/.x0).|| by NORMSP_1:4;
      then ||.h/.(u/.x1) - h/.(u/.x0).|| * ||.g/.x1.||
        <= r10 * (1 + ||.g/.x0.||) by A42,A43,XREAL_1:66;
      hence ||.h/.(u/.x1) - h/.(u/.x0).|| * ||.g/.x1.|| <= r1
        by A34,XCMPLX_1:87;
    end;

    A44: 0 + 0 < 1 + ||.h/.(u/.x0).|| by NORMSP_1:4,XREAL_1:8;
    set r10 = r1 / (1 + ||.h/.(u/.x0).||);
    A45: 0 < r10 by A29,A44,XREAL_1:139;
    consider s2 be Real such that
    A46: 0 < s2
       & for x1 be Point of E
         st x1 in Z & ||.x1 - x0.|| < s2
         holds ||.g/.x1 - g/.x0.|| < r10
       by A2,A27,A29,A44,NFCONT_1:19,XREAL_1:139;

    A47: 0 < s2
       & for x1 be Point of E
         st x1 in Z & ||.x1 - x0.|| < s2
         holds ||.h/.(u/.x0).|| * ||.g/.x1 - g/.x0.|| <= r1
    proof
      thus 0 < s2 by A46;
      let x1 be Point of E;
      assume x1 in Z & ||.x1 - x0.|| < s2;
      then A48: ||.g/.x1 - g/.x0.|| < r10 by A46;
        0 <= ||.g/.x1 - g/.x0.||
      & 0 <= ||.h/.(u/.x0).|| by NORMSP_1:4;
      then
      A49: ||.h/.(u/.x0).|| * ||.g/.x1 - g/.x0.||
        <= ||.h/.(u/.x0).|| * r10 by A48,XREAL_1:64;
      0 + ||.h/.(u/.x0).|| <= ||.h/.(u/.x0).|| + 1 by XREAL_1:7;
      then ||.h/.(u/.x0).|| * r10 <= (||.h/.(u/.x0).|| + 1) * r10
        by A45,XREAL_1:64;
      then ||.h/.(u/.x0).|| * r10 <= r1 by A44,XCMPLX_1:87;
      hence ||.h/.(u/.x0).|| * ||.g/.x1 - g/.x0.|| <= r1 by A49,XXREAL_0:2;
    end;

    reconsider s = min(s1,s2) as Real;
    take s;
    thus 0 < s by A40,A47,XXREAL_0:15;

    let x1 be Point of E;
    assume A50: x1 in Z & ||.x1 - x0.|| < s;
    s <= s1 by XXREAL_0:17;
    then ||.x1 - x0.|| < s1 by A50,XXREAL_0:2;
    then A51: ||.h/.(u/.x1) - h/.(u/.x0).|| * ||.g/.x1.|| <= r1 by A40,A50;
    s <= s2 by XXREAL_0:17;
    then ||.x1 - x0.|| < s2 by A50,XXREAL_0:2;
    then ||.h/.(u/.x0).|| * ||.g/.x1 - g/.x0.|| <= r1 by A47,A50;
    then
    A52: ||.h/.(u/.x1) - h/.(u/.x0).|| * ||.g/.x1.||
        + ||.h/.(u/.x0).|| * ||.g/.x1 - g/.x0.|| <= r1 + r1 by A51,XREAL_1:7;

    ||.f/.x1 - f/.x0.|| <= ||.h/.(u/.x1) - h/.(u/.x0).|| * ||.g/.x1.||
        + ||.h/.(u/.x0).|| * ||.g/.x1 - g/.x0.|| by A6,A27,A50;
    then ||.f/.x1 - f/.x0.|| <= r0 by A52,XXREAL_0:2;
    hence ||.f/.x1 - f/.x0.|| < r by A28,XXREAL_0:2;
  end;
  hence thesis by A1,A2,A3,A26,Th19,NFCONT_1:19;
end;
