reserve n for Nat,
  i for Integer,
  p, x, x0, y for Real,
  q for Rational,
  f for PartFunc of REAL,REAL;

theorem Th24:
  for f be PartFunc of REAL,REAL, Z be Subset of REAL, n be Nat
  st f is_differentiable_on n, Z
 for a,b be Real st a < b & ].a,b
  .[ c= Z holds diff(f,Z).n | ].a,b.[ = diff(f,].a,b.[).n
proof
  let f be PartFunc of REAL,REAL;
  let Z be Subset of REAL;
  defpred P[Nat] means f is_differentiable_on $1, Z implies
  for a,b be Real st a < b & ].a,b.[ c= Z
   holds diff(f,Z).$1 | ].a,b.[ = diff(f,].a,b.[).$1;
A1: for k be Nat st P[k] holds P[k+1]
  proof
    let k be Nat such that
A2: P[k];
    assume
A3: f is_differentiable_on (k+1), Z;
    let a,b be Real such that
A4: a < b and
A5: ].a,b.[ c= Z;
A6: (diff(f,Z).k) is_differentiable_on Z by A3;
    then
A7: (diff(f,Z).k) is_differentiable_on ].a,b.[ by A5,FDIFF_1:26;
    then
A8: dom((diff(f,Z).k)`| ].a,b.[) = ].a,b.[ by FDIFF_1:def 7;
A9: dom(((diff(f,Z).k)`|Z)| ].a,b.[) =dom((diff(f,Z).k)`|Z) /\ ].a,b.[ by
RELAT_1:61
      .=Z /\ ].a,b.[ by A6,FDIFF_1:def 7
      .=].a,b.[ by A5,XBOOLE_1:28;
A10: now
      let x be Element of REAL such that
A11:  x in dom(((diff(f,Z).k)`|Z)| ].a,b.[);
      thus (((diff(f,Z).k)`|Z)| ].a,b.[).x =((diff(f,Z).k)`|Z).x by A9,A11,
FUNCT_1:49
        .=diff((diff(f,Z).k),x) by A5,A6,A9,A11,FDIFF_1:def 7
        .=((diff(f,Z).k)`|].a,b.[).x by A7,A9,A11,FDIFF_1:def 7;
    end;
    thus diff(f,Z).(k+1) | ].a,b.[ =((diff(f,Z).k)`|Z)| ].a,b.[ by Def5
      .=(diff(f,Z).k)`| ].a,b.[ by A9,A8,A10,PARTFUN1:5
      .= ((diff(f,Z).k)|].a,b.[) `| ].a,b.[ by A7,FDIFF_2:16
      .=(diff(f,].a,b.[).k)`| ].a,b.[ by A2,A3,A4,A5,Th23,NAT_1:11
      .=diff(f,].a,b.[).(k+1) by Def5;
  end;
A12: P[0]
  proof
    assume f is_differentiable_on 0, Z;
    let a,b be Real such that
    a < b and
A13: ].a,b.[ c=Z;
    thus (diff(f,Z).0) |].a,b.[ = (f|Z)|].a,b.[ by Def5
      .=f|].a,b.[ by A13,FUNCT_1:51
      .=diff(f,].a,b.[).0 by Def5;
  end;
  thus for k be Nat holds P[k] from NAT_1: sch 2(A12,A1);
end;
