:: ENDALG semantic presentation

definition
let UA be Universal_Algebra;
func UAEnd c1 -> FUNCTION_DOMAIN of the carrier of a1,the carrier of a1 means :Def1: :: ENDALG:def 1
for h being Function of UA,UA holds
( h in it iff h is_homomorphism UA,UA );
existence
ex b1 being FUNCTION_DOMAIN of the carrier of UA,the carrier of UA st
for h being Function of UA,UA holds
( h in b1 iff h is_homomorphism UA,UA )
proof end;
uniqueness
for b1, b2 being FUNCTION_DOMAIN of the carrier of UA,the carrier of UA st ( for h being Function of UA,UA holds
( h in b1 iff h is_homomorphism UA,UA ) ) & ( for h being Function of UA,UA holds
( h in b2 iff h is_homomorphism UA,UA ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def1 defines UAEnd ENDALG:def 1 :
for UA being Universal_Algebra
for b2 being FUNCTION_DOMAIN of the carrier of UA,the carrier of UA holds
( b2 = UAEnd UA iff for h being Function of UA,UA holds
( h in b2 iff h is_homomorphism UA,UA ) );

theorem Th1: :: ENDALG:1
for UA being Universal_Algebra holds UAEnd UA c= Funcs the carrier of UA,the carrier of UA
proof end;

theorem Th2: :: ENDALG:2
canceled;

theorem Th3: :: ENDALG:3
for UA being Universal_Algebra holds id the carrier of UA in UAEnd UA
proof end;

theorem Th4: :: ENDALG:4
for UA being Universal_Algebra
for f1, f2 being Element of UAEnd UA holds f1 * f2 in UAEnd UA
proof end;

definition
let UA be Universal_Algebra;
func UAEndComp c1 -> BinOp of UAEnd a1 means :Def2: :: ENDALG:def 2
for x, y being Element of UAEnd UA holds it . x,y = y * x;
existence
ex b1 being BinOp of UAEnd UA st
for x, y being Element of UAEnd UA holds b1 . x,y = y * x
proof end;
uniqueness
for b1, b2 being BinOp of UAEnd UA st ( for x, y being Element of UAEnd UA holds b1 . x,y = y * x ) & ( for x, y being Element of UAEnd UA holds b2 . x,y = y * x ) holds
b1 = b2
proof end;
end;

:: deftheorem Def2 defines UAEndComp ENDALG:def 2 :
for UA being Universal_Algebra
for b2 being BinOp of UAEnd UA holds
( b2 = UAEndComp UA iff for x, y being Element of UAEnd UA holds b2 . x,y = y * x );

definition
let UA be Universal_Algebra;
func UAEndMonoid c1 -> strict multLoopStr means :Def3: :: ENDALG:def 3
( the carrier of it = UAEnd UA & the mult of it = UAEndComp UA & the unity of it = id the carrier of UA );
existence
ex b1 being strict multLoopStr st
( the carrier of b1 = UAEnd UA & the mult of b1 = UAEndComp UA & the unity of b1 = id the carrier of UA )
proof end;
uniqueness
for b1, b2 being strict multLoopStr st the carrier of b1 = UAEnd UA & the mult of b1 = UAEndComp UA & the unity of b1 = id the carrier of UA & the carrier of b2 = UAEnd UA & the mult of b2 = UAEndComp UA & the unity of b2 = id the carrier of UA holds
b1 = b2
;
end;

:: deftheorem Def3 defines UAEndMonoid ENDALG:def 3 :
for UA being Universal_Algebra
for b2 being strict multLoopStr holds
( b2 = UAEndMonoid UA iff ( the carrier of b2 = UAEnd UA & the mult of b2 = UAEndComp UA & the unity of b2 = id the carrier of UA ) );

registration
let UA be Universal_Algebra;
cluster UAEndMonoid a1 -> non empty strict ;
coherence
not UAEndMonoid UA is empty
proof end;
end;

E67: now
let UA be Universal_Algebra;
set F = UAEndMonoid UA;
let x be Element of (UAEndMonoid UA), e be Element of (UAEndMonoid UA);
assume E32: e = id the carrier of UA ;
reconsider i = e, y = x as Element of UAEnd UA by ;
thus x * e = (UAEndComp UA) . y,i by
.= i * y by
.= x by , FUNCT_2:23 ;
thus e * x = (UAEndComp UA) . i,y by
.= y * i by
.= x by , FUNCT_2:23 ;
end;

registration
let UA be Universal_Algebra;
cluster UAEndMonoid a1 -> non empty unital associative strict ;
coherence
( UAEndMonoid UA is unital & UAEndMonoid UA is associative )
proof end;
end;

theorem Th5: :: ENDALG:5
for UA being Universal_Algebra
for x, y being Element of (UAEndMonoid UA)
for f, g being Element of UAEnd UA st x = f & y = g holds
x * y = g * f
proof end;

theorem Th6: :: ENDALG:6
for UA being Universal_Algebra holds id the carrier of UA = 1. (UAEndMonoid UA)
proof end;

definition
let S be non empty non void ManySortedSign ;
let U1 be non-empty MSAlgebra of S;
func MSAEnd c2 -> MSFunctionSet of the Sorts of a2,the Sorts of a2 means :Def4: :: ENDALG:def 4
( ( for f being Element of it holds f is ManySortedFunction of U1,U1 ) & ( for h being ManySortedFunction of U1,U1 holds
( h in it iff h is_homomorphism U1,U1 ) ) );
existence
ex b1 being MSFunctionSet of the Sorts of U1,the Sorts of U1 st
( ( for f being Element of b1 holds f is ManySortedFunction of U1,U1 ) & ( for h being ManySortedFunction of U1,U1 holds
( h in b1 iff h is_homomorphism U1,U1 ) ) )
proof end;
uniqueness
for b1, b2 being MSFunctionSet of the Sorts of U1,the Sorts of U1 st ( for f being Element of b1 holds f is ManySortedFunction of U1,U1 ) & ( for h being ManySortedFunction of U1,U1 holds
( h in b1 iff h is_homomorphism U1,U1 ) ) & ( for f being Element of b2 holds f is ManySortedFunction of U1,U1 ) & ( for h being ManySortedFunction of U1,U1 holds
( h in b2 iff h is_homomorphism U1,U1 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def4 defines MSAEnd ENDALG:def 4 :
for S being non empty non void ManySortedSign
for U1 being non-empty MSAlgebra of S
for b3 being MSFunctionSet of the Sorts of U1,the Sorts of U1 holds
( b3 = MSAEnd U1 iff ( ( for f being Element of b3 holds f is ManySortedFunction of U1,U1 ) & ( for h being ManySortedFunction of U1,U1 holds
( h in b3 iff h is_homomorphism U1,U1 ) ) ) );

theorem Th7: :: ENDALG:7
canceled;

theorem Th8: :: ENDALG:8
canceled;

theorem Th9: :: ENDALG:9
for S being non empty non void ManySortedSign
for U1 being non-empty MSAlgebra of S holds MSAEnd U1 c= product (MSFuncs the Sorts of U1,the Sorts of U1)
proof end;

theorem Th10: :: ENDALG:10
for S being non empty non void ManySortedSign
for U1 being non-empty MSAlgebra of S holds id the Sorts of U1 in MSAEnd U1
proof end;

theorem Th11: :: ENDALG:11
for S being non empty non void ManySortedSign
for U1 being non-empty MSAlgebra of S
for f1, f2 being Element of MSAEnd U1 holds f1 ** f2 in MSAEnd U1
proof end;

theorem Th12: :: ENDALG:12
for UA being Universal_Algebra
for F being ManySortedFunction of (MSAlg UA),(MSAlg UA)
for f being Element of UAEnd UA st F = {0} --> f holds
F in MSAEnd (MSAlg UA)
proof end;

definition
let S be non empty non void ManySortedSign ;
let U1 be non-empty MSAlgebra of S;
func MSAEndComp c2 -> BinOp of MSAEnd a2 means :Def5: :: ENDALG:def 5
for x, y being Element of MSAEnd U1 holds it . x,y = y ** x;
existence
ex b1 being BinOp of MSAEnd U1 st
for x, y being Element of MSAEnd U1 holds b1 . x,y = y ** x
proof end;
uniqueness
for b1, b2 being BinOp of MSAEnd U1 st ( for x, y being Element of MSAEnd U1 holds b1 . x,y = y ** x ) & ( for x, y being Element of MSAEnd U1 holds b2 . x,y = y ** x ) holds
b1 = b2
proof end;
end;

:: deftheorem Def5 defines MSAEndComp ENDALG:def 5 :
for S being non empty non void ManySortedSign
for U1 being non-empty MSAlgebra of S
for b3 being BinOp of MSAEnd U1 holds
( b3 = MSAEndComp U1 iff for x, y being Element of MSAEnd U1 holds b3 . x,y = y ** x );

definition
let S be non empty non void ManySortedSign ;
let U1 be non-empty MSAlgebra of S;
func MSAEndMonoid c2 -> strict multLoopStr means :Def6: :: ENDALG:def 6
( the carrier of it = MSAEnd U1 & the mult of it = MSAEndComp U1 & the unity of it = id the Sorts of U1 );
existence
ex b1 being strict multLoopStr st
( the carrier of b1 = MSAEnd U1 & the mult of b1 = MSAEndComp U1 & the unity of b1 = id the Sorts of U1 )
proof end;
uniqueness
for b1, b2 being strict multLoopStr st the carrier of b1 = MSAEnd U1 & the mult of b1 = MSAEndComp U1 & the unity of b1 = id the Sorts of U1 & the carrier of b2 = MSAEnd U1 & the mult of b2 = MSAEndComp U1 & the unity of b2 = id the Sorts of U1 holds
b1 = b2
;
end;

:: deftheorem Def6 defines MSAEndMonoid ENDALG:def 6 :
for S being non empty non void ManySortedSign
for U1 being non-empty MSAlgebra of S
for b3 being strict multLoopStr holds
( b3 = MSAEndMonoid U1 iff ( the carrier of b3 = MSAEnd U1 & the mult of b3 = MSAEndComp U1 & the unity of b3 = id the Sorts of U1 ) );

registration
let S be non empty non void ManySortedSign ;
let U1 be non-empty MSAlgebra of S;
cluster MSAEndMonoid a2 -> non empty strict ;
coherence
not MSAEndMonoid U1 is empty
proof end;
end;

E85: now
let S be non empty non void ManySortedSign ;
let U1 be non-empty MSAlgebra of S;
set F = MSAEndMonoid U1;
let x be Element of (MSAEndMonoid U1), e be Element of (MSAEndMonoid U1);
assume E32: e = id the Sorts of U1 ;
reconsider i = e, y = x as Element of MSAEnd U1 by ;
thus x * e = (MSAEndComp U1) . y,i by
.= i ** y by
.= x by , MSUALG_3:4 ;
thus e * x = (MSAEndComp U1) . i,y by
.= y ** i by
.= x by , MSUALG_3:3 ;
end;

registration
let S be non empty non void ManySortedSign ;
let U1 be non-empty MSAlgebra of S;
cluster MSAEndMonoid a2 -> non empty unital associative strict ;
coherence
( MSAEndMonoid U1 is unital & MSAEndMonoid U1 is associative )
proof end;
end;

theorem Th13: :: ENDALG:13
for S being non empty non void ManySortedSign
for U1 being non-empty MSAlgebra of S
for x, y being Element of (MSAEndMonoid U1)
for f, g being Element of MSAEnd U1 st x = f & y = g holds
x * y = g ** f
proof end;

theorem Th14: :: ENDALG:14
for S being non empty non void ManySortedSign
for U1 being non-empty MSAlgebra of S holds id the Sorts of U1 = 1. (MSAEndMonoid U1)
proof end;

theorem Th15: :: ENDALG:15
canceled;

theorem Th16: :: ENDALG:16
for UA being Universal_Algebra
for f being Element of UAEnd UA holds {0} --> f is ManySortedFunction of (MSAlg UA),(MSAlg UA)
proof end;

Lemma89: for UA being Universal_Algebra
for h being Function st dom h = UAEnd UA & ( for x being set st x in UAEnd UA holds
h . x = {0} --> x ) holds
rng h = MSAEnd (MSAlg UA)
proof end;

definition
let G be non empty multLoopStr , H be non empty multLoopStr ;
let IT be Function of G,H;
canceled;
attr a3 is unity-preserving means :Def8: :: ENDALG:def 8
IT . (1. G) = 1. H;
end;

:: deftheorem Def7 ENDALG:def 7 :
canceled;

:: deftheorem Def8 defines unity-preserving ENDALG:def 8 :
for G, H being non empty multLoopStr
for IT being Function of G,H holds
( IT is unity-preserving iff IT . (1. G) = 1. H );

registration
cluster non empty left_unital multLoopStr ;
existence
ex b1 being non empty multLoopStr st b1 is left_unital
proof end;
end;

registration
let G be non empty left_unital multLoopStr , H be non empty left_unital multLoopStr ;
cluster multiplicative unity-preserving M4(the carrier of a1,the carrier of a2);
existence
ex b1 being Function of G,H st
( b1 is multiplicative & b1 is unity-preserving )
proof end;
end;

definition
let G be non empty left_unital multLoopStr , H be non empty left_unital multLoopStr ;
mode Homomorphism of a1,a2 is multiplicative unity-preserving Function of a1,a2;
end;

definition
let G be non empty left_unital multLoopStr , H be non empty left_unital multLoopStr ;
let h be Function of G,H;
pred c3 is_monomorphism means :Def9: :: ENDALG:def 9
h is one-to-one;
pred c3 is_epimorphism means :Def10: :: ENDALG:def 10
rng h = the carrier of H;
end;

:: deftheorem Def9 defines is_monomorphism ENDALG:def 9 :
for G, H being non empty left_unital multLoopStr
for h being Function of G,H holds
( h is_monomorphism iff h is one-to-one );

:: deftheorem Def10 defines is_epimorphism ENDALG:def 10 :
for G, H being non empty left_unital multLoopStr
for h being Function of G,H holds
( h is_epimorphism iff rng h = the carrier of H );

definition
let G be non empty left_unital multLoopStr , H be non empty left_unital multLoopStr ;
let h be Function of G,H;
pred c3 is_isomorphism means :Def11: :: ENDALG:def 11
( h is_epimorphism & h is_monomorphism );
end;

:: deftheorem Def11 defines is_isomorphism ENDALG:def 11 :
for G, H being non empty left_unital multLoopStr
for h being Function of G,H holds
( h is_isomorphism iff ( h is_epimorphism & h is_monomorphism ) );

theorem Th17: :: ENDALG:17
for G being non empty left_unital multLoopStr holds id the carrier of G is Homomorphism of G,G
proof end;

definition
let G be non empty left_unital multLoopStr , H be non empty left_unital multLoopStr ;
pred c1,c2 are_isomorphic means :Def12: :: ENDALG:def 12
ex h being Homomorphism of G,H st h is_isomorphism ;
reflexivity
for G being non empty left_unital multLoopStr ex h being Homomorphism of G,G st h is_isomorphism
proof end;
end;

:: deftheorem Def12 defines are_isomorphic ENDALG:def 12 :
for G, H being non empty left_unital multLoopStr holds
( G,H are_isomorphic iff ex h being Homomorphism of G,H st h is_isomorphism );

theorem Th18: :: ENDALG:18
for UA being Universal_Algebra
for h being Function st dom h = UAEnd UA & ( for x being set st x in UAEnd UA holds
h . x = {0} --> x ) holds
h is Homomorphism of (UAEndMonoid UA),(MSAEndMonoid (MSAlg UA))
proof end;

theorem Th19: :: ENDALG:19
for UA being Universal_Algebra
for h being Homomorphism of (UAEndMonoid UA),(MSAEndMonoid (MSAlg UA)) st ( for x being set st x in UAEnd UA holds
h . x = {0} --> x ) holds
h is_isomorphism
proof end;

theorem Th20: :: ENDALG:20
for UA being Universal_Algebra holds UAEndMonoid UA, MSAEndMonoid (MSAlg UA) are_isomorphic
proof end;