:: ALTCAT_3 semantic presentation

definition
let c1 be non empty with_units AltCatStr ;
let c2, c3 be object of c1;
let c4 be Morphism of c2,c3;
let c5 be Morphism of c3,c2;
pred c4 is_left_inverse_of c5 means :E1: :: ALTCAT_3:def 1
a4 * a5 = idm a3;
end;

:: deftheorem E1 defines is_left_inverse_of ALTCAT_3:def 1 :
for b1 being non empty with_units AltCatStr
for b2, b3 being object of b1
for b4 being Morphism of b2,b3
for b5 being Morphism of b3,b2 holds
( b4 is_left_inverse_of b5 iff b4 * b5 = idm b3 );

notation
let c1 be non empty with_units AltCatStr ;
let c2, c3 be object of c1;
let c4 be Morphism of c2,c3;
let c5 be Morphism of c3,c2;
synonym c5 is_right_inverse_of c4 for c4 is_left_inverse_of c5;
end;

definition
let c1 be non empty with_units AltCatStr ;
let c2, c3 be object of c1;
let c4 be Morphism of c2,c3;
attr a4 is retraction means :E2: :: ALTCAT_3:def 2
ex b1 being Morphism of a3,a2 st b1 is_right_inverse_of a4;
end;

:: deftheorem E2 defines retraction ALTCAT_3:def 2 :
for b1 being non empty with_units AltCatStr
for b2, b3 being object of b1
for b4 being Morphism of b2,b3 holds
( b4 is retraction iff ex b5 being Morphism of b3,b2 st b5 is_right_inverse_of b4 );

definition
let c1 be non empty with_units AltCatStr ;
let c2, c3 be object of c1;
let c4 be Morphism of c2,c3;
attr a4 is coretraction means :E3: :: ALTCAT_3:def 3
ex b1 being Morphism of a3,a2 st b1 is_left_inverse_of a4;
end;

:: deftheorem E3 defines coretraction ALTCAT_3:def 3 :
for b1 being non empty with_units AltCatStr
for b2, b3 being object of b1
for b4 being Morphism of b2,b3 holds
( b4 is coretraction iff ex b5 being Morphism of b3,b2 st b5 is_left_inverse_of b4 );

theorem E4: :: ALTCAT_3:1
for b1 being non empty with_units AltCatStr
for b2 being object of b1 holds
( idm b2 is retraction & idm b2 is coretraction )
proof
let c1 be non empty with_units AltCatStr ;
let c2 be object of c1;
<^c2,c2^> <> {} by ALTCAT_1:23;
then (idm c2) * (idm c2) = idm c2 by ALTCAT_1:def 19;
then ( idm c2 is_left_inverse_of idm c2 & idm c2 is_right_inverse_of idm c2 ) by E1;
hence ( idm c2 is retraction & idm c2 is coretraction ) by E2, E3;
end;

definition
let c1 be category;
let c2, c3 be object of c1;
assume E5: ( <^c2,c3^> <> {} & <^c3,c2^> <> {} ) ;
let c4 be Morphism of c2,c3;
assume E6: ( c4 is retraction & c4 is coretraction ) ;
func c4 " -> Morphism of a3,a2 means :E5: :: ALTCAT_3:def 4
( a5 is_left_inverse_of a4 & a5 is_right_inverse_of a4 );
existence
ex b1 being Morphism of c3,c2 st
( b1 is_left_inverse_of c4 & b1 is_right_inverse_of c4 )
proof
consider c5 being Morphism of c3,c2 such that
E7: c5 is_right_inverse_of c4 by E6, E2;
consider c6 being Morphism of c3,c2 such that
E8: c6 is_left_inverse_of c4 by E6, E3;
E9: c5 = (idm c2) * c5 by E5, ALTCAT_1:24
.= (c6 * c4) * c5 by E8, E1
.= c6 * (c4 * c5) by E5, ALTCAT_1:25
.= c6 * (idm c3) by E7, E1
.= c6 by E5, ALTCAT_1:def 19 ;
take c5 ;
thus ( c5 is_left_inverse_of c4 & c5 is_right_inverse_of c4 ) by E7, E8, E9;
end;
uniqueness
for b1, b2 being Morphism of c3,c2 holds
( ( b1 is_left_inverse_of c4 & b1 is_right_inverse_of c4 & b2 is_left_inverse_of c4 & b2 is_right_inverse_of c4 ) implies ( b1 = b2 ) )
proof
let c5, c6 be Morphism of c3,c2;
assume that
E7: ( c5 is_left_inverse_of c4 & c5 is_right_inverse_of c4 ) and
E8: ( c6 is_left_inverse_of c4 & c6 is_right_inverse_of c4 ) ;
thus c5 = c5 * (idm c3) by E5, ALTCAT_1:def 19
.= c5 * (c4 * c6) by E8, E1
.= (c5 * c4) * c6 by E5, ALTCAT_1:25
.= (idm c2) * c6 by E7, E1
.= c6 by E5, ALTCAT_1:24 ;
end;
end;

