:: Refined Finiteness and Degree properties in Graphs
:: by Sebastian Koch
::
:: Received May 19, 2020
:: Copyright (c) 2020-2021 Association of Mizar Users

theorem Th1: :: GLIB_013:1
for G being non-Dmulti _Graph ex f being one-to-one Function st
( dom f = the_Edges_of G & rng f c= [:(),():] & ( for e being object st e in dom f holds
f . e = [(() . e),(() . e)] ) )
proof end;

theorem Th2: :: GLIB_013:2
for G being non-Dmulti _Graph holds G .size() c= () * ()
proof end;

theorem Th3: :: GLIB_013:3
for G being Dsimple _Graph ex f being one-to-one Function st
( dom f = the_Edges_of G & rng f c= [:(),():] \ () & ( for e being object st e in dom f holds
f . e = [(() . e),(() . e)] ) )
proof end;

theorem Th4: :: GLIB_013:4
for G being non-multi _Graph ex f being one-to-one Function st
( dom f = the_Edges_of G & rng f c= () \/ () & ( for e being object st e in dom f holds
f . e = {(() . e),(() . e)} ) )
proof end;

theorem Th5: :: GLIB_013:5
for G being simple _Graph ex f being one-to-one Function st
( dom f = the_Edges_of G & rng f c= 2Set () & ( for e being object st e in dom f holds
f . e = {(() . e),(() . e)} ) )
proof end;

definition
let G be _Graph;
attr G is vertex-finite means :Def1: :: GLIB_013:def 1
the_Vertices_of G is finite ;
attr G is edge-finite means :Def2: :: GLIB_013:def 2
the_Edges_of G is finite ;
end;

:: deftheorem Def1 defines vertex-finite GLIB_013:def 1 :
for G being _Graph holds
( G is vertex-finite iff the_Vertices_of G is finite );

:: deftheorem Def2 defines edge-finite GLIB_013:def 2 :
for G being _Graph holds
( G is edge-finite iff the_Edges_of G is finite );

theorem Th6: :: GLIB_013:6
for G being _Graph holds
( G is vertex-finite iff G .order() is finite ) ;

theorem Th7: :: GLIB_013:7
for G being _Graph holds
( G is edge-finite iff G .size() is finite ) ;

theorem Th8: :: GLIB_013:8
for G1, G2 being _Graph st G1 == G2 holds
( ( G1 is vertex-finite implies G2 is vertex-finite ) & ( G1 is edge-finite implies G2 is edge-finite ) ) by GLIB_000:def 34;

registration
let V be non empty finite set ;
let E be set ;
let S, T be Function of E,V;
cluster createGraph (V,E,S,T) -> vertex-finite ;
coherence
createGraph (V,E,S,T) is vertex-finite
;
end;

registration
let V be infinite set ;
let E be set ;
let S, T be Function of E,V;
cluster createGraph (V,E,S,T) -> non vertex-finite ;
coherence
not createGraph (V,E,S,T) is vertex-finite
;
end;

registration
let V be non empty set ;
let E be finite set ;
let S, T be Function of E,V;
cluster createGraph (V,E,S,T) -> edge-finite ;
coherence
createGraph (V,E,S,T) is edge-finite
;
end;

registration
let V be non empty set ;
let E be infinite set ;
let S, T be Function of E,V;
cluster createGraph (V,E,S,T) -> non edge-finite ;
coherence
not createGraph (V,E,S,T) is edge-finite
;
end;

registration
coherence
for b1 being _Graph st b1 is _finite holds
( b1 is vertex-finite & b1 is edge-finite )
;
coherence
for b1 being _Graph st b1 is vertex-finite & b1 is edge-finite holds
b1 is _finite
by GLIB_000:def 17;
coherence
for b1 being _Graph st b1 is edgeless holds
b1 is edge-finite
;
coherence
for b1 being _Graph st b1 is _trivial holds
b1 is vertex-finite
;
coherence
for b1 being _Graph st b1 is vertex-finite & b1 is non-Dmulti holds
b1 is edge-finite
proof end;
coherence
for b1 being _Graph st not b1 is vertex-finite & b1 is loopfull holds
not b1 is edge-finite
proof end;
existence
ex b1 being _Graph st
( b1 is vertex-finite & b1 is edge-finite & b1 is simple )
proof end;
existence
ex b1 being _Graph st
( b1 is vertex-finite & not b1 is edge-finite )
proof end;
existence
ex b1 being _Graph st
( not b1 is vertex-finite & b1 is edge-finite )
proof end;
existence
ex b1 being _Graph st
( not b1 is vertex-finite & not b1 is edge-finite )
proof end;
end;

registration
let G be vertex-finite _Graph;
cluster G .order() -> natural non zero ;
coherence
( not G .order() is zero & G .order() is natural )
proof end;
end;

definition
let G be vertex-finite _Graph;
:: original: .order()
redefine func G .order() -> non zero Nat;
coherence
G .order() is non zero Nat
;
end;

registration
let G be edge-finite _Graph;
coherence
proof end;
end;

definition
let G be edge-finite _Graph;
:: original: .size()
redefine func G .size() -> Nat;
coherence
G .size() is Nat
;
end;

theorem :: GLIB_013:9
for G being non-Dmulti vertex-finite _Graph holds G .size() <= () ^2
proof end;

theorem :: GLIB_013:10
for G being Dsimple vertex-finite _Graph holds G .size() <= (() ^2) - ()
proof end;

theorem :: GLIB_013:11
for G being non-multi vertex-finite _Graph holds G .size() <= ((() ^2) + ()) / 2
proof end;

theorem :: GLIB_013:12
for G being simple vertex-finite _Graph holds G .size() <= ((() ^2) - ()) / 2
proof end;

registration
let G be vertex-finite _Graph;
coherence by Def1;
cluster -> vertex-finite for Subgraph of G;
coherence
for b1 being Subgraph of G holds b1 is vertex-finite
proof end;
coherence
for b1 being DLGraphComplement of G holds
( b1 is vertex-finite & b1 is edge-finite )
proof end;
coherence
for b1 being LGraphComplement of G holds
( b1 is vertex-finite & b1 is edge-finite )
proof end;
coherence
for b1 being DGraphComplement of G holds
( b1 is vertex-finite & b1 is edge-finite )
proof end;
coherence
for b1 being GraphComplement of G holds
( b1 is vertex-finite & b1 is edge-finite )
proof end;
let V be finite set ;
cluster -> vertex-finite for addVertices of G,V;
coherence
for b1 being addVertices of G,V holds b1 is vertex-finite
proof end;
end;

registration
let G be vertex-finite _Graph;
let v be object ;
cluster -> vertex-finite for addVertices of G,{v};
coherence
for b1 being addVertex of G,v holds b1 is vertex-finite
;
let e, w be object ;
cluster -> vertex-finite for addEdge of G,v,e,w;
coherence
for b1 being addEdge of G,v,e,w holds b1 is vertex-finite
proof end;
cluster -> vertex-finite for addAdjVertex of G,v,e,w;
coherence
for b1 being addAdjVertex of G,v,e,w holds b1 is vertex-finite
proof end;
end;

registration
let G be vertex-finite _Graph;
let E be set ;
cluster -> vertex-finite for reverseEdgeDirections of G,E;
coherence
for b1 being reverseEdgeDirections of G,E holds b1 is vertex-finite
proof end;
end;

registration
let G be vertex-finite _Graph;
let v be object ;
let V be set ;
cluster -> vertex-finite for addAdjVertexAll of G,v,V;
coherence
for b1 being addAdjVertexAll of G,v,V holds b1 is vertex-finite
proof end;
end;

