:: GLIB_003 semantic presentation

definition
let c1 be set ;
let c2 be FinSequence of c1;
let c3 be FinSubsequence of c2;
redefine func Seq as Seq c3 -> FinSequence of a1;
correctness
coherence
Seq c3 is FinSequence of c1
;
proof end;
end;

registration
let c1 be real-yielding Relation;
let c2 be set ;
cluster a1 | a2 -> real-yielding ;
coherence
c1 | c2 is real-yielding
;
end;

theorem Th1: :: GLIB_003:1
for b1, b2, b3, b4, b5, b6, b7, b8, b9, b10 being set
for b11 being FinSequence st b11 = ((((((((<*b1*> ^ <*b2*>) ^ <*b3*>) ^ <*b4*>) ^ <*b5*>) ^ <*b6*>) ^ <*b7*>) ^ <*b8*>) ^ <*b9*>) ^ <*b10*> holds
( len b11 = 10 & b11 . 1 = b1 & b11 . 2 = b2 & b11 . 3 = b3 & b11 . 4 = b4 & b11 . 5 = b5 & b11 . 6 = b6 & b11 . 7 = b7 & b11 . 8 = b8 & b11 . 9 = b9 & b11 . 10 = b10 )
proof end;

theorem Th2: :: GLIB_003:2
for b1 being FinSequence of REAL
for b2 being FinSubsequence of b1 st ( for b3 being Nat st b3 in dom b1 holds
0 <= b1 . b3 ) holds
Sum (Seq b2) <= Sum b1
proof end;

definition
func WeightSelector -> Nat equals :: GLIB_003:def 1
5;
coherence
5 is Nat
;
func ELabelSelector -> Nat equals :: GLIB_003:def 2
6;
coherence
6 is Nat
;
func VLabelSelector -> Nat equals :: GLIB_003:def 3
7;
coherence
7 is Nat
;
end;

:: deftheorem Def1 defines WeightSelector GLIB_003:def 1 :
WeightSelector = 5;

:: deftheorem Def2 defines ELabelSelector GLIB_003:def 2 :
ELabelSelector = 6;

:: deftheorem Def3 defines VLabelSelector GLIB_003:def 3 :
VLabelSelector = 7;

definition
let c1 be GraphStruct ;
attr a1 is [Weighted] means :Def4: :: GLIB_003:def 4
( WeightSelector in dom a1 & a1 . WeightSelector is ManySortedSet of the_Edges_of a1 );
attr a1 is [ELabeled] means :Def5: :: GLIB_003:def 5
( ELabelSelector in dom a1 & ex b1 being Function st
( a1 . ELabelSelector = b1 & dom b1 c= the_Edges_of a1 ) );
attr a1 is [VLabeled] means :Def6: :: GLIB_003:def 6
( VLabelSelector in dom a1 & ex b1 being Function st
( a1 . VLabelSelector = b1 & dom b1 c= the_Vertices_of a1 ) );
end;

:: deftheorem Def4 defines [Weighted] GLIB_003:def 4 :
for b1 being GraphStruct holds
( b1 is [Weighted] iff ( WeightSelector in dom b1 & b1 . WeightSelector is ManySortedSet of the_Edges_of b1 ) );

:: deftheorem Def5 defines [ELabeled] GLIB_003:def 5 :
for b1 being GraphStruct holds
( b1 is [ELabeled] iff ( ELabelSelector in dom b1 & ex b2 being Function st
( b1 . ELabelSelector = b2 & dom b2 c= the_Edges_of b1 ) ) );

:: deftheorem Def6 defines [VLabeled] GLIB_003:def 6 :
for b1 being GraphStruct holds
( b1 is [VLabeled] iff ( VLabelSelector in dom b1 & ex b2 being Function st
( b1 . VLabelSelector = b2 & dom b2 c= the_Vertices_of b1 ) ) );

registration
cluster [Graph-like] [Weighted] [ELabeled] [VLabeled] GraphStruct ;
existence
ex b1 being GraphStruct st
( b1 is [Graph-like] & b1 is [Weighted] & b1 is [ELabeled] & b1 is [VLabeled] )
proof end;
end;

definition
mode WGraph is [Weighted] _Graph;
mode EGraph is [ELabeled] _Graph;
mode VGraph is [VLabeled] _Graph;
mode WEGraph is [Weighted] [ELabeled] _Graph;
mode WVGraph is [Weighted] [VLabeled] _Graph;
mode EVGraph is [ELabeled] [VLabeled] _Graph;
mode WEVGraph is [Weighted] [ELabeled] [VLabeled] _Graph;
end;

definition
let c1 be WGraph;
func the_Weight_of c1 -> ManySortedSet of the_Edges_of a1 equals :: GLIB_003:def 7
a1 . WeightSelector ;
coherence
c1 . WeightSelector is ManySortedSet of the_Edges_of c1
by Def4;
end;

:: deftheorem Def7 defines the_Weight_of GLIB_003:def 7 :
for b1 being WGraph holds the_Weight_of b1 = b1 . WeightSelector ;

definition
let c1 be EGraph;
func the_ELabel_of c1 -> Function equals :: GLIB_003:def 8
a1 . ELabelSelector ;
coherence
c1 . ELabelSelector is Function
proof end;
end;

:: deftheorem Def8 defines the_ELabel_of GLIB_003:def 8 :
for b1 being EGraph holds the_ELabel_of b1 = b1 . ELabelSelector ;

definition
let c1 be VGraph;
func the_VLabel_of c1 -> Function equals :: GLIB_003:def 9
a1 . VLabelSelector ;
coherence
c1 . VLabelSelector is Function
proof end;
end;

:: deftheorem Def9 defines the_VLabel_of GLIB_003:def 9 :
for b1 being VGraph holds the_VLabel_of b1 = b1 . VLabelSelector ;

Lemma5: for b1 being EGraph holds dom (the_ELabel_of b1) c= the_Edges_of b1
proof end;

Lemma6: for b1 being VGraph holds dom (the_VLabel_of b1) c= the_Vertices_of b1
proof end;

registration
let c1 be _Graph;
let c2 be set ;
cluster a1 .set WeightSelector ,a2 -> [Graph-like] ;
coherence
c1 .set WeightSelector ,c2 is [Graph-like]
proof end;
cluster a1 .set ELabelSelector ,a2 -> [Graph-like] ;
coherence
c1 .set ELabelSelector ,c2 is [Graph-like]
proof end;
cluster a1 .set VLabelSelector ,a2 -> [Graph-like] ;
coherence
c1 .set VLabelSelector ,c2 is [Graph-like]
proof end;
end;

Lemma7: for b1 being _Graph
for b2 being set holds
( b1 .set WeightSelector ,b2 == b1 & b1 .set ELabelSelector ,b2 == b1 & b1 .set VLabelSelector ,b2 == b1 )
proof end;

registration
let c1 be finite _Graph;
let c2 be set ;
cluster a1 .set WeightSelector ,a2 -> [Graph-like] finite ;
coherence
c1 .set WeightSelector ,c2 is finite
proof end;
cluster a1 .set ELabelSelector ,a2 -> [Graph-like] finite ;
coherence
c1 .set ELabelSelector ,c2 is finite
proof end;
cluster a1 .set VLabelSelector ,a2 -> [Graph-like] finite ;
coherence
c1 .set VLabelSelector ,c2 is finite
proof end;
end;

registration
let c1 be loopless _Graph;
let c2 be set ;
cluster a1 .set WeightSelector ,a2 -> [Graph-like] loopless ;
coherence
c1 .set WeightSelector ,c2 is loopless
proof end;
cluster a1 .set ELabelSelector ,a2 -> [Graph-like] loopless ;
coherence
c1 .set ELabelSelector ,c2 is loopless
proof end;
cluster a1 .set VLabelSelector ,a2 -> [Graph-like] loopless ;
coherence
c1 .set VLabelSelector ,c2 is loopless
proof end;
end;

registration
let c1 be trivial _Graph;
let c2 be set ;
cluster a1 .set WeightSelector ,a2 -> [Graph-like] trivial ;
coherence
c1 .set WeightSelector ,c2 is trivial
proof end;
cluster a1 .set ELabelSelector ,a2 -> [Graph-like] trivial ;
coherence
c1 .set ELabelSelector ,c2 is trivial
proof end;
cluster a1 .set VLabelSelector ,a2 -> [Graph-like] trivial ;
coherence
c1 .set VLabelSelector ,c2 is trivial
proof end;
end;

