:: ENS_1 semantic presentation

definition
let c1 be non empty set ;
func Funcs c1 -> set equals :: ENS_1:def 1
union { (Funcs b1,b2) where B is Element of a1, B is Element of a1 : verum } ;
coherence
union { (Funcs b1,b2) where B is Element of c1, B is Element of c1 : verum } is set
;
end;

:: deftheorem Def1 defines Funcs ENS_1:def 1 :
for b1 being non empty set holds Funcs b1 = union { (Funcs b2,b3) where B is Element of b1, B is Element of b1 : verum } ;

registration
let c1 be non empty set ;
cluster Funcs a1 -> non empty functional ;
coherence
( Funcs c1 is functional & not Funcs c1 is empty )
proof end;
end;

theorem Th1: :: ENS_1:1
for b1 being non empty set
for b2 being set holds
( b2 in Funcs b1 iff ex b3, b4 being Element of b1 st
( ( b4 = {} implies b3 = {} ) & b2 is Function of b3,b4 ) )
proof end;

theorem Th2: :: ENS_1:2
for b1 being non empty set
for b2, b3 being Element of b1 holds Funcs b2,b3 c= Funcs b1
proof end;

theorem Th3: :: ENS_1:3
for b1 being non empty set
for b2 being non empty Subset of b1 holds Funcs b2 c= Funcs b1
proof end;

definition
let c1 be non empty set ;
func Maps c1 -> set equals :: ENS_1:def 2
{ [[b1,b2],b3] where B is Element of a1, B is Element of a1, B is Element of Funcs a1 : ( ( b2 = {} implies b1 = {} ) & b3 is Function of b1,b2 ) } ;
coherence
{ [[b1,b2],b3] where B is Element of c1, B is Element of c1, B is Element of Funcs c1 : ( ( b2 = {} implies b1 = {} ) & b3 is Function of b1,b2 ) } is set
;
end;

:: deftheorem Def2 defines Maps ENS_1:def 2 :
for b1 being non empty set holds Maps b1 = { [[b2,b3],b4] where B is Element of b1, B is Element of b1, B is Element of Funcs b1 : ( ( b3 = {} implies b2 = {} ) & b4 is Function of b2,b3 ) } ;

registration
let c1 be non empty set ;
cluster Maps a1 -> non empty ;
coherence
not Maps c1 is empty
proof end;
end;

theorem Th4: :: ENS_1:4
for b1 being non empty set
for b2 being Element of Maps b1 ex b3 being Element of Funcs b1ex b4, b5 being Element of b1 st
( b2 = [[b4,b5],b3] & ( b5 = {} implies b4 = {} ) & b3 is Function of b4,b5 )
proof end;

theorem Th5: :: ENS_1:5
for b1 being non empty set
for b2, b3 being Element of b1
for b4 being Function of b2,b3 st ( b3 = {} implies b2 = {} ) holds
[[b2,b3],b4] in Maps b1
proof end;

theorem Th6: :: ENS_1:6
for b1 being non empty set holds Maps b1 c= [:[:b1,b1:],(Funcs b1):]
proof end;

theorem Th7: :: ENS_1:7
for b1 being non empty set
for b2 being non empty Subset of b1 holds Maps b2 c= Maps b1
proof end;

Lemma6: for b1, b2, b3, b4, b5, b6 being set st [[b1,b3],b5] = [[b2,b4],b6] holds
( b1 = b2 & b3 = b4 )
proof end;

registration
let c1 be non empty set ;
let c2 be Element of Maps c1;
cluster a2 `2 -> Relation-like Function-like ;
coherence
( c2 `2 is Function-like & c2 `2 is Relation-like )
proof end;
end;

definition
let c1 be non empty set ;
let c2 be Element of Maps c1;
canceled;
func dom c2 -> Element of a1 equals :: ENS_1:def 4
(a2 `1 ) `1 ;
coherence
(c2 `1 ) `1 is Element of c1
proof end;
func cod c2 -> Element of a1 equals :: ENS_1:def 5
(a2 `1 ) `2 ;
coherence
(c2 `1 ) `2 is Element of c1
proof end;
end;

:: deftheorem Def3 ENS_1:def 3 :
canceled;

:: deftheorem Def4 defines dom ENS_1:def 4 :
for b1 being non empty set
for b2 being Element of Maps b1 holds dom b2 = (b2 `1 ) `1 ;

:: deftheorem Def5 defines cod ENS_1:def 5 :
for b1 being non empty set
for b2 being Element of Maps b1 holds cod b2 = (b2 `1 ) `2 ;

theorem Th8: :: ENS_1:8
for b1 being non empty set
for b2 being Element of Maps b1 holds b2 = [[(dom b2),(cod b2)],(b2 `2 )]
proof end;

Lemma8: for b1 being non empty set
for b2, b3 being Element of Maps b1 st b2 `2 = b3 `2 & dom b2 = dom b3 & cod b2 = cod b3 holds
b2 = b3
proof end;

