:: GLIB_000 semantic presentation

definition
mode GraphStruct -> finite Function means :Def1: :: GLIB_000:def 1
dom a1 c= NAT ;
existence
ex b1 being finite Function st dom b1 c= NAT
proof end;
end;

:: deftheorem Def1 defines GraphStruct GLIB_000:def 1 :
for b1 being finite Function holds
( b1 is GraphStruct iff dom b1 c= NAT );

definition
func VertexSelector -> Nat equals :: GLIB_000:def 2
1;
coherence
1 is Nat
;
func EdgeSelector -> Nat equals :: GLIB_000:def 3
2;
coherence
2 is Nat
;
func SourceSelector -> Nat equals :: GLIB_000:def 4
3;
coherence
3 is Nat
;
func TargetSelector -> Nat equals :: GLIB_000:def 5
4;
coherence
4 is Nat
;
end;

:: deftheorem Def2 defines VertexSelector GLIB_000:def 2 :
VertexSelector = 1;

:: deftheorem Def3 defines EdgeSelector GLIB_000:def 3 :
EdgeSelector = 2;

:: deftheorem Def4 defines SourceSelector GLIB_000:def 4 :
SourceSelector = 3;

:: deftheorem Def5 defines TargetSelector GLIB_000:def 5 :
TargetSelector = 4;

definition
func _GraphSelectors -> non empty Subset of NAT equals :: GLIB_000:def 6
{VertexSelector ,EdgeSelector ,SourceSelector ,TargetSelector };
coherence
{VertexSelector ,EdgeSelector ,SourceSelector ,TargetSelector } is non empty Subset of NAT
by ENUMSET1:def 2;
end;

:: deftheorem Def6 defines _GraphSelectors GLIB_000:def 6 :
_GraphSelectors = {VertexSelector ,EdgeSelector ,SourceSelector ,TargetSelector };

definition
let c1 be GraphStruct ;
func the_Vertices_of c1 -> set equals :: GLIB_000:def 7
a1 . VertexSelector ;
coherence
c1 . VertexSelector is set
;
func the_Edges_of c1 -> set equals :: GLIB_000:def 8
a1 . EdgeSelector ;
coherence
c1 . EdgeSelector is set
;
func the_Source_of c1 -> set equals :: GLIB_000:def 9
a1 . SourceSelector ;
coherence
c1 . SourceSelector is set
;
func the_Target_of c1 -> set equals :: GLIB_000:def 10
a1 . TargetSelector ;
coherence
c1 . TargetSelector is set
;
end;

:: deftheorem Def7 defines the_Vertices_of GLIB_000:def 7 :
for b1 being GraphStruct holds the_Vertices_of b1 = b1 . VertexSelector ;

:: deftheorem Def8 defines the_Edges_of GLIB_000:def 8 :
for b1 being GraphStruct holds the_Edges_of b1 = b1 . EdgeSelector ;

:: deftheorem Def9 defines the_Source_of GLIB_000:def 9 :
for b1 being GraphStruct holds the_Source_of b1 = b1 . SourceSelector ;

:: deftheorem Def10 defines the_Target_of GLIB_000:def 10 :
for b1 being GraphStruct holds the_Target_of b1 = b1 . TargetSelector ;

definition
let c1 be GraphStruct ;
attr a1 is [Graph-like] means :Def11: :: GLIB_000:def 11
( VertexSelector in dom a1 & EdgeSelector in dom a1 & SourceSelector in dom a1 & TargetSelector in dom a1 & the_Vertices_of a1 is non empty set & the_Source_of a1 is Function of the_Edges_of a1, the_Vertices_of a1 & the_Target_of a1 is Function of the_Edges_of a1, the_Vertices_of a1 );
end;

:: deftheorem Def11 defines [Graph-like] GLIB_000:def 11 :
for b1 being GraphStruct holds
( b1 is [Graph-like] iff ( VertexSelector in dom b1 & EdgeSelector in dom b1 & SourceSelector in dom b1 & TargetSelector in dom b1 & the_Vertices_of b1 is non empty set & the_Source_of b1 is Function of the_Edges_of b1, the_Vertices_of b1 & the_Target_of b1 is Function of the_Edges_of b1, the_Vertices_of b1 ) );

registration
cluster finite [Graph-like] GraphStruct ;
existence
ex b1 being GraphStruct st b1 is [Graph-like]
proof end;
end;

definition
mode _Graph is [Graph-like] GraphStruct ;
end;

registration
let c1 be _Graph;
cluster the_Vertices_of a1 -> non empty ;
coherence
not the_Vertices_of c1 is empty
by Def11;
end;

definition
let c1 be _Graph;
redefine func the_Source_of as the_Source_of c1 -> Function of the_Edges_of a1, the_Vertices_of a1;
coherence
the_Source_of c1 is Function of the_Edges_of c1, the_Vertices_of c1
by Def11;
redefine func the_Target_of as the_Target_of c1 -> Function of the_Edges_of a1, the_Vertices_of a1;
coherence
the_Target_of c1 is Function of the_Edges_of c1, the_Vertices_of c1
by Def11;
end;

Lemma3: 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 FUNCT_2:def 1;

definition
let c1 be non empty set ;
let c2 be set ;
let c3, c4 be Function of c2,c1;
func createGraph c1,c2,c3,c4 -> _Graph equals :: GLIB_000:def 12
<*a1,a2,a3,a4*>;
coherence
<*c1,c2,c3,c4*> is _Graph
proof end;
end;

:: deftheorem Def12 defines createGraph GLIB_000:def 12 :
for b1 being non empty set
for b2 being set
for b3, b4 being Function of b2,b1 holds createGraph b1,b2,b3,b4 = <*b1,b2,b3,b4*>;

Lemma4: for b1 being non empty set
for b2 being set
for b3, b4 being Function of b2,b1 holds
( the_Vertices_of (createGraph b1,b2,b3,b4) = b1 & the_Edges_of (createGraph b1,b2,b3,b4) = b2 & the_Source_of (createGraph b1,b2,b3,b4) = b3 & the_Target_of (createGraph b1,b2,b3,b4) = b4 )
by SCMPDS_1:3;

registration
let c1, c2 be set ;
cluster a1 .--> a2 -> finite ;
coherence
c1 .--> c2 is finite
proof end;
end;

definition
let c1 be GraphStruct ;
let c2 be Nat;
let c3 be set ;
func c1 .set c2,c3 -> GraphStruct equals :: GLIB_000:def 13
a1 +* (a2 .--> a3);
coherence
c1 +* (c2 .--> c3) is GraphStruct
proof end;
end;

:: deftheorem Def13 defines .set GLIB_000:def 13 :
for b1 being GraphStruct
for b2 being Nat
for b3 being set holds b1 .set b2,b3 = b1 +* (b2 .--> b3);

definition
let c1 be GraphStruct ;
let c2 be set ;
func c1 .strict c2 -> GraphStruct equals :: GLIB_000:def 14
a1 | a2;
coherence
c1 | c2 is GraphStruct
proof end;
end;

:: deftheorem Def14 defines .strict GLIB_000:def 14 :
for b1 being GraphStruct
for b2 being set holds b1 .strict b2 = b1 | b2;

Lemma5: for b1 being GraphStruct holds
( b1 is [Graph-like] iff ( _GraphSelectors c= dom b1 & not the_Vertices_of b1 is empty & the_Source_of b1 is Function of the_Edges_of b1, the_Vertices_of b1 & the_Target_of b1 is Function of the_Edges_of b1, the_Vertices_of b1 ) )
proof end;

registration
let c1 be _Graph;
cluster a1 .strict _GraphSelectors -> finite [Graph-like] ;
coherence
c1 .strict _GraphSelectors is [Graph-like]
proof end;
end;

