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
not P is trivial
by A1, A4, GLIB_001:128;
then
3 <= len P
by GLIB_001:126;
then reconsider lenP2g = (len P) - (2 * 1) as odd Element of NAT by INT_1:18, 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:18;
A6:
lenP2g < (len P) - 0
by XREAL_1:17;
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
by GLIB_000:def 15;
now 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)
by GLIB_000:def 16
.=
sink
by A2, GLIB_001:18
;
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 28;
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 4;
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))}
by FUNCOP_1:19
.=
(G .edgesInto {sink}) \/ {(P . (lenP2g + 1))}
by PARTFUN1:def 4
.=
G .edgesInto {sink}
by A10, ZFMISC_1:46
;
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 4, RELAT_1:def 18;
A13:
(FF:PushFlow EL,P) . (P . (lenP2g + 1)) = (EL . (P . (lenP2g + 1))) + (P .tolerance EL)
by A3, A6, A9, Def17;
now let e be
set ;
( e in dom ((FF:PushFlow EL,P) | (G .edgesInto {sink})) implies ((FF:PushFlow EL,P) | (G .edgesInto {sink})) . e = EI2 . e )assume A14:
e in dom ((FF:PushFlow EL,P) | (G .edgesInto {sink}))
;
((FF:PushFlow EL,P) | (G .edgesInto {sink})) . e = EI2 . ethen A15:
e in G .edgesInto {sink}
by PARTFUN1:def 4;
A16:
((FF:PushFlow EL,P) | (G .edgesInto {sink})) . e = (FF:PushFlow EL,P) . e
by A11, A14, FUNCT_1:72;
(the_Target_of G) . e in {sink}
by A15, GLIB_000:def 28;
then A17:
(the_Target_of G) . e = sink
by TARSKI:def 1;
hence
((FF:PushFlow EL,P) | (G .edgesInto {sink})) . e = EI2 . e
;
verum end; 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:9, 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 4;
A31:
now let e be
set ;
( 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}
by PARTFUN1:def 4;
then
(the_Source_of G) . e in {sink}
by GLIB_000:def 29;
then A34:
(the_Source_of G) . e = sink
by TARSKI:def 1;
now 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:104;
now per cases
( v1 = sink or v2 = sink )
by A34, A39, GLIB_000:def 15;
suppose A40:
v1 = sink
;
contradictionend; suppose
v2 = sink
;
contradictionthen A42:
P . (m + 2) = P . (len P)
by A2, A38, GLIB_001:18;
then
m + 2
= len P
by A35, XXREAL_0:1;
then A43:
P . lenP2g = sink
by A9, A34, A37, GLIB_000:def 16;
then
lenP2g = 1
by A6, A5, GLIB_001:def 28;
hence
contradiction
by A1, A2, A43, GLIB_001:18;
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:72
;
hence
((FF:PushFlow EL,P) | (G .edgesOutOf {sink})) . e = (EL | (G .edgesOutOf {sink})) . e
by A30, A32, FUNCT_1:72;
verum end;
dom (EL | (G .edgesOutOf {sink})) = G .edgesOutOf {sink}
by PARTFUN1:def 4;
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:9
.=
((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, GLIB_000:19;
then (the_Source_of G) . (P . (lenP2g + 1)) =
P . (lenP2g + 2)
by GLIB_000:def 16
.=
sink
by A2, GLIB_001:18
;
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 29;
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 4;
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))}
by FUNCOP_1:19
.=
(G .edgesOutOf {sink}) \/ {(P . (lenP2g + 1))}
by PARTFUN1:def 4
.=
G .edgesOutOf {sink}
by A46, ZFMISC_1:46
;
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 4, RELAT_1:def 18;
A49:
(FF:PushFlow EL,P) . (P . (lenP2g + 1)) = (EL . (P . (lenP2g + 1))) - (P .tolerance EL)
by A3, A6, A44, Def17;
now let e be
set ;
( e in dom ((FF:PushFlow EL,P) | (G .edgesOutOf {sink})) implies ((FF:PushFlow EL,P) | (G .edgesOutOf {sink})) . e = EO2 . e )assume A50:
e in dom ((FF:PushFlow EL,P) | (G .edgesOutOf {sink}))
;
((FF:PushFlow EL,P) | (G .edgesOutOf {sink})) . e = EO2 . ethen A51:
e in G .edgesOutOf {sink}
by PARTFUN1:def 4;
A52:
((FF:PushFlow EL,P) | (G .edgesOutOf {sink})) . e = (FF:PushFlow EL,P) . e
by A47, A50, FUNCT_1:72;
(the_Source_of G) . e in {sink}
by A51, GLIB_000:def 29;
then A53:
(the_Source_of G) . e = sink
by TARSKI:def 1;
hence
((FF:PushFlow EL,P) | (G .edgesOutOf {sink})) . e = EO2 . e
;
verum end; 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:9, 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 4;
A67:
now let e be
set ;
( 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}
by PARTFUN1:def 4;
then
(the_Target_of G) . e in {sink}
by GLIB_000:def 28;
then A70:
(the_Target_of G) . e = sink
by TARSKI:def 1;
now 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:104;
now per cases
( v1 = sink or v2 = sink )
by A70, A75, GLIB_000:def 15;
suppose A76:
v1 = sink
;
contradictionend; suppose
v2 = sink
;
contradictionthen A78:
P . (m + 2) = P . (len P)
by A2, A74, GLIB_001:18;
then
m + 2
= len P
by A71, XXREAL_0:1;
then A79:
P . lenP2g = sink
by A45, A70, A73, GLIB_000:def 16;
then
lenP2g = 1
by A6, A5, GLIB_001:def 28;
hence
contradiction
by A1, A2, A79, GLIB_001:18;
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:72
;
hence
((FF:PushFlow EL,P) | (G .edgesInto {sink})) . e = (EL | (G .edgesInto {sink})) . e
by A66, A68, FUNCT_1:72;
verum end;
dom (EL | (G .edgesInto {sink})) = G .edgesInto {sink}
by PARTFUN1:def 4;
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:9
.=
((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