registration
let G be vertex-finite _Graph;
let V be set ;
cluster -> vertex-finite for addLoops of G,V;
coherence
for b1 being addLoops of G,V holds b1 is vertex-finite
proof end;
end;

registration
let G be _Graph;
let V be infinite set ;
cluster -> non vertex-finite for addVertices of G,V;
coherence
for b1 being addVertices of G,V holds not b1 is vertex-finite
proof end;
end;

registration
let G be non vertex-finite _Graph;
coherence
not the_Vertices_of G is finite
by Def1;
cluster -> non vertex-finite for Supergraph of G;
coherence
for b1 being Supergraph of G holds not b1 is vertex-finite
proof end;
cluster spanning -> non vertex-finite for Subgraph of G;
coherence
for b1 being Subgraph of G st b1 is spanning holds
not b1 is vertex-finite
proof end;
cluster -> non vertex-finite for DLGraphComplement of G;
coherence
for b1 being DLGraphComplement of G holds not b1 is vertex-finite
proof end;
cluster -> non vertex-finite for LGraphComplement of G;
coherence
for b1 being LGraphComplement of G holds not b1 is vertex-finite
proof end;
cluster -> non vertex-finite for DGraphComplement of G;
coherence
for b1 being DGraphComplement of G holds not b1 is vertex-finite
proof end;
cluster -> non vertex-finite for GraphComplement of G;
coherence
for b1 being GraphComplement of G holds not b1 is vertex-finite
proof end;
let V be infinite set ;
let E be set ;
cluster -> non vertex-finite for inducedSubgraph of G,V,E;
coherence
for b1 being inducedSubgraph of G,V,E holds not b1 is vertex-finite
proof end;
end;

registration
let G be non vertex-finite _Graph;
let V be infinite Subset of ();
cluster -> non edge-finite for addLoops of G,V;
coherence
for b1 being addLoops of G,V holds not b1 is edge-finite
proof end;
end;

registration
let G be edge-finite _Graph;
coherence by Def2;
cluster -> edge-finite for Subgraph of G;
coherence
for b1 being Subgraph of G holds b1 is edge-finite
proof end;
let V be set ;
cluster -> edge-finite for addVertices of G,V;
coherence
for b1 being addVertices of G,V holds b1 is edge-finite
proof end;
end;

registration
let G be edge-finite _Graph;
let E be set ;
cluster -> edge-finite for reverseEdgeDirections of G,E;
coherence
for b1 being reverseEdgeDirections of G,E holds b1 is edge-finite
proof end;
end;

registration
let G be edge-finite _Graph;
let v be object ;
cluster -> edge-finite for addVertices of G,{v};
coherence
for b1 being addVertex of G,v holds b1 is edge-finite
;
let e, w be object ;
cluster -> edge-finite for addEdge of G,v,e,w;
coherence
for b1 being addEdge of G,v,e,w holds b1 is edge-finite
proof end;
cluster -> edge-finite for addAdjVertex of G,v,e,w;
coherence
for b1 being addAdjVertex of G,v,e,w holds b1 is edge-finite
proof end;
end;

registration
let G be edge-finite _Graph;
let v be object ;
let V be finite set ;
cluster -> edge-finite for addAdjVertexAll of G,v,V;
coherence
for b1 being addAdjVertexAll of G,v,V holds b1 is edge-finite
proof end;
end;

registration
let G be edge-finite _Graph;
let V be finite Subset of ();
cluster -> edge-finite for addLoops of G,V;
coherence
for b1 being addLoops of G,V holds b1 is edge-finite
proof end;
end;

registration
let G be non vertex-finite edge-finite _Graph;
existence
ex b1 being Vertex of G st b1 is isolated
proof end;
end;

registration
let G be non vertex-finite edge-finite _Graph;
cluster -> non edge-finite for DLGraphComplement of G;
coherence
for b1 being DLGraphComplement of G holds not b1 is edge-finite
proof end;
cluster -> non edge-finite for LGraphComplement of G;
coherence
for b1 being LGraphComplement of G holds not b1 is edge-finite
proof end;
cluster -> non edge-finite for DGraphComplement of G;
coherence
for b1 being DGraphComplement of G holds not b1 is edge-finite
proof end;
cluster -> non edge-finite for GraphComplement of G;
coherence
for b1 being GraphComplement of G holds not b1 is edge-finite
proof end;
end;

registration
let G be non edge-finite _Graph;
coherence
not the_Edges_of G is finite
by Def2;
cluster -> non edge-finite for Supergraph of G;
coherence
for b1 being Supergraph of G holds not b1 is edge-finite
proof end;
let V be set ;
let E be infinite Subset of ();
cluster -> non edge-finite for inducedSubgraph of G,V,E;
coherence
for b1 being inducedSubgraph of G,V,E holds not b1 is edge-finite
proof end;
end;

registration
let G be non edge-finite _Graph;
let E be finite set ;
cluster -> non edge-finite for inducedSubgraph of G, the_Vertices_of G,() \ E;
coherence
for b1 being removeEdges of G,E holds not b1 is edge-finite
;
end;

registration
let G be non edge-finite _Graph;
let e be set ;
cluster -> non edge-finite for inducedSubgraph of G, the_Vertices_of G,() \ {e};
coherence
for b1 being removeEdge of G,e holds not b1 is edge-finite
;
end;

theorem Th13: :: GLIB_013:13
for G1, G2 being _Graph
for F being PGraphMapping of G1,G2 st F is weak_SG-embedding holds
( ( G2 is vertex-finite implies G1 is vertex-finite ) & ( G2 is edge-finite implies G1 is edge-finite ) )
proof end;

theorem Th14: :: GLIB_013:14
for G1, G2 being _Graph
for F being PGraphMapping of G1,G2 st F is onto holds
( ( G1 is vertex-finite implies G2 is vertex-finite ) & ( G1 is edge-finite implies G2 is edge-finite ) )
proof end;

theorem :: GLIB_013:15
for G1, G2 being _Graph
for F being PGraphMapping of G1,G2 st F is isomorphism holds
( ( G1 is vertex-finite implies G2 is vertex-finite ) & ( G2 is vertex-finite implies G1 is vertex-finite ) & ( G1 is edge-finite implies G2 is edge-finite ) & ( G2 is edge-finite implies G1 is edge-finite ) ) by ;

definition
let c be Cardinal;
let G be _Graph;
attr G is c -vertex means :Def3: :: GLIB_013:def 3
G .order() = c;
attr G is c -edge means :Def4: :: GLIB_013:def 4
G .size() = c;
end;

:: deftheorem Def3 defines -vertex GLIB_013:def 3 :
for c being Cardinal
for G being _Graph holds
( G is c -vertex iff G .order() = c );

:: deftheorem Def4 defines -edge GLIB_013:def 4 :
for c being Cardinal
for G being _Graph holds
( G is c -edge iff G .size() = c );

theorem :: GLIB_013:16
for G being _Graph holds
( G is vertex-finite iff ex n being non zero Nat st G is n -vertex )
proof end;

theorem :: GLIB_013:17
for G being _Graph holds
( G is edge-finite iff ex n being Nat st G is n -edge )
proof end;

theorem Th18: :: GLIB_013:18
for G1, G2 being _Graph
for c being Cardinal st the_Vertices_of G1 = the_Vertices_of G2 & G1 is c -vertex holds
G2 is c -vertex ;

theorem Th19: :: GLIB_013:19
for G1, G2 being _Graph
for c being Cardinal st the_Edges_of G1 = the_Edges_of G2 & G1 is c -edge holds
G2 is c -edge ;

