
theorem Th26:
  for m be non zero Nat
  for f be PartFunc of REAL m,REAL
  for x be Element of REAL m
    st f is_differentiable_in x
  holds
    for dx be Element of REAL m
    ex dy be FinSequence of REAL
    st dom dy = Seg m
     & ( for i be Nat st 1 <= i <= m
         holds dy.i = proj(i,m).dx * partdiff(f,x,i) )
    & diff(f,x).dx = Sum dy
proof
  let m be non zero Nat;
  let f be PartFunc of (REAL m),REAL;
  let x be Element of REAL m;
  assume
  A1: f is_differentiable_in x;

  let dx be Element of REAL m;

  consider s be FinSequence of REAL m such that
  A2: dom s = Seg m
    & ( for i be Nat st 1 <= i <= m
        holds
          ex ei be Element of REAL m
          st ei = reproj(i,0* m) . 1
            & s.i = proj(i,m).dx * ei )
    & Sum s = dx by Th5;
  deffunc F1(Nat) = In(diff(f,x).(s.$1), REAL);
  consider dy be FinSequence of REAL such that
  A3: len dy = m
    & for i be Nat st i in dom dy
      holds dy.i = F1(i) from FINSEQ_2:sch 1;
  A4: dom dy = Seg m by A3,FINSEQ_1:def 3;
  A5: for i be Nat st i in dom dy
      holds dy.i = diff(f,x).(s.i)
  proof
    let i be Nat;
    assume i in dom dy;
    then dy.i = In(diff(f,x).(s.i), REAL) by A3;
    hence dy.i = diff(f,x).(s.i);
  end;
  take dy;
  thus dom dy = Seg m by A3,FINSEQ_1:def 3;

  thus for i be Nat st 1 <= i <= m
        holds dy.i = proj(i,m).dx * partdiff(f,x,i)
  proof
    let i be Nat;
    assume
    A6: 1 <= i <= m;
    then
    A7: i in dom dy by A4;
    consider ei be Element of REAL m such that
    A8: ei = reproj(i,0* m).1
      & s.i = proj(i,m).dx * ei by A2,A6;

    thus dy.i
      = diff(f,x).(s.i) by A5,A7
    .= proj(i,m).dx * diff(f,x).ei by A1,A8,Th24
    .= proj(i,m).dx * partdiff(f,x,i) by A1,A6,A8,PDIFF_7:23;
  end;
  thus diff(f,x).dx = Sum dy by A1,A2,A4,A5,Th25;
end;
