reserve Y for RealNormSpace;
reserve X,Y for RealBanachSpace;
reserve Z for open Subset of REAL;
reserve a,b,c,d,e,r,x0 for Real;
reserve y0 for VECTOR of X;
reserve G for Function of X,X;

theorem Th40:
for f be continuous PartFunc of REAL,the carrier of X,
    g be PartFunc of REAL,the carrier of X
  st dom f = [.a,b.] & dom g = [.a,b.] & Z = ].a,b.[
   & for t be Real st t in [.a,b.] holds g/.t = y0 + integral(f,a,t) holds
   g is continuous & g is_differentiable_on Z
 & for t be Real st t in Z holds diff(g,t) = f/.t
proof
   let f be continuous PartFunc of REAL,the carrier of X,
       g be PartFunc of REAL,the carrier of X;
   assume that
A2: dom f = [.a,b.] and
A3: dom g = [.a,b.] and
D1: Z = ].a,b.[ and
D2: for t be Real st t in [.a,b.] holds g/.t = y0+ integral(f,a,t);
   deffunc FX(Element of REAL) = integral(f,a,$1);
   consider F0 be Function of REAL,the carrier of X such that
A5: for x be Element of REAL holds F0.x = FX(x) from FUNCT_2:sch 4;
   set G0 = REAL --> y0;
   set F = F0|[.a,b.], G = G0|[.a,b.];
   dom F = dom F0 /\ [.a,b.] & dom G = dom G0 /\ [.a,b.] by RELAT_1:61; then
   dom F = REAL /\ [.a,b.] & dom G = REAL /\ [.a,b.] by FUNCT_2:def 1; then
A6:dom F = [.a,b.] & dom G = [.a,b.] & dom g = dom F /\ dom G
      by A3,XBOOLE_1:28;
A10:].a,b.[ c= [.a,b.] by XXREAL_1:25;
A7:for x be Real st x in [.a,b.] holds F/.x = integral(f,a,x)
   proof
    let x be Real;
    assume x in [.a,b.]; then
A8: F/.x = F.x & F.x = F0.x by A6,PARTFUN1:def 6,FUNCT_1:47;
    x in REAL by XREAL_0:def 1;
    hence F/.x = integral(f,a,x) by A5,A8;
   end; then
A12:for x be Real st
     x in ].a,b.[ holds F/.x = integral(f,a,x) by A10;
A14:now let x be Real;
    assume A15: x in Z;
    then f is_continuous_in x by A10,A2,D1,NFCONT_3:def 2;
    hence F is_differentiable_in x & diff(F,x)=f/.x
       by A15,A2,D1,A12,A10,A6,Th1955;
   end;
   then for x be Real st x in Z holds F is_differentiable_in x;
   then
A16:F is_differentiable_on Z by D1,A6,XXREAL_1:25,NDIFF_3:10;
A18:now let x be Real;
    assume A19: x in [.a,b.]; then
    G/.x = G.x by A6,PARTFUN1:def 6; then
    G/.x = G0.x by A19,A6,FUNCT_1:47;
    hence G/.x = y0 by XREAL_0:def 1,FUNCOP_1:7;
   end;
   G|Z is constant; then
A23: G is_differentiable_on Z & for x be Real st x in Z holds (G`|Z).x = 0.X
      by A6,D1,A10,NDIFF_3:20;
   now let x be Element of REAL;
    assume A25: x in dom g; then
    G/.x = y0 & F/.x = integral(f,a,x) by A3,A7,A18;
    hence g/.x = G/.x + F/.x by A3,D2,A25;
   end; then
A29: g = G + F by A6,VFUNCT_1:def 1;
   F is continuous by A6,A7,Th35,A2;
   hence g is continuous by A29;
   thus B1: g is_differentiable_on Z
     by A29,A16,A23,A3,D1,A10,NDIFF_3:17;
   thus for t be Real st t in Z holds diff(g,t) = f/.t
   proof
    let t be Real;
    assume A33: t in Z; then
    diff(g,t) = (g`|Z).t & (g`|Z).t = diff(G,t) + diff(F,t)
  & diff(G,t) = (G`|Z).t & (G`|Z).t = 0.X by A23,B1,A29,A16,NDIFF_3:17,def 6;
    hence diff(g,t) = f/.t by A14,A33;
   end;
end;
