:: GLIB_005 semantic presentation

registration
let c1 be set ;
let c2 be real number ;
cluster a1 .--> a2 -> real-yielding ;
coherence
c1 .--> c2 is real-yielding
proof end;
end;

registration
let c1 be set ;
let c2 be natural number ;
cluster K380(a1,a2) -> natural-yielding ;
coherence
c1 --> c2 is natural-yielding
proof end;
end;

registration
let c1, c2 be real-yielding Function;
cluster a1 +* a2 -> real-yielding ;
coherence
c1 +* c2 is real-yielding
proof end;
end;

definition
let c1 be EGraph;
attr a1 is complete-elabeled means :Def1: :: GLIB_005:def 1
dom (the_ELabel_of a1) = the_Edges_of a1;
end;

:: deftheorem Def1 defines complete-elabeled GLIB_005:def 1 :
for b1 being EGraph holds
( b1 is complete-elabeled iff dom (the_ELabel_of b1) = the_Edges_of b1 );

registration
let c1 be _Graph;
let c2 be ManySortedSet of the_Edges_of c1;
cluster a1 .set ELabelSelector ,a2 -> complete-elabeled ;
coherence
c1 .set ELabelSelector ,c2 is complete-elabeled
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 ELabelSelector ,a3 -> complete-elabeled ;
coherence
c1 .set ELabelSelector ,c3 is complete-elabeled
proof end;
end;

definition
let c1 be EGraphSeq;
attr a1 is complete-elabeled means :Def2: :: GLIB_005:def 2
for b1 being Nat holds a1 .-> b1 is complete-elabeled;
end;

:: deftheorem Def2 defines complete-elabeled GLIB_005:def 2 :
for b1 being EGraphSeq holds
( b1 is complete-elabeled iff for b2 being Nat holds b1 .-> b2 is complete-elabeled );

definition
let c1 be WGraph;
attr a1 is natural-weighted means :Def3: :: GLIB_005:def 3
the_Weight_of a1 is natural-yielding;
end;

:: deftheorem Def3 defines natural-weighted GLIB_005:def 3 :
for b1 being WGraph holds
( b1 is natural-weighted iff the_Weight_of b1 is natural-yielding );

definition
let c1 be EGraph;
attr a1 is natural-elabeled means :Def4: :: GLIB_005:def 4
the_ELabel_of a1 is natural-yielding;
end;

:: deftheorem Def4 defines natural-elabeled GLIB_005:def 4 :
for b1 being EGraph holds
( b1 is natural-elabeled iff the_ELabel_of b1 is natural-yielding );

definition
let c1 be WGraphSeq;
attr a1 is natural-weighted means :Def5: :: GLIB_005:def 5
for b1 being Nat holds a1 .-> b1 is natural-weighted;
end;

:: deftheorem Def5 defines natural-weighted GLIB_005:def 5 :
for b1 being WGraphSeq holds
( b1 is natural-weighted iff for b2 being Nat holds b1 .-> b2 is natural-weighted );

definition
let c1 be EGraphSeq;
attr a1 is natural-elabeled means :Def6: :: GLIB_005:def 6
for b1 being Nat holds a1 .-> b1 is natural-elabeled;
end;

:: deftheorem Def6 defines natural-elabeled GLIB_005:def 6 :
for b1 being EGraphSeq holds
( b1 is natural-elabeled iff for b2 being Nat holds b1 .-> b2 is natural-elabeled );

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

registration
cluster natural-elabeled -> real-elabeled GraphStruct ;
coherence
for b1 being EGraph st b1 is natural-elabeled holds
b1 is real-elabeled
proof end;
end;

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

registration
cluster finite real-WEV complete-elabeled natural-weighted natural-elabeled ManySortedSet of NAT ;
existence
ex b1 being WEVGraphSeq st
( b1 is finite & b1 is natural-weighted & b1 is real-WEV & b1 is natural-elabeled & b1 is complete-elabeled )
proof end;
end;

registration
let c1 be complete-elabeled EGraphSeq;
let c2 be Nat;
cluster a1 .-> a2 -> complete-elabeled ;
coherence
c1 .-> c2 is complete-elabeled
by Def2;
end;

registration
let c1 be natural-elabeled EGraphSeq;
let c2 be Nat;
cluster a1 .-> a2 -> real-elabeled natural-elabeled ;
coherence
c1 .-> c2 is natural-elabeled
by Def6;
end;

registration
let c1 be natural-weighted WGraphSeq;
let c2 be Nat;
cluster a1 .-> a2 -> nonnegative-weighted natural-weighted ;
coherence
c1 .-> c2 is natural-weighted
by Def5;
end;

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

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

definition
let c1 be complete-elabeled EGraph;
redefine func the_ELabel_of as the_ELabel_of c1 -> ManySortedSet of the_Edges_of a1;
coherence
the_ELabel_of c1 is ManySortedSet of the_Edges_of c1
proof end;
end;

registration
let c1 be natural-weighted WGraph;
let c2 be set ;
cluster a1 .set ELabelSelector ,a2 -> natural-weighted ;
coherence
c1 .set ELabelSelector ,c2 is natural-weighted
proof end;
cluster a1 .set VLabelSelector ,a2 -> natural-weighted ;
coherence
c1 .set VLabelSelector ,c2 is natural-weighted
proof end;
end;

registration
let c1 be _Graph;
let c2 be natural-yielding ManySortedSet of the_Edges_of c1;
cluster a1 .set ELabelSelector ,a2 -> complete-elabeled natural-elabeled ;
coherence
c1 .set ELabelSelector ,c2 is natural-elabeled
proof end;
end;

definition
let c1 be finite real-weighted real-elabeled complete-elabeled WEGraph;
let c2, c3 be set ;
pred c1 has_valid_flow_from c2,c3 means :Def7: :: GLIB_005:def 7
( a2 is Vertex of a1 & a3 is Vertex of a1 & ( for b1 being set st b1 in the_Edges_of a1 holds
( 0 <= (the_ELabel_of a1) . b1 & (the_ELabel_of a1) . b1 <= (the_Weight_of a1) . b1 ) ) & ( for b1 being Vertex of a1 st b1 <> a2 & b1 <> a3 holds
Sum ((the_ELabel_of a1) | (b1 .edgesIn() )) = Sum ((the_ELabel_of a1) | (b1 .edgesOut() )) ) );
end;

