:: EQUATION semantic presentation

theorem Th1: :: EQUATION:1
for b1 being set
for b2, b3 being non empty set
for b4 being Function of b1,b2
for b5 being Function of b2,b3 st rng (b5 * b4) = b3 holds
rng b5 = b3
proof end;

theorem Th2: :: EQUATION: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
for b6 being ManySortedFunction of b3,b4 st b6 ** b5 is "onto" holds
b6 is "onto"
proof end;

theorem Th3: :: EQUATION:3
for b1, b2 being non empty set
for b3, b4 being set
for b5 being Function st b5 in Funcs b1,(Funcs b2,b3) & b4 in b2 holds
( dom ((commute b5) . b4) = b1 & rng ((commute b5) . b4) c= b3 )
proof end;

theorem Th4: :: EQUATION:4
canceled;

theorem Th5: :: EQUATION:5
for b1 being set
for b2, b3 being ManySortedSet of b1 st b2 is_transformable_to b3 holds
for b4 being ManySortedFunction of b1 st doms b4 = b2 & rngs b4 c= b3 holds
b4 is ManySortedFunction of b2,b3
proof end;

theorem Th6: :: EQUATION:6
for b1 being set
for b2, b3 being ManySortedSet of b1
for b4 being ManySortedFunction of b2,b3
for b5, b6 being ManySortedSubset of b2
for b7 being ManySortedSubset of b5 st b6 = b7 holds
(b4 || b5) || b7 = b4 || b6
proof end;

theorem Th7: :: EQUATION:7
for b1 being set
for b2 being V2 ManySortedSet of b1
for b3 being ManySortedSet of b1
for b4 being ManySortedSubset of b3
for b5 being ManySortedFunction of b4,b2 ex b6 being ManySortedFunction of b3,b2 st b6 || b4 = b5
proof end;