definition
let c1 be _Graph;
let c2, c3, c4 be set ;
pred c4 Joins c2,c3,c1 means :Def15: :: GLIB_000:def 15
( a4 in the_Edges_of a1 & ( ( (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 Def15 defines Joins GLIB_000:def 15 :
for b1 being _Graph
for b2, b3, b4 being set holds
( b4 Joins b2,b3,b1 iff ( b4 in the_Edges_of b1 & ( ( (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 c1 be _Graph;
let c2, c3, c4 be set ;
pred c4 DJoins c2,c3,c1 means :Def16: :: GLIB_000:def 16
( a4 in the_Edges_of a1 & (the_Source_of a1) . a4 = a2 & (the_Target_of a1) . a4 = a3 );
end;

:: deftheorem Def16 defines DJoins GLIB_000:def 16 :
for b1 being _Graph
for b2, b3, b4 being set holds
( b4 DJoins b2,b3,b1 iff ( b4 in the_Edges_of b1 & (the_Source_of b1) . b4 = b2 & (the_Target_of b1) . b4 = b3 ) );

definition
let c1 be _Graph;
let c2, c3, c4 be set ;
pred c4 SJoins c2,c3,c1 means :Def17: :: GLIB_000:def 17
( a4 in the_Edges_of a1 & ( ( (the_Source_of a1) . a4 in a2 & (the_Target_of a1) . a4 in a3 ) or ( (the_Source_of a1) . a4 in a3 & (the_Target_of a1) . a4 in a2 ) ) );
pred c4 DSJoins c2,c3,c1 means :Def18: :: GLIB_000:def 18
( a4 in the_Edges_of a1 & (the_Source_of a1) . a4 in a2 & (the_Target_of a1) . a4 in a3 );
end;

:: deftheorem Def17 defines SJoins GLIB_000:def 17 :
for b1 being _Graph
for b2, b3, b4 being set holds
( b4 SJoins b2,b3,b1 iff ( b4 in the_Edges_of b1 & ( ( (the_Source_of b1) . b4 in b2 & (the_Target_of b1) . b4 in b3 ) or ( (the_Source_of b1) . b4 in b3 & (the_Target_of b1) . b4 in b2 ) ) ) );

:: deftheorem Def18 defines DSJoins GLIB_000:def 18 :
for b1 being _Graph
for b2, b3, b4 being set holds
( b4 DSJoins b2,b3,b1 iff ( b4 in the_Edges_of b1 & (the_Source_of b1) . b4 in b2 & (the_Target_of b1) . b4 in b3 ) );

Lemma10: for b1 being _Graph
for b2, b3, b4 being set holds
( b2 Joins b3,b4,b1 iff ( b2 DJoins b3,b4,b1 or b2 DJoins b4,b3,b1 ) )
proof end;

definition
let c1 be _Graph;
attr a1 is finite means :Def19: :: GLIB_000:def 19
( the_Vertices_of a1 is finite & the_Edges_of a1 is finite );
attr a1 is loopless means :Def20: :: GLIB_000:def 20
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 trivial means :Def21: :: GLIB_000:def 21
Card (the_Vertices_of a1) = one ;
attr a1 is non-multi means :Def22: :: GLIB_000:def 22
for b1, b2, b3, b4 being set st b1 Joins b3,b4,a1 & b2 Joins b3,b4,a1 holds
b1 = b2;
attr a1 is non-Dmulti means :Def23: :: GLIB_000:def 23
for b1, b2, b3, b4 being set st b1 DJoins b3,b4,a1 & b2 DJoins b3,b4,a1 holds
b1 = b2;
end;

:: deftheorem Def19 defines finite GLIB_000:def 19 :
for b1 being _Graph holds
( b1 is finite iff ( the_Vertices_of b1 is finite & the_Edges_of b1 is finite ) );

:: deftheorem Def20 defines loopless GLIB_000:def 20 :
for b1 being _Graph holds
( b1 is loopless 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 Def21 defines trivial GLIB_000:def 21 :
for b1 being _Graph holds
( b1 is trivial iff Card (the_Vertices_of b1) = one );

:: deftheorem Def22 defines non-multi GLIB_000:def 22 :
for b1 being _Graph holds
( b1 is non-multi iff for b2, b3, b4, b5 being set st b2 Joins b4,b5,b1 & b3 Joins b4,b5,b1 holds
b2 = b3 );

:: deftheorem Def23 defines non-Dmulti GLIB_000:def 23 :
for b1 being _Graph holds
( b1 is non-Dmulti iff for b2, b3, b4, b5 being set st b2 DJoins b4,b5,b1 & b3 DJoins b4,b5,b1 holds
b2 = b3 );

definition
let c1 be _Graph;
attr a1 is simple means :Def24: :: GLIB_000:def 24
( a1 is loopless & a1 is non-multi );
attr a1 is Dsimple means :Def25: :: GLIB_000:def 25
( a1 is loopless & a1 is non-Dmulti );
end;

:: deftheorem Def24 defines simple GLIB_000:def 24 :
for b1 being _Graph holds
( b1 is simple iff ( b1 is loopless & b1 is non-multi ) );

:: deftheorem Def25 defines Dsimple GLIB_000:def 25 :
for b1 being _Graph holds
( b1 is Dsimple iff ( b1 is loopless & b1 is non-Dmulti ) );

Lemma18: for b1 being _Graph st the_Edges_of b1 = {} holds
b1 is simple
proof end;

registration
cluster non-multi -> non-Dmulti GraphStruct ;
coherence
for b1 being _Graph st b1 is non-multi holds
b1 is non-Dmulti
proof end;
cluster simple -> loopless non-multi GraphStruct ;
coherence
for b1 being _Graph st b1 is simple holds
( b1 is loopless & b1 is non-multi )
by Def24;
cluster loopless non-multi -> simple GraphStruct ;
coherence
for b1 being _Graph st b1 is loopless & b1 is non-multi holds
b1 is simple
by Def24;
cluster loopless non-Dmulti -> Dsimple GraphStruct ;
coherence
for b1 being _Graph st b1 is loopless & b1 is non-Dmulti holds
b1 is Dsimple
by Def25;
cluster Dsimple -> loopless non-Dmulti GraphStruct ;
coherence
for b1 being _Graph st b1 is Dsimple holds
( b1 is loopless & b1 is non-Dmulti )
by Def25;
cluster loopless trivial -> finite GraphStruct ;
coherence
for b1 being _Graph st b1 is trivial & b1 is loopless holds
b1 is finite
proof end;
cluster trivial non-Dmulti -> finite GraphStruct ;
coherence
for b1 being _Graph st b1 is trivial & b1 is non-Dmulti holds
b1 is finite
proof end;
end;

registration
cluster finite loopless trivial non-multi non-Dmulti simple Dsimple GraphStruct ;
existence
ex b1 being _Graph st
( b1 is trivial & b1 is simple )
proof end;
cluster finite loopless non trivial non-multi non-Dmulti simple Dsimple GraphStruct ;
existence
ex b1 being _Graph st
( b1 is finite & not b1 is trivial & b1 is simple )
proof end;
end;

registration
let c1 be finite _Graph;
cluster the_Vertices_of a1 -> non empty finite ;
coherence
the_Vertices_of c1 is finite
by Def19;
cluster the_Edges_of a1 -> finite ;
coherence
the_Edges_of c1 is finite
by Def19;
end;

registration
let c1 be trivial _Graph;
cluster the_Vertices_of a1 -> non empty finite ;
coherence
the_Vertices_of c1 is finite
proof end;
end;

registration
let c1 be non empty finite set ;
let c2 be finite set ;
let c3, c4 be Function of c2,c1;
cluster createGraph a1,a2,a3,a4 -> finite ;
coherence
createGraph c1,c2,c3,c4 is finite
proof end;
end;

registration
let c1 be non empty set ;
let c2 be empty set ;
let c3, c4 be Function of c2,c1;
cluster createGraph a1,a2,a3,a4 -> loopless non-multi non-Dmulti simple Dsimple ;
coherence
createGraph c1,c2,c3,c4 is simple
proof end;
end;

registration
let c1, c2 be set ;
let c3, c4 be Function of c2,{c1};
cluster createGraph {a1},a2,a3,a4 -> trivial ;
coherence
createGraph {c1},c2,c3,c4 is trivial
proof end;
end;

definition
let c1 be _Graph;
func c1 .order() -> Cardinal equals :: GLIB_000:def 26
Card (the_Vertices_of a1);
coherence
Card (the_Vertices_of c1) is Cardinal
;
end;

:: deftheorem Def26 defines .order() GLIB_000:def 26 :
for b1 being _Graph holds b1 .order() = Card (the_Vertices_of b1);

definition
let c1 be finite _Graph;
redefine func .order() as c1 .order() -> non empty Nat;
coherence
c1 .order() is non empty Nat
proof end;
end;

definition
let c1 be _Graph;
func c1 .size() -> Cardinal equals :: GLIB_000:def 27
Card (the_Edges_of a1);
coherence
Card (the_Edges_of c1) is Cardinal
;
end;

:: deftheorem Def27 defines .size() GLIB_000:def 27 :
for b1 being _Graph holds b1 .size() = Card (the_Edges_of b1);

definition
let c1 be finite _Graph;
redefine func .size() as c1 .size() -> Nat;
coherence
c1 .size() is Nat
proof end;
end;

definition
let c1 be _Graph;
let c2 be set ;
func c1 .edgesInto c2 -> Subset of (the_Edges_of a1) means :Def28: :: GLIB_000:def 28
for b1 being set holds
( b1 in a3 iff ( b1 in the_Edges_of a1 & (the_Target_of a1) . b1 in a2 ) );
existence
ex b1 being Subset of (the_Edges_of c1) st
for b2 being set holds
( b2 in b1 iff ( b2 in the_Edges_of c1 & (the_Target_of c1) . b2 in c2 ) )
proof end;
uniqueness
for b1, b2 being Subset of (the_Edges_of c1) st ( for b3 being set holds
( b3 in b1 iff ( b3 in the_Edges_of c1 & (the_Target_of c1) . b3 in c2 ) ) ) & ( for b3 being set holds
( b3 in b2 iff ( b3 in the_Edges_of c1 & (the_Target_of c1) . b3 in c2 ) ) ) holds
b1 = b2
proof end;
func c1 .edgesOutOf c2 -> Subset of (the_Edges_of a1) means :Def29: :: GLIB_000:def 29
for b1 being set holds
( b1 in a3 iff ( b1 in the_Edges_of a1 & (the_Source_of a1) . b1 in a2 ) );
existence
ex b1 being Subset of (the_Edges_of c1) st
for b2 being set holds
( b2 in b1 iff ( b2 in the_Edges_of c1 & (the_Source_of c1) . b2 in c2 ) )
proof end;
uniqueness
for b1, b2 being Subset of (the_Edges_of c1) st ( for b3 being set holds
( b3 in b1 iff ( b3 in the_Edges_of c1 & (the_Source_of c1) . b3 in c2 ) ) ) & ( for b3 being set holds
( b3 in b2 iff ( b3 in the_Edges_of c1 & (the_Source_of c1) . b3 in c2 ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def28 defines .edgesInto GLIB_000:def 28 :
for b1 being _Graph
for b2 being set
for b3 being Subset of (the_Edges_of b1) holds
( b3 = b1 .edgesInto b2 iff for b4 being set holds
( b4 in b3 iff ( b4 in the_Edges_of b1 & (the_Target_of b1) . b4 in b2 ) ) );

:: deftheorem Def29 defines .edgesOutOf GLIB_000:def 29 :
for b1 being _Graph
for b2 being set
for b3 being Subset of (the_Edges_of b1) holds
( b3 = b1 .edgesOutOf b2 iff for b4 being set holds
( b4 in b3 iff ( b4 in the_Edges_of b1 & (the_Source_of b1) . b4 in b2 ) ) );

definition
let c1 be _Graph;
let c2 be set ;
func c1 .edgesInOut c2 -> Subset of (the_Edges_of a1) equals :: GLIB_000:def 30
(a1 .edgesInto a2) \/ (a1 .edgesOutOf a2);
coherence
(c1 .edgesInto c2) \/ (c1 .edgesOutOf c2) is Subset of (the_Edges_of c1)
;
func c1 .edgesBetween c2 -> Subset of (the_Edges_of a1) equals :: GLIB_000:def 31
(a1 .edgesInto a2) /\ (a1 .edgesOutOf a2);
coherence
(c1 .edgesInto c2) /\ (c1 .edgesOutOf c2) is Subset of (the_Edges_of c1)
;
end;

:: deftheorem Def30 defines .edgesInOut GLIB_000:def 30 :
for b1 being _Graph
for b2 being set holds b1 .edgesInOut b2 = (b1 .edgesInto b2) \/ (b1 .edgesOutOf b2);

:: deftheorem Def31 defines .edgesBetween GLIB_000:def 31 :
for b1 being _Graph
for b2 being set holds b1 .edgesBetween b2 = (b1 .edgesInto b2) /\ (b1 .edgesOutOf b2);

definition
let c1 be _Graph;
let c2, c3 be set ;
func c1 .edgesBetween c2,c3 -> Subset of (the_Edges_of a1) means :Def32: :: GLIB_000:def 32
for b1 being set holds
( b1 in a4 iff b1 SJoins a2,a3,a1 );
existence
ex b1 being Subset of (the_Edges_of c1) st
for b2 being set holds
( b2 in b1 iff b2 SJoins c2,c3,c1 )
proof end;
uniqueness
for b1, b2 being Subset of (the_Edges_of c1) st ( for b3 being set holds
( b3 in b1 iff b3 SJoins c2,c3,c1 ) ) & ( for b3 being set holds
( b3 in b2 iff b3 SJoins c2,c3,c1 ) ) holds
b1 = b2
proof end;
func c1 .edgesDBetween c2,c3 -> Subset of (the_Edges_of a1) means :Def33: :: GLIB_000:def 33
for b1 being set holds
( b1 in a4 iff b1 DSJoins a2,a3,a1 );
existence
ex b1 being Subset of (the_Edges_of c1) st
for b2 being set holds
( b2 in b1 iff b2 DSJoins c2,c3,c1 )
proof end;
uniqueness
for b1, b2 being Subset of (the_Edges_of c1) st ( for b3 being set holds
( b3 in b1 iff b3 DSJoins c2,c3,c1 ) ) & ( for b3 being set holds
( b3 in b2 iff b3 DSJoins c2,c3,c1 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def32 defines .edgesBetween GLIB_000:def 32 :
for b1 being _Graph
for b2, b3 being set
for b4 being Subset of (the_Edges_of b1) holds
( b4 = b1 .edgesBetween b2,b3 iff for b5 being set holds
( b5 in b4 iff b5 SJoins b2,b3,b1 ) );

:: deftheorem Def33 defines .edgesDBetween GLIB_000:def 33 :
for b1 being _Graph
for b2, b3 being set
for b4 being Subset of (the_Edges_of b1) holds
( b4 = b1 .edgesDBetween b2,b3 iff for b5 being set holds
( b5 in b4 iff b5 DSJoins b2,b3,b1 ) );

scheme :: GLIB_000:sch 1
s1{ P1[ finite _Graph] } :
for b1 being finite _Graph holds P1[b1]
provided
E23: for b1 being finite _Graph st b1 .order() = 1 holds
P1[b1] and
E24: for b1 being non empty Nat st ( for b2 being finite _Graph st b2 .order() = b1 holds
P1[b2] ) holds
for b2 being finite _Graph st b2 .order() = b1 + 1 holds
P1[b2]
proof end;

scheme :: GLIB_000:sch 2
s2{ P1[ finite _Graph] } :
for b1 being finite _Graph holds P1[b1]
provided
E23: for b1 being finite _Graph st b1 .size() = 0 holds
P1[b1] and
E24: for b1 being Nat st ( for b2 being finite _Graph st b2 .size() = b1 holds
P1[b2] ) holds
for b2 being finite _Graph st b2 .size() = b1 + 1 holds
P1[b2]
proof end;

definition
let c1 be _Graph;
mode Subgraph of c1 -> _Graph means :Def34: :: GLIB_000:def 34
( 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 ) ) );
existence
ex b1 being _Graph st
( the_Vertices_of b1 c= the_Vertices_of c1 & the_Edges_of b1 c= the_Edges_of c1 & ( for b2 being set st b2 in the_Edges_of b1 holds
( (the_Source_of b1) . b2 = (the_Source_of c1) . b2 & (the_Target_of b1) . b2 = (the_Target_of c1) . b2 ) ) )
proof end;
end;

:: deftheorem Def34 defines Subgraph GLIB_000:def 34 :
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 ) ) ) );

definition
let c1 be _Graph;
let c2 be Subgraph of c1;
redefine func the_Vertices_of as the_Vertices_of c2 -> non empty Subset of (the_Vertices_of a1);
coherence
the_Vertices_of c2 is non empty Subset of (the_Vertices_of c1)
by Def34;
redefine func the_Edges_of as the_Edges_of c2 -> Subset of (the_Edges_of a1);
coherence
the_Edges_of c2 is Subset of (the_Edges_of c1)
by Def34;
end;

registration
let c1 be _Graph;
cluster finite loopless trivial non-multi non-Dmulti simple Dsimple Subgraph of a1;
existence
ex b1 being Subgraph of c1 st
( b1 is trivial & b1 is simple )
proof end;
end;

Lemma24: for b1 being _Graph holds b1 is Subgraph of b1
proof end;

Lemma25: for b1 being _Graph
for b2 being Subgraph of b1
for b3, b4, b5 being set st b5 Joins b3,b4,b2 holds
b5 Joins b3,b4,b1
proof end;

registration
let c1 be finite _Graph;
cluster -> finite Subgraph of a1;
coherence
for b1 being Subgraph of c1 holds b1 is finite
proof end;
end;

registration
let c1 be loopless _Graph;
cluster -> loopless Subgraph of a1;
coherence
for b1 being Subgraph of c1 holds b1 is loopless
proof end;
end;

registration
let c1 be trivial _Graph;
cluster -> trivial Subgraph of a1;
coherence
for b1 being Subgraph of c1 holds b1 is trivial
proof end;
end;

registration
let c1 be non-multi _Graph;
cluster -> non-multi Subgraph of a1;
coherence
for b1 being Subgraph of c1 holds b1 is non-multi
proof end;
end;

definition
let c1 be _Graph;
let c2 be Subgraph of c1;
attr a2 is spanning means :Def35: :: GLIB_000:def 35
the_Vertices_of a2 = the_Vertices_of a1;
end;

:: deftheorem Def35 defines spanning GLIB_000:def 35 :
for b1 being _Graph
for b2 being Subgraph of b1 holds
( b2 is spanning iff the_Vertices_of b2 = the_Vertices_of b1 );

registration
let c1 be _Graph;
cluster spanning Subgraph of a1;
existence
ex b1 being Subgraph of c1 st b1 is spanning
proof end;
end;

definition
let c1, c2 be _Graph;
pred c1 == c2 means :Def36: :: GLIB_000:def 36
( the_Vertices_of a1 = the_Vertices_of a2 & the_Edges_of a1 = the_Edges_of a2 & the_Source_of a1 = the_Source_of a2 & the_Target_of a1 = the_Target_of a2 );
reflexivity
for b1 being _Graph holds
( the_Vertices_of b1 = the_Vertices_of b1 & the_Edges_of b1 = the_Edges_of b1 & the_Source_of b1 = the_Source_of b1 & the_Target_of b1 = the_Target_of b1 )
;
symmetry
for b1, b2 being _Graph st the_Vertices_of b1 = the_Vertices_of b2 & the_Edges_of b1 = the_Edges_of b2 & the_Source_of b1 = the_Source_of b2 & the_Target_of b1 = the_Target_of b2 holds
( the_Vertices_of b2 = the_Vertices_of b1 & the_Edges_of b2 = the_Edges_of b1 & the_Source_of b2 = the_Source_of b1 & the_Target_of b2 = the_Target_of b1 )
;
end;

:: deftheorem Def36 defines == GLIB_000:def 36 :
for b1, b2 being _Graph holds
( b1 == b2 iff ( the_Vertices_of b1 = the_Vertices_of b2 & the_Edges_of b1 = the_Edges_of b2 & the_Source_of b1 = the_Source_of b2 & the_Target_of b1 = the_Target_of b2 ) );

notation
let c1, c2 be _Graph;
antonym c1 != c2 for c1 == c2;
end;

definition
let c1, c2 be _Graph;
pred c1 c= c2 means :Def37: :: GLIB_000:def 37
a1 is Subgraph of a2;
reflexivity
for b1 being _Graph holds b1 is Subgraph of b1
by Lemma24;
end;

:: deftheorem Def37 defines c= GLIB_000:def 37 :
for b1, b2 being _Graph holds
( b1 c= b2 iff b1 is Subgraph of b2 );

definition
let c1, c2 be _Graph;
pred c1 c< c2 means :Def38: :: GLIB_000:def 38
( a1 c= a2 & a1 != a2 );
irreflexivity
for b1 being _Graph holds
( not b1 c= b1 or not b1 != b1 )
;
end;

:: deftheorem Def38 defines c< GLIB_000:def 38 :
for b1, b2 being _Graph holds
( b1 c< b2 iff ( b1 c= b2 & b1 != b2 ) );

definition
let c1 be _Graph;
let c2, c3 be set ;
mode inducedSubgraph of c1,c2,c3 -> Subgraph of a1 means :Def39: :: GLIB_000:def 39
( the_Vertices_of a4 = a2 & the_Edges_of a4 = a3 ) if ( a2 is non empty Subset of (the_Vertices_of a1) & a3 c= a1 .edgesBetween a2 )
otherwise a4 == a1;
existence
( ( c2 is non empty Subset of (the_Vertices_of c1) & c3 c= c1 .edgesBetween c2 implies ex b1 being Subgraph of c1 st
( the_Vertices_of b1 = c2 & the_Edges_of b1 = c3 ) ) & ( ( not c2 is non empty Subset of (the_Vertices_of c1) or not c3 c= c1 .edgesBetween c2 ) implies ex b1 being Subgraph of c1 st b1 == c1 ) )
proof end;
consistency
for b1 being Subgraph of c1 holds verum
;
end;

:: deftheorem Def39 defines inducedSubgraph GLIB_000:def 39 :
for b1 being _Graph
for b2, b3 being set
for b4 being Subgraph of b1 holds
( ( b2 is non empty Subset of (the_Vertices_of b1) & b3 c= b1 .edgesBetween b2 implies ( b4 is inducedSubgraph of b1,b2,b3 iff ( the_Vertices_of b4 = b2 & the_Edges_of b4 = b3 ) ) ) & ( ( not b2 is non empty Subset of (the_Vertices_of b1) or not b3 c= b1 .edgesBetween b2 ) implies ( b4 is inducedSubgraph of b1,b2,b3 iff b4 == b1 ) ) );

definition
let c1 be _Graph;
let c2 be set ;
mode inducedSubgraph of a1,a2 is inducedSubgraph of a1,a2,a1 .edgesBetween a2;
end;

registration
let c1 be _Graph;
let c2 be non empty finite Subset of (the_Vertices_of c1);
let c3 be finite Subset of (c1 .edgesBetween c2);
cluster -> finite inducedSubgraph of a1,a2,a3;
coherence
for b1 being inducedSubgraph of c1,c2,c3 holds b1 is finite
proof end;
end;

registration
let c1 be _Graph;
let c2 be Element of the_Vertices_of c1;
let c3 be Subset of (c1 .edgesBetween {c2});
cluster -> trivial inducedSubgraph of a1,{a2},a3;
coherence
for b1 being inducedSubgraph of c1,{c2},c3 holds b1 is trivial
proof end;
end;

registration
let c1 be _Graph;
let c2 be Element of the_Vertices_of c1;
cluster -> finite trivial inducedSubgraph of a1,{a2}, {} ;
coherence
for b1 being inducedSubgraph of c1,{c2}, {} holds
( b1 is finite & b1 is trivial )
proof end;
end;

registration
let c1 be _Graph;
let c2 be non empty Subset of (the_Vertices_of c1);
cluster -> simple inducedSubgraph of a1,a2, {} ;
coherence
for b1 being inducedSubgraph of c1,c2, {} holds b1 is simple
proof end;
end;

Lemma31: for b1 being _Graph
for b2, b3 being set holds
( ( b2 in the_Edges_of b1 & (the_Source_of b1) . b2 in b3 & (the_Target_of b1) . b2 in b3 ) iff b2 in b1 .edgesBetween b3 )
proof end;

Lemma32: for b1 being _Graph holds the_Edges_of b1 = b1 .edgesBetween (the_Vertices_of b1)
proof end;

registration
let c1 be _Graph;
let c2 be Subset of (the_Edges_of c1);
cluster -> spanning inducedSubgraph of a1, the_Vertices_of a1,a2;
coherence
for b1 being inducedSubgraph of c1, the_Vertices_of c1,c2 holds b1 is spanning
proof end;
end;

registration
let c1 be _Graph;
cluster -> spanning inducedSubgraph of a1, the_Vertices_of a1, {} ;
coherence
for b1 being inducedSubgraph of c1, the_Vertices_of c1, {} holds b1 is spanning
proof end;
end;

definition
let c1 be _Graph;
let c2 be set ;
mode removeVertex of a1,a2 is inducedSubgraph of a1,((the_Vertices_of a1) \ {a2});
end;

definition
let c1 be _Graph;
let c2 be set ;
mode removeVertices of a1,a2 is inducedSubgraph of a1,((the_Vertices_of a1) \ a2);
end;

definition
let c1 be _Graph;
let c2 be set ;
mode removeEdge of a1,a2 is inducedSubgraph of a1, the_Vertices_of a1,(the_Edges_of a1) \ {a2};
end;

definition
let c1 be _Graph;
let c2 be set ;
mode removeEdges of a1,a2 is inducedSubgraph of a1, the_Vertices_of a1,(the_Edges_of a1) \ a2;
end;

registration
let c1 be _Graph;
let c2 be set ;
cluster -> spanning inducedSubgraph of a1, the_Vertices_of a1,(the_Edges_of a1) \ {a2};
coherence
for b1 being removeEdge of c1,c2 holds b1 is spanning
;
end;

registration
let c1 be _Graph;
let c2 be set ;
cluster -> spanning inducedSubgraph of a1, the_Vertices_of a1,(the_Edges_of a1) \ a2;
coherence
for b1 being removeEdges of c1,c2 holds b1 is spanning
;
end;

definition
let c1 be _Graph;
mode Vertex of a1 is Element of the_Vertices_of a1;
end;

definition
let c1 be _Graph;
let c2 be Vertex of c1;
func c2 .edgesIn() -> Subset of (the_Edges_of a1) equals :: GLIB_000:def 40
a1 .edgesInto {a2};
coherence
c1 .edgesInto {c2} is Subset of (the_Edges_of c1)
;
func c2 .edgesOut() -> Subset of (the_Edges_of a1) equals :: GLIB_000:def 41
a1 .edgesOutOf {a2};
coherence
c1 .edgesOutOf {c2} is Subset of (the_Edges_of c1)
;
func c2 .edgesInOut() -> Subset of (the_Edges_of a1) equals :: GLIB_000:def 42
a1 .edgesInOut {a2};
coherence
c1 .edgesInOut {c2} is Subset of (the_Edges_of c1)
;
end;

:: deftheorem Def40 defines .edgesIn() GLIB_000:def 40 :
for b1 being _Graph
for b2 being Vertex of b1 holds b2 .edgesIn() = b1 .edgesInto {b2};

:: deftheorem Def41 defines .edgesOut() GLIB_000:def 41 :
for b1 being _Graph
for b2 being Vertex of b1 holds b2 .edgesOut() = b1 .edgesOutOf {b2};

:: deftheorem Def42 defines .edgesInOut() GLIB_000:def 42 :
for b1 being _Graph
for b2 being Vertex of b1 holds b2 .edgesInOut() = b1 .edgesInOut {b2};

Lemma33: for b1 being _Graph
for b2 being Vertex of b1
for b3 being set holds
( b3 in b2 .edgesIn() iff ( b3 in the_Edges_of b1 & (the_Target_of b1) . b3 = b2 ) )
proof end;

Lemma34: for b1 being _Graph
for b2 being Vertex of b1
for b3 being set holds
( b3 in b2 .edgesOut() iff ( b3 in the_Edges_of b1 & (the_Source_of b1) . b3 = b2 ) )
proof end;

definition
let c1 be _Graph;
let c2 be Vertex of c1;
let c3 be set ;
func c2 .adj c3 -> Vertex of a1 equals :Def43: :: GLIB_000:def 43
(the_Source_of a1) . a3 if ( a3 in the_Edges_of a1 & (the_Target_of a1) . a3 = a2 )
(the_Target_of a1) . a3 if ( a3 in the_Edges_of a1 & (the_Source_of a1) . a3 = a2 & not (the_Target_of a1) . a3 = a2 )
otherwise a2;
coherence
( ( c3 in the_Edges_of c1 & (the_Target_of c1) . c3 = c2 implies (the_Source_of c1) . c3 is Vertex of c1 ) & ( c3 in the_Edges_of c1 & (the_Source_of c1) . c3 = c2 & not (the_Target_of c1) . c3 = c2 implies (the_Target_of c1) . c3 is Vertex of c1 ) & ( ( not c3 in the_Edges_of c1 or not (the_Target_of c1) . c3 = c2 ) & ( not c3 in the_Edges_of c1 or not (the_Source_of c1) . c3 = c2 or (the_Target_of c1) . c3 = c2 ) implies c2 is Vertex of c1 ) )
by FUNCT_2:7;
consistency
for b1 being Vertex of c1 st c3 in the_Edges_of c1 & (the_Target_of c1) . c3 = c2 & c3 in the_Edges_of c1 & (the_Source_of c1) . c3 = c2 & not (the_Target_of c1) . c3 = c2 holds
( b1 = (the_Source_of c1) . c3 iff b1 = (the_Target_of c1) . c3 )
;
end;

:: deftheorem Def43 defines .adj GLIB_000:def 43 :
for b1 being _Graph
for b2 being Vertex of b1
for b3 being set holds
( ( b3 in the_Edges_of b1 & (the_Target_of b1) . b3 = b2 implies b2 .adj b3 = (the_Source_of b1) . b3 ) & ( b3 in the_Edges_of b1 & (the_Source_of b1) . b3 = b2 & not (the_Target_of b1) . b3 = b2 implies b2 .adj b3 = (the_Target_of b1) . b3 ) & ( ( not b3 in the_Edges_of b1 or not (the_Target_of b1) . b3 = b2 ) & ( not b3 in the_Edges_of b1 or not (the_Source_of b1) . b3 = b2 or (the_Target_of b1) . b3 = b2 ) implies b2 .adj b3 = b2 ) );

definition
let c1 be _Graph;
let c2 be Vertex of c1;
func c2 .inDegree() -> Cardinal equals :: GLIB_000:def 44
Card (a2 .edgesIn() );
coherence
Card (c2 .edgesIn() ) is Cardinal
;
func c2 .outDegree() -> Cardinal equals :: GLIB_000:def 45
Card (a2 .edgesOut() );
coherence
Card (c2 .edgesOut() ) is Cardinal
;
end;

:: deftheorem Def44 defines .inDegree() GLIB_000:def 44 :
for b1 being _Graph
for b2 being Vertex of b1 holds b2 .inDegree() = Card (b2 .edgesIn() );

:: deftheorem Def45 defines .outDegree() GLIB_000:def 45 :
for b1 being _Graph
for b2 being Vertex of b1 holds b2 .outDegree() = Card (b2 .edgesOut() );

definition
let c1 be finite _Graph;
let c2 be Vertex of c1;
redefine func .inDegree() as c2 .inDegree() -> Nat;
coherence
c2 .inDegree() is Nat
proof end;
redefine func .outDegree() as c2 .outDegree() -> Nat;
coherence
c2 .outDegree() is Nat
proof end;
end;

definition
let c1 be _Graph;
let c2 be Vertex of c1;
func c2 .degree() -> Cardinal equals :: GLIB_000:def 46
(a2 .inDegree() ) +` (a2 .outDegree() );
coherence
(c2 .inDegree() ) +` (c2 .outDegree() ) is Cardinal
;
end;

:: deftheorem Def46 defines .degree() GLIB_000:def 46 :
for b1 being _Graph
for b2 being Vertex of b1 holds b2 .degree() = (b2 .inDegree() ) +` (b2 .outDegree() );

definition
let c1 be finite _Graph;
let c2 be Vertex of c1;
redefine func .degree() as c2 .degree() -> Nat equals :: GLIB_000:def 47
(a2 .inDegree() ) + (a2 .outDegree() );
correctness
coherence
c2 .degree() is Nat
;
compatibility
for b1 being Nat holds
( b1 = c2 .degree() iff b1 = (c2 .inDegree() ) + (c2 .outDegree() ) )
;
proof end;
end;

:: deftheorem Def47 defines .degree() GLIB_000:def 47 :
for b1 being finite _Graph
for b2 being Vertex of b1 holds b2 .degree() = (b2 .inDegree() ) + (b2 .outDegree() );

definition
let c1 be _Graph;
let c2 be Vertex of c1;
func c2 .inNeighbors() -> Subset of (the_Vertices_of a1) equals :: GLIB_000:def 48
(the_Source_of a1) .: (a2 .edgesIn() );
coherence
(the_Source_of c1) .: (c2 .edgesIn() ) is Subset of (the_Vertices_of c1)
;
func c2 .outNeighbors() -> Subset of (the_Vertices_of a1) equals :: GLIB_000:def 49
(the_Target_of a1) .: (a2 .edgesOut() );
coherence
(the_Target_of c1) .: (c2 .edgesOut() ) is Subset of (the_Vertices_of c1)
;
end;

:: deftheorem Def48 defines .inNeighbors() GLIB_000:def 48 :
for b1 being _Graph
for b2 being Vertex of b1 holds b2 .inNeighbors() = (the_Source_of b1) .: (b2 .edgesIn() );

:: deftheorem Def49 defines .outNeighbors() GLIB_000:def 49 :
for b1 being _Graph
for b2 being Vertex of b1 holds b2 .outNeighbors() = (the_Target_of b1) .: (b2 .edgesOut() );

definition
let c1 be _Graph;
let c2 be Vertex of c1;
func c2 .allNeighbors() -> Subset of (the_Vertices_of a1) equals :: GLIB_000:def 50
(a2 .inNeighbors() ) \/ (a2 .outNeighbors() );
coherence
(c2 .inNeighbors() ) \/ (c2 .outNeighbors() ) is Subset of (the_Vertices_of c1)
;
end;

:: deftheorem Def50 defines .allNeighbors() GLIB_000:def 50 :
for b1 being _Graph
for b2 being Vertex of b1 holds b2 .allNeighbors() = (b2 .inNeighbors() ) \/ (b2 .outNeighbors() );

definition
let c1 be _Graph;
let c2 be Vertex of c1;
attr a2 is isolated means :Def51: :: GLIB_000:def 51
a2 .edgesInOut() = {} ;
end;

:: deftheorem Def51 defines isolated GLIB_000:def 51 :
for b1 being _Graph
for b2 being Vertex of b1 holds
( b2 is isolated iff b2 .edgesInOut() = {} );

definition
let c1 be finite _Graph;
let c2 be Vertex of c1;
redefine attr a2 is isolated means :: GLIB_000:def 52
a2 .degree() = 0;
compatibility
( c2 is isolated iff c2 .degree() = 0 )
proof end;
end;

:: deftheorem Def52 defines isolated GLIB_000:def 52 :
for b1 being finite _Graph
for b2 being Vertex of b1 holds
( b2 is isolated iff b2 .degree() = 0 );

definition
let c1 be _Graph;
let c2 be Vertex of c1;
attr a2 is endvertex means :Def53: :: GLIB_000:def 53
ex b1 being set st
( a2 .edgesInOut() = {b1} & not b1 Joins a2,a2,a1 );
end;

:: deftheorem Def53 defines endvertex GLIB_000:def 53 :
for b1 being _Graph
for b2 being Vertex of b1 holds
( b2 is endvertex iff ex b3 being set st
( b2 .edgesInOut() = {b3} & not b3 Joins b2,b2,b1 ) );

definition
let c1 be finite _Graph;
let c2 be Vertex of c1;
redefine attr a2 is endvertex means :: GLIB_000:def 54
a2 .degree() = 1;
compatibility
( c2 is endvertex iff c2 .degree() = 1 )
proof end;
end;

:: deftheorem Def54 defines endvertex GLIB_000:def 54 :
for b1 being finite _Graph
for b2 being Vertex of b1 holds
( b2 is endvertex iff b2 .degree() = 1 );

definition
let c1 be ManySortedSet of NAT ;
attr a1 is Graph-yielding means :Def55: :: GLIB_000:def 55
for b1 being Nat holds a1 . b1 is _Graph;
attr a1 is halting means :Def56: :: GLIB_000:def 56
ex b1 being Nat st a1 . b1 = a1 . (b1 + 1);
end;

:: deftheorem Def55 defines Graph-yielding GLIB_000:def 55 :
for b1 being ManySortedSet of NAT holds
( b1 is Graph-yielding iff for b2 being Nat holds b1 . b2 is _Graph );

:: deftheorem Def56 defines halting GLIB_000:def 56 :
for b1 being ManySortedSet of NAT holds
( b1 is halting iff ex b2 being Nat st b1 . b2 = b1 . (b2 + 1) );

definition
let c1 be ManySortedSet of NAT ;
func c1 .Lifespan() -> Nat means :: GLIB_000:def 57
( a1 . a2 = a1 . (a2 + 1) & ( for b1 being Nat st a1 . b1 = a1 . (b1 + 1) holds
a2 <= b1 ) ) if a1 is halting
otherwise a2 = 0;
existence
( ( c1 is halting implies ex b1 being Nat st
( c1 . b1 = c1 . (b1 + 1) & ( for b2 being Nat st c1 . b2 = c1 . (b2 + 1) holds
b1 <= b2 ) ) ) & ( not c1 is halting implies ex b1 being Nat st b1 = 0 ) )
proof end;
uniqueness
for b1, b2 being Nat holds
( ( c1 is halting & c1 . b1 = c1 . (b1 + 1) & ( for b3 being Nat st c1 . b3 = c1 . (b3 + 1) holds
b1 <= b3 ) & c1 . b2 = c1 . (b2 + 1) & ( for b3 being Nat st c1 . b3 = c1 . (b3 + 1) holds
b2 <= b3 ) implies b1 = b2 ) & ( not c1 is halting & b1 = 0 & b2 = 0 implies b1 = b2 ) )
proof end;
consistency
for b1 being Nat holds verum
;
end;

:: deftheorem Def57 defines .Lifespan() GLIB_000:def 57 :
for b1 being ManySortedSet of NAT
for b2 being Nat holds
( ( b1 is halting implies ( b2 = b1 .Lifespan() iff ( b1 . b2 = b1 . (b2 + 1) & ( for b3 being Nat st b1 . b3 = b1 . (b3 + 1) holds
b2 <= b3 ) ) ) ) & ( not b1 is halting implies ( b2 = b1 .Lifespan() iff b2 = 0 ) ) );

definition
let c1 be ManySortedSet of NAT ;
func c1 .Result() -> set equals :: GLIB_000:def 58
a1 . (a1 .Lifespan() );
coherence
c1 . (c1 .Lifespan() ) is set
;
end;

:: deftheorem Def58 defines .Result() GLIB_000:def 58 :
for b1 being ManySortedSet of NAT holds b1 .Result() = b1 . (b1 .Lifespan() );

registration
cluster Graph-yielding ManySortedSet of NAT ;
existence
ex b1 being ManySortedSet of NAT st b1 is Graph-yielding
proof end;
end;

definition
mode GraphSeq is Graph-yielding ManySortedSet of NAT ;
end;

definition
let c1 be GraphSeq;
let c2 be Nat;
func c1 .-> c2 -> _Graph equals :: GLIB_000:def 59
a1 . a2;
coherence
c1 . c2 is _Graph
by Def55;
end;

:: deftheorem Def59 defines .-> GLIB_000:def 59 :
for b1 being GraphSeq
for b2 being Nat holds b1 .-> b2 = b1 . b2;

definition
let c1 be GraphSeq;
attr a1 is finite means :Def60: :: GLIB_000:def 60
for b1 being Nat holds a1 .-> b1 is finite;
attr a1 is loopless means :Def61: :: GLIB_000:def 61
for b1 being Nat holds a1 .-> b1 is loopless;
attr a1 is trivial means :Def62: :: GLIB_000:def 62
for b1 being Nat holds a1 .-> b1 is trivial;
attr a1 is non-trivial means :Def63: :: GLIB_000:def 63
for b1 being Nat holds not a1 .-> b1 is trivial;
attr a1 is non-multi means :Def64: :: GLIB_000:def 64
for b1 being Nat holds a1 .-> b1 is non-multi;
attr a1 is non-Dmulti means :Def65: :: GLIB_000:def 65
for b1 being Nat holds a1 .-> b1 is non-Dmulti;
attr a1 is simple means :Def66: :: GLIB_000:def 66
for b1 being Nat holds a1 .-> b1 is simple;
attr a1 is Dsimple means :Def67: :: GLIB_000:def 67
for b1 being Nat holds a1 .-> b1 is Dsimple;
end;

:: deftheorem Def60 defines finite GLIB_000:def 60 :
for b1 being GraphSeq holds
( b1 is finite iff for b2 being Nat holds b1 .-> b2 is finite );

:: deftheorem Def61 defines loopless GLIB_000:def 61 :
for b1 being GraphSeq holds
( b1 is loopless iff for b2 being Nat holds b1 .-> b2 is loopless );

:: deftheorem Def62 defines trivial GLIB_000:def 62 :
for b1 being GraphSeq holds
( b1 is trivial iff for b2 being Nat holds b1 .-> b2 is trivial );

:: deftheorem Def63 defines non-trivial GLIB_000:def 63 :
for b1 being GraphSeq holds
( b1 is non-trivial iff for b2 being Nat holds not b1 .-> b2 is trivial );

:: deftheorem Def64 defines non-multi GLIB_000:def 64 :
for b1 being GraphSeq holds
( b1 is non-multi iff for b2 being Nat holds b1 .-> b2 is non-multi );

:: deftheorem Def65 defines non-Dmulti GLIB_000:def 65 :
for b1 being GraphSeq holds
( b1 is non-Dmulti iff for b2 being Nat holds b1 .-> b2 is non-Dmulti );

:: deftheorem Def66 defines simple GLIB_000:def 66 :
for b1 being GraphSeq holds
( b1 is simple iff for b2 being Nat holds b1 .-> b2 is simple );

:: deftheorem Def67 defines Dsimple GLIB_000:def 67 :
for b1 being GraphSeq holds
( b1 is Dsimple iff for b2 being Nat holds b1 .-> b2 is Dsimple );

definition
let c1 be GraphSeq;
redefine attr a1 is halting means :: GLIB_000:def 68
ex b1 being Nat st a1 .-> b1 = a1 .-> (b1 + 1);
compatibility
( c1 is halting iff ex b1 being Nat st c1 .-> b1 = c1 .-> (b1 + 1) )
proof end;
end;

:: deftheorem Def68 defines halting GLIB_000:def 68 :
for b1 being GraphSeq holds
( b1 is halting iff ex b2 being Nat st b1 .-> b2 = b1 .-> (b2 + 1) );

registration
cluster halting finite loopless trivial non-multi non-Dmulti simple Dsimple ManySortedSet of NAT ;
existence
ex b1 being GraphSeq st
( b1 is halting & b1 is finite & b1 is loopless & b1 is trivial & b1 is non-multi & b1 is non-Dmulti & b1 is simple & b1 is Dsimple )
proof end;
cluster halting finite loopless non-trivial non-multi non-Dmulti simple Dsimple ManySortedSet of NAT ;
existence
ex b1 being GraphSeq st
( b1 is halting & b1 is finite & b1 is loopless & b1 is non-trivial & b1 is non-multi & b1 is non-Dmulti & b1 is simple & b1 is Dsimple )
proof end;
end;

registration
let c1 be finite GraphSeq;
let c2 be Nat;
cluster a1 .-> a2 -> finite ;
coherence
c1 .-> c2 is finite
by Def60;
end;

registration
let c1 be loopless GraphSeq;
let c2 be Nat;
cluster a1 .-> a2 -> loopless ;
coherence
c1 .-> c2 is loopless
by Def61;
end;

registration
let c1 be trivial GraphSeq;
let c2 be Nat;
cluster a1 .-> a2 -> trivial ;
coherence
c1 .-> c2 is trivial
by Def62;
end;

registration
let c1 be non-trivial GraphSeq;
let c2 be Nat;
cluster a1 .-> a2 -> non trivial ;
coherence
not c1 .-> c2 is trivial
by Def63;
end;

registration
let c1 be non-multi GraphSeq;
let c2 be Nat;
cluster a1 .-> a2 -> non-multi non-Dmulti ;
coherence
c1 .-> c2 is non-multi
by Def64;
end;

registration
let c1 be non-Dmulti GraphSeq;
let c2 be Nat;
cluster a1 .-> a2 -> non-Dmulti ;
coherence
c1 .-> c2 is non-Dmulti
by Def65;
end;

registration
let c1 be simple GraphSeq;
let c2 be Nat;
cluster a1 .-> a2 -> loopless non-multi non-Dmulti simple Dsimple ;
coherence
c1 .-> c2 is simple
by Def66;
end;

registration
let c1 be Dsimple GraphSeq;
let c2 be Nat;
cluster a1 .-> a2 -> loopless non-Dmulti Dsimple ;
coherence
c1 .-> c2 is Dsimple
by Def67;
end;

registration
cluster non-multi -> non-Dmulti ManySortedSet of NAT ;
coherence
for b1 being GraphSeq st b1 is non-multi holds
b1 is non-Dmulti
proof end;
end;

registration
cluster simple -> loopless non-multi non-Dmulti ManySortedSet of NAT ;
coherence
for b1 being GraphSeq st b1 is simple holds
( b1 is loopless & b1 is non-multi )
proof end;
end;

registration
cluster loopless non-multi -> loopless non-multi non-Dmulti simple ManySortedSet of NAT ;
coherence
for b1 being GraphSeq st b1 is loopless & b1 is non-multi holds
b1 is simple
proof end;
end;

registration
cluster loopless non-Dmulti -> Dsimple ManySortedSet of NAT ;
coherence
for b1 being GraphSeq st b1 is loopless & b1 is non-Dmulti holds
b1 is Dsimple
proof end;
end;

registration
cluster Dsimple -> loopless non-Dmulti Dsimple ManySortedSet of NAT ;
coherence
for b1 being GraphSeq st b1 is Dsimple holds
( b1 is loopless & b1 is non-Dmulti )
proof end;
end;

registration
cluster loopless trivial -> finite ManySortedSet of NAT ;
coherence
for b1 being GraphSeq st b1 is trivial & b1 is loopless holds
b1 is finite
proof end;
end;

registration
cluster trivial non-Dmulti -> finite ManySortedSet of NAT ;
coherence
for b1 being GraphSeq st b1 is trivial & b1 is non-Dmulti holds
b1 is finite
proof end;
end;

theorem Th1: :: GLIB_000:1
( VertexSelector = 1 & EdgeSelector = 2 & SourceSelector = 3 & TargetSelector = 4 ) ;

theorem Th2: :: GLIB_000:2
for b1 being set holds
( b1 in _GraphSelectors iff ( b1 = VertexSelector or b1 = EdgeSelector or b1 = SourceSelector or b1 = TargetSelector ) ) by ENUMSET1:def 2;

theorem Th3: :: GLIB_000:3
for b1 being _Graph holds _GraphSelectors c= dom b1
proof end;

theorem Th4: :: GLIB_000:4
for b1 being GraphStruct holds
( the_Vertices_of b1 = b1 . VertexSelector & the_Edges_of b1 = b1 . EdgeSelector & the_Source_of b1 = b1 . SourceSelector & the_Target_of b1 = b1 . TargetSelector ) ;

theorem Th5: :: GLIB_000:5
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 Lemma3;

theorem Th6: :: GLIB_000:6
canceled;

theorem Th7: :: GLIB_000:7
for b1 being GraphStruct holds
( b1 is [Graph-like] iff ( _GraphSelectors c= dom b1 & not the_Vertices_of b1 is empty & the_Source_of b1 is Function of the_Edges_of b1, the_Vertices_of b1 & the_Target_of b1 is Function of the_Edges_of b1, the_Vertices_of b1 ) ) by Lemma5;

theorem Th8: :: GLIB_000:8
for b1 being non empty set
for b2 being set
for b3, b4 being Function of b2,b1 holds
( the_Vertices_of (createGraph b1,b2,b3,b4) = b1 & the_Edges_of (createGraph b1,b2,b3,b4) = b2 & the_Source_of (createGraph b1,b2,b3,b4) = b3 & the_Target_of (createGraph b1,b2,b3,b4) = b4 ) by Lemma4;

theorem Th9: :: GLIB_000:9
for b1 being GraphStruct
for b2 being set
for b3 being Nat holds dom (b1 .set b3,b2) = (dom b1) \/ {b3}
proof end;

theorem Th10: :: GLIB_000:10
for b1 being GraphStruct
for b2 being set
for b3 being Nat holds dom b1 c= dom (b1 .set b3,b2) by FUNCT_4:11;

theorem Th11: :: GLIB_000:11
for b1 being GraphStruct
for b2 being set
for b3 being Nat holds (b1 .set b3,b2) . b3 = b2
proof end;

theorem Th12: :: GLIB_000:12
for b1 being GraphStruct
for b2 being set
for b3, b4 being Nat st b3 <> b4 holds
b1 . b4 = (b1 .set b3,b2) . b4
proof end;

theorem Th13: :: GLIB_000:13
for b1 being _Graph
for b2 being set
for b3 being Nat st not b3 in _GraphSelectors holds
( the_Vertices_of b1 = the_Vertices_of (b1 .set b3,b2) & the_Edges_of b1 = the_Edges_of (b1 .set b3,b2) & the_Source_of b1 = the_Source_of (b1 .set b3,b2) & the_Target_of b1 = the_Target_of (b1 .set b3,b2) & b1 .set b3,b2 is _Graph )
proof end;

theorem Th14: :: GLIB_000:14
for b1 being GraphStruct
for b2 being set holds
( the_Vertices_of (b1 .set VertexSelector ,b2) = b2 & the_Edges_of (b1 .set EdgeSelector ,b2) = b2 & the_Source_of (b1 .set SourceSelector ,b2) = b2 & the_Target_of (b1 .set TargetSelector ,b2) = b2 ) by Th11;

theorem Th15: :: GLIB_000:15
for b1 being GraphStruct
for b2, b3 being set
for b4, b5 being Nat st b4 <> b5 holds
( b4 in dom ((b1 .set b4,b2) .set b5,b3) & b5 in dom ((b1 .set b4,b2) .set b5,b3) & ((b1 .set b4,b2) .set b5,b3) . b4 = b2 & ((b1 .set b4,b2) .set b5,b3) . b5 = b3 )
proof end;

theorem Th16: :: GLIB_000:16
for b1 being _Graph
for b2, b3, b4 being set st b2 Joins b3,b4,b1 holds
( b3 in the_Vertices_of b1 & b4 in the_Vertices_of b1 )
proof end;

theorem Th17: :: GLIB_000:17
for b1 being _Graph
for b2, b3, b4 being set st b2 Joins b3,b4,b1 holds
b2 Joins b4,b3,b1
proof end;

theorem Th18: :: GLIB_000:18
for b1 being _Graph
for b2, b3, b4, b5, b6 being set st b2 Joins b3,b4,b1 & b2 Joins b5,b6,b1 & not ( b3 = b5 & b4 = b6 ) holds
( b3 = b6 & b4 = b5 )
proof end;

theorem Th19: :: GLIB_000:19
for b1 being _Graph
for b2, b3, b4 being set holds
( b2 Joins b3,b4,b1 iff ( b2 DJoins b3,b4,b1 or b2 DJoins b4,b3,b1 ) ) by Lemma10;

theorem Th20: :: GLIB_000:20
for b1 being _Graph
for b2, b3, b4, b5, b6 being set st b2 Joins b3,b4,b1 & ( ( b3 in b5 & b4 in b6 ) or ( b3 in b6 & b4 in b5 ) ) holds
b2 SJoins b5,b6,b1
proof end;

theorem Th21: :: GLIB_000:21
for b1 being _Graph holds
( b1 is loopless iff for b2, b3 being set holds not b3 Joins b2,b2,b1 )
proof end;

theorem Th22: :: GLIB_000:22
for b1 being finite loopless _Graph
for b2 being Vertex of b1 holds b2 .degree() = card (b2 .edgesInOut() )
proof end;

theorem Th23: :: GLIB_000:23
for b1 being non trivial _Graph
for b2 being Vertex of b1 holds not (the_Vertices_of b1) \ {b2} is empty
proof end;

theorem Th24: :: GLIB_000:24
for b1 being non trivial _Graph ex b2, b3 being Vertex of b1 st b2 <> b3
proof end;

theorem Th25: :: GLIB_000:25
for b1 being trivial _Graph ex b2 being Vertex of b1 st the_Vertices_of b1 = {b2}
proof end;

theorem Th26: :: GLIB_000:26
for b1 being loopless trivial _Graph holds the_Edges_of b1 = {}
proof end;

theorem Th27: :: GLIB_000:27
for b1 being _Graph st the_Edges_of b1 = {} holds
b1 is simple
proof end;

theorem Th28: :: GLIB_000:28
for b1 being finite _Graph holds b1 .order() >= 1
proof end;

theorem Th29: :: GLIB_000:29
for b1 being finite _Graph holds
( b1 .order() = 1 iff b1 is trivial ) by Def21, CARD_2:20;

theorem Th30: :: GLIB_000:30
for b1 being finite _Graph holds
( b1 .order() = 1 iff ex b2 being Vertex of b1 st the_Vertices_of b1 = {b2} )
proof end;

theorem Th31: :: GLIB_000:31
for b1 being _Graph
for b2, b3 being set holds
( ( b2 in the_Edges_of b1 & ( (the_Source_of b1) . b2 in b3 or (the_Target_of b1) . b2 in b3 ) ) iff b2 in b1 .edgesInOut b3 )
proof end;

theorem Th32: :: GLIB_000:32
for b1 being _Graph
for b2 being set holds
( b1 .edgesInto b2 c= b1 .edgesInOut b2 & b1 .edgesOutOf b2 c= b1 .edgesInOut b2 )
proof end;

theorem Th33: :: GLIB_000:33
for b1 being _Graph holds the_Edges_of b1 = b1 .edgesInOut (the_Vertices_of b1)
proof end;

theorem Th34: :: GLIB_000:34
for b1 being _Graph
for b2, b3 being set holds
( ( b2 in the_Edges_of b1 & (the_Source_of b1) . b2 in b3 & (the_Target_of b1) . b2 in b3 ) iff b2 in b1 .edgesBetween b3 ) by Lemma31;

theorem Th35: :: GLIB_000:35
for b1 being _Graph
for b2, b3, b4, b5 being set st b2 in b3 & b4 in b3 & b5 Joins b2,b4,b1 holds
b5 in b1 .edgesBetween b3
proof end;

theorem Th36: :: GLIB_000:36
for b1 being _Graph
for b2 being set holds b1 .edgesBetween b2 c= b1 .edgesInOut b2
proof end;

theorem Th37: :: GLIB_000:37
for b1 being _Graph holds the_Edges_of b1 = b1 .edgesBetween (the_Vertices_of b1)
proof end;

theorem Th38: :: GLIB_000:38
for b1 being _Graph
for b2 being set holds (the_Edges_of b1) \ (b1 .edgesInOut b2) = b1 .edgesBetween ((the_Vertices_of b1) \ b2)
proof end;

theorem Th39: :: GLIB_000:39
for b1 being _Graph
for b2, b3 being set st b2 c= b3 holds
b1 .edgesBetween b2 c= b1 .edgesBetween b3
proof end;

theorem Th40: :: GLIB_000:40
for b1 being _Graph
for b2, b3, b4, b5 being set st b2 c= b3 & b4 c= b5 holds
b1 .edgesBetween b2,b4 c= b1 .edgesBetween b3,b5
proof end;

theorem Th41: :: GLIB_000:41
for b1 being _Graph
for b2, b3, b4, b5 being set st b2 c= b3 & b4 c= b5 holds
b1 .edgesDBetween b2,b4 c= b1 .edgesDBetween b3,b5
proof end;

theorem Th42: :: GLIB_000:42
for b1 being _Graph
for b2 being Vertex of b1 holds
( b2 .edgesIn() = b1 .edgesDBetween (the_Vertices_of b1),{b2} & b2 .edgesOut() = b1 .edgesDBetween {b2},(the_Vertices_of b1) )
proof end;

theorem Th43: :: GLIB_000:43
for b1 being _Graph holds b1 is Subgraph of b1 by Lemma24;

theorem Th44: :: GLIB_000:44
for b1, b2 being _Graph holds
( b1 is Subgraph of b2 & b2 is Subgraph of b1 iff ( the_Vertices_of b1 = the_Vertices_of b2 & the_Edges_of b1 = the_Edges_of b2 & the_Source_of b1 = the_Source_of b2 & the_Target_of b1 = the_Target_of b2 ) )
proof end;

theorem Th45: :: GLIB_000:45
for b1 being _Graph
for b2 being Subgraph of b1
for b3 being set holds
( ( b3 in the_Vertices_of b2 implies b3 in the_Vertices_of b1 ) & ( b3 in the_Edges_of b2 implies b3 in the_Edges_of b1 ) ) ;

theorem Th46: :: GLIB_000:46
for b1 being _Graph
for b2 being Subgraph of b1
for b3 being Subgraph of b2 holds b3 is Subgraph of b1
proof end;

theorem Th47: :: GLIB_000:47
for b1 being _Graph
for b2, b3 being Subgraph of b1 st the_Vertices_of b2 c= the_Vertices_of b3 & the_Edges_of b2 c= the_Edges_of b3 holds
b2 is Subgraph of b3
proof end;

theorem Th48: :: GLIB_000:48
for b1 being _Graph
for b2 being Subgraph of b1 holds
( the_Source_of b2 = (the_Source_of b1) | (the_Edges_of b2) & the_Target_of b2 = (the_Target_of b1) | (the_Edges_of b2) )
proof end;

theorem Th49: :: GLIB_000:49
for b1 being _Graph
for b2, b3, b4, b5 being set
for b6 being inducedSubgraph of b1,b2,b4
for b7 being inducedSubgraph of b1,b3,b5 st b3 c= b2 & b5 c= b4 & b3 is non empty Subset of (the_Vertices_of b1) & b5 c= b1 .edgesBetween b3 holds
b7 is Subgraph of b6
proof end;

theorem Th50: :: GLIB_000:50
for b1 being non trivial _Graph
for b2 being Vertex of b1
for b3 being removeVertex of b1,b2 holds
( the_Vertices_of b3 = (the_Vertices_of b1) \ {b2} & the_Edges_of b3 = b1 .edgesBetween ((the_Vertices_of b1) \ {b2}) )
proof end;

theorem Th51: :: GLIB_000:51
for b1 being finite non trivial _Graph
for b2 being Vertex of b1
for b3 being removeVertex of b1,b2 holds
( (b3 .order() ) + 1 = b1 .order() & (b3 .size() ) + (card (b2 .edgesInOut() )) = b1 .size() )
proof end;

theorem Th52: :: GLIB_000:52
for b1 being _Graph
for b2 being set
for b3 being removeVertices of b1,b2 st b2 c< the_Vertices_of b1 holds
( the_Vertices_of b3 = (the_Vertices_of b1) \ b2 & the_Edges_of b3 = b1 .edgesBetween ((the_Vertices_of b1) \ b2) )
proof end;

theorem Th53: :: GLIB_000:53
for b1 being finite _Graph
for b2 being Subset of (the_Vertices_of b1)
for b3 being removeVertices of b1,b2 st b2 <> the_Vertices_of b1 holds
( (b3 .order() ) + (card b2) = b1 .order() & (b3 .size() ) + (card (b1 .edgesInOut b2)) = b1 .size() )
proof end;

theorem Th54: :: GLIB_000:54
for b1 being _Graph
for b2 being set
for b3 being removeEdge of b1,b2 holds
( the_Vertices_of b3 = the_Vertices_of b1 & the_Edges_of b3 = (the_Edges_of b1) \ {b2} )
proof end;

theorem Th55: :: GLIB_000:55
for b1 being finite _Graph
for b2 being set
for b3 being removeEdge of b1,b2 holds
( b1 .order() = b3 .order() & ( b2 in the_Edges_of b1 implies (b3 .size() ) + 1 = b1 .size() ) )
proof end;

theorem Th56: :: GLIB_000:56
for b1 being _Graph
for b2 being set
for b3 being removeEdges of b1,b2 holds
( the_Vertices_of b3 = the_Vertices_of b1 & the_Edges_of b3 = (the_Edges_of b1) \ b2 )
proof end;

theorem Th57: :: GLIB_000:57
for b1 being finite _Graph
for b2 being set
for b3 being removeEdges of b1,b2 holds b1 .order() = b3 .order() by Th56;

theorem Th58: :: GLIB_000:58
for b1 being finite _Graph
for b2 being Subset of (the_Edges_of b1)
for b3 being removeEdges of b1,b2 holds (b3 .size() ) + (card b2) = b1 .size()
proof end;

theorem Th59: :: GLIB_000:59
for b1 being _Graph
for b2 being set
for b3 being Vertex of b1 holds
( b2 in b3 .edgesIn() iff ( b2 in the_Edges_of b1 & (the_Target_of b1) . b2 = b3 ) ) by Lemma33;

theorem Th60: :: GLIB_000:60
for b1 being _Graph
for b2 being set
for b3 being Vertex of b1 holds
( b2 in b3 .edgesIn() iff ex b4 being set st b2 DJoins b4,b3,b1 )
proof end;

theorem Th61: :: GLIB_000:61
for b1 being _Graph
for b2 being set
for b3 being Vertex of b1 holds
( b2 in b3 .edgesOut() iff ( b2 in the_Edges_of b1 & (the_Source_of b1) . b2 = b3 ) ) by Lemma34;

theorem Th62: :: GLIB_000:62
for b1 being _Graph
for b2 being set
for b3 being Vertex of b1 holds
( b2 in b3 .edgesOut() iff ex b4 being set st b2 DJoins b3,b4,b1 )
proof end;

theorem Th63: :: GLIB_000:63
for b1 being _Graph
for b2 being Vertex of b1 holds b2 .edgesInOut() = (b2 .edgesIn() ) \/ (b2 .edgesOut() ) ;

theorem Th64: :: GLIB_000:64
for b1 being _Graph
for b2 being set
for b3 being Vertex of b1 holds
( b2 in b3 .edgesInOut() iff ( b2 in the_Edges_of b1 & ( (the_Source_of b1) . b2 = b3 or (the_Target_of b1) . b2 = b3 ) ) )
proof end;

theorem Th65: :: GLIB_000:65
for b1 being _Graph
for b2, b3 being set
for b4 being Vertex of b1 st b2 Joins b4,b3,b1 holds
b2 in b4 .edgesInOut()
proof end;

theorem Th66: :: GLIB_000:66
for b1 being _Graph
for b2 being set
for b3, b4 being Vertex of b1 holds
( not b2 Joins b3,b4,b1 or ( b2 in b3 .edgesIn() & b2 in b4 .edgesOut() ) or ( b2 in b4 .edgesIn() & b2 in b3 .edgesOut() ) )
proof end;

theorem Th67: :: GLIB_000:67
for b1 being _Graph
for b2 being set
for b3 being Vertex of b1 holds
( b2 in b3 .edgesInOut() iff ex b4 being Vertex of b1 st b2 Joins b3,b4,b1 )
proof end;

theorem Th68: :: GLIB_000:68
for b1 being _Graph
for b2, b3, b4 being set
for b5 being Vertex of b1 st b2 in b5 .edgesInOut() & b2 Joins b3,b4,b1 & not b5 = b3 holds
b5 = b4
proof end;

theorem Th69: :: GLIB_000:69
for b1 being _Graph
for b2 being set
for b3, b4 being Vertex of b1 st b2 Joins b3,b4,b1 holds
( b3 .adj b2 = b4 & b4 .adj b2 = b3 )
proof end;

theorem Th70: :: GLIB_000:70
for b1 being _Graph
for b2 being set
for b3 being Vertex of b1 holds
( b2 in b3 .edgesInOut() iff b2 Joins b3,b3 .adj b2,b1 )
proof end;

theorem Th71: :: GLIB_000:71
for b1 being finite _Graph
for b2 being set
for b3, b4 being Vertex of b1 st b2 Joins b3,b4,b1 holds
( 1 <= b3 .degree() & 1 <= b4 .degree() )
proof end;

theorem Th72: :: GLIB_000:72
for b1 being _Graph
for b2 being set
for b3 being Vertex of b1 holds
( b2 in b3 .inNeighbors() iff ex b4 being set st b4 DJoins b2,b3,b1 )
proof end;

theorem Th73: :: GLIB_000:73
for b1 being _Graph
for b2 being set
for b3 being Vertex of b1 holds
( b2 in b3 .outNeighbors() iff ex b4 being set st b4 DJoins b3,b2,b1 )
proof end;

theorem Th74: :: GLIB_000:74
for b1 being _Graph
for b2 being set
for b3 being Vertex of b1 holds
( b2 in b3 .allNeighbors() iff ex b4 being set st b4 Joins b3,b2,b1 )
proof end;

theorem Th75: :: GLIB_000:75
for b1 being _Graph
for b2 being Subgraph of b1
for b3, b4, b5 being set holds
( ( b5 Joins b3,b4,b2 implies b5 Joins b3,b4,b1 ) & ( b5 DJoins b3,b4,b2 implies b5 DJoins b3,b4,b1 ) & ( b5 SJoins b3,b4,b2 implies b5 SJoins b3,b4,b1 ) & ( b5 DSJoins b3,b4,b2 implies b5 DSJoins b3,b4,b1 ) )
proof end;

theorem Th76: :: GLIB_000:76
for b1 being _Graph
for b2 being Subgraph of b1
for b3, b4, b5 being set st b5 in the_Edges_of b2 holds
( ( b5 Joins b3,b4,b1 implies b5 Joins b3,b4,b2 ) & ( b5 DJoins b3,b4,b1 implies b5 DJoins b3,b4,b2 ) & ( b5 SJoins b3,b4,b1 implies b5 SJoins b3,b4,b2 ) & ( b5 DSJoins b3,b4,b1 implies b5 DSJoins b3,b4,b2 ) )
proof end;

theorem Th77: :: GLIB_000:77
for b1 being _Graph
for b2 being spanning Subgraph of b1
for b3 being spanning Subgraph of b2 holds b3 is spanning Subgraph of b1
proof end;

theorem Th78: :: GLIB_000:78
for b1 being finite _Graph
for b2 being Subgraph of b1 holds
( b2 .order() <= b1 .order() & b2 .size() <= b1 .size() )
proof end;

theorem Th79: :: GLIB_000:79
for b1 being _Graph
for b2 being Subgraph of b1
for b3 being set holds
( b2 .edgesInto b3 c= b1 .edgesInto b3 & b2 .edgesOutOf b3 c= b1 .edgesOutOf b3 & b2 .edgesInOut b3 c= b1 .edgesInOut b3 & b2 .edgesBetween b3 c= b1 .edgesBetween b3 )
proof end;

theorem Th80: :: GLIB_000:80
for b1 being _Graph
for b2 being Subgraph of b1
for b3, b4 being set holds
( b2 .edgesBetween b3,b4 c= b1 .edgesBetween b3,b4 & b2 .edgesDBetween b3,b4 c= b1 .edgesDBetween b3,b4 )
proof end;

theorem Th81: :: GLIB_000:81
for b1 being _Graph
for b2 being Subgraph of b1
for b3 being Vertex of b1
for b4 being Vertex of b2 st b3 = b4 holds
( b4 .edgesIn() c= b3 .edgesIn() & b4 .edgesOut() c= b3 .edgesOut() & b4 .edgesInOut() c= b3 .edgesInOut() )
proof end;

theorem Th82: :: GLIB_000:82
for b1 being _Graph
for b2 being Subgraph of b1
for b3 being Vertex of b1
for b4 being Vertex of b2 st b3 = b4 holds
( b4 .edgesIn() = (b3 .edgesIn() ) /\ (the_Edges_of b2) & b4 .edgesOut() = (b3 .edgesOut() ) /\ (the_Edges_of b2) & b4 .edgesInOut() = (b3 .edgesInOut() ) /\ (the_Edges_of b2) )
proof end;

theorem Th83: :: GLIB_000:83
for b1 being _Graph
for b2 being Subgraph of b1
for b3 being Vertex of b1
for b4 being Vertex of b2
for b5 being set st b3 = b4 & b5 in the_Edges_of b2 holds
b3 .adj b5 = b4 .adj b5
proof end;

theorem Th84: :: GLIB_000:84
for b1 being finite _Graph
for b2 being Subgraph of b1
for b3 being Vertex of b1
for b4 being Vertex of b2 st b3 = b4 holds
( b4 .inDegree() <= b3 .inDegree() & b4 .outDegree() <= b3 .outDegree() & b4 .degree() <= b3 .degree() )
proof end;

theorem Th85: :: GLIB_000:85
for b1 being _Graph
for b2 being Subgraph of b1
for b3 being Vertex of b1
for b4 being Vertex of b2 st b3 = b4 holds
( b4 .inNeighbors() c= b3 .inNeighbors() & b4 .outNeighbors() c= b3 .outNeighbors() & b4 .allNeighbors() c= b3 .allNeighbors() )
proof end;

theorem Th86: :: GLIB_000:86
for b1 being _Graph
for b2 being Subgraph of b1
for b3 being Vertex of b1
for b4 being Vertex of b2 st b3 = b4 & b3 is isolated holds
b4 is isolated
proof end;

theorem Th87: :: GLIB_000:87
for b1 being _Graph
for b2 being Subgraph of b1
for b3 being Vertex of b1
for b4 being Vertex of b2 st b3 = b4 & b3 is endvertex & not b4 is endvertex holds
b4 is isolated
proof end;

theorem Th88: :: GLIB_000:88
for b1, b2, b3 being _Graph st b1 == b2 & b2 == b3 holds
b1 == b3
proof end;

theorem Th89: :: GLIB_000:89
for b1 being _Graph
for b2, b3 being 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;

theorem Th90: :: GLIB_000:90
for b1, b2 being _Graph holds
( b1 == b2 iff ( b1 is Subgraph of b2 & b2 is Subgraph of b1 ) )
proof end;

theorem Th91: :: GLIB_000:91
for b1, b2 being _Graph
for b3, b4, b5, b6, b7 being set st b1 == b2 holds
( ( b3 Joins b4,b5,b1 implies b3 Joins b4,b5,b2 ) & ( b3 DJoins b4,b5,b1 implies b3 DJoins b4,b5,b2 ) & ( b3 SJoins b6,b7,b1 implies b3 SJoins b6,b7,b2 ) & ( b3 DSJoins b6,b7,b1 implies b3 DSJoins b6,b7,b2 ) )
proof end;

theorem Th92: :: GLIB_000:92
for b1, b2 being _Graph st b1 == b2 holds
( ( b1 is finite implies b2 is finite ) & ( b1 is loopless implies b2 is loopless ) & ( b1 is trivial implies b2 is trivial ) & ( b1 is non-multi implies b2 is non-multi ) & ( b1 is non-Dmulti implies b2 is non-Dmulti ) & ( b1 is simple implies b2 is simple ) & ( b1 is Dsimple implies b2 is Dsimple ) )
proof end;

theorem Th93: :: GLIB_000:93
for b1, b2 being _Graph
for b3, b4 being set st b1 == b2 holds
( b1 .order() = b2 .order() & b1 .size() = b2 .size() & b1 .edgesInto b3 = b2 .edgesInto b3 & b1 .edgesOutOf b3 = b2 .edgesOutOf b3 & b1 .edgesInOut b3 = b2 .edgesInOut b3 & b1 .edgesBetween b3 = b2 .edgesBetween b3 & b1 .edgesDBetween b3,b4 = b2 .edgesDBetween b3,b4 )
proof end;

theorem Th94: :: GLIB_000:94
for b1, b2, b3 being _Graph st b1 == b2 & b3 is Subgraph of b1 holds
b3 is Subgraph of b2
proof end;

theorem Th95: :: GLIB_000:95
for b1, b2, b3 being _Graph st b1 == b2 & b1 is Subgraph of b3 holds
b2 is Subgraph of b3
proof end;

theorem Th96: :: GLIB_000:96
for b1 being _Graph
for b2, b3 being set
for b4, b5 being inducedSubgraph of b1,b2,b3 holds b4 == b5
proof end;

theorem Th97: :: GLIB_000:97
for b1 being _Graph
for b2 being inducedSubgraph of b1,(the_Vertices_of b1) holds b1 == b2
proof end;

theorem Th98: :: GLIB_000:98
for b1, b2 being _Graph
for b3, b4 being set
for b5 being inducedSubgraph of b1,b3,b4 st b1 == b2 holds
b5 is inducedSubgraph of b2,b3,b4
proof end;

theorem Th99: :: GLIB_000:99
for b1, b2 being _Graph
for b3 being set
for b4 being Vertex of b1
for b5 being Vertex of b2 st b4 = b5 & b1 == b2 holds
( b4 .edgesIn() = b5 .edgesIn() & b4 .edgesOut() = b5 .edgesOut() & b4 .edgesInOut() = b5 .edgesInOut() & b4 .adj b3 = b5 .adj b3 & b4 .inDegree() = b5 .inDegree() & b4 .outDegree() = b5 .outDegree() & b4 .degree() = b5 .degree() & b4 .inNeighbors() = b5 .inNeighbors() & b4 .outNeighbors() = b5 .outNeighbors() & b4 .allNeighbors() = b5 .allNeighbors() )
proof end;

theorem Th100: :: GLIB_000:100
for b1, b2 being _Graph
for b3 being Vertex of b1
for b4 being Vertex of b2 st b3 = b4 & b1 == b2 holds
( ( b3 is isolated implies b4 is isolated ) & ( b3 is endvertex implies b4 is endvertex ) )
proof end;

theorem Th101: :: GLIB_000:101
for b1 being _Graph
for b2, b3 being Subgraph of b1 holds
( not b2 c< b3 or the_Vertices_of b2 c< the_Vertices_of b3 or the_Edges_of b2 c< the_Edges_of b3 )
proof end;

theorem Th102: :: GLIB_000:102
for b1 being _Graph
for b2, b3 being Subgraph of b1 holds
( not b2 c< b3 or ex b4 being set st
( b4 in the_Vertices_of b3 & not b4 in the_Vertices_of b2 ) or ex b4 being set st
( b4 in the_Edges_of b3 & not b4 in the_Edges_of b2 ) )
proof end;