theorem Th20: :: GLIB_013:20
for G1, G2 being _Graph
for c being Cardinal st G1 == G2 holds
( ( G1 is c -vertex implies G2 is c -vertex ) & ( G1 is c -edge implies G2 is c -edge ) ) by GLIB_000:def 34;

theorem :: GLIB_013:21
for G being _Graph holds
( G is G .order() -vertex & G is G .size() -edge ) ;

registration
let V be non empty set ;
let E be set ;
let S, T be Function of E,V;
cluster createGraph (V,E,S,T) -> card V -vertex card E -edge ;
coherence
( createGraph (V,E,S,T) is card V -vertex & createGraph (V,E,S,T) is card E -edge )
;
end;

registration
let a be non zero Cardinal;
let b be Cardinal;
existence
ex b1 being _Graph st
( b1 is a -vertex & b1 is b -edge )
proof end;
end;

registration
let c be Cardinal;
existence
ex b1 being _Graph st
( b1 is _trivial & b1 is c -edge )
proof end;
end;

registration
coherence
for b1 being _Graph holds not b1 is 0 -vertex
;
coherence
for b1 being _Graph st b1 is _trivial holds
b1 is 1 -vertex
by GLIB_000:def 19;
coherence
for b1 being _Graph st b1 is 1 -vertex holds
b1 is _trivial
by GLIB_000:def 19;
let n be non zero Nat;
coherence
for b1 being _Graph st b1 is n -vertex holds
b1 is vertex-finite
;
end;

registration
let c be non zero Cardinal;
let G be c -vertex _Graph;
cluster spanning -> c -vertex for Subgraph of G;
coherence
for b1 being Subgraph of G st b1 is spanning holds
b1 is c -vertex
proof end;
cluster -> c -vertex for DLGraphComplement of G;
coherence
for b1 being DLGraphComplement of G holds b1 is c -vertex
proof end;
cluster -> c -vertex for LGraphComplement of G;
coherence
for b1 being LGraphComplement of G holds b1 is c -vertex
proof end;
cluster -> c -vertex for DGraphComplement of G;
coherence
for b1 being DGraphComplement of G holds b1 is c -vertex
proof end;
cluster -> c -vertex for GraphComplement of G;
coherence
for b1 being GraphComplement of G holds b1 is c -vertex
proof end;
let E be set ;
cluster -> c -vertex for reverseEdgeDirections of G,E;
coherence
for b1 being reverseEdgeDirections of G,E holds b1 is c -vertex
proof end;
end;

registration
let c be non zero Cardinal;
let G be c -vertex _Graph;
let V be set ;
cluster -> c -vertex for addLoops of G,V;
coherence
for b1 being addLoops of G,V holds b1 is c -vertex
proof end;
end;

registration
let c be non zero Cardinal;
let G be c -vertex _Graph;
let v, e, w be object ;
cluster -> c -vertex for addEdge of G,v,e,w;
coherence
for b1 being addEdge of G,v,e,w holds b1 is c -vertex
proof end;
end;

registration
coherence
for b1 being _Graph st b1 is edgeless holds
b1 is 0 -edge
;
coherence
for b1 being _Graph st b1 is 0 -edge holds
b1 is edgeless
;
let n be Nat;
coherence
for b1 being _Graph st b1 is n -edge holds
b1 is edge-finite
;
end;

registration
let c be Cardinal;
let G be c -edge _Graph;
let E be set ;
cluster -> c -edge for reverseEdgeDirections of G,E;
coherence
for b1 being reverseEdgeDirections of G,E holds b1 is c -edge
proof end;
end;

registration
let c be Cardinal;
let G be c -edge _Graph;
let V be set ;
cluster -> c -edge for addVertices of G,V;
coherence
for b1 being addVertices of G,V holds b1 is c -edge
proof end;
end;

theorem :: GLIB_013:22
for G1, G2 being _Graph
for F being PGraphMapping of G1,G2
for c being Cardinal st F is isomorphism holds
( ( G1 is c -vertex implies G2 is c -vertex ) & ( G2 is c -vertex implies G1 is c -vertex ) & ( G1 is c -edge implies G2 is c -edge ) & ( G2 is c -edge implies G1 is c -edge ) ) by GLIB_010:84;

definition
let G be _Graph;
attr G is locally-finite means :Def5: :: GLIB_013:def 5
for v being Vertex of G holds v .edgesInOut() is finite ;
end;

:: deftheorem Def5 defines locally-finite GLIB_013:def 5 :
for G being _Graph holds
( G is locally-finite iff for v being Vertex of G holds v .edgesInOut() is finite );

theorem Th23: :: GLIB_013:23
for G being _Graph holds
( G is locally-finite iff for v being Vertex of G holds v .degree() is finite )
proof end;

theorem Th24: :: GLIB_013:24
for G1, G2 being _Graph st G1 == G2 & G1 is locally-finite holds
G2 is locally-finite
proof end;

theorem Th25: :: GLIB_013:25
for G being _Graph holds
( G is locally-finite iff for v being Vertex of G holds
( v .edgesIn() is finite & v .edgesOut() is finite ) )
proof end;

theorem :: GLIB_013:26
for G being _Graph holds
( G is locally-finite iff for v being Vertex of G holds
( v .inDegree() is finite & v .outDegree() is finite ) )
proof end;

theorem :: GLIB_013:27
for V being non empty set
for E being set
for S, T being Function of E,V st ( for v being Element of V holds
( S " {v} is finite & T " {v} is finite ) ) holds
createGraph (V,E,S,T) is locally-finite
proof end;

theorem :: GLIB_013:28
for V being non empty set
for E being set
for S, T being Function of E,V st ex v being Element of V st
( S " {v} is infinite or T " {v} is infinite ) holds
not createGraph (V,E,S,T) is locally-finite
proof end;

:: easy creation of non locally-finite graph
registration
let G be non vertex-finite _Graph;
let V be infinite Subset of ();
cluster -> non locally-finite for addAdjVertexAll of G, the_Vertices_of G,V;
coherence
for b1 being addAdjVertexAll of G, the_Vertices_of G,V holds not b1 is locally-finite
proof end;
end;

registration
coherence
for b1 being _Graph st b1 is edge-finite holds
b1 is locally-finite
;
existence
ex b1 being _Graph st b1 is locally-finite
proof end;
existence
not for b1 being _Graph holds b1 is locally-finite
proof end;
end;

registration
let G be locally-finite _Graph;
cluster -> locally-finite for Subgraph of G;
coherence
for b1 being Subgraph of G holds b1 is locally-finite
proof end;
let X be finite set ;
coherence
G .edgesInto X is finite
proof end;
coherence
proof end;
coherence ;
coherence ;
let Y be finite set ;
cluster G .edgesBetween (X,Y) -> finite ;
coherence
G .edgesBetween (X,Y) is finite
proof end;
cluster G .edgesDBetween (X,Y) -> finite ;
coherence
G .edgesDBetween (X,Y) is finite
proof end;
end;

registration
let G be locally-finite _Graph;
let v be Vertex of G;
coherence ;
coherence ;
coherence ;
coherence ;
coherence ;
coherence ;
end;

definition
let G be locally-finite _Graph;
let v be Vertex of G;
:: original: .inDegree()
redefine func v .inDegree() -> Nat;
coherence ;
:: original: .outDegree()
redefine func v .outDegree() -> Nat;
coherence ;
:: original: .degree()
redefine func v .degree() -> Nat;
coherence
v .degree() is Nat
;
end;

