:: SGRAPH1 semantic presentation

Lemma1: for b1 being set
for b2 being Nat st b1 in Seg b2 holds
ex b3 being Nat st
( b1 = b3 & 1 <= b3 & b3 <= b2 )
proof end;

definition
let c1, c2 be natural number ;
func nat_interval c1,c2 -> Subset of NAT equals :: SGRAPH1:def 1
{ b1 where B is Nat : ( a1 <= b1 & b1 <= a2 ) } ;
coherence
{ b1 where B is Nat : ( c1 <= b1 & b1 <= c2 ) } is Subset of NAT
proof end;
end;

:: deftheorem Def1 defines nat_interval SGRAPH1:def 1 :
for b1, b2 being natural number holds nat_interval b1,b2 = { b3 where B is Nat : ( b1 <= b3 & b3 <= b2 ) } ;

notation
let c1, c2 be natural number ;
synonym Seg c1,c2 for nat_interval c1,c2;
end;

registration
let c1, c2 be natural number ;
cluster nat_interval a1,a2 -> finite ;
coherence
nat_interval c1,c2 is finite
proof end;
end;

theorem Th1: :: SGRAPH1:1
canceled;

theorem Th2: :: SGRAPH1:2
for b1, b2 being Nat
for b3 being set holds
( b3 in nat_interval b1,b2 iff ex b4 being Nat st
( b3 = b4 & b1 <= b4 & b4 <= b2 ) ) ;

theorem Th3: :: SGRAPH1:3
for b1, b2, b3 being Nat holds
( b3 in nat_interval b1,b2 iff ( b1 <= b3 & b3 <= b2 ) )
proof end;

theorem Th4: :: SGRAPH1:4
for b1 being Nat holds nat_interval 1,b1 = Seg b1
proof end;

theorem Th5: :: SGRAPH1:5
for b1, b2 being Nat st 1 <= b1 holds
nat_interval b1,b2 c= Seg b2
proof end;

theorem Th6: :: SGRAPH1:6
for b1, b2, b3 being Nat st b1 < b2 holds
Seg b1 misses nat_interval b2,b3
proof end;

theorem Th7: :: SGRAPH1:7
for b1, b2 being Nat st b2 < b1 holds
nat_interval b1,b2 = {}
proof end;

Lemma4: for b1 being set
for b2 being Subset of b1
for b3 being set st b3 in b1 holds
b2 \/ {b3} is Subset of b1
proof end;

definition
let c1 be set ;
canceled;
canceled;
func TWOELEMENTSETS c1 -> set equals :: SGRAPH1:def 4
{ b1 where B is finite Subset of a1 : card b1 = 2 } ;
coherence
{ b1 where B is finite Subset of c1 : card b1 = 2 } is set
;
end;

:: deftheorem Def2 SGRAPH1:def 2 :
canceled;

:: deftheorem Def3 SGRAPH1:def 3 :
canceled;

:: deftheorem Def4 defines TWOELEMENTSETS SGRAPH1:def 4 :
for b1 being set holds TWOELEMENTSETS b1 = { b2 where B is finite Subset of b1 : card b2 = 2 } ;

theorem Th8: :: SGRAPH1:8
canceled;

theorem Th9: :: SGRAPH1:9
for b1, b2 being set holds
( b2 in TWOELEMENTSETS b1 iff ex b3 being finite Subset of b1 st
( b2 = b3 & card b3 = 2 ) ) ;

theorem Th10: :: SGRAPH1:10
for b1, b2 being set holds
( b2 in TWOELEMENTSETS b1 iff ( b2 is finite Subset of b1 & ex b3, b4 being set st
( b3 in b1 & b4 in b1 & b3 <> b4 & b2 = {b3,b4} ) ) )
proof end;

theorem Th11: :: SGRAPH1:11
for b1 being set holds TWOELEMENTSETS b1 c= bool b1
proof end;

theorem Th12: :: SGRAPH1:12
for b1, b2, b3 being set st {b2,b3} in TWOELEMENTSETS b1 holds
( b2 in b1 & b3 in b1 & b2 <> b3 )
proof end;

