:: NECKLACE semantic presentation

definition
let c1, c2, c3, c4, c5 be set ;
pred c1,c2,c3,c4,c5 are_mutually_different means :Def1: :: NECKLACE:def 1
( a1 <> a2 & a1 <> a3 & a1 <> a4 & a1 <> a5 & a2 <> a3 & a2 <> a4 & a2 <> a5 & a3 <> a4 & a3 <> a5 & a4 <> a5 );
end;

:: deftheorem Def1 defines are_mutually_different NECKLACE:def 1 :
for b1, b2, b3, b4, b5 being set holds
( b1,b2,b3,b4,b5 are_mutually_different iff ( b1 <> b2 & b1 <> b3 & b1 <> b4 & b1 <> b5 & b2 <> b3 & b2 <> b4 & b2 <> b5 & b3 <> b4 & b3 <> b5 & b4 <> b5 ) );

theorem Th1: :: NECKLACE:1
for b1, b2, b3, b4, b5 being set st b1,b2,b3,b4,b5 are_mutually_different holds
card {b1,b2,b3,b4,b5} = 5
proof end;

theorem Th2: :: NECKLACE:2
4 = {0,1,2,3}
proof end;

theorem Th3: :: NECKLACE:3
for b1, b2, b3, b4, b5, b6 being set holds [:{b1,b2,b3},{b4,b5,b6}:] = {[b1,b4],[b1,b5],[b1,b6],[b2,b4],[b2,b5],[b2,b6],[b3,b4],[b3,b5],[b3,b6]}
proof end;

theorem Th4: :: NECKLACE:4
for b1 being set
for b2 being natural number st b1 in b2 holds
b1 is natural number
proof end;

theorem Th5: :: NECKLACE:5
for b1 being non empty natural number holds 0 in b1
proof end;

registration
cluster natural -> cardinal set ;
coherence
for b1 being set st b1 is natural holds
b1 is cardinal
proof end;
end;

registration
let c1 be set ;
cluster delta a1 -> one-to-one ;
coherence
delta c1 is one-to-one
proof end;
end;

theorem Th6: :: NECKLACE:6
for b1 being set holds Card (id b1) = Card b1
proof end;

registration
let c1 be trivial Relation;
cluster dom a1 -> trivial ;
coherence
dom c1 is trivial
proof end;
end;

registration
cluster trivial -> one-to-one set ;
coherence
for b1 being Function st b1 is trivial holds
b1 is one-to-one
proof end;
end;

theorem Th7: :: NECKLACE:7
for b1, b2 being Function st dom b1 misses dom b2 holds
rng (b1 +* b2) = (rng b1) \/ (rng b2)
proof end;