registration
let G be locally-finite _Graph;
let V be set ;
cluster -> locally-finite for addVertices of G,V;
coherence
for b1 being addVertices of G,V holds b1 is locally-finite
proof end;
cluster -> locally-finite for addLoops of G,V;
coherence
for b1 being addLoops of G,V holds b1 is locally-finite
proof end;
end;

registration
let G be locally-finite _Graph;
let E be set ;
cluster -> locally-finite for reverseEdgeDirections of G,E;
coherence
for b1 being reverseEdgeDirections of G,E holds b1 is locally-finite
proof end;
end;

registration
let G be locally-finite _Graph;
let v, e, w be object ;
cluster -> locally-finite for addEdge of G,v,e,w;
coherence
for b1 being addEdge of G,v,e,w holds b1 is locally-finite
proof end;
cluster -> locally-finite for addAdjVertex of G,v,e,w;
coherence
for b1 being addAdjVertex of G,v,e,w holds b1 is locally-finite
proof end;
end;

theorem Th29: :: GLIB_013:29
for G2 being _Graph
for v being object
for V being Subset of ()
for G1 being addAdjVertexAll of G2,v,V st not v in the_Vertices_of G2 holds
( ( G2 is locally-finite & V is finite ) iff G1 is locally-finite )
proof end;

registration
let G be locally-finite _Graph;
let v be object ;
let V be finite set ;
cluster -> locally-finite for addAdjVertexAll of G,v,V;
coherence
for b1 being addAdjVertexAll of G,v,V holds b1 is locally-finite
proof end;
end;

registration
let G be non locally-finite _Graph;
cluster -> non locally-finite for Supergraph of G;
coherence
for b1 being Supergraph of G holds not b1 is locally-finite
proof end;
let E be finite set ;
cluster -> non locally-finite for inducedSubgraph of G, the_Vertices_of G,() \ E;
coherence
for b1 being removeEdges of G,E holds not b1 is locally-finite
proof end;
end;

registration
let G be non locally-finite _Graph;
let e be set ;
cluster -> non locally-finite for inducedSubgraph of G, the_Vertices_of G,() \ {e};
coherence
for b1 being removeEdge of G,e holds not b1 is locally-finite
;
end;

theorem Th30: :: GLIB_013:30
for G1 being non locally-finite _Graph
for V being finite Subset of ()
for G2 being removeVertices of G1,V st ( for v being Vertex of G1 st v in V holds
v .edgesInOut() is finite ) holds
not G2 is locally-finite
proof end;

theorem :: GLIB_013:31
for G1 being non locally-finite _Graph
for v being Vertex of G1
for G2 being removeVertex of G1,v st v .edgesInOut() is finite holds
not G2 is locally-finite
proof end;

theorem Th32: :: GLIB_013:32
for G1, G2 being _Graph
for F being PGraphMapping of G1,G2 st F is weak_SG-embedding & G2 is locally-finite holds
G1 is locally-finite
proof end;

theorem :: GLIB_013:33
for G1, G2 being _Graph
for F being PGraphMapping of G1,G2 st F is onto & F is semi-Dcontinuous & G1 is locally-finite holds
G2 is locally-finite
proof end;

theorem :: GLIB_013:34
for G1, G2 being _Graph
for F being PGraphMapping of G1,G2 st F is isomorphism holds
( G1 is locally-finite iff G2 is locally-finite )
proof end;

definition
let G be _Graph;
func G .supDegree() -> Cardinal equals :: GLIB_013:def 6
union { () where v is Vertex of G : verum } ;
coherence
union { () where v is Vertex of G : verum } is Cardinal
proof end;
func G .supInDegree() -> Cardinal equals :: GLIB_013:def 7
union { () where v is Vertex of G : verum } ;
coherence
union { () where v is Vertex of G : verum } is Cardinal
proof end;
func G .supOutDegree() -> Cardinal equals :: GLIB_013:def 8
union { () where v is Vertex of G : verum } ;
coherence
union { () where v is Vertex of G : verum } is Cardinal
proof end;
func G .minDegree() -> Cardinal equals :: GLIB_013:def 9
meet { () where v is Vertex of G : verum } ;
coherence
meet { () where v is Vertex of G : verum } is Cardinal
proof end;
func G .minInDegree() -> Cardinal equals :: GLIB_013:def 10
meet { () where v is Vertex of G : verum } ;
coherence
meet { () where v is Vertex of G : verum } is Cardinal
proof end;
func G .minOutDegree() -> Cardinal equals :: GLIB_013:def 11
meet { () where v is Vertex of G : verum } ;
coherence
meet { () where v is Vertex of G : verum } is Cardinal
proof end;
end;

:: deftheorem defines .supDegree() GLIB_013:def 6 :
for G being _Graph holds G .supDegree() = union { () where v is Vertex of G : verum } ;

:: deftheorem defines .supInDegree() GLIB_013:def 7 :
for G being _Graph holds G .supInDegree() = union { () where v is Vertex of G : verum } ;

:: deftheorem defines .supOutDegree() GLIB_013:def 8 :
for G being _Graph holds G .supOutDegree() = union { () where v is Vertex of G : verum } ;

:: deftheorem defines .minDegree() GLIB_013:def 9 :
for G being _Graph holds G .minDegree() = meet { () where v is Vertex of G : verum } ;

:: deftheorem defines .minInDegree() GLIB_013:def 10 :
for G being _Graph holds G .minInDegree() = meet { () where v is Vertex of G : verum } ;

:: deftheorem defines .minOutDegree() GLIB_013:def 11 :
for G being _Graph holds G .minOutDegree() = meet { () where v is Vertex of G : verum } ;

theorem Th35: :: GLIB_013:35
for G being _Graph
for v being Vertex of G holds
( G .minDegree() c= v .degree() & v .degree() c= G .supDegree() & G .minInDegree() c= v .inDegree() & v .inDegree() c= G .supInDegree() & G .minOutDegree() c= v .outDegree() & v .outDegree() c= G .supOutDegree() )
proof end;

theorem Th36: :: GLIB_013:36
for G being _Graph
for c being Cardinal holds
( G .minDegree() = c iff ex v being Vertex of G st
( v .degree() = c & ( for w being Vertex of G holds v .degree() c= w .degree() ) ) )
proof end;

theorem Th37: :: GLIB_013:37
for G being _Graph
for c being Cardinal holds
( G .minInDegree() = c iff ex v being Vertex of G st
( v .inDegree() = c & ( for w being Vertex of G holds v .inDegree() c= w .inDegree() ) ) )
proof end;

theorem Th38: :: GLIB_013:38
for G being _Graph
for c being Cardinal holds
( G .minOutDegree() = c iff ex v being Vertex of G st
( v .outDegree() = c & ( for w being Vertex of G holds v .outDegree() c= w .outDegree() ) ) )
proof end;

theorem Th39: :: GLIB_013:39
for G being _Graph holds G .supInDegree() c= G .supDegree()
proof end;

theorem Th40: :: GLIB_013:40
for G being _Graph holds G .supOutDegree() c= G .supDegree()
proof end;

theorem :: GLIB_013:41
for G being _Graph holds G .minInDegree() c= G .minDegree()
proof end;

theorem :: GLIB_013:42
for G being _Graph holds G .minOutDegree() c= G .minDegree()
proof end;

theorem :: GLIB_013:43
for G being _Graph holds G .minDegree() c= G .supDegree() by SETFAM_1:2;

theorem :: GLIB_013:44
for G being _Graph holds G .minInDegree() c= G .supInDegree() by SETFAM_1:2;