theorem Th9: :: ENS_1:9
for b1 being non empty set
for b2 being Element of Maps b1 holds
( ( cod b2 <> {} or dom b2 = {} ) & b2 `2 is Function of dom b2, cod b2 )
proof end;

Lemma10: for b1 being non empty set
for b2 being Element of Maps b1 holds
( dom (b2 `2 ) = dom b2 & rng (b2 `2 ) c= cod b2 )
proof end;

theorem Th10: :: ENS_1:10
for b1 being non empty set
for b2 being Function
for b3, b4 being set st [[b3,b4],b2] in Maps b1 holds
( ( b4 = {} implies b3 = {} ) & b2 is Function of b3,b4 )
proof end;

definition
let c1 be non empty set ;
let c2 be Element of c1;
func id$ c2 -> Element of Maps a1 equals :: ENS_1:def 6
[[a2,a2],(id a2)];
coherence
[[c2,c2],(id c2)] is Element of Maps c1
proof end;
end;

:: deftheorem Def6 defines id$ ENS_1:def 6 :
for b1 being non empty set
for b2 being Element of b1 holds id$ b2 = [[b2,b2],(id b2)];

theorem Th11: :: ENS_1:11
for b1 being non empty set
for b2 being Element of b1 holds
( (id$ b2) `2 = id b2 & dom (id$ b2) = b2 & cod (id$ b2) = b2 )
proof end;

definition
let c1 be non empty set ;
let c2, c3 be Element of Maps c1;
assume E13: cod c2 = dom c3 ;
func c3 * c2 -> Element of Maps a1 equals :Def7: :: ENS_1:def 7
[[(dom a2),(cod a3)],((a3 `2 ) * (a2 `2 ))];
coherence
[[(dom c2),(cod c3)],((c3 `2 ) * (c2 `2 ))] is Element of Maps c1
proof end;
end;

:: deftheorem Def7 defines * ENS_1:def 7 :
for b1 being non empty set
for b2, b3 being Element of Maps b1 st cod b2 = dom b3 holds
b3 * b2 = [[(dom b2),(cod b3)],((b3 `2 ) * (b2 `2 ))];

theorem Th12: :: ENS_1:12
for b1 being non empty set
for b2, b3 being Element of Maps b1 st dom b2 = cod b3 holds
( (b2 * b3) `2 = (b2 `2 ) * (b3 `2 ) & dom (b2 * b3) = dom b3 & cod (b2 * b3) = cod b2 )
proof end;

theorem Th13: :: ENS_1:13
for b1 being non empty set
for b2, b3, b4 being Element of Maps b1 st dom b2 = cod b3 & dom b4 = cod b2 holds
b4 * (b2 * b3) = (b4 * b2) * b3
proof end;

theorem Th14: :: ENS_1:14
for b1 being non empty set
for b2 being Element of Maps b1 holds
( b2 * (id$ (dom b2)) = b2 & (id$ (cod b2)) * b2 = b2 )
proof end;

definition
let c1 be non empty set ;
let c2, c3 be Element of c1;
func Maps c2,c3 -> set equals :: ENS_1:def 8
{ [[a2,a3],b1] where B is Element of Funcs a1 : [[a2,a3],b1] in Maps a1 } ;
correctness
coherence
{ [[c2,c3],b1] where B is Element of Funcs c1 : [[c2,c3],b1] in Maps c1 } is set
;
;
end;

:: deftheorem Def8 defines Maps ENS_1:def 8 :
for b1 being non empty set
for b2, b3 being Element of b1 holds Maps b2,b3 = { [[b2,b3],b4] where B is Element of Funcs b1 : [[b2,b3],b4] in Maps b1 } ;

theorem Th15: :: ENS_1:15
for b1 being non empty set
for b2, b3 being Element of b1
for b4 being Function of b2,b3 st ( b3 = {} implies b2 = {} ) holds
[[b2,b3],b4] in Maps b2,b3
proof end;

theorem Th16: :: ENS_1:16
for b1 being non empty set
for b2, b3 being Element of b1
for b4 being Element of Maps b1 st b4 in Maps b2,b3 holds
b4 = [[b2,b3],(b4 `2 )]
proof end;

theorem Th17: :: ENS_1:17
for b1 being non empty set
for b2, b3 being Element of b1 holds Maps b2,b3 c= Maps b1
proof end;

Lemma20: for b1 being non empty set
for b2, b3 being Element of b1
for b4 being Function st [[b2,b3],b4] in Maps b2,b3 holds
( ( b3 = {} implies b2 = {} ) & b4 is Function of b2,b3 )
proof end;

theorem Th18: :: ENS_1:18
for b1 being non empty set holds Maps b1 = union { (Maps b2,b3) where B is Element of b1, B is Element of b1 : verum }
proof end;

theorem Th19: :: ENS_1:19
for b1 being non empty set
for b2, b3 being Element of b1
for b4 being Element of Maps b1 holds
( b4 in Maps b2,b3 iff ( dom b4 = b2 & cod b4 = b3 ) )
proof end;

