:: PUA2MSS1 semantic presentation

Lemma1: for b1 being FinSequence
for b2 being Function st dom b2 = dom b1 holds
b2 is FinSequence
proof end;

Lemma2: for b1 being set
for b2 being non empty set
for b3 being FinSequence of b1
for b4 being Function of b1,b2 holds b4 * b3 is FinSequence of b2
proof end;

registration
let c1, c2 be non empty set ;
cluster non empty Relation of a1,a2;
existence
not for b1 being PartFunc of c1,c2 holds b1 is empty
proof end;
end;

registration
let c1 be with_non-empty_elements set ;
cluster -> non-empty FinSequence of a1;
coherence
for b1 being FinSequence of c1 holds b1 is non-empty
proof end;
end;

registration
let c1 be non empty set ;
cluster non empty non-empty homogeneous quasi_total FinSequence of PFuncs (a1 * ),a1;
existence
ex b1 being PFuncFinSequence of c1 st
( b1 is homogeneous & b1 is quasi_total & b1 is non-empty & not b1 is empty )
proof end;
end;

registration
cluster non-empty -> non empty UAStr ;
coherence
for b1 being UAStr st b1 is non-empty holds
not b1 is empty
proof end;
end;

theorem Th1: :: PUA2MSS1:1
for b1, b2 being non-empty Function st product b1 c= product b2 holds
( dom b1 = dom b2 & ( for b3 being set st b3 in dom b1 holds
b1 . b3 c= b2 . b3 ) )
proof end;

theorem Th2: :: PUA2MSS1:2
for b1, b2 being non-empty Function st product b1 = product b2 holds
b1 = b2
proof end;

definition
let c1 be non empty set ;
let c2 be PFuncFinSequence of c1;
redefine func rng as rng c2 -> Subset of (PFuncs (a1 * ),a1);
coherence
rng c2 is Subset of (PFuncs (c1 * ),c1)
by FINSEQ_1:def 4;
end;

definition
let c1, c2 be non empty set ;
let c3 be non empty Subset of (PFuncs c1,c2);
redefine mode Element as Element of c3 -> PartFunc of a1,a2;
coherence
for b1 being Element of c3 holds b1 is PartFunc of c1,c2
proof end;
end;

definition
let c1 be non-empty UAStr ;
mode OperSymbol of a1 is Element of dom the charact of a1;
mode operation of a1 is Element of rng the charact of a1;
end;

definition
let c1 be non-empty UAStr ;
let c2 be OperSymbol of c1;
func Den c2,c1 -> operation of a1 equals :: PUA2MSS1:def 1
the charact of a1 . a2;
correctness
coherence
the charact of c1 . c2 is operation of c1
;
by FUNCT_1:def 5;
end;

:: deftheorem Def1 defines Den PUA2MSS1:def 1 :
for b1 being non-empty UAStr
for b2 being OperSymbol of b1 holds Den b2,b1 = the charact of b1 . b2;

theorem Th3: :: PUA2MSS1:3
for b1 being set
for b2 being a_partition of b1
for b3, b4, b5 being set st b3 in b4 & b4 in b2 & b3 in b5 & b5 in b2 holds
b4 = b5
proof end;

theorem Th4: :: PUA2MSS1:4
for b1, b2 being set st b1 is_finer_than b2 holds
for b3 being FinSequence of b1 ex b4 being FinSequence of b2 st product b3 c= product b4
proof end;

theorem Th5: :: PUA2MSS1:5
for b1 being set
for b2, b3 being a_partition of b1
for b4 being Function of b2,b3 st ( for b5 being set st b5 in b2 holds
b5 c= b4 . b5 ) holds
for b5 being FinSequence of b2
for b6 being FinSequence of b3 holds
( product b5 c= product b6 iff b4 * b5 = b6 )
proof end;

theorem Th6: :: PUA2MSS1:6
for b1 being set
for b2 being Function st rng b2 c= union b1 holds
ex b3 being Function st
( dom b3 = dom b2 & rng b3 c= b1 & b2 in product b3 )
proof end;

theorem Th7: :: PUA2MSS1:7
for b1 being set
for b2 being a_partition of b1
for b3 being FinSequence of b1 ex b4 being FinSequence of b2 st b3 in product b4
proof end;

theorem Th8: :: PUA2MSS1:8
for b1, b2 being non empty set
for b3 being a_partition of b1
for b4 being a_partition of b2 holds { [:b5,b6:] where B is Element of b3, B is Element of b4 : verum } is a_partition of [:b1,b2:]
proof end;