theorem :: GLIB_013:45
for G being _Graph holds G .minOutDegree() c= G .supOutDegree() by SETFAM_1:2;

theorem Th46: :: GLIB_013:46
for G being _Graph st ex v being Vertex of G st v is isolated holds
( G .minDegree() = 0 & G .minInDegree() = 0 & G .minOutDegree() = 0 )
proof end;

theorem :: GLIB_013:47
for G being _Graph st G .minDegree() = 0 holds
ex v being Vertex of G st v is isolated
proof end;

::theorem
::for G being with_isolated_vertices _Graph
::holds G.minDegree() = 0 & G.minInDegree() = 0 & G.minOutDegree() = 0;
::theorem
::for G being without_isolated_vertices _Graph holds G.minDegree() <> 0;
theorem Th48: :: GLIB_013:48
for G being _Graph
for c being Cardinal st ex v being Vertex of G st
( v .degree() = c & ( for w being Vertex of G holds w .degree() c= v .degree() ) ) holds
G .supDegree() = c
proof end;

theorem Th49: :: GLIB_013:49
for G being _Graph
for c being Cardinal st ex v being Vertex of G st
( v .inDegree() = c & ( for w being Vertex of G holds w .inDegree() c= v .inDegree() ) ) holds
G .supInDegree() = c
proof end;

theorem Th50: :: GLIB_013:50
for G being _Graph
for c being Cardinal st ex v being Vertex of G st
( v .outDegree() = c & ( for w being Vertex of G holds w .outDegree() c= v .outDegree() ) ) holds
G .supOutDegree() = c
proof end;

theorem Th51: :: GLIB_013:51
for G1, G2 being _Graph
for F being PGraphMapping of G1,G2 st F is weak_SG-embedding holds
G1 .supDegree() c= G2 .supDegree()
proof end;

theorem Th52: :: GLIB_013:52
for G1, G2 being _Graph
for F being PGraphMapping of G1,G2 st F is weak_SG-embedding & rng (F _V) = the_Vertices_of G2 holds
G1 .minDegree() c= G2 .minDegree()
proof end;

theorem :: GLIB_013:53
for G1, G2 being _Graph
for F being PGraphMapping of G1,G2 st F is onto & F is semi-Dcontinuous holds
G2 .supDegree() c= G1 .supDegree()
proof end;

theorem :: GLIB_013:54
for G1, G2 being _Graph
for F being PGraphMapping of G1,G2 st F is onto & F is semi-Dcontinuous & dom (F _V) = the_Vertices_of G1 holds
G2 .minDegree() c= G1 .minDegree()
proof end;

theorem Th55: :: GLIB_013:55
for G1, G2 being _Graph
for F being PGraphMapping of G1,G2 st F is isomorphism holds
( G1 .supDegree() = G2 .supDegree() & G1 .minDegree() = G2 .minDegree() )
proof end;

theorem Th56: :: GLIB_013:56
for G1, G2 being _Graph
for F being PGraphMapping of G1,G2 st F is directed & F is weak_SG-embedding holds
( G1 .supInDegree() c= G2 .supInDegree() & G1 .supOutDegree() c= G2 .supOutDegree() )
proof end;

theorem Th57: :: GLIB_013:57
for G1, G2 being _Graph
for F being PGraphMapping of G1,G2 st F is directed & F is weak_SG-embedding & rng (F _V) = the_Vertices_of G2 holds
( G1 .minInDegree() c= G2 .minInDegree() & G1 .minOutDegree() c= G2 .minOutDegree() )
proof end;

theorem Th58: :: GLIB_013:58
for G1, G2 being _Graph
for F being PGraphMapping of G1,G2 st F is onto & F is semi-Dcontinuous holds
( G2 .supInDegree() c= G1 .supInDegree() & G2 .supOutDegree() c= G1 .supOutDegree() )
proof end;

theorem Th59: :: GLIB_013:59
for G1, G2 being _Graph
for F being PGraphMapping of G1,G2 st F is onto & F is semi-Dcontinuous & dom (F _V) = the_Vertices_of G1 holds
( G2 .minInDegree() c= G1 .minInDegree() & G2 .minOutDegree() c= G1 .minOutDegree() )
proof end;

theorem Th60: :: GLIB_013:60
for G1, G2 being _Graph
for F being PGraphMapping of G1,G2 st F is Disomorphism holds
( G1 .supInDegree() = G2 .supInDegree() & G1 .supOutDegree() = G2 .supOutDegree() & G1 .minInDegree() = G2 .minInDegree() & G1 .minOutDegree() = G2 .minOutDegree() )
proof end;

theorem :: GLIB_013:61
for G1 being _Graph
for E being set
for G2 being reverseEdgeDirections of G1,E holds
( G1 .supDegree() = G2 .supDegree() & G1 .minDegree() = G2 .minDegree() )
proof end;

theorem Th62: :: GLIB_013:62
for G1, G2 being _Graph st G1 == G2 holds
( G1 .supDegree() = G2 .supDegree() & G1 .minDegree() = G2 .minDegree() & G1 .supInDegree() = G2 .supInDegree() & G1 .minInDegree() = G2 .minInDegree() & G1 .supOutDegree() = G2 .supOutDegree() & G1 .minOutDegree() = G2 .minOutDegree() )
proof end;

theorem Th63: :: GLIB_013:63
for G1 being _Graph
for G2 being Subgraph of G1 holds
( G2 .supDegree() c= G1 .supDegree() & G2 .supInDegree() c= G1 .supInDegree() & G2 .supOutDegree() c= G1 .supOutDegree() )
proof end;

theorem :: GLIB_013:64
for G1 being _Graph
for G2 being spanning Subgraph of G1 holds
( G2 .minDegree() c= G1 .minDegree() & G2 .minInDegree() c= G1 .minInDegree() & G2 .minOutDegree() c= G1 .minOutDegree() )
proof end;

theorem :: GLIB_013:65
for G2 being _Graph
for V being set
for G1 being addVertices of G2,V holds
( G1 .supDegree() = G2 .supDegree() & G1 .supInDegree() = G2 .supInDegree() & G1 .supOutDegree() = G2 .supOutDegree() )
proof end;

theorem :: GLIB_013:66
for G2 being _Graph
for V being set
for G1 being addVertices of G2,V st V \ () <> {} holds
( G1 .minDegree() = 0 & G1 .minInDegree() = 0 & G1 .minOutDegree() = 0 )
proof end;

registration
let G be non edgeless _Graph;
cluster G .supDegree() -> non empty ;
coherence
not G .supDegree() is empty
proof end;
cluster G .supInDegree() -> non empty ;
coherence
not G .supInDegree() is empty
proof end;
cluster G .supOutDegree() -> non empty ;
coherence
not G .supOutDegree() is empty
proof end;
end;

:: better version
:: non trivial connected or loopfull <=> without_isolated_vertices
:: registration
:: let G be non trivial connected _Graph;
:: cluster G.minDegree() -> non empty;
:: coherence;
:: cluster G.minInDegree() -> non empty;
:: coherence;
:: cluster G.minOutDegree() -> non empty;
:: coherence;
:: end;
::
:: registration
:: let G be loopfull _Graph;
:: cluster G.minDegree() -> non empty;
:: coherence;
:: cluster G.minInDegree() -> non empty;
:: coherence;
:: cluster G.minOutDegree() -> non empty;
:: coherence;
:: end;
registration
let G be locally-finite _Graph;
coherence
proof end;
coherence
proof end;
coherence
proof end;
end;

