:: MSUALG_9 semantic presentation

scheme :: MSUALG_9:sch 1
s1{ F1() -> non empty set , P1[ set , set ] } :
ex b1 being ManySortedSet of F1() st
for b2 being Element of F1() holds P1[b2,b1 . b2]
provided
E1: for b1 being Element of F1() ex b2 being set st P1[b1,b2]
proof end;

registration
let c1 be set ;
let c2 be ManySortedSet of c1;
cluster locally-finite Element of Bool a2;
existence
ex b1 being Element of Bool c2 st b1 is locally-finite
proof end;
end;

registration
let c1 be set ;
let c2 be V2 ManySortedSet of c1;
cluster V2 locally-finite ManySortedSubset of a2;
existence
ex b1 being ManySortedSubset of c2 st
( b1 is non-empty & b1 is locally-finite )
proof end;
end;

registration
let c1 be non empty non void ManySortedSign ;
let c2 be non-empty MSAlgebra of c1;
let c3 be OperSymbol of c1;
cluster -> FinSequence-like Element of Args a3,a2;
coherence
for b1 being Element of Args c3,c2 holds b1 is FinSequence-like
proof end;
end;

registration
let c1 be non empty non void ManySortedSign ;
let c2 be set ;
let c3 be SortSymbol of c1;
let c4 be MSAlgebra-Family of c2,c1;
cluster -> Relation-like Function-like Element of (SORTS a4) . a3;
coherence
for b1 being Element of (SORTS c4) . c3 holds
( b1 is Function-like & b1 is Relation-like )
proof end;
end;

registration
let c1 be non empty non void ManySortedSign ;
let c2 be V2 ManySortedSet of the carrier of c1;
cluster FreeGen a2 -> V2 free ;
coherence
( FreeGen c2 is free & FreeGen c2 is non-empty )
by MSAFREE:15, MSAFREE:17;
end;

registration
let c1 be non empty non void ManySortedSign ;
let c2 be V2 ManySortedSet of the carrier of c1;
cluster FreeMSA a2 -> free ;
coherence
FreeMSA c2 is free
by MSAFREE:18;
end;

registration
let c1 be non empty non void ManySortedSign ;
let c2, c3 be non-empty MSAlgebra of c1;
cluster [:a2,a3:] -> non-empty ;
coherence
[:c2,c3:] is non-empty
proof end;
end;

theorem Th1: :: MSUALG_9:1
for b1, b2, b3 being set
for b4 being Function st b1 in dom b4 & b4 . b1 in [:b2,b3:] holds
b4 . b1 = [((pr1 b4) . b1),((pr2 b4) . b1)]
proof end;

theorem Th2: :: MSUALG_9:2
for b1 being non empty set
for b2 being set
for b3 being Function of b1,{b2} holds rng b3 = {b2}
proof end;

theorem Th3: :: MSUALG_9:3
for b1 being non empty finite set ex b2 being Function of NAT ,b1 st rng b2 = b1
proof end;

theorem Th4: :: MSUALG_9:4
for b1 being set holds Class (nabla b1) c= {b1}
proof end;

theorem Th5: :: MSUALG_9:5
for b1 being non empty set holds Class (nabla b1) = {b1}
proof end;

theorem Th6: :: MSUALG_9:6
for b1, b2 being set ex b3 being ManySortedSet of b1 st {b3} = b1 --> {b2}
proof end;

theorem Th7: :: MSUALG_9:7
for b1 being set
for b2 being ManySortedSet of b1 ex b3 being V2 ManySortedSet of b1 st b2 c= b3
proof end;

theorem Th8: :: MSUALG_9:8
for b1 being set
for b2 being V2 ManySortedSet of b1
for b3 being locally-finite ManySortedSubset of b2 ex b4 being V2 locally-finite ManySortedSubset of b2 st b3 c= b4
proof end;

theorem Th9: :: MSUALG_9:9
for b1 being set
for b2, b3 being ManySortedSet of b1
for b4, b5 being ManySortedFunction of b2,{b3} holds b4 = b5
proof end;

theorem Th10: :: MSUALG_9:10
for b1 being set
for b2 being V2 ManySortedSet of b1
for b3 being ManySortedSet of b1
for b4 being ManySortedFunction of b2,{b3} holds b4 is "onto"
proof end;

theorem Th11: :: MSUALG_9:11
for b1 being set
for b2 being ManySortedSet of b1
for b3 being V2 ManySortedSet of b1
for b4 being ManySortedFunction of {b2},b3 holds b4 is "1-1"
proof end;

theorem Th12: :: MSUALG_9:12
for b1 being non empty non void ManySortedSign
for b2 being V2 ManySortedSet of the carrier of b1 holds Reverse b2 is "1-1"
proof end;