:: deftheorem Def7 defines has_valid_flow_from GLIB_005:def 7 :
for b1 being finite real-weighted real-elabeled complete-elabeled WEGraph
for b2, b3 being set holds
( b1 has_valid_flow_from b2,b3 iff ( b2 is Vertex of b1 & b3 is Vertex of b1 & ( for b4 being set st b4 in the_Edges_of b1 holds
( 0 <= (the_ELabel_of b1) . b4 & (the_ELabel_of b1) . b4 <= (the_Weight_of b1) . b4 ) ) & ( for b4 being Vertex of b1 st b4 <> b2 & b4 <> b3 holds
Sum ((the_ELabel_of b1) | (b4 .edgesIn() )) = Sum ((the_ELabel_of b1) | (b4 .edgesOut() )) ) ) );

definition
let c1 be finite real-weighted real-elabeled complete-elabeled WEGraph;
let c2, c3 be set ;
assume c1 has_valid_flow_from c2,c3 ;
func c1 .flow c2,c3 -> real number equals :Def8: :: GLIB_005:def 8
(Sum ((the_ELabel_of a1) | (a1 .edgesInto {a3}))) - (Sum ((the_ELabel_of a1) | (a1 .edgesOutOf {a3})));
coherence
(Sum ((the_ELabel_of c1) | (c1 .edgesInto {c3}))) - (Sum ((the_ELabel_of c1) | (c1 .edgesOutOf {c3}))) is real number
;
end;

:: deftheorem Def8 defines .flow GLIB_005:def 8 :
for b1 being finite real-weighted real-elabeled complete-elabeled WEGraph
for b2, b3 being set st b1 has_valid_flow_from b2,b3 holds
b1 .flow b2,b3 = (Sum ((the_ELabel_of b1) | (b1 .edgesInto {b3}))) - (Sum ((the_ELabel_of b1) | (b1 .edgesOutOf {b3})));

definition
let c1 be finite real-weighted real-elabeled complete-elabeled WEGraph;
let c2, c3 be set ;
pred c1 has_maximum_flow_from c2,c3 means :Def9: :: GLIB_005:def 9
( a1 has_valid_flow_from a2,a3 & ( for b1 being finite real-weighted real-elabeled complete-elabeled WEGraph st b1 == a1 & the_Weight_of a1 = the_Weight_of b1 & b1 has_valid_flow_from a2,a3 holds
b1 .flow a2,a3 <= a1 .flow a2,a3 ) );
end;

:: deftheorem Def9 defines has_maximum_flow_from GLIB_005:def 9 :
for b1 being finite real-weighted real-elabeled complete-elabeled WEGraph
for b2, b3 being set holds
( b1 has_maximum_flow_from b2,b3 iff ( b1 has_valid_flow_from b2,b3 & ( for b4 being finite real-weighted real-elabeled complete-elabeled WEGraph st b4 == b1 & the_Weight_of b1 = the_Weight_of b4 & b4 has_valid_flow_from b2,b3 holds
b4 .flow b2,b3 <= b1 .flow b2,b3 ) ) );

definition
let c1 be real-weighted real-elabeled WEVGraph;
let c2 be set ;
pred c2 is_forward_labeling_in c1 means :Def10: :: GLIB_005:def 10
( a2 in the_Edges_of a1 & (the_Source_of a1) . a2 in a1 .labeledV() & not (the_Target_of a1) . a2 in a1 .labeledV() & (the_ELabel_of a1) . a2 < (the_Weight_of a1) . a2 );
end;

:: deftheorem Def10 defines is_forward_labeling_in GLIB_005:def 10 :
for b1 being real-weighted real-elabeled WEVGraph
for b2 being set holds
( b2 is_forward_labeling_in b1 iff ( b2 in the_Edges_of b1 & (the_Source_of b1) . b2 in b1 .labeledV() & not (the_Target_of b1) . b2 in b1 .labeledV() & (the_ELabel_of b1) . b2 < (the_Weight_of b1) . b2 ) );

definition
let c1 be real-elabeled EVGraph;
let c2 be set ;
pred c2 is_backward_labeling_in c1 means :Def11: :: GLIB_005:def 11
( a2 in the_Edges_of a1 & (the_Target_of a1) . a2 in a1 .labeledV() & not (the_Source_of a1) . a2 in a1 .labeledV() & 0 < (the_ELabel_of a1) . a2 );
end;

:: deftheorem Def11 defines is_backward_labeling_in GLIB_005:def 11 :
for b1 being real-elabeled EVGraph
for b2 being set holds
( b2 is_backward_labeling_in b1 iff ( b2 in the_Edges_of b1 & (the_Target_of b1) . b2 in b1 .labeledV() & not (the_Source_of b1) . b2 in b1 .labeledV() & 0 < (the_ELabel_of b1) . b2 ) );

definition
let c1 be real-weighted real-elabeled WEGraph;
let c2 be Walk of c1;
attr a2 is augmenting means :Def12: :: GLIB_005:def 12
for b1 being odd Nat st b1 < len a2 holds
( ( a2 . (b1 + 1) DJoins a2 . b1,a2 . (b1 + 2),a1 implies (the_ELabel_of a1) . (a2 . (b1 + 1)) < (the_Weight_of a1) . (a2 . (b1 + 1)) ) & ( not a2 . (b1 + 1) DJoins a2 . b1,a2 . (b1 + 2),a1 implies 0 < (the_ELabel_of a1) . (a2 . (b1 + 1)) ) );
end;

:: deftheorem Def12 defines augmenting GLIB_005:def 12 :
for b1 being real-weighted real-elabeled WEGraph
for b2 being Walk of b1 holds
( b2 is augmenting iff for b3 being odd Nat st b3 < len b2 holds
( ( b2 . (b3 + 1) DJoins b2 . b3,b2 . (b3 + 2),b1 implies (the_ELabel_of b1) . (b2 . (b3 + 1)) < (the_Weight_of b1) . (b2 . (b3 + 1)) ) & ( not b2 . (b3 + 1) DJoins b2 . b3,b2 . (b3 + 2),b1 implies 0 < (the_ELabel_of b1) . (b2 . (b3 + 1)) ) ) );

registration
let c1 be real-weighted real-elabeled WEGraph;
cluster trivial -> augmenting Walk of a1;
coherence
for b1 being Walk of c1 st b1 is trivial holds
b1 is augmenting
proof end;
end;