theorem Th20: :: ENS_1:20
for b1 being non empty set
for b2, b3 being Element of b1
for b4 being Element of Maps b1 st b4 in Maps b2,b3 holds
b4 `2 in Funcs b2,b3
proof end;

Lemma23: for b1 being non empty set
for b2 being non empty Subset of b1
for b3, b4 being Element of b2
for b5, b6 being Element of b1 st b3 = b5 & b4 = b6 holds
Maps b3,b4 = Maps b5,b6
proof end;

definition
let c1 be non empty set ;
let c2 be Element of Maps c1;
attr a2 is surjective means :: ENS_1:def 9
rng (a2 `2 ) = cod a2;
end;

:: deftheorem Def9 defines surjective ENS_1:def 9 :
for b1 being non empty set
for b2 being Element of Maps b1 holds
( b2 is surjective iff rng (b2 `2 ) = cod b2 );

notation
let c1 be non empty set ;
let c2 be Element of Maps c1;
synonym c2 is_a_surjection for surjective c2c2 is_a_surjectionis_a_surjection ;
end;

definition
let c1 be non empty set ;
func fDom c1 -> Function of Maps a1,a1 means :Def10: :: ENS_1:def 10
for b1 being Element of Maps a1 holds a2 . b1 = dom b1;
existence
ex b1 being Function of Maps c1,c1 st
for b2 being Element of Maps c1 holds b1 . b2 = dom b2
proof end;
uniqueness
for b1, b2 being Function of Maps c1,c1 st ( for b3 being Element of Maps c1 holds b1 . b3 = dom b3 ) & ( for b3 being Element of Maps c1 holds b2 . b3 = dom b3 ) holds
b1 = b2
proof end;
func fCod c1 -> Function of Maps a1,a1 means :Def11: :: ENS_1:def 11
for b1 being Element of Maps a1 holds a2 . b1 = cod b1;
existence
ex b1 being Function of Maps c1,c1 st
for b2 being Element of Maps c1 holds b1 . b2 = cod b2
proof end;
uniqueness
for b1, b2 being Function of Maps c1,c1 st ( for b3 being Element of Maps c1 holds b1 . b3 = cod b3 ) & ( for b3 being Element of Maps c1 holds b2 . b3 = cod b3 ) holds
b1 = b2
proof end;
func fComp c1 -> PartFunc of [:(Maps a1),(Maps a1):], Maps a1 means :Def12: :: ENS_1:def 12
( ( for b1, b2 being Element of Maps a1 holds
( [b1,b2] in dom a2 iff dom b1 = cod b2 ) ) & ( for b1, b2 being Element of Maps a1 st dom b1 = cod b2 holds
a2 . [b1,b2] = b1 * b2 ) );
existence
ex b1 being PartFunc of [:(Maps c1),(Maps c1):], Maps c1 st
( ( for b2, b3 being Element of Maps c1 holds
( [b2,b3] in dom b1 iff dom b2 = cod b3 ) ) & ( for b2, b3 being Element of Maps c1 st dom b2 = cod b3 holds
b1 . [b2,b3] = b2 * b3 ) )
proof end;
uniqueness
for b1, b2 being PartFunc of [:(Maps c1),(Maps c1):], Maps c1 st ( for b3, b4 being Element of Maps c1 holds
( [b3,b4] in dom b1 iff dom b3 = cod b4 ) ) & ( for b3, b4 being Element of Maps c1 st dom b3 = cod b4 holds
b1 . [b3,b4] = b3 * b4 ) & ( for b3, b4 being Element of Maps c1 holds
( [b3,b4] in dom b2 iff dom b3 = cod b4 ) ) & ( for b3, b4 being Element of Maps c1 st dom b3 = cod b4 holds
b2 . [b3,b4] = b3 * b4 ) holds
b1 = b2
proof end;
func fId c1 -> Function of a1, Maps a1 means :Def13: :: ENS_1:def 13
for b1 being Element of a1 holds a2 . b1 = id$ b1;
existence
ex b1 being Function of c1, Maps c1 st
for b2 being Element of c1 holds b1 . b2 = id$ b2
proof end;
uniqueness
for b1, b2 being Function of c1, Maps c1 st ( for b3 being Element of c1 holds b1 . b3 = id$ b3 ) & ( for b3 being Element of c1 holds b2 . b3 = id$ b3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def10 defines fDom ENS_1:def 10 :
for b1 being non empty set
for b2 being Function of Maps b1,b1 holds
( b2 = fDom b1 iff for b3 being Element of Maps b1 holds b2 . b3 = dom b3 );

:: deftheorem Def11 defines fCod ENS_1:def 11 :
for b1 being non empty set
for b2 being Function of Maps b1,b1 holds
( b2 = fCod b1 iff for b3 being Element of Maps b1 holds b2 . b3 = cod b3 );

:: deftheorem Def12 defines fComp ENS_1:def 12 :
for b1 being non empty set
for b2 being PartFunc of [:(Maps b1),(Maps b1):], Maps b1 holds
( b2 = fComp b1 iff ( ( for b3, b4 being Element of Maps b1 holds
( [b3,b4] in dom b2 iff dom b3 = cod b4 ) ) & ( for b3, b4 being Element of Maps b1 st dom b3 = cod b4 holds
b2 . [b3,b4] = b3 * b4 ) ) );

:: deftheorem Def13 defines fId ENS_1:def 13 :
for b1 being non empty set
for b2 being Function of b1, Maps b1 holds
( b2 = fId b1 iff for b3 being Element of b1 holds b2 . b3 = id$ b3 );

definition
let c1 be non empty set ;
func Ens c1 -> CatStr equals :: ENS_1:def 14
CatStr(# a1,(Maps a1),(fDom a1),(fCod a1),(fComp a1),(fId a1) #);
coherence
CatStr(# c1,(Maps c1),(fDom c1),(fCod c1),(fComp c1),(fId c1) #) is CatStr
;
end;

:: deftheorem Def14 defines Ens ENS_1:def 14 :
for b1 being non empty set holds Ens b1 = CatStr(# b1,(Maps b1),(fDom b1),(fCod b1),(fComp b1),(fId b1) #);

theorem Th21: :: ENS_1:21
for b1 being non empty set holds CatStr(# b1,(Maps b1),(fDom b1),(fCod b1),(fComp b1),(fId b1) #) is Category
proof end;

registration
let c1 be non empty set ;
cluster Ens a1 -> strict Category-like ;
coherence
( Ens c1 is strict & Ens c1 is Category-like )
by Th21;
end;

theorem Th22: :: ENS_1:22
for b1 being non empty set
for b2 being Element of b1 holds b2 is Object of (Ens b1) ;

definition
let c1 be non empty set ;
let c2 be Element of c1;
func @ c2 -> Object of (Ens a1) equals :: ENS_1:def 15
a2;
coherence
c2 is Object of (Ens c1)
;
end;

:: deftheorem Def15 defines @ ENS_1:def 15 :
for b1 being non empty set
for b2 being Element of b1 holds @ b2 = b2;

theorem Th23: :: ENS_1:23
for b1 being non empty set
for b2 being Object of (Ens b1) holds b2 is Element of b1 ;

definition
let c1 be non empty set ;
let c2 be Object of (Ens c1);
func @ c2 -> Element of a1 equals :: ENS_1:def 16
a2;
coherence
c2 is Element of c1
;
end;

:: deftheorem Def16 defines @ ENS_1:def 16 :
for b1 being non empty set
for b2 being Object of (Ens b1) holds @ b2 = b2;

theorem Th24: :: ENS_1:24
for b1 being non empty set
for b2 being Element of Maps b1 holds b2 is Morphism of (Ens b1) ;

definition
let c1 be non empty set ;
let c2 be Element of Maps c1;
func @ c2 -> Morphism of (Ens a1) equals :: ENS_1:def 17
a2;
coherence
c2 is Morphism of (Ens c1)
;
end;

:: deftheorem Def17 defines @ ENS_1:def 17 :
for b1 being non empty set
for b2 being Element of Maps b1 holds @ b2 = b2;

theorem Th25: :: ENS_1:25
for b1 being non empty set
for b2 being Morphism of (Ens b1) holds b2 is Element of Maps b1 ;

definition
let c1 be non empty set ;
let c2 be Morphism of (Ens c1);
func @ c2 -> Element of Maps a1 equals :: ENS_1:def 18
a2;
coherence
c2 is Element of Maps c1
;
end;

:: deftheorem Def18 defines @ ENS_1:def 18 :
for b1 being non empty set
for b2 being Morphism of (Ens b1) holds @ b2 = b2;

theorem Th26: :: ENS_1:26
for b1 being non empty set
for b2 being Morphism of (Ens b1) holds
( dom b2 = dom (@ b2) & cod b2 = cod (@ b2) ) by Def10, Def11;

theorem Th27: :: ENS_1:27
for b1 being non empty set
for b2, b3 being Object of (Ens b1) holds Hom b2,b3 = Maps (@ b2),(@ b3)
proof end;

Lemma31: for b1 being non empty set
for b2, b3 being Object of (Ens b1) st Hom b2,b3 <> {} holds
Funcs (@ b2),(@ b3) <> {}
proof end;

theorem Th28: :: ENS_1:28
for b1 being non empty set
for b2, b3 being Morphism of (Ens b1) st dom b2 = cod b3 holds
b2 * b3 = (@ b2) * (@ b3)
proof end;

theorem Th29: :: ENS_1:29
for b1 being non empty set
for b2 being Object of (Ens b1) holds id b2 = id$ (@ b2) by Def13;

theorem Th30: :: ENS_1:30
for b1 being non empty set
for b2 being Object of (Ens b1) st b2 = {} holds
b2 is initial
proof end;

theorem Th31: :: ENS_1:31
for b1 being non empty set
for b2 being Object of (Ens b1) st {} in b1 & b2 is initial holds
b2 = {}
proof end;

theorem Th32: :: ENS_1:32
for b1 being Universe
for b2 being Object of (Ens b1) st b2 is initial holds
b2 = {}
proof end;

theorem Th33: :: ENS_1:33
for b1 being non empty set
for b2 being Object of (Ens b1) st ex b3 being set st b2 = {b3} holds
b2 is terminal
proof end;

theorem Th34: :: ENS_1:34
for b1 being non empty set
for b2 being Object of (Ens b1) st b1 <> {{} } & b2 is terminal holds
ex b3 being set st b2 = {b3}
proof end;

theorem Th35: :: ENS_1:35
for b1 being Universe
for b2 being Object of (Ens b1) st b2 is terminal holds
ex b3 being set st b2 = {b3}
proof end;

theorem Th36: :: ENS_1:36
for b1 being non empty set
for b2 being Morphism of (Ens b1) holds
( b2 is monic iff (@ b2) `2 is one-to-one )
proof end;

theorem Th37: :: ENS_1:37
for b1 being non empty set
for b2 being Morphism of (Ens b1) st b2 is epi & ex b3 being Element of b1ex b4, b5 being set st
( b4 in b3 & b5 in b3 & b4 <> b5 ) holds
@ b2 is surjective
proof end;

theorem Th38: :: ENS_1:38
for b1 being non empty set
for b2 being Morphism of (Ens b1) st @ b2 is surjective holds
b2 is epi
proof end;

theorem Th39: :: ENS_1:39
for b1 being Universe
for b2 being Morphism of (Ens b1) st b2 is epi holds
@ b2 is surjective
proof end;

theorem Th40: :: ENS_1:40
for b1 being non empty set
for b2 being non empty Subset of b1 holds Ens b2 is_full_subcategory_of Ens b1
proof end;

definition
let c1 be Category;
func Hom c1 -> set equals :: ENS_1:def 19
{ (Hom b1,b2) where B is Object of a1, B is Object of a1 : verum } ;
coherence
{ (Hom b1,b2) where B is Object of c1, B is Object of c1 : verum } is set
;
end;

:: deftheorem Def19 defines Hom ENS_1:def 19 :
for b1 being Category holds Hom b1 = { (Hom b2,b3) where B is Object of b1, B is Object of b1 : verum } ;

registration
let c1 be Category;
cluster Hom a1 -> non empty ;
coherence
not Hom c1 is empty
proof end;
end;

theorem Th41: :: ENS_1:41
for b1 being Category
for b2, b3 being Object of b1 holds Hom b2,b3 in Hom b1 ;

theorem Th42: :: ENS_1:42
for b1 being Category
for b2 being Object of b1
for b3 being Morphism of b1 holds
( ( Hom b2,(cod b3) = {} implies Hom b2,(dom b3) = {} ) & ( Hom (dom b3),b2 = {} implies Hom (cod b3),b2 = {} ) )
proof end;

definition
let c1 be Category;
let c2 be Object of c1;
let c3 be Morphism of c1;
func hom c2,c3 -> Function of Hom a2,(dom a3), Hom a2,(cod a3) means :Def20: :: ENS_1:def 20
for b1 being Morphism of a1 st b1 in Hom a2,(dom a3) holds
a4 . b1 = a3 * b1;
existence
ex b1 being Function of Hom c2,(dom c3), Hom c2,(cod c3) st
for b2 being Morphism of c1 st b2 in Hom c2,(dom c3) holds
b1 . b2 = c3 * b2
proof end;
uniqueness
for b1, b2 being Function of Hom c2,(dom c3), Hom c2,(cod c3) st ( for b3 being Morphism of c1 st b3 in Hom c2,(dom c3) holds
b1 . b3 = c3 * b3 ) & ( for b3 being Morphism of c1 st b3 in Hom c2,(dom c3) holds
b2 . b3 = c3 * b3 ) holds
b1 = b2
proof end;
func hom c3,c2 -> Function of Hom (cod a3),a2, Hom (dom a3),a2 means :Def21: :: ENS_1:def 21
for b1 being Morphism of a1 st b1 in Hom (cod a3),a2 holds
a4 . b1 = b1 * a3;
existence
ex b1 being Function of Hom (cod c3),c2, Hom (dom c3),c2 st
for b2 being Morphism of c1 st b2 in Hom (cod c3),c2 holds
b1 . b2 = b2 * c3
proof end;
uniqueness
for b1, b2 being Function of Hom (cod c3),c2, Hom (dom c3),c2 st ( for b3 being Morphism of c1 st b3 in Hom (cod c3),c2 holds
b1 . b3 = b3 * c3 ) & ( for b3 being Morphism of c1 st b3 in Hom (cod c3),c2 holds
b2 . b3 = b3 * c3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def20 defines hom ENS_1:def 20 :
for b1 being Category
for b2 being Object of b1
for b3 being Morphism of b1
for b4 being Function of Hom b2,(dom b3), Hom b2,(cod b3) holds
( b4 = hom b2,b3 iff for b5 being Morphism of b1 st b5 in Hom b2,(dom b3) holds
b4 . b5 = b3 * b5 );

:: deftheorem Def21 defines hom ENS_1:def 21 :
for b1 being Category
for b2 being Object of b1
for b3 being Morphism of b1
for b4 being Function of Hom (cod b3),b2, Hom (dom b3),b2 holds
( b4 = hom b3,b2 iff for b5 being Morphism of b1 st b5 in Hom (cod b3),b2 holds
b4 . b5 = b5 * b3 );

theorem Th43: :: ENS_1:43
for b1 being Category
for b2, b3 being Object of b1 holds hom b2,(id b3) = id (Hom b2,b3)
proof end;

theorem Th44: :: ENS_1:44
for b1 being Category
for b2, b3 being Object of b1 holds hom (id b2),b3 = id (Hom b2,b3)
proof end;

theorem Th45: :: ENS_1:45
for b1 being Category
for b2 being Object of b1
for b3, b4 being Morphism of b1 st dom b3 = cod b4 holds
hom b2,(b3 * b4) = (hom b2,b3) * (hom b2,b4)
proof end;

theorem Th46: :: ENS_1:46
for b1 being Category
for b2 being Object of b1
for b3, b4 being Morphism of b1 st dom b3 = cod b4 holds
hom (b3 * b4),b2 = (hom b4,b2) * (hom b3,b2)
proof end;

theorem Th47: :: ENS_1:47
for b1 being Category
for b2 being Object of b1
for b3 being Morphism of b1 holds [[(Hom b2,(dom b3)),(Hom b2,(cod b3))],(hom b2,b3)] is Element of Maps (Hom b1)
proof end;

theorem Th48: :: ENS_1:48
for b1 being Category
for b2 being Object of b1
for b3 being Morphism of b1 holds [[(Hom (cod b3),b2),(Hom (dom b3),b2)],(hom b3,b2)] is Element of Maps (Hom b1)
proof end;

definition
let c1 be Category;
let c2 be Object of c1;
func hom?- c2 -> Function of the Morphisms of a1, Maps (Hom a1) means :Def22: :: ENS_1:def 22
for b1 being Morphism of a1 holds a3 . b1 = [[(Hom a2,(dom b1)),(Hom a2,(cod b1))],(hom a2,b1)];
existence
ex b1 being Function of the Morphisms of c1, Maps (Hom c1) st
for b2 being Morphism of c1 holds b1 . b2 = [[(Hom c2,(dom b2)),(Hom c2,(cod b2))],(hom c2,b2)]
proof end;
uniqueness
for b1, b2 being Function of the Morphisms of c1, Maps (Hom c1) st ( for b3 being Morphism of c1 holds b1 . b3 = [[(Hom c2,(dom b3)),(Hom c2,(cod b3))],(hom c2,b3)] ) & ( for b3 being Morphism of c1 holds b2 . b3 = [[(Hom c2,(dom b3)),(Hom c2,(cod b3))],(hom c2,b3)] ) holds
b1 = b2
proof end;
func hom-? c2 -> Function of the Morphisms of a1, Maps (Hom a1) means :Def23: :: ENS_1:def 23
for b1 being Morphism of a1 holds a3 . b1 = [[(Hom (cod b1),a2),(Hom (dom b1),a2)],(hom b1,a2)];
existence
ex b1 being Function of the Morphisms of c1, Maps (Hom c1) st
for b2 being Morphism of c1 holds b1 . b2 = [[(Hom (cod b2),c2),(Hom (dom b2),c2)],(hom b2,c2)]
proof end;
uniqueness
for b1, b2 being Function of the Morphisms of c1, Maps (Hom c1) st ( for b3 being Morphism of c1 holds b1 . b3 = [[(Hom (cod b3),c2),(Hom (dom b3),c2)],(hom b3,c2)] ) & ( for b3 being Morphism of c1 holds b2 . b3 = [[(Hom (cod b3),c2),(Hom (dom b3),c2)],(hom b3,c2)] ) holds
b1 = b2
proof end;
end;

:: deftheorem Def22 defines hom?- ENS_1:def 22 :
for b1 being Category
for b2 being Object of b1
for b3 being Function of the Morphisms of b1, Maps (Hom b1) holds
( b3 = hom?- b2 iff for b4 being Morphism of b1 holds b3 . b4 = [[(Hom b2,(dom b4)),(Hom b2,(cod b4))],(hom b2,b4)] );

:: deftheorem Def23 defines hom-? ENS_1:def 23 :
for b1 being Category
for b2 being Object of b1
for b3 being Function of the Morphisms of b1, Maps (Hom b1) holds
( b3 = hom-? b2 iff for b4 being Morphism of b1 holds b3 . b4 = [[(Hom (cod b4),b2),(Hom (dom b4),b2)],(hom b4,b2)] );

Lemma47: for b1 being non empty set
for b2 being Category
for b3 being Function of the Morphisms of b2, Maps (Hom b2) st Hom b2 c= b1 holds
b3 is Function of the Morphisms of b2,the Morphisms of (Ens b1)
proof end;

Lemma48: for b1 being non empty set
for b2 being Category
for b3, b4 being Object of b2 st Hom b2 c= b1 holds
for b5 being Object of (Ens b1) st b5 = Hom b3,b4 holds
(hom?- b3) . (id b4) = id b5
proof end;

Lemma49: for b1 being non empty set
for b2 being Category
for b3, b4 being Object of b2 st Hom b2 c= b1 holds
for b5 being Object of (Ens b1) st b5 = Hom b3,b4 holds
(hom-? b4) . (id b3) = id b5
proof end;

theorem Th49: :: ENS_1:49
for b1 being non empty set
for b2 being Category
for b3 being Object of b2 st Hom b2 c= b1 holds
hom?- b3 is Functor of b2, Ens b1
proof end;

theorem Th50: :: ENS_1:50
for b1 being non empty set
for b2 being Category
for b3 being Object of b2 st Hom b2 c= b1 holds
hom-? b3 is Contravariant_Functor of b2, Ens b1
proof end;

theorem Th51: :: ENS_1:51
for b1 being Category
for b2, b3 being Morphism of b1 st Hom (dom b2),(cod b3) = {} holds
Hom (cod b2),(dom b3) = {}
proof end;

definition
let c1 be Category;
let c2, c3 be Morphism of c1;
func hom c2,c3 -> Function of Hom (cod a2),(dom a3), Hom (dom a2),(cod a3) means :Def24: :: ENS_1:def 24
for b1 being Morphism of a1 st b1 in Hom (cod a2),(dom a3) holds
a4 . b1 = (a3 * b1) * a2;
existence
ex b1 being Function of Hom (cod c2),(dom c3), Hom (dom c2),(cod c3) st
for b2 being Morphism of c1 st b2 in Hom (cod c2),(dom c3) holds
b1 . b2 = (c3 * b2) * c2
proof end;
uniqueness
for b1, b2 being Function of Hom (cod c2),(dom c3), Hom (dom c2),(cod c3) st ( for b3 being Morphism of c1 st b3 in Hom (cod c2),(dom c3) holds
b1 . b3 = (c3 * b3) * c2 ) & ( for b3 being Morphism of c1 st b3 in Hom (cod c2),(dom c3) holds
b2 . b3 = (c3 * b3) * c2 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def24 defines hom ENS_1:def 24 :
for b1 being Category
for b2, b3 being Morphism of b1
for b4 being Function of Hom (cod b2),(dom b3), Hom (dom b2),(cod b3) holds
( b4 = hom b2,b3 iff for b5 being Morphism of b1 st b5 in Hom (cod b2),(dom b3) holds
b4 . b5 = (b3 * b5) * b2 );

theorem Th52: :: ENS_1:52
for b1 being Category
for b2, b3 being Morphism of b1 holds [[(Hom (cod b2),(dom b3)),(Hom (dom b2),(cod b3))],(hom b2,b3)] is Element of Maps (Hom b1)
proof end;

theorem Th53: :: ENS_1:53
for b1 being Category
for b2 being Object of b1
for b3 being Morphism of b1 holds
( hom (id b2),b3 = hom b2,b3 & hom b3,(id b2) = hom b3,b2 )
proof end;

theorem Th54: :: ENS_1:54
for b1 being Category
for b2, b3 being Object of b1 holds hom (id b2),(id b3) = id (Hom b2,b3)
proof end;

theorem Th55: :: ENS_1:55
for b1 being Category
for b2, b3 being Morphism of b1 holds hom b2,b3 = (hom (dom b2),b3) * (hom b2,(dom b3))
proof end;

theorem Th56: :: ENS_1:56
for b1 being Category
for b2, b3, b4, b5 being Morphism of b1 st cod b2 = dom b3 & dom b4 = cod b5 holds
hom (b3 * b2),(b4 * b5) = (hom b2,b4) * (hom b3,b5)
proof end;

definition
let c1 be Category;
func hom?? c1 -> Function of the Morphisms of [:a1,a1:], Maps (Hom a1) means :Def25: :: ENS_1:def 25
for b1, b2 being Morphism of a1 holds a2 . [b1,b2] = [[(Hom (cod b1),(dom b2)),(Hom (dom b1),(cod b2))],(hom b1,b2)];
existence
ex b1 being Function of the Morphisms of [:c1,c1:], Maps (Hom c1) st
for b2, b3 being Morphism of c1 holds b1 . [b2,b3] = [[(Hom (cod b2),(dom b3)),(Hom (dom b2),(cod b3))],(hom b2,b3)]
proof end;
uniqueness
for b1, b2 being Function of the Morphisms of [:c1,c1:], Maps (Hom c1) st ( for b3, b4 being Morphism of c1 holds b1 . [b3,b4] = [[(Hom (cod b3),(dom b4)),(Hom (dom b3),(cod b4))],(hom b3,b4)] ) & ( for b3, b4 being Morphism of c1 holds b2 . [b3,b4] = [[(Hom (cod b3),(dom b4)),(Hom (dom b3),(cod b4))],(hom b3,b4)] ) holds
b1 = b2
proof end;
end;

:: deftheorem Def25 defines hom?? ENS_1:def 25 :
for b1 being Category
for b2 being Function of the Morphisms of [:b1,b1:], Maps (Hom b1) holds
( b2 = hom?? b1 iff for b3, b4 being Morphism of b1 holds b2 . [b3,b4] = [[(Hom (cod b3),(dom b4)),(Hom (dom b3),(cod b4))],(hom b3,b4)] );

theorem Th57: :: ENS_1:57
for b1 being Category
for b2 being Object of b1 holds
( hom?- b2 = (curry (hom?? b1)) . (id b2) & hom-? b2 = (curry' (hom?? b1)) . (id b2) )
proof end;

Lemma60: for b1 being non empty set
for b2 being Category
for b3, b4 being Object of b2 st Hom b2 c= b1 holds
for b5 being Object of (Ens b1) st b5 = Hom b3,b4 holds
(hom?? b2) . [(id b3),(id b4)] = id b5
proof end;

theorem Th58: :: ENS_1:58
for b1 being non empty set
for b2 being Category st Hom b2 c= b1 holds
hom?? b2 is Functor of [:(b2 opp ),b2:], Ens b1
proof end;

definition
let c1 be non empty set ;
let c2 be Category;
let c3 be Object of c2;
assume E62: Hom c2 c= c1 ;
func hom?- c1,c3 -> Functor of a2, Ens a1 equals :Def26: :: ENS_1:def 26
hom?- a3;
coherence
hom?- c3 is Functor of c2, Ens c1
by E62, Th49;
func hom-? c1,c3 -> Contravariant_Functor of a2, Ens a1 equals :Def27: :: ENS_1:def 27
hom-? a3;
coherence
hom-? c3 is Contravariant_Functor of c2, Ens c1
by E62, Th50;
end;

:: deftheorem Def26 defines hom?- ENS_1:def 26 :
for b1 being non empty set
for b2 being Category
for b3 being Object of b2 st Hom b2 c= b1 holds
hom?- b1,b3 = hom?- b3;

:: deftheorem Def27 defines hom-? ENS_1:def 27 :
for b1 being non empty set
for b2 being Category
for b3 being Object of b2 st Hom b2 c= b1 holds
hom-? b1,b3 = hom-? b3;

definition
let c1 be non empty set ;
let c2 be Category;
assume E64: Hom c2 c= c1 ;
func hom?? c1,c2 -> Functor of [:(a2 opp ),a2:], Ens a1 equals :Def28: :: ENS_1:def 28
hom?? a2;
coherence
hom?? c2 is Functor of [:(c2 opp ),c2:], Ens c1
by E64, Th58;
end;

:: deftheorem Def28 defines hom?? ENS_1:def 28 :
for b1 being non empty set
for b2 being Category st Hom b2 c= b1 holds
hom?? b1,b2 = hom?? b2;

theorem Th59: :: ENS_1:59
for b1 being non empty set
for b2 being Category
for b3 being Object of b2
for b4 being Morphism of b2 st Hom b2 c= b1 holds
(hom?- b1,b3) . b4 = [[(Hom b3,(dom b4)),(Hom b3,(cod b4))],(hom b3,b4)]
proof end;

theorem Th60: :: ENS_1:60
for b1 being non empty set
for b2 being Category
for b3, b4 being Object of b2 st Hom b2 c= b1 holds
(Obj (hom?- b1,b3)) . b4 = Hom b3,b4
proof end;

theorem Th61: :: ENS_1:61
for b1 being non empty set
for b2 being Category
for b3 being Object of b2
for b4 being Morphism of b2 st Hom b2 c= b1 holds
(hom-? b1,b3) . b4 = [[(Hom (cod b4),b3),(Hom (dom b4),b3)],(hom b4,b3)]
proof end;

theorem Th62: :: ENS_1:62
for b1 being non empty set
for b2 being Category
for b3, b4 being Object of b2 st Hom b2 c= b1 holds
(Obj (hom-? b1,b3)) . b4 = Hom b4,b3
proof end;

theorem Th63: :: ENS_1:63
for b1 being non empty set
for b2 being Category
for b3, b4 being Morphism of b2 st Hom b2 c= b1 holds
(hom?? b1,b2) . [(b3 opp ),b4] = [[(Hom (cod b3),(dom b4)),(Hom (dom b3),(cod b4))],(hom b3,b4)]
proof end;

theorem Th64: :: ENS_1:64
for b1 being non empty set
for b2 being Category
for b3, b4 being Object of b2 st Hom b2 c= b1 holds
(Obj (hom?? b1,b2)) . [(b3 opp ),b4] = Hom b3,b4
proof end;

theorem Th65: :: ENS_1:65
for b1 being non empty set
for b2 being Category
for b3 being Object of b2 st Hom b2 c= b1 holds
(hom?? b1,b2) ?- (b3 opp ) = hom?- b1,b3
proof end;

theorem Th66: :: ENS_1:66
for b1 being non empty set
for b2 being Category
for b3 being Object of b2 st Hom b2 c= b1 holds
(hom?? b1,b2) -? b3 = hom-? b1,b3
proof end;