registration
let c1 be non trivial _Graph;
let c2 be set ;
cluster a1 .set WeightSelector ,a2 -> [Graph-like] non trivial ;
coherence
not c1 .set WeightSelector ,c2 is trivial
proof end;
cluster a1 .set ELabelSelector ,a2 -> [Graph-like] non trivial ;
coherence
not c1 .set ELabelSelector ,c2 is trivial
proof end;
cluster a1 .set VLabelSelector ,a2 -> [Graph-like] non trivial ;
coherence
not c1 .set VLabelSelector ,c2 is trivial
proof end;
end;

registration
let c1 be non-multi _Graph;
let c2 be set ;
cluster a1 .set WeightSelector ,a2 -> [Graph-like] non-multi ;
coherence
c1 .set WeightSelector ,c2 is non-multi
proof end;
cluster a1 .set ELabelSelector ,a2 -> [Graph-like] non-multi ;
coherence
c1 .set ELabelSelector ,c2 is non-multi
proof end;
cluster a1 .set VLabelSelector ,a2 -> [Graph-like] non-multi ;
coherence
c1 .set VLabelSelector ,c2 is non-multi
proof end;
end;

registration
let c1 be non-Dmulti _Graph;
let c2 be set ;
cluster a1 .set WeightSelector ,a2 -> [Graph-like] non-Dmulti ;
coherence
c1 .set WeightSelector ,c2 is non-Dmulti
proof end;
cluster a1 .set ELabelSelector ,a2 -> [Graph-like] non-Dmulti ;
coherence
c1 .set ELabelSelector ,c2 is non-Dmulti
proof end;
cluster a1 .set VLabelSelector ,a2 -> [Graph-like] non-Dmulti ;
coherence
c1 .set VLabelSelector ,c2 is non-Dmulti
proof end;
end;

registration
let c1 be connected _Graph;
let c2 be set ;
cluster a1 .set WeightSelector ,a2 -> [Graph-like] connected ;
coherence
c1 .set WeightSelector ,c2 is connected
proof end;
cluster a1 .set ELabelSelector ,a2 -> [Graph-like] connected ;
coherence
c1 .set ELabelSelector ,c2 is connected
proof end;
cluster a1 .set VLabelSelector ,a2 -> [Graph-like] connected ;
coherence
c1 .set VLabelSelector ,c2 is connected
proof end;
end;

registration
let c1 be acyclic _Graph;
let c2 be set ;
cluster a1 .set WeightSelector ,a2 -> [Graph-like] loopless non-multi acyclic ;
coherence
c1 .set WeightSelector ,c2 is acyclic
proof end;
cluster a1 .set ELabelSelector ,a2 -> [Graph-like] loopless non-multi acyclic ;
coherence
c1 .set ELabelSelector ,c2 is acyclic
proof end;
cluster a1 .set VLabelSelector ,a2 -> [Graph-like] loopless non-multi acyclic ;
coherence
c1 .set VLabelSelector ,c2 is acyclic
proof end;
end;

registration
let c1 be WGraph;
let c2 be set ;
cluster a1 .set ELabelSelector ,a2 -> [Graph-like] [Weighted] ;
coherence
c1 .set ELabelSelector ,c2 is [Weighted]
proof end;
cluster a1 .set VLabelSelector ,a2 -> [Graph-like] [Weighted] ;
coherence
c1 .set VLabelSelector ,c2 is [Weighted]
proof end;
end;

registration
let c1 be _Graph;
let c2 be ManySortedSet of the_Edges_of c1;
cluster a1 .set WeightSelector ,a2 -> [Graph-like] [Weighted] ;
coherence
c1 .set WeightSelector ,c2 is [Weighted]
proof end;
end;

registration
let c1 be _Graph;
let c2 be non empty set ;
let c3 be Function of the_Edges_of c1,c2;
cluster a1 .set WeightSelector ,a3 -> [Graph-like] [Weighted] ;
coherence
c1 .set WeightSelector ,c3 is [Weighted]
proof end;
end;

registration
let c1 be EGraph;
let c2 be set ;
cluster a1 .set WeightSelector ,a2 -> [Graph-like] [ELabeled] ;
coherence
c1 .set WeightSelector ,c2 is [ELabeled]
proof end;
cluster a1 .set VLabelSelector ,a2 -> [Graph-like] [ELabeled] ;
coherence
c1 .set VLabelSelector ,c2 is [ELabeled]
proof end;
end;

registration
let c1 be _Graph;
let c2 be set ;
let c3 be PartFunc of the_Edges_of c1,c2;
cluster a1 .set ELabelSelector ,a3 -> [Graph-like] [ELabeled] ;
coherence
c1 .set ELabelSelector ,c3 is [ELabeled]
proof end;
end;

registration
let c1 be _Graph;
let c2 be ManySortedSet of the_Edges_of c1;
cluster a1 .set ELabelSelector ,a2 -> [Graph-like] [ELabeled] ;
coherence
c1 .set ELabelSelector ,c2 is [ELabeled]
proof end;
end;

registration
let c1 be VGraph;
let c2 be set ;
cluster a1 .set WeightSelector ,a2 -> [Graph-like] [VLabeled] ;
coherence
c1 .set WeightSelector ,c2 is [VLabeled]
proof end;
cluster a1 .set ELabelSelector ,a2 -> [Graph-like] [VLabeled] ;
coherence
c1 .set ELabelSelector ,c2 is [VLabeled]
proof end;
end;

registration
let c1 be _Graph;
let c2 be set ;
let c3 be PartFunc of the_Vertices_of c1,c2;
cluster a1 .set VLabelSelector ,a3 -> [Graph-like] [VLabeled] ;
coherence
c1 .set VLabelSelector ,c3 is [VLabeled]
proof end;
end;

registration
let c1 be _Graph;
let c2 be ManySortedSet of the_Vertices_of c1;
cluster a1 .set VLabelSelector ,a2 -> [Graph-like] [VLabeled] ;
coherence
c1 .set VLabelSelector ,c2 is [VLabeled]
proof end;
end;

registration
let c1 be _Graph;
cluster a1 .set ELabelSelector ,{} -> [Graph-like] [ELabeled] ;
coherence
c1 .set ELabelSelector ,{} is [ELabeled]
proof end;
cluster a1 .set VLabelSelector ,{} -> [Graph-like] [VLabeled] ;
coherence
c1 .set VLabelSelector ,{} is [VLabeled]
proof end;
end;

registration
let c1 be _Graph;
cluster [Weighted] [ELabeled] [VLabeled] Subgraph of a1;
existence
ex b1 being Subgraph of c1 st
( b1 is [Weighted] & b1 is [ELabeled] & b1 is [VLabeled] )
proof end;
end;

definition
let c1 be WGraph;
let c2 be [Weighted] Subgraph of c1;
attr a2 is weight-inheriting means :Def10: :: GLIB_003:def 10
the_Weight_of a2 = (the_Weight_of a1) | (the_Edges_of a2);
end;

:: deftheorem Def10 defines weight-inheriting GLIB_003:def 10 :
for b1 being WGraph
for b2 being [Weighted] Subgraph of b1 holds
( b2 is weight-inheriting iff the_Weight_of b2 = (the_Weight_of b1) | (the_Edges_of b2) );

definition
let c1 be EGraph;
let c2 be [ELabeled] Subgraph of c1;
attr a2 is elabel-inheriting means :Def11: :: GLIB_003:def 11
the_ELabel_of a2 = (the_ELabel_of a1) | (the_Edges_of a2);
end;

:: deftheorem Def11 defines elabel-inheriting GLIB_003:def 11 :
for b1 being EGraph
for b2 being [ELabeled] Subgraph of b1 holds
( b2 is elabel-inheriting iff the_ELabel_of b2 = (the_ELabel_of b1) | (the_Edges_of b2) );

definition
let c1 be VGraph;
let c2 be [VLabeled] Subgraph of c1;
attr a2 is vlabel-inheriting means :Def12: :: GLIB_003:def 12
the_VLabel_of a2 = (the_VLabel_of a1) | (the_Vertices_of a2);
end;

:: deftheorem Def12 defines vlabel-inheriting GLIB_003:def 12 :
for b1 being VGraph
for b2 being [VLabeled] Subgraph of b1 holds
( b2 is vlabel-inheriting iff the_VLabel_of b2 = (the_VLabel_of b1) | (the_Vertices_of b2) );