registration
let c1 be real-weighted real-elabeled WEGraph;
cluster vertex-distinct augmenting Walk of a1;
existence
ex b1 being Path of c1 st
( b1 is vertex-distinct & b1 is augmenting )
proof end;
end;

registration
let c1 be real-weighted real-elabeled WEGraph;
let c2 be augmenting Walk of c1;
let c3, c4 be Nat;
cluster a2 .cut a3,a4 -> augmenting ;
coherence
c2 .cut c3,c4 is augmenting
proof end;
end;

theorem Th1: :: GLIB_005:1
for b1, b2 being real-weighted real-elabeled WEGraph
for b3 being Walk of b1
for b4 being Walk of b2 st b3 is augmenting & b1 == b2 & the_Weight_of b1 = the_Weight_of b2 & the_ELabel_of b1 = the_ELabel_of b2 & b3 = b4 holds
b4 is augmenting
proof end;

theorem Th2: :: GLIB_005:2
for b1 being real-weighted real-elabeled WEGraph
for b2 being augmenting Walk of b1
for b3, b4 being set st not b4 in b2 .vertices() & ( ( b3 DJoins b2 .last() ,b4,b1 & (the_ELabel_of b1) . b3 < (the_Weight_of b1) . b3 ) or ( b3 DJoins b4,b2 .last() ,b1 & 0 < (the_ELabel_of b1) . b3 ) ) holds
b2 .addEdge b3 is augmenting
proof end;

