:: NECKLA_2 semantic presentation

theorem Th1: :: NECKLA_2:1
for b1 being Universe
for b2, b3 being set st b2 in b1 & b3 in b1 holds
for b4 being Relation of b2,b3 holds b4 in b1
proof end;

theorem Th2: :: NECKLA_2:2
the InternalRel of (Necklace 4) = {[0,1],[1,0],[1,2],[2,1],[2,3],[3,2]}
proof end;

registration
let c1 be natural number ;
cluster -> finite Element of Rank a1;
coherence
for b1 being Element of Rank c1 holds b1 is finite
proof end;
end;

theorem Th3: :: NECKLA_2:3
for b1 being set st b1 in FinSETS holds
b1 is finite
proof end;

registration
cluster -> finite Element of FinSETS ;
coherence
for b1 being Element of FinSETS holds b1 is finite
by Th3;
end;

registration
cluster ordinal finite -> natural set ;
coherence
for b1 being number st b1 is finite & b1 is ordinal holds
b1 is natural
proof end;
end;

definition
let c1 be non empty RelStr ;
attr a1 is N-free means :Def1: :: NECKLA_2:def 1
not a1 embeds Necklace 4;
end;

:: deftheorem Def1 defines N-free NECKLA_2:def 1 :
for b1 being non empty RelStr holds
( b1 is N-free iff not b1 embeds Necklace 4 );

registration
cluster non empty strict finite N-free RelStr ;
existence
ex b1 being non empty RelStr st
( b1 is strict & b1 is finite & b1 is N-free )
proof end;
end;

definition
let c1, c2 be RelStr ;
func union_of c1,c2 -> strict RelStr means :Def2: :: NECKLA_2:def 2
( the carrier of a3 = the carrier of a1 \/ the carrier of a2 & the InternalRel of a3 = the InternalRel of a1 \/ the InternalRel of a2 );
existence
ex b1 being strict RelStr st
( the carrier of b1 = the carrier of c1 \/ the carrier of c2 & the InternalRel of b1 = the InternalRel of c1 \/ the InternalRel of c2 )
proof end;
uniqueness
for b1, b2 being strict RelStr st the carrier of b1 = the carrier of c1 \/ the carrier of c2 & the InternalRel of b1 = the InternalRel of c1 \/ the InternalRel of c2 & the carrier of b2 = the carrier of c1 \/ the carrier of c2 & the InternalRel of b2 = the InternalRel of c1 \/ the InternalRel of c2 holds
b1 = b2
;
end;

:: deftheorem Def2 defines union_of NECKLA_2:def 2 :
for b1, b2 being RelStr
for b3 being strict RelStr holds
( b3 = union_of b1,b2 iff ( the carrier of b3 = the carrier of b1 \/ the carrier of b2 & the InternalRel of b3 = the InternalRel of b1 \/ the InternalRel of b2 ) );

definition
let c1, c2 be RelStr ;
func sum_of c1,c2 -> strict RelStr means :Def3: :: NECKLA_2:def 3
( the carrier of a3 = the carrier of a1 \/ the carrier of a2 & the InternalRel of a3 = ((the InternalRel of a1 \/ the InternalRel of a2) \/ [:the carrier of a1,the carrier of a2:]) \/ [:the carrier of a2,the carrier of a1:] );
existence
ex b1 being strict RelStr st
( the carrier of b1 = the carrier of c1 \/ the carrier of c2 & the InternalRel of b1 = ((the InternalRel of c1 \/ the InternalRel of c2) \/ [:the carrier of c1,the carrier of c2:]) \/ [:the carrier of c2,the carrier of c1:] )
proof end;
uniqueness
for b1, b2 being strict RelStr st the carrier of b1 = the carrier of c1 \/ the carrier of c2 & the InternalRel of b1 = ((the InternalRel of c1 \/ the InternalRel of c2) \/ [:the carrier of c1,the carrier of c2:]) \/ [:the carrier of c2,the carrier of c1:] & the carrier of b2 = the carrier of c1 \/ the carrier of c2 & the InternalRel of b2 = ((the InternalRel of c1 \/ the InternalRel of c2) \/ [:the carrier of c1,the carrier of c2:]) \/ [:the carrier of c2,the carrier of c1:] holds
b1 = b2
;
end;