theorem Th13: :: MSUALG_9:13
for b1 being set
for b2 being V2 locally-finite ManySortedSet of b1 ex b3 being ManySortedFunction of b1 --> NAT ,b2 st b3 is "onto"
proof end;

theorem Th14: :: MSUALG_9:14
for b1 being non empty ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3, b4 being Element of product the Sorts of b2 st ( for b5 being set holds (proj the Sorts of b2,b5) . b3 = (proj the Sorts of b2,b5) . b4 ) holds
b3 = b4
proof end;

theorem Th15: :: MSUALG_9:15
for b1 being non empty non void ManySortedSign
for b2 being non empty set
for b3 being Element of b1
for b4 being MSAlgebra-Family of b2,b1
for b5, b6 being Element of product (Carrier b4,b3) st ( for b7 being Element of b2 holds (proj (Carrier b4,b3),b7) . b5 = (proj (Carrier b4,b3),b7) . b6 ) holds
b5 = b6
proof end;

theorem Th16: :: MSUALG_9:16
for b1 being non empty non void ManySortedSign
for b2, b3 being non-empty MSAlgebra of b1
for b4 being non-empty MSSubAlgebra of b2
for b5 being ManySortedFunction of b3,b4 st b5 is_homomorphism b3,b4 holds
for b6 being ManySortedFunction of b3,b2 st b5 = b6 holds
b6 is_homomorphism b3,b2
proof end;

theorem Th17: :: MSUALG_9:17
for b1 being non empty non void ManySortedSign
for b2, b3 being non-empty MSAlgebra of b1
for b4 being ManySortedFunction of b2,b3 st b4 is_monomorphism b2,b3 holds
b2, Image b4 are_isomorphic
proof end;

theorem Th18: :: MSUALG_9:18
for b1 being non empty non void ManySortedSign
for b2, b3 being non-empty MSAlgebra of b1
for b4 being ManySortedFunction of b2,b3 st b4 is "onto" holds
for b5 being OperSymbol of b1
for b6 being Element of Args b5,b3 ex b7 being Element of Args b5,b2 st b4 # b7 = b6
proof end;

theorem Th19: :: MSUALG_9:19
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being OperSymbol of b1
for b4 being Element of Args b3,b2 holds (Den b3,b2) . b4 in the Sorts of b2 . (the_result_sort_of b3)
proof end;

theorem Th20: :: MSUALG_9:20
for b1 being non empty non void ManySortedSign
for b2, b3, b4 being non-empty MSAlgebra of b1
for b5 being ManySortedFunction of b2,b3
for b6 being ManySortedFunction of b2,b4 st b5 is_epimorphism b2,b3 & b6 is_homomorphism b2,b4 holds
for b7 being ManySortedFunction of b3,b4 st b7 ** b5 = b6 holds
b7 is_homomorphism b3,b4
proof end;