definition
let c1 be real-weighted real-elabeled WEVGraph;
func AP:NextBestEdges c1 -> Subset of (the_Edges_of a1) means :Def13: :: GLIB_005:def 13
for b1 being set holds
( b1 in a2 iff ( b1 is_forward_labeling_in a1 or b1 is_backward_labeling_in a1 ) );
existence
ex b1 being Subset of (the_Edges_of c1) st
for b2 being set holds
( b2 in b1 iff ( b2 is_forward_labeling_in c1 or b2 is_backward_labeling_in c1 ) )
proof end;
uniqueness
for b1, b2 being Subset of (the_Edges_of c1) st ( for b3 being set holds
( b3 in b1 iff ( b3 is_forward_labeling_in c1 or b3 is_backward_labeling_in c1 ) ) ) & ( for b3 being set holds
( b3 in b2 iff ( b3 is_forward_labeling_in c1 or b3 is_backward_labeling_in c1 ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def13 defines AP:NextBestEdges GLIB_005:def 13 :
for b1 being real-weighted real-elabeled WEVGraph
for b2 being Subset of (the_Edges_of b1) holds
( b2 = AP:NextBestEdges b1 iff for b3 being set holds
( b3 in b2 iff ( b3 is_forward_labeling_in b1 or b3 is_backward_labeling_in b1 ) ) );

definition
let c1 be real-weighted real-elabeled WEVGraph;
set c2 = choose (AP:NextBestEdges c1);
func AP:Step c1 -> real-weighted real-elabeled WEVGraph equals :Def14: :: GLIB_005:def 14
a1 if AP:NextBestEdges a1 = {}
a1 .labelVertex ((the_Source_of a1) . (choose (AP:NextBestEdges a1))),(choose (AP:NextBestEdges a1)) if ( AP:NextBestEdges a1 <> {} & not (the_Source_of a1) . (choose (AP:NextBestEdges a1)) in a1 .labeledV() )
otherwise a1 .labelVertex ((the_Target_of a1) . (choose (AP:NextBestEdges a1))),(choose (AP:NextBestEdges a1));
coherence
( ( AP:NextBestEdges c1 = {} implies c1 is real-weighted real-elabeled WEVGraph ) & ( AP:NextBestEdges c1 <> {} & not (the_Source_of c1) . (choose (AP:NextBestEdges c1)) in c1 .labeledV() implies c1 .labelVertex ((the_Source_of c1) . (choose (AP:NextBestEdges c1))),(choose (AP:NextBestEdges c1)) is real-weighted real-elabeled WEVGraph ) & ( not AP:NextBestEdges c1 = {} & ( not AP:NextBestEdges c1 <> {} or (the_Source_of c1) . (choose (AP:NextBestEdges c1)) in c1 .labeledV() ) implies c1 .labelVertex ((the_Target_of c1) . (choose (AP:NextBestEdges c1))),(choose (AP:NextBestEdges c1)) is real-weighted real-elabeled WEVGraph ) )
;
consistency
for b1 being real-weighted real-elabeled WEVGraph st AP:NextBestEdges c1 = {} & AP:NextBestEdges c1 <> {} & not (the_Source_of c1) . (choose (AP:NextBestEdges c1)) in c1 .labeledV() holds
( b1 = c1 iff b1 = c1 .labelVertex ((the_Source_of c1) . (choose (AP:NextBestEdges c1))),(choose (AP:NextBestEdges c1)) )
;
end;

:: deftheorem Def14 defines AP:Step GLIB_005:def 14 :
for b1 being real-weighted real-elabeled WEVGraph holds
( ( AP:NextBestEdges b1 = {} implies AP:Step b1 = b1 ) & ( AP:NextBestEdges b1 <> {} & not (the_Source_of b1) . (choose (AP:NextBestEdges b1)) in b1 .labeledV() implies AP:Step b1 = b1 .labelVertex ((the_Source_of b1) . (choose (AP:NextBestEdges b1))),(choose (AP:NextBestEdges b1)) ) & ( not AP:NextBestEdges b1 = {} & ( not AP:NextBestEdges b1 <> {} or (the_Source_of b1) . (choose (AP:NextBestEdges b1)) in b1 .labeledV() ) implies AP:Step b1 = b1 .labelVertex ((the_Target_of b1) . (choose (AP:NextBestEdges b1))),(choose (AP:NextBestEdges b1)) ) );

registration
let c1 be finite real-weighted real-elabeled WEVGraph;
cluster AP:Step a1 -> finite real-weighted real-elabeled ;
coherence
AP:Step c1 is finite
proof end;
end;

definition
let c1 be real-weighted real-elabeled WEGraph;
let c2 be Vertex of c1;
func AP:CompSeq c1,c2 -> real-weighted real-elabeled WEVGraphSeq means :Def15: :: GLIB_005:def 15
( a3 .-> 0 = a1 .set VLabelSelector ,(a2 .--> 1) & ( for b1 being Nat holds a3 .-> (b1 + 1) = AP:Step (a3 .-> b1) ) );
existence
ex b1 being real-weighted real-elabeled WEVGraphSeq st
( b1 .-> 0 = c1 .set VLabelSelector ,(c2 .--> 1) & ( for b2 being Nat holds b1 .-> (b2 + 1) = AP:Step (b1 .-> b2) ) )
proof end;
uniqueness
for b1, b2 being real-weighted real-elabeled WEVGraphSeq st b1 .-> 0 = c1 .set VLabelSelector ,(c2 .--> 1) & ( for b3 being Nat holds b1 .-> (b3 + 1) = AP:Step (b1 .-> b3) ) & b2 .-> 0 = c1 .set VLabelSelector ,(c2 .--> 1) & ( for b3 being Nat holds b2 .-> (b3 + 1) = AP:Step (b2 .-> b3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def15 defines AP:CompSeq GLIB_005:def 15 :
for b1 being real-weighted real-elabeled WEGraph
for b2 being Vertex of b1
for b3 being real-weighted real-elabeled WEVGraphSeq holds
( b3 = AP:CompSeq b1,b2 iff ( b3 .-> 0 = b1 .set VLabelSelector ,(b2 .--> 1) & ( for b4 being Nat holds b3 .-> (b4 + 1) = AP:Step (b3 .-> b4) ) ) );

registration
let c1 be finite real-weighted real-elabeled WEGraph;
let c2 be Vertex of c1;
cluster AP:CompSeq a1,a2 -> finite real-weighted real-elabeled ;
coherence
AP:CompSeq c1,c2 is finite
proof end;
end;

theorem Th3: :: GLIB_005:3
for b1 being real-weighted real-elabeled WEGraph
for b2 being Vertex of b1 holds
( b1 == (AP:CompSeq b1,b2) .-> 0 & the_Weight_of b1 = the_Weight_of ((AP:CompSeq b1,b2) .-> 0) & the_ELabel_of b1 = the_ELabel_of ((AP:CompSeq b1,b2) .-> 0) & ((AP:CompSeq b1,b2) .-> 0) .labeledV() = {b2} )
proof end;

theorem Th4: :: GLIB_005:4
for b1 being real-weighted real-elabeled WEGraph
for b2 being Vertex of b1
for b3, b4 being Nat st b3 <= b4 holds
((AP:CompSeq b1,b2) .-> b3) .labeledV() c= ((AP:CompSeq b1,b2) .-> b4) .labeledV()
proof end;

theorem Th5: :: GLIB_005:5
for b1 being real-weighted real-elabeled WEGraph
for b2 being Vertex of b1
for b3 being Nat holds
( b1 == (AP:CompSeq b1,b2) .-> b3 & the_Weight_of b1 = the_Weight_of ((AP:CompSeq b1,b2) .-> b3) & the_ELabel_of b1 = the_ELabel_of ((AP:CompSeq b1,b2) .-> b3) )
proof end;

definition
let c1 be real-weighted real-elabeled WEGraph;
let c2 be Vertex of c1;
func AP:FindAugPath c1,c2 -> real-weighted real-elabeled WEVGraph equals :: GLIB_005:def 16
(AP:CompSeq a1,a2) .Result() ;
coherence
(AP:CompSeq c1,c2) .Result() is real-weighted real-elabeled WEVGraph
proof end;
end;

:: deftheorem Def16 defines AP:FindAugPath GLIB_005:def 16 :
for b1 being real-weighted real-elabeled WEGraph
for b2 being Vertex of b1 holds AP:FindAugPath b1,b2 = (AP:CompSeq b1,b2) .Result() ;

theorem Th6: :: GLIB_005:6
for b1 being finite real-weighted real-elabeled WEGraph
for b2 being Vertex of b1 holds AP:CompSeq b1,b2 is halting
proof end;

theorem Th7: :: GLIB_005:7
for b1 being finite real-weighted real-elabeled WEGraph
for b2 being Vertex of b1
for b3 being Nat
for b4 being set st b4 in ((AP:CompSeq b1,b2) .-> b3) .labeledV() holds
(the_VLabel_of ((AP:CompSeq b1,b2) .-> b3)) . b4 = (the_VLabel_of (AP:FindAugPath b1,b2)) . b4
proof end;

definition
let c1 be finite real-weighted real-elabeled WEGraph;
let c2, c3 be Vertex of c1;
func AP:GetAugPath c1,c2,c3 -> vertex-distinct augmenting Path of a1 means :Def17: :: GLIB_005:def 17
( a4 is_Walk_from a2,a3 & ( for b1 being even Nat st b1 in dom a4 holds
a4 . b1 = (the_VLabel_of (AP:FindAugPath a1,a2)) . (a4 . (b1 + 1)) ) ) if a3 in (AP:FindAugPath a1,a2) .labeledV()
otherwise a4 = a1 .walkOf a2;
existence
( ( c3 in (AP:FindAugPath c1,c2) .labeledV() implies ex b1 being vertex-distinct augmenting Path of c1 st
( b1 is_Walk_from c2,c3 & ( for b2 being even Nat st b2 in dom b1 holds
b1 . b2 = (the_VLabel_of (AP:FindAugPath c1,c2)) . (b1 . (b2 + 1)) ) ) ) & ( not c3 in (AP:FindAugPath c1,c2) .labeledV() implies ex b1 being vertex-distinct augmenting Path of c1 st b1 = c1 .walkOf c2 ) )
proof end;
uniqueness
for b1, b2 being vertex-distinct augmenting Path of c1 holds
( ( c3 in (AP:FindAugPath c1,c2) .labeledV() & b1 is_Walk_from c2,c3 & ( for b3 being even Nat st b3 in dom b1 holds
b1 . b3 = (the_VLabel_of (AP:FindAugPath c1,c2)) . (b1 . (b3 + 1)) ) & b2 is_Walk_from c2,c3 & ( for b3 being even Nat st b3 in dom b2 holds
b2 . b3 = (the_VLabel_of (AP:FindAugPath c1,c2)) . (b2 . (b3 + 1)) ) implies b1 = b2 ) & ( not c3 in (AP:FindAugPath c1,c2) .labeledV() & b1 = c1 .walkOf c2 & b2 = c1 .walkOf c2 implies b1 = b2 ) )
proof end;
consistency
for b1 being vertex-distinct augmenting Path of c1 holds verum
;
end;

:: deftheorem Def17 defines AP:GetAugPath GLIB_005:def 17 :
for b1 being finite real-weighted real-elabeled WEGraph
for b2, b3 being Vertex of b1
for b4 being vertex-distinct augmenting Path of b1 holds
( ( b3 in (AP:FindAugPath b1,b2) .labeledV() implies ( b4 = AP:GetAugPath b1,b2,b3 iff ( b4 is_Walk_from b2,b3 & ( for b5 being even Nat st b5 in dom b4 holds
b4 . b5 = (the_VLabel_of (AP:FindAugPath b1,b2)) . (b4 . (b5 + 1)) ) ) ) ) & ( not b3 in (AP:FindAugPath b1,b2) .labeledV() implies ( b4 = AP:GetAugPath b1,b2,b3 iff b4 = b1 .walkOf b2 ) ) );

theorem Th8: :: GLIB_005:8
for b1 being real-weighted real-elabeled WEGraph
for b2 being Vertex of b1
for b3 being Nat
for b4 being set st b4 in ((AP:CompSeq b1,b2) .-> b3) .labeledV() holds
ex b5 being Path of b1 st
( b5 is augmenting & b5 is_Walk_from b2,b4 & b5 .vertices() c= ((AP:CompSeq b1,b2) .-> b3) .labeledV() )
proof end;

theorem Th9: :: GLIB_005:9
for b1 being finite real-weighted real-elabeled WEGraph
for b2 being Vertex of b1
for b3 being set holds
( b3 in (AP:FindAugPath b1,b2) .labeledV() iff ex b4 being Path of b1 st
( b4 is augmenting & b4 is_Walk_from b2,b3 ) )
proof end;

theorem Th10: :: GLIB_005:10
for b1 being finite real-weighted real-elabeled WEGraph
for b2 being Vertex of b1 holds
( b2 in (AP:FindAugPath b1,b2) .labeledV() & b1 == AP:FindAugPath b1,b2 & the_Weight_of b1 = the_Weight_of (AP:FindAugPath b1,b2) & the_ELabel_of b1 = the_ELabel_of (AP:FindAugPath b1,b2) )
proof end;

definition
let c1 be real-weighted real-elabeled WEGraph;
let c2 be augmenting Walk of c1;
func c2 .flowSeq() -> FinSequence of REAL means :Def18: :: GLIB_005:def 18
( dom a3 = dom (a2 .edgeSeq() ) & ( for b1 being Nat st b1 in dom a3 holds
( ( a2 . (2 * b1) DJoins a2 . ((2 * b1) - 1),a2 . ((2 * b1) + 1),a1 implies a3 . b1 = ((the_Weight_of a1) . (a2 . (2 * b1))) - ((the_ELabel_of a1) . (a2 . (2 * b1))) ) & ( not a2 . (2 * b1) DJoins a2 . ((2 * b1) - 1),a2 . ((2 * b1) + 1),a1 implies a3 . b1 = (the_ELabel_of a1) . (a2 . (2 * b1)) ) ) ) );
existence
ex b1 being FinSequence of REAL st
( dom b1 = dom (c2 .edgeSeq() ) & ( for b2 being Nat st b2 in dom b1 holds
( ( c2 . (2 * b2) DJoins c2 . ((2 * b2) - 1),c2 . ((2 * b2) + 1),c1 implies b1 . b2 = ((the_Weight_of c1) . (c2 . (2 * b2))) - ((the_ELabel_of c1) . (c2 . (2 * b2))) ) & ( not c2 . (2 * b2) DJoins c2 . ((2 * b2) - 1),c2 . ((2 * b2) + 1),c1 implies b1 . b2 = (the_ELabel_of c1) . (c2 . (2 * b2)) ) ) ) )
proof end;
uniqueness
for b1, b2 being FinSequence of REAL st dom b1 = dom (c2 .edgeSeq() ) & ( for b3 being Nat st b3 in dom b1 holds
( ( c2 . (2 * b3) DJoins c2 . ((2 * b3) - 1),c2 . ((2 * b3) + 1),c1 implies b1 . b3 = ((the_Weight_of c1) . (c2 . (2 * b3))) - ((the_ELabel_of c1) . (c2 . (2 * b3))) ) & ( not c2 . (2 * b3) DJoins c2 . ((2 * b3) - 1),c2 . ((2 * b3) + 1),c1 implies b1 . b3 = (the_ELabel_of c1) . (c2 . (2 * b3)) ) ) ) & dom b2 = dom (c2 .edgeSeq() ) & ( for b3 being Nat st b3 in dom b2 holds
( ( c2 . (2 * b3) DJoins c2 . ((2 * b3) - 1),c2 . ((2 * b3) + 1),c1 implies b2 . b3 = ((the_Weight_of c1) . (c2 . (2 * b3))) - ((the_ELabel_of c1) . (c2 . (2 * b3))) ) & ( not c2 . (2 * b3) DJoins c2 . ((2 * b3) - 1),c2 . ((2 * b3) + 1),c1 implies b2 . b3 = (the_ELabel_of c1) . (c2 . (2 * b3)) ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def18 defines .flowSeq() GLIB_005:def 18 :
for b1 being real-weighted real-elabeled WEGraph
for b2 being augmenting Walk of b1
for b3 being FinSequence of REAL holds
( b3 = b2 .flowSeq() iff ( dom b3 = dom (b2 .edgeSeq() ) & ( for b4 being Nat st b4 in dom b3 holds
( ( b2 . (2 * b4) DJoins b2 . ((2 * b4) - 1),b2 . ((2 * b4) + 1),b1 implies b3 . b4 = ((the_Weight_of b1) . (b2 . (2 * b4))) - ((the_ELabel_of b1) . (b2 . (2 * b4))) ) & ( not b2 . (2 * b4) DJoins b2 . ((2 * b4) - 1),b2 . ((2 * b4) + 1),b1 implies b3 . b4 = (the_ELabel_of b1) . (b2 . (2 * b4)) ) ) ) ) );

definition
let c1 be real-weighted real-elabeled WEGraph;
let c2 be augmenting Walk of c1;
func c2 .tolerance() -> Real means :Def19: :: GLIB_005:def 19
( a3 in rng (a2 .flowSeq() ) & ( for b1 being Real st b1 in rng (a2 .flowSeq() ) holds
a3 <= b1 ) ) if not a2 is trivial
otherwise a3 = 0;
existence
( ( not c2 is trivial implies ex b1 being Real st
( b1 in rng (c2 .flowSeq() ) & ( for b2 being Real st b2 in rng (c2 .flowSeq() ) holds
b1 <= b2 ) ) ) & ( c2 is trivial implies ex b1 being Real st b1 = 0 ) )
proof end;
uniqueness
for b1, b2 being Real holds
( ( not c2 is trivial & b1 in rng (c2 .flowSeq() ) & ( for b3 being Real st b3 in rng (c2 .flowSeq() ) holds
b1 <= b3 ) & b2 in rng (c2 .flowSeq() ) & ( for b3 being Real st b3 in rng (c2 .flowSeq() ) holds
b2 <= b3 ) implies b1 = b2 ) & ( c2 is trivial & b1 = 0 & b2 = 0 implies b1 = b2 ) )
proof end;
consistency
for b1 being Real holds verum
;
end;

:: deftheorem Def19 defines .tolerance() GLIB_005:def 19 :
for b1 being real-weighted real-elabeled WEGraph
for b2 being augmenting Walk of b1
for b3 being Real holds
( ( not b2 is trivial implies ( b3 = b2 .tolerance() iff ( b3 in rng (b2 .flowSeq() ) & ( for b4 being Real st b4 in rng (b2 .flowSeq() ) holds
b3 <= b4 ) ) ) ) & ( b2 is trivial implies ( b3 = b2 .tolerance() iff b3 = 0 ) ) );

definition
let c1 be natural-weighted natural-elabeled WEGraph;
let c2 be augmenting Walk of c1;
redefine func .tolerance() as c2 .tolerance() -> Nat;
coherence
c2 .tolerance() is Nat
proof end;
end;

definition
let c1 be real-weighted real-elabeled WEGraph;
let c2 be augmenting Path of c1;
func FF:PushFlow c1,c2 -> ManySortedSet of the_Edges_of a1 means :Def20: :: GLIB_005:def 20
( ( for b1 being set st b1 in the_Edges_of a1 & not b1 in a2 .edges() holds
a3 . b1 = (the_ELabel_of a1) . b1 ) & ( for b1 being odd Nat st b1 < len a2 holds
( ( a2 . (b1 + 1) DJoins a2 . b1,a2 . (b1 + 2),a1 implies a3 . (a2 . (b1 + 1)) = ((the_ELabel_of a1) . (a2 . (b1 + 1))) + (a2 .tolerance() ) ) & ( not a2 . (b1 + 1) DJoins a2 . b1,a2 . (b1 + 2),a1 implies a3 . (a2 . (b1 + 1)) = ((the_ELabel_of a1) . (a2 . (b1 + 1))) - (a2 .tolerance() ) ) ) ) );
existence
ex b1 being ManySortedSet of the_Edges_of c1 st
( ( for b2 being set st b2 in the_Edges_of c1 & not b2 in c2 .edges() holds
b1 . b2 = (the_ELabel_of c1) . b2 ) & ( for b2 being odd Nat st b2 < len c2 holds
( ( c2 . (b2 + 1) DJoins c2 . b2,c2 . (b2 + 2),c1 implies b1 . (c2 . (b2 + 1)) = ((the_ELabel_of c1) . (c2 . (b2 + 1))) + (c2 .tolerance() ) ) & ( not c2 . (b2 + 1) DJoins c2 . b2,c2 . (b2 + 2),c1 implies b1 . (c2 . (b2 + 1)) = ((the_ELabel_of c1) . (c2 . (b2 + 1))) - (c2 .tolerance() ) ) ) ) )
proof end;
uniqueness
for b1, b2 being ManySortedSet of the_Edges_of c1 st ( for b3 being set st b3 in the_Edges_of c1 & not b3 in c2 .edges() holds
b1 . b3 = (the_ELabel_of c1) . b3 ) & ( for b3 being odd Nat st b3 < len c2 holds
( ( c2 . (b3 + 1) DJoins c2 . b3,c2 . (b3 + 2),c1 implies b1 . (c2 . (b3 + 1)) = ((the_ELabel_of c1) . (c2 . (b3 + 1))) + (c2 .tolerance() ) ) & ( not c2 . (b3 + 1) DJoins c2 . b3,c2 . (b3 + 2),c1 implies b1 . (c2 . (b3 + 1)) = ((the_ELabel_of c1) . (c2 . (b3 + 1))) - (c2 .tolerance() ) ) ) ) & ( for b3 being set st b3 in the_Edges_of c1 & not b3 in c2 .edges() holds
b2 . b3 = (the_ELabel_of c1) . b3 ) & ( for b3 being odd Nat st b3 < len c2 holds
( ( c2 . (b3 + 1) DJoins c2 . b3,c2 . (b3 + 2),c1 implies b2 . (c2 . (b3 + 1)) = ((the_ELabel_of c1) . (c2 . (b3 + 1))) + (c2 .tolerance() ) ) & ( not c2 . (b3 + 1) DJoins c2 . b3,c2 . (b3 + 2),c1 implies b2 . (c2 . (b3 + 1)) = ((the_ELabel_of c1) . (c2 . (b3 + 1))) - (c2 .tolerance() ) ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def20 defines FF:PushFlow GLIB_005:def 20 :
for b1 being real-weighted real-elabeled WEGraph
for b2 being augmenting Path of b1
for b3 being ManySortedSet of the_Edges_of b1 holds
( b3 = FF:PushFlow b1,b2 iff ( ( for b4 being set st b4 in the_Edges_of b1 & not b4 in b2 .edges() holds
b3 . b4 = (the_ELabel_of b1) . b4 ) & ( for b4 being odd Nat st b4 < len b2 holds
( ( b2 . (b4 + 1) DJoins b2 . b4,b2 . (b4 + 2),b1 implies b3 . (b2 . (b4 + 1)) = ((the_ELabel_of b1) . (b2 . (b4 + 1))) + (b2 .tolerance() ) ) & ( not b2 . (b4 + 1) DJoins b2 . b4,b2 . (b4 + 2),b1 implies b3 . (b2 . (b4 + 1)) = ((the_ELabel_of b1) . (b2 . (b4 + 1))) - (b2 .tolerance() ) ) ) ) ) );

registration
let c1 be real-weighted real-elabeled WEGraph;
let c2 be augmenting Path of c1;
cluster FF:PushFlow a1,a2 -> real-yielding ;
coherence
FF:PushFlow c1,c2 is real-yielding
proof end;
end;

registration
let c1 be natural-weighted natural-elabeled WEGraph;
let c2 be augmenting Path of c1;
cluster FF:PushFlow a1,a2 -> real-yielding natural-yielding ;
coherence
FF:PushFlow c1,c2 is natural-yielding
proof end;
end;

definition
let c1 be real-weighted real-elabeled WEGraph;
let c2 be augmenting Path of c1;
func FF:AugmentPath c1,c2 -> real-weighted real-elabeled complete-elabeled WEGraph equals :: GLIB_005:def 21
a1 .set ELabelSelector ,(FF:PushFlow a1,a2);
coherence
c1 .set ELabelSelector ,(FF:PushFlow c1,c2) is real-weighted real-elabeled complete-elabeled WEGraph
;
end;

:: deftheorem Def21 defines FF:AugmentPath GLIB_005:def 21 :
for b1 being real-weighted real-elabeled WEGraph
for b2 being augmenting Path of b1 holds FF:AugmentPath b1,b2 = b1 .set ELabelSelector ,(FF:PushFlow b1,b2);

registration
let c1 be finite real-weighted real-elabeled WEGraph;
let c2 be augmenting Path of c1;
cluster FF:AugmentPath a1,a2 -> finite real-weighted real-elabeled complete-elabeled ;
coherence
FF:AugmentPath c1,c2 is finite
;
end;

registration
let c1 be finite nonnegative-weighted real-elabeled WEGraph;
let c2 be augmenting Path of c1;
cluster FF:AugmentPath a1,a2 -> finite real-weighted nonnegative-weighted real-elabeled complete-elabeled ;
coherence
FF:AugmentPath c1,c2 is nonnegative-weighted
;
end;

registration
let c1 be finite natural-weighted natural-elabeled WEGraph;
let c2 be augmenting Path of c1;
cluster FF:AugmentPath a1,a2 -> finite real-weighted nonnegative-weighted real-elabeled complete-elabeled natural-weighted natural-elabeled ;
coherence
( FF:AugmentPath c1,c2 is natural-weighted & FF:AugmentPath c1,c2 is natural-elabeled )
;
end;

definition
let c1 be finite real-weighted real-elabeled complete-elabeled WEGraph;
let c2, c3 be Vertex of c1;
func FF:Step c1,c3,c2 -> finite real-weighted real-elabeled complete-elabeled WEGraph equals :Def22: :: GLIB_005:def 22
FF:AugmentPath a1,(AP:GetAugPath a1,a3,a2) if a2 in (AP:FindAugPath a1,a3) .labeledV()
otherwise a1;
coherence
( ( c2 in (AP:FindAugPath c1,c3) .labeledV() implies FF:AugmentPath c1,(AP:GetAugPath c1,c3,c2) is finite real-weighted real-elabeled complete-elabeled WEGraph ) & ( not c2 in (AP:FindAugPath c1,c3) .labeledV() implies c1 is finite real-weighted real-elabeled complete-elabeled WEGraph ) )
;
consistency
for b1 being finite real-weighted real-elabeled complete-elabeled WEGraph holds verum
;
end;

:: deftheorem Def22 defines FF:Step GLIB_005:def 22 :
for b1 being finite real-weighted real-elabeled complete-elabeled WEGraph
for b2, b3 being Vertex of b1 holds
( ( b2 in (AP:FindAugPath b1,b3) .labeledV() implies FF:Step b1,b3,b2 = FF:AugmentPath b1,(AP:GetAugPath b1,b3,b2) ) & ( not b2 in (AP:FindAugPath b1,b3) .labeledV() implies FF:Step b1,b3,b2 = b1 ) );

registration
let c1 be finite nonnegative-weighted real-elabeled complete-elabeled WEGraph;
let c2, c3 be Vertex of c1;
cluster FF:Step a1,a2,a3 -> finite real-weighted nonnegative-weighted real-elabeled complete-elabeled ;
coherence
FF:Step c1,c2,c3 is nonnegative-weighted
proof end;
end;

registration
let c1 be finite complete-elabeled natural-weighted natural-elabeled WEGraph;
let c2, c3 be Vertex of c1;
cluster FF:Step a1,a2,a3 -> finite real-weighted nonnegative-weighted real-elabeled complete-elabeled natural-weighted natural-elabeled ;
coherence
( FF:Step c1,c2,c3 is natural-weighted & FF:Step c1,c2,c3 is natural-elabeled )
proof end;
end;

definition
let c1 be finite real-weighted WGraph;
let c2, c3 be Vertex of c1;
func FF:CompSeq c1,c2,c3 -> finite real-weighted real-elabeled complete-elabeled WEGraphSeq means :Def23: :: GLIB_005:def 23
( a4 .-> 0 = a1 .set ELabelSelector ,((the_Edges_of a1) --> 0) & ( for b1 being Nat ex b2, b3 being Vertex of (a4 .-> b1) st
( b2 = a2 & b3 = a3 & a4 .-> (b1 + 1) = FF:Step (a4 .-> b1),b2,b3 ) ) );
existence
ex b1 being finite real-weighted real-elabeled complete-elabeled WEGraphSeq st
( b1 .-> 0 = c1 .set ELabelSelector ,((the_Edges_of c1) --> 0) & ( for b2 being Nat ex b3, b4 being Vertex of (b1 .-> b2) st
( b3 = c2 & b4 = c3 & b1 .-> (b2 + 1) = FF:Step (b1 .-> b2),b3,b4 ) ) )
proof end;
uniqueness
for b1, b2 being finite real-weighted real-elabeled complete-elabeled WEGraphSeq st b1 .-> 0 = c1 .set ELabelSelector ,((the_Edges_of c1) --> 0) & ( for b3 being Nat ex b4, b5 being Vertex of (b1 .-> b3) st
( b4 = c2 & b5 = c3 & b1 .-> (b3 + 1) = FF:Step (b1 .-> b3),b4,b5 ) ) & b2 .-> 0 = c1 .set ELabelSelector ,((the_Edges_of c1) --> 0) & ( for b3 being Nat ex b4, b5 being Vertex of (b2 .-> b3) st
( b4 = c2 & b5 = c3 & b2 .-> (b3 + 1) = FF:Step (b2 .-> b3),b4,b5 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def23 defines FF:CompSeq GLIB_005:def 23 :
for b1 being finite real-weighted WGraph
for b2, b3 being Vertex of b1
for b4 being finite real-weighted real-elabeled complete-elabeled WEGraphSeq holds
( b4 = FF:CompSeq b1,b2,b3 iff ( b4 .-> 0 = b1 .set ELabelSelector ,((the_Edges_of b1) --> 0) & ( for b5 being Nat ex b6, b7 being Vertex of (b4 .-> b5) st
( b6 = b2 & b7 = b3 & b4 .-> (b5 + 1) = FF:Step (b4 .-> b5),b6,b7 ) ) ) );

registration
let c1 be finite nonnegative-weighted WGraph;
let c2, c3 be Vertex of c1;
cluster FF:CompSeq a1,a3,a2 -> finite real-weighted nonnegative-weighted real-elabeled complete-elabeled ;
coherence
FF:CompSeq c1,c3,c2 is nonnegative-weighted
proof end;
end;

registration
let c1 be finite natural-weighted WGraph;
let c2, c3 be Vertex of c1;
cluster FF:CompSeq a1,a3,a2 -> finite real-weighted nonnegative-weighted real-elabeled complete-elabeled natural-weighted natural-elabeled ;
coherence
( FF:CompSeq c1,c3,c2 is natural-weighted & FF:CompSeq c1,c3,c2 is natural-elabeled )
proof end;
end;

definition
let c1 be finite real-weighted WGraph;
let c2, c3 be Vertex of c1;
func FF:MaxFlow c1,c3,c2 -> finite real-weighted real-elabeled complete-elabeled WEGraph equals :: GLIB_005:def 24
(FF:CompSeq a1,a3,a2) .Result() ;
coherence
(FF:CompSeq c1,c3,c2) .Result() is finite real-weighted real-elabeled complete-elabeled WEGraph
proof end;
end;

:: deftheorem Def24 defines FF:MaxFlow GLIB_005:def 24 :
for b1 being finite real-weighted WGraph
for b2, b3 being Vertex of b1 holds FF:MaxFlow b1,b3,b2 = (FF:CompSeq b1,b3,b2) .Result() ;

theorem Th11: :: GLIB_005:11
for b1 being finite real-weighted real-elabeled complete-elabeled WEGraph
for b2, b3 being set
for b4 being Subset of (the_Vertices_of b1) st b1 has_valid_flow_from b2,b3 & b2 in b4 & not b3 in b4 holds
b1 .flow b2,b3 = (Sum ((the_ELabel_of b1) | (b1 .edgesDBetween b4,((the_Vertices_of b1) \ b4)))) - (Sum ((the_ELabel_of b1) | (b1 .edgesDBetween ((the_Vertices_of b1) \ b4),b4)))
proof end;

theorem Th12: :: GLIB_005:12
for b1 being finite real-weighted real-elabeled complete-elabeled WEGraph
for b2, b3 being set
for b4 being Subset of (the_Vertices_of b1) st b1 has_valid_flow_from b2,b3 & b2 in b4 & not b3 in b4 holds
b1 .flow b2,b3 <= Sum ((the_Weight_of b1) | (b1 .edgesDBetween b4,((the_Vertices_of b1) \ b4)))
proof end;

theorem Th13: :: GLIB_005:13
for b1 being real-weighted real-elabeled WEGraph
for b2 being augmenting Path of b1 holds
( b1 == FF:AugmentPath b1,b2 & the_Weight_of b1 = the_Weight_of (FF:AugmentPath b1,b2) ) by GLIB_003:11, GLIB_003:8;

theorem Th14: :: GLIB_005:14
for b1 being finite real-weighted real-elabeled WEGraph
for b2 being augmenting Walk of b1 st not b2 is trivial holds
0 < b2 .tolerance()
proof end;

theorem Th15: :: GLIB_005:15
for b1 being finite real-weighted real-elabeled complete-elabeled WEGraph
for b2, b3 being set
for b4 being augmenting Path of b1 st b2 <> b3 & b1 has_valid_flow_from b2,b3 & b4 is_Walk_from b2,b3 holds
FF:AugmentPath b1,b4 has_valid_flow_from b2,b3
proof end;

theorem Th16: :: GLIB_005:16
for b1 being finite real-weighted real-elabeled complete-elabeled WEGraph
for b2, b3 being set
for b4 being augmenting Path of b1 st b2 <> b3 & b1 has_valid_flow_from b2,b3 & b4 is_Walk_from b2,b3 holds
(b1 .flow b2,b3) + (b4 .tolerance() ) = (FF:AugmentPath b1,b4) .flow b2,b3
proof end;

theorem Th17: :: GLIB_005:17
for b1 being finite real-weighted WGraph
for b2, b3 being Vertex of b1
for b4 being Nat holds
( (FF:CompSeq b1,b2,b3) .-> b4 == b1 & the_Weight_of b1 = the_Weight_of ((FF:CompSeq b1,b2,b3) .-> b4) )
proof end;

theorem Th18: :: GLIB_005:18
for b1 being finite nonnegative-weighted WGraph
for b2, b3 being Vertex of b1
for b4 being Nat st b2 <> b3 holds
(FF:CompSeq b1,b2,b3) .-> b4 has_valid_flow_from b2,b3
proof end;

theorem Th19: :: GLIB_005:19
for b1 being finite natural-weighted WGraph
for b2, b3 being Vertex of b1 st b2 <> b3 holds
FF:CompSeq b1,b2,b3 is halting
proof end;

theorem Th20: :: GLIB_005:20
for b1 being finite real-weighted real-elabeled complete-elabeled WEGraph
for b2, b3 being set st b2 <> b3 & b1 has_valid_flow_from b2,b3 & ( for b4 being augmenting Path of b1 holds not b4 is_Walk_from b2,b3 ) holds
b1 has_maximum_flow_from b2,b3
proof end;

theorem Th21: :: GLIB_005:21
for b1 being finite real-weighted WGraph
for b2, b3 being Vertex of b1 holds
( b1 == FF:MaxFlow b1,b2,b3 & the_Weight_of b1 = the_Weight_of (FF:MaxFlow b1,b2,b3) )
proof end;

theorem Th22: :: GLIB_005:22
for b1 being finite natural-weighted WGraph
for b2, b3 being Vertex of b1 st b3 <> b2 holds
FF:MaxFlow b1,b2,b3 has_maximum_flow_from b2,b3
proof end;