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
  for f,Z st Z c= dom f & ex a1 st rng f = {a1} holds f
  is_differentiable_on Z & for x st x in Z holds (f`|Z)/.x = 0c
proof
  reconsider cf = COMPLEX --> 0c as Function of COMPLEX,COMPLEX;
  set R = cf;
  now
    let h;
    now
      let n be Nat;
A2:   rng h c= dom R & n in NAT by ORDINAL1:def 12;
      thus ((h")(#)(R/*h)).n = (h").n*((R/*h).n) by VALUED_1:5
        .= (h").n*(R/.(h.n)) by A2,FUNCT_2:109
        .= (h").n* 0c
        .= 0c;
    end;
    then (h")(#)(R/*h) is constant & ((h")(#)(R/*h)).0 = 0c by VALUED_0:def 18;
    hence (h")(#)(R/*h) is convergent & lim ((h")(#)(R/*h)) = 0c by CFCONT_1:26
,27;
  end;
  then reconsider R as C_RestFunc by Def3;
  set L = cf;
  for z holds L/.z = 0c*z
   by XCMPLX_0:def 2,FUNCOP_1:7;
  then reconsider L as C_LinearFunc by Def4;
  let f, Z such that
A3: Z c= dom f;
  given a1 such that
A4: rng f = {a1};
A5: now
    let x0;
    assume
A6: x0 in dom f;
    then f.x0 in {a1} by A4,FUNCT_1:def 3;
    then f/.x0 in {a1} by A6,PARTFUN1:def 6;
    hence f/.x0 = a1 by TARSKI:def 1;
  end;
A7: now
    let x0;
    assume
A8: x0 in Z;
    then consider N being Neighbourhood of x0 such that
A9: N c= Z by Th9;
A10: N c= dom f by A3,A9;
A11: x - x0 in COMPLEX by XCMPLX_0:def 2;
    for x st x in N holds f/.x-f/.x0 = L/.(x-x0)+R/.(x-x0)
    proof
      let x;
      assume x in N;
      hence f/.x-f/.x0 = a1-f/.x0 by A5,A10
        .= a1-a1 by A3,A5,A8
        .= L/.(x-x0)+0c by FUNCOP_1:7,A11
        .= L/.(x-x0)+R/.(x-x0) by FUNCOP_1:7,A11;
    end;
    hence f is_differentiable_in x0 by A10;
  end;
  hence
A12: f is_differentiable_on Z by A3,Th15;
  let x0;
  assume
A13: x0 in Z;
  then
A14: f is_differentiable_in x0 by A7;
  then ex N being Neighbourhood of x0 st N c= dom f & ex L,R st for x st x in
  N holds f/.x-f/.x0 = L/.(x-x0)+R/.(x-x0);
  then consider N being Neighbourhood of x0 such that
A15: N c= dom f;
A16: for x st x in N holds f/.x-f/.x0 = L/.(x-x0)+R/.(x-x0)
  proof
    let x;
A17: x - x0 in COMPLEX by XCMPLX_0:def 2;
    assume x in N;
    hence f/.x-f/.x0 = a1-f/.x0 by A5,A15
      .= a1-a1 by A3,A5,A13
      .= L/.(x-x0)+0c by FUNCOP_1:7,A17
      .= L/.(x-x0)+R/.(x-x0) by FUNCOP_1:7,A17;
  end;
  thus (f`|Z)/.x0 = diff(f,x0) by A12,A13,Def12
    .= L/.1r by A14,A15,A16,Def7
    .= 0c;
end;