definition
let G be locally-finite _Graph;
:: original: .minDegree()
redefine func G .minDegree() -> Nat;
coherence ;
:: original: .minInDegree()
redefine func G .minInDegree() -> Nat;
coherence ;
:: original: .minOutDegree()
redefine func G .minOutDegree() -> Nat;
coherence ;
end;

theorem :: GLIB_013:67
for G being locally-finite _Graph
for n being Nat holds
( G .minDegree() = n iff ex v being Vertex of G st
( v .degree() = n & ( for w being Vertex of G holds v .degree() <= w .degree() ) ) )
proof end;

theorem :: GLIB_013:68
for G being locally-finite _Graph
for n being Nat holds
( G .minInDegree() = n iff ex v being Vertex of G st
( v .inDegree() = n & ( for w being Vertex of G holds v .inDegree() <= w .inDegree() ) ) )
proof end;

theorem :: GLIB_013:69
for G being locally-finite _Graph
for n being Nat holds
( G .minOutDegree() = n iff ex v being Vertex of G st
( v .outDegree() = n & ( for w being Vertex of G holds v .outDegree() <= w .outDegree() ) ) )
proof end;

Lm1: for a, b being Cardinal st a c= b & a <> b holds
a + 1 c= b

proof end;

theorem Th70: :: GLIB_013:70
for G2 being _Graph
for v, w being Vertex of G2
for e being object
for G1 being addEdge of G2,v,e,w holds
( not v <> w or G1 .minDegree() = G2 .minDegree() or G1 .minDegree() = (() /\ ()) + 1 )
proof end;

theorem Th71: :: GLIB_013:71
for G2 being _Graph
for v, w being Vertex of G2
for e being object
for G1 being addEdge of G2,v,e,w holds
( not v <> w or G1 .minInDegree() = G2 .minInDegree() or G1 .minInDegree() = () + 1 )
proof end;

theorem Th72: :: GLIB_013:72
for G2 being _Graph
for v, w being Vertex of G2
for e being object
for G1 being addEdge of G2,v,e,w holds
( not v <> w or G1 .minOutDegree() = G2 .minOutDegree() or G1 .minOutDegree() = () + 1 )
proof end;

theorem :: GLIB_013:73
for G2 being locally-finite _Graph
for v, w being Vertex of G2
for e being object
for G1 being addEdge of G2,v,e,w holds
( not v <> w or G1 .minDegree() = G2 .minDegree() or G1 .minDegree() = (min ((),())) + 1 )
proof end;

theorem :: GLIB_013:74
for G2 being locally-finite _Graph
for v, w being Vertex of G2
for e being object
for G1 being addEdge of G2,v,e,w holds
( not v <> w or G1 .minInDegree() = G2 .minInDegree() or G1 .minInDegree() = () + 1 )
proof end;

theorem :: GLIB_013:75
for G2 being locally-finite _Graph
for v, w being Vertex of G2
for e being object
for G1 being addEdge of G2,v,e,w holds
( not v <> w or G1 .minOutDegree() = G2 .minOutDegree() or G1 .minOutDegree() = () + 1 )
proof end;

:: :: better in combination with_isolated_vertices
:: theorem
:: for G2 being _Graph, v being Vertex of G2, e,w being object
:: for G1 being addAdjVertex of G2,v,e,w
:: st not e in the_Edges_of G2 & not w in the_Vertices_of G2
:: holds G1.minDegree() = {1} /\ G2.minDegree();
::
:: theorem
:: for G2 being _Graph, v,e being object, w being Vertex of G2
:: for G1 being addAdjVertex of G2,v,e,w
:: st not e in the_Edges_of G2 & not v in the_Vertices_of G2
:: holds G1.minDegree() = {1} /\ G2.minDegree();
::
:: theorem
:: for G2 being locally-finite _Graph, v being Vertex of G2,e,w being object
:: for G1 being addAdjVertex of G2,v,e,w
:: st not e in the_Edges_of G2 & not w in the_Vertices_of G2
:: holds G1.minDegree() = min(1,G2.minDegree());
::
:: theorem
:: for G2 being locally-finite _Graph, v,e being object,w being Vertex of G2
:: for G1 being addAdjVertex of G2,v,e,w
:: st not e in the_Edges_of G2 & not v in the_Vertices_of G2
:: holds G1.minDegree() = min(1,G2.minDegree());
theorem Th76: :: GLIB_013:76
for G2 being _Graph
for v being object
for G1 being addAdjVertexAll of G2,v st not v in the_Vertices_of G2 holds
G1 .minDegree() = (() + 1) /\ (G2 .order())
proof end;

theorem :: GLIB_013:77
for G2 being _finite _Graph
for v being object
for G1 being addAdjVertexAll of G2,v st not v in the_Vertices_of G2 holds
G1 .minDegree() = min ((() + 1),(G2 .order()))
proof end;

Lm2: for a, b, c being Cardinal st c c= a & c c= b & a in c + 2 & not a c= b holds
b = c

proof end;

theorem :: GLIB_013:78
for G2 being _Graph
for V being set
for G1 being addLoops of G2,V holds G1 .minDegree() c= () + 2
proof end;

registration
let G be edge-finite _Graph;
coherence
proof end;
coherence
proof end;
coherence
proof end;
end;

definition
let G be edge-finite _Graph;
:: original: .supDegree()
redefine func G .supDegree() -> Nat;
coherence ;
:: original: .supInDegree()
redefine func G .supInDegree() -> Nat;
coherence ;
:: original: .supOutDegree()
redefine func G .supOutDegree() -> Nat;
coherence ;
end;

definition
let G be _Graph;
attr G is with_max_degree means :Def12: :: GLIB_013:def 12
ex v being Vertex of G st
for w being Vertex of G holds w .degree() c= v .degree() ;
attr G is with_max_in_degree means :Def13: :: GLIB_013:def 13
ex v being Vertex of G st
for w being Vertex of G holds w .inDegree() c= v .inDegree() ;
attr G is with_max_out_degree means :Def14: :: GLIB_013:def 14
ex v being Vertex of G st
for w being Vertex of G holds w .outDegree() c= v .outDegree() ;
end;

:: deftheorem Def12 defines with_max_degree GLIB_013:def 12 :
for G being _Graph holds
( G is with_max_degree iff ex v being Vertex of G st
for w being Vertex of G holds w .degree() c= v .degree() );

:: deftheorem Def13 defines with_max_in_degree GLIB_013:def 13 :
for G being _Graph holds
( G is with_max_in_degree iff ex v being Vertex of G st
for w being Vertex of G holds w .inDegree() c= v .inDegree() );

:: deftheorem Def14 defines with_max_out_degree GLIB_013:def 14 :
for G being _Graph holds
( G is with_max_out_degree iff ex v being Vertex of G st
for w being Vertex of G holds w .outDegree() c= v .outDegree() );

theorem Th79: :: GLIB_013:79
for G being _Graph st G is with_max_degree holds
ex v being Vertex of G st
( v .degree() = G .supDegree() & ( for w being Vertex of G holds w .degree() c= v .degree() ) )
proof end;

theorem Th80: :: GLIB_013:80
for G being _Graph st G is with_max_in_degree holds
ex v being Vertex of G st
( v .inDegree() = G .supInDegree() & ( for w being Vertex of G holds w .inDegree() c= v .inDegree() ) )
proof end;

theorem Th81: :: GLIB_013:81
for G being _Graph st G is with_max_out_degree holds
ex v being Vertex of G st
( v .outDegree() = G .supOutDegree() & ( for w being Vertex of G holds w .outDegree() c= v .outDegree() ) )
proof end;

