let G be _finite natural-weighted WGraph; for EL being FF:ELabeling of G
for source, sink being set
for P being Path of G st source <> sink & P is_Walk_from source,sink & P is_augmenting_wrt EL holds
(EL .flow (source,sink)) + (P .tolerance EL) = (FF:PushFlow (EL,P)) .flow (source,sink)
let EL be FF:ELabeling of G; for source, sink being set
for P being Path of G st source <> sink & P is_Walk_from source,sink & P is_augmenting_wrt EL holds
(EL .flow (source,sink)) + (P .tolerance EL) = (FF:PushFlow (EL,P)) .flow (source,sink)
let source, sink be set ; for P being Path of G st source <> sink & P is_Walk_from source,sink & P is_augmenting_wrt EL holds
(EL .flow (source,sink)) + (P .tolerance EL) = (FF:PushFlow (EL,P)) .flow (source,sink)
let P be Path of G; ( source <> sink & P is_Walk_from source,sink & P is_augmenting_wrt EL implies (EL .flow (source,sink)) + (P .tolerance EL) = (FF:PushFlow (EL,P)) .flow (source,sink) )
assume that
A1:
source <> sink
and
A2:
P is_Walk_from source,sink
and
A3:
P is_augmenting_wrt EL
; (EL .flow (source,sink)) + (P .tolerance EL) = (FF:PushFlow (EL,P)) .flow (source,sink)
A4:
P .last() = sink
by A2, GLIB_001:def 23;
P .first() = source
by A2, GLIB_001:def 23;
then
P is trivial
by A1, A4, GLIB_001:127;
then
3 <= len P
by GLIB_001:125;
then reconsider lenP2g = (len P) - (2 * 1) as odd Element of NAT by INT_1:5, XXREAL_0:2;
set e1 = P . (lenP2g + 1);
set EI1 = EL | (G .edgesInto {sink});
set EO1 = EL | (G .edgesOutOf {sink});
set EL2 = FF:PushFlow (EL,P);
set T = P .tolerance EL;
A5:
P . (len P) = sink
by A2, GLIB_001:17;
A6:
lenP2g < (len P) - 0
by XREAL_1:15;
then A7:
P . (lenP2g + 1) Joins P . lenP2g,P . (lenP2g + 2),G
by GLIB_001:def 3;
then A8:
P . (lenP2g + 1) in the_Edges_of G
;
now (FF:PushFlow (EL,P)) .flow (source,sink) = (EL .flow (source,sink)) + (P .tolerance EL)per cases
( P . (lenP2g + 1) DJoins P . lenP2g,P . (lenP2g + 2),G or not P . (lenP2g + 1) DJoins P . lenP2g,P . (lenP2g + 2),G )
;
suppose A9:
P . (lenP2g + 1) DJoins P . lenP2g,
P . (lenP2g + 2),
G
;
(FF:PushFlow (EL,P)) .flow (source,sink) = (EL .flow (source,sink)) + (P .tolerance EL)then (the_Target_of G) . (P . (lenP2g + 1)) =
P . (lenP2g + 2)
.=
sink
by A2, GLIB_001:17
;
then
(the_Target_of G) . (P . (lenP2g + 1)) in {sink}
by TARSKI:def 1;
then A10:
P . (lenP2g + 1) in G .edgesInto {sink}
by A8, GLIB_000:def 26;
set EI2 =
(EL | (G .edgesInto {sink})) +* ((P . (lenP2g + 1)) .--> (((EL | (G .edgesInto {sink})) . (P . (lenP2g + 1))) + (P .tolerance EL)));
A11:
dom ((FF:PushFlow (EL,P)) | (G .edgesInto {sink})) = G .edgesInto {sink}
by PARTFUN1:def 2;
A12:
dom ((EL | (G .edgesInto {sink})) +* ((P . (lenP2g + 1)) .--> (((EL | (G .edgesInto {sink})) . (P . (lenP2g + 1))) + (P .tolerance EL)))) =
(dom (EL | (G .edgesInto {sink}))) \/ (dom ((P . (lenP2g + 1)) .--> (((EL | (G .edgesInto {sink})) . (P . (lenP2g + 1))) + (P .tolerance EL))))
by FUNCT_4:def 1
.=
(dom (EL | (G .edgesInto {sink}))) \/ {(P . (lenP2g + 1))}
.=
(G .edgesInto {sink}) \/ {(P . (lenP2g + 1))}
by PARTFUN1:def 2
.=
G .edgesInto {sink}
by A10, ZFMISC_1:40
;
then reconsider EI2 =
(EL | (G .edgesInto {sink})) +* ((P . (lenP2g + 1)) .--> (((EL | (G .edgesInto {sink})) . (P . (lenP2g + 1))) + (P .tolerance EL))) as
Rbag of
G .edgesInto {sink} by PARTFUN1:def 2, RELAT_1:def 18;
A13:
(FF:PushFlow (EL,P)) . (P . (lenP2g + 1)) = (EL . (P . (lenP2g + 1))) + (P .tolerance EL)
by A3, A6, A9, Def17;
then A29:
Sum ((FF:PushFlow (EL,P)) | (G .edgesInto {sink})) =
((Sum (EL | (G .edgesInto {sink}))) + ((P .tolerance EL) + ((EL | (G .edgesInto {sink})) . (P . (lenP2g + 1))))) - ((EL | (G .edgesInto {sink})) . (P . (lenP2g + 1)))
by A12, A11, FUNCT_1:2, GLIB_004:9
.=
(Sum (EL | (G .edgesInto {sink}))) + (P .tolerance EL)
;
A30:
dom ((FF:PushFlow (EL,P)) | (G .edgesOutOf {sink})) = G .edgesOutOf {sink}
by PARTFUN1:def 2;
A31:
now for e being object st e in dom ((FF:PushFlow (EL,P)) | (G .edgesOutOf {sink})) holds
((FF:PushFlow (EL,P)) | (G .edgesOutOf {sink})) . e = (EL | (G .edgesOutOf {sink})) . elet e be
object ;
( e in dom ((FF:PushFlow (EL,P)) | (G .edgesOutOf {sink})) implies ((FF:PushFlow (EL,P)) | (G .edgesOutOf {sink})) . e = (EL | (G .edgesOutOf {sink})) . e )assume A32:
e in dom ((FF:PushFlow (EL,P)) | (G .edgesOutOf {sink}))
;
((FF:PushFlow (EL,P)) | (G .edgesOutOf {sink})) . e = (EL | (G .edgesOutOf {sink})) . ethen A33:
e in G .edgesOutOf {sink}
;
then
(the_Source_of G) . e in {sink}
by GLIB_000:def 27;
then A34:
(the_Source_of G) . e = sink
by TARSKI:def 1;
now not e in P .edges() assume
e in P .edges()
;
contradictionthen consider v1,
v2 being
Vertex of
G,
m being
odd Element of
NAT such that A35:
m + 2
<= len P
and A36:
v1 = P . m
and A37:
e = P . (m + 1)
and A38:
v2 = P . (m + 2)
and A39:
e Joins v1,
v2,
G
by GLIB_001:103;
now contradictionper cases
( v1 = sink or v2 = sink )
by A34, A39;
suppose A40:
v1 = sink
;
contradictionend; suppose
v2 = sink
;
contradictionthen A42:
P . (m + 2) = P . (len P)
by A2, A38, GLIB_001:17;
then
m + 2
= len P
by A35, XXREAL_0:1;
then A43:
P . lenP2g = sink
by A9, A34, A37;
then
lenP2g = 1
by A6, A5, GLIB_001:def 28;
hence
contradiction
by A1, A2, A43, GLIB_001:17;
verum end; end; end; hence
contradiction
;
verum end; then (FF:PushFlow (EL,P)) . e =
EL . e
by A3, A33, Def17
.=
(EL | (G .edgesOutOf {sink})) . e
by A33, FUNCT_1:49
;
hence
((FF:PushFlow (EL,P)) | (G .edgesOutOf {sink})) . e = (EL | (G .edgesOutOf {sink})) . e
by A32, FUNCT_1:49;
verum end;
dom (EL | (G .edgesOutOf {sink})) = G .edgesOutOf {sink}
by PARTFUN1:def 2;
hence (FF:PushFlow (EL,P)) .flow (
source,
sink) =
((Sum (EL | (G .edgesInto {sink}))) + (P .tolerance EL)) - (Sum (EL | (G .edgesOutOf {sink})))
by A29, A30, A31, FUNCT_1:2
.=
((Sum (EL | (G .edgesInto {sink}))) - (Sum (EL | (G .edgesOutOf {sink})))) + (P .tolerance EL)
.=
(EL .flow (source,sink)) + (P .tolerance EL)
;
verum end; suppose A44:
not
P . (lenP2g + 1) DJoins P . lenP2g,
P . (lenP2g + 2),
G
;
(FF:PushFlow (EL,P)) .flow (source,sink) = (EL .flow (source,sink)) + (P .tolerance EL)then A45:
P . (lenP2g + 1) DJoins P . (lenP2g + 2),
P . lenP2g,
G
by A7;
then (the_Source_of G) . (P . (lenP2g + 1)) =
P . (lenP2g + 2)
.=
sink
by A2, GLIB_001:17
;
then
(the_Source_of G) . (P . (lenP2g + 1)) in {sink}
by TARSKI:def 1;
then A46:
P . (lenP2g + 1) in G .edgesOutOf {sink}
by A8, GLIB_000:def 27;
set EO2 =
(EL | (G .edgesOutOf {sink})) +* ((P . (lenP2g + 1)) .--> (((EL | (G .edgesOutOf {sink})) . (P . (lenP2g + 1))) - (P .tolerance EL)));
A47:
dom ((FF:PushFlow (EL,P)) | (G .edgesOutOf {sink})) = G .edgesOutOf {sink}
by PARTFUN1:def 2;
A48:
dom ((EL | (G .edgesOutOf {sink})) +* ((P . (lenP2g + 1)) .--> (((EL | (G .edgesOutOf {sink})) . (P . (lenP2g + 1))) - (P .tolerance EL)))) =
(dom (EL | (G .edgesOutOf {sink}))) \/ (dom ((P . (lenP2g + 1)) .--> (((EL | (G .edgesOutOf {sink})) . (P . (lenP2g + 1))) - (P .tolerance EL))))
by FUNCT_4:def 1
.=
(dom (EL | (G .edgesOutOf {sink}))) \/ {(P . (lenP2g + 1))}
.=
(G .edgesOutOf {sink}) \/ {(P . (lenP2g + 1))}
by PARTFUN1:def 2
.=
G .edgesOutOf {sink}
by A46, ZFMISC_1:40
;
then reconsider EO2 =
(EL | (G .edgesOutOf {sink})) +* ((P . (lenP2g + 1)) .--> (((EL | (G .edgesOutOf {sink})) . (P . (lenP2g + 1))) - (P .tolerance EL))) as
Rbag of
G .edgesOutOf {sink} by PARTFUN1:def 2, RELAT_1:def 18;
A49:
(FF:PushFlow (EL,P)) . (P . (lenP2g + 1)) = (EL . (P . (lenP2g + 1))) - (P .tolerance EL)
by A3, A6, A44, Def17;
then A65:
Sum ((FF:PushFlow (EL,P)) | (G .edgesOutOf {sink})) =
((Sum (EL | (G .edgesOutOf {sink}))) + (((EL | (G .edgesOutOf {sink})) . (P . (lenP2g + 1))) - (P .tolerance EL))) - ((EL | (G .edgesOutOf {sink})) . (P . (lenP2g + 1)))
by A48, A47, FUNCT_1:2, GLIB_004:9
.=
(Sum (EL | (G .edgesOutOf {sink}))) - (P .tolerance EL)
;
A66:
dom ((FF:PushFlow (EL,P)) | (G .edgesInto {sink})) = G .edgesInto {sink}
by PARTFUN1:def 2;
A67:
now for e being object st e in dom ((FF:PushFlow (EL,P)) | (G .edgesInto {sink})) holds
((FF:PushFlow (EL,P)) | (G .edgesInto {sink})) . e = (EL | (G .edgesInto {sink})) . elet e be
object ;
( e in dom ((FF:PushFlow (EL,P)) | (G .edgesInto {sink})) implies ((FF:PushFlow (EL,P)) | (G .edgesInto {sink})) . e = (EL | (G .edgesInto {sink})) . e )assume A68:
e in dom ((FF:PushFlow (EL,P)) | (G .edgesInto {sink}))
;
((FF:PushFlow (EL,P)) | (G .edgesInto {sink})) . e = (EL | (G .edgesInto {sink})) . ethen A69:
e in G .edgesInto {sink}
;
then
(the_Target_of G) . e in {sink}
by GLIB_000:def 26;
then A70:
(the_Target_of G) . e = sink
by TARSKI:def 1;
now not e in P .edges() assume
e in P .edges()
;
contradictionthen consider v1,
v2 being
Vertex of
G,
m being
odd Element of
NAT such that A71:
m + 2
<= len P
and A72:
v1 = P . m
and A73:
e = P . (m + 1)
and A74:
v2 = P . (m + 2)
and A75:
e Joins v1,
v2,
G
by GLIB_001:103;
now contradictionper cases
( v1 = sink or v2 = sink )
by A70, A75;
suppose A76:
v1 = sink
;
contradictionend; suppose
v2 = sink
;
contradictionthen A78:
P . (m + 2) = P . (len P)
by A2, A74, GLIB_001:17;
then
m + 2
= len P
by A71, XXREAL_0:1;
then A79:
P . lenP2g = sink
by A45, A70, A73;
then
lenP2g = 1
by A6, A5, GLIB_001:def 28;
hence
contradiction
by A1, A2, A79, GLIB_001:17;
verum end; end; end; hence
contradiction
;
verum end; then (FF:PushFlow (EL,P)) . e =
EL . e
by A3, A69, Def17
.=
(EL | (G .edgesInto {sink})) . e
by A69, FUNCT_1:49
;
hence
((FF:PushFlow (EL,P)) | (G .edgesInto {sink})) . e = (EL | (G .edgesInto {sink})) . e
by A68, FUNCT_1:49;
verum end;
dom (EL | (G .edgesInto {sink})) = G .edgesInto {sink}
by PARTFUN1:def 2;
hence (FF:PushFlow (EL,P)) .flow (
source,
sink) =
(Sum (EL | (G .edgesInto {sink}))) - ((Sum (EL | (G .edgesOutOf {sink}))) - (P .tolerance EL))
by A65, A66, A67, FUNCT_1:2
.=
((Sum (EL | (G .edgesInto {sink}))) - (Sum (EL | (G .edgesOutOf {sink})))) + (P .tolerance EL)
.=
(EL .flow (source,sink)) + (P .tolerance EL)
;
verum end; end; end;
hence
(EL .flow (source,sink)) + (P .tolerance EL) = (FF:PushFlow (EL,P)) .flow (source,sink)
; verum