:: CAT_4 semantic presentation

definition
let c1 be Category;
let c2, c3 be Object of c1;
canceled;
redefine pred c2,c3 are_isomorphic means :: CAT_4:def 2
( Hom a2,a3 <> {} & Hom a3,a2 <> {} & ex b1 being Morphism of a2,a3ex b2 being Morphism of a3,a2 st
( b1 * b2 = id a3 & b2 * b1 = id a2 ) );
compatibility
( c2,c3 are_isomorphic iff ( Hom c2,c3 <> {} & Hom c3,c2 <> {} & ex b1 being Morphism of c2,c3ex b2 being Morphism of c3,c2 st
( b1 * b2 = id c3 & b2 * b1 = id c2 ) ) )
by CAT_1:81;
end;

:: deftheorem Def1 CAT_4:def 1 :
canceled;

:: deftheorem Def2 defines are_isomorphic CAT_4:def 2 :
for b1 being Category
for b2, b3 being Object of b1 holds
( b2,b3 are_isomorphic iff ( Hom b2,b3 <> {} & Hom b3,b2 <> {} & ex b4 being Morphism of b2,b3ex b5 being Morphism of b3,b2 st
( b4 * b5 = id b3 & b5 * b4 = id b2 ) ) );

definition
let c1 be Category;
attr a1 is with_finite_product means :: CAT_4:def 3
for b1 being finite set
for b2 being Function of b1,the Objects of a1 ex b3 being Object of a1ex b4 being Projections_family of b3,b1 st
( cods b4 = b2 & b3 is_a_product_wrt b4 );
end;

:: deftheorem Def3 defines with_finite_product CAT_4:def 3 :
for b1 being Category holds
( b1 is with_finite_product iff for b2 being finite set
for b3 being Function of b2,the Objects of b1 ex b4 being Object of b1ex b5 being Projections_family of b4,b2 st
( cods b5 = b3 & b4 is_a_product_wrt b5 ) );

notation
let c1 be Category;
synonym c1 has_finite_product for with_finite_product c1;
end;

theorem Th1: :: CAT_4:1
for b1 being Category holds
( b1 has_finite_product iff ( ex b2 being Object of b1 st b2 is terminal & ( for b2, b3 being Object of b1 ex b4 being Object of b1ex b5, b6 being Morphism of b1 st
( dom b5 = b4 & dom b6 = b4 & cod b5 = b2 & cod b6 = b3 & b4 is_a_product_wrt b5,b6 ) ) ) )
proof end;