:: deftheorem Def3 defines sum_of NECKLA_2:def 3 :
for b1, b2 being RelStr
for b3 being strict RelStr holds
( b3 = sum_of b1,b2 iff ( the carrier of b3 = the carrier of b1 \/ the carrier of b2 & the InternalRel of b3 = ((the InternalRel of b1 \/ the InternalRel of b2) \/ [:the carrier of b1,the carrier of b2:]) \/ [:the carrier of b2,the carrier of b1:] ) );

definition
func fin_RelStr -> set means :Def4: :: NECKLA_2:def 4
for b1 being set holds
( b1 in a1 iff ex b2 being strict RelStr st
( b1 = b2 & the carrier of b2 in FinSETS ) );
existence
ex b1 being set st
for b2 being set holds
( b2 in b1 iff ex b3 being strict RelStr st
( b2 = b3 & the carrier of b3 in FinSETS ) )
proof end;
uniqueness
for b1, b2 being set st ( for b3 being set holds
( b3 in b1 iff ex b4 being strict RelStr st
( b3 = b4 & the carrier of b4 in FinSETS ) ) ) & ( for b3 being set holds
( b3 in b2 iff ex b4 being strict RelStr st
( b3 = b4 & the carrier of b4 in FinSETS ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def4 defines fin_RelStr NECKLA_2:def 4 :
for b1 being set holds
( b1 = fin_RelStr iff for b2 being set holds
( b2 in b1 iff ex b3 being strict RelStr st
( b2 = b3 & the carrier of b3 in FinSETS ) ) );

registration
cluster fin_RelStr -> non empty ;
correctness
coherence
not fin_RelStr is empty
;
proof end;
end;

definition
func fin_RelStr_sp -> Subset of fin_RelStr means :Def5: :: NECKLA_2:def 5
( ( for b1 being strict RelStr st not the carrier of b1 is empty & the carrier of b1 is trivial & the carrier of b1 in FinSETS holds
b1 in a1 ) & ( for b1, b2 being strict RelStr st the carrier of b1 misses the carrier of b2 & b1 in a1 & b2 in a1 holds
( union_of b1,b2 in a1 & sum_of b1,b2 in a1 ) ) & ( for b1 being Subset of fin_RelStr st ( for b2 being strict RelStr st not the carrier of b2 is empty & the carrier of b2 is trivial & the carrier of b2 in FinSETS holds
b2 in b1 ) & ( for b2, b3 being strict RelStr st the carrier of b2 misses the carrier of b3 & b2 in b1 & b3 in b1 holds
( union_of b2,b3 in b1 & sum_of b2,b3 in b1 ) ) holds
a1 c= b1 ) );
existence
ex b1 being Subset of fin_RelStr st
( ( for b2 being strict RelStr st not the carrier of b2 is empty & the carrier of b2 is trivial & the carrier of b2 in FinSETS holds
b2 in b1 ) & ( for b2, b3 being strict RelStr st the carrier of b2 misses the carrier of b3 & b2 in b1 & b3 in b1 holds
( union_of b2,b3 in b1 & sum_of b2,b3 in b1 ) ) & ( for b2 being Subset of fin_RelStr st ( for b3 being strict RelStr st not the carrier of b3 is empty & the carrier of b3 is trivial & the carrier of b3 in FinSETS holds
b3 in b2 ) & ( for b3, b4 being strict RelStr st the carrier of b3 misses the carrier of b4 & b3 in b2 & b4 in b2 holds
( union_of b3,b4 in b2 & sum_of b3,b4 in b2 ) ) holds
b1 c= b2 ) )
proof end;
uniqueness
for b1, b2 being Subset of fin_RelStr st ( for b3 being strict RelStr st not the carrier of b3 is empty & the carrier of b3 is trivial & the carrier of b3 in FinSETS holds
b3 in b1 ) & ( for b3, b4 being strict RelStr st the carrier of b3 misses the carrier of b4 & b3 in b1 & b4 in b1 holds
( union_of b3,b4 in b1 & sum_of b3,b4 in b1 ) ) & ( for b3 being Subset of fin_RelStr st ( for b4 being strict RelStr st not the carrier of b4 is empty & the carrier of b4 is trivial & the carrier of b4 in FinSETS holds
b4 in b3 ) & ( for b4, b5 being strict RelStr st the carrier of b4 misses the carrier of b5 & b4 in b3 & b5 in b3 holds
( union_of b4,b5 in b3 & sum_of b4,b5 in b3 ) ) holds
b1 c= b3 ) & ( for b3 being strict RelStr st not the carrier of b3 is empty & the carrier of b3 is trivial & the carrier of b3 in FinSETS holds
b3 in b2 ) & ( for b3, b4 being strict RelStr st the carrier of b3 misses the carrier of b4 & b3 in b2 & b4 in b2 holds
( union_of b3,b4 in b2 & sum_of b3,b4 in b2 ) ) & ( for b3 being Subset of fin_RelStr st ( for b4 being strict RelStr st not the carrier of b4 is empty & the carrier of b4 is trivial & the carrier of b4 in FinSETS holds
b4 in b3 ) & ( for b4, b5 being strict RelStr st the carrier of b4 misses the carrier of b5 & b4 in b3 & b5 in b3 holds
( union_of b4,b5 in b3 & sum_of b4,b5 in b3 ) ) holds
b2 c= b3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def5 defines fin_RelStr_sp NECKLA_2:def 5 :
for b1 being Subset of fin_RelStr holds
( b1 = fin_RelStr_sp iff ( ( for b2 being strict RelStr st not the carrier of b2 is empty & the carrier of b2 is trivial & the carrier of b2 in FinSETS holds
b2 in b1 ) & ( for b2, b3 being strict RelStr st the carrier of b2 misses the carrier of b3 & b2 in b1 & b3 in b1 holds
( union_of b2,b3 in b1 & sum_of b2,b3 in b1 ) ) & ( for b2 being Subset of fin_RelStr st ( for b3 being strict RelStr st not the carrier of b3 is empty & the carrier of b3 is trivial & the carrier of b3 in FinSETS holds
b3 in b2 ) & ( for b3, b4 being strict RelStr st the carrier of b3 misses the carrier of b4 & b3 in b2 & b4 in b2 holds
( union_of b3,b4 in b2 & sum_of b3,b4 in b2 ) ) holds
b1 c= b2 ) ) );

registration
cluster fin_RelStr_sp -> non empty ;
correctness
coherence
not fin_RelStr_sp is empty
;
proof end;
end;

theorem Th4: :: NECKLA_2:4
for b1 being set st b1 in fin_RelStr_sp holds
b1 is non empty strict finite RelStr
proof end;

theorem Th5: :: NECKLA_2:5
for b1 being RelStr st b1 in fin_RelStr_sp holds
the carrier of b1 in FinSETS
proof end;

theorem Th6: :: NECKLA_2:6
for b1 being set holds
( not b1 in fin_RelStr_sp or b1 is non empty strict trivial RelStr or ex b2, b3 being strict RelStr st
( the carrier of b2 misses the carrier of b3 & b2 in fin_RelStr_sp & b3 in fin_RelStr_sp & ( b1 = union_of b2,b3 or b1 = sum_of b2,b3 ) ) )
proof end;

Lemma11: the carrier of (Necklace 4) = {0,1,2,3}
by NECKLACE:2, NECKLACE:21;

theorem Th7: :: NECKLA_2:7
for b1 being non empty strict RelStr st b1 in fin_RelStr_sp holds
b1 is N-free
proof end;