theorem Th9: :: PUA2MSS1:9
for b1 being non empty set
for b2 being a_partition of b1 holds { (product b3) where B is Element of b2 * : verum } is a_partition of b1 *
proof end;

theorem Th10: :: PUA2MSS1:10
for b1 being non empty set
for b2 being Nat
for b3 being a_partition of b1 holds { (product b4) where B is Element of b2 -tuples_on b3 : verum } is a_partition of b2 -tuples_on b1
proof end;

theorem Th11: :: PUA2MSS1:11
for b1 being non empty set
for b2 being set st b2 c= b1 holds
for b3 being a_partition of b1 holds { (b4 /\ b2) where B is Element of b3 : b4 meets b2 } is a_partition of b2
proof end;

theorem Th12: :: PUA2MSS1:12
for b1 being non empty Function
for b2 being a_partition of dom b1 holds { (b1 | b3) where B is Element of b2 : verum } is a_partition of b1
proof end;

definition
let c1 be set ;
func SmallestPartition c1 -> a_partition of a1 equals :: PUA2MSS1:def 2
Class (id a1);
correctness
coherence
Class (id c1) is a_partition of c1
;
;
end;

:: deftheorem Def2 defines SmallestPartition PUA2MSS1:def 2 :
for b1 being set holds SmallestPartition b1 = Class (id b1);

theorem Th13: :: PUA2MSS1:13
for b1 being non empty set holds SmallestPartition b1 = { {b2} where B is Element of b1 : verum }
proof end;

theorem Th14: :: PUA2MSS1:14
for b1 being set
for b2 being FinSequence of SmallestPartition b1 ex b3 being FinSequence of b1 st product b2 = {b3}
proof end;

definition
let c1 be set ;
mode IndexedPartition of c1 -> Function means :Def3: :: PUA2MSS1:def 3
( rng a2 is a_partition of a1 & a2 is one-to-one );
existence
ex b1 being Function st
( rng b1 is a_partition of c1 & b1 is one-to-one )
proof end;
end;

:: deftheorem Def3 defines IndexedPartition PUA2MSS1:def 3 :
for b1 being set
for b2 being Function holds
( b2 is IndexedPartition of b1 iff ( rng b2 is a_partition of b1 & b2 is one-to-one ) );

definition
let c1 be set ;
let c2 be IndexedPartition of c1;
redefine func rng as rng c2 -> a_partition of a1;
coherence
rng c2 is a_partition of c1
by Def3;
end;

registration
let c1 be set ;
cluster -> non-empty one-to-one IndexedPartition of a1;
coherence
for b1 being IndexedPartition of c1 holds
( b1 is one-to-one & b1 is non-empty )
proof end;
end;

registration
let c1 be non empty set ;
cluster -> non empty non-empty one-to-one IndexedPartition of a1;
coherence
for b1 being IndexedPartition of c1 holds not b1 is empty
proof end;
end;

definition
let c1 be set ;
let c2 be a_partition of c1;
redefine func id as id c2 -> IndexedPartition of a1;
coherence
id c2 is IndexedPartition of c1
proof end;
end;

definition
let c1 be set ;
let c2 be IndexedPartition of c1;
let c3 be set ;
assume E16: c3 in c1 ;
then E17: union (rng c2) = c1 by EQREL_1:def 6;
func c2 -index_of c3 -> set means :Def4: :: PUA2MSS1:def 4
( a4 in dom a2 & a3 in a2 . a4 );
existence
ex b1 being set st
( b1 in dom c2 & c3 in c2 . b1 )
proof end;
correctness
uniqueness
for b1, b2 being set st b1 in dom c2 & c3 in c2 . b1 & b2 in dom c2 & c3 in c2 . b2 holds
b1 = b2
;
proof end;
end;

:: deftheorem Def4 defines -index_of PUA2MSS1:def 4 :
for b1 being set
for b2 being IndexedPartition of b1
for b3 being set st b3 in b1 holds
for b4 being set holds
( b4 = b2 -index_of b3 iff ( b4 in dom b2 & b3 in b2 . b4 ) );

theorem Th15: :: PUA2MSS1:15
for b1 being set
for b2 being non-empty Function st Union b2 = b1 & ( for b3, b4 being set st b3 in dom b2 & b4 in dom b2 & b3 <> b4 holds
b2 . b3 misses b2 . b4 ) holds
b2 is IndexedPartition of b1
proof end;

theorem Th16: :: PUA2MSS1:16
for b1, b2 being non empty set
for b3 being a_partition of b2
for b4 being Function of b1,b3 st b3 c= rng b4 & b4 is one-to-one holds
b4 is IndexedPartition of b2
proof end;

