let G be _finite natural-weighted WGraph; :: thesis: for EL being FF:ELabeling of G
for source, sink being set st EL has_valid_flow_from source,sink & ( for P being Path of G holds
( not P is_Walk_from source,sink or not P is_augmenting_wrt EL ) ) holds
EL has_maximum_flow_from source,sink

let EL be FF:ELabeling of G; :: thesis: for source, sink being set st EL has_valid_flow_from source,sink & ( for P being Path of G holds
( not P is_Walk_from source,sink or not P is_augmenting_wrt EL ) ) holds
EL has_maximum_flow_from source,sink

let source, sink be set ; :: thesis: ( EL has_valid_flow_from source,sink & ( for P being Path of G holds
( not P is_Walk_from source,sink or not P is_augmenting_wrt EL ) ) implies EL has_maximum_flow_from source,sink )

assume that
A1: EL has_valid_flow_from source,sink and
A2: for P being Path of G holds
( not P is_Walk_from source,sink or not P is_augmenting_wrt EL ) ; :: thesis: EL has_maximum_flow_from source,sink
reconsider src = source as Vertex of G by A1;
set CS = AP:CompSeq (EL,src);
set Gn = AP:FindAugPath (EL,src);
set Gn1 = (AP:CompSeq (EL,src)) . (((AP:CompSeq (EL,src)) .Lifespan()) + 1);
reconsider V = dom (AP:FindAugPath (EL,src)) as Subset of (the_Vertices_of G) ;
set E1 = G .edgesDBetween (V,((the_Vertices_of G) \ V));
set A1 = EL | (G .edgesDBetween (V,((the_Vertices_of G) \ V)));
set B1 = (the_Weight_of G) | (G .edgesDBetween (V,((the_Vertices_of G) \ V)));
set e = the Element of AP:NextBestEdges (AP:FindAugPath (EL,src));
AP:CompSeq (EL,src) is halting by Th6;
then A3: (AP:CompSeq (EL,src)) . (((AP:CompSeq (EL,src)) .Lifespan()) + 1) = AP:FindAugPath (EL,src) by GLIB_000:def 56;
A4: (AP:CompSeq (EL,src)) . (((AP:CompSeq (EL,src)) .Lifespan()) + 1) = AP:Step (AP:FindAugPath (EL,src)) by Def12;
A5: now :: thesis: not AP:NextBestEdges (AP:FindAugPath (EL,src)) <> {}
assume A6: AP:NextBestEdges (AP:FindAugPath (EL,src)) <> {} ; :: thesis: contradiction
now :: thesis: contradictionend;
hence contradiction ; :: thesis: verum
end;
A10: now :: thesis: for x being set st x in G .edgesDBetween (V,((the_Vertices_of G) \ V)) holds
(EL | (G .edgesDBetween (V,((the_Vertices_of G) \ V)))) . x = ((the_Weight_of G) | (G .edgesDBetween (V,((the_Vertices_of G) \ V)))) . x
let x be set ; :: thesis: ( x in G .edgesDBetween (V,((the_Vertices_of G) \ V)) implies (EL | (G .edgesDBetween (V,((the_Vertices_of G) \ V)))) . x = ((the_Weight_of G) | (G .edgesDBetween (V,((the_Vertices_of G) \ V)))) . x )
assume A11: x in G .edgesDBetween (V,((the_Vertices_of G) \ V)) ; :: thesis: (EL | (G .edgesDBetween (V,((the_Vertices_of G) \ V)))) . x = ((the_Weight_of G) | (G .edgesDBetween (V,((the_Vertices_of G) \ V)))) . x
then A12: (EL | (G .edgesDBetween (V,((the_Vertices_of G) \ V)))) . x = EL . x by FUNCT_1:49;
A13: x DSJoins V,(the_Vertices_of G) \ V,G by A11, GLIB_000:def 31;
then (the_Target_of G) . x in (the_Vertices_of G) \ V ;
then A14: not (the_Target_of G) . x in V by XBOOLE_0:def 5;
A15: ((the_Weight_of G) | (G .edgesDBetween (V,((the_Vertices_of G) \ V)))) . x = (the_Weight_of G) . x by A11, FUNCT_1:49;
A16: (the_Source_of G) . x in V by A13;
A17: now :: thesis: not (EL | (G .edgesDBetween (V,((the_Vertices_of G) \ V)))) . x < ((the_Weight_of G) | (G .edgesDBetween (V,((the_Vertices_of G) \ V)))) . xend;
(EL | (G .edgesDBetween (V,((the_Vertices_of G) \ V)))) . x <= ((the_Weight_of G) | (G .edgesDBetween (V,((the_Vertices_of G) \ V)))) . x by A1, A11, A12, A15;
hence (EL | (G .edgesDBetween (V,((the_Vertices_of G) \ V)))) . x = ((the_Weight_of G) | (G .edgesDBetween (V,((the_Vertices_of G) \ V)))) . x by A17, XXREAL_0:1; :: thesis: verum
end;
set E2 = G .edgesDBetween (((the_Vertices_of G) \ V),V);
set A2 = EL | (G .edgesDBetween (((the_Vertices_of G) \ V),V));
set B2 = EmptyBag (G .edgesDBetween (((the_Vertices_of G) \ V),V));
now :: thesis: for x being set st x in G .edgesDBetween (((the_Vertices_of G) \ V),V) holds
(EL | (G .edgesDBetween (((the_Vertices_of G) \ V),V))) . x = (EmptyBag (G .edgesDBetween (((the_Vertices_of G) \ V),V))) . x
end;
then Sum (EL | (G .edgesDBetween (((the_Vertices_of G) \ V),V))) = Sum (EmptyBag (G .edgesDBetween (((the_Vertices_of G) \ V),V))) by GLIB_004:6;
then A24: Sum (EL | (G .edgesDBetween (((the_Vertices_of G) \ V),V))) = 0 by UPROOTS:11;
A25: not sink in dom (AP:FindAugPath (EL,src)) by A2, Th9;
then EL .flow (source,sink) = (Sum (EL | (G .edgesDBetween (V,((the_Vertices_of G) \ V))))) - (Sum (EL | (G .edgesDBetween (((the_Vertices_of G) \ V),V)))) by A1, Th10, Th11;
then EL .flow (source,sink) = Sum ((the_Weight_of G) | (G .edgesDBetween (V,((the_Vertices_of G) \ V)))) by A10, A24, GLIB_004:6;
then for X being FF:ELabeling of G st X has_valid_flow_from source,sink holds
X .flow (source,sink) <= EL .flow (source,sink) by A25, Th10, Th12;
hence EL has_maximum_flow_from source,sink by A1; :: thesis: verum