let Z be open Subset of REAL ; :: thesis: ( Z c= dom ((- cot ) - (id Z)) implies ( (- cot ) - (id Z) is_differentiable_on Z & ( for x being Real st x in Z holds
(((- cot ) - (id Z)) `| Z) . x = (cot . x) ^2 ) ) )

assume A1: Z c= dom ((- cot ) - (id Z)) ; :: thesis: ( (- cot ) - (id Z) is_differentiable_on Z & ( for x being Real st x in Z holds
(((- cot ) - (id Z)) `| Z) . x = (cot . x) ^2 ) )

then Z c= (dom (- cot )) /\ (dom (id Z)) by VALUED_1:12;
then A2: ( Z c= dom (- cot ) & Z c= dom (id Z) ) by XBOOLE_1:18;
then A3: Z c= dom cot by VALUED_1:8;
A4: for x being Real st x in Z holds
(id Z) . x = (1 * x) + 0 by FUNCT_1:35;
then A5: ( id Z is_differentiable_on Z & ( for x being Real st x in Z holds
((id Z) `| Z) . x = 1 ) ) by A2, FDIFF_1:31;
for x being Real st x in Z holds
cot is_differentiable_in x
proof end;
then A6: cot is_differentiable_on Z by A3, FDIFF_1:16;
then A7: ( (- 1) (#) cot is_differentiable_on Z & ( for x being Real st x in Z holds
(((- 1) (#) cot ) `| Z) . x = (- 1) * (diff cot ,x) ) ) by A2, FDIFF_1:28;
set f = - cot ;
for x being Real st x in Z holds
(((- cot ) - (id Z)) `| Z) . x = (cot . x) ^2
proof
let x be Real; :: thesis: ( x in Z implies (((- cot ) - (id Z)) `| Z) . x = (cot . x) ^2 )
assume A8: x in Z ; :: thesis: (((- cot ) - (id Z)) `| Z) . x = (cot . x) ^2
then A9: sin . x <> 0 by A3, FDIFF_8:2;
then A10: (sin . x) ^2 > 0 by SQUARE_1:74;
(((- cot ) - (id Z)) `| Z) . x = (diff (- cot ),x) - (diff (id Z),x) by A1, A5, A7, A8, FDIFF_1:27
.= ((((- 1) (#) cot ) `| Z) . x) - (diff (id Z),x) by A7, A8, FDIFF_1:def 8
.= ((- 1) * (diff cot ,x)) - (diff (id Z),x) by A2, A6, A8, FDIFF_1:28
.= ((- 1) * (- (1 / ((sin . x) ^2 )))) - (diff (id Z),x) by A9, FDIFF_7:47
.= (1 / ((sin . x) ^2 )) - (((id Z) `| Z) . x) by A5, A8, FDIFF_1:def 8
.= (1 / ((sin . x) ^2 )) - 1 by A2, A4, A8, FDIFF_1:31
.= (1 / ((sin . x) ^2 )) - (((sin . x) ^2 ) / ((sin . x) ^2 )) by A10, XCMPLX_1:60
.= (1 - ((sin . x) ^2 )) / ((sin . x) ^2 ) by XCMPLX_1:121
.= ((((cos . x) ^2 ) + ((sin . x) ^2 )) - ((sin . x) ^2 )) / ((sin . x) ^2 ) by SIN_COS:31
.= ((cos x) / (sin x)) * ((cos . x) / (sin . x)) by XCMPLX_1:77
.= (cot . x) * (cot x) by A3, FDIFF_8:2, A8, SIN_COS9:16
.= (cot . x) ^2 by A3, FDIFF_8:2, A8, SIN_COS9:16 ;
hence (((- cot ) - (id Z)) `| Z) . x = (cot . x) ^2 ; :: thesis: verum
end;
hence ( (- cot ) - (id Z) is_differentiable_on Z & ( for x being Real st x in Z holds
(((- cot ) - (id Z)) `| Z) . x = (cot . x) ^2 ) ) by A1, A5, A7, FDIFF_1:27; :: thesis: verum