scheme :: PUA2MSS1:sch 1
s1{ F1() -> non empty set , F2() -> non empty set , F3() -> Nat, F4() -> Relation of F1(),F2(), F5( set , set ) -> Relation of F1(),F2() } :
ex b1 being Relation of F1(),F2()ex b2 being ManySortedSet of NAT st
( b1 = b2 . F3() & b2 . 0 = F4() & ( for b3 being Nat
for b4 being Relation of F1(),F2() st b4 = b2 . b3 holds
b2 . (b3 + 1) = F5(b4,b3) ) )
proof end;

scheme :: PUA2MSS1:sch 2
s2{ F1() -> non empty set , F2() -> non empty set , P1[ set , set ] } :
for b1, b2 being Relation of F1(),F2() st ( for b3 being Element of F1()
for b4 being Element of F2() holds
( [b3,b4] in b1 iff P1[b3,b4] ) ) & ( for b3 being Element of F1()
for b4 being Element of F2() holds
( [b3,b4] in b2 iff P1[b3,b4] ) ) holds
b1 = b2
proof end;

scheme :: PUA2MSS1:sch 3
s3{ F1() -> non empty set , F2() -> non empty set , F3() -> Nat, F4() -> Relation of F1(),F2(), F5( set , set ) -> Relation of F1(),F2() } :
for b1, b2 being Relation of F1(),F2() st ex b3 being ManySortedSet of NAT st
( b1 = b3 . F3() & b3 . 0 = F4() & ( for b4 being Nat
for b5 being Relation of F1(),F2() st b5 = b3 . b4 holds
b3 . (b4 + 1) = F5(b5,b4) ) ) & ex b3 being ManySortedSet of NAT st
( b2 = b3 . F3() & b3 . 0 = F4() & ( for b4 being Nat
for b5 being Relation of F1(),F2() st b5 = b3 . b4 holds
b3 . (b4 + 1) = F5(b5,b4) ) ) holds
b1 = b2
proof end;

