 reserve j for set;
 reserve p,r for Real;
 reserve S,T,F for RealNormSpace;
 reserve x0 for Point of S;
 reserve g for PartFunc of S,T;
 reserve c for constant sequence of S;
 reserve R for RestFunc of S,T;
 reserve G for RealNormSpace-Sequence;
 reserve i for Element of dom G;
 reserve f for PartFunc of product G,F;
 reserve x for Element of product G;
reserve G for RealNormSpace-Sequence;
reserve F for RealNormSpace;
reserve i for Element of dom G;
reserve f,f1,f2 for PartFunc of product G, F;
reserve x for Point of product G;
reserve X for set;

theorem Th45:
for G be RealNormSpace-Sequence,
      S be RealNormSpace,
      f be PartFunc of product G, S,
      x,y be Point of product G
ex h be FinSequence of product G, g be FinSequence of S,
    Z,y0 be Element of product carr G st
    y0=y & Z = 0.(product G)
   & len h = len G + 1 & len g = len G  &
  (for i be Nat st i in dom h holds h/.i = Z +* (y0| Seg (len G + 1-'i))) &
  (for i be Nat st i in dom g holds g/.i = f/.(x+h/.i) - f/.(x+h/.(i+1))) &
  (for i be Nat, hi be Point of product G st
    i in dom h & h/.i= hi holds ||. hi .|| <=||. y .||) &
  f /.(x+y) - f/.x = Sum g
proof
   let G be RealNormSpace-Sequence,
       S be RealNormSpace,
       f be PartFunc of product G,S,
       x,y be Point of product G;
   set m= len G;
A1:
   the carrier of (product G) = product carr G by Th10;
   reconsider Z0 = 0.(product G) as Element of product carr G by Th10;
   reconsider y0 = y as Element of product carr G by Th10;
   reconsider y1=y as (len G)-element FinSequence;
   reconsider Z1=0.(product G) as (len G)-element FinSequence;

   len y1 = m by CARD_1:def 7; then
A2:dom y1 = dom G by FINSEQ_3:29;

   len Z1 = m by CARD_1:def 7; then
A3:dom Z1 = dom G by FINSEQ_3:29;

   defpred H[Nat,set] means $2=Z0 +* (y0| Seg (len G + 1-'$1));

A4:for k be Nat st k in Seg(m+1) ex x being Element of product G st H[k,x]
   proof
    let k be Nat;
    assume k in Seg(m+1);
    Z0 +* (y0| Seg (len G + 1-'k)) is Element of product carr G by CARD_3:79;
    hence thesis by A1;
   end;

   consider h be FinSequence of product G such that
A5: dom h = Seg(m+1) &
    for j being Nat st j in Seg(m+1) holds H[j,h.j] from FINSEQ_1:sch 5(A4);

A6:now let j being Nat;
    assume A7: j in dom h; then
    h/.j = h.j by PARTFUN1:def 6;
    hence h/.j = Z0 +* (y0| Seg (len G + 1-'j)) by A7,A5;
   end;

   deffunc Z(Nat)=f/.(x+h/.$1);
   consider z be FinSequence of S such that
A8: len z = m+1 &
    for j being Nat st j in dom z holds z.j = Z(j) from FINSEQ_2:sch 1;

A9:now let j being Nat;
    assume A10: j in dom z; then
    z/.j = z.j by PARTFUN1:def 6;
    hence z/.j = f/.(x+h/.j) by A10,A8;
   end;

   deffunc G(Nat) = z/.$1 - z/.($1+1);
   consider g be FinSequence of S such that
A11:len g = m &
    for j being Nat st j in dom g holds g.j = G(j) from FINSEQ_2:sch 1;

A12:now let j being Nat;
    assume A13: j in dom g; then
    g/.j = g.j by PARTFUN1:def 6;
    hence g/.j = z/.j - z /.(j+1) by A13,A11;
   end;

A14:m+1-'1 = m+1-1 by NAT_1:11,XREAL_1:233;

   reconsider zz0=0 as Element of NAT;
   1 <= m+1 by NAT_1:11; then
A15:1 in dom h by A5; then
   h/.1 = Z0 +* (y0| Seg (len G + 1-'1)) by A6
       .= Z0 +* (y0| dom G) by A14,FINSEQ_1:def 3
       .= Z0 +* y0 by A2; then
A16:h/.1 = y by A2,A3,FUNCT_4:19;

A17:m+1-'(len z) = m+1 - len z by A8,XREAL_1:233;

   1 <= len z & len z <= m+1 by A8,NAT_1:14; then
A18:len z in dom h by A5; then
A19:h/.(len z) = Z0 +* (y0| Seg 0) by A6,A17,A8
             .=0.(product G);

A20:dom h= dom z by A5,A8,FINSEQ_1:def 3; then
A21:z/.1 = f/.(x+y) by A9,A16,A15;

   z/.(len z) = f/. (x+h/.(len z)) by A9,A20,A18; then
A22:z/.(len z) = f/.x by A19,RLVECT_1:def 4;

   take h,g,Z0,y0;

A23:now let i be Nat;
    assume A24: i in dom g; then
A25:i in Seg m by A11,FINSEQ_1:def 3; then
    1 <= i & i <= m by FINSEQ_1:1; then
A26:i+1 <= m+1 by XREAL_1:6;

    Seg m c= Seg (m+1) by NAT_1:11,FINSEQ_1:5; then
A27:z/.i =f/.(x+h/.i) by A9,A5,A25,A20;

    1 <= i+1 by NAT_1:11; then
    i+1 in Seg (m+1) by A26; then
    i+1 in dom z by A8,FINSEQ_1:def 3; then
    z/.(i+1) =f /. (x+h/.(i+1)) by A9;
    hence g/.i = f /. (x+h/.i) - f /.(x+h/.(i+1)) by A12,A24,A27;
   end;

   now let i be Nat, hi be Element of product G;
    assume A28: i in dom h & h/.i= hi; then
    h/.i = Z0 +* (y0| Seg (len G + 1-'i)) by A6;
    hence ||. hi .|| <=||. y .|| by Th44,A28;
   end;
   hence thesis by A6,A21,A22,A23,A8,A12,Th42,A5,A11,FINSEQ_1:def 3;
end;
