:: GLIB_005 semantic presentation
:: deftheorem Def1 defines complete-elabeled GLIB_005:def 1 :
:: deftheorem Def2 defines complete-elabeled GLIB_005:def 2 :
:: deftheorem Def3 defines natural-weighted GLIB_005:def 3 :
:: deftheorem Def4 defines natural-elabeled GLIB_005:def 4 :
:: deftheorem Def5 defines natural-weighted GLIB_005:def 5 :
:: deftheorem Def6 defines natural-elabeled GLIB_005:def 6 :
:: deftheorem Def7 defines has_valid_flow_from GLIB_005:def 7 :
:: deftheorem Def8 defines .flow GLIB_005:def 8 :
:: deftheorem Def9 defines has_maximum_flow_from GLIB_005:def 9 :
:: deftheorem Def10 defines is_forward_labeling_in GLIB_005:def 10 :
:: deftheorem Def11 defines is_backward_labeling_in GLIB_005:def 11 :
:: deftheorem Def12 defines augmenting GLIB_005:def 12 :
theorem Th1: :: GLIB_005:1
theorem Th2: :: GLIB_005:2
:: deftheorem Def13 defines AP:NextBestEdges GLIB_005:def 13 :
:: deftheorem Def14 defines AP:Step GLIB_005:def 14 :
:: deftheorem Def15 defines AP:CompSeq GLIB_005:def 15 :
theorem Th3: :: GLIB_005:3
theorem Th4: :: GLIB_005:4
theorem Th5: :: GLIB_005:5
:: deftheorem Def16 defines AP:FindAugPath GLIB_005:def 16 :
theorem Th6: :: GLIB_005:6
theorem Th7: :: GLIB_005:7
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 ) )
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 ) )
consistency
for b1 being vertex-distinct augmenting Path of c1 holds verum
;
end;
:: deftheorem Def17 defines AP:GetAugPath GLIB_005:def 17 :
theorem Th8: :: GLIB_005:8
theorem Th9: :: GLIB_005:9
theorem Th10: :: GLIB_005:10
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)) ) ) ) )
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
end;
:: deftheorem Def18 defines .flowSeq() GLIB_005:def 18 :
:: deftheorem Def19 defines .tolerance() GLIB_005:def 19 :
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() ) ) ) ) )
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
end;
:: deftheorem Def20 defines FF:PushFlow GLIB_005:def 20 :
:: deftheorem Def21 defines FF:AugmentPath GLIB_005:def 21 :
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 ) );
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 ) ) )
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
end;
:: deftheorem Def23 defines FF:CompSeq GLIB_005:def 23 :
:: deftheorem Def24 defines FF:MaxFlow GLIB_005:def 24 :
theorem Th11: :: GLIB_005:11
theorem Th12: :: GLIB_005:12
theorem Th13: :: GLIB_005:13
theorem Th14: :: GLIB_005:14
theorem Th15: :: GLIB_005:15
theorem Th16: :: GLIB_005:16
theorem Th17: :: GLIB_005:17
theorem Th18: :: GLIB_005:18
theorem Th19: :: GLIB_005:19
theorem Th20: :: GLIB_005:20
theorem Th21: :: GLIB_005:21
theorem Th22: :: GLIB_005:22