Lm3: for G being _Graph st ex v being Vertex of G st v .degree() = G .supDegree() holds
G is with_max_degree

proof end;

Lm4: for G being _Graph st ex v being Vertex of G st v .inDegree() = G .supInDegree() holds
G is with_max_in_degree

proof end;

Lm5: for G being _Graph st ex v being Vertex of G st v .outDegree() = G .supOutDegree() holds
G is with_max_out_degree

proof end;

notation end;

registration
coherence
for b1 being _Graph st b1 is with_max_in_degree & b1 is with_max_out_degree holds
b1 is with_max_degree
proof end;
coherence
for b1 being _Graph st b1 is vertex-finite holds
( b1 is with_max_degree & b1 is with_max_in_degree & b1 is with_max_out_degree )
proof end;
coherence
for b1 being _Graph st b1 is edge-finite holds
( b1 is with_max_degree & b1 is with_max_in_degree & b1 is with_max_out_degree )
proof end;
end;

theorem :: GLIB_013:82
for G being with_max_degree _Graph holds
( G is with_max_in_degree or G is with_max_out_degree )
proof end;

notation end;

notation end;

notation end;

registration
let G be locally-finite with_max_degree _Graph;
coherence
proof end;
end;

definition
let G be locally-finite with_max_degree _Graph;
:: original: .supDegree()
redefine func G .maxDegree() -> Nat;
coherence ;
end;

registration
let G be locally-finite with_max_in_degree _Graph;
coherence
proof end;
end;

definition
let G be locally-finite with_max_in_degree _Graph;
:: original: .supInDegree()
redefine func G .maxInDegree() -> Nat;
coherence ;
end;

registration
let G be locally-finite with_max_out_degree _Graph;
coherence
proof end;
end;

definition
let G be locally-finite with_max_out_degree _Graph;
:: original: .supOutDegree()
redefine func G .maxOutDegree() -> Nat;
coherence ;
end;

theorem Th83: :: GLIB_013:83
for G1, G2 being _Graph
for F being PGraphMapping of G1,G2 st F is isomorphism holds
( G1 is with_max_degree iff G2 is with_max_degree )
proof end;

theorem Th84: :: GLIB_013:84
for G1, G2 being _Graph
for F being PGraphMapping of G1,G2 st F is Disomorphism holds
( ( G1 is with_max_in_degree implies G2 is with_max_in_degree ) & ( G2 is with_max_in_degree implies G1 is with_max_in_degree ) & ( G1 is with_max_out_degree implies G2 is with_max_out_degree ) & ( G2 is with_max_out_degree implies G1 is with_max_out_degree ) )
proof end;

theorem Th85: :: GLIB_013:85
for G1, G2 being _Graph st G1 == G2 holds
( ( G1 is with_max_degree implies G2 is with_max_degree ) & ( G1 is with_max_in_degree implies G2 is with_max_in_degree ) & ( G1 is with_max_out_degree implies G2 is with_max_out_degree ) )
proof end;

theorem Th86: :: GLIB_013:86
for G1 being _Graph
for E being set
for G2 being reverseEdgeDirections of G1,E holds
( G1 is with_max_degree iff G2 is with_max_degree )
proof end;

registration
let G be with_max_degree _Graph;
let E be set ;
cluster -> with_max_degree for reverseEdgeDirections of G,E;
coherence
for b1 being reverseEdgeDirections of G,E holds b1 is with_max_degree
by Th86;
end;

Lm6: for a, b, c being Cardinal st a c= c & b c= c & c c< a + 2 & not b c= a holds
b = c

proof end;

registration
let G be with_max_degree _Graph;
let V be set ;
cluster -> with_max_degree for addVertices of G,V;
coherence
for b1 being addVertices of G,V holds b1 is with_max_degree
proof end;
cluster -> with_max_degree for addLoops of G,V;
coherence
for b1 being addLoops of G,V holds b1 is with_max_degree
proof end;
end;

registration
let G be with_max_degree _Graph;
let v, e, w be object ;
cluster -> with_max_degree for addEdge of G,v,e,w;
coherence
for b1 being addEdge of G,v,e,w holds b1 is with_max_degree
proof end;
cluster -> with_max_degree for addAdjVertex of G,v,e,w;
coherence
for b1 being addAdjVertex of G,v,e,w holds b1 is with_max_degree
proof end;
end;

Lm7: for a, b being Cardinal st a in b + 1 holds
a c= b

proof end;

registration
let G be with_max_degree _Graph;
let v be object ;
let V be set ;
cluster -> with_max_degree for addAdjVertexAll of G,v,V;
coherence
for b1 being addAdjVertexAll of G,v,V holds b1 is with_max_degree
proof end;
end;

registration
let G be with_max_in_degree _Graph;
coherence
for b1 being reverseEdgeDirections of G holds b1 is with_max_out_degree
proof end;
end;

registration
let G be with_max_in_degree _Graph;
let V be set ;
cluster -> with_max_in_degree for addVertices of G,V;
coherence
for b1 being addVertices of G,V holds b1 is with_max_in_degree
proof end;
cluster -> with_max_in_degree for addLoops of G,V;
coherence
for b1 being addLoops of G,V holds b1 is with_max_in_degree
proof end;
end;

registration
let G be with_max_in_degree _Graph;
let v, e, w be object ;
cluster -> with_max_in_degree for addEdge of G,v,e,w;
coherence
for b1 being addEdge of G,v,e,w holds b1 is with_max_in_degree
proof end;
cluster -> with_max_in_degree for addAdjVertex of G,v,e,w;
coherence
for b1 being addAdjVertex of G,v,e,w holds b1 is with_max_in_degree
proof end;
end;

registration
let G be with_max_in_degree _Graph;
let v be object ;
let V be set ;
cluster -> with_max_in_degree for addAdjVertexAll of G,v,V;
coherence
for b1 being addAdjVertexAll of G,v,V holds b1 is with_max_in_degree
proof end;
end;

registration
let G be with_max_out_degree _Graph;
coherence
for b1 being reverseEdgeDirections of G holds b1 is with_max_in_degree
proof end;
end;

registration
let G be with_max_out_degree _Graph;
let V be set ;
cluster -> with_max_out_degree for addVertices of G,V;
coherence
for b1 being addVertices of G,V holds b1 is with_max_out_degree
proof end;
cluster -> with_max_out_degree for addLoops of G,V;
coherence
for b1 being addLoops of G,V holds b1 is with_max_out_degree
proof end;
end;

registration
let G be with_max_out_degree _Graph;
let v, e, w be object ;
cluster -> with_max_out_degree for addEdge of G,v,e,w;
coherence
for b1 being addEdge of G,v,e,w holds b1 is with_max_out_degree
proof end;
cluster -> with_max_out_degree for addAdjVertex of G,v,e,w;
coherence
for b1 being addAdjVertex of G,v,e,w holds b1 is with_max_out_degree
proof end;
end;

registration
let G be with_max_out_degree _Graph;
let v be object ;
let V be set ;
cluster -> with_max_out_degree for addAdjVertexAll of G,v,V;
coherence
for b1 being addAdjVertexAll of G,v,V holds b1 is with_max_out_degree
proof end;
end;

