reserve F for RealNormSpace;
reserve G for RealNormSpace;
reserve X for set;
reserve x,x0,g,r,s,p for Real;
reserve n,m,k for Element of NAT;
reserve Y for Subset of REAL;
reserve Z for open Subset of REAL;
reserve s1,s3 for Real_Sequence;
reserve seq for sequence of G;
reserve f,f1,f2 for PartFunc of REAL,the carrier of F;
reserve h for 0-convergent non-zero Real_Sequence;
reserve c for constant Real_Sequence;
reserve R,R1,R2 for RestFunc of F;
reserve L,L1,L2 for LinearFunc of F;

theorem Th15:
  f1 is_differentiable_in x0 & f2 is_differentiable_in x0 implies
  f1-f2 is_differentiable_in x0 & diff(f1-f2,x0)=diff(f1,x0)-diff(f2,x0)
  proof
    assume that
    A1: f1 is_differentiable_in x0 and
    A2: f2 is_differentiable_in x0;
    consider N1 be Neighbourhood of x0 such that
    A3: N1 c= dom f1 and
    A4: ex L,R st for x st x in N1 holds f1/.x - f1/.x0 = L/.(x-x0) + R/.(x-x0)
    by A1;
    consider L1,R1 such that
    A5: for x st x in N1 holds f1/.x - f1/.x0 = L1/.(x-x0) + R1/.(x-x0) by A4;
    consider N2 be Neighbourhood of x0 such that
    A6: N2 c= dom f2 and
    A7: ex L,R st for x st x in N2 holds f2/.x - f2/.x0 = L/.(x-x0) + R/.(x-x0)
    by A2;
    consider L2,R2 such that
    A8: for x st x in N2 holds f2/.x - f2/.x0 = L2/.(x-x0) + R2/.(x-x0) by A7;
    reconsider R=R1-R2 as RestFunc of F by Th7;
    reconsider L=L1-L2 as LinearFunc of F by Th3;
    consider N be Neighbourhood of x0 such that
    A9: N c= N1 and
    A10: N c= N2 by RCOMP_1:17;
    A11: N c= dom f2 by A6,A10;
    N c= dom f1 by A3,A9;
    then N /\ N c= dom f1 /\ dom f2 by A11,XBOOLE_1:27; then
    A12: N c= dom (f1-f2) by VFUNCT_1:def 2;
    R1 is total & R2 is total by Def1; then
    R1-R2 is total by VFUNCT_1:32; then
    A13: dom (R1-R2) = REAL by FUNCT_2:def 1;
    L1-L2 is total by VFUNCT_1:32; then
    A14: dom (L1-L2) = REAL by FUNCT_2:def 1;
    A15: now
    let x;
    A16: x0 in N by RCOMP_1:16;
A17:  x - x0 in REAL by XREAL_0:def 1;
    assume
    A18: x in N;
    hence (f1-f2)/.x - (f1-f2)/.x0
    = (f1/.x-f2/.x) - (f1-f2)/.x0 by A12,VFUNCT_1:def 2
    .=f1/.x-f2/.x - (f1/.x0-f2/.x0) by A12,A16,VFUNCT_1:def 2
    .=f1/.x-(f2/.x + (f1/.x0-f2/.x0)) by RLVECT_1:27
    .=f1/.x-(f2/.x + f1/.x0-f2/.x0) by RLVECT_1:28
    .=f1/.x-(f1/.x0+ (f2/.x -f2/.x0)) by RLVECT_1:28
    .=(f1/.x-f1/.x0) - (f2/.x -f2/.x0) by RLVECT_1:27
    .=L1/.(x-x0)+R1/.(x-x0) - (f2/.x - f2/.x0) by A5,A9,A18
    .=L1/.(x-x0)+R1/.(x-x0) - (L2/.(x-x0) + R2/.(x-x0)) by A8,A10,A18
    .=L1/.(x-x0)+(R1/.(x-x0) - (L2/.(x-x0) + R2/.(x-x0))) by RLVECT_1:28
    .=L1/.(x-x0)+( (R1/.(x-x0) - R2/.(x-x0)) - L2/.(x-x0)) by RLVECT_1:27
    .=L1/.(x-x0)+((R1/.(x-x0) - R2/.(x-x0))) - L2/.(x-x0) by RLVECT_1:28
    .=(L1/.(x-x0)-L2/.(x-x0)) + (R1/.(x-x0) - R2/.(x-x0)) by RLVECT_1:28
    .=L/.(x-x0)+(R1/.(x-x0) - R2/.(x-x0)) by A14,VFUNCT_1:def 2,A17
    .=L/.(x-x0)+R/.(x-x0) by A13,VFUNCT_1:def 2,A17;
  end;
  hence f1-f2 is_differentiable_in x0 by A12;
  hence diff(f1-f2,x0)=L/.jj by A12,A15,Def4
  .=L/.jj
  .=L1/.jj - L2/.jj by A14,VFUNCT_1:def 2
  .=L1/.jj - L2/.jj
  .=L1/.jj - L2/.jj
  .=diff(f1,x0) - L2/.jj by A1,A3,A5,Def4
  .=diff(f1,x0) - diff(f2,x0) by A2,A6,A8,Def4;
end;
