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