reserve F for RealNormSpace;
reserve G for RealNormSpace;
reserve y,X for set;
reserve x,x0,x1,x2,g,g1,g2,r,r1,s,p,p1,p2 for Real;
reserve i,m,k for Element of NAT;
reserve n,k for non zero Element of NAT;
reserve Y for Subset of REAL;
reserve Z for open Subset of REAL;
reserve s1,s3 for Real_Sequence;
reserve seq,seq1 for sequence of G;
reserve f,f1,f2 for PartFunc of REAL,REAL n;
reserve g,g1,g2 for PartFunc of REAL,REAL-NS n;
reserve h for 0-convergent non-zero Real_Sequence;
reserve c for constant Real_Sequence;
reserve GR,R for RestFunc of REAL-NS n;
reserve DFG,L for LinearFunc of REAL-NS n;

theorem Th38:
for J be Function of REAL 1,REAL,
      x0 be Element of REAL 1
   st J=proj(1,1)
 holds J is_differentiable_in x0 & diff(J,x0) = J
proof
  let J be Function of REAL 1,REAL,
      x0 be Element of REAL 1;
  assume A1: J=proj(1,1);
A2: 1 in Seg 1;
  set R = (REAL 1) --> (0*1);
  set L = <>*J;
  rng J = dom (proj(1,1) qua Function") by A1,A2,PDIFF_1:1,2;
  then
A3: dom L = dom J by RELAT_1:27
    .= REAL 1 by A1,A2,PDIFF_1:1;
    reconsider L as Function of REAL 1,REAL 1 by PDIFF_1:2;
    set f = <>*J;
A4: L= id (dom J) by A1,FUNCT_1:39
    .= id (REAL 1) by A1,A2,PDIFF_1:1;
A5: for x,y being Element of REAL 1 holds L.(x+y) = L.x+L.y
    by A4;
A6: for x being Element of REAL 1, r being Real holds L.(r*x) = r*L.x
    by A4;
    then
A7: L is LinearOperator of 1,1 by A5,PDIFF_6:def 1,def 2;
    reconsider r0=1 as Real;
A8: {y where y is Element of REAL 1: |.y-x0.| < r0} c= dom f
    proof
      let x be object;
      assume x in {y where y is Element of REAL 1: |.y-x0.| < r0};
      then ex y be Element of REAL 1 st x=y & |.y-x0.| < r0;
      hence x in dom f by A3;
    end;
A9:for r be Real st r > 0
      ex d be Real st d > 0 &
      for z be Element of REAL 1,w be Element of REAL 1 st
      z <> 0*1 & |.z.| < d & w = R.z holds |.z.|"* |. w .| < r
   proof
     let r be Real;
     assume A10: r > 0;
     take d=r;
     thus 0 < d by A10;
     let z be Element of REAL 1,w be Element of REAL 1;
     assume A11: z <> 0*1 & |.z.| < d & w = R.z;
     w= 0*1 by A11,FUNCOP_1:7;
     then |. w .| = 0 by EUCLID:7;
     hence thesis by A10;
   end;
A12: for x be Element of REAL 1 st |.x-x0.| < r0 holds
      f/.x - f/.x0 = L.(x-x0) + R.(x-x0)
   proof
     let x be Element of REAL 1;
     assume |.x-x0.| < r0;
     thus f/.x - f/.x0 = L/.x -L/.x0
     .=L/.x +L/.((-1)*x0) by A6
     .=L.(x-x0) by A5
     .=L.(x-x0) +  0*1 by RVSUM_1:16
     .= L.(x-x0) + R.(x-x0) by FUNCOP_1:7;
   end;
   then f is_differentiable_in x0 & diff(f,x0) = L by A7,A8,A9,PDIFF_6:24;
   hence J is_differentiable_in x0;
A13: rng J c= REAL;
   thus diff(J,x0) =proj(1,1)*L by A12,A7,A8,A9,PDIFF_6:24
           .=proj(1,1)*(proj(1,1) qua Function") * J by RELAT_1:36
           .=id (rng proj(1,1) )* J by FUNCT_1:39
           .= id REAL * J by A2,PDIFF_1:1
           .=J by A13,RELAT_1:53;
end;