definition
attr a1 is strict;
struct ProdCatStr -> CatStr ;
aggr ProdCatStr(# Objects, Morphisms, Dom, Cod, Comp, Id, TerminalObj, CatProd, Proj1, Proj2 #) -> ProdCatStr ;
sel TerminalObj c1 -> Element of the Objects of a1;
sel CatProd c1 -> Function of [:the Objects of a1,the Objects of a1:],the Objects of a1;
sel Proj1 c1 -> Function of [:the Objects of a1,the Objects of a1:],the Morphisms of a1;
sel Proj2 c1 -> Function of [:the Objects of a1,the Objects of a1:],the Morphisms of a1;
end;

definition
let c1 be ProdCatStr ;
func [1] c1 -> Object of a1 equals :: CAT_4:def 4
the TerminalObj of a1;
correctness
coherence
the TerminalObj of c1 is Object of c1
;
;
let c2, c3 be Object of c1;
func c2 [x] c3 -> Object of a1 equals :: CAT_4:def 5
the CatProd of a1 . [a2,a3];
correctness
coherence
the CatProd of c1 . [c2,c3] is Object of c1
;
;
func pr1 c2,c3 -> Morphism of a1 equals :: CAT_4:def 6
the Proj1 of a1 . [a2,a3];
correctness
coherence
the Proj1 of c1 . [c2,c3] is Morphism of c1
;
;
func pr2 c2,c3 -> Morphism of a1 equals :: CAT_4:def 7
the Proj2 of a1 . [a2,a3];
correctness
coherence
the Proj2 of c1 . [c2,c3] is Morphism of c1
;
;
end;

:: deftheorem Def4 defines [1] CAT_4:def 4 :
for b1 being ProdCatStr holds [1] b1 = the TerminalObj of b1;

:: deftheorem Def5 defines [x] CAT_4:def 5 :
for b1 being ProdCatStr
for b2, b3 being Object of b1 holds b2 [x] b3 = the CatProd of b1 . [b2,b3];

:: deftheorem Def6 defines pr1 CAT_4:def 6 :
for b1 being ProdCatStr
for b2, b3 being Object of b1 holds pr1 b2,b3 = the Proj1 of b1 . [b2,b3];

:: deftheorem Def7 defines pr2 CAT_4:def 7 :
for b1 being ProdCatStr
for b2, b3 being Object of b1 holds pr2 b2,b3 = the Proj2 of b1 . [b2,b3];

definition
let c1, c2 be set ;
func c1Cat c1,c2 -> strict ProdCatStr equals :: CAT_4:def 8
ProdCatStr(# {a1},{a2},({a2} --> a1),({a2} --> a1),(a2,a2 .--> a2),({a1} --> a2),(Extract a1),(a1,a1 :-> a1),(a1,a1 :-> a2),(a1,a1 :-> a2) #);
correctness
coherence
ProdCatStr(# {c1},{c2},({c2} --> c1),({c2} --> c1),(c2,c2 .--> c2),({c1} --> c2),(Extract c1),(c1,c1 :-> c1),(c1,c1 :-> c2),(c1,c1 :-> c2) #) is strict ProdCatStr
;
;
end;

:: deftheorem Def8 defines c1Cat CAT_4:def 8 :
for b1, b2 being set holds c1Cat b1,b2 = ProdCatStr(# {b1},{b2},({b2} --> b1),({b2} --> b1),(b2,b2 .--> b2),({b1} --> b2),(Extract b1),(b1,b1 :-> b1),(b1,b1 :-> b2),(b1,b1 :-> b2) #);

theorem Th2: :: CAT_4:2
for b1, b2 being set holds CatStr(# the Objects of (c1Cat b1,b2),the Morphisms of (c1Cat b1,b2),the Dom of (c1Cat b1,b2),the Cod of (c1Cat b1,b2),the Comp of (c1Cat b1,b2),the Id of (c1Cat b1,b2) #) = 1Cat b1,b2 ;

Lemma2: for b1, b2 being set holds c1Cat b1,b2 is Category-like
proof end;

registration
cluster Category-like strict ProdCatStr ;
existence
ex b1 being ProdCatStr st
( b1 is strict & b1 is Category-like )
proof end;
end;

registration
let c1, c2 be set ;
cluster c1Cat a1,a2 -> Category-like strict ;
coherence
c1Cat c1,c2 is Category-like
by Lemma2;
end;

theorem Th3: :: CAT_4:3
for b1, b2 being set
for b3 being Object of (c1Cat b1,b2) holds b3 = b1 by TARSKI:def 1;

theorem Th4: :: CAT_4:4
for b1, b2 being set
for b3, b4 being Object of (c1Cat b1,b2) holds b3 = b4
proof end;

theorem Th5: :: CAT_4:5
for b1, b2 being set
for b3 being Morphism of (c1Cat b1,b2) holds b3 = b2 by TARSKI:def 1;

theorem Th6: :: CAT_4:6
for b1, b2 being set
for b3, b4 being Morphism of (c1Cat b1,b2) holds b3 = b4
proof end;

theorem Th7: :: CAT_4:7
for b1, b2 being set
for b3, b4 being Object of (c1Cat b1,b2)
for b5 being Morphism of (c1Cat b1,b2) holds b5 in Hom b3,b4
proof end;

theorem Th8: :: CAT_4:8
for b1, b2 being set
for b3, b4 being Object of (c1Cat b1,b2)
for b5 being Morphism of (c1Cat b1,b2) holds b5 is Morphism of b3,b4
proof end;

theorem Th9: :: CAT_4:9
for b1, b2 being set
for b3, b4 being Object of (c1Cat b1,b2) holds Hom b3,b4 <> {} by Th7;

theorem Th10: :: CAT_4:10
for b1, b2 being set
for b3 being Object of (c1Cat b1,b2) holds b3 is terminal
proof end;

theorem Th11: :: CAT_4:11
for b1, b2 being set
for b3 being Object of (c1Cat b1,b2)
for b4, b5 being Morphism of (c1Cat b1,b2) holds b3 is_a_product_wrt b4,b5
proof end;

definition
let c1 be Category-like ProdCatStr ;
attr a1 is Cartesian means :Def9: :: CAT_4:def 9
( the TerminalObj of a1 is terminal & ( for b1, b2 being Object of a1 holds
( cod (the Proj1 of a1 . [b1,b2]) = b1 & cod (the Proj2 of a1 . [b1,b2]) = b2 & the CatProd of a1 . [b1,b2] is_a_product_wrt the Proj1 of a1 . [b1,b2],the Proj2 of a1 . [b1,b2] ) ) );
end;

:: deftheorem Def9 defines Cartesian CAT_4:def 9 :
for b1 being Category-like ProdCatStr holds
( b1 is Cartesian iff ( the TerminalObj of b1 is terminal & ( for b2, b3 being Object of b1 holds
( cod (the Proj1 of b1 . [b2,b3]) = b2 & cod (the Proj2 of b1 . [b2,b3]) = b3 & the CatProd of b1 . [b2,b3] is_a_product_wrt the Proj1 of b1 . [b2,b3],the Proj2 of b1 . [b2,b3] ) ) ) );

theorem Th12: :: CAT_4:12
for b1, b2 being set holds c1Cat b1,b2 is Cartesian
proof end;

registration
cluster Category-like strict Cartesian ProdCatStr ;
existence
ex b1 being Category-like ProdCatStr st
( b1 is strict & b1 is Cartesian )
proof end;
end;

definition
mode Cartesian_category is Category-like Cartesian ProdCatStr ;
end;

theorem Th13: :: CAT_4:13
for b1 being Cartesian_category holds [1] b1 is terminal by Def9;

theorem Th14: :: CAT_4:14
for b1 being Cartesian_category
for b2 being Object of b1
for b3, b4 being Morphism of b2, [1] b1 holds b3 = b4
proof end;

theorem Th15: :: CAT_4:15
for b1 being Cartesian_category
for b2 being Object of b1 holds Hom b2,([1] b1) <> {}
proof end;

definition
let c1 be Cartesian_category;
let c2 be Object of c1;
func term c2 -> Morphism of a2, [1] a1 means :: CAT_4:def 10
verum;
existence
ex b1 being Morphism of c2, [1] c1 st verum
;
uniqueness
for b1, b2 being Morphism of c2, [1] c1 holds b1 = b2
by Th14;
end;

:: deftheorem Def10 defines term CAT_4:def 10 :
for b1 being Cartesian_category
for b2 being Object of b1
for b3 being Morphism of b2, [1] b1 holds
( b3 = term b2 iff verum );

theorem Th16: :: CAT_4:16
for b1 being Cartesian_category
for b2 being Object of b1 holds term b2 = term b2,([1] b1)
proof end;

theorem Th17: :: CAT_4:17
for b1 being Cartesian_category
for b2 being Object of b1 holds
( dom (term b2) = b2 & cod (term b2) = [1] b1 )
proof end;

theorem Th18: :: CAT_4:18
for b1 being Cartesian_category
for b2 being Object of b1 holds Hom b2,([1] b1) = {(term b2)}
proof end;

theorem Th19: :: CAT_4:19
for b1 being Cartesian_category
for b2, b3 being Object of b1 holds
( dom (pr1 b2,b3) = b2 [x] b3 & cod (pr1 b2,b3) = b2 )
proof end;

theorem Th20: :: CAT_4:20
for b1 being Cartesian_category
for b2, b3 being Object of b1 holds
( dom (pr2 b2,b3) = b2 [x] b3 & cod (pr2 b2,b3) = b3 )
proof end;

definition
let c1 be Cartesian_category;
let c2, c3 be Object of c1;
redefine func pr1 as pr1 c2,c3 -> Morphism of a2 [x] a3,a2;
coherence
pr1 c2,c3 is Morphism of c2 [x] c3,c2
proof end;
redefine func pr2 as pr2 c2,c3 -> Morphism of a2 [x] a3,a3;
coherence
pr2 c2,c3 is Morphism of c2 [x] c3,c3
proof end;
end;

theorem Th21: :: CAT_4:21
for b1 being Cartesian_category
for b2, b3 being Object of b1 holds
( Hom (b2 [x] b3),b2 <> {} & Hom (b2 [x] b3),b3 <> {} )
proof end;

theorem Th22: :: CAT_4:22
for b1 being Cartesian_category
for b2, b3 being Object of b1 holds b2 [x] b3 is_a_product_wrt pr1 b2,b3, pr2 b2,b3 by Def9;

theorem Th23: :: CAT_4:23
for b1 being Cartesian_category holds b1 has_finite_product
proof end;

theorem Th24: :: CAT_4:24
for b1 being Cartesian_category
for b2, b3 being Object of b1 st Hom b2,b3 <> {} & Hom b3,b2 <> {} holds
( pr1 b2,b3 is retraction & pr2 b2,b3 is retraction )
proof end;

definition
let c1 be Cartesian_category;
let c2, c3, c4 be Object of c1;
let c5 be Morphism of c4,c2;
let c6 be Morphism of c4,c3;
assume E20: ( Hom c4,c2 <> {} & Hom c4,c3 <> {} ) ;
func <:c5,c6:> -> Morphism of a4,a2 [x] a3 means :Def11: :: CAT_4:def 11
( (pr1 a2,a3) * a7 = a5 & (pr2 a2,a3) * a7 = a6 );
existence
ex b1 being Morphism of c4,c2 [x] c3 st
( (pr1 c2,c3) * b1 = c5 & (pr2 c2,c3) * b1 = c6 )
proof end;
uniqueness
for b1, b2 being Morphism of c4,c2 [x] c3 st (pr1 c2,c3) * b1 = c5 & (pr2 c2,c3) * b1 = c6 & (pr1 c2,c3) * b2 = c5 & (pr2 c2,c3) * b2 = c6 holds
b1 = b2
proof end;
end;

:: deftheorem Def11 defines <: CAT_4:def 11 :
for b1 being Cartesian_category
for b2, b3, b4 being Object of b1
for b5 being Morphism of b4,b2
for b6 being Morphism of b4,b3 st Hom b4,b2 <> {} & Hom b4,b3 <> {} holds
for b7 being Morphism of b4,b2 [x] b3 holds
( b7 = <:b5,b6:> iff ( (pr1 b2,b3) * b7 = b5 & (pr2 b2,b3) * b7 = b6 ) );

theorem Th25: :: CAT_4:25
for b1 being Cartesian_category
for b2, b3, b4 being Object of b1 st Hom b2,b3 <> {} & Hom b2,b4 <> {} holds
Hom b2,(b3 [x] b4) <> {}
proof end;

theorem Th26: :: CAT_4:26
for b1 being Cartesian_category
for b2, b3 being Object of b1 holds <:(pr1 b2,b3),(pr2 b2,b3):> = id (b2 [x] b3)
proof end;

theorem Th27: :: CAT_4:27
for b1 being Cartesian_category
for b2, b3, b4, b5 being Object of b1
for b6 being Morphism of b2,b3
for b7 being Morphism of b2,b4
for b8 being Morphism of b5,b2 st Hom b2,b3 <> {} & Hom b2,b4 <> {} & Hom b5,b2 <> {} holds
<:(b6 * b8),(b7 * b8):> = <:b6,b7:> * b8
proof end;

theorem Th28: :: CAT_4:28
for b1 being Cartesian_category
for b2, b3, b4 being Object of b1
for b5, b6 being Morphism of b2,b3
for b7, b8 being Morphism of b2,b4 st Hom b2,b3 <> {} & Hom b2,b4 <> {} & <:b5,b7:> = <:b6,b8:> holds
( b5 = b6 & b7 = b8 )
proof end;

theorem Th29: :: CAT_4:29
for b1 being Cartesian_category
for b2, b3, b4 being Object of b1
for b5 being Morphism of b2,b3
for b6 being Morphism of b2,b4 st Hom b2,b3 <> {} & Hom b2,b4 <> {} & ( b5 is monic or b6 is monic ) holds
<:b5,b6:> is monic
proof end;

theorem Th30: :: CAT_4:30
for b1 being Cartesian_category
for b2 being Object of b1 holds
( Hom b2,(b2 [x] ([1] b1)) <> {} & Hom b2,(([1] b1) [x] b2) <> {} )
proof end;

definition
let c1 be Cartesian_category;
let c2 be Object of c1;
func lambda c2 -> Morphism of ([1] a1) [x] a2,a2 equals :: CAT_4:def 12
pr2 ([1] a1),a2;
correctness
coherence
pr2 ([1] c1),c2 is Morphism of ([1] c1) [x] c2,c2
;
;
func lambda' c2 -> Morphism of a2,([1] a1) [x] a2 equals :: CAT_4:def 13
<:(term a2),(id a2):>;
correctness
coherence
<:(term c2),(id c2):> is Morphism of c2,([1] c1) [x] c2
;
;
func rho c2 -> Morphism of a2 [x] ([1] a1),a2 equals :: CAT_4:def 14
pr1 a2,([1] a1);
correctness
coherence
pr1 c2,([1] c1) is Morphism of c2 [x] ([1] c1),c2
;
;
func rho' c2 -> Morphism of a2,a2 [x] ([1] a1) equals :: CAT_4:def 15
<:(id a2),(term a2):>;
correctness
coherence
<:(id c2),(term c2):> is Morphism of c2,c2 [x] ([1] c1)
;
;
end;

:: deftheorem Def12 defines lambda CAT_4:def 12 :
for b1 being Cartesian_category
for b2 being Object of b1 holds lambda b2 = pr2 ([1] b1),b2;

:: deftheorem Def13 defines lambda' CAT_4:def 13 :
for b1 being Cartesian_category
for b2 being Object of b1 holds lambda' b2 = <:(term b2),(id b2):>;

:: deftheorem Def14 defines rho CAT_4:def 14 :
for b1 being Cartesian_category
for b2 being Object of b1 holds rho b2 = pr1 b2,([1] b1);

:: deftheorem Def15 defines rho' CAT_4:def 15 :
for b1 being Cartesian_category
for b2 being Object of b1 holds rho' b2 = <:(id b2),(term b2):>;

theorem Th31: :: CAT_4:31
for b1 being Cartesian_category
for b2 being Object of b1 holds
( (lambda b2) * (lambda' b2) = id b2 & (lambda' b2) * (lambda b2) = id (([1] b1) [x] b2) & (rho b2) * (rho' b2) = id b2 & (rho' b2) * (rho b2) = id (b2 [x] ([1] b1)) )
proof end;

theorem Th32: :: CAT_4:32
for b1 being Cartesian_category
for b2 being Object of b1 holds
( b2,b2 [x] ([1] b1) are_isomorphic & b2,([1] b1) [x] b2 are_isomorphic )
proof end;

definition
let c1 be Cartesian_category;
let c2, c3 be Object of c1;
func Switch c2,c3 -> Morphism of a2 [x] a3,a3 [x] a2 equals :: CAT_4:def 16
<:(pr2 a2,a3),(pr1 a2,a3):>;
correctness
coherence
<:(pr2 c2,c3),(pr1 c2,c3):> is Morphism of c2 [x] c3,c3 [x] c2
;
;
end;

:: deftheorem Def16 defines Switch CAT_4:def 16 :
for b1 being Cartesian_category
for b2, b3 being Object of b1 holds Switch b2,b3 = <:(pr2 b2,b3),(pr1 b2,b3):>;

theorem Th33: :: CAT_4:33
for b1 being Cartesian_category
for b2, b3 being Object of b1 holds Hom (b2 [x] b3),(b3 [x] b2) <> {}
proof end;

theorem Th34: :: CAT_4:34
for b1 being Cartesian_category
for b2, b3 being Object of b1 holds (Switch b2,b3) * (Switch b3,b2) = id (b3 [x] b2)
proof end;

theorem Th35: :: CAT_4:35
for b1 being Cartesian_category
for b2, b3 being Object of b1 holds b2 [x] b3,b3 [x] b2 are_isomorphic
proof end;

definition
let c1 be Cartesian_category;
let c2 be Object of c1;
func Delta c2 -> Morphism of a2,a2 [x] a2 equals :: CAT_4:def 17
<:(id a2),(id a2):>;
correctness
coherence
<:(id c2),(id c2):> is Morphism of c2,c2 [x] c2
;
;
end;

:: deftheorem Def17 defines Delta CAT_4:def 17 :
for b1 being Cartesian_category
for b2 being Object of b1 holds Delta b2 = <:(id b2),(id b2):>;

theorem Th36: :: CAT_4:36
for b1 being Cartesian_category
for b2 being Object of b1 holds Hom b2,(b2 [x] b2) <> {}
proof end;

theorem Th37: :: CAT_4:37
for b1 being Cartesian_category
for b2, b3 being Object of b1
for b4 being Morphism of b2,b3 st Hom b2,b3 <> {} holds
<:b4,b4:> = (Delta b3) * b4
proof end;

definition
let c1 be Cartesian_category;
let c2, c3, c4 be Object of c1;
func Alpha c2,c3,c4 -> Morphism of (a2 [x] a3) [x] a4,a2 [x] (a3 [x] a4) equals :: CAT_4:def 18
<:((pr1 a2,a3) * (pr1 (a2 [x] a3),a4)),<:((pr2 a2,a3) * (pr1 (a2 [x] a3),a4)),(pr2 (a2 [x] a3),a4):>:>;
correctness
coherence
<:((pr1 c2,c3) * (pr1 (c2 [x] c3),c4)),<:((pr2 c2,c3) * (pr1 (c2 [x] c3),c4)),(pr2 (c2 [x] c3),c4):>:> is Morphism of (c2 [x] c3) [x] c4,c2 [x] (c3 [x] c4)
;
;
func Alpha' c2,c3,c4 -> Morphism of a2 [x] (a3 [x] a4),(a2 [x] a3) [x] a4 equals :: CAT_4:def 19
<:<:(pr1 a2,(a3 [x] a4)),((pr1 a3,a4) * (pr2 a2,(a3 [x] a4))):>,((pr2 a3,a4) * (pr2 a2,(a3 [x] a4))):>;
correctness
coherence
<:<:(pr1 c2,(c3 [x] c4)),((pr1 c3,c4) * (pr2 c2,(c3 [x] c4))):>,((pr2 c3,c4) * (pr2 c2,(c3 [x] c4))):> is Morphism of c2 [x] (c3 [x] c4),(c2 [x] c3) [x] c4
;
;
end;

:: deftheorem Def18 defines Alpha CAT_4:def 18 :
for b1 being Cartesian_category
for b2, b3, b4 being Object of b1 holds Alpha b2,b3,b4 = <:((pr1 b2,b3) * (pr1 (b2 [x] b3),b4)),<:((pr2 b2,b3) * (pr1 (b2 [x] b3),b4)),(pr2 (b2 [x] b3),b4):>:>;

:: deftheorem Def19 defines Alpha' CAT_4:def 19 :
for b1 being Cartesian_category
for b2, b3, b4 being Object of b1 holds Alpha' b2,b3,b4 = <:<:(pr1 b2,(b3 [x] b4)),((pr1 b3,b4) * (pr2 b2,(b3 [x] b4))):>,((pr2 b3,b4) * (pr2 b2,(b3 [x] b4))):>;

theorem Th38: :: CAT_4:38
for b1 being Cartesian_category
for b2, b3, b4 being Object of b1 holds
( Hom ((b2 [x] b3) [x] b4),(b2 [x] (b3 [x] b4)) <> {} & Hom (b2 [x] (b3 [x] b4)),((b2 [x] b3) [x] b4) <> {} )
proof end;

theorem Th39: :: CAT_4:39
for b1 being Cartesian_category
for b2, b3, b4 being Object of b1 holds
( (Alpha b2,b3,b4) * (Alpha' b2,b3,b4) = id (b2 [x] (b3 [x] b4)) & (Alpha' b2,b3,b4) * (Alpha b2,b3,b4) = id ((b2 [x] b3) [x] b4) )
proof end;

theorem Th40: :: CAT_4:40
for b1 being Cartesian_category
for b2, b3, b4 being Object of b1 holds (b2 [x] b3) [x] b4,b2 [x] (b3 [x] b4) are_isomorphic
proof end;

definition
let c1 be Cartesian_category;
let c2, c3, c4, c5 be Object of c1;
let c6 be Morphism of c2,c3;
let c7 be Morphism of c4,c5;
func c6 [x] c7 -> Morphism of a2 [x] a4,a3 [x] a5 equals :: CAT_4:def 20
<:(a6 * (pr1 a2,a4)),(a7 * (pr2 a2,a4)):>;
correctness
coherence
<:(c6 * (pr1 c2,c4)),(c7 * (pr2 c2,c4)):> is Morphism of c2 [x] c4,c3 [x] c5
;
;
end;

:: deftheorem Def20 defines [x] CAT_4:def 20 :
for b1 being Cartesian_category
for b2, b3, b4, b5 being Object of b1
for b6 being Morphism of b2,b3
for b7 being Morphism of b4,b5 holds b6 [x] b7 = <:(b6 * (pr1 b2,b4)),(b7 * (pr2 b2,b4)):>;

theorem Th41: :: CAT_4:41
for b1 being Cartesian_category
for b2, b3, b4, b5 being Object of b1 st Hom b2,b3 <> {} & Hom b4,b5 <> {} holds
Hom (b2 [x] b4),(b3 [x] b5) <> {}
proof end;

theorem Th42: :: CAT_4:42
for b1 being Cartesian_category
for b2, b3 being Object of b1 holds (id b2) [x] (id b3) = id (b2 [x] b3)
proof end;

theorem Th43: :: CAT_4:43
for b1 being Cartesian_category
for b2, b3, b4, b5, b6 being Object of b1
for b7 being Morphism of b2,b3
for b8 being Morphism of b4,b5
for b9 being Morphism of b6,b2
for b10 being Morphism of b6,b4 st Hom b2,b3 <> {} & Hom b4,b5 <> {} & Hom b6,b2 <> {} & Hom b6,b4 <> {} holds
(b7 [x] b8) * <:b9,b10:> = <:(b7 * b9),(b8 * b10):>
proof end;

theorem Th44: :: CAT_4:44
for b1 being Cartesian_category
for b2, b3, b4 being Object of b1
for b5 being Morphism of b2,b3
for b6 being Morphism of b2,b4 st Hom b2,b3 <> {} & Hom b2,b4 <> {} holds
<:b5,b6:> = (b5 [x] b6) * (Delta b2)
proof end;

theorem Th45: :: CAT_4:45
for b1 being Cartesian_category
for b2, b3, b4, b5, b6, b7 being Object of b1
for b8 being Morphism of b2,b3
for b9 being Morphism of b4,b5
for b10 being Morphism of b6,b2
for b11 being Morphism of b7,b4 st Hom b2,b3 <> {} & Hom b4,b5 <> {} & Hom b6,b2 <> {} & Hom b7,b4 <> {} holds
(b8 [x] b9) * (b10 [x] b11) = (b8 * b10) [x] (b9 * b11)
proof end;

definition
let c1 be Category;
attr a1 is with_finite_coproduct means :: CAT_4:def 21
for b1 being finite set
for b2 being Function of b1,the Objects of a1 ex b3 being Object of a1ex b4 being Injections_family of b3,b1 st
( doms b4 = b2 & b3 is_a_coproduct_wrt b4 );
end;

:: deftheorem Def21 defines with_finite_coproduct CAT_4:def 21 :
for b1 being Category holds
( b1 is with_finite_coproduct iff for b2 being finite set
for b3 being Function of b2,the Objects of b1 ex b4 being Object of b1ex b5 being Injections_family of b4,b2 st
( doms b5 = b3 & b4 is_a_coproduct_wrt b5 ) );

notation
let c1 be Category;
synonym c1 has_finite_coproduct for with_finite_coproduct c1;
end;

theorem Th46: :: CAT_4:46
for b1 being Category holds
( b1 has_finite_coproduct iff ( ex b2 being Object of b1 st b2 is initial & ( for b2, b3 being Object of b1 ex b4 being Object of b1ex b5, b6 being Morphism of b1 st
( dom b5 = b2 & dom b6 = b3 & cod b5 = b4 & cod b6 = b4 & b4 is_a_coproduct_wrt b5,b6 ) ) ) )
proof end;

definition
attr a1 is strict;
struct CoprodCatStr -> CatStr ;
aggr CoprodCatStr(# Objects, Morphisms, Dom, Cod, Comp, Id, Initial, Coproduct, Incl1, Incl2 #) -> CoprodCatStr ;
sel Initial c1 -> Element of the Objects of a1;
sel Coproduct c1 -> Function of [:the Objects of a1,the Objects of a1:],the Objects of a1;
sel Incl1 c1 -> Function of [:the Objects of a1,the Objects of a1:],the Morphisms of a1;
sel Incl2 c1 -> Function of [:the Objects of a1,the Objects of a1:],the Morphisms of a1;
end;

definition
let c1 be CoprodCatStr ;
func [0] c1 -> Object of a1 equals :: CAT_4:def 22
the Initial of a1;
correctness
coherence
the Initial of c1 is Object of c1
;
;
let c2, c3 be Object of c1;
func c2 + c3 -> Object of a1 equals :: CAT_4:def 23
the Coproduct of a1 . [a2,a3];
correctness
coherence
the Coproduct of c1 . [c2,c3] is Object of c1
;
;
func in1 c2,c3 -> Morphism of a1 equals :: CAT_4:def 24
the Incl1 of a1 . [a2,a3];
correctness
coherence
the Incl1 of c1 . [c2,c3] is Morphism of c1
;
;
func in2 c2,c3 -> Morphism of a1 equals :: CAT_4:def 25
the Incl2 of a1 . [a2,a3];
correctness
coherence
the Incl2 of c1 . [c2,c3] is Morphism of c1
;
;
end;

:: deftheorem Def22 defines [0] CAT_4:def 22 :
for b1 being CoprodCatStr holds [0] b1 = the Initial of b1;

:: deftheorem Def23 defines + CAT_4:def 23 :
for b1 being CoprodCatStr
for b2, b3 being Object of b1 holds b2 + b3 = the Coproduct of b1 . [b2,b3];

:: deftheorem Def24 defines in1 CAT_4:def 24 :
for b1 being CoprodCatStr
for b2, b3 being Object of b1 holds in1 b2,b3 = the Incl1 of b1 . [b2,b3];

:: deftheorem Def25 defines in2 CAT_4:def 25 :
for b1 being CoprodCatStr
for b2, b3 being Object of b1 holds in2 b2,b3 = the Incl2 of b1 . [b2,b3];

definition
let c1, c2 be set ;
func c1Cat* c1,c2 -> strict CoprodCatStr equals :: CAT_4:def 26
CoprodCatStr(# {a1},{a2},({a2} --> a1),({a2} --> a1),(a2,a2 .--> a2),({a1} --> a2),(Extract a1),(a1,a1 :-> a1),(a1,a1 :-> a2),(a1,a1 :-> a2) #);
correctness
coherence
CoprodCatStr(# {c1},{c2},({c2} --> c1),({c2} --> c1),(c2,c2 .--> c2),({c1} --> c2),(Extract c1),(c1,c1 :-> c1),(c1,c1 :-> c2),(c1,c1 :-> c2) #) is strict CoprodCatStr
;
;
end;

:: deftheorem Def26 defines c1Cat* CAT_4:def 26 :
for b1, b2 being set holds c1Cat* b1,b2 = CoprodCatStr(# {b1},{b2},({b2} --> b1),({b2} --> b1),(b2,b2 .--> b2),({b1} --> b2),(Extract b1),(b1,b1 :-> b1),(b1,b1 :-> b2),(b1,b1 :-> b2) #);

theorem Th47: :: CAT_4:47
for b1, b2 being set holds CatStr(# the Objects of (c1Cat* b1,b2),the Morphisms of (c1Cat* b1,b2),the Dom of (c1Cat* b1,b2),the Cod of (c1Cat* b1,b2),the Comp of (c1Cat* b1,b2),the Id of (c1Cat* b1,b2) #) = 1Cat b1,b2 ;

Lemma33: for b1, b2 being set holds c1Cat* b1,b2 is Category-like
proof end;

registration
cluster Category-like strict CoprodCatStr ;
existence
ex b1 being CoprodCatStr st
( b1 is strict & b1 is Category-like )
proof end;
end;

registration
let c1, c2 be set ;
cluster c1Cat* a1,a2 -> Category-like strict ;
coherence
c1Cat* c1,c2 is Category-like
by Lemma33;
end;

theorem Th48: :: CAT_4:48
for b1, b2 being set
for b3 being Object of (c1Cat* b1,b2) holds b3 = b1 by TARSKI:def 1;

theorem Th49: :: CAT_4:49
for b1, b2 being set
for b3, b4 being Object of (c1Cat* b1,b2) holds b3 = b4
proof end;

theorem Th50: :: CAT_4:50
for b1, b2 being set
for b3 being Morphism of (c1Cat* b1,b2) holds b3 = b2 by TARSKI:def 1;

theorem Th51: :: CAT_4:51
for b1, b2 being set
for b3, b4 being Morphism of (c1Cat* b1,b2) holds b3 = b4
proof end;

theorem Th52: :: CAT_4:52
for b1, b2 being set
for b3, b4 being Object of (c1Cat* b1,b2)
for b5 being Morphism of (c1Cat* b1,b2) holds b5 in Hom b3,b4
proof end;

theorem Th53: :: CAT_4:53
for b1, b2 being set
for b3, b4 being Object of (c1Cat* b1,b2)
for b5 being Morphism of (c1Cat* b1,b2) holds b5 is Morphism of b3,b4
proof end;

theorem Th54: :: CAT_4:54
for b1, b2 being set
for b3, b4 being Object of (c1Cat* b1,b2) holds Hom b3,b4 <> {} by Th52;

theorem Th55: :: CAT_4:55
for b1, b2 being set
for b3 being Object of (c1Cat* b1,b2) holds b3 is initial
proof end;

theorem Th56: :: CAT_4:56
for b1, b2 being set
for b3 being Object of (c1Cat* b1,b2)
for b4, b5 being Morphism of (c1Cat* b1,b2) holds b3 is_a_coproduct_wrt b4,b5
proof end;

definition
let c1 be Category-like CoprodCatStr ;
attr a1 is Cocartesian means :Def27: :: CAT_4:def 27
( the Initial of a1 is initial & ( for b1, b2 being Object of a1 holds
( dom (the Incl1 of a1 . [b1,b2]) = b1 & dom (the Incl2 of a1 . [b1,b2]) = b2 & the Coproduct of a1 . [b1,b2] is_a_coproduct_wrt the Incl1 of a1 . [b1,b2],the Incl2 of a1 . [b1,b2] ) ) );
end;

:: deftheorem Def27 defines Cocartesian CAT_4:def 27 :
for b1 being Category-like CoprodCatStr holds
( b1 is Cocartesian iff ( the Initial of b1 is initial & ( for b2, b3 being Object of b1 holds
( dom (the Incl1 of b1 . [b2,b3]) = b2 & dom (the Incl2 of b1 . [b2,b3]) = b3 & the Coproduct of b1 . [b2,b3] is_a_coproduct_wrt the Incl1 of b1 . [b2,b3],the Incl2 of b1 . [b2,b3] ) ) ) );

theorem Th57: :: CAT_4:57
for b1, b2 being set holds c1Cat* b1,b2 is Cocartesian
proof end;

registration
cluster Category-like strict Cocartesian CoprodCatStr ;
existence
ex b1 being Category-like CoprodCatStr st
( b1 is strict & b1 is Cocartesian )
proof end;
end;

definition
mode Cocartesian_category is Category-like Cocartesian CoprodCatStr ;
end;

theorem Th58: :: CAT_4:58
for b1 being Cocartesian_category holds [0] b1 is initial by Def27;

theorem Th59: :: CAT_4:59
for b1 being Cocartesian_category
for b2 being Object of b1
for b3, b4 being Morphism of [0] b1,b2 holds b3 = b4
proof end;

definition
let c1 be Cocartesian_category;
let c2 be Object of c1;
func init c2 -> Morphism of [0] a1,a2 means :: CAT_4:def 28
verum;
existence
ex b1 being Morphism of [0] c1,c2 st verum
;
uniqueness
for b1, b2 being Morphism of [0] c1,c2 holds b1 = b2
by Th59;
end;

:: deftheorem Def28 defines init CAT_4:def 28 :
for b1 being Cocartesian_category
for b2 being Object of b1
for b3 being Morphism of [0] b1,b2 holds
( b3 = init b2 iff verum );

theorem Th60: :: CAT_4:60
for b1 being Cocartesian_category
for b2 being Object of b1 holds Hom ([0] b1),b2 <> {}
proof end;

theorem Th61: :: CAT_4:61
for b1 being Cocartesian_category
for b2 being Object of b1 holds init b2 = init ([0] b1),b2
proof end;

theorem Th62: :: CAT_4:62
for b1 being Cocartesian_category
for b2 being Object of b1 holds
( dom (init b2) = [0] b1 & cod (init b2) = b2 )
proof end;

theorem Th63: :: CAT_4:63
for b1 being Cocartesian_category
for b2 being Object of b1 holds Hom ([0] b1),b2 = {(init b2)}
proof end;

theorem Th64: :: CAT_4:64
for b1 being Cocartesian_category
for b2, b3 being Object of b1 holds
( dom (in1 b2,b3) = b2 & cod (in1 b2,b3) = b2 + b3 )
proof end;

theorem Th65: :: CAT_4:65
for b1 being Cocartesian_category
for b2, b3 being Object of b1 holds
( dom (in2 b2,b3) = b3 & cod (in2 b2,b3) = b2 + b3 )
proof end;

theorem Th66: :: CAT_4:66
for b1 being Cocartesian_category
for b2, b3 being Object of b1 holds
( Hom b2,(b2 + b3) <> {} & Hom b3,(b2 + b3) <> {} )
proof end;

theorem Th67: :: CAT_4:67
for b1 being Cocartesian_category
for b2, b3 being Object of b1 holds b2 + b3 is_a_coproduct_wrt in1 b2,b3, in2 b2,b3 by Def27;

theorem Th68: :: CAT_4:68
for b1 being Cocartesian_category holds b1 has_finite_coproduct
proof end;

theorem Th69: :: CAT_4:69
for b1 being Cocartesian_category
for b2, b3 being Object of b1 st Hom b2,b3 <> {} & Hom b3,b2 <> {} holds
( in1 b2,b3 is coretraction & in2 b2,b3 is coretraction )
proof end;

definition
let c1 be Cocartesian_category;
let c2, c3 be Object of c1;
redefine func in1 as in1 c2,c3 -> Morphism of a2,a2 + a3;
coherence
in1 c2,c3 is Morphism of c2,c2 + c3
proof end;
redefine func in2 as in2 c2,c3 -> Morphism of a3,a2 + a3;
coherence
in2 c2,c3 is Morphism of c3,c2 + c3
proof end;
end;

definition
let c1 be Cocartesian_category;
let c2, c3, c4 be Object of c1;
let c5 be Morphism of c2,c4;
let c6 be Morphism of c3,c4;
assume E51: ( Hom c2,c4 <> {} & Hom c3,c4 <> {} ) ;
func [$c5,c6$] -> Morphism of a2 + a3,a4 means :Def29: :: CAT_4:def 29
( a7 * (in1 a2,a3) = a5 & a7 * (in2 a2,a3) = a6 );
existence
ex b1 being Morphism of c2 + c3,c4 st
( b1 * (in1 c2,c3) = c5 & b1 * (in2 c2,c3) = c6 )
proof end;
uniqueness
for b1, b2 being Morphism of c2 + c3,c4 st b1 * (in1 c2,c3) = c5 & b1 * (in2 c2,c3) = c6 & b2 * (in1 c2,c3) = c5 & b2 * (in2 c2,c3) = c6 holds
b1 = b2
proof end;
end;

:: deftheorem Def29 defines [$ CAT_4:def 29 :
for b1 being Cocartesian_category
for b2, b3, b4 being Object of b1
for b5 being Morphism of b2,b4
for b6 being Morphism of b3,b4 st Hom b2,b4 <> {} & Hom b3,b4 <> {} holds
for b7 being Morphism of b2 + b3,b4 holds
( b7 = [$b5,b6$] iff ( b7 * (in1 b2,b3) = b5 & b7 * (in2 b2,b3) = b6 ) );

theorem Th70: :: CAT_4:70
for b1 being Cocartesian_category
for b2, b3, b4 being Object of b1 st Hom b2,b3 <> {} & Hom b4,b3 <> {} holds
Hom (b2 + b4),b3 <> {}
proof end;

theorem Th71: :: CAT_4:71
for b1 being Cocartesian_category
for b2, b3 being Object of b1 holds [$(in1 b2,b3),(in2 b2,b3)$] = id (b2 + b3)
proof end;

theorem Th72: :: CAT_4:72
for b1 being Cocartesian_category
for b2, b3, b4, b5 being Object of b1
for b6 being Morphism of b2,b3
for b7 being Morphism of b4,b3
for b8 being Morphism of b3,b5 st Hom b2,b3 <> {} & Hom b4,b3 <> {} & Hom b3,b5 <> {} holds
[$(b8 * b6),(b8 * b7)$] = b8 * [$b6,b7$]
proof end;

theorem Th73: :: CAT_4:73
for b1 being Cocartesian_category
for b2, b3, b4 being Object of b1
for b5, b6 being Morphism of b2,b3
for b7, b8 being Morphism of b4,b3 st Hom b2,b3 <> {} & Hom b4,b3 <> {} & [$b5,b7$] = [$b6,b8$] holds
( b5 = b6 & b7 = b8 )
proof end;

theorem Th74: :: CAT_4:74
for b1 being Cocartesian_category
for b2, b3, b4 being Object of b1
for b5 being Morphism of b2,b3
for b6 being Morphism of b4,b3 st Hom b2,b3 <> {} & Hom b4,b3 <> {} & ( b5 is epi or b6 is epi ) holds
[$b5,b6$] is epi
proof end;

theorem Th75: :: CAT_4:75
for b1 being Cocartesian_category
for b2 being Object of b1 holds
( b2,b2 + ([0] b1) are_isomorphic & b2,([0] b1) + b2 are_isomorphic )
proof end;

theorem Th76: :: CAT_4:76
for b1 being Cocartesian_category
for b2, b3 being Object of b1 holds b2 + b3,b3 + b2 are_isomorphic
proof end;

theorem Th77: :: CAT_4:77
for b1 being Cocartesian_category
for b2, b3, b4 being Object of b1 holds (b2 + b3) + b4,b2 + (b3 + b4) are_isomorphic
proof end;

definition
let c1 be Cocartesian_category;
let c2 be Object of c1;
func nabla c2 -> Morphism of a2 + a2,a2 equals :: CAT_4:def 30
[$(id a2),(id a2)$];
correctness
coherence
[$(id c2),(id c2)$] is Morphism of c2 + c2,c2
;
;
end;

:: deftheorem Def30 defines nabla CAT_4:def 30 :
for b1 being Cocartesian_category
for b2 being Object of b1 holds nabla b2 = [$(id b2),(id b2)$];

definition
let c1 be Cocartesian_category;
let c2, c3, c4, c5 be Object of c1;
let c6 be Morphism of c2,c4;
let c7 be Morphism of c3,c5;
func c6 + c7 -> Morphism of a2 + a3,a4 + a5 equals :: CAT_4:def 31
[$((in1 a4,a5) * a6),((in2 a4,a5) * a7)$];
correctness
coherence
[$((in1 c4,c5) * c6),((in2 c4,c5) * c7)$] is Morphism of c2 + c3,c4 + c5
;
;
end;

:: deftheorem Def31 defines + CAT_4:def 31 :
for b1 being Cocartesian_category
for b2, b3, b4, b5 being Object of b1
for b6 being Morphism of b2,b4
for b7 being Morphism of b3,b5 holds b6 + b7 = [$((in1 b4,b5) * b6),((in2 b4,b5) * b7)$];

theorem Th78: :: CAT_4:78
for b1 being Cocartesian_category
for b2, b3, b4, b5 being Object of b1 st Hom b2,b3 <> {} & Hom b4,b5 <> {} holds
Hom (b2 + b4),(b3 + b5) <> {}
proof end;

theorem Th79: :: CAT_4:79
for b1 being Cocartesian_category
for b2, b3 being Object of b1 holds (id b2) + (id b3) = id (b2 + b3)
proof end;

theorem Th80: :: CAT_4:80
for b1 being Cocartesian_category
for b2, b3, b4, b5, b6 being Object of b1
for b7 being Morphism of b2,b3
for b8 being Morphism of b4,b5
for b9 being Morphism of b3,b6
for b10 being Morphism of b5,b6 st Hom b2,b3 <> {} & Hom b4,b5 <> {} & Hom b3,b6 <> {} & Hom b5,b6 <> {} holds
[$b9,b10$] * (b7 + b8) = [$(b9 * b7),(b10 * b8)$]
proof end;

theorem Th81: :: CAT_4:81
for b1 being Cocartesian_category
for b2, b3, b4 being Object of b1
for b5 being Morphism of b2,b3
for b6 being Morphism of b4,b3 st Hom b2,b3 <> {} & Hom b4,b3 <> {} holds
(nabla b3) * (b5 + b6) = [$b5,b6$]
proof end;

theorem Th82: :: CAT_4:82
for b1 being Cocartesian_category
for b2, b3, b4, b5, b6, b7 being Object of b1
for b8 being Morphism of b2,b3
for b9 being Morphism of b4,b5
for b10 being Morphism of b3,b6
for b11 being Morphism of b5,b7 st Hom b2,b3 <> {} & Hom b4,b5 <> {} & Hom b3,b6 <> {} & Hom b5,b7 <> {} holds
(b10 + b11) * (b8 + b9) = (b10 * b8) + (b11 * b9)
proof end;