:: deftheorem E5 defines " ALTCAT_3:def 4 :
for b1 being category
for b2, b3 being object of b1 holds
( ( ) implies ( not <^b2,b3^> <> {} or not <^b3,b2^> <> {} or ( for b4 being Morphism of b2,b3 holds
( ( b4 is retraction & b4 is coretraction ) implies ( ( for b5 being Morphism of b3,b2 holds
( b5 = b4 " iff ( b5 is_left_inverse_of b4 & b5 is_right_inverse_of b4 ) ) ) ) ) ) ) );

theorem E6: :: ALTCAT_3:2
for b1 being category
for b2, b3 being object of b1 holds
( ( ) implies ( not <^b2,b3^> <> {} or not <^b3,b2^> <> {} or ( for b4 being Morphism of b2,b3 holds
( ( b4 is retraction & b4 is coretraction ) implies ( ( (b4 " ) * b4 = idm b2 & b4 * (b4 " ) = idm b3 ) ) ) ) ) )
proof
let c1 be category;
let c2, c3 be object of c1;
assume E7: ( <^c2,c3^> <> {} & <^c3,c2^> <> {} ) ;
let c4 be Morphism of c2,c3;
assume ( c4 is retraction & c4 is coretraction ) ;
then ( c4 " is_left_inverse_of c4 & c4 " is_right_inverse_of c4 ) by E7, E5;
hence ( (c4 " ) * c4 = idm c2 & c4 * (c4 " ) = idm c3 ) by E1;
end;

theorem E7: :: ALTCAT_3:3
for b1 being category
for b2, b3 being object of b1 holds
( ( ) implies ( not <^b2,b3^> <> {} or not <^b3,b2^> <> {} or ( for b4 being Morphism of b2,b3 holds
( ( b4 is retraction & b4 is coretraction ) implies ( (b4 " ) " = b4 ) ) ) ) )
proof
let c1 be category;
let c2, c3 be object of c1;
assume E8: ( <^c2,c3^> <> {} & <^c3,c2^> <> {} ) ;
let c4 be Morphism of c2,c3;
assume ( c4 is retraction & c4 is coretraction ) ;
then E9: ( c4 " is_left_inverse_of c4 & c4 " is_right_inverse_of c4 ) by E8, E5;
then ( c4 " is retraction & c4 " is coretraction ) by E2, E3;
then E10: (c4 " ) " is_right_inverse_of c4 " by E8, E5;
thus (c4 " ) " = (idm c3) * ((c4 " ) " ) by E8, ALTCAT_1:24
.= (c4 * (c4 " )) * ((c4 " ) " ) by E9, E1
.= c4 * ((c4 " ) * ((c4 " ) " )) by E8, ALTCAT_1:25
.= c4 * (idm c2) by E10, E1
.= c4 by E8, ALTCAT_1:def 19 ;
end;

theorem E8: :: ALTCAT_3:4
for b1 being category
for b2 being object of b1 holds (idm b2) " = idm b2
proof
let c1 be category;
let c2 be object of c1;
E9: <^c2,c2^> <> {} by ALTCAT_1:23;
( idm c2 is retraction & idm c2 is coretraction ) by E4;
then E10: (idm c2) " is_left_inverse_of idm c2 by E9, E5;
thus (idm c2) " = ((idm c2) " ) * (idm c2) by E9, ALTCAT_1:def 19
.= idm c2 by E10, E1 ;
end;

definition
let c1 be category;
let c2, c3 be object of c1;
let c4 be Morphism of c2,c3;
attr a4 is iso means :E9: :: ALTCAT_3:def 5
( a4 * (a4 " ) = idm a3 & (a4 " ) * a4 = idm a2 );
end;

:: deftheorem E9 defines iso ALTCAT_3:def 5 :
for b1 being category
for b2, b3 being object of b1
for b4 being Morphism of b2,b3 holds
( b4 is iso iff ( b4 * (b4 " ) = idm b3 & (b4 " ) * b4 = idm b2 ) );

theorem E10: :: ALTCAT_3:5
for b1 being category
for b2, b3 being object of b1
for b4 being Morphism of b2,b3 holds
( b4 is iso implies ( b4 is retraction & b4 is coretraction ) )
proof
let c1 be category;
let c2, c3 be object of c1;
let c4 be Morphism of c2,c3;
assume c4 is iso ;
then E11: ( c4 * (c4 " ) = idm c3 & (c4 " ) * c4 = idm c2 ) by E9;
then c4 " is_right_inverse_of c4 by E1;
hence c4 is retraction by E2;
c4 " is_left_inverse_of c4 by E11, E1;
hence c4 is coretraction by E3;
end;

theorem E11: :: ALTCAT_3:6
for b1 being category
for b2, b3 being object of b1 holds
( ( ) implies ( not <^b2,b3^> <> {} or not <^b3,b2^> <> {} or ( for b4 being Morphism of b2,b3 holds
( b4 is iso iff ( b4 is retraction & b4 is coretraction ) ) ) ) )
proof
let c1 be category;
let c2, c3 be object of c1;
assume E12: ( <^c2,c3^> <> {} & <^c3,c2^> <> {} ) ;
let c4 be Morphism of c2,c3;
thus ( c4 is iso implies ( c4 is retraction & c4 is coretraction ) ) by E10;
assume that
E13: c4 is retraction and
E14: c4 is coretraction ;
( c4 " is_left_inverse_of c4 & c4 " is_right_inverse_of c4 ) by E12, E13, E14, E5;
then ( (c4 " ) * c4 = idm c2 & c4 * (c4 " ) = idm c3 ) by E1;
hence c4 is iso by E9;
end;

theorem E12: :: ALTCAT_3:7
for b1 being category
for b2, b3, b4 being object of b1
for b5 being Morphism of b2,b3
for b6 being Morphism of b3,b4 holds
( ( b5 is iso & b6 is iso ) implies ( not <^b2,b3^> <> {} or not <^b3,b4^> <> {} or not <^b4,b2^> <> {} or ( b6 * b5 is iso & (b6 * b5) " = (b5 " ) * (b6 " ) ) ) )
proof
let c1 be category;
let c2, c3, c4 be object of c1;
let c5 be Morphism of c2,c3;
let c6 be Morphism of c3,c4;
assume E13: ( <^c2,c3^> <> {} & <^c3,c4^> <> {} & <^c4,c2^> <> {} ) ;
then E14: ( <^c3,c2^> <> {} & <^c4,c3^> <> {} & <^c2,c4^> <> {} ) by ALTCAT_1:def 4;
assume ( c5 is iso & c6 is iso ) ;
then E15: ( c5 is retraction & c5 is coretraction & c6 is retraction & c6 is coretraction ) by E13, E14, E11;
consider c7 being Morphism of c3,c2 such that
E16: c7 = c5 " ;
consider c8 being Morphism of c4,c3 such that
E17: c8 = c6 " ;
E18: (c7 * c8) * (c6 * c5) = c7 * (c8 * (c6 * c5)) by E14, ALTCAT_1:25
.= c7 * ((c8 * c6) * c5) by E13, E14, ALTCAT_1:25
.= c7 * ((idm c3) * c5) by E13, E14, E15, E17, E6
.= c7 * c5 by E13, ALTCAT_1:24
.= idm c2 by E13, E14, E15, E16, E6 ;
then E19: c7 * c8 is_left_inverse_of c6 * c5 by E1;
then E20: c6 * c5 is coretraction by E3;
E21: (c6 * c5) * (c7 * c8) = c6 * (c5 * (c7 * c8)) by E13, ALTCAT_1:25
.= c6 * ((c5 * c7) * c8) by E13, E14, ALTCAT_1:25
.= c6 * ((idm c3) * c8) by E13, E14, E15, E16, E6
.= c6 * c8 by E14, ALTCAT_1:24
.= idm c4 by E13, E14, E15, E17, E6 ;
then E22: c7 * c8 is_right_inverse_of c6 * c5 by E1;
then c6 * c5 is retraction by E2;
then c7 * c8 = (c6 * c5) " by E13, E14, E19, E20, E22, E5;
hence ( c6 * c5 is iso & (c6 * c5) " = (c5 " ) * (c6 " ) ) by E16, E17, E18, E21, E9;
end;

definition
let c1 be category;
let c2, c3 be object of c1;
pred c2,c3 are_iso means :E13: :: ALTCAT_3:def 6
( <^a2,a3^> <> {} & <^a3,a2^> <> {} & ex b1 being Morphism of a2,a3 st b1 is iso );
reflexivity
for b1 being object of c1 holds
( <^b1,b1^> <> {} & <^b1,b1^> <> {} & ex b2 being Morphism of b1,b1 st b2 is iso )
proof
let c4 be object of c1;
thus E13: ( <^c4,c4^> <> {} & <^c4,c4^> <> {} ) by ALTCAT_1:23;
take idm c4 ;
set c5 = idm c4;
E14: (idm c4) * ((idm c4) " ) = (idm c4) * (idm c4) by E8
.= idm c4 by E13, ALTCAT_1:def 19 ;
((idm c4) " ) * (idm c4) = (idm c4) * (idm c4) by E8
.= idm c4 by E13, ALTCAT_1:def 19 ;
hence idm c4 is iso by E14, E9;
end;
symmetry
for b1, b2 being object of c1 holds
( ( ) implies ( not <^b1,b2^> <> {} or not <^b2,b1^> <> {} or ( for b3 being Morphism of b1,b2 holds
not b3 is iso ) or ( <^b2,b1^> <> {} & <^b1,b2^> <> {} & ex b3 being Morphism of b2,b1 st b3 is iso ) ) )
proof
let c4, c5 be object of c1;
assume that
E13: ( <^c4,c5^> <> {} & <^c5,c4^> <> {} ) and
E14: ex b1 being Morphism of c4,c5 st b1 is iso ;
consider c6 being Morphism of c4,c5 such that
E15: c6 is iso by E14;
E16: ( c6 is retraction & c6 is coretraction ) by E15, E10;
thus ( <^c5,c4^> <> {} & <^c4,c5^> <> {} ) by E13;
take c7 = c6 " ;
E17: c7 * (c7 " ) = (c6 " ) * c6 by E13, E16, E7
.= idm c4 by E13, E16, E6 ;
(c7 " ) * c7 = c6 * (c6 " ) by E13, E16, E7
.= idm c5 by E13, E16, E6 ;
hence c7 is iso by E17, E9;
end;
end;

:: deftheorem E13 defines are_iso ALTCAT_3:def 6 :
for b1 being category
for b2, b3 being object of b1 holds
( b2,b3 are_iso iff ( <^b2,b3^> <> {} & <^b3,b2^> <> {} & ex b4 being Morphism of b2,b3 st b4 is iso ) );

theorem :: ALTCAT_3:8
for b1 being category
for b2, b3, b4 being object of b1 holds
( ( b2,b3 are_iso & b3,b4 are_iso ) implies ( b2,b4 are_iso ) )
proof
let c1 be category;
let c2, c3, c4 be object of c1;
assume that
E14: c2,c3 are_iso and
E15: c3,c4 are_iso ;
E16: ( <^c2,c3^> <> {} & <^c3,c2^> <> {} & <^c3,c4^> <> {} & <^c4,c3^> <> {} ) by E14, E15, E13;
hence E17: ( <^c2,c4^> <> {} & <^c4,c2^> <> {} ) by ALTCAT_1:def 4; :: according to ALTCAT_3:def 6
consider c5 being Morphism of c2,c3 such that
E18: c5 is iso by E14, E13;
consider c6 being Morphism of c3,c4 such that
E19: c6 is iso by E15, E13;
take c6 * c5 ;
thus c6 * c5 is iso by E16, E17, E18, E19, E12;
end;

definition
let c1 be non empty AltCatStr ;
let c2, c3 be object of c1;
let c4 be Morphism of c2,c3;
attr a4 is mono means :E14: :: ALTCAT_3:def 7
for b1 being object of a1 holds
( <^b1,a2^> <> {} implies for b2, b3 being Morphism of b1,a2 holds
( a4 * b2 = a4 * b3 implies b2 = b3 ) );
end;

:: deftheorem E14 defines mono ALTCAT_3:def 7 :
for b1 being non empty AltCatStr
for b2, b3 being object of b1
for b4 being Morphism of b2,b3 holds
( b4 is mono iff for b5 being object of b1 holds
( <^b5,b2^> <> {} implies for b6, b7 being Morphism of b5,b2 holds
( b4 * b6 = b4 * b7 implies b6 = b7 ) ) );

definition
let c1 be non empty AltCatStr ;
let c2, c3 be object of c1;
let c4 be Morphism of c2,c3;
attr a4 is epi means :E15: :: ALTCAT_3:def 8
for b1 being object of a1 holds
( <^a3,b1^> <> {} implies for b2, b3 being Morphism of a3,b1 holds
( b2 * a4 = b3 * a4 implies b2 = b3 ) );
end;

:: deftheorem E15 defines epi ALTCAT_3:def 8 :
for b1 being non empty AltCatStr
for b2, b3 being object of b1
for b4 being Morphism of b2,b3 holds
( b4 is epi iff for b5 being object of b1 holds
( <^b3,b5^> <> {} implies for b6, b7 being Morphism of b3,b5 holds
( b6 * b4 = b7 * b4 implies b6 = b7 ) ) );

theorem E16: :: ALTCAT_3:9
for b1 being non empty transitive associative AltCatStr
for b2, b3, b4 being object of b1 holds
( ( ) implies ( not <^b2,b3^> <> {} or not <^b3,b4^> <> {} or ( for b5 being Morphism of b2,b3
for b6 being Morphism of b3,b4 holds
( ( b5 is mono & b6 is mono ) implies ( b6 * b5 is mono ) ) ) ) )
proof
let c1 be non empty transitive associative AltCatStr ;
let c2, c3, c4 be object of c1;
assume E17: ( <^c2,c3^> <> {} & <^c3,c4^> <> {} ) ;
let c5 be Morphism of c2,c3;
let c6 be Morphism of c3,c4;
assume E18: ( c5 is mono & c6 is mono ) ;
let c7 be object of c1; :: according to ALTCAT_3:def 7
assume E19: <^c7,c2^> <> {} ;
let c8, c9 be Morphism of c7,c2;
assume E20: (c6 * c5) * c8 = (c6 * c5) * c9 ;
E21: (c6 * c5) * c8 = c6 * (c5 * c8) by E17, E19, ALTCAT_1:25;
E22: (c6 * c5) * c9 = c6 * (c5 * c9) by E17, E19, ALTCAT_1:25;
<^c7,c3^> <> {} by E17, E19, ALTCAT_1:def 4;
then c5 * c8 = c5 * c9 by E18, E20, E21, E22, E14;
hence c8 = c9 by E18, E19, E14;
end;

theorem E17: :: ALTCAT_3:10
for b1 being non empty transitive associative AltCatStr
for b2, b3, b4 being object of b1 holds
( ( ) implies ( not <^b2,b3^> <> {} or not <^b3,b4^> <> {} or ( for b5 being Morphism of b2,b3
for b6 being Morphism of b3,b4 holds
( ( b5 is epi & b6 is epi ) implies ( b6 * b5 is epi ) ) ) ) )
proof
let c1 be non empty transitive associative AltCatStr ;
let c2, c3, c4 be object of c1;
assume E18: ( <^c2,c3^> <> {} & <^c3,c4^> <> {} ) ;
let c5 be Morphism of c2,c3;
let c6 be Morphism of c3,c4;
assume E19: ( c5 is epi & c6 is epi ) ;
let c7 be object of c1; :: according to ALTCAT_3:def 8
assume E20: <^c4,c7^> <> {} ;
let c8, c9 be Morphism of c4,c7;
assume E21: c8 * (c6 * c5) = c9 * (c6 * c5) ;
E22: c8 * (c6 * c5) = (c8 * c6) * c5 by E18, E20, ALTCAT_1:25;
E23: c9 * (c6 * c5) = (c9 * c6) * c5 by E18, E20, ALTCAT_1:25;
<^c3,c7^> <> {} by E18, E20, ALTCAT_1:def 4;
then c8 * c6 = c9 * c6 by E19, E21, E22, E23, E15;
hence c8 = c9 by E19, E20, E15;
end;

theorem :: ALTCAT_3:11
for b1 being non empty transitive associative AltCatStr
for b2, b3, b4 being object of b1 holds
( ( ) implies ( not <^b2,b3^> <> {} or not <^b3,b4^> <> {} or ( for b5 being Morphism of b2,b3
for b6 being Morphism of b3,b4 holds
( b6 * b5 is mono implies b5 is mono ) ) ) )
proof
let c1 be non empty transitive associative AltCatStr ;
let c2, c3, c4 be object of c1;
assume E18: ( <^c2,c3^> <> {} & <^c3,c4^> <> {} ) ;
let c5 be Morphism of c2,c3;
let c6 be Morphism of c3,c4;
assume E19: c6 * c5 is mono ;
let c7 be object of c1; :: according to ALTCAT_3:def 7
assume E20: <^c7,c2^> <> {} ;
let c8, c9 be Morphism of c7,c2;
assume E21: c5 * c8 = c5 * c9 ;
E22: (c6 * c5) * c8 = c6 * (c5 * c8) by E18, E20, ALTCAT_1:25;
(c6 * c5) * c9 = c6 * (c5 * c9) by E18, E20, ALTCAT_1:25;
hence c8 = c9 by E19, E20, E21, E22, E14;
end;

theorem :: ALTCAT_3:12
for b1 being non empty transitive associative AltCatStr
for b2, b3, b4 being object of b1 holds
( ( ) implies ( not <^b2,b3^> <> {} or not <^b3,b4^> <> {} or ( for b5 being Morphism of b2,b3
for b6 being Morphism of b3,b4 holds
( b6 * b5 is epi implies b6 is epi ) ) ) )
proof
let c1 be non empty transitive associative AltCatStr ;
let c2, c3, c4 be object of c1;
assume E18: ( <^c2,c3^> <> {} & <^c3,c4^> <> {} ) ;
let c5 be Morphism of c2,c3;
let c6 be Morphism of c3,c4;
assume E19: c6 * c5 is epi ;
let c7 be object of c1; :: according to ALTCAT_3:def 8
assume E20: <^c4,c7^> <> {} ;
let c8, c9 be Morphism of c4,c7;
assume E21: c8 * c6 = c9 * c6 ;
E22: (c8 * c6) * c5 = c8 * (c6 * c5) by E18, E20, ALTCAT_1:25;
(c9 * c6) * c5 = c9 * (c6 * c5) by E18, E20, ALTCAT_1:25;
hence c8 = c9 by E19, E20, E21, E22, E15;
end;

E18: now
let c1 be non empty with_units AltCatStr ;
let c2 be object of c1;
thus idm c2 is epi
proof
let c3 be object of c1; :: according to ALTCAT_3:def 8
assume E19: <^c2,c3^> <> {} ;
let c4, c5 be Morphism of c2,c3;
assume E20: c4 * (idm c2) = c5 * (idm c2) ;
thus c4 = c4 * (idm c2) by E19, ALTCAT_1:def 19
.= c5 by E19, E20, ALTCAT_1:def 19 ;
end;
thus idm c2 is mono
proof
let c3 be object of c1; :: according to ALTCAT_3:def 7
assume E19: <^c3,c2^> <> {} ;
let c4, c5 be Morphism of c3,c2;
assume E20: (idm c2) * c4 = (idm c2) * c5 ;
thus c4 = (idm c2) * c4 by E19, ALTCAT_1:24
.= c5 by E19, E20, ALTCAT_1:24 ;
end;
end;

theorem :: ALTCAT_3:13
for b1 being non empty set
for b2, b3 being object of (EnsCat b1) holds
( <^b2,b3^> <> {} implies for b4 being Morphism of b2,b3
for b5 being Function of b2,b3 holds
( b5 = b4 implies ( b4 is mono iff b5 is one-to-one ) ) )
proof
let c1 be non empty set ;
let c2, c3 be object of (EnsCat c1);
assume E19: <^c2,c3^> <> {} ;
let c4 be Morphism of c2,c3;
let c5 be Function of c2,c3;
assume E20: c5 = c4 ;
per cases not ( not c3 <> {} & not c3 = {} ) ;
suppose c3 <> {} ;
then E21: dom c5 = c2 by FUNCT_2:def 1;
thus ( c4 is mono implies c5 is one-to-one )
proof
assume E22: c4 is mono ;
assume not c5 is one-to-one ;
then consider c6, c7 being set such that
E23: ( c6 in dom c5 & c7 in dom c5 ) and
E24: c5 . c6 = c5 . c7 and
E25: c6 <> c7 by FUNCT_1:def 8;
set c8 = c2;
E26: <^c2,c2^> <> {} by ALTCAT_1:23;
set c9 = c2 --> c6;
E27: dom (c2 --> c6) = c2 by FUNCOP_1:19;
E28: for b1 being set holds
( b1 in c2 implies (c2 --> c6) . b1 = c6 ) by FUNCOP_1:13;
set c10 = c2 --> c7;
E29: dom (c2 --> c7) = c2 by FUNCOP_1:19;
E30: for b1 being set holds
( b1 in c2 implies (c2 --> c7) . b1 = c7 ) by FUNCOP_1:13;
consider c11 being Element of c2;
(c2 --> c6) . c11 = c6 by E21, E23, E28;
then E31: (c2 --> c6) . c11 <> (c2 --> c7) . c11 by E21, E23, E25, E30;
E32: rng (c2 --> c6) c= c2
proof
let c12 be set ; :: according to TARSKI:def 3
assume c12 in rng (c2 --> c6) ;
then consider c13 being set such that
E33: ( c13 in dom (c2 --> c6) & (c2 --> c6) . c13 = c12 ) by FUNCT_1:def 5;
thus c12 in c2 by E21, E23, E27, E28, E33;
end;
then c2 --> c6 in Funcs c2,c2 by E27, FUNCT_2:def 2;
then reconsider c12 = c2 --> c6 as Morphism of c2,c2 by ALTCAT_1:def 16;
E33: rng (c2 --> c7) c= c2
proof
let c13 be set ; :: according to TARSKI:def 3
assume c13 in rng (c2 --> c7) ;
then consider c14 being set such that
E34: ( c14 in dom (c2 --> c7) & (c2 --> c7) . c14 = c13 ) by FUNCT_1:def 5;
thus c13 in c2 by E21, E23, E29, E30, E34;
end;
then c2 --> c7 in Funcs c2,c2 by E29, FUNCT_2:def 2;
then reconsider c13 = c2 --> c7 as Morphism of c2,c2 by ALTCAT_1:def 16;
E34: dom (c5 * (c2 --> c6)) = c2 by E21, E27, E32, RELAT_1:46;
E35: dom (c5 * (c2 --> c7)) = c2 by E21, E29, E33, RELAT_1:46;
now
let c14 be set ;
assume E36: c14 in c2 ;
hence (c5 * (c2 --> c6)) . c14 = c5 . ((c2 --> c6) . c14) by E34, FUNCT_1:22
.= c5 . c7 by E24, E28, E36
.= c5 . ((c2 --> c7) . c14) by E30, E36
.= (c5 * (c2 --> c7)) . c14 by E35, E36, FUNCT_1:22 ;

end;
then c5 * (c2 --> c6) = c5 * (c2 --> c7) by E34, E35, FUNCT_1:9;
then c4 * c12 = c5 * (c2 --> c7) by E19, E20, E26, ALTCAT_1:18
.= c4 * c13 by E19, E20, E26, ALTCAT_1:18 ;
hence not verum by E22, E26, E31, E14;
end;
thus ( c5 is one-to-one implies c4 is mono )
proof
assume E22: c5 is one-to-one ;
let c6 be object of (EnsCat c1); :: according to ALTCAT_3:def 7
assume E23: <^c6,c2^> <> {} ;
let c7, c8 be Morphism of c6,c2;
assume E24: c4 * c7 = c4 * c8 ;
E25: <^c6,c2^> = Funcs c6,c2 by ALTCAT_1:def 16;
then consider c9 being Function such that
E26: ( c9 = c7 & dom c9 = c6 & rng c9 c= c2 ) by E23, FUNCT_2:def 2;
consider c10 being Function such that
E27: ( c10 = c8 & dom c10 = c6 & rng c10 c= c2 ) by E23, E25, FUNCT_2:def 2;
E28: <^c6,c3^> <> {} by E19, E23, ALTCAT_1:def 4;
then E29: c5 * c9 = c4 * c8 by E19, E20, E23, E24, E26, ALTCAT_1:18
.= c5 * c10 by E19, E20, E23, E27, E28, ALTCAT_1:18 ;
now
let c11 be set ;
assume E30: c11 in c6 ;
then E31: ( c9 . c11 in rng c9 & c10 . c11 in rng c10 ) by E26, E27, FUNCT_1:def 5;
c5 . (c9 . c11) = (c5 * c9) . c11 by E26, E30, FUNCT_1:23;
then c5 . (c9 . c11) = c5 . (c10 . c11) by E27, E29, E30, FUNCT_1:23;
hence c9 . c11 = c10 . c11 by E21, E22, E26, E27, E31, FUNCT_1:def 8;
end;
hence c7 = c8 by E26, E27, FUNCT_1:9;
end;
end;
suppose E21: c3 = {} ;
E22: now
per cases not ( not c2 = {} & not c2 <> {} ) ;
suppose c2 = {} ;
hence c5 = {} by PARTFUN1:57;
end;
suppose c2 <> {} ;
hence c5 = {} by E21, FUNCT_2:def 1;
end;
end;
end;
thus ( c4 is mono implies c5 is one-to-one )
proof
assume c4 is mono ;
reconsider c6 = c5 as Function of {} , rng c5 by E22, FUNCT_2:55, RELAT_1:60;
c6 is one-to-one by PARTFUN1:59;
hence c5 is one-to-one ;
end;
thus ( c5 is one-to-one implies c4 is mono )
proof
assume c5 is one-to-one ;
let c6 be object of (EnsCat c1); :: according to ALTCAT_3:def 7
assume E23: <^c6,c2^> <> {} ;
let c7, c8 be Morphism of c6,c2;
assume c4 * c7 = c4 * c8 ;
E24: <^c6,c2^> = Funcs c6,c2 by ALTCAT_1:def 16;
then consider c9 being Function such that
E25: ( c9 = c7 & dom c9 = c6 & rng c9 c= c2 ) by E23, FUNCT_2:def 2;
consider c10 being Function such that
E26: ( c10 = c8 & dom c10 = c6 & rng c10 c= c2 ) by E23, E24, FUNCT_2:def 2;
E27: <^c2,c3^> = Funcs c2,c3 by ALTCAT_1:def 16;
consider c11 being Element of Funcs c2,c3;
consider c12 being Function such that
E28: ( c12 = c11 & dom c12 = c2 & rng c12 c= c3 ) by E19, E27, FUNCT_2:def 2;
rng c12 = {} by E21, E28, XBOOLE_1:3;
then dom c12 = {} by RELAT_1:65;
then E29: rng c9 = {} by E25, E28, XBOOLE_1:3;
then E30: dom c9 = {} by RELAT_1:65;
c9 = {} by E29, RELAT_1:64
.= c10 by E25, E26, E30, RELAT_1:64 ;
hence c7 = c8 by E25, E26;
end;
end;
end;
end;

theorem :: ALTCAT_3:14
for b1 being non empty with_non-empty_elements set
for b2, b3 being object of (EnsCat b1) holds
( <^b2,b3^> <> {} implies for b4 being Morphism of b2,b3
for b5 being Function of b2,b3 holds
( b5 = b4 implies ( b4 is epi iff b5 is onto ) ) )
proof
let c1 be non empty with_non-empty_elements set ;
let c2, c3 be object of (EnsCat c1);
assume E19: <^c2,c3^> <> {} ;
let c4 be Morphism of c2,c3;
let c5 be Function of c2,c3;
assume E20: c5 = c4 ;
per cases not ( ex b1 being set st
( b1 in c1 & not b1 is trivial ) & ( for b1 being set holds
not ( b1 in c1 & not b1 is trivial ) ) ) ;
suppose E21: for b1 being set holds
( b1 in c1 implies b1 is trivial ) ;
thus ( c4 is epi implies c5 is onto )
proof
assume c4 is epi ;
now
per cases not ( not c3 = {} & not c3 <> {} ) ;
suppose E22: c3 = {} ;
now
per cases not ( not c2 = {} & not c2 <> {} ) ;
suppose c2 = {} ;
hence c5 = {} by PARTFUN1:57;
end;
suppose c2 <> {} ;
hence c5 = {} by E22, FUNCT_2:def 1;
end;
end;
end;
hence c5 is onto by E22, FUNCT_2:def 3, PARTFUN1:10;
end;
suppose E22: c3 <> {} ;
c3 is Element of c1 by ALTCAT_1:def 16;
then c3 is trivial by E21;
then consider c6 being set such that
E23: c3 = {c6} by E22, REALSET1:def 4;
E24: rng c5 c= {c6} by E23, RELSET_1:12;
E25: c2 is Element of c1 by ALTCAT_1:def 16;
then E26: c2 <> {} ;
c2 is trivial by E21, E25;
then consider c7 being set such that
E27: c2 = {c7} by E26, REALSET1:def 4;
dom c5 = {c7} by E22, E27, FUNCT_2:def 1;
then rng c5 <> {} by RELAT_1:65;
then rng c5 = {c6} by E24, ZFMISC_1:39;
hence c5 is onto by E23, FUNCT_2:def 3;
end;
end;
end;
hence c5 is onto ;
end;
thus ( c5 is onto implies c4 is epi )
proof
assume E22: c5 is onto ;
let c6 be object of (EnsCat c1); :: according to ALTCAT_3:def 8
assume E23: <^c3,c6^> <> {} ;
let c7, c8 be Morphism of c3,c6;
assume E24: c7 * c4 = c8 * c4 ;
E25: <^c3,c6^> = Funcs c3,c6 by ALTCAT_1:def 16;
then consider c9 being Function such that
E26: ( c9 = c7 & dom c9 = c3 & rng c9 c= c6 ) by E23, FUNCT_2:def 2;
consider c10 being Function such that
E27: ( c10 = c8 & dom c10 = c3 & rng c10 c= c6 ) by E23, E25, FUNCT_2:def 2;
E28: <^c2,c6^> <> {} by E19, E23, ALTCAT_1:def 4;
then E29: c9 * c5 = c8 * c4 by E19, E20, E23, E24, E26, ALTCAT_1:18
.= c10 * c5 by E19, E20, E23, E27, E28, ALTCAT_1:18 ;
now
assume c9 <> c10 ;
then consider c11 being set such that
E30: ( c11 in c3 & c9 . c11 <> c10 . c11 ) by E26, E27, FUNCT_1:9;
c11 in rng c5 by E22, E30, FUNCT_2:def 3;
then consider c12 being set such that </