definition
let c1 be partial non-empty UAStr ;
func DomRel c1 -> Relation of the carrier of a1 means :Def5: :: PUA2MSS1:def 5
for b1, b2 being Element of a1 holds
( [b1,b2] in a2 iff for b3 being operation of a1
for b4, b5 being FinSequence holds
( (b4 ^ <*b1*>) ^ b5 in dom b3 iff (b4 ^ <*b2*>) ^ b5 in dom b3 ) );
existence
ex b1 being Relation of the carrier of c1 st
for b2, b3 being Element of c1 holds
( [b2,b3] in b1 iff for b4 being operation of c1
for b5, b6 being FinSequence holds
( (b5 ^ <*b2*>) ^ b6 in dom b4 iff (b5 ^ <*b3*>) ^ b6 in dom b4 ) )
proof end;
uniqueness
for b1, b2 being Relation of the carrier of c1 st ( for b3, b4 being Element of c1 holds
( [b3,b4] in b1 iff for b5 being operation of c1
for b6, b7 being FinSequence holds
( (b6 ^ <*b3*>) ^ b7 in dom b5 iff (b6 ^ <*b4*>) ^ b7 in dom b5 ) ) ) & ( for b3, b4 being Element of c1 holds
( [b3,b4] in b2 iff for b5 being operation of c1
for b6, b7 being FinSequence holds
( (b6 ^ <*b3*>) ^ b7 in dom b5 iff (b6 ^ <*b4*>) ^ b7 in dom b5 ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def5 defines DomRel PUA2MSS1:def 5 :
for b1 being partial non-empty UAStr
for b2 being Relation of the carrier of b1 holds
( b2 = DomRel b1 iff for b3, b4 being Element of b1 holds
( [b3,b4] in b2 iff for b5 being operation of b1
for b6, b7 being FinSequence holds
( (b6 ^ <*b3*>) ^ b7 in dom b5 iff (b6 ^ <*b4*>) ^ b7 in dom b5 ) ) );

registration
let c1 be partial non-empty UAStr ;
cluster DomRel a1 -> symmetric transitive total ;
coherence
( DomRel c1 is total & DomRel c1 is symmetric & DomRel c1 is transitive )
proof end;
end;

definition
let c1 be partial non-empty UAStr ;
let c2 be Relation of the carrier of c1;
func c2 |^ c1 -> Relation of the carrier of a1 means :Def6: :: PUA2MSS1:def 6
for b1, b2 being Element of a1 holds
( [b1,b2] in a3 iff ( [b1,b2] in a2 & ( for b3 being operation of a1
for b4, b5 being FinSequence st (b4 ^ <*b1*>) ^ b5 in dom b3 & (b4 ^ <*b2*>) ^ b5 in dom b3 holds
[(b3 . ((b4 ^ <*b1*>) ^ b5)),(b3 . ((b4 ^ <*b2*>) ^ b5))] in a2 ) ) );
existence
ex b1 being Relation of the carrier of c1 st
for b2, b3 being Element of c1 holds
( [b2,b3] in b1 iff ( [b2,b3] in c2 & ( for b4 being operation of c1
for b5, b6 being FinSequence st (b5 ^ <*b2*>) ^ b6 in dom b4 & (b5 ^ <*b3*>) ^ b6 in dom b4 holds
[(b4 . ((b5 ^ <*b2*>) ^ b6)),(b4 . ((b5 ^ <*b3*>) ^ b6))] in c2 ) ) )
proof end;
uniqueness
for b1, b2 being Relation of the carrier of c1 st ( for b3, b4 being Element of c1 holds
( [b3,b4] in b1 iff ( [b3,b4] in c2 & ( for b5 being operation of c1
for b6, b7 being FinSequence st (b6 ^ <*b3*>) ^ b7 in dom b5 & (b6 ^ <*b4*>) ^ b7 in dom b5 holds
[(b5 . ((b6 ^ <*b3*>) ^ b7)),(b5 . ((b6 ^ <*b4*>) ^ b7))] in c2 ) ) ) ) & ( for b3, b4 being Element of c1 holds
( [b3,b4] in b2 iff ( [b3,b4] in c2 & ( for b5 being operation of c1
for b6, b7 being FinSequence st (b6 ^ <*b3*>) ^ b7 in dom b5 & (b6 ^ <*b4*>) ^ b7 in dom b5 holds
[(b5 . ((b6 ^ <*b3*>) ^ b7)),(b5 . ((b6 ^ <*b4*>) ^ b7))] in c2 ) ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def6 defines |^ PUA2MSS1:def 6 :
for b1 being partial non-empty UAStr
for b2, b3 being Relation of the carrier of b1 holds
( b3 = b2 |^ b1 iff for b4, b5 being Element of b1 holds
( [b4,b5] in b3 iff ( [b4,b5] in b2 & ( for b6 being operation of b1
for b7, b8 being FinSequence st (b7 ^ <*b4*>) ^ b8 in dom b6 & (b7 ^ <*b5*>) ^ b8 in dom b6 holds
[(b6 . ((b7 ^ <*b4*>) ^ b8)),(b6 . ((b7 ^ <*b5*>) ^ b8))] in b2 ) ) ) );

definition
let c1 be partial non-empty UAStr ;
let c2 be Relation of the carrier of c1;
let c3 be Nat;
func c2 |^ c1,c3 -> Relation of the carrier of a1 means :Def7: :: PUA2MSS1:def 7
ex b1 being ManySortedSet of NAT st
( a4 = b1 . a3 & b1 . 0 = a2 & ( for b2 being Nat
for b3 being Relation of the carrier of a1 st b3 = b1 . b2 holds
b1 . (b2 + 1) = b3 |^ a1 ) );
existence
ex b1 being Relation of the carrier of c1ex b2 being ManySortedSet of NAT st
( b1 = b2 . c3 & b2 . 0 = c2 & ( for b3 being Nat
for b4 being Relation of the carrier of c1 st b4 = b2 . b3 holds
b2 . (b3 + 1) = b4 |^ c1 ) )
proof end;
uniqueness
for b1, b2 being Relation of the carrier of c1 st ex b3 being ManySortedSet of NAT st
( b1 = b3 . c3 & b3 . 0 = c2 & ( for b4 being Nat
for b5 being Relation of the carrier of c1 st b5 = b3 . b4 holds
b3 . (b4 + 1) = b5 |^ c1 ) ) & ex b3 being ManySortedSet of NAT st
( b2 = b3 . c3 & b3 . 0 = c2 & ( for b4 being Nat
for b5 being Relation of the carrier of c1 st b5 = b3 . b4 holds
b3 . (b4 + 1) = b5 |^ c1 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def7 defines |^ PUA2MSS1:def 7 :
for b1 being partial non-empty UAStr
for b2 being Relation of the carrier of b1
for b3 being Nat
for b4 being Relation of the carrier of b1 holds
( b4 = b2 |^ b1,b3 iff ex b5 being ManySortedSet of NAT st
( b4 = b5 . b3 & b5 . 0 = b2 & ( for b6 being Nat
for b7 being Relation of the carrier of b1 st b7 = b5 . b6 holds
b5 . (b6 + 1) = b7 |^ b1 ) ) );

theorem Th17: :: PUA2MSS1:17
for b1 being partial non-empty UAStr
for b2 being Relation of the carrier of b1 holds
( b2 |^ b1,0 = b2 & b2 |^ b1,1 = b2 |^ b1 )
proof end;

theorem Th18: :: PUA2MSS1:18
for b1 being partial non-empty UAStr
for b2 being Nat
for b3 being Relation of the carrier of b1 holds b3 |^ b1,(b2 + 1) = (b3 |^ b1,b2) |^ b1
proof end;

theorem Th19: :: PUA2MSS1:19
for b1 being partial non-empty UAStr
for b2, b3 being Nat
for b4 being Relation of the carrier of b1 holds b4 |^ b1,(b2 + b3) = (b4 |^ b1,b2) |^ b1,b3
proof end;

theorem Th20: :: PUA2MSS1:20
for b1 being partial non-empty UAStr
for b2 being Equivalence_Relation of the carrier of b1 st b2 c= DomRel b1 holds
( b2 |^ b1 is total & b2 |^ b1 is symmetric & b2 |^ b1 is transitive )
proof end;

theorem Th21: :: PUA2MSS1:21
for b1 being partial non-empty UAStr
for b2 being Relation of the carrier of b1 holds b2 |^ b1 c= b2
proof end;

theorem Th22: :: PUA2MSS1:22
for b1 being partial non-empty UAStr
for b2 being Equivalence_Relation of the carrier of b1 st b2 c= DomRel b1 holds
for b3 being Nat holds
( b2 |^ b1,b3 is total & b2 |^ b1,b3 is symmetric & b2 |^ b1,b3 is transitive )
proof end;

definition
let c1 be partial non-empty UAStr ;
func LimDomRel c1 -> Relation of the carrier of a1 means :Def8: :: PUA2MSS1:def 8
for b1, b2 being Element of a1 holds
( [b1,b2] in a2 iff for b3 being Nat holds [b1,b2] in (DomRel a1) |^ a1,b3 );
existence
ex b1 being Relation of the carrier of c1 st
for b2, b3 being Element of c1 holds
( [b2,b3] in b1 iff for b4 being Nat holds [b2,b3] in (DomRel c1) |^ c1,b4 )
proof end;
uniqueness
for b1, b2 being Relation of the carrier of c1 st ( for b3, b4 being Element of c1 holds
( [b3,b4] in b1 iff for b5 being Nat holds [b3,b4] in (DomRel c1) |^ c1,b5 ) ) & ( for b3, b4 being Element of c1 holds
( [b3,b4] in b2 iff for b5 being Nat holds [b3,b4] in (DomRel c1) |^ c1,b5 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def8 defines LimDomRel PUA2MSS1:def 8 :
for b1 being partial non-empty UAStr
for b2 being Relation of the carrier of b1 holds
( b2 = LimDomRel b1 iff for b3, b4 being Element of b1 holds
( [b3,b4] in b2 iff for b5 being Nat holds [b3,b4] in (DomRel b1) |^ b1,b5 ) );

theorem Th23: :: PUA2MSS1:23
for b1 being partial non-empty UAStr holds LimDomRel b1 c= DomRel b1
proof end;

registration
let c1 be partial non-empty UAStr ;
cluster LimDomRel a1 -> symmetric transitive total ;
coherence
( LimDomRel c1 is total & LimDomRel c1 is symmetric & LimDomRel c1 is transitive )
proof end;
end;

definition
let c1 be non empty set ;
let c2 be PartFunc of c1 * ,c1;
let c3 be a_partition of c1;
pred c2 is_partitable_wrt c3 means :Def9: :: PUA2MSS1:def 9
for b1 being FinSequence of a3 ex b2 being Element of a3 st a2 .: (product b1) c= b2;
end;

:: deftheorem Def9 defines is_partitable_wrt PUA2MSS1:def 9 :
for b1 being non empty set
for b2 being PartFunc of b1 * ,b1
for b3 being a_partition of b1 holds
( b2 is_partitable_wrt b3 iff for b4 being FinSequence of b3 ex b5 being Element of b3 st b2 .: (product b4) c= b5 );

definition
let c1 be non empty set ;
let c2 be PartFunc of c1 * ,c1;
let c3 be a_partition of c1;
pred c2 is_exactly_partitable_wrt c3 means :Def10: :: PUA2MSS1:def 10
( a2 is_partitable_wrt a3 & ( for b1 being FinSequence of a3 st product b1 meets dom a2 holds
product b1 c= dom a2 ) );
end;

:: deftheorem Def10 defines is_exactly_partitable_wrt PUA2MSS1:def 10 :
for b1 being non empty set
for b2 being PartFunc of b1 * ,b1
for b3 being a_partition of b1 holds
( b2 is_exactly_partitable_wrt b3 iff ( b2 is_partitable_wrt b3 & ( for b4 being FinSequence of b3 st product b4 meets dom b2 holds
product b4 c= dom b2 ) ) );

theorem Th24: :: PUA2MSS1:24
for b1 being partial non-empty UAStr
for b2 being operation of b1 holds b2 is_exactly_partitable_wrt SmallestPartition the carrier of b1
proof end;

scheme :: PUA2MSS1:sch 4
s4{ F1() -> FinSequence, F2() -> FinSequence, P1[ set ], P2[ set , set ] } :
P1[F2()]
provided
E31: P1[F1()] and
E32: len F1() = len F2() and
E33: for b1, b2 being FinSequence
for b3, b4 being set st P1[(b1 ^ <*b3*>) ^ b2] & P2[b3,b4] holds
P1[(b1 ^ <*b4*>) ^ b2] and
E34: for b1 being Nat st b1 in dom F1() holds
P2[F1() . b1,F2() . b1]
proof end;

theorem Th25: :: PUA2MSS1:25
for b1 being partial non-empty UAStr
for b2 being operation of b1 holds b2 is_exactly_partitable_wrt Class (LimDomRel b1)
proof end;

definition
let c1 be partial non-empty UAStr ;
mode a_partition of c1 -> a_partition of the carrier of a1 means :Def11: :: PUA2MSS1:def 11
for b1 being operation of a1 holds b1 is_exactly_partitable_wrt a2;
existence
ex b1 being a_partition of the carrier of c1 st
for b2 being operation of c1 holds b2 is_exactly_partitable_wrt b1
proof end;
end;

:: deftheorem Def11 defines a_partition PUA2MSS1:def 11 :
for b1 being partial non-empty UAStr
for b2 being a_partition of the carrier of b1 holds
( b2 is a_partition of b1 iff for b3 being operation of b1 holds b3 is_exactly_partitable_wrt b2 );

definition
let c1 be partial non-empty UAStr ;
mode IndexedPartition of c1 -> IndexedPartition of the carrier of a1 means :Def12: :: PUA2MSS1:def 12
rng a2 is a_partition of a1;
existence
ex b1 being IndexedPartition of the carrier of c1 st rng b1 is a_partition of c1
proof end;
end;

:: deftheorem Def12 defines IndexedPartition PUA2MSS1:def 12 :
for b1 being partial non-empty UAStr
for b2 being IndexedPartition of the carrier of b1 holds
( b2 is IndexedPartition of b1 iff rng b2 is a_partition of b1 );

definition
let c1 be partial non-empty UAStr ;
let c2 be IndexedPartition of c1;
redefine func rng as rng c2 -> a_partition of a1;
coherence
rng c2 is a_partition of c1
by Def12;
end;

theorem Th26: :: PUA2MSS1:26
for b1 being partial non-empty UAStr holds Class (LimDomRel b1) is a_partition of b1
proof end;

theorem Th27: :: PUA2MSS1:27
for b1 being non empty set
for b2 being a_partition of b1
for b3 being FinSequence of b2
for b4, b5 being FinSequence
for b6, b7 being set st (b4 ^ <*b6*>) ^ b5 in product b3 & ex b8 being Element of b2 st
( b6 in b8 & b7 in b8 ) holds
(b4 ^ <*b7*>) ^ b5 in product b3
proof end;

theorem Th28: :: PUA2MSS1:28
for b1 being partial non-empty UAStr
for b2 being a_partition of b1 holds b2 is_finer_than Class (LimDomRel b1)
proof end;

definition
let c1, c2 be ManySortedSign ;
let c3, c4 be Function;
pred c3,c4 form_morphism_between c1,c2 means :Def13: :: PUA2MSS1:def 13
( dom a3 = the carrier of a1 & dom a4 = the OperSymbols of a1 & rng a3 c= the carrier of a2 & rng a4 c= the OperSymbols of a2 & a3 * the ResultSort of a1 = the ResultSort of a2 * a4 & ( for b1 being set
for b2 being Function st b1 in the OperSymbols of a1 & b2 = the Arity of a1 . b1 holds
a3 * b2 = the Arity of a2 . (a4 . b1) ) );
end;

:: deftheorem Def13 defines form_morphism_between PUA2MSS1:def 13 :
for b1, b2 being ManySortedSign
for b3, b4 being Function holds
( b3,b4 form_morphism_between b1,b2 iff ( dom b3 = the carrier of b1 & dom b4 = the OperSymbols of b1 & rng b3 c= the carrier of b2 & rng b4 c= the OperSymbols of b2 & b3 * the ResultSort of b1 = the ResultSort of b2 * b4 & ( for b5 being set
for b6 being Function st b5 in the OperSymbols of b1 & b6 = the Arity of b1 . b5 holds
b3 * b6 = the Arity of b2 . (b4 . b5) ) ) );

theorem Th29: :: PUA2MSS1:29
for b1 being non empty non void ManySortedSign holds id the carrier of b1, id the OperSymbols of b1 form_morphism_between b1,b1
proof end;

theorem Th30: :: PUA2MSS1:30
for b1, b2, b3 being ManySortedSign
for b4, b5, b6, b7 being Function st b4,b6 form_morphism_between b1,b2 & b5,b7 form_morphism_between b2,b3 holds
b5 * b4,b7 * b6 form_morphism_between b1,b3
proof end;

definition
let c1, c2 be ManySortedSign ;
pred c1 is_rougher_than c2 means :: PUA2MSS1:def 14
ex b1, b2 being Function st
( b1,b2 form_morphism_between a2,a1 & rng b1 = the carrier of a1 & rng b2 = the OperSymbols of a1 );
end;

:: deftheorem Def14 defines is_rougher_than PUA2MSS1:def 14 :
for b1, b2 being ManySortedSign holds
( b1 is_rougher_than b2 iff ex b3, b4 being Function st
( b3,b4 form_morphism_between b2,b1 & rng b3 = the carrier of b1 & rng b4 = the OperSymbols of b1 ) );

definition
let c1, c2 be non empty non void ManySortedSign ;
redefine pred is_rougher_than as c1 is_rougher_than c2;
reflexivity
for b1 being non empty non void ManySortedSign holds b1 is_rougher_than b1
proof end;
end;

theorem Th31: :: PUA2MSS1:31
for b1, b2, b3 being ManySortedSign st b1 is_rougher_than b2 & b2 is_rougher_than b3 holds
b1 is_rougher_than b3
proof end;

definition
let c1 be partial non-empty UAStr ;
let c2 be a_partition of c1;
func MSSign c1,c2 -> strict ManySortedSign means :Def15: :: PUA2MSS1:def 15
( the carrier of a3 = a2 & the OperSymbols of a3 = { [b1,b2] where B is OperSymbol of a1, B is Element of a2 * : product b2 meets dom (Den b1,a1) } & ( for b1 being OperSymbol of a1
for b2 being Element of a2 * st product b2 meets dom (Den b1,a1) holds
( the Arity of a3 . [b1,b2] = b2 & (Den b1,a1) .: (product b2) c= the ResultSort of a3 . [b1,b2] ) ) );
existence
ex b1 being strict ManySortedSign st
( the carrier of b1 = c2 & the OperSymbols of b1 = { [b2,b3] where B is OperSymbol of c1, B is Element of c2 * : product b3 meets dom (Den b2,c1) } & ( for b2 being OperSymbol of c1
for b3 being Element of c2 * st product b3 meets dom (Den b2,c1) holds
( the Arity of b1 . [b2,b3] = b3 & (Den b2,c1) .: (product b3) c= the ResultSort of b1 . [b2,b3] ) ) )
proof end;
correctness
uniqueness
for b1, b2 being strict ManySortedSign st the carrier of b1 = c2 & the OperSymbols of b1 = { [b3,b4] where B is OperSymbol of c1, B is Element of c2 * : product b4 meets dom (Den b3,c1) } & ( for b3 being OperSymbol of c1
for b4 being Element of c2 * st product b4 meets dom (Den b3,c1) holds
( the Arity of b1 . [b3,b4] = b4 & (Den b3,c1) .: (product b4) c= the ResultSort of b1 . [b3,b4] ) ) & the carrier of b2 = c2 & the OperSymbols of b2 = { [b3,b4] where B is OperSymbol of c1, B is Element of c2 * : product b4 meets dom (Den b3,c1) } & ( for b3 being OperSymbol of c1
for b4 being Element of c2 * st product b4 meets dom (Den b3,c1) holds
( the Arity of b2 . [b3,b4] = b4 & (Den b3,c1) .: (product b4) c= the ResultSort of b2 . [b3,b4] ) ) holds
b1 = b2
;
proof end;
end;

:: deftheorem Def15 defines MSSign PUA2MSS1:def 15 :
for b1 being partial non-empty UAStr
for b2 being a_partition of b1
for b3 being strict ManySortedSign holds
( b3 = MSSign b1,b2 iff ( the carrier of b3 = b2 & the OperSymbols of b3 = { [b4,b5] where B is OperSymbol of b1, B is Element of b2 * : product b5 meets dom (Den b4,b1) } & ( for b4 being OperSymbol of b1
for b5 being Element of b2 * st product b5 meets dom (Den b4,b1) holds
( the Arity of b3 . [b4,b5] = b5 & (Den b4,b1) .: (product b5) c= the ResultSort of b3 . [b4,b5] ) ) ) );

registration
let c1 be partial non-empty UAStr ;
let c2 be a_partition of c1;
cluster MSSign a1,a2 -> non empty strict non void ;
coherence
( not MSSign c1,c2 is empty & not MSSign c1,c2 is void )
proof end;
end;

definition
let c1 be partial non-empty UAStr ;
let c2 be a_partition of c1;
let c3 be OperSymbol of (MSSign c1,c2);
redefine func `1 as c3 `1 -> OperSymbol of a1;
coherence
c3 `1 is OperSymbol of c1
proof end;
redefine func `2 as c3 `2 -> Element of a2 * ;
coherence
c3 `2 is Element of c2 *
proof end;
end;

definition
let c1 be partial non-empty UAStr ;
let c2 be non empty non void ManySortedSign ;
let c3 be MSAlgebra of c2;
let c4 be IndexedPartition of the OperSymbols of c2;
pred c1 can_be_characterized_by c2,c3,c4 means :Def16: :: PUA2MSS1:def 16
( the Sorts of a3 is IndexedPartition of a1 & dom a4 = dom the charact of a1 & ( for b1 being OperSymbol of a1 holds the Charact of a3 | (a4 . b1) is IndexedPartition of Den b1,a1 ) );
end;

:: deftheorem Def16 defines can_be_characterized_by PUA2MSS1:def 16 :
for b1 being partial non-empty UAStr
for b2 being non empty non void ManySortedSign
for b3 being MSAlgebra of b2
for b4 being IndexedPartition of the OperSymbols of b2 holds
( b1 can_be_characterized_by b2,b3,b4 iff ( the Sorts of b3 is IndexedPartition of b1 & dom b4 = dom the charact of b1 & ( for b5 being OperSymbol of b1 holds the Charact of b3 | (b4 . b5) is IndexedPartition of Den b5,b1 ) ) );

definition
let c1 be partial non-empty UAStr ;
let c2 be non empty non void ManySortedSign ;
pred c1 can_be_characterized_by c2 means :: PUA2MSS1:def 17
ex b1 being MSAlgebra of a2ex b2 being IndexedPartition of the OperSymbols of a2 st a1 can_be_characterized_by a2,b1,b2;
end;

:: deftheorem Def17 defines can_be_characterized_by PUA2MSS1:def 17 :
for b1 being partial non-empty UAStr
for b2 being non empty non void ManySortedSign holds
( b1 can_be_characterized_by b2 iff ex b3 being MSAlgebra of b2ex b4 being IndexedPartition of the OperSymbols of b2 st b1 can_be_characterized_by b2,b3,b4 );

theorem Th32: :: PUA2MSS1:32
for b1 being partial non-empty UAStr
for b2 being a_partition of b1 holds b1 can_be_characterized_by MSSign b1,b2
proof end;

theorem Th33: :: PUA2MSS1:33
for b1 being partial non-empty UAStr
for b2 being non empty non void ManySortedSign
for b3 being MSAlgebra of b2
for b4 being IndexedPartition of the OperSymbols of b2 st b1 can_be_characterized_by b2,b3,b4 holds
for b5 being OperSymbol of b1
for b6 being FinSequence of rng the Sorts of b3 st product b6 c= dom (Den b5,b1) holds
ex b7 being OperSymbol of b2 st
( the Sorts of b3 * (the_arity_of b7) = b6 & b7 in b4 . b5 )
proof end;

theorem Th34: :: PUA2MSS1:34
for b1 being partial non-empty UAStr
for b2 being a_partition of b1 st b2 = Class (LimDomRel b1) holds
for b3 being non empty non void ManySortedSign st b1 can_be_characterized_by b3 holds
MSSign b1,b2 is_rougher_than b3
proof end;