reserve k, k1, n, n1, m for Nat;
reserve X, y for set;
reserve p for Real;
reserve r for Real;
reserve a, a1, a2, b, b1, b2, x, x0, z, z0 for Complex;
reserve s1, s3, seq, seq1 for Complex_Sequence;
reserve Y for Subset of COMPLEX;
reserve f, f1, f2 for PartFunc of COMPLEX,COMPLEX;
reserve Nseq for increasing sequence of NAT;
reserve h for 0-convergent non-zero Complex_Sequence;
reserve c for constant Complex_Sequence;
reserve R, R1, R2 for C_RestFunc;
reserve L, L1, L2 for C_LinearFunc;
reserve Z for open Subset of COMPLEX;

theorem Th25:
  for a,f,x0 st f is_differentiable_in x0 holds a(#)f
  is_differentiable_in x0 & diff((a(#)f),x0) = a*diff(f,x0)
proof
  let a,f,x0;
  assume
A1: f is_differentiable_in x0;
  then consider N1 be Neighbourhood of x0 such that
A2: N1 c= dom f and
A3: ex L,R st for x st x in N1 holds f/.x-f/.x0 = L/.(x-x0)+R/.(x-x0);
  consider L1,R1 such that
A4: for x st x in N1 holds f/.x-f/.x0 = L1/.(x-x0)+R1/.(x-x0) by A3;
  reconsider R = a(#)R1 as C_RestFunc;
  reconsider L = a(#)L1 as C_LinearFunc;
A5: N1 c= dom(a(#)f) by A2,VALUED_1:def 5;
A6: now
    let x;
A7: x0 in N1 by Th7;
A8:  x-x0 in COMPLEX by XCMPLX_0:def 2;
    assume
A9: x in N1;
    hence (a(#)f)/.x-(a(#)f)/.x0 = a*(f/.x)-(a(#)f)/.x0 by A5,CFUNCT_1:4
      .= a*f/.x-a*f/.x0 by A5,A7,CFUNCT_1:4
      .= a*(f/.x-f/.x0)
      .= a*(L1/.(x-x0)+R1/.(x-x0)) by A4,A9
      .= a*L1/.(x-x0)+a*R1/.(x-x0)
      .= L/.(x-x0)+a*R1/.(x-x0) by CFUNCT_1:65,A8
      .= L/.(x-x0)+R/.(x-x0) by CFUNCT_1:65,A8;
  end;
  hence a(#)f is_differentiable_in x0 by A5;
  hence diff((a(#)f),x0) = L/.1r by A5,A6,Def7
    .= a*L1/.1r by CFUNCT_1:65
    .= a*diff(f,x0) by A1,A2,A4,Def7;
end;