registration
let c1 be WGraph;
cluster [Weighted] weight-inheriting Subgraph of a1;
existence
ex b1 being [Weighted] Subgraph of c1 st b1 is weight-inheriting
proof end;
end;

registration
let c1 be EGraph;
cluster [ELabeled] elabel-inheriting Subgraph of a1;
existence
ex b1 being [ELabeled] Subgraph of c1 st b1 is elabel-inheriting
proof end;
end;

registration
let c1 be VGraph;
cluster [VLabeled] vlabel-inheriting Subgraph of a1;
existence
ex b1 being [VLabeled] Subgraph of c1 st b1 is vlabel-inheriting
proof end;
end;

registration
let c1 be WEGraph;
cluster [Weighted] [ELabeled] weight-inheriting elabel-inheriting Subgraph of a1;
existence
ex b1 being [Weighted] [ELabeled] Subgraph of c1 st
( b1 is weight-inheriting & b1 is elabel-inheriting )
proof end;
end;

registration
let c1 be WVGraph;
cluster [Weighted] [VLabeled] weight-inheriting vlabel-inheriting Subgraph of a1;
existence
ex b1 being [Weighted] [VLabeled] Subgraph of c1 st
( b1 is weight-inheriting & b1 is vlabel-inheriting )
proof end;
end;

registration
let c1 be EVGraph;
cluster [ELabeled] [VLabeled] elabel-inheriting vlabel-inheriting Subgraph of a1;
existence
ex b1 being [ELabeled] [VLabeled] Subgraph of c1 st
( b1 is elabel-inheriting & b1 is vlabel-inheriting )
proof end;
end;

registration
let c1 be WEVGraph;
cluster [Weighted] [ELabeled] [VLabeled] weight-inheriting elabel-inheriting vlabel-inheriting Subgraph of a1;
existence
ex b1 being [Weighted] [ELabeled] [VLabeled] Subgraph of c1 st
( b1 is weight-inheriting & b1 is elabel-inheriting & b1 is vlabel-inheriting )
proof end;
end;

definition
let c1 be WGraph;
mode WSubgraph of a1 is [Weighted] weight-inheriting Subgraph of a1;
end;

definition
let c1 be EGraph;
mode ESubgraph of a1 is [ELabeled] elabel-inheriting Subgraph of a1;
end;

definition
let c1 be VGraph;
mode VSubgraph of a1 is [VLabeled] vlabel-inheriting Subgraph of a1;
end;

definition
let c1 be WEGraph;
mode WESubgraph of a1 is [Weighted] [ELabeled] weight-inheriting elabel-inheriting Subgraph of a1;
end;

definition
let c1 be WVGraph;
mode WVSubgraph of a1 is [Weighted] [VLabeled] weight-inheriting vlabel-inheriting Subgraph of a1;
end;

definition
let c1 be EVGraph;
mode EVSubgraph of a1 is [ELabeled] [VLabeled] elabel-inheriting vlabel-inheriting Subgraph of a1;
end;

definition
let c1 be WEVGraph;
mode WEVSubgraph of a1 is [Weighted] [ELabeled] [VLabeled] weight-inheriting elabel-inheriting vlabel-inheriting Subgraph of a1;
end;

registration
let c1 be _Graph;
let c2, c3 be set ;
cluster [Weighted] [ELabeled] [VLabeled] inducedSubgraph of a1,a2,a3;
existence
ex b1 being inducedSubgraph of c1,c2,c3 st
( b1 is [Weighted] & b1 is [ELabeled] & b1 is [VLabeled] )
proof end;
end;

registration
let c1 be WGraph;
let c2, c3 be set ;
cluster [Weighted] weight-inheriting inducedSubgraph of a1,a2,a3;
existence
ex b1 being [Weighted] inducedSubgraph of c1,c2,c3 st b1 is weight-inheriting
proof end;
end;

registration
let c1 be EGraph;
let c2, c3 be set ;
cluster [ELabeled] elabel-inheriting inducedSubgraph of a1,a2,a3;
existence
ex b1 being [ELabeled] inducedSubgraph of c1,c2,c3 st b1 is elabel-inheriting
proof end;
end;

registration
let c1 be VGraph;
let c2, c3 be set ;
cluster [VLabeled] vlabel-inheriting inducedSubgraph of a1,a2,a3;
existence
ex b1 being [VLabeled] inducedSubgraph of c1,c2,c3 st b1 is vlabel-inheriting
proof end;
end;

registration
let c1 be WEGraph;
let c2, c3 be set ;
cluster [Weighted] [ELabeled] weight-inheriting elabel-inheriting inducedSubgraph of a1,a2,a3;
existence
ex b1 being [Weighted] [ELabeled] inducedSubgraph of c1,c2,c3 st
( b1 is weight-inheriting & b1 is elabel-inheriting )
proof end;
end;

registration
let c1 be WVGraph;
let c2, c3 be set ;
cluster [Weighted] [VLabeled] weight-inheriting vlabel-inheriting inducedSubgraph of a1,a2,a3;
existence
ex b1 being [Weighted] [VLabeled] inducedSubgraph of c1,c2,c3 st
( b1 is weight-inheriting & b1 is vlabel-inheriting )
proof end;
end;

registration
let c1 be EVGraph;
let c2, c3 be set ;
cluster [ELabeled] [VLabeled] elabel-inheriting vlabel-inheriting inducedSubgraph of a1,a2,a3;
existence
ex b1 being [ELabeled] [VLabeled] inducedSubgraph of c1,c2,c3 st
( b1 is elabel-inheriting & b1 is vlabel-inheriting )
proof end;
end;

registration
let c1 be WEVGraph;
let c2, c3 be set ;
cluster [Weighted] [ELabeled] [VLabeled] weight-inheriting elabel-inheriting vlabel-inheriting inducedSubgraph of a1,a2,a3;
existence
ex b1 being [Weighted] [ELabeled] [VLabeled] inducedSubgraph of c1,c2,c3 st
( b1 is weight-inheriting & b1 is elabel-inheriting & b1 is vlabel-inheriting )
proof end;
end;

definition
let c1 be WGraph;
let c2, c3 be set ;
mode inducedWSubgraph of a1,a2,a3 is [Weighted] weight-inheriting inducedSubgraph of a1,a2,a3;
end;

definition
let c1 be EGraph;
let c2, c3 be set ;
mode inducedESubgraph of a1,a2,a3 is [ELabeled] elabel-inheriting inducedSubgraph of a1,a2,a3;
end;

definition
let c1 be VGraph;
let c2, c3 be set ;
mode inducedVSubgraph of a1,a2,a3 is [VLabeled] vlabel-inheriting inducedSubgraph of a1,a2,a3;
end;

definition
let c1 be WEGraph;
let c2, c3 be set ;
mode inducedWESubgraph of a1,a2,a3 is [Weighted] [ELabeled] weight-inheriting elabel-inheriting inducedSubgraph of a1,a2,a3;
end;

definition
let c1 be WVGraph;
let c2, c3 be set ;
mode inducedWVSubgraph of a1,a2,a3 is [Weighted] [VLabeled] weight-inheriting vlabel-inheriting inducedSubgraph of a1,a2,a3;
end;

definition
let c1 be EVGraph;
let c2, c3 be set ;
mode inducedEVSubgraph of a1,a2,a3 is [ELabeled] [VLabeled] elabel-inheriting vlabel-inheriting inducedSubgraph of a1,a2,a3;
end;

definition
let c1 be WEVGraph;
let c2, c3 be set ;
mode inducedWEVSubgraph of a1,a2,a3 is [Weighted] [ELabeled] [VLabeled] weight-inheriting elabel-inheriting vlabel-inheriting inducedSubgraph of a1,a2,a3;
end;

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

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

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

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

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

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

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

definition
let c1 be WGraph;
attr a1 is real-weighted means :Def13: :: GLIB_003:def 13
the_Weight_of a1 is real-yielding;
end;

:: deftheorem Def13 defines real-weighted GLIB_003:def 13 :
for b1 being WGraph holds
( b1 is real-weighted iff the_Weight_of b1 is real-yielding );

definition
let c1 be WGraph;
attr a1 is nonnegative-weighted means :Def14: :: GLIB_003:def 14
rng (the_Weight_of a1) c= Real>=0 ;
end;