:: registration
:: let G be without_max_degree _Graph, E be set;
:: cluster -> without_max_degree for reverseEdgeDirections of G, E;
:: coherence;
:: end;
::
:: registration
:: let G be without_max_degree _Graph, V be set;
:: cluster -> without_max_degree for addVertices of G, V;
:: coherence;
:: cluster -> without_max_degree for addLoops of G, V;
:: coherence;
:: end;
::
:: registration
:: let G be without_max_degree _Graph, v,e,w be object;
:: cluster -> without_max_degree for addEdge of G,v,e,w;
:: coherence;
:: cluster -> without_max_degree for addAdjVertex of G,v,e,w;
:: coherence;
:: end;
::
:: registration
:: let G be without_max_degree _Graph, v be object, V be set;
:: cluster -> without_max_degree for addAdjVertexAll of G,v,V;
:: coherence;
:: end;
::
:: registration
:: let G be without_max_in_degree _Graph, E be set;
:: cluster -> without_max_in_degree for reverseEdgeDirections of G, E;
:: coherence;
:: end;
::
:: registration
:: let G be without_max_in_degree _Graph, V be set;
:: cluster -> without_max_in_degree for addVertices of G, V;
:: coherence;
:: cluster -> without_max_in_degree for addLoops of G, V;
:: coherence;
:: end;
::
:: registration
:: let G be without_max_in_degree _Graph, v,e,w be object;
:: cluster -> without_max_in_degree for addEdge of G,v,e,w;
:: coherence;
:: cluster -> without_max_in_degree for addAdjVertex of G,v,e,w;
:: coherence;
:: end;
::
:: registration
:: let G be without_max_in_degree _Graph, v be object, V be set;
:: cluster -> without_max_in_degree for addAdjVertexAll of G,v,V;
:: coherence;
:: end;
::
:: registration
:: let G be without_max_out_degree _Graph, E be set;
:: cluster -> without_max_out_degree for reverseEdgeDirections of G, E;
:: coherence;
:: end;
::
:: registration
:: let G be without_max_out_degree _Graph, V be set;
:: cluster -> without_max_out_degree for addVertices of G, V;
:: coherence;
:: cluster -> without_max_out_degree for addLoops of G, V;
:: coherence;
:: end;
::
:: registration
:: let G be without_max_out_degree _Graph, v,e,w be object;
:: cluster -> without_max_out_degree for addEdge of G,v,e,w;
:: coherence;
:: cluster -> without_max_out_degree for addAdjVertex of G,v,e,w;
:: coherence;
:: end;
::
:: registration
:: let G be without_max_out_degree _Graph, v be object, V be set;
:: cluster -> without_max_out_degree for addAdjVertexAll of G,v,V;
:: coherence;
:: end;
theorem :: GLIB_013:87
for G being locally-finite with_max_degree _Graph
for n being Nat holds
( G .maxDegree() = n iff ex v being Vertex of G st
( v .degree() = n & ( for w being Vertex of G holds w .degree() <= v .degree() ) ) )
proof end;

theorem :: GLIB_013:88
for G being locally-finite with_max_in_degree _Graph
for n being Nat holds
( G .maxInDegree() = n iff ex v being Vertex of G st
( v .inDegree() = n & ( for w being Vertex of G holds w .inDegree() <= v .inDegree() ) ) )
proof end;

theorem :: GLIB_013:89
for G being locally-finite with_max_out_degree _Graph
for n being Nat holds
( G .maxOutDegree() = n iff ex v being Vertex of G st
( v .outDegree() = n & ( for w being Vertex of G holds w .outDegree() <= v .outDegree() ) ) )
proof end;

theorem :: GLIB_013:90
for c being Cardinal
for G being _trivial b1 -edge _Graph holds
( G .maxInDegree() = c & G .minInDegree() = c & G .maxOutDegree() = c & G .minOutDegree() = c & G .maxDegree() = c + c & G .minDegree() = c + c )
proof end;

definition
let G be _Graph;
let v be Vertex of G;
end;

:: deftheorem defines with_min_degree GLIB_013:def 15 :
for G being _Graph
for v being Vertex of G holds
( v is with_min_degree iff v .degree() = G .minDegree() );

:: deftheorem defines with_min_in_degree GLIB_013:def 16 :
for G being _Graph
for v being Vertex of G holds
( v is with_min_in_degree iff v .inDegree() = G .minInDegree() );

:: deftheorem defines with_min_out_degree GLIB_013:def 17 :
for G being _Graph
for v being Vertex of G holds
( v is with_min_out_degree iff v .outDegree() = G .minOutDegree() );

:: deftheorem defines with_max_degree GLIB_013:def 18 :
for G being _Graph
for v being Vertex of G holds
( v is with_max_degree iff v .degree() = G .supDegree() );

:: deftheorem defines with_max_in_degree GLIB_013:def 19 :
for G being _Graph
for v being Vertex of G holds
( v is with_max_in_degree iff v .inDegree() = G .supInDegree() );

:: deftheorem defines with_max_out_degree GLIB_013:def 20 :
for G being _Graph
for v being Vertex of G holds
( v is with_max_out_degree iff v .outDegree() = G .supOutDegree() );

theorem :: GLIB_013:91
for G being _Graph
for v, w being Vertex of G st v is with_min_degree holds
v .degree() c= w .degree()
proof end;

theorem Th92: :: GLIB_013:92
for G being _Graph
for v, w being Vertex of G st v is with_min_in_degree holds
v .inDegree() c= w .inDegree()
proof end;

theorem Th93: :: GLIB_013:93
for G being _Graph
for v, w being Vertex of G st v is with_min_out_degree holds
v .outDegree() c= w .outDegree()
proof end;

theorem :: GLIB_013:94
for G being _Graph
for v, w being Vertex of G st w is with_max_degree holds
v .degree() c= w .degree()
proof end;

theorem Th95: :: GLIB_013:95
for G being _Graph
for v, w being Vertex of G st w is with_max_in_degree holds
v .inDegree() c= w .inDegree()
proof end;

theorem Th96: :: GLIB_013:96
for G being _Graph
for v, w being Vertex of G st w is with_max_out_degree holds
v .outDegree() c= w .outDegree()
proof end;

registration
let G be _Graph;
existence
ex b1 being Vertex of G st b1 is with_min_degree
proof end;
existence
ex b1 being Vertex of G st b1 is with_min_in_degree
proof end;
existence
ex b1 being Vertex of G st b1 is with_min_out_degree
proof end;
coherence
for b1 being Vertex of G st b1 is with_min_in_degree & b1 is with_min_out_degree holds
b1 is with_min_degree
proof end;
coherence
for b1 being Vertex of G st b1 is with_max_in_degree & b1 is with_max_out_degree holds
b1 is with_max_degree
proof end;
coherence
for b1 being Vertex of G st b1 is isolated holds
( b1 is with_min_degree & b1 is with_min_in_degree & b1 is with_min_out_degree )
proof end;
end;

theorem Th97: :: GLIB_013:97
for G being _Graph holds
( G is with_max_degree iff ex v being Vertex of G st v is with_max_degree )
proof end;

theorem Th98: :: GLIB_013:98
for G being _Graph holds
( G is with_max_in_degree iff ex v being Vertex of G st v is with_max_in_degree )
proof end;

theorem Th99: :: GLIB_013:99
for G being _Graph holds
( G is with_max_out_degree iff ex v being Vertex of G st v is with_max_out_degree )
proof end;

registration
let G be with_max_degree _Graph;
existence
ex b1 being Vertex of G st b1 is with_max_degree
by Th97;
end;

registration
let G be with_max_in_degree _Graph;
existence
ex b1 being Vertex of G st b1 is with_max_in_degree
by Th98;
end;

registration
let G be with_max_out_degree _Graph;
existence
ex b1 being Vertex of G st b1 is with_max_out_degree
by Th99;
end;