definition
let c1 be set ;
let c2 be ManySortedSet of c1;
let c3, c4 be V2 ManySortedSet of c1;
let c5 be ManySortedFunction of c2,[|c3,c4|];
func Mpr1 c5 -> ManySortedFunction of a2,a3 means :Def1: :: MSUALG_9:def 1
for b1 being set st b1 in a1 holds
a6 . b1 = pr1 (a5 . b1);
existence
ex b1 being ManySortedFunction of c2,c3 st
for b2 being set st b2 in c1 holds
b1 . b2 = pr1 (c5 . b2)
proof end;
uniqueness
for b1, b2 being ManySortedFunction of c2,c3 st ( for b3 being set st b3 in c1 holds
b1 . b3 = pr1 (c5 . b3) ) & ( for b3 being set st b3 in c1 holds
b2 . b3 = pr1 (c5 . b3) ) holds
b1 = b2
proof end;
func Mpr2 c5 -> ManySortedFunction of a2,a4 means :Def2: :: MSUALG_9:def 2
for b1 being set st b1 in a1 holds
a6 . b1 = pr2 (a5 . b1);
existence
ex b1 being ManySortedFunction of c2,c4 st
for b2 being set st b2 in c1 holds
b1 . b2 = pr2 (c5 . b2)
proof end;
uniqueness
for b1, b2 being ManySortedFunction of c2,c4 st ( for b3 being set st b3 in c1 holds
b1 . b3 = pr2 (c5 . b3) ) & ( for b3 being set st b3 in c1 holds
b2 . b3 = pr2 (c5 . b3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def1 defines Mpr1 MSUALG_9:def 1 :
for b1 being set
for b2 being ManySortedSet of b1
for b3, b4 being V2 ManySortedSet of b1
for b5 being ManySortedFunction of b2,[|b3,b4|]
for b6 being ManySortedFunction of b2,b3 holds
( b6 = Mpr1 b5 iff for b7 being set st b7 in b1 holds
b6 . b7 = pr1 (b5 . b7) );

:: deftheorem Def2 defines Mpr2 MSUALG_9:def 2 :
for b1 being set
for b2 being ManySortedSet of b1
for b3, b4 being V2 ManySortedSet of b1
for b5 being ManySortedFunction of b2,[|b3,b4|]
for b6 being ManySortedFunction of b2,b4 holds
( b6 = Mpr2 b5 iff for b7 being set st b7 in b1 holds
b6 . b7 = pr2 (b5 . b7) );

theorem Th21: :: MSUALG_9:21
for b1, b2 being set
for b3 being ManySortedSet of b1
for b4 being ManySortedFunction of b3,[|(b1 --> {b2}),(b1 --> {b2})|] holds Mpr1 b4 = Mpr2 b4
proof end;

theorem Th22: :: MSUALG_9:22
for b1 being set
for b2 being ManySortedSet of b1
for b3, b4 being V2 ManySortedSet of b1
for b5 being ManySortedFunction of b2,[|b3,b4|] st b5 is "onto" holds
Mpr1 b5 is "onto"
proof end;

theorem Th23: :: MSUALG_9:23
for b1 being set
for b2 being ManySortedSet of b1
for b3, b4 being V2 ManySortedSet of b1
for b5 being ManySortedFunction of b2,[|b3,b4|] st b5 is "onto" holds
Mpr2 b5 is "onto"
proof end;

theorem Th24: :: MSUALG_9:24
for b1 being set
for b2, b3 being ManySortedSet of b1
for b4, b5 being V2 ManySortedSet of b1
for b6 being ManySortedFunction of b2,[|b4,b5|] st b3 in doms b6 holds
for b7 being set st b7 in b1 holds
(b6 .. b3) . b7 = [(((Mpr1 b6) .. b3) . b7),(((Mpr2 b6) .. b3) . b7)]
proof end;

registration
let c1 be non empty ManySortedSign ;
cluster the Sorts of (Trivial_Algebra a1) -> V2 locally-finite ;
coherence
( the Sorts of (Trivial_Algebra c1) is locally-finite & the Sorts of (Trivial_Algebra c1) is non-empty )
proof end;
end;

registration
let c1 be non empty ManySortedSign ;
cluster Trivial_Algebra a1 -> non-empty locally-finite ;
coherence
( Trivial_Algebra c1 is locally-finite & Trivial_Algebra c1 is non-empty )
proof end;
end;

theorem Th25: :: MSUALG_9:25
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being ManySortedFunction of b2,(Trivial_Algebra b1)
for b4 being OperSymbol of b1
for b5 being Element of Args b4,b2 holds
( (b3 . (the_result_sort_of b4)) . ((Den b4,b2) . b5) = 0 & (Den b4,(Trivial_Algebra b1)) . (b3 # b5) = 0 )
proof end;

theorem Th26: :: MSUALG_9:26
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being ManySortedFunction of b2,(Trivial_Algebra b1) holds b3 is_epimorphism b2, Trivial_Algebra b1
proof end;

theorem Th27: :: MSUALG_9:27
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1 st ex b3 being ManySortedSet of the carrier of b1 st the Sorts of b2 = {b3} holds
b2, Trivial_Algebra b1 are_isomorphic
proof end;

theorem Th28: :: MSUALG_9:28
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being MSCongruence of b2 holds b3 is ManySortedSubset of [|the Sorts of b2,the Sorts of b2|]
proof end;

theorem Th29: :: MSUALG_9:29
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being Subset of (CongrLatt b2)
for b4 being SubsetFamily of [|the Sorts of b2,the Sorts of b2|] st b3 = b4 holds
meet |:b4:| is MSCongruence of b2
proof end;

theorem Th30: :: MSUALG_9:30
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being MSCongruence of b2 st b3 = [|the Sorts of b2,the Sorts of b2|] holds
the Sorts of (QuotMSAlg b2,b3) = {the Sorts of b2}
proof end;

theorem Th31: :: MSUALG_9:31
for b1 being non empty non void ManySortedSign
for b2, b3 being non-empty MSAlgebra of b1
for b4 being ManySortedFunction of b2,b3 st b4 is_homomorphism b2,b3 holds
(MSHomQuot b4) ** (MSNat_Hom b2,(MSCng b4)) = b4
proof end;

theorem Th32: :: MSUALG_9:32
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being MSCongruence of b2
for b4 being SortSymbol of b1
for b5 being Element of the Sorts of (QuotMSAlg b2,b3) . b4 ex b6 being Element of the Sorts of b2 . b4 st b5 = Class b3,b6
proof end;

theorem Th33: :: MSUALG_9:33
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3, b4 being MSEquivalence-like ManySortedRelation of b2 st b3 c= b4 holds
for b5 being Element of b1
for b6, b7 being Element of the Sorts of b2 . b5 st [b6,b7] in b3 . b5 holds
( Class b3,b6 c= Class b4,b7 & ( b2 is non-empty implies Class b3,b7 c= Class b4,b6 ) )
proof end;

theorem Th34: :: MSUALG_9:34
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being MSCongruence of b2
for b4 being SortSymbol of b1
for b5, b6 being Element of the Sorts of b2 . b4 holds
( ((MSNat_Hom b2,b3) . b4) . b5 = ((MSNat_Hom b2,b3) . b4) . b6 iff [b5,b6] in b3 . b4 )
proof end;

E17: now
let c1 be non empty non void ManySortedSign ;
let c2 be non-empty MSAlgebra of c1;
let c3, c4 be MSCongruence of c2;
let c5 be ManySortedFunction of (QuotMSAlg c2,c3),(QuotMSAlg c2,c4);
assume E18: for b1 being Element of c1
for b2 being Element of the Sorts of (QuotMSAlg c2,c3) . b1
for b3 being Element of the Sorts of c2 . b1 st b2 = Class c3,b3 holds
(c5 . b1) . b2 = Class c4,b3 ;
thus c5 is "onto"
proof
set c6 = the Sorts of (QuotMSAlg c2,c3);
set c7 = the Sorts of (QuotMSAlg c2,c4);
let c8 be set ; :: according to MSUALG_3:def 3
assume c8 in the carrier of c1 ;
then reconsider c9 = c8 as SortSymbol of c1 ;
rng (c5 . c9) c= the Sorts of (QuotMSAlg c2,c4) . c9 by RELSET_1:12;
hence rng (c5 . c8) c= the Sorts of (QuotMSAlg c2,c4) . c8 ; :: according to XBOOLE_0:def 10
let c10 be set ; :: according to TARSKI:def 3
assume E19: c10 in the Sorts of (QuotMSAlg c2,c4) . c8 ;
c10 in Class (c4 . c9) by E19, MSUALG_4:def 8;
then consider c11 being set such that
E20: c11 in the Sorts of c2 . c9 and
E21: c10 = Class (c4 . c9),c11 by EQREL_1:def 5;
reconsider c12 = c11 as Element of the Sorts of c2 . c9 by E20;
E22: dom (c5 . c9) = the Sorts of (QuotMSAlg c2,c3) . c9 by FUNCT_2:def 1;
Class (c3 . c9),c12 in Class (c3 . c9) by EQREL_1:def 5;
then Class c3,c12 in Class (c3 . c9) ;
then reconsider c13 = Class c3,c12 as Element of the Sorts of (QuotMSAlg c2,c3) . c9 by MSUALG_4:def 8;
(c5 . c9) . c13 = Class c4,c12 by E18
.= Class (c4 . c9),c12 ;
hence c10 in rng (c5 . c8) by E21, E22, FUNCT_1:def 5;
end;
end;

theorem Th35: :: MSUALG_9:35
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3, b4 being MSCongruence of b2
for b5 being ManySortedFunction of (QuotMSAlg b2,b3),(QuotMSAlg b2,b4) st ( for b6 being Element of b1
for b7 being Element of the Sorts of (QuotMSAlg b2,b3) . b6
for b8 being Element of the Sorts of b2 . b6 st b7 = Class b3,b8 holds
(b5 . b6) . b7 = Class b4,b8 ) holds
b5 ** (MSNat_Hom b2,b3) = MSNat_Hom b2,b4
proof end;

theorem Th36: :: MSUALG_9:36
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3, b4 being MSCongruence of b2
for b5 being ManySortedFunction of (QuotMSAlg b2,b3),(QuotMSAlg b2,b4) st ( for b6 being Element of b1
for b7 being Element of the Sorts of (QuotMSAlg b2,b3) . b6
for b8 being Element of the Sorts of b2 . b6 st b7 = Class b3,b8 holds
(b5 . b6) . b7 = Class b4,b8 ) holds
b5 is_epimorphism QuotMSAlg b2,b3, QuotMSAlg b2,b4
proof end;

theorem Th37: :: MSUALG_9:37
for b1 being non empty non void ManySortedSign
for b2, b3 being non-empty MSAlgebra of b1
for b4 being ManySortedFunction of b2,b3 st b4 is_homomorphism b2,b3 holds
for b5 being MSCongruence of b2 st b5 c= MSCng b4 holds
ex b6 being ManySortedFunction of (QuotMSAlg b2,b5),b3 st
( b6 is_homomorphism QuotMSAlg b2,b5,b3 & b4 = b6 ** (MSNat_Hom b2,b5) )
proof end;