theorem Th13: :: SGRAPH1:13
TWOELEMENTSETS {} = {}
proof end;

theorem Th14: :: SGRAPH1:14
for b1, b2 being set st b1 c= b2 holds
TWOELEMENTSETS b1 c= TWOELEMENTSETS b2
proof end;

theorem Th15: :: SGRAPH1:15
for b1 being finite set holds TWOELEMENTSETS b1 is finite
proof end;

theorem Th16: :: SGRAPH1:16
for b1 being non trivial set holds not TWOELEMENTSETS b1 is empty
proof end;

theorem Th17: :: SGRAPH1:17
for b1 being set holds TWOELEMENTSETS {b1} = {}
proof end;

registration
let c1 be empty set ;
cluster -> empty Element of bool a1;
coherence
for b1 being Subset of c1 holds b1 is empty
by XBOOLE_1:3;
end;

definition
attr a1 is strict;
struct SimpleGraphStruct -> 1-sorted ;
aggr SimpleGraphStruct(# carrier, SEdges #) -> SimpleGraphStruct ;
sel SEdges c1 -> Subset of (TWOELEMENTSETS the carrier of a1);
end;

definition
let c1 be set ;
canceled;
func SIMPLEGRAPHS c1 -> set equals :: SGRAPH1:def 6
{ SimpleGraphStruct(# b1,b2 #) where B is finite Subset of a1, B is finite Subset of (TWOELEMENTSETS b1) : verum } ;
coherence
{ SimpleGraphStruct(# b1,b2 #) where B is finite Subset of c1, B is finite Subset of (TWOELEMENTSETS b1) : verum } is set
;
end;

:: deftheorem Def5 SGRAPH1:def 5 :
canceled;

:: deftheorem Def6 defines SIMPLEGRAPHS SGRAPH1:def 6 :
for b1 being set holds SIMPLEGRAPHS b1 = { SimpleGraphStruct(# b2,b3 #) where B is finite Subset of b1, B is finite Subset of (TWOELEMENTSETS b2) : verum } ;

theorem Th18: :: SGRAPH1:18
canceled;

theorem Th19: :: SGRAPH1:19
for b1 being set holds SimpleGraphStruct(# {} ,({} (TWOELEMENTSETS {} )) #) in SIMPLEGRAPHS b1
proof end;

registration
let c1 be set ;
cluster SIMPLEGRAPHS a1 -> non empty ;
coherence
not SIMPLEGRAPHS c1 is empty
by Th19;
end;

definition
let c1 be set ;
mode SimpleGraph of c1 -> strict SimpleGraphStruct means :Def7: :: SGRAPH1:def 7
a2 is Element of SIMPLEGRAPHS a1;
existence
ex b1 being strict SimpleGraphStruct st b1 is Element of SIMPLEGRAPHS c1
proof end;
end;

:: deftheorem Def7 defines SimpleGraph SGRAPH1:def 7 :
for b1 being set
for b2 being strict SimpleGraphStruct holds
( b2 is SimpleGraph of b1 iff b2 is Element of SIMPLEGRAPHS b1 );

theorem Th20: :: SGRAPH1:20
canceled;

theorem Th21: :: SGRAPH1:21
for b1, b2 being set holds
( b2 in SIMPLEGRAPHS b1 iff ex b3 being finite Subset of b1ex b4 being finite Subset of (TWOELEMENTSETS b3) st b2 = SimpleGraphStruct(# b3,b4 #) ) ;

theorem Th22: :: SGRAPH1:22
canceled;

theorem Th23: :: SGRAPH1:23
for b1 being set
for b2 being SimpleGraph of b1 holds
( the carrier of b2 c= b1 & the SEdges of b2 c= TWOELEMENTSETS the carrier of b2 )
proof end;

theorem Th24: :: SGRAPH1:24
canceled;

theorem Th25: :: SGRAPH1:25
for b1 being set
for b2 being SimpleGraph of b1
for b3 being set st b3 in the SEdges of b2 holds
ex b4, b5 being set st
( b4 in the carrier of b2 & b5 in the carrier of b2 & b4 <> b5 & b3 = {b4,b5} ) by Th10;

theorem Th26: :: SGRAPH1:26
for b1 being set
for b2 being SimpleGraph of b1
for b3, b4 being set st {b3,b4} in the SEdges of b2 holds
( b3 in the carrier of b2 & b4 in the carrier of b2 & b3 <> b4 ) by Th12;

theorem Th27: :: SGRAPH1:27
for b1 being set
for b2 being SimpleGraph of b1 holds
( the carrier of b2 is finite Subset of b1 & the SEdges of b2 is finite Subset of (TWOELEMENTSETS the carrier of b2) )
proof end;

definition
let c1 be set ;
let c2, c3 be SimpleGraph of c1;
pred c2 is_isomorphic_to c3 means :: SGRAPH1:def 8
ex b1 being Function of the carrier of a2,the carrier of a3 st
( b1 is bijective & ( for b2, b3 being Element of a2 holds
( {b2,b3} in the SEdges of a2 iff {(b1 . b2),(b1 . b3)} in the SEdges of a2 ) ) );
end;

:: deftheorem Def8 defines is_isomorphic_to SGRAPH1:def 8 :
for b1 being set
for b2, b3 being SimpleGraph of b1 holds
( b2 is_isomorphic_to b3 iff ex b4 being Function of the carrier of b2,the carrier of b3 st
( b4 is bijective & ( for b5, b6 being Element of b2 holds
( {b5,b6} in the SEdges of b2 iff {(b4 . b5),(b4 . b6)} in the SEdges of b2 ) ) ) );

scheme :: SGRAPH1:sch 1
s1{ F1() -> set , P1[ set ] } :
for b1 being set st b1 in SIMPLEGRAPHS F1() holds
P1[b1]
provided
E16: P1[ SimpleGraphStruct(# {} ,({} (TWOELEMENTSETS {} )) #)] and
E17: for b1 being SimpleGraph of F1()
for b2 being set st b1 in SIMPLEGRAPHS F1() & P1[b1] & b2 in F1() & not b2 in the carrier of b1 holds
P1[ SimpleGraphStruct(# (the carrier of b1 \/ {b2}),({} (TWOELEMENTSETS (the carrier of b1 \/ {b2}))) #)] and
E18: for b1 being SimpleGraph of F1()
for b2 being set st P1[b1] & b2 in TWOELEMENTSETS the carrier of b1 & not b2 in the SEdges of b1 holds
ex b3 being Subset of (TWOELEMENTSETS the carrier of b1) st
( b3 = the SEdges of b1 \/ {b2} & P1[ SimpleGraphStruct(# the carrier of b1,b3 #)] )
proof end;

theorem Th28: :: SGRAPH1:28
for b1 being set
for b2 being SimpleGraph of b1 holds
( b2 = SimpleGraphStruct(# {} ,({} (TWOELEMENTSETS {} )) #) or ex b3 being set ex b4 being Subset of (TWOELEMENTSETS b3) st
( not b3 is empty & b2 = SimpleGraphStruct(# b3,b4 #) ) )
proof end;

theorem Th29: :: SGRAPH1:29
canceled;

theorem Th30: :: SGRAPH1:30
for b1 being set
for b2 being Subset of b1
for b3 being Subset of (TWOELEMENTSETS b2)
for b4 being set
for b5 being finite Subset of (TWOELEMENTSETS (b2 \/ {b4})) st SimpleGraphStruct(# b2,b3 #) in SIMPLEGRAPHS b1 & b4 in b1 & not b4 in b2 holds
SimpleGraphStruct(# (b2 \/ {b4}),b5 #) in SIMPLEGRAPHS b1
proof end;

theorem Th31: :: SGRAPH1:31
for b1 being set
for b2 being Subset of b1
for b3 being Subset of (TWOELEMENTSETS b2)
for b4, b5 being set st b4 in b2 & b5 in b2 & b4 <> b5 & SimpleGraphStruct(# b2,b3 #) in SIMPLEGRAPHS b1 holds
ex b6 being finite Subset of (TWOELEMENTSETS b2) st
( b6 = b3 \/ {{b4,b5}} & SimpleGraphStruct(# b2,b6 #) in SIMPLEGRAPHS b1 )
proof end;

definition
let c1, c2 be set ;
pred c2 is_SetOfSimpleGraphs_of c1 means :Def9: :: SGRAPH1:def 9
( SimpleGraphStruct(# {} ,({} (TWOELEMENTSETS {} )) #) in a2 & ( for b1 being Subset of a1
for b2 being Subset of (TWOELEMENTSETS b1)
for b3 being set
for b4 being finite Subset of (TWOELEMENTSETS (b1 \/ {b3})) st SimpleGraphStruct(# b1,b2 #) in a2 & b3 in a1 & not b3 in b1 holds
SimpleGraphStruct(# (b1 \/ {b3}),b4 #) in a2 ) & ( for b1 being Subset of a1
for b2 being Subset of (TWOELEMENTSETS b1)
for b3, b4 being set st SimpleGraphStruct(# b1,b2 #) in a2 & b3 in b1 & b4 in b1 & b3 <> b4 & not {b3,b4} in b2 holds
ex b5 being finite Subset of (TWOELEMENTSETS b1) st
( b5 = b2 \/ {{b3,b4}} & SimpleGraphStruct(# b1,b5 #) in a2 ) ) );
end;

:: deftheorem Def9 defines is_SetOfSimpleGraphs_of SGRAPH1:def 9 :
for b1, b2 being set holds
( b2 is_SetOfSimpleGraphs_of b1 iff ( SimpleGraphStruct(# {} ,({} (TWOELEMENTSETS {} )) #) in b2 & ( for b3 being Subset of b1
for b4 being Subset of (TWOELEMENTSETS b3)
for b5 being set
for b6 being finite Subset of (TWOELEMENTSETS (b3 \/ {b5})) st SimpleGraphStruct(# b3,b4 #) in b2 & b5 in b1 & not b5 in b3 holds
SimpleGraphStruct(# (b3 \/ {b5}),b6 #) in b2 ) & ( for b3 being Subset of b1
for b4 being Subset of (TWOELEMENTSETS b3)
for b5, b6 being set st SimpleGraphStruct(# b3,b4 #) in b2 & b5 in b3 & b6 in b3 & b5 <> b6 & not {b5,b6} in b4 holds
ex b7 being finite Subset of (TWOELEMENTSETS b3) st
( b7 = b4 \/ {{b5,b6}} & SimpleGraphStruct(# b3,b7 #) in b2 ) ) ) );

theorem Th32: :: SGRAPH1:32
canceled;

theorem Th33: :: SGRAPH1:33
canceled;

theorem Th34: :: SGRAPH1:34
canceled;

theorem Th35: :: SGRAPH1:35
for b1 being set holds SIMPLEGRAPHS b1 is_SetOfSimpleGraphs_of b1
proof end;

theorem Th36: :: SGRAPH1:36
for b1, b2 being set st b2 is_SetOfSimpleGraphs_of b1 holds
SIMPLEGRAPHS b1 c= b2
proof end;

theorem Th37: :: SGRAPH1:37
for b1 being set holds
( SIMPLEGRAPHS b1 is_SetOfSimpleGraphs_of b1 & ( for b2 being set st b2 is_SetOfSimpleGraphs_of b1 holds
SIMPLEGRAPHS b1 c= b2 ) ) by Th35, Th36;

definition
let c1 be set ;
let c2 be SimpleGraph of c1;
mode SubGraph of c2 -> SimpleGraph of a1 means :: SGRAPH1:def 10
( the carrier of a3 c= the carrier of a2 & the SEdges of a3 c= the SEdges of a2 );
existence
ex b1 being SimpleGraph of c1 st
( the carrier of b1 c= the carrier of c2 & the SEdges of b1 c= the SEdges of c2 )
;
end;

:: deftheorem Def10 defines SubGraph SGRAPH1:def 10 :
for b1 being set
for b2, b3 being SimpleGraph of b1 holds
( b3 is SubGraph of b2 iff ( the carrier of b3 c= the carrier of b2 & the SEdges of b3 c= the SEdges of b2 ) );

definition
let c1 be set ;
let c2 be SimpleGraph of c1;
let c3 be set ;
func degree c2,c3 -> Nat means :Def11: :: SGRAPH1:def 11
ex b1 being finite set st
( ( for b2 being set holds
( b2 in b1 iff ( b2 in the SEdges of a2 & a3 in b2 ) ) ) & a4 = card b1 );
existence
ex b1 being Natex b2 being finite set st
( ( for b3 being set holds
( b3 in b2 iff ( b3 in the SEdges of c2 & c3 in b3 ) ) ) & b1 = card b2 )
proof end;
uniqueness
for b1, b2 being Nat st ex b3 being finite set st
( ( for b4 being set holds
( b4 in b3 iff ( b4 in the SEdges of c2 & c3 in b4 ) ) ) & b1 = card b3 ) & ex b3 being finite set st
( ( for b4 being set holds
( b4 in b3 iff ( b4 in the SEdges of c2 & c3 in b4 ) ) ) & b2 = card b3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def11 defines degree SGRAPH1:def 11 :
for b1 being set
for b2 being SimpleGraph of b1
for b3 being set
for b4 being Nat holds
( b4 = degree b2,b3 iff ex b5 being finite set st
( ( for b6 being set holds
( b6 in b5 iff ( b6 in the SEdges of b2 & b3 in b6 ) ) ) & b4 = card b5 ) );

theorem Th38: :: SGRAPH1:38
canceled;

theorem Th39: :: SGRAPH1:39
for b1 being non empty set
for b2 being SimpleGraph of b1
for b3 being set ex b4 being finite set st
( b4 = { b5 where B is Element of b1 : ( b5 in the carrier of b2 & {b3,b5} in the SEdges of b2 ) } & degree b2,b3 = card b4 )
proof end;

theorem Th40: :: SGRAPH1:40
for b1 being non empty set
for b2 being SimpleGraph of b1
for b3 being set st b3 in the carrier of b2 holds
ex b4 being finite set st
( b4 = the carrier of b2 & degree b2,b3 < card b4 )
proof end;

theorem Th41: :: SGRAPH1:41
for b1 being set
for b2 being SimpleGraph of b1
for b3, b4 being set st b3 in the carrier of b2 & b4 in the SEdges of b2 & degree b2,b3 = 0 holds
not b3 in b4
proof end;

theorem Th42: :: SGRAPH1:42
for b1 being set
for b2 being SimpleGraph of b1
for b3 being set
for b4 being finite set st b4 = the carrier of b2 & b3 in b4 & 1 + (degree b2,b3) = card b4 holds
for b5 being Element of b4 st b3 <> b5 holds
ex b6 being set st
( b6 in the SEdges of b2 & b6 = {b3,b5} )
proof end;

definition
let c1 be set ;
let c2 be SimpleGraph of c1;
let c3, c4 be Element of c2;
let c5 be FinSequence of the carrier of c2;
pred c5 is_path_of c3,c4 means :Def12: :: SGRAPH1:def 12
( a5 . 1 = a3 & a5 . (len a5) = a4 & ( for b1 being Nat st 1 <= b1 & b1 < len a5 holds
{(a5 . b1),(a5 . (b1 + 1))} in the SEdges of a2 ) & ( for b1, b2 being Nat st 1 <= b1 & b1 < len a5 & b1 < b2 & b2 < len a5 holds
( a5 . b1 <> a5 . b2 & {(a5 . b1),(a5 . (b1 + 1))} <> {(a5 . b2),(a5 . (b2 + 1))} ) ) );
end;

:: deftheorem Def12 defines is_path_of SGRAPH1:def 12 :
for b1 being set
for b2 being SimpleGraph of b1
for b3, b4 being Element of b2
for b5 being FinSequence of the carrier of b2 holds
( b5 is_path_of b3,b4 iff ( b5 . 1 = b3 & b5 . (len b5) = b4 & ( for b6 being Nat st 1 <= b6 & b6 < len b5 holds
{(b5 . b6),(b5 . (b6 + 1))} in the SEdges of b2 ) & ( for b6, b7 being Nat st 1 <= b6 & b6 < len b5 & b6 < b7 & b7 < len b5 holds
( b5 . b6 <> b5 . b7 & {(b5 . b6),(b5 . (b6 + 1))} <> {(b5 . b7),(b5 . (b7 + 1))} ) ) ) );

definition
let c1 be set ;
let c2 be SimpleGraph of c1;
let c3, c4 be Element of the carrier of c2;
func PATHS c3,c4 -> Subset of (the carrier of a2 * ) equals :: SGRAPH1:def 13
{ b1 where B is Element of the carrier of a2 * : b1 is_path_of a3,a4 } ;
coherence
{ b1 where B is Element of the carrier of c2 * : b1 is_path_of c3,c4 } is Subset of (the carrier of c2 * )
proof end;
end;

:: deftheorem Def13 defines PATHS SGRAPH1:def 13 :
for b1 being set
for b2 being SimpleGraph of b1
for b3, b4 being Element of the carrier of b2 holds PATHS b3,b4 = { b5 where B is Element of the carrier of b2 * : b5 is_path_of b3,b4 } ;

theorem Th43: :: SGRAPH1:43
canceled;

theorem Th44: :: SGRAPH1:44
for b1 being set
for b2 being SimpleGraph of b1
for b3, b4 being Element of the carrier of b2
for b5 being set holds
( b5 in PATHS b3,b4 iff ex b6 being Element of the carrier of b2 * st
( b5 = b6 & b6 is_path_of b3,b4 ) ) ;

theorem Th45: :: SGRAPH1:45
for b1 being set
for b2 being SimpleGraph of b1
for b3, b4 being Element of the carrier of b2
for b5 being Element of the carrier of b2 * st b5 is_path_of b3,b4 holds
b5 in PATHS b3,b4 ;

definition
let c1 be set ;
let c2 be SimpleGraph of c1;
let c3 be set ;
pred c3 is_cycle_of c2 means :Def14: :: SGRAPH1:def 14
ex b1 being Element of the carrier of a2 st a3 in PATHS b1,b1;
end;

:: deftheorem Def14 defines is_cycle_of SGRAPH1:def 14 :
for b1 being set
for b2 being SimpleGraph of b1
for b3 being set holds
( b3 is_cycle_of b2 iff ex b4 being Element of the carrier of b2 st b3 in PATHS b4,b4 );

definition
let c1, c2 be Nat;
canceled;
func K_ c2,c1 -> SimpleGraph of NAT means :: SGRAPH1:def 16
ex b1 being Subset of (TWOELEMENTSETS (Seg (a2 + a1))) st
( b1 = { {b2,b3} where B is Element of NAT , B is Element of NAT : ( b2 in Seg a2 & b3 in nat_interval (a2 + 1),(a2 + a1) ) } & a3 = SimpleGraphStruct(# (Seg (a2 + a1)),b1 #) );
existence
ex b1 being SimpleGraph of NAT ex b2 being Subset of (TWOELEMENTSETS (Seg (c2 + c1))) st
( b2 = { {b3,b4} where B is Element of NAT , B is Element of NAT : ( b3 in Seg c2 & b4 in nat_interval (c2 + 1),(c2 + c1) ) } & b1 = SimpleGraphStruct(# (Seg (c2 + c1)),b2 #) )
proof end;
uniqueness
for b1, b2 being SimpleGraph of NAT st ex b3 being Subset of (TWOELEMENTSETS (Seg (c2 + c1))) st
( b3 = { {b4,b5} where B is Element of NAT , B is Element of NAT : ( b4 in Seg c2 & b5 in nat_interval (c2 + 1),(c2 + c1) ) } & b1 = SimpleGraphStruct(# (Seg (c2 + c1)),b3 #) ) & ex b3 being Subset of (TWOELEMENTSETS (Seg (c2 + c1))) st
( b3 = { {b4,b5} where B is Element of NAT , B is Element of NAT : ( b4 in Seg c2 & b5 in nat_interval (c2 + 1),(c2 + c1) ) } & b2 = SimpleGraphStruct(# (Seg (c2 + c1)),b3 #) ) holds
b1 = b2
;
end;

:: deftheorem Def15 SGRAPH1:def 15 :
canceled;

:: deftheorem Def16 defines K_ SGRAPH1:def 16 :
for b1, b2 being Nat
for b3 being SimpleGraph of NAT holds
( b3 = K_ b2,b1 iff ex b4 being Subset of (TWOELEMENTSETS (Seg (b2 + b1))) st
( b4 = { {b5,b6} where B is Element of NAT , B is Element of NAT : ( b5 in Seg b2 & b6 in nat_interval (b2 + 1),(b2 + b1) ) } & b3 = SimpleGraphStruct(# (Seg (b2 + b1)),b4 #) ) );

definition
let c1 be Nat;
func K_ c1 -> SimpleGraph of NAT means :Def17: :: SGRAPH1:def 17
ex b1 being finite Subset of (TWOELEMENTSETS (Seg a1)) st
( b1 = { {b2,b3} where B is Element of NAT , B is Element of NAT : ( b2 in Seg a1 & b3 in Seg a1 & b2 <> b3 ) } & a2 = SimpleGraphStruct(# (Seg a1),b1 #) );
existence
ex b1 being SimpleGraph of NAT ex b2 being finite Subset of (TWOELEMENTSETS (Seg c1)) st
( b2 = { {b3,b4} where B is Element of NAT , B is Element of NAT : ( b3 in Seg c1 & b4 in Seg c1 & b3 <> b4 ) } & b1 = SimpleGraphStruct(# (Seg c1),b2 #) )
proof end;
uniqueness
for b1, b2 being SimpleGraph of NAT st ex b3 being finite Subset of (TWOELEMENTSETS (Seg c1)) st
( b3 = { {b4,b5} where B is Element of NAT , B is Element of NAT : ( b4 in Seg c1 & b5 in Seg c1 & b4 <> b5 ) } & b1 = SimpleGraphStruct(# (Seg c1),b3 #) ) & ex b3 being finite Subset of (TWOELEMENTSETS (Seg c1)) st
( b3 = { {b4,b5} where B is Element of NAT , B is Element of NAT : ( b4 in Seg c1 & b5 in Seg c1 & b4 <> b5 ) } & b2 = SimpleGraphStruct(# (Seg c1),b3 #) ) holds
b1 = b2
;
end;

:: deftheorem Def17 defines K_ SGRAPH1:def 17 :
for b1 being Nat
for b2 being SimpleGraph of NAT holds
( b2 = K_ b1 iff ex b3 being finite Subset of (TWOELEMENTSETS (Seg b1)) st
( b3 = { {b4,b5} where B is Element of NAT , B is Element of NAT : ( b4 in Seg b1 & b5 in Seg b1 & b4 <> b5 ) } & b2 = SimpleGraphStruct(# (Seg b1),b3 #) ) );

definition
func TriangleGraph -> SimpleGraph of NAT equals :: SGRAPH1:def 18
K_ 3;
correctness
coherence
K_ 3 is SimpleGraph of NAT
;
;
end;

:: deftheorem Def18 defines TriangleGraph SGRAPH1:def 18 :
TriangleGraph = K_ 3;

theorem Th46: :: SGRAPH1:46
ex b1 being Subset of (TWOELEMENTSETS (Seg 3)) st
( b1 = {{1,2},{2,3},{3,1}} & TriangleGraph = SimpleGraphStruct(# (Seg 3),b1 #) )
proof end;

theorem Th47: :: SGRAPH1:47
( the carrier of TriangleGraph = Seg 3 & the SEdges of TriangleGraph = {{1,2},{2,3},{3,1}} ) by Th46;

theorem Th48: :: SGRAPH1:48
( {1,2} in the SEdges of TriangleGraph & {2,3} in the SEdges of TriangleGraph & {3,1} in the SEdges of TriangleGraph ) by Th46, ENUMSET1:def 1;

theorem Th49: :: SGRAPH1:49
((<*1*> ^ <*2*>) ^ <*3*>) ^ <*1*> is_cycle_of TriangleGraph
proof end;