:: GRAPH_1 semantic presentation

definition
attr a1 is strict;
struct MultiGraphStruct -> ;
aggr MultiGraphStruct(# Vertices, Edges, Source, Target #) -> MultiGraphStruct ;
sel Vertices c1 -> set ;
sel Edges c1 -> set ;
sel Source c1 -> Function of the Edges of a1,the Vertices of a1;
sel Target c1 -> Function of the Edges of a1,the Vertices of a1;
end;

set c1 = {1,2};

reconsider c2 = {} as Function of {} ,{1,2} by FUNCT_2:55, RELAT_1:60;

definition
let c3 be MultiGraphStruct ;
attr a1 is Graph-like means :Def1: :: GRAPH_1:def 1
the Vertices of a1 is non empty set ;
end;

:: deftheorem Def1 defines Graph-like GRAPH_1:def 1 :
for b1 being MultiGraphStruct holds
( b1 is Graph-like iff the Vertices of b1 is non empty set );

registration
cluster strict Graph-like MultiGraphStruct ;
existence
ex b1 being MultiGraphStruct st
( b1 is strict & b1 is Graph-like )
proof end;
end;

definition
mode Graph is Graph-like MultiGraphStruct ;
end;

Lemma2: for b1 being Graph holds
( dom the Source of b1 = the Edges of b1 & dom the Target of b1 = the Edges of b1 & rng the Source of b1 c= the Vertices of b1 & rng the Target of b1 c= the Vertices of b1 )
proof end;

Lemma3: for b1 being Graph
for b2 being Element of the Vertices of b1 holds b2 in the Vertices of b1
proof end;

definition
let c3, c4 be Graph;
assume E4: ( the Source of c3 tolerates the Source of c4 & the Target of c3 tolerates the Target of c4 ) ;
func c1 \/ c2 -> strict Graph means :Def2: :: GRAPH_1:def 2
( the Vertices of a3 = the Vertices of a1 \/ the Vertices of a2 & the Edges of a3 = the Edges of a1 \/ the Edges of a2 & ( for b1 being set st b1 in the Edges of a1 holds
( the Source of a3 . b1 = the Source of a1 . b1 & the Target of a3 . b1 = the Target of a1 . b1 ) ) & ( for b1 being set st b1 in the Edges of a2 holds
( the Source of a3 . b1 = the Source of a2 . b1 & the Target of a3 . b1 = the Target of a2 . b1 ) ) );
existence
ex b1 being strict Graph st
( the Vertices of b1 = the Vertices of c3 \/ the Vertices of c4 & the Edges of b1 = the Edges of c3 \/ the Edges of c4 & ( for b2 being set st b2 in the Edges of c3 holds
( the Source of b1 . b2 = the Source of c3 . b2 & the Target of b1 . b2 = the Target of c3 . b2 ) ) & ( for b2 being set st b2 in the Edges of c4 holds
( the Source of b1 . b2 = the Source of c4 . b2 & the Target of b1 . b2 = the Target of c4 . b2 ) ) )
proof end;
uniqueness
for b1, b2 being strict Graph st the Vertices of b1 = the Vertices of c3 \/ the Vertices of c4 & the Edges of b1 = the Edges of c3 \/ the Edges of c4 & ( for b3 being set st b3 in the Edges of c3 holds
( the Source of b1 . b3 = the Source of c3 . b3 & the Target of b1 . b3 = the Target of c3 . b3 ) ) & ( for b3 being set st b3 in the Edges of c4 holds
( the Source of b1 . b3 = the Source of c4 . b3 & the Target of b1 . b3 = the Target of c4 . b3 ) ) & the Vertices of b2 = the Vertices of c3 \/ the Vertices of c4 & the Edges of b2 = the Edges of c3 \/ the Edges of c4 & ( for b3 being set st b3 in the Edges of c3 holds
( the Source of b2 . b3 = the Source of c3 . b3 & the Target of b2 . b3 = the Target of c3 . b3 ) ) & ( for b3 being set st b3 in the Edges of c4 holds
( the Source of b2 . b3 = the Source of c4 . b3 & the Target of b2 . b3 = the Target of c4 . b3 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def2 defines \/ GRAPH_1:def 2 :
for b1, b2 being Graph st the Source of b1 tolerates the Source of b2 & the Target of b1 tolerates the Target of b2 holds
for b3 being strict Graph holds
( b3 = b1 \/ b2 iff ( the Vertices of b3 = the Vertices of b1 \/ the Vertices of b2 & the Edges of b3 = the Edges of b1 \/ the Edges of b2 & ( for b4 being set st b4 in the Edges of b1 holds
( the Source of b3 . b4 = the Source of b1 . b4 & the Target of b3 . b4 = the Target of b1 . b4 ) ) & ( for b4 being set st b4 in the Edges of b2 holds
( the Source of b3 . b4 = the Source of b2 . b4 & the Target of b3 . b4 = the Target of b2 . b4 ) ) ) );

definition
let c3, c4, c5 be Graph;
pred c1 is_sum_of c2,c3 means :Def3: :: GRAPH_1:def 3
( the Target of a2 tolerates the Target of a3 & the Source of a2 tolerates the Source of a3 & MultiGraphStruct(# the Vertices of a1,the Edges of a1,the Source of a1,the Target of a1 #) = a2 \/ a3 );
end;

:: deftheorem Def3 defines is_sum_of GRAPH_1:def 3 :
for b1, b2, b3 being Graph holds
( b1 is_sum_of b2,b3 iff ( the Target of b2 tolerates the Target of b3 & the Source of b2 tolerates the Source of b3 & MultiGraphStruct(# the Vertices of b1,the Edges of b1,the Source of b1,the Target of b1 #) = b2 \/ b3 ) );

definition
let c3 be Graph;
attr a1 is oriented means :Def4: :: GRAPH_1:def 4
for b1, b2 being set st b1 in the Edges of a1 & b2 in the Edges of a1 & the Source of a1 . b1 = the Source of a1 . b2 & the Target of a1 . b1 = the Target of a1 . b2 holds
b1 = b2;
attr a1 is non-multi means :Def5: :: GRAPH_1:def 5
for b1, b2 being set st b1 in the Edges of a1 & b2 in the Edges of a1 & ( ( the Source of a1 . b1 = the Source of a1 . b2 & the Target of a1 . b1 = the Target of a1 . b2 ) or ( the Source of a1 . b1 = the Target of a1 . b2 & the Source of a1 . b2 = the Target of a1 . b1 ) ) holds
b1 = b2;
attr a1 is simple means :Def6: :: GRAPH_1:def 6
for b1 being set holds
( not b1 in the Edges of a1 or not the Source of a1 . b1 = the Target of a1 . b1 );
attr a1 is connected means :Def7: :: GRAPH_1:def 7
for b1, b2 being Graph holds
( not the Vertices of b1 misses the Vertices of b2 or not a1 is_sum_of b1,b2 );
end;

:: deftheorem Def4 defines oriented GRAPH_1:def 4 :
for b1 being Graph holds
( b1 is oriented iff for b2, b3 being set st b2 in the Edges of b1 & b3 in the Edges of b1 & the Source of b1 . b2 = the Source of b1 . b3 & the Target of b1 . b2 = the Target of b1 . b3 holds
b2 = b3 );

:: deftheorem Def5 defines non-multi GRAPH_1:def 5 :
for b1 being Graph holds
( b1 is non-multi iff for b2, b3 being set st b2 in the Edges of b1 & b3 in the Edges of b1 & ( ( the Source of b1 . b2 = the Source of b1 . b3 & the Target of b1 . b2 = the Target of b1 . b3 ) or ( the Source of b1 . b2 = the Target of b1 . b3 & the Source of b1 . b3 = the Target of b1 . b2 ) ) holds
b2 = b3 );

:: deftheorem Def6 defines simple GRAPH_1:def 6 :
for b1 being Graph holds
( b1 is simple iff for b2 being set holds
( not b2 in the Edges of b1 or not the Source of b1 . b2 = the Target of b1 . b2 ) );

:: deftheorem Def7 defines connected GRAPH_1:def 7 :
for b1 being Graph holds
( b1 is connected iff for b2, b3 being Graph holds
( not the Vertices of b2 misses the Vertices of b3 or not b1 is_sum_of b2,b3 ) );

definition
let c3 be MultiGraphStruct ;
attr a1 is finite means :Def8: :: GRAPH_1:def 8
( the Vertices of a1 is finite & the Edges of a1 is finite );
end;

:: deftheorem Def8 defines finite GRAPH_1:def 8 :
for b1 being MultiGraphStruct holds
( b1 is finite iff ( the Vertices of b1 is finite & the Edges of b1 is finite ) );

registration
cluster finite MultiGraphStruct ;
existence
ex b1 being MultiGraphStruct st b1 is finite
proof end;
cluster oriented non-multi simple connected finite MultiGraphStruct ;
existence
ex b1 being Graph st
( b1 is finite & b1 is non-multi & b1 is oriented & b1 is simple & b1 is connected )
proof end;
end;

definition
let c3 be Graph;
let c4, c5 be Element of the Vertices of c3;
let c6 be set ;
pred c4 joins c2,c3 means :: GRAPH_1:def 9
( ( the Source of a1 . a4 = a2 & the Target of a1 . a4 = a3 ) or ( the Source of a1 . a4 = a3 & the Target of a1 . a4 = a2 ) );
end;

:: deftheorem Def9 defines joins GRAPH_1:def 9 :
for b1 being Graph
for b2, b3 being Element of the Vertices of b1
for b4 being set holds
( b4 joins b2,b3 iff ( ( the Source of b1 . b4 = b2 & the Target of b1 . b4 = b3 ) or ( the Source of b1 . b4 = b3 & the Target of b1 . b4 = b2 ) ) );

definition
let c3 be Graph;
let c4, c5 be Element of the Vertices of c3;
pred c2,c3 are_incydent means :: GRAPH_1:def 10
ex b1 being set st
( b1 in the Edges of a1 & b1 joins a2,a3 );
end;

:: deftheorem Def10 defines are_incydent GRAPH_1:def 10 :
for b1 being Graph
for b2, b3 being Element of the Vertices of b1 holds
( b2,b3 are_incydent iff ex b4 being set st
( b4 in the Edges of b1 & b4 joins b2,b3 ) );

definition
let c3 be Graph;
mode Chain of c1 -> FinSequence means :Def11: :: GRAPH_1:def 11
( ( for b1 being Nat st 1 <= b1 & b1 <= len a2 holds
a2 . b1 in the Edges of a1 ) & ex b1 being FinSequence st
( len b1 = (len a2) + 1 & ( for b2 being Nat st 1 <= b2 & b2 <= len b1 holds
b1 . b2 in the Vertices of a1 ) & ( for b2 being Nat st 1 <= b2 & b2 <= len a2 holds
ex b3, b4 being Element of the Vertices of a1 st
( b3 = b1 . b2 & b4 = b1 . (b2 + 1) & a2 . b2 joins b3,b4 ) ) ) );
existence
ex b1 being FinSequence st
( ( for b2 being Nat st 1 <= b2 & b2 <= len b1 holds
b1 . b2 in the Edges of c3 ) & ex b2 being FinSequence st
( len b2 = (len b1) + 1 & ( for b3 being Nat st 1 <= b3 & b3 <= len b2 holds
b2 . b3 in the Vertices of c3 ) & ( for b3 being Nat st 1 <= b3 & b3 <= len b1 holds
ex b4, b5 being Element of the Vertices of c3 st
( b4 = b2 . b3 & b5 = b2 . (b3 + 1) & b1 . b3 joins b4,b5 ) ) ) )
proof end;
end;

:: deftheorem Def11 defines Chain GRAPH_1:def 11 :
for b1 being Graph
for b2 being FinSequence holds
( b2 is Chain of b1 iff ( ( for b3 being Nat st 1 <= b3 & b3 <= len b2 holds
b2 . b3 in the Edges of b1 ) & ex b3 being FinSequence st
( len b3 = (len b2) + 1 & ( for b4 being Nat st 1 <= b4 & b4 <= len b3 holds
b3 . b4 in the Vertices of b1 ) & ( for b4 being Nat st 1 <= b4 & b4 <= len b2 holds
ex b5, b6 being Element of the Vertices of b1 st
( b5 = b3 . b4 & b6 = b3 . (b4 + 1) & b2 . b4 joins b5,b6 ) ) ) ) );

Lemma12: for b1 being Graph holds {} is Chain of b1
proof end;

definition
let c3 be Graph;
redefine mode Chain as Chain of c1 -> FinSequence of the Edges of a1;
coherence
for b1 being Chain of c3 holds b1 is FinSequence of the Edges of c3
proof end;
end;

definition
let c3 be Graph;
let c4 be Chain of c3;
attr a2 is oriented means :Def12: :: GRAPH_1:def 12
for b1 being Nat st 1 <= b1 & b1 < len a2 holds
the Source of a1 . (a2 . (b1 + 1)) = the Target of a1 . (a2 . b1);
end;

:: deftheorem Def12 defines oriented GRAPH_1:def 12 :
for b1 being Graph
for b2 being Chain of b1 holds
( b2 is oriented iff for b3 being Nat st 1 <= b3 & b3 < len b2 holds
the Source of b1 . (b2 . (b3 + 1)) = the Target of b1 . (b2 . b3) );

registration
let c3 be Graph;
cluster oriented Chain of a1;
existence
ex b1 being Chain of c3 st b1 is oriented
proof end;
end;

Lemma14: for b1 being Graph holds {} is oriented Chain of b1
proof end;

definition
let c3 be Graph;
let c4 be Chain of c3;
redefine attr one-to-one as a2 is one-to-one means :: GRAPH_1:def 13
for b1, b2 being Nat st 1 <= b1 & b1 < b2 & b2 <= len a2 holds
a2 . b1 <> a2 . b2;
compatibility
( c4 is one-to-one iff for b1, b2 being Nat st 1 <= b1 & b1 < b2 & b2 <= len c4 holds
c4 . b1 <> c4 . b2 )
proof end;
end;

:: deftheorem Def13 defines one-to-one GRAPH_1:def 13 :
for b1 being Graph
for b2 being Chain of b1 holds
( b2 is one-to-one iff for b3, b4 being Nat st 1 <= b3 & b3 < b4 & b4 <= len b2 holds
b2 . b3 <> b2 . b4 );

registration
let c3 be Graph;
cluster V5 Chain of a1;
existence
ex b1 being Chain of c3 st b1 is one-to-one
proof end;
end;

definition
let c3 be Graph;
mode Path of a1 is V5 Chain of a1;
end;

registration
let c3 be Graph;
cluster V5 oriented Chain of a1;
existence
ex b1 being Chain of c3 st
( b1 is one-to-one & b1 is oriented )
proof end;
end;

definition
let c3 be Graph;
mode OrientedPath of a1 is V5 oriented Chain of a1;
end;

definition
let c3 be Graph;
let c4 be Path of c3;
canceled;
attr a2 is cyclic means :Def15: :: GRAPH_1:def 15
ex b1 being FinSequence st
( len b1 = (len a2) + 1 & ( for b2 being Nat st 1 <= b2 & b2 <= len b1 holds
b1 . b2 in the Vertices of a1 ) & ( for b2 being Nat st 1 <= b2 & b2 <= len a2 holds
ex b3, b4 being Element of the Vertices of a1 st
( b3 = b1 . b2 & b4 = b1 . (b2 + 1) & a2 . b2 joins b3,b4 ) ) & b1 . 1 = b1 . (len b1) );
end;

:: deftheorem Def14 GRAPH_1:def 14 :
canceled;

:: deftheorem Def15 defines cyclic GRAPH_1:def 15 :
for b1 being Graph
for b2 being Path of b1 holds
( b2 is cyclic iff ex b3 being FinSequence st
( len b3 = (len b2) + 1 & ( for b4 being Nat st 1 <= b4 & b4 <= len b3 holds
b3 . b4 in the Vertices of b1 ) & ( for b4 being Nat st 1 <= b4 & b4 <= len b2 holds
ex b5, b6 being Element of the Vertices of b1 st
( b5 = b3 . b4 & b6 = b3 . (b4 + 1) & b2 . b4 joins b5,b6 ) ) & b3 . 1 = b3 . (len b3) ) );

registration
let c3 be Graph;
cluster cyclic Chain of a1;
existence
ex b1 being Path of c3 st b1 is cyclic
proof end;
end;

definition
let c3 be Graph;
mode Cycle of a1 is cyclic Path of a1;
end;

Lemma16: for b1 being Graph holds {} is Cycle of b1
proof end;

registration
let c3 be Graph;
cluster cyclic Chain of a1;
existence
ex b1 being OrientedPath of c3 st b1 is cyclic
proof end;
end;

definition
let c3 be Graph;
mode OrientedCycle of a1 is cyclic OrientedPath of a1;
end;

Lemma17: for b1 being Graph
for b2 being set st b2 in the Edges of b1 holds
( the Source of b1 . b2 in the Vertices of b1 & the Target of b1 . b2 in the Vertices of b1 )
proof end;

definition
let c3 be Graph;
canceled;
mode Subgraph of c1 -> Graph means :Def17: :: GRAPH_1:def 17
( the Vertices of a2 c= the Vertices of a1 & the Edges of a2 c= the Edges of a1 & ( for b1 being set st b1 in the Edges of a2 holds
( the Source of a2 . b1 = the Source of a1 . b1 & the Target of a2 . b1 = the Target of a1 . b1 & the Source of a1 . b1 in the Vertices of a2 & the Target of a1 . b1 in the Vertices of a2 ) ) );
existence
ex b1 being Graph st
( the Vertices of b1 c= the Vertices of c3 & the Edges of b1 c= the Edges of c3 & ( for b2 being set st b2 in the Edges of b1 holds
( the Source of b1 . b2 = the Source of c3 . b2 & the Target of b1 . b2 = the Target of c3 . b2 & the Source of c3 . b2 in the Vertices of b1 & the Target of c3 . b2 in the Vertices of b1 ) ) )
proof end;
end;

:: deftheorem Def16 GRAPH_1:def 16 :
canceled;

:: deftheorem Def17 defines Subgraph GRAPH_1:def 17 :
for b1, b2 being Graph holds
( b2 is Subgraph of b1 iff ( the Vertices of b2 c= the Vertices of b1 & the Edges of b2 c= the Edges of b1 & ( for b3 being set st b3 in the Edges of b2 holds
( the Source of b2 . b3 = the Source of b1 . b3 & the Target of b2 . b3 = the Target of b1 . b3 & the Source of b1 . b3 in the Vertices of b2 & the Target of b1 . b3 in the Vertices of b2 ) ) ) );

registration
let c3 be Graph;
cluster strict Subgraph of a1;
existence
ex b1 being Subgraph of c3 st b1 is strict
proof end;
end;

definition
let c3 be finite Graph;
func VerticesCount c1 -> Nat means :: GRAPH_1:def 18
ex b1 being finite set st
( b1 = the Vertices of a1 & a2 = card b1 );
existence
ex b1 being Natex b2 being finite set st
( b2 = the Vertices of c3 & b1 = card b2 )
proof end;
uniqueness
for b1, b2 being Nat st ex b3 being finite set st
( b3 = the Vertices of c3 & b1 = card b3 ) & ex b3 being finite set st
( b3 = the Vertices of c3 & b2 = card b3 ) holds
b1 = b2
;
func EdgesCount c1 -> Nat means :: GRAPH_1:def 19
ex b1 being finite set st
( b1 = the Edges of a1 & a2 = card b1 );
existence
ex b1 being Natex b2 being finite set st
( b2 = the Edges of c3 & b1 = card b2 )
proof end;
uniqueness
for b1, b2 being Nat st ex b3 being finite set st
( b3 = the Edges of c3 & b1 = card b3 ) & ex b3 being finite set st
( b3 = the Edges of c3 & b2 = card b3 ) holds
b1 = b2
;
end;

:: deftheorem Def18 defines VerticesCount GRAPH_1:def 18 :
for b1 being finite Graph
for b2 being Nat holds
( b2 = VerticesCount b1 iff ex b3 being finite set st
( b3 = the Vertices of b1 & b2 = card b3 ) );

:: deftheorem Def19 defines EdgesCount GRAPH_1:def 19 :
for b1 being finite Graph
for b2 being Nat holds
( b2 = EdgesCount b1 iff ex b3 being finite set st
( b3 = the Edges of b1 & b2 = card b3 ) );

definition
let c3 be finite Graph;
let c4 be Element of the Vertices of c3;
func EdgesIn c2 -> Nat means :: GRAPH_1:def 20
ex b1 being finite set st
( ( for b2 being set holds
( b2 in b1 iff ( b2 in the Edges of a1 & the Target of a1 . b2 = a2 ) ) ) & a3 = card b1 );
existence
ex b1 being Natex b2 being finite set st
( ( for b3 being set holds
( b3 in b2 iff ( b3 in the Edges of c3 & the Target of c3 . b3 = c4 ) ) ) & 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 Edges of c3 & the Target of c3 . b4 = c4 ) ) ) & b1 = card b3 ) & ex b3 being finite set st
( ( for b4 being set holds
( b4 in b3 iff ( b4 in the Edges of c3 & the Target of c3 . b4 = c4 ) ) ) & b2 = card b3 ) holds
b1 = b2
proof end;
func EdgesOut c2 -> Nat means :: GRAPH_1:def 21
ex b1 being finite set st
( ( for b2 being set holds
( b2 in b1 iff ( b2 in the Edges of a1 & the Source of a1 . b2 = a2 ) ) ) & a3 = card b1 );
existence
ex b1 being Natex b2 being finite set st
( ( for b3 being set holds
( b3 in b2 iff ( b3 in the Edges of c3 & the Source of c3 . b3 = c4 ) ) ) & 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 Edges of c3 & the Source of c3 . b4 = c4 ) ) ) & b1 = card b3 ) & ex b3 being finite set st
( ( for b4 being set holds
( b4 in b3 iff ( b4 in the Edges of c3 & the Source of c3 . b4 = c4 ) ) ) & b2 = card b3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def20 defines EdgesIn GRAPH_1:def 20 :
for b1 being finite Graph
for b2 being Element of the Vertices of b1
for b3 being Nat holds
( b3 = EdgesIn b2 iff ex b4 being finite set st
( ( for b5 being set holds
( b5 in b4 iff ( b5 in the Edges of b1 & the Target of b1 . b5 = b2 ) ) ) & b3 = card b4 ) );

:: deftheorem Def21 defines EdgesOut GRAPH_1:def 21 :
for b1 being finite Graph
for b2 being Element of the Vertices of b1
for b3 being Nat holds
( b3 = EdgesOut b2 iff ex b4 being finite set st
( ( for b5 being set holds
( b5 in b4 iff ( b5 in the Edges of b1 & the Source of b1 . b5 = b2 ) ) ) & b3 = card b4 ) );

definition
let c3 be finite Graph;
let c4 be Element of the Vertices of c3;
func Degree c2 -> Nat equals :: GRAPH_1:def 22
(EdgesIn a2) + (EdgesOut a2);
correctness
coherence
(EdgesIn c4) + (EdgesOut c4) is Nat
;
;
end;

:: deftheorem Def22 defines Degree GRAPH_1:def 22 :
for b1 being finite Graph
for b2 being Element of the Vertices of b1 holds Degree b2 = (EdgesIn b2) + (EdgesOut b2);

Lemma19: for b1 being Nat
for b2 being Graph
for b3 being Chain of b2 holds b3 | (Seg b1) is Chain of b2
proof end;

Lemma20: for b1 being Graph
for b2, b3 being strict Subgraph of b1 st the Vertices of b2 = the Vertices of b3 & the Edges of b2 = the Edges of b3 holds
b2 = b3
proof end;

definition
let c3, c4 be Graph;
pred c1 c= c2 means :Def23: :: GRAPH_1:def 23
a1 is Subgraph of a2;
reflexivity
for b1 being Graph holds b1 is Subgraph of b1
proof end;
end;

:: deftheorem Def23 defines c= GRAPH_1:def 23 :
for b1, b2 being Graph holds
( b1 c= b2 iff b1 is Subgraph of b2 );

Lemma22: for b1 being Graph
for b2 being Subgraph of b1 holds
( the Source of b2 in PFuncs the Edges of b1,the Vertices of b1 & the Target of b2 in PFuncs the Edges of b1,the Vertices of b1 )
proof end;

definition
let c3 be Graph;
func bool c1 -> set means :Def24: :: GRAPH_1:def 24
for b1 being set holds
( b1 in a2 iff b1 is strict Subgraph of a1 );
existence
ex b1 being set st
for b2 being set holds
( b2 in b1 iff b2 is strict Subgraph of c3 )
proof end;
uniqueness
for b1, b2 being set st ( for b3 being set holds
( b3 in b1 iff b3 is strict Subgraph of c3 ) ) & ( for b3 being set holds
( b3 in b2 iff b3 is strict Subgraph of c3 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def24 defines bool GRAPH_1:def 24 :
for b1 being Graph
for b2 being set holds
( b2 = bool b1 iff for b3 being set holds
( b3 in b2 iff b3 is strict Subgraph of b1 ) );

scheme :: GRAPH_1:sch 1
s1{ F1() -> Graph, P1[ set ] } :
ex b1 being set st
for b2 being set holds
( b2 in b1 iff ( b2 is strict Subgraph of F1() & P1[b2] ) )
proof end;

theorem Th1: :: GRAPH_1:1
for b1 being Graph holds
( dom the Source of b1 = the Edges of b1 & dom the Target of b1 = the Edges of b1 & rng the Source of b1 c= the Vertices of b1 & rng the Target of b1 c= the Vertices of b1 ) by Lemma2;

theorem Th2: :: GRAPH_1:2
for b1 being Graph
for b2 being Element of the Vertices of b1 holds b2 in the Vertices of b1 by Lemma3;

theorem Th3: :: GRAPH_1:3
for b1 being Graph
for b2 being set st b2 in the Edges of b1 holds
( the Source of b1 . b2 in the Vertices of b1 & the Target of b1 . b2 in the Vertices of b1 ) by Lemma17;

theorem Th4: :: GRAPH_1:4
for b1 being Nat
for b2 being Graph
for b3 being Chain of b2 holds b3 | (Seg b1) is Chain of b2 by Lemma19;

theorem Th5: :: GRAPH_1:5
for b1, b2 being Graph st b1 c= b2 holds
( the Source of b1 c= the Source of b2 & the Target of b1 c= the Target of b2 )
proof end;

theorem Th6: :: GRAPH_1:6
for b1, b2 being Graph st the Source of b1 tolerates the Source of b2 & the Target of b1 tolerates the Target of b2 holds
( the Source of (b1 \/ b2) = the Source of b1 \/ the Source of b2 & the Target of (b1 \/ b2) = the Target of b1 \/ the Target of b2 )
proof end;

theorem Th7: :: GRAPH_1:7
for b1 being strict Graph holds b1 = b1 \/ b1
proof end;

theorem Th8: :: GRAPH_1:8
for b1, b2 being Graph st the Source of b1 tolerates the Source of b2 & the Target of b1 tolerates the Target of b2 holds
b1 \/ b2 = b2 \/ b1
proof end;

theorem Th9: :: GRAPH_1:9
for b1, b2, b3 being Graph st the Source of b1 tolerates the Source of b2 & the Target of b1 tolerates the Target of b2 & the Source of b1 tolerates the Source of b3 & the Target of b1 tolerates the Target of b3 & the Source of b2 tolerates the Source of b3 & the Target of b2 tolerates the Target of b3 holds
(b1 \/ b2) \/ b3 = b1 \/ (b2 \/ b3)
proof end;

theorem Th10: :: GRAPH_1:10
for b1, b2, b3 being Graph st b1 is_sum_of b2,b3 holds
b1 is_sum_of b3,b2
proof end;

theorem Th11: :: GRAPH_1:11
for b1 being strict Graph holds b1 is_sum_of b1,b1
proof end;

theorem Th12: :: GRAPH_1:12
for b1, b2 being Graph st ex b3 being Graph st
( b1 c= b3 & b2 c= b3 ) holds
b1 \/ b2 = b2 \/ b1
proof end;

theorem Th13: :: GRAPH_1:13
for b1, b2, b3 being Graph st ex b4 being Graph st
( b1 c= b4 & b2 c= b4 & b3 c= b4 ) holds
(b1 \/ b2) \/ b3 = b1 \/ (b2 \/ b3)
proof end;

theorem Th14: :: GRAPH_1:14
for b1 being Graph holds {} is oriented cyclic Path of b1 by Lemma14, Lemma16;

theorem Th15: :: GRAPH_1:15
for b1 being Graph
for b2, b3 being strict Subgraph of b1 st the Vertices of b2 = the Vertices of b3 & the Edges of b2 = the Edges of b3 holds
b2 = b3 by Lemma20;

theorem Th16: :: GRAPH_1:16
for b1, b2 being strict Graph st b1 c= b2 & b2 c= b1 holds
b1 = b2
proof end;

theorem Th17: :: GRAPH_1:17
for b1, b2, b3 being Graph st b1 c= b2 & b2 c= b3 holds
b1 c= b3
proof end;

theorem Th18: :: GRAPH_1:18
for b1, b2, b3 being Graph st b1 is_sum_of b2,b3 holds
( b2 c= b1 & b3 c= b1 )
proof end;

theorem Th19: :: GRAPH_1:19
for b1, b2 being Graph st the Source of b1 tolerates the Source of b2 & the Target of b1 tolerates the Target of b2 holds
( b1 c= b1 \/ b2 & b2 c= b1 \/ b2 )
proof end;

theorem Th20: :: GRAPH_1:20
for b1, b2 being Graph st ex b3 being Graph st
( b1 c= b3 & b2 c= b3 ) holds
( b1 c= b1 \/ b2 & b2 c= b1 \/ b2 )
proof end;

theorem Th21: :: GRAPH_1:21
for b1, b2, b3, b4 being Graph st b1 c= b2 & b3 c= b2 & b4 is_sum_of b1,b3 holds
b4 c= b2
proof end;

theorem Th22: :: GRAPH_1:22
for b1, b2, b3 being Graph st b1 c= b2 & b3 c= b2 holds
b1 \/ b3 c= b2
proof end;

theorem Th23: :: GRAPH_1:23
for b1, b2 being strict Graph st b1 c= b2 holds
( b1 \/ b2 = b2 & b2 \/ b1 = b2 )
proof end;

theorem Th24: :: GRAPH_1:24
for b1, b2 being Graph st the Source of b1 tolerates the Source of b2 & the Target of b1 tolerates the Target of b2 & ( b1 \/ b2 = b2 or b2 \/ b1 = b2 ) holds
b1 c= b2
proof end;

theorem Th25: :: GRAPH_1:25
canceled;

theorem Th26: :: GRAPH_1:26
canceled;

theorem Th27: :: GRAPH_1:27
for b1 being Graph
for b2 being oriented Graph st b1 c= b2 holds
b1 is oriented
proof end;

theorem Th28: :: GRAPH_1:28
for b1 being Graph
for b2 being non-multi Graph st b1 c= b2 holds
b1 is non-multi
proof end;

theorem Th29: :: GRAPH_1:29
for b1 being Graph
for b2 being simple Graph st b1 c= b2 holds
b1 is simple
proof end;

theorem Th30: :: GRAPH_1:30
for b1 being Graph
for b2 being strict Graph holds
( b2 in bool b1 iff b2 c= b1 )
proof end;

theorem Th31: :: GRAPH_1:31
for b1 being strict Graph holds b1 in bool b1
proof end;

theorem Th32: :: GRAPH_1:32
for b1 being Graph
for b2 being strict Graph holds
( b2 c= b1 iff bool b2 c= bool b1 )
proof end;

theorem Th33: :: GRAPH_1:33
canceled;

theorem Th34: :: GRAPH_1:34
for b1 being strict Graph holds {b1} c= bool b1
proof end;

theorem Th35: :: GRAPH_1:35
for b1, b2 being strict Graph st the Source of b1 tolerates the Source of b2 & the Target of b1 tolerates the Target of b2 & bool (b1 \/ b2) c= (bool b1) \/ (bool b2) & not b1 c= b2 holds
b2 c= b1
proof end;

theorem Th36: :: GRAPH_1:36
for b1, b2 being Graph st the Source of b1 tolerates the Source of b2 & the Target of b1 tolerates the Target of b2 holds
(bool b1) \/ (bool b2) c= bool (b1 \/ b2)
proof end;

theorem Th37: :: GRAPH_1:37
for b1, b2, b3 being Graph st b1 in bool b2 & b3 in bool b2 holds
b1 \/ b3 in bool b2
proof end;