:: deftheorem Def14 defines nonnegative-weighted GLIB_003:def 14 :
for b1 being WGraph holds
( b1 is nonnegative-weighted iff rng (the_Weight_of b1) c= Real>=0 );

registration
cluster nonnegative-weighted -> real-weighted GraphStruct ;
coherence
for b1 being WGraph st b1 is nonnegative-weighted holds
b1 is real-weighted
proof end;
end;

definition
let c1 be EGraph;
attr a1 is real-elabeled means :Def15: :: GLIB_003:def 15
the_ELabel_of a1 is real-yielding;
end;

:: deftheorem Def15 defines real-elabeled GLIB_003:def 15 :
for b1 being EGraph holds
( b1 is real-elabeled iff the_ELabel_of b1 is real-yielding );

definition
let c1 be VGraph;
attr a1 is real-vlabeled means :Def16: :: GLIB_003:def 16
the_VLabel_of a1 is real-yielding;
end;

:: deftheorem Def16 defines real-vlabeled GLIB_003:def 16 :
for b1 being VGraph holds
( b1 is real-vlabeled iff the_VLabel_of b1 is real-yielding );

definition
let c1 be WEVGraph;
attr a1 is real-WEV means :Def17: :: GLIB_003:def 17
( a1 is real-weighted & a1 is real-elabeled & a1 is real-vlabeled );
end;

:: deftheorem Def17 defines real-WEV GLIB_003:def 17 :
for b1 being WEVGraph holds
( b1 is real-WEV iff ( b1 is real-weighted & b1 is real-elabeled & b1 is real-vlabeled ) );

registration
cluster real-WEV -> real-weighted real-elabeled real-vlabeled GraphStruct ;
coherence
for b1 being WEVGraph st b1 is real-WEV holds
( b1 is real-weighted & b1 is real-elabeled & b1 is real-vlabeled )
by Def17;
cluster real-weighted real-elabeled real-vlabeled -> real-WEV GraphStruct ;
coherence
for b1 being WEVGraph st b1 is real-weighted & b1 is real-elabeled & b1 is real-vlabeled holds
b1 is real-WEV
by Def17;
end;

registration
let c1 be _Graph;
let c2 be Function of the_Edges_of c1, REAL ;
cluster a1 .set WeightSelector ,a2 -> [Graph-like] [Weighted] real-weighted ;
coherence
c1 .set WeightSelector ,c2 is real-weighted
proof end;
end;

registration
let c1 be _Graph;
let c2 be PartFunc of the_Edges_of c1, REAL ;
cluster a1 .set ELabelSelector ,a2 -> [Graph-like] [ELabeled] real-elabeled ;
coherence
c1 .set ELabelSelector ,c2 is real-elabeled
proof end;
end;

registration
let c1 be _Graph;
let c2 be real-yielding ManySortedSet of the_Edges_of c1;
cluster a1 .set ELabelSelector ,a2 -> [Graph-like] [ELabeled] real-elabeled ;
coherence
c1 .set ELabelSelector ,c2 is real-elabeled
proof end;
end;

registration
let c1 be _Graph;
let c2 be PartFunc of the_Vertices_of c1, REAL ;
cluster a1 .set VLabelSelector ,a2 -> [Graph-like] [VLabeled] real-vlabeled ;
coherence
c1 .set VLabelSelector ,c2 is real-vlabeled
proof end;
end;

registration
let c1 be _Graph;
let c2 be real-yielding ManySortedSet of the_Vertices_of c1;
cluster a1 .set VLabelSelector ,a2 -> [Graph-like] [VLabeled] real-vlabeled ;
coherence
c1 .set VLabelSelector ,c2 is real-vlabeled
proof end;
end;

registration
let c1 be _Graph;
cluster a1 .set ELabelSelector ,{} -> [Graph-like] [ELabeled] real-elabeled ;
coherence
c1 .set ELabelSelector ,{} is real-elabeled
proof end;
cluster a1 .set VLabelSelector ,{} -> [Graph-like] [VLabeled] real-vlabeled ;
coherence
c1 .set VLabelSelector ,{} is real-vlabeled
proof end;
end;

registration
let c1 be _Graph;
let c2 be Vertex of c1;
let c3 be real number ;
cluster a1 .set VLabelSelector ,(a2 .--> a3) -> [Graph-like] [VLabeled] ;
coherence
c1 .set VLabelSelector ,(c2 .--> c3) is [VLabeled]
proof end;
end;

registration
let c1 be _Graph;
let c2 be Vertex of c1;
let c3 be real number ;
cluster a1 .set VLabelSelector ,(a2 .--> a3) -> [Graph-like] [VLabeled] real-vlabeled ;
coherence
c1 .set VLabelSelector ,(c2 .--> c3) is real-vlabeled
proof end;
end;

registration
cluster finite trivial Tree-like real-weighted nonnegative-weighted real-elabeled real-vlabeled real-WEV GraphStruct ;
existence
ex b1 being WEVGraph st
( b1 is finite & b1 is trivial & b1 is Tree-like & b1 is nonnegative-weighted & b1 is real-WEV )
proof end;
cluster finite non trivial Tree-like real-weighted nonnegative-weighted real-elabeled real-vlabeled real-WEV GraphStruct ;
existence
ex b1 being WEVGraph st
( b1 is finite & not b1 is trivial & b1 is Tree-like & b1 is nonnegative-weighted & b1 is real-WEV )
proof end;
end;

registration
let c1 be finite WGraph;
cluster the_Weight_of a1 -> finite ;
coherence
the_Weight_of c1 is finite
proof end;
end;

registration
let c1 be finite EGraph;
cluster the_ELabel_of a1 -> finite ;
coherence
the_ELabel_of c1 is finite
proof end;
end;

registration
let c1 be finite VGraph;
cluster the_VLabel_of a1 -> finite ;
coherence
the_VLabel_of c1 is finite
proof end;
end;

registration
let c1 be real-weighted WGraph;
cluster the_Weight_of a1 -> real-yielding ;
coherence
the_Weight_of c1 is real-yielding
by Def13;
end;

registration
let c1 be real-elabeled EGraph;
cluster the_ELabel_of a1 -> real-yielding ;
coherence
the_ELabel_of c1 is real-yielding
by Def15;
end;

registration
let c1 be real-vlabeled VGraph;
cluster the_VLabel_of a1 -> real-yielding ;
coherence
the_VLabel_of c1 is real-yielding
by Def16;
end;

registration
let c1 be real-weighted WGraph;
let c2 be set ;
cluster a1 .set ELabelSelector ,a2 -> [Graph-like] [Weighted] real-weighted ;
coherence
c1 .set ELabelSelector ,c2 is real-weighted
proof end;
cluster a1 .set VLabelSelector ,a2 -> [Graph-like] [Weighted] real-weighted ;
coherence
c1 .set VLabelSelector ,c2 is real-weighted
proof end;
end;

registration
let c1 be nonnegative-weighted WGraph;
let c2 be set ;
cluster a1 .set ELabelSelector ,a2 -> [Graph-like] [Weighted] real-weighted nonnegative-weighted ;
coherence
c1 .set ELabelSelector ,c2 is nonnegative-weighted
proof end;
cluster a1 .set VLabelSelector ,a2 -> [Graph-like] [Weighted] real-weighted nonnegative-weighted ;
coherence
c1 .set VLabelSelector ,c2 is nonnegative-weighted
proof end;
end;

registration
let c1 be real-elabeled EGraph;
let c2 be set ;
cluster a1 .set WeightSelector ,a2 -> [Graph-like] [ELabeled] real-elabeled ;
coherence
c1 .set WeightSelector ,c2 is real-elabeled
proof end;
cluster a1 .set VLabelSelector ,a2 -> [Graph-like] [ELabeled] real-elabeled ;
coherence
c1 .set VLabelSelector ,c2 is real-elabeled
proof end;
end;

registration
let c1 be real-vlabeled VGraph;
let c2 be set ;
cluster a1 .set WeightSelector ,a2 -> [Graph-like] [VLabeled] real-vlabeled ;
coherence
c1 .set WeightSelector ,c2 is real-vlabeled
proof end;
cluster a1 .set ELabelSelector ,a2 -> [Graph-like] [VLabeled] real-vlabeled ;
coherence
c1 .set ELabelSelector ,c2 is real-vlabeled
proof end;
end;

