 reserve a,x for Real;
 reserve n for Nat;
 reserve A for non empty closed_interval Subset of REAL;
 reserve f,f1 for PartFunc of REAL,REAL;
 reserve Z for open Subset of REAL;

theorem Th5:
  Z c= dom (ln*cosec) implies -ln*cosec is_differentiable_on Z
  & for x st x in Z holds ((-ln*cosec)`|Z).x = cot.x
proof
  assume
A1:Z c= dom (ln*cosec);
then A2:Z c= dom (-ln*cosec) by VALUED_1:8;
A3:ln*cosec is_differentiable_on Z by A1,FDIFF_9:19;
then A4:(-1)(#)(ln*cosec) is_differentiable_on Z by A2,FDIFF_1:20;
A5:for x st x in Z holds sin.x<>0
  proof
    let x;
    assume x in Z;
    then x in dom cosec by A1,FUNCT_1:11;
    hence thesis by RFUNCT_1:3;
  end;
  for x st x in Z holds ((-ln*cosec)`|Z).x = cot.x
   proof
     let x;
     assume
A6:  x in Z;
     ((-ln*cosec)`|Z).x =((-1)(#)((ln*cosec)`|Z)).x by A3,FDIFF_2:19
                 .=(-1)*(((ln*cosec)`|Z).x) by VALUED_1:6
                 .=(-1)*(-cos.x/sin.x) by A1,A6,FDIFF_9:19
                 .=cot(x)
                 .=cot.x by A5,A6,SIN_COS9:16;
   hence thesis;
  end;
  hence thesis by A4;
end;