theorem Th8: :: NECKLACE:8
for b1, b2 being one-to-one Function st dom b1 misses dom b2 & rng b1 misses rng b2 holds
(b1 +* b2) " = (b1 " ) +* (b2 " )
proof end;

theorem Th9: :: NECKLACE:9
for b1, b2, b3 being set holds (b1 --> b2) +* (b1 --> b3) = b1 --> b3
proof end;

theorem Th10: :: NECKLACE:10
for b1, b2 being set holds (b1 .--> b2) " = b2 .--> b1
proof end;

theorem Th11: :: NECKLACE:11
for b1, b2, b3, b4 being set holds
not ( ( b1 = b2 implies b3 = b4 ) & ( b3 = b4 implies b1 = b2 ) & not (b1,b2 --> b3,b4) " = b3,b4 --> b1,b2 )
proof end;

scheme :: NECKLACE:sch 1
s1{ F1() -> non empty set , F2() -> Relation, F3( set ) -> set , F4( set ) -> set , P1[ set ] } :
F2() ~ = { [F3(b1),F4(b1)] where B is Element of F1() : P1[b1] }
provided
E11: F2() = { [F4(b1),F3(b1)] where B is Element of F1() : P1[b1] }
proof end;

theorem Th12: :: NECKLACE:12
for b1, b2, b3 being natural number st b1 < b2 & b2 in b3 holds
b1 in b3
proof end;

definition
let c1, c2 be RelStr ;
pred c2 embeds c1 means :Def2: :: NECKLACE:def 2
ex b1 being Function of a1,a2 st
( b1 is one-to-one & ( for b2, b3 being Element of a1 holds
( [b2,b3] in the InternalRel of a1 iff [(b1 . b2),(b1 . b3)] in the InternalRel of a2 ) ) );
end;

:: deftheorem Def2 defines embeds NECKLACE:def 2 :
for b1, b2 being RelStr holds
( b2 embeds b1 iff ex b3 being Function of b1,b2 st
( b3 is one-to-one & ( for b4, b5 being Element of b1 holds
( [b4,b5] in the InternalRel of b1 iff [(b3 . b4),(b3 . b5)] in the InternalRel of b2 ) ) ) );

definition
let c1, c2 be non empty RelStr ;
redefine pred embeds as c2 embeds c1;
reflexivity
for b1 being non empty RelStr holds b1 embeds b1
proof end;
end;

theorem Th13: :: NECKLACE:13
for b1, b2, b3 being non empty RelStr st b1 embeds b2 & b2 embeds b3 holds
b1 embeds b3
proof end;

definition
let c1, c2 be non empty RelStr ;
pred c1 is_equimorphic_to c2 means :Def3: :: NECKLACE:def 3
( a1 embeds a2 & a2 embeds a1 );
reflexivity
for b1 being non empty RelStr holds
( b1 embeds b1 & b1 embeds b1 )
;
symmetry
for b1, b2 being non empty RelStr st b1 embeds b2 & b2 embeds b1 holds
( b2 embeds b1 & b1 embeds b2 )
;
end;

:: deftheorem Def3 defines is_equimorphic_to NECKLACE:def 3 :
for b1, b2 being non empty RelStr holds
( b1 is_equimorphic_to b2 iff ( b1 embeds b2 & b2 embeds b1 ) );

theorem Th14: :: NECKLACE:14
for b1, b2, b3 being non empty RelStr st b1 is_equimorphic_to b2 & b2 is_equimorphic_to b3 holds
b1 is_equimorphic_to b3
proof end;

notation
let c1 be non empty RelStr ;
synonym parallel c1 for connected c1;
end;

definition
let c1 be RelStr ;
attr a1 is symmetric means :Def4: :: NECKLACE:def 4
the InternalRel of a1 is_symmetric_in the carrier of a1;
end;

:: deftheorem Def4 defines symmetric NECKLACE:def 4 :
for b1 being RelStr holds
( b1 is symmetric iff the InternalRel of b1 is_symmetric_in the carrier of b1 );

definition
let c1 be RelStr ;
attr a1 is asymmetric means :Def5: :: NECKLACE:def 5
the InternalRel of a1 is asymmetric;
end;

:: deftheorem Def5 defines asymmetric NECKLACE:def 5 :
for b1 being RelStr holds
( b1 is asymmetric iff the InternalRel of b1 is asymmetric );

theorem Th15: :: NECKLACE:15
for b1 being RelStr st b1 is asymmetric holds
the InternalRel of b1 misses the InternalRel of b1 ~
proof end;

definition
let c1 be RelStr ;
attr a1 is irreflexive means :: NECKLACE:def 6
for b1 being set st b1 in the carrier of a1 holds
not [b1,b1] in the InternalRel of a1;
end;

:: deftheorem Def6 defines irreflexive NECKLACE:def 6 :
for b1 being RelStr holds
( b1 is irreflexive iff for b2 being set st b2 in the carrier of b1 holds
not [b2,b2] in the InternalRel of b1 );

definition
let c1 be natural number ;
func c1 -SuccRelStr -> strict RelStr means :Def7: :: NECKLACE:def 7
( the carrier of a2 = a1 & the InternalRel of a2 = { [b1,(b1 + 1)] where B is Nat : b1 + 1 < a1 } );
existence
ex b1 being strict RelStr st
( the carrier of b1 = c1 & the InternalRel of b1 = { [b2,(b2 + 1)] where B is Nat : b2 + 1 < c1 } )
proof end;
uniqueness
for b1, b2 being strict RelStr st the carrier of b1 = c1 & the InternalRel of b1 = { [b3,(b3 + 1)] where B is Nat : b3 + 1 < c1 } & the carrier of b2 = c1 & the InternalRel of b2 = { [b3,(b3 + 1)] where B is Nat : b3 + 1 < c1 } holds
b1 = b2
;
end;

:: deftheorem Def7 defines -SuccRelStr NECKLACE:def 7 :
for b1 being natural number
for b2 being strict RelStr holds
( b2 = b1 -SuccRelStr iff ( the carrier of b2 = b1 & the InternalRel of b2 = { [b3,(b3 + 1)] where B is Nat : b3 + 1 < b1 } ) );

theorem Th16: :: NECKLACE:16
for b1 being natural number holds b1 -SuccRelStr is asymmetric
proof end;

theorem Th17: :: NECKLACE:17
for b1 being natural number st b1 > 0 holds
Card the InternalRel of (b1 -SuccRelStr ) = b1 - 1
proof end;

definition
let c1 be RelStr ;
func SymRelStr c1 -> strict RelStr means :Def8: :: NECKLACE:def 8
( the carrier of a2 = the carrier of a1 & the InternalRel of a2 = the InternalRel of a1 \/ (the InternalRel of a1 ~ ) );
existence
ex b1 being strict RelStr st
( the carrier of b1 = the carrier of c1 & the InternalRel of b1 = the InternalRel of c1 \/ (the InternalRel of c1 ~ ) )
proof end;
uniqueness
for b1, b2 being strict RelStr st the carrier of b1 = the carrier of c1 & the InternalRel of b1 = the InternalRel of c1 \/ (the InternalRel of c1 ~ ) & the carrier of b2 = the carrier of c1 & the InternalRel of b2 = the InternalRel of c1 \/ (the InternalRel of c1 ~ ) holds
b1 = b2
;
end;

:: deftheorem Def8 defines SymRelStr NECKLACE:def 8 :
for b1 being RelStr
for b2 being strict RelStr holds
( b2 = SymRelStr b1 iff ( the carrier of b2 = the carrier of b1 & the InternalRel of b2 = the InternalRel of b1 \/ (the InternalRel of b1 ~ ) ) );

registration
let c1 be RelStr ;
cluster SymRelStr a1 -> strict symmetric ;
coherence
SymRelStr c1 is symmetric
proof end;
end;

registration
cluster non empty symmetric RelStr ;
existence
ex b1 being RelStr st
( not b1 is empty & b1 is symmetric )
proof end;
end;

registration
let c1 be symmetric RelStr ;
cluster the InternalRel of a1 -> symmetric ;
coherence
the InternalRel of c1 is symmetric
proof end;
end;

Lemma19: for b1, b2 being non empty RelStr st b1,b2 are_isomorphic holds
Card the InternalRel of b1 = Card the InternalRel of b2
proof end;

definition
let c1 be RelStr ;
func ComplRelStr c1 -> strict RelStr means :Def9: :: NECKLACE:def 9
( the carrier of a2 = the carrier of a1 & the InternalRel of a2 = (the InternalRel of a1 ` ) \ (id the carrier of a1) );
existence
ex b1 being strict RelStr st
( the carrier of b1 = the carrier of c1 & the InternalRel of b1 = (the InternalRel of c1 ` ) \ (id the carrier of c1) )
proof end;
uniqueness
for b1, b2 being strict RelStr st the carrier of b1 = the carrier of c1 & the InternalRel of b1 = (the InternalRel of c1 ` ) \ (id the carrier of c1) & the carrier of b2 = the carrier of c1 & the InternalRel of b2 = (the InternalRel of c1 ` ) \ (id the carrier of c1) holds
b1 = b2
;
end;

:: deftheorem Def9 defines ComplRelStr NECKLACE:def 9 :
for b1 being RelStr
for b2 being strict RelStr holds
( b2 = ComplRelStr b1 iff ( the carrier of b2 = the carrier of b1 & the InternalRel of b2 = (the InternalRel of b1 ` ) \ (id the carrier of b1) ) );

registration
let c1 be non empty RelStr ;
cluster ComplRelStr a1 -> non empty strict ;
coherence
not ComplRelStr c1 is empty
proof end;
end;

theorem Th18: :: NECKLACE:18
for b1, b2 being RelStr st b1,b2 are_isomorphic holds
Card the InternalRel of b1 = Card the InternalRel of b2
proof end;

definition
let c1 be natural number ;
func Necklace c1 -> strict RelStr equals :: NECKLACE:def 10
SymRelStr (a1 -SuccRelStr );
coherence
SymRelStr (c1 -SuccRelStr ) is strict RelStr
;
end;

:: deftheorem Def10 defines Necklace NECKLACE:def 10 :
for b1 being natural number holds Necklace b1 = SymRelStr (b1 -SuccRelStr );

registration
let c1 be natural number ;
cluster Necklace a1 -> strict symmetric ;
coherence
Necklace c1 is symmetric
;
end;

theorem Th19: :: NECKLACE:19
for b1 being natural number holds the InternalRel of (Necklace b1) = { [b2,(b2 + 1)] where B is Nat : b2 + 1 < b1 } \/ { [(b2 + 1),b2] where B is Nat : b2 + 1 < b1 }
proof end;

theorem Th20: :: NECKLACE:20
for b1 being natural number
for b2 being set holds
( b2 in the InternalRel of (Necklace b1) iff ex b3 being Nat st
( b3 + 1 < b1 & ( b2 = [b3,(b3 + 1)] or b2 = [(b3 + 1),b3] ) ) )
proof end;

registration
let c1 be natural number ;
cluster Necklace a1 -> strict symmetric irreflexive ;
coherence
Necklace c1 is irreflexive
proof end;
end;

theorem Th21: :: NECKLACE:21
for b1 being natural number holds the carrier of (Necklace b1) = b1
proof end;

registration
let c1 be non empty natural number ;
cluster Necklace a1 -> non empty strict symmetric irreflexive ;
coherence
not Necklace c1 is empty
proof end;
end;

registration
let c1 be natural number ;
cluster the carrier of (Necklace a1) -> finite ;
coherence
the carrier of (Necklace c1) is finite
by Th21;
end;

theorem Th22: :: NECKLACE:22
for b1, b2 being natural number st b2 + 1 < b1 holds
[b2,(b2 + 1)] in the InternalRel of (Necklace b1)
proof end;

theorem Th23: :: NECKLACE:23
for b1, b2 being natural number st b2 in the carrier of (Necklace b1) holds
b2 < b1
proof end;

theorem Th24: :: NECKLACE:24
for b1 being non empty natural number holds not Necklace b1 is parallel
proof end;

theorem Th25: :: NECKLACE:25
for b1 being natural number
for b2, b3 being natural number holds
( not [b2,b3] in the InternalRel of (Necklace b1) or b2 = b3 + 1 or b3 = b2 + 1 )
proof end;

theorem Th26: :: NECKLACE:26
for b1 being natural number
for b2, b3 being natural number st ( b2 = b3 + 1 or b3 = b2 + 1 ) & b2 in the carrier of (Necklace b1) & b3 in the carrier of (Necklace b1) holds
[b2,b3] in the InternalRel of (Necklace b1)
proof end;

theorem Th27: :: NECKLACE:27
for b1 being natural number st b1 > 0 holds
Card { [(b2 + 1),b2] where B is Nat : b2 + 1 < b1 } = b1 - 1
proof end;

theorem Th28: :: NECKLACE:28
for b1 being natural number st b1 > 0 holds
Card the InternalRel of (Necklace b1) = 2 * (b1 - 1)
proof end;

theorem Th29: :: NECKLACE:29
Necklace 1, ComplRelStr (Necklace 1) are_isomorphic
proof end;

theorem Th30: :: NECKLACE:30
Necklace 4, ComplRelStr (Necklace 4) are_isomorphic
proof end;

theorem Th31: :: NECKLACE:31
for b1 being natural number holds
( not Necklace b1, ComplRelStr (Necklace b1) are_isomorphic or b1 = 0 or b1 = 1 or b1 = 4 )
proof end;