reserve r,p,x for Real;
reserve n for Element of NAT;
reserve A for non empty closed_interval Subset of REAL;
reserve Z for open Subset of REAL;

theorem Th4:
  n<>0 implies (-1/n)(#)(cos*(AffineMap(n,0))) is_differentiable_on
  REAL & for x holds (((-1/n)(#)(cos*(AffineMap(n,0))))`|REAL).x =sin(n*x)
proof
  assume
A1: n<>0;
A2: [#]REAL = dom ((-1/n)(#)(cos*(AffineMap(n,0)))) by FUNCT_2:def 1;
A3: [#]REAL = dom (cos*(AffineMap(n,0))) & for x st x in REAL holds
  AffineMap(n, 0).x=n*x + 0 by FCONT_1:def 4,FUNCT_2:def 1;
  then
A4: cos*(AffineMap(n,0)) is_differentiable_on REAL by FDIFF_4:38;
  hence (-1/n)(#)(cos*(AffineMap(n,0))) is_differentiable_on
  REAL by A2,FDIFF_1:20;
A5:
  for x st x in REAL holds (((-1/n)(#)(cos*(AffineMap(n,0))))`|REAL).x =
  sin(n*x)
  proof
    let x;
    assume
A6:   x in REAL;
    then (((-1/n)(#)(cos*(AffineMap(n,0))))`|REAL).x = (-1/n)*diff((cos*(
    AffineMap(n,0))),x) by A2,A4,FDIFF_1:20
      .= (-1/n)*((cos*(AffineMap(n,0)))`|REAL).x by A4,FDIFF_1:def 7,A6
      .= (-1/n)*(-n * sin.(n*x+0)) by A3,FDIFF_4:38,A6
      .= (1/n)*n * (sin.(n*x+0))
      .= n/n*(sin.(n*x+0)) by XCMPLX_1:99
      .= 1*(sin.(n*x+0)) by A1,XCMPLX_1:60
      .= sin(n*x);
    hence thesis;
  end;
  let x;
   x in REAL by XREAL_0:def 1;
  hence thesis by A5;
end;