definition
let c1 be WGraph;
let c2 be Walk of c1;
func c2 .weightSeq() -> FinSequence means :Def18: :: GLIB_003:def 18
( len a3 = len (a2 .edgeSeq() ) & ( for b1 being Nat st 1 <= b1 & b1 <= len a3 holds
a3 . b1 = (the_Weight_of a1) . ((a2 .edgeSeq() ) . b1) ) );
existence
ex b1 being FinSequence st
( len b1 = len (c2 .edgeSeq() ) & ( for b2 being Nat st 1 <= b2 & b2 <= len b1 holds
b1 . b2 = (the_Weight_of c1) . ((c2 .edgeSeq() ) . b2) ) )
proof end;
uniqueness
for b1, b2 being FinSequence st len b1 = len (c2 .edgeSeq() ) & ( for b3 being Nat st 1 <= b3 & b3 <= len b1 holds
b1 . b3 = (the_Weight_of c1) . ((c2 .edgeSeq() ) . b3) ) & len b2 = len (c2 .edgeSeq() ) & ( for b3 being Nat st 1 <= b3 & b3 <= len b2 holds
b2 . b3 = (the_Weight_of c1) . ((c2 .edgeSeq() ) . b3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def18 defines .weightSeq() GLIB_003:def 18 :
for b1 being WGraph
for b2 being Walk of b1
for b3 being FinSequence holds
( b3 = b2 .weightSeq() iff ( len b3 = len (b2 .edgeSeq() ) & ( for b4 being Nat st 1 <= b4 & b4 <= len b3 holds
b3 . b4 = (the_Weight_of b1) . ((b2 .edgeSeq() ) . b4) ) ) );

definition
let c1 be real-weighted WGraph;
let c2 be Walk of c1;
redefine func .weightSeq() as c2 .weightSeq() -> FinSequence of REAL ;
coherence
c2 .weightSeq() is FinSequence of REAL
proof end;
end;

definition
let c1 be real-weighted WGraph;
let c2 be Walk of c1;
func c2 .cost() -> Real equals :: GLIB_003:def 19
Sum (a2 .weightSeq() );
coherence
Sum (c2 .weightSeq() ) is Real
;
end;

:: deftheorem Def19 defines .cost() GLIB_003:def 19 :
for b1 being real-weighted WGraph
for b2 being Walk of b1 holds b2 .cost() = Sum (b2 .weightSeq() );

Lemma17: for b1, b2, b3, b4 being set
for b5 being PartFunc of b3,b4 st b1 in b3 & b2 in b4 holds
b5 +* (b1 .--> b2) is PartFunc of b3,b4
proof end;

definition
let c1 be EGraph;
func c1 .labeledE() -> Subset of (the_Edges_of a1) equals :: GLIB_003:def 20
dom (the_ELabel_of a1);
coherence
dom (the_ELabel_of c1) is Subset of (the_Edges_of c1)
by Lemma5;
end;

:: deftheorem Def20 defines .labeledE() GLIB_003:def 20 :
for b1 being EGraph holds b1 .labeledE() = dom (the_ELabel_of b1);

definition
let c1 be EGraph;
let c2, c3 be set ;
func c1 .labelEdge c2,c3 -> EGraph equals :Def21: :: GLIB_003:def 21
a1 .set ELabelSelector ,((the_ELabel_of a1) +* (a2 .--> a3)) if a2 in the_Edges_of a1
otherwise a1;
coherence
( ( c2 in the_Edges_of c1 implies c1 .set ELabelSelector ,((the_ELabel_of c1) +* (c2 .--> c3)) is EGraph ) & ( not c2 in the_Edges_of c1 implies c1 is EGraph ) )
proof end;
consistency
for b1 being EGraph holds verum
;
end;

:: deftheorem Def21 defines .labelEdge GLIB_003:def 21 :
for b1 being EGraph
for b2, b3 being set holds
( ( b2 in the_Edges_of b1 implies b1 .labelEdge b2,b3 = b1 .set ELabelSelector ,((the_ELabel_of b1) +* (b2 .--> b3)) ) & ( not b2 in the_Edges_of b1 implies b1 .labelEdge b2,b3 = b1 ) );

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

registration
let c1 be loopless EGraph;
let c2, c3 be set ;
cluster a1 .labelEdge a2,a3 -> loopless ;
coherence
c1 .labelEdge c2,c3 is loopless
proof end;
end;

registration
let c1 be trivial EGraph;
let c2, c3 be set ;
cluster a1 .labelEdge a2,a3 -> trivial ;
coherence
c1 .labelEdge c2,c3 is trivial
proof end;
end;

registration
let c1 be non trivial EGraph;
let c2, c3 be set ;
cluster a1 .labelEdge a2,a3 -> non trivial ;
coherence
not c1 .labelEdge c2,c3 is trivial
proof end;
end;

registration
let c1 be non-multi EGraph;
let c2, c3 be set ;
cluster a1 .labelEdge a2,a3 -> non-multi ;
coherence
c1 .labelEdge c2,c3 is non-multi
proof end;
end;

registration
let c1 be non-Dmulti EGraph;
let c2, c3 be set ;
cluster a1 .labelEdge a2,a3 -> non-Dmulti ;
coherence
c1 .labelEdge c2,c3 is non-Dmulti
proof end;
end;

registration
let c1 be connected EGraph;
let c2, c3 be set ;
cluster a1 .labelEdge a2,a3 -> connected ;
coherence
c1 .labelEdge c2,c3 is connected
proof end;
end;

registration
let c1 be acyclic EGraph;
let c2, c3 be set ;
cluster a1 .labelEdge a2,a3 -> loopless non-multi acyclic ;
coherence
c1 .labelEdge c2,c3 is acyclic
proof end;
end;

registration
let c1 be WEGraph;
let c2, c3 be set ;
cluster a1 .labelEdge a2,a3 -> [Weighted] ;
coherence
c1 .labelEdge c2,c3 is [Weighted]
proof end;
end;

registration
let c1 be EVGraph;
let c2, c3 be set ;
cluster a1 .labelEdge a2,a3 -> [VLabeled] ;
coherence
c1 .labelEdge c2,c3 is [VLabeled]
proof end;
end;

registration
let c1 be real-weighted WEGraph;
let c2, c3 be set ;
cluster a1 .labelEdge a2,a3 -> [Weighted] real-weighted ;
coherence
c1 .labelEdge c2,c3 is real-weighted
proof end;
end;

registration
let c1 be nonnegative-weighted WEGraph;
let c2, c3 be set ;
cluster a1 .labelEdge a2,a3 -> [Weighted] real-weighted nonnegative-weighted ;
coherence
c1 .labelEdge c2,c3 is nonnegative-weighted
proof end;
end;

registration
let c1 be real-elabeled EGraph;
let c2 be set ;
let c3 be Real;
cluster a1 .labelEdge a2,a3 -> real-elabeled ;
coherence
c1 .labelEdge c2,c3 is real-elabeled
proof end;
end;

registration
let c1 be real-vlabeled EVGraph;
let c2, c3 be set ;
cluster a1 .labelEdge a2,a3 -> [VLabeled] real-vlabeled ;
coherence
c1 .labelEdge c2,c3 is real-vlabeled
proof end;
end;

definition
let c1 be VGraph;
let c2, c3 be set ;
func c1 .labelVertex c2,c3 -> VGraph equals :Def22: :: GLIB_003:def 22
a1 .set VLabelSelector ,((the_VLabel_of a1) +* (a2 .--> a3)) if a2 in the_Vertices_of a1
otherwise a1;
coherence
( ( c2 in the_Vertices_of c1 implies c1 .set VLabelSelector ,((the_VLabel_of c1) +* (c2 .--> c3)) is VGraph ) & ( not c2 in the_Vertices_of c1 implies c1 is VGraph ) )
proof end;
consistency
for b1 being VGraph holds verum
;
end;

:: deftheorem Def22 defines .labelVertex GLIB_003:def 22 :
for b1 being VGraph
for b2, b3 being set holds
( ( b2 in the_Vertices_of b1 implies b1 .labelVertex b2,b3 = b1 .set VLabelSelector ,((the_VLabel_of b1) +* (b2 .--> b3)) ) & ( not b2 in the_Vertices_of b1 implies b1 .labelVertex b2,b3 = b1 ) );

definition
let c1 be VGraph;
func c1 .labeledV() -> Subset of (the_Vertices_of a1) equals :: GLIB_003:def 23
dom (the_VLabel_of a1);
coherence
dom (the_VLabel_of c1) is Subset of (the_Vertices_of c1)
by Lemma6;
end;

:: deftheorem Def23 defines .labeledV() GLIB_003:def 23 :
for b1 being VGraph holds b1 .labeledV() = dom (the_VLabel_of b1);

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

registration
let c1 be loopless VGraph;
let c2, c3 be set ;
cluster a1 .labelVertex a2,a3 -> loopless ;
coherence
c1 .labelVertex c2,c3 is loopless
proof end;
end;

registration
let c1 be trivial VGraph;
let c2, c3 be set ;
cluster a1 .labelVertex a2,a3 -> trivial ;
coherence
c1 .labelVertex c2,c3 is trivial
proof end;
end;

registration
let c1 be non trivial VGraph;
let c2, c3 be set ;
cluster a1 .labelVertex a2,a3 -> non trivial ;
coherence
not c1 .labelVertex c2,c3 is trivial
proof end;
end;

registration
let c1 be non-multi VGraph;
let c2, c3 be set ;
cluster a1 .labelVertex a2,a3 -> non-multi ;
coherence
c1 .labelVertex c2,c3 is non-multi
proof end;
end;

registration
let c1 be non-Dmulti VGraph;
let c2, c3 be set ;
cluster a1 .labelVertex a2,a3 -> non-Dmulti ;
coherence
c1 .labelVertex c2,c3 is non-Dmulti
proof end;
end;

registration
let c1 be connected VGraph;
let c2, c3 be set ;
cluster a1 .labelVertex a2,a3 -> connected ;
coherence
c1 .labelVertex c2,c3 is connected
proof end;
end;

registration
let c1 be acyclic VGraph;
let c2, c3 be set ;
cluster a1 .labelVertex a2,a3 -> loopless non-multi acyclic ;
coherence
c1 .labelVertex c2,c3 is acyclic
proof end;
end;

registration
let c1 be WVGraph;
let c2, c3 be set ;
cluster a1 .labelVertex a2,a3 -> [Weighted] ;
coherence
c1 .labelVertex c2,c3 is [Weighted]
proof end;
end;

registration
let c1 be EVGraph;
let c2, c3 be set ;
cluster a1 .labelVertex a2,a3 -> [ELabeled] ;
coherence
c1 .labelVertex c2,c3 is [ELabeled]
proof end;
end;

registration
let c1 be real-weighted WVGraph;
let c2, c3 be set ;
cluster a1 .labelVertex a2,a3 -> [Weighted] real-weighted ;
coherence
c1 .labelVertex c2,c3 is real-weighted
proof end;
end;

registration
let c1 be nonnegative-weighted WVGraph;
let c2, c3 be set ;
cluster a1 .labelVertex a2,a3 -> [Weighted] real-weighted nonnegative-weighted ;
coherence
c1 .labelVertex c2,c3 is nonnegative-weighted
proof end;
end;

registration
let c1 be real-elabeled EVGraph;
let c2, c3 be set ;
cluster a1 .labelVertex a2,a3 -> [ELabeled] real-elabeled ;
coherence
c1 .labelVertex c2,c3 is real-elabeled
proof end;
end;

registration
let c1 be real-vlabeled VGraph;
let c2 be set ;
let c3 be Real;
cluster a1 .labelVertex a2,a3 -> real-vlabeled ;
coherence
c1 .labelVertex c2,c3 is real-vlabeled
proof end;
end;

registration
let c1 be real-weighted WGraph;
cluster -> real-weighted Subgraph of a1;
coherence
for b1 being WSubgraph of c1 holds b1 is real-weighted
proof end;
end;

registration
let c1 be nonnegative-weighted WGraph;
cluster -> real-weighted nonnegative-weighted Subgraph of a1;
coherence
for b1 being WSubgraph of c1 holds b1 is nonnegative-weighted
proof end;
end;

registration
let c1 be real-elabeled EGraph;
cluster -> real-elabeled Subgraph of a1;
coherence
for b1 being ESubgraph of c1 holds b1 is real-elabeled
proof end;
end;

registration
let c1 be real-vlabeled VGraph;
cluster -> real-vlabeled Subgraph of a1;
coherence
for b1 being VSubgraph of c1 holds b1 is real-vlabeled
proof end;
end;

definition
let c1 be GraphSeq;
attr a1 is [Weighted] means :Def24: :: GLIB_003:def 24
for b1 being Nat holds a1 .-> b1 is [Weighted];
attr a1 is [ELabeled] means :Def25: :: GLIB_003:def 25
for b1 being Nat holds a1 .-> b1 is [ELabeled];
attr a1 is [VLabeled] means :Def26: :: GLIB_003:def 26
for b1 being Nat holds a1 .-> b1 is [VLabeled];
end;

:: deftheorem Def24 defines [Weighted] GLIB_003:def 24 :
for b1 being GraphSeq holds
( b1 is [Weighted] iff for b2 being Nat holds b1 .-> b2 is [Weighted] );

:: deftheorem Def25 defines [ELabeled] GLIB_003:def 25 :
for b1 being GraphSeq holds
( b1 is [ELabeled] iff for b2 being Nat holds b1 .-> b2 is [ELabeled] );

:: deftheorem Def26 defines [VLabeled] GLIB_003:def 26 :
for b1 being GraphSeq holds
( b1 is [VLabeled] iff for b2 being Nat holds b1 .-> b2 is [VLabeled] );

registration
cluster [Weighted] [ELabeled] [VLabeled] ManySortedSet of NAT ;
existence
ex b1 being GraphSeq st
( b1 is [Weighted] & b1 is [ELabeled] & b1 is [VLabeled] )
proof end;
end;

definition
mode WGraphSeq is [Weighted] GraphSeq;
mode EGraphSeq is [ELabeled] GraphSeq;
mode VGraphSeq is [VLabeled] GraphSeq;
mode WEGraphSeq is [Weighted] [ELabeled] GraphSeq;
mode WVGraphSeq is [Weighted] [VLabeled] GraphSeq;
mode EVGraphSeq is [ELabeled] [VLabeled] GraphSeq;
mode WEVGraphSeq is [Weighted] [ELabeled] [VLabeled] GraphSeq;
end;

registration
let c1 be WGraphSeq;
let c2 be Nat;
cluster a1 .-> a2 -> [Weighted] ;
coherence
c1 .-> c2 is [Weighted]
by Def24;
end;

registration
let c1 be EGraphSeq;
let c2 be Nat;
cluster a1 .-> a2 -> [ELabeled] ;
coherence
c1 .-> c2 is [ELabeled]
by Def25;
end;

registration
let c1 be VGraphSeq;
let c2 be Nat;
cluster a1 .-> a2 -> [VLabeled] ;
coherence
c1 .-> c2 is [VLabeled]
by Def26;
end;

definition
let c1 be WGraphSeq;
attr a1 is real-weighted means :Def27: :: GLIB_003:def 27
for b1 being Nat holds a1 .-> b1 is real-weighted;
attr a1 is nonnegative-weighted means :Def28: :: GLIB_003:def 28
for b1 being Nat holds a1 .-> b1 is nonnegative-weighted;
end;

:: deftheorem Def27 defines real-weighted GLIB_003:def 27 :
for b1 being WGraphSeq holds
( b1 is real-weighted iff for b2 being Nat holds b1 .-> b2 is real-weighted );

:: deftheorem Def28 defines nonnegative-weighted GLIB_003:def 28 :
for b1 being WGraphSeq holds
( b1 is nonnegative-weighted iff for b2 being Nat holds b1 .-> b2 is nonnegative-weighted );

definition
let c1 be EGraphSeq;
attr a1 is real-elabeled means :Def29: :: GLIB_003:def 29
for b1 being Nat holds a1 .-> b1 is real-elabeled;
end;

:: deftheorem Def29 defines real-elabeled GLIB_003:def 29 :
for b1 being EGraphSeq holds
( b1 is real-elabeled iff for b2 being Nat holds b1 .-> b2 is real-elabeled );

definition
let c1 be VGraphSeq;
attr a1 is real-vlabeled means :Def30: :: GLIB_003:def 30
for b1 being Nat holds a1 .-> b1 is real-vlabeled;
end;

:: deftheorem Def30 defines real-vlabeled GLIB_003:def 30 :
for b1 being VGraphSeq holds
( b1 is real-vlabeled iff for b2 being Nat holds b1 .-> b2 is real-vlabeled );

definition
let c1 be WEVGraphSeq;
attr a1 is real-WEV means :Def31: :: GLIB_003:def 31
for b1 being Nat holds a1 .-> b1 is real-WEV;
end;

:: deftheorem Def31 defines real-WEV GLIB_003:def 31 :
for b1 being WEVGraphSeq holds
( b1 is real-WEV iff for b2 being Nat holds b1 .-> b2 is real-WEV );

registration
cluster real-WEV -> real-weighted real-elabeled real-vlabeled ManySortedSet of NAT ;
coherence
for b1 being WEVGraphSeq st b1 is real-WEV holds
( b1 is real-weighted & b1 is real-elabeled & b1 is real-vlabeled )
proof end;
cluster real-weighted real-elabeled real-vlabeled -> real-WEV ManySortedSet of NAT ;
coherence
for b1 being WEVGraphSeq st b1 is real-weighted & b1 is real-elabeled & b1 is real-vlabeled holds
b1 is real-WEV
proof end;
end;

registration
cluster halting finite loopless trivial non-multi simple Tree-like real-weighted nonnegative-weighted real-elabeled real-vlabeled real-WEV ManySortedSet of NAT ;
existence
ex b1 being WEVGraphSeq st
( b1 is halting & b1 is finite & b1 is loopless & b1 is trivial & b1 is non-multi & b1 is simple & b1 is real-WEV & b1 is nonnegative-weighted & b1 is Tree-like )
proof end;
end;

registration
let c1 be real-weighted WGraphSeq;
let c2 be Nat;
cluster a1 .-> a2 -> [Weighted] real-weighted ;
coherence
c1 .-> c2 is real-weighted
by Def27;
end;

registration
let c1 be nonnegative-weighted WGraphSeq;
let c2 be Nat;
cluster a1 .-> a2 -> [Weighted] real-weighted nonnegative-weighted ;
coherence
c1 .-> c2 is nonnegative-weighted
by Def28;
end;

registration
let c1 be real-elabeled EGraphSeq;
let c2 be Nat;
cluster a1 .-> a2 -> [ELabeled] real-elabeled ;
coherence
c1 .-> c2 is real-elabeled
by Def29;
end;

registration
let c1 be real-vlabeled VGraphSeq;
let c2 be Nat;
cluster a1 .-> a2 -> [VLabeled] real-vlabeled ;
coherence
c1 .-> c2 is real-vlabeled
by Def30;
end;

theorem Th3: :: GLIB_003:3
( WeightSelector = 5 & ELabelSelector = 6 & VLabelSelector = 7 ) ;

theorem Th4: :: GLIB_003:4
( ( for b1 being WGraph holds the_Weight_of b1 = b1 . WeightSelector ) & ( for b1 being EGraph holds the_ELabel_of b1 = b1 . ELabelSelector ) & ( for b1 being VGraph holds the_VLabel_of b1 = b1 . VLabelSelector ) ) ;

theorem Th5: :: GLIB_003:5
canceled;

theorem Th6: :: GLIB_003:6
for b1 being EGraph holds dom (the_ELabel_of b1) c= the_Edges_of b1 by Lemma5;

theorem Th7: :: GLIB_003:7
for b1 being VGraph holds dom (the_VLabel_of b1) c= the_Vertices_of b1 by Lemma6;

theorem Th8: :: GLIB_003:8
for b1 being _Graph
for b2 being set holds
( b1 == b1 .set WeightSelector ,b2 & b1 == b1 .set ELabelSelector ,b2 & b1 == b1 .set VLabelSelector ,b2 ) by Lemma7;

theorem Th9: :: GLIB_003:9
for b1 being EGraph
for b2 being set holds the_ELabel_of b1 = the_ELabel_of (b1 .set WeightSelector ,b2) by GLIB_000:12;

theorem Th10: :: GLIB_003:10
for b1 being VGraph
for b2 being set holds the_VLabel_of b1 = the_VLabel_of (b1 .set WeightSelector ,b2) by GLIB_000:12;

theorem Th11: :: GLIB_003:11
for b1 being WGraph
for b2 being set holds the_Weight_of b1 = the_Weight_of (b1 .set ELabelSelector ,b2) by GLIB_000:12;

theorem Th12: :: GLIB_003:12
for b1 being VGraph
for b2 being set holds the_VLabel_of b1 = the_VLabel_of (b1 .set ELabelSelector ,b2) by GLIB_000:12;

theorem Th13: :: GLIB_003:13
for b1 being WGraph
for b2 being set holds the_Weight_of b1 = the_Weight_of (b1 .set VLabelSelector ,b2) by GLIB_000:12;

theorem Th14: :: GLIB_003:14
for b1 being EGraph
for b2 being set holds the_ELabel_of b1 = the_ELabel_of (b1 .set VLabelSelector ,b2) by GLIB_000:12;

theorem Th15: :: GLIB_003:15
for b1, b2, b3 being WGraph st b1 == b2 & the_Weight_of b1 = the_Weight_of b2 & b1 is WSubgraph of b3 holds
b2 is WSubgraph of b3
proof end;

theorem Th16: :: GLIB_003:16
for b1 being WGraph
for b2 being WSubgraph of b1
for b3 being WSubgraph of b2 holds b3 is WSubgraph of b1
proof end;

theorem Th17: :: GLIB_003:17
for b1, b2 being WGraph
for b3 being WSubgraph of b1 st b1 == b2 & the_Weight_of b1 = the_Weight_of b2 holds
b3 is WSubgraph of b2
proof end;

theorem Th18: :: GLIB_003:18
for b1 being WGraph
for b2 being WSubgraph of b1
for b3 being set st b3 in the_Edges_of b2 holds
(the_Weight_of b2) . b3 = (the_Weight_of b1) . b3
proof end;

theorem Th19: :: GLIB_003:19
for b1 being WGraph
for b2 being Walk of b1 st b2 is trivial holds
b2 .weightSeq() = {}
proof end;

theorem Th20: :: GLIB_003:20
for b1 being WGraph
for b2 being Walk of b1 holds len (b2 .weightSeq() ) = b2 .length()
proof end;

theorem Th21: :: GLIB_003:21
for b1 being WGraph
for b2, b3, b4 being set st b4 Joins b2,b3,b1 holds
(b1 .walkOf b2,b4,b3) .weightSeq() = <*((the_Weight_of b1) . b4)*>
proof end;

theorem Th22: :: GLIB_003:22
for b1 being WGraph
for b2 being Walk of b1 holds (b2 .reverse() ) .weightSeq() = Rev (b2 .weightSeq() )
proof end;

theorem Th23: :: GLIB_003:23
for b1 being WGraph
for b2, b3 being Walk of b1 st b2 .last() = b3 .first() holds
(b2 .append b3) .weightSeq() = (b2 .weightSeq() ) ^ (b3 .weightSeq() )
proof end;

theorem Th24: :: GLIB_003:24
for b1 being WGraph
for b2 being Walk of b1
for b3 being set st b3 in (b2 .last() ) .edgesInOut() holds
(b2 .addEdge b3) .weightSeq() = (b2 .weightSeq() ) ^ <*((the_Weight_of b1) . b3)*>
proof end;

theorem Th25: :: GLIB_003:25
for b1 being real-weighted WGraph
for b2 being Walk of b1
for b3 being Subwalk of b2 ex b4 being FinSubsequence of b2 .weightSeq() st b3 .weightSeq() = Seq b4
proof end;

theorem Th26: :: GLIB_003:26
for b1, b2 being WGraph
for b3 being Walk of b1
for b4 being Walk of b2 st b3 = b4 & the_Weight_of b1 = the_Weight_of b2 holds
b3 .weightSeq() = b4 .weightSeq()
proof end;

theorem Th27: :: GLIB_003:27
for b1 being WGraph
for b2 being WSubgraph of b1
for b3 being Walk of b1
for b4 being Walk of b2 st b3 = b4 holds
b3 .weightSeq() = b4 .weightSeq()
proof end;

theorem Th28: :: GLIB_003:28
for b1 being real-weighted WGraph
for b2 being Walk of b1 st b2 is trivial holds
b2 .cost() = 0 by RVSUM_1:102, Th19;

theorem Th29: :: GLIB_003:29
for b1 being real-weighted WGraph
for b2, b3 being Vertex of b1
for b4 being set st b4 Joins b2,b3,b1 holds
(b1 .walkOf b2,b4,b3) .cost() = (the_Weight_of b1) . b4
proof end;

theorem Th30: :: GLIB_003:30
for b1 being real-weighted WGraph
for b2 being Walk of b1 holds b2 .cost() = (b2 .reverse() ) .cost()
proof end;

theorem Th31: :: GLIB_003:31
for b1 being real-weighted WGraph
for b2, b3 being Walk of b1 st b2 .last() = b3 .first() holds
(b2 .append b3) .cost() = (b2 .cost() ) + (b3 .cost() )
proof end;

theorem Th32: :: GLIB_003:32
for b1 being real-weighted WGraph
for b2 being Walk of b1
for b3 being set st b3 in (b2 .last() ) .edgesInOut() holds
(b2 .addEdge b3) .cost() = (b2 .cost() ) + ((the_Weight_of b1) . b3)
proof end;

theorem Th33: :: GLIB_003:33
for b1, b2 being real-weighted WGraph
for b3 being Walk of b1
for b4 being Walk of b2 st b3 = b4 & the_Weight_of b1 = the_Weight_of b2 holds
b3 .cost() = b4 .cost() by Th26;

theorem Th34: :: GLIB_003:34
for b1 being real-weighted WGraph
for b2 being WSubgraph of b1
for b3 being Walk of b1
for b4 being Walk of b2 st b3 = b4 holds
b3 .cost() = b4 .cost() by Th27;

theorem Th35: :: GLIB_003:35
for b1 being nonnegative-weighted WGraph
for b2 being Walk of b1
for b3 being Nat st b3 in dom (b2 .weightSeq() ) holds
0 <= (b2 .weightSeq() ) . b3
proof end;

theorem Th36: :: GLIB_003:36
for b1 being nonnegative-weighted WGraph
for b2 being Walk of b1 holds 0 <= b2 .cost()
proof end;

theorem Th37: :: GLIB_003:37
for b1 being nonnegative-weighted WGraph
for b2 being Walk of b1
for b3 being Subwalk of b2 holds b3 .cost() <= b2 .cost()
proof end;

theorem Th38: :: GLIB_003:38
for b1 being nonnegative-weighted WGraph
for b2 being set st b2 in the_Edges_of b1 holds
0 <= (the_Weight_of b1) . b2
proof end;

theorem Th39: :: GLIB_003:39
for b1 being EGraph
for b2, b3 being set st b2 in the_Edges_of b1 holds
the_ELabel_of (b1 .labelEdge b2,b3) = (the_ELabel_of b1) +* (b2 .--> b3)
proof end;

theorem Th40: :: GLIB_003:40
for b1 being EGraph
for b2, b3 being set st b2 in the_Edges_of b1 holds
(the_ELabel_of (b1 .labelEdge b2,b3)) . b2 = b3
proof end;

theorem Th41: :: GLIB_003:41
for b1 being EGraph
for b2, b3 being set holds b1 == b1 .labelEdge b2,b3
proof end;

theorem Th42: :: GLIB_003:42
for b1 being WEGraph
for b2, b3 being set holds the_Weight_of b1 = the_Weight_of (b1 .labelEdge b2,b3)
proof end;

theorem Th43: :: GLIB_003:43
for b1 being EVGraph
for b2, b3 being set holds the_VLabel_of b1 = the_VLabel_of (b1 .labelEdge b2,b3)
proof end;

theorem Th44: :: GLIB_003:44
for b1 being EGraph
for b2, b3, b4 being set st b2 <> b3 holds
(the_ELabel_of (b1 .labelEdge b2,b4)) . b3 = (the_ELabel_of b1) . b3
proof end;

theorem Th45: :: GLIB_003:45
for b1 being VGraph
for b2, b3 being set st b2 in the_Vertices_of b1 holds
the_VLabel_of (b1 .labelVertex b2,b3) = (the_VLabel_of b1) +* (b2 .--> b3)
proof end;

theorem Th46: :: GLIB_003:46
for b1 being VGraph
for b2, b3 being set st b2 in the_Vertices_of b1 holds
(the_VLabel_of (b1 .labelVertex b2,b3)) . b2 = b3
proof end;

theorem Th47: :: GLIB_003:47
for b1 being VGraph
for b2, b3 being set holds b1 == b1 .labelVertex b2,b3
proof end;

theorem Th48: :: GLIB_003:48
for b1 being WVGraph
for b2, b3 being set holds the_Weight_of b1 = the_Weight_of (b1 .labelVertex b2,b3)
proof end;

theorem Th49: :: GLIB_003:49
for b1 being EVGraph
for b2, b3 being set holds the_ELabel_of b1 = the_ELabel_of (b1 .labelVertex b2,b3)
proof end;

theorem Th50: :: GLIB_003:50
for b1 being VGraph
for b2, b3, b4 being set st b2 <> b3 holds
(the_VLabel_of (b1 .labelVertex b2,b4)) . b3 = (the_VLabel_of b1) . b3
proof end;

theorem Th51: :: GLIB_003:51
for b1, b2 being EGraph st the_ELabel_of b1 = the_ELabel_of b2 holds
b1 .labeledE() = b2 .labeledE() ;

theorem Th52: :: GLIB_003:52
for b1 being EGraph
for b2, b3 being set st b2 in the_Edges_of b1 holds
(b1 .labelEdge b2,b3) .labeledE() = (b1 .labeledE() ) \/ {b2}
proof end;

theorem Th53: :: GLIB_003:53
for b1 being EGraph
for b2, b3 being set st b2 in the_Edges_of b1 holds
b1 .labeledE() c= (b1 .labelEdge b2,b3) .labeledE()
proof end;

theorem Th54: :: GLIB_003:54
for b1 being finite EGraph
for b2, b3 being set st b2 in the_Edges_of b1 & not b2 in b1 .labeledE() holds
card ((b1 .labelEdge b2,b3) .labeledE() ) = (card (b1 .labeledE() )) + 1
proof end;

theorem Th55: :: GLIB_003:55
for b1 being EGraph
for b2, b3, b4 being set st not b3 in b1 .labeledE() & b3 in (b1 .labelEdge b2,b4) .labeledE() holds
( b2 = b3 & b2 in the_Edges_of b1 )
proof end;

theorem Th56: :: GLIB_003:56
for b1 being EVGraph
for b2, b3 being set holds b1 .labeledE() = (b1 .labelVertex b2,b3) .labeledE() by Th49;

theorem Th57: :: GLIB_003:57
for b1 being EGraph
for b2, b3 being set st b2 in the_Edges_of b1 holds
b2 in (b1 .labelEdge b2,b3) .labeledE()
proof end;

theorem Th58: :: GLIB_003:58
for b1, b2 being VGraph st the_VLabel_of b1 = the_VLabel_of b2 holds
b1 .labeledV() = b2 .labeledV() ;

theorem Th59: :: GLIB_003:59
for b1 being VGraph
for b2, b3 being set st b2 in the_Vertices_of b1 holds
(b1 .labelVertex b2,b3) .labeledV() = (b1 .labeledV() ) \/ {b2}
proof end;

theorem Th60: :: GLIB_003:60
for b1 being VGraph
for b2, b3 being set st b2 in the_Vertices_of b1 holds
b1 .labeledV() c= (b1 .labelVertex b2,b3) .labeledV()
proof end;

theorem Th61: :: GLIB_003:61
for b1 being finite VGraph
for b2, b3 being set st b2 in the_Vertices_of b1 & not b2 in b1 .labeledV() holds
card ((b1 .labelVertex b2,b3) .labeledV() ) = (card (b1 .labeledV() )) + 1
proof end;

theorem Th62: :: GLIB_003:62
for b1 being VGraph
for b2, b3, b4 being set st not b3 in b1 .labeledV() & b3 in (b1 .labelVertex b2,b4) .labeledV() holds
( b2 = b3 & b2 in the_Vertices_of b1 )
proof end;

theorem Th63: :: GLIB_003:63
for b1 being EVGraph
for b2, b3 being set holds b1 .labeledV() = (b1 .labelEdge b2,b3) .labeledV() by Th43;

theorem Th64: :: GLIB_003:64
for b1 being VGraph
for b2 being Vertex of b1
for b3 being set holds b2 in (b1 .labelVertex b2,b3) .labeledV()
proof end;