let Z be open Subset of REAL ; :: thesis: ( Z c= dom (((id Z) - tan ) - sec ) & ( for x being Real st x in Z holds
( 1 + (sin . x) <> 0 & 1 - (sin . x) <> 0 ) ) implies ( ((id Z) - tan ) - sec is_differentiable_on Z & ( for x being Real st x in Z holds
((((id Z) - tan ) - sec ) `| Z) . x = (sin . x) / ((sin . x) - 1) ) ) )

assume that
A1: Z c= dom (((id Z) - tan ) - sec ) and
A2: for x being Real st x in Z holds
( 1 + (sin . x) <> 0 & 1 - (sin . x) <> 0 ) ; :: thesis: ( ((id Z) - tan ) - sec is_differentiable_on Z & ( for x being Real st x in Z holds
((((id Z) - tan ) - sec ) `| Z) . x = (sin . x) / ((sin . x) - 1) ) )

C: Z c= (dom ((id Z) - tan )) /\ (dom sec ) by A1, VALUED_1:12;
then B1: ( Z c= dom ((id Z) - tan ) & Z c= dom sec ) by XBOOLE_1:18;
then Z c= (dom (id Z)) /\ (dom tan ) by VALUED_1:12;
then A3: ( Z c= dom tan & Z c= dom sec & Z c= dom (id Z) ) by C, XBOOLE_1:18;
A5: sec is_differentiable_on Z by B1, FDIFF_9:4;
for x being Real st x in Z holds
tan is_differentiable_in x
proof end;
then A6: tan is_differentiable_on Z by A3, FDIFF_1:16;
B3: for x being Real st x in Z holds
(id Z) . x = (1 * x) + 0 by FUNCT_1:35;
then B4: ( id Z is_differentiable_on Z & ( for x being Real st x in Z holds
((id Z) `| Z) . x = 1 ) ) by A3, FDIFF_1:31;
AA: (id Z) - tan is_differentiable_on Z by B1, B4, A6, FDIFF_1:27;
B5: for x being Real st x in Z holds
(((id Z) - tan ) `| Z) . x = - (((sin . x) ^2 ) / ((cos . x) ^2 ))
proof
let x be Real; :: thesis: ( x in Z implies (((id Z) - tan ) `| Z) . x = - (((sin . x) ^2 ) / ((cos . x) ^2 )) )
assume A7: x in Z ; :: thesis: (((id Z) - tan ) `| Z) . x = - (((sin . x) ^2 ) / ((cos . x) ^2 ))
then A8: cos . x <> 0 by A3, FDIFF_8:1;
then A9: (cos . x) ^2 > 0 by SQUARE_1:74;
(((id Z) - tan ) `| Z) . x = (diff (id Z),x) - (diff tan ,x) by B1, A6, B4, A7, FDIFF_1:27
.= (((id Z) `| Z) . x) - (diff tan ,x) by B4, A7, FDIFF_1:def 8
.= 1 - (diff tan ,x) by A3, B3, A7, FDIFF_1:31
.= 1 - (1 / ((cos . x) ^2 )) by A8, FDIFF_7:46
.= 1 - ((((cos . x) ^2 ) + ((sin . x) ^2 )) / ((cos . x) ^2 )) by SIN_COS:31
.= 1 - ((((cos . x) ^2 ) / ((cos . x) ^2 )) + (((sin . x) ^2 ) / ((cos . x) ^2 ))) by XCMPLX_1:63
.= 1 - (1 + (((sin . x) ^2 ) / ((cos . x) ^2 ))) by A9, XCMPLX_1:60
.= - (((sin . x) ^2 ) / ((cos . x) ^2 )) ;
hence (((id Z) - tan ) `| Z) . x = - (((sin . x) ^2 ) / ((cos . x) ^2 )) ; :: thesis: verum
end;
for x being Real st x in Z holds
((((id Z) - tan ) - sec ) `| Z) . x = (sin . x) / ((sin . x) - 1)
proof
let x be Real; :: thesis: ( x in Z implies ((((id Z) - tan ) - sec ) `| Z) . x = (sin . x) / ((sin . x) - 1) )
assume A10: x in Z ; :: thesis: ((((id Z) - tan ) - sec ) `| Z) . x = (sin . x) / ((sin . x) - 1)
then A11: ( cos . x <> 0 & 1 + (sin . x) <> 0 & 1 - (sin . x) <> 0 ) by A2, A3, FDIFF_8:1;
((((id Z) - tan ) - sec ) `| Z) . x = (diff ((id Z) - tan ),x) - (diff sec ,x) by A1, A5, AA, A10, FDIFF_1:27
.= ((((id Z) - tan ) `| Z) . x) - (diff sec ,x) by AA, A10, FDIFF_1:def 8
.= (- (((sin . x) ^2 ) / ((cos . x) ^2 ))) - (diff sec ,x) by B5, A10
.= (- (((sin . x) ^2 ) / ((cos . x) ^2 ))) - ((sec `| Z) . x) by A5, A10, FDIFF_1:def 8
.= (- (((sin . x) ^2 ) / ((cos . x) ^2 ))) - ((sin . x) / ((cos . x) ^2 )) by B1, A10, FDIFF_9:4
.= - (((sin . x) / ((cos . x) ^2 )) + (((sin . x) ^2 ) / ((cos . x) ^2 )))
.= - (((sin . x) + ((sin . x) ^2 )) / ((cos . x) ^2 )) by XCMPLX_1:63
.= - (((sin . x) * (1 + (sin . x))) / ((((cos . x) ^2 ) + ((sin . x) ^2 )) - ((sin . x) ^2 )))
.= - (((sin . x) * (1 + (sin . x))) / (1 - ((sin . x) ^2 ))) by SIN_COS:31
.= - (((sin . x) * (1 + (sin . x))) / ((1 + (sin . x)) * (1 - (sin . x))))
.= - ((((sin . x) * (1 + (sin . x))) / (1 + (sin . x))) / (1 - (sin . x))) by XCMPLX_1:79
.= - (((sin . x) * ((1 + (sin . x)) / (1 + (sin . x)))) / (1 - (sin . x))) by XCMPLX_1:75
.= - (((sin . x) * 1) / (1 - (sin . x))) by A11, XCMPLX_1:60
.= (sin . x) / (- (1 - (sin . x))) by XCMPLX_1:189
.= (sin . x) / ((sin . x) - 1) ;
hence ((((id Z) - tan ) - sec ) `| Z) . x = (sin . x) / ((sin . x) - 1) ; :: thesis: verum
end;
hence ( ((id Z) - tan ) - sec is_differentiable_on Z & ( for x being Real st x in Z holds
((((id Z) - tan ) - sec ) `| Z) . x = (sin . x) / ((sin . x) - 1) ) ) by A1, AA, A5, FDIFF_1:27; :: thesis: verum