definition
let c1 be set ;
let c2 be ManySortedSet of c1;
let c3 be ManySortedFunction of c1;
func c3 "" c2 -> ManySortedSet of a1 means :Def1: :: EQUATION:def 1
for b1 being set st b1 in a1 holds
a4 . b1 = (a3 . b1) " (a2 . b1);
existence
ex b1 being ManySortedSet of c1 st
for b2 being set st b2 in c1 holds
b1 . b2 = (c3 . b2) " (c2 . b2)
proof end;
uniqueness
for b1, b2 being ManySortedSet of c1 st ( for b3 being set st b3 in c1 holds
b1 . b3 = (c3 . b3) " (c2 . b3) ) & ( for b3 being set st b3 in c1 holds
b2 . b3 = (c3 . b3) " (c2 . b3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def1 defines "" EQUATION:def 1 :
for b1 being set
for b2 being ManySortedSet of b1
for b3 being ManySortedFunction of b1
for b4 being ManySortedSet of b1 holds
( b4 = b3 "" b2 iff for b5 being set st b5 in b1 holds
b4 . b5 = (b3 . b5) " (b2 . b5) );

theorem Th8: :: EQUATION:8
for b1 being set
for b2, b3, b4 being ManySortedSet of b1
for b5 being ManySortedFunction of b2,b3 holds b5 .:.: b4 is ManySortedSubset of b3
proof end;

theorem Th9: :: EQUATION:9
for b1 being set
for b2, b3, b4 being ManySortedSet of b1
for b5 being ManySortedFunction of b2,b3 holds b5 "" b4 is ManySortedSubset of b2
proof end;

theorem Th10: :: EQUATION:10
for b1 being set
for b2, b3 being ManySortedSet of b1
for b4 being ManySortedFunction of b2,b3 st b4 is "onto" holds
b4 .:.: b2 = b3
proof end;

theorem Th11: :: EQUATION:11
for b1 being set
for b2, b3 being ManySortedSet of b1
for b4 being ManySortedFunction of b2,b3 st b2 is_transformable_to b3 holds
b4 "" b3 = b2
proof end;

theorem Th12: :: EQUATION:12
for b1 being set
for b2 being ManySortedSet of b1
for b3 being ManySortedFunction of b1 st b2 c= rngs b3 holds
b3 .:.: (b3 "" b2) = b2
proof end;

theorem Th13: :: EQUATION:13
for b1 being set
for b2 being ManySortedFunction of b1
for b3 being ManySortedSet of b1 holds b2 .:.: b3 c= rngs b2
proof end;

theorem Th14: :: EQUATION:14
for b1 being set
for b2 being ManySortedFunction of b1 holds b2 .:.: (doms b2) = rngs b2
proof end;

theorem Th15: :: EQUATION:15
for b1 being set
for b2 being ManySortedFunction of b1 holds b2 "" (rngs b2) = doms b2
proof end;

theorem Th16: :: EQUATION:16
for b1 being set
for b2 being ManySortedSet of b1 holds (id b2) .:.: b2 = b2
proof end;

theorem Th17: :: EQUATION:17
for b1 being set
for b2 being ManySortedSet of b1 holds (id b2) "" b2 = b2
proof end;

theorem Th18: :: EQUATION:18
canceled;

theorem Th19: :: EQUATION:19
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1 holds b2 is MSSubAlgebra of MSAlgebra(# the Sorts of b2,the Charact of b2 #)
proof end;

theorem Th20: :: EQUATION:20
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being MSSubAlgebra of b2
for b4 being OperSymbol of b1
for b5 being set st b5 in Args b4,b3 holds
b5 in Args b4,b2
proof end;

theorem Th21: :: EQUATION:21
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being MSSubAlgebra of b2
for b4 being OperSymbol of b1
for b5 being set st b5 in Args b4,b3 holds
(Den b4,b3) . b5 = (Den b4,b2) . b5
proof end;

theorem Th22: :: EQUATION:22
for b1 being set
for b2 being non empty non void ManySortedSign
for b3 being MSAlgebra-Family of b1,b2
for b4 being MSSubAlgebra of product b3
for b5 being OperSymbol of b2
for b6 being set st b6 in Args b5,b4 holds
( (Den b5,b4) . b6 is Function & (Den b5,(product b3)) . b6 is Function )
proof end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
let c3 be MSSubAlgebra of c2;
func SuperAlgebraSet c3 -> set means :Def2: :: EQUATION:def 2
for b1 being set holds
( b1 in a4 iff ex b2 being strict MSSubAlgebra of a2 st
( b1 = b2 & a3 is MSSubAlgebra of b2 ) );
existence
ex b1 being set st
for b2 being set holds
( b2 in b1 iff ex b3 being strict MSSubAlgebra of c2 st
( b2 = b3 & c3 is MSSubAlgebra of b3 ) )
proof end;
uniqueness
for b1, b2 being set st ( for b3 being set holds
( b3 in b1 iff ex b4 being strict MSSubAlgebra of c2 st
( b3 = b4 & c3 is MSSubAlgebra of b4 ) ) ) & ( for b3 being set holds
( b3 in b2 iff ex b4 being strict MSSubAlgebra of c2 st
( b3 = b4 & c3 is MSSubAlgebra of b4 ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def2 defines SuperAlgebraSet EQUATION:def 2 :
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being MSSubAlgebra of b2
for b4 being set holds
( b4 = SuperAlgebraSet b3 iff for b5 being set holds
( b5 in b4 iff ex b6 being strict MSSubAlgebra of b2 st
( b5 = b6 & b3 is MSSubAlgebra of b6 ) ) );

registration
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
let c3 be MSSubAlgebra of c2;
cluster SuperAlgebraSet a3 -> non empty ;
coherence
not SuperAlgebraSet c3 is empty
proof end;
end;

registration
let c1 be non empty non void ManySortedSign ;
cluster strict non-empty free MSAlgebra of a1;
existence
ex b1 being MSAlgebra of c1 st
( b1 is strict & b1 is non-empty & b1 is free )
proof end;
end;

registration
let c1 be non empty non void ManySortedSign ;
let c2 be non-empty MSAlgebra of c1;
let c3 be V2 locally-finite MSSubset of c2;
cluster GenMSAlg a3 -> finitely-generated ;
coherence
GenMSAlg c3 is finitely-generated
proof end;
end;

registration
let c1 be non empty non void ManySortedSign ;
let c2 be non-empty MSAlgebra of c1;
cluster strict non-empty finitely-generated MSSubAlgebra of a2;
existence
ex b1 being MSSubAlgebra of c2 st
( b1 is strict & b1 is non-empty & b1 is finitely-generated )
proof end;
end;

registration
let c1 be non empty non void ManySortedSign ;
let c2 be feasible MSAlgebra of c1;
cluster feasible MSSubAlgebra of a2;
existence
ex b1 being MSSubAlgebra of c2 st b1 is feasible
proof end;
end;

theorem Th23: :: EQUATION:23
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being MSAlgebra of b1
for b4 being MSSubAlgebra of b3
for b5 being ManySortedSubset of the Sorts of b3 st b5 = the Sorts of b4 holds
for b6 being ManySortedFunction of b3,b2
for b7 being ManySortedFunction of b4,b2 st b7 = b6 || b5 holds
for b8 being OperSymbol of b1
for b9 being Element of Args b8,b3
for b10 being Element of Args b8,b4 st Args b8,b4 <> {} & b9 = b10 holds
b6 # b9 = b7 # b10
proof end;

theorem Th24: :: EQUATION:24
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being feasible MSAlgebra of b1
for b4 being feasible MSSubAlgebra of b3
for b5 being ManySortedSubset of the Sorts of b3 st b5 = the Sorts of b4 holds
for b6 being ManySortedFunction of b3,b2 st b6 is_homomorphism b3,b2 holds
for b7 being ManySortedFunction of b4,b2 st b7 = b6 || b5 holds
b7 is_homomorphism b4,b2
proof end;

theorem Th25: :: EQUATION:25
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being strict non-empty MSAlgebra of b1
for b4 being GeneratorSet of b2
for b5 being V2 GeneratorSet of b3
for b6 being ManySortedFunction of b2,b3 st b5 c= b6 .:.: b4 & b6 is_homomorphism b2,b3 holds
b6 is_epimorphism b2,b3
proof end;

theorem Th26: :: EQUATION:26
for b1 being non empty non void ManySortedSign
for b2, b3 being non-empty MSAlgebra of b1
for b4 being strict non-empty free MSAlgebra of b1
for b5 being ManySortedFunction of b2,b3 st b5 is_epimorphism b2,b3 holds
for b6 being ManySortedFunction of b4,b3 st b6 is_homomorphism b4,b3 holds
ex b7 being ManySortedFunction of b4,b2 st
( b7 is_homomorphism b4,b2 & b6 = b5 ** b7 )
proof end;

theorem Th27: :: EQUATION:27
for b1 being non empty non void ManySortedSign
for b2 being non empty finite set
for b3 being non-empty MSAlgebra of b1
for b4 being MSAlgebra-Family of b2,b1 st ( for b5 being Element of b2 ex b6 being strict non-empty finitely-generated MSSubAlgebra of b3 st b6 = b4 . b5 ) holds
ex b5 being strict non-empty finitely-generated MSSubAlgebra of b3 st
for b6 being Element of b2 holds b4 . b6 is MSSubAlgebra of b5
proof end;

theorem Th28: :: EQUATION:28
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3, b4 being strict non-empty finitely-generated MSSubAlgebra of b2 ex b5 being strict non-empty finitely-generated MSSubAlgebra of b2 st
( b3 is MSSubAlgebra of b5 & b4 is MSSubAlgebra of b5 )
proof end;

theorem Th29: :: EQUATION:29
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being set st b3 = { b4 where B is Element of MSSub b2 : ex b1 being strict non-empty finitely-generated MSSubAlgebra of b2 st b5 = b4 } holds
for b4 being MSAlgebra-Family of b3,b1 st ( for b5 being set st b5 in b3 holds
b5 = b4 . b5 ) holds
ex b5 being strict non-empty MSSubAlgebra of product b4ex b6 being ManySortedFunction of b5,b2 st b6 is_epimorphism b5,b2
proof end;

theorem Th30: :: EQUATION:30
for b1 being non empty non void ManySortedSign
for b2 being free feasible MSAlgebra of b1
for b3 being free GeneratorSet of b2
for b4 being MSSubset of b2 st b4 c= b3 & GenMSAlg b4 is feasible holds
GenMSAlg b4 is free
proof end;

definition
let c1 be non empty non void ManySortedSign ;
func TermAlg c1 -> MSAlgebra of a1 equals :: EQUATION:def 3
FreeMSA (the carrier of a1 --> NAT );
correctness
coherence
FreeMSA (the carrier of c1 --> NAT ) is MSAlgebra of c1
;
;
end;

:: deftheorem Def3 defines TermAlg EQUATION:def 3 :
for b1 being non empty non void ManySortedSign holds TermAlg b1 = FreeMSA (the carrier of b1 --> NAT );

registration
let c1 be non empty non void ManySortedSign ;
cluster TermAlg a1 -> strict non-empty free ;
coherence
( TermAlg c1 is strict & TermAlg c1 is non-empty & TermAlg c1 is free )
;
end;

definition
let c1 be non empty non void ManySortedSign ;
func Equations c1 -> ManySortedSet of the carrier of a1 equals :: EQUATION:def 4
[|the Sorts of (TermAlg a1),the Sorts of (TermAlg a1)|];
correctness
coherence
[|the Sorts of (TermAlg c1),the Sorts of (TermAlg c1)|] is ManySortedSet of the carrier of c1
;
;
end;

:: deftheorem Def4 defines Equations EQUATION:def 4 :
for b1 being non empty non void ManySortedSign holds Equations b1 = [|the Sorts of (TermAlg b1),the Sorts of (TermAlg b1)|];

registration
let c1 be non empty non void ManySortedSign ;
cluster Equations a1 -> V2 ;
coherence
Equations c1 is non-empty
;
end;

definition
let c1 be non empty non void ManySortedSign ;
mode EqualSet of a1 is ManySortedSubset of Equations a1;
end;

notation
let c1 be non empty non void ManySortedSign ;
let c2 be SortSymbol of c1;
let c3, c4 be Element of the Sorts of (TermAlg c1) . c2;
synonym c3 '=' c4 for [c1,c2];
end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be SortSymbol of c1;
let c3, c4 be Element of the Sorts of (TermAlg c1) . c2;
redefine func '=' as c3 '=' c4 -> Element of (Equations a1) . a2;
coherence
'=' is Element of (Equations c1) . c2
proof end;
end;

theorem Th31: :: EQUATION:31
for b1 being non empty non void ManySortedSign
for b2 being SortSymbol of b1
for b3 being Element of (Equations b1) . b2 holds b3 `1 in the Sorts of (TermAlg b1) . b2
proof end;

theorem Th32: :: EQUATION:32
for b1 being non empty non void ManySortedSign
for b2 being SortSymbol of b1
for b3 being Element of (Equations b1) . b2 holds b3 `2 in the Sorts of (TermAlg b1) . b2
proof end;

definition
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
let c3 be SortSymbol of c1;
let c4 be Element of (Equations c1) . c3;
pred c2 |= c4 means :Def5: :: EQUATION:def 5
for b1 being ManySortedFunction of (TermAlg a1),a2 st b1 is_homomorphism TermAlg a1,a2 holds
(b1 . a3) . (a4 `1 ) = (b1 . a3) . (a4 `2 );
end;

:: deftheorem Def5 defines |= EQUATION:def 5 :
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being SortSymbol of b1
for b4 being Element of (Equations b1) . b3 holds
( b2 |= b4 iff for b5 being ManySortedFunction of (TermAlg b1),b2 st b5 is_homomorphism TermAlg b1,b2 holds
(b5 . b3) . (b4 `1 ) = (b5 . b3) . (b4 `2 ) );

definition
let c1 be non empty non void ManySortedSign ;
let c2 be MSAlgebra of c1;
let c3 be EqualSet of c1;
pred c2 |= c3 means :Def6: :: EQUATION:def 6
for b1 being SortSymbol of a1
for b2 being Element of (Equations a1) . b1 st b2 in a3 . b1 holds
a2 |= b2;
end;

:: deftheorem Def6 defines |= EQUATION:def 6 :
for b1 being non empty non void ManySortedSign
for b2 being MSAlgebra of b1
for b3 being EqualSet of b1 holds
( b2 |= b3 iff for b4 being SortSymbol of b1
for b5 being Element of (Equations b1) . b4 st b5 in b3 . b4 holds
b2 |= b5 );

theorem Th33: :: EQUATION:33
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being SortSymbol of b1
for b4 being Element of (Equations b1) . b3
for b5 being strict non-empty MSSubAlgebra of b2 st b2 |= b4 holds
b5 |= b4
proof end;

theorem Th34: :: EQUATION:34
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being EqualSet of b1
for b4 being strict non-empty MSSubAlgebra of b2 st b2 |= b3 holds
b4 |= b3
proof end;

theorem Th35: :: EQUATION:35
for b1 being non empty non void ManySortedSign
for b2, b3 being non-empty MSAlgebra of b1
for b4 being SortSymbol of b1
for b5 being Element of (Equations b1) . b4 st b2,b3 are_isomorphic & b2 |= b5 holds
b3 |= b5
proof end;

theorem Th36: :: EQUATION:36
for b1 being non empty non void ManySortedSign
for b2, b3 being non-empty MSAlgebra of b1
for b4 being EqualSet of b1 st b2,b3 are_isomorphic & b2 |= b4 holds
b3 |= b4
proof end;

theorem Th37: :: EQUATION:37
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being SortSymbol of b1
for b4 being Element of (Equations b1) . b3
for b5 being MSCongruence of b2 st b2 |= b4 holds
QuotMSAlg b2,b5 |= b4
proof end;

theorem Th38: :: EQUATION:38
for b1 being non empty non void ManySortedSign
for b2 being non-empty MSAlgebra of b1
for b3 being EqualSet of b1
for b4 being MSCongruence of b2 st b2 |= b3 holds
QuotMSAlg b2,b4 |= b3
proof end;

Lemma25: for b1 being non empty non void ManySortedSign
for b2 being SortSymbol of b1
for b3 being Element of (Equations b1) . b2
for b4 being non empty set
for b5 being MSAlgebra-Family of b4,b1 st ( for b6 being Element of b4 holds b5 . b6 |= b3 ) holds
product b5 |= b3
proof end;

theorem Th39: :: EQUATION:39
for b1 being set
for b2 being non empty non void ManySortedSign
for b3 being SortSymbol of b2
for b4 being Element of (Equations b2) . b3
for b5 being MSAlgebra-Family of b1,b2 st ( for b6 being set st b6 in b1 holds
ex b7 being MSAlgebra of b2 st
( b7 = b5 . b6 & b7 |= b4 ) ) holds
product b5 |= b4
proof end;

theorem Th40: :: EQUATION:40
for b1 being set
for b2 being non empty non void ManySortedSign
for b3 being EqualSet of b2
for b4 being MSAlgebra-Family of b1,b2 st ( for b5 being set st b5 in b1 holds
ex b6 being MSAlgebra of b2 st
( b6 = b4 . b5 & b6 |= b3 ) ) holds
product b4 |= b3
proof end;