:: 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 c
1 be
finite real-weighted real-elabeled WEGraph;
let c
2, c
3 be
Vertex of c
1;
func AP:GetAugPath c
1,c
2,c
3 -> vertex-distinct augmenting Path of a
1 means :
Def17:
:: GLIB_005:def 17
( a
4 is_Walk_from a
2,a
3 & ( for b
1 being
even Nat holds
( b
1 in dom a
4 implies a
4 . b
1 = (the_VLabel_of (AP:FindAugPath a1,a2)) . (a4 . (b1 + 1)) ) ) )
if a
3 in (AP:FindAugPath a1,a2) .labeledV() otherwise a
4 = a
1 .walkOf a
2;
existence
( not ( c3 in (AP:FindAugPath c1,c2) .labeledV() & ( for b1 being vertex-distinct augmenting Path of c1 holds
not ( b1 is_Walk_from c2,c3 & ( for b2 being even Nat holds
( b2 in dom b1 implies b1 . b2 = (the_VLabel_of (AP:FindAugPath c1,c2)) . (b1 . (b2 + 1)) ) ) ) ) ) & not ( not c3 in (AP:FindAugPath c1,c2) .labeledV() & ( for b1 being vertex-distinct augmenting Path of c1 holds
not 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 holds
( b3 in dom b1 implies b1 . b3 = (the_VLabel_of (AP:FindAugPath c1,c2)) . (b1 . (b3 + 1)) ) ) & b2 is_Walk_from c2,c3 & ( for b3 being even Nat holds
( b3 in dom b2 implies 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 c
1 be
real-weighted real-elabeled WEGraph;
let c
2 be
augmenting Walk of c
1;
func c
2 .flowSeq() -> FinSequence of
REAL means :
Def18:
:: GLIB_005:def 18
(
dom a
3 = dom (a2 .edgeSeq() ) & ( for b
1 being
Nat holds
( b
1 in dom a
3 implies ( ( a
2 . (2 * b1) DJoins a
2 . ((2 * b1) - 1),a
2 . ((2 * b1) + 1),a
1 implies a
3 . b
1 = ((the_Weight_of a1) . (a2 . (2 * b1))) - ((the_ELabel_of a1) . (a2 . (2 * b1))) ) & ( not a
2 . (2 * b1) DJoins a
2 . ((2 * b1) - 1),a
2 . ((2 * b1) + 1),a
1 implies a
3 . b
1 = (the_ELabel_of a1) . (a2 . (2 * b1)) ) ) ) ) );
existence
ex b1 being FinSequence of REAL st
( dom b1 = dom (c2 .edgeSeq() ) & ( for b2 being Nat holds
( b2 in dom b1 implies ( ( 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 holds
( dom b1 = dom (c2 .edgeSeq() ) & ( for b3 being Nat holds
( b3 in dom b1 implies ( ( 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 holds
( b3 in dom b2 implies ( ( 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)) ) ) ) ) implies b1 = b2 )
end;
:: deftheorem Def18 defines .flowSeq() GLIB_005:def 18 :
:: deftheorem Def19 defines .tolerance() GLIB_005:def 19 :
definition
let c
1 be
real-weighted real-elabeled WEGraph;
let c
2 be
augmenting Path of c
1;
func FF:PushFlow c
1,c
2 -> ManySortedSet of
the_Edges_of a
1 means :
Def20:
:: GLIB_005:def 20
( ( for b
1 being
set holds
( b
1 in the_Edges_of a
1 & not b
1 in a
2 .edges() implies a
3 . b
1 = (the_ELabel_of a1) . b
1 ) ) & ( for b
1 being
odd Nat holds
( b
1 < len a
2 implies ( ( a
2 . (b1 + 1) DJoins a
2 . b
1,a
2 . (b1 + 2),a
1 implies a
3 . (a2 . (b1 + 1)) = ((the_ELabel_of a1) . (a2 . (b1 + 1))) + (a2 .tolerance() ) ) & ( not a
2 . (b1 + 1) DJoins a
2 . b
1,a
2 . (b1 + 2),a
1 implies a
3 . (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 holds
( b2 in the_Edges_of c1 & not b2 in c2 .edges() implies b1 . b2 = (the_ELabel_of c1) . b2 ) ) & ( for b2 being odd Nat holds
( b2 < len c2 implies ( ( 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 holds
( ( for b3 being set holds
( b3 in the_Edges_of c1 & not b3 in c2 .edges() implies b1 . b3 = (the_ELabel_of c1) . b3 ) ) & ( for b3 being odd Nat holds
( b3 < len c2 implies ( ( 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 holds
( b3 in the_Edges_of c1 & not b3 in c2 .edges() implies b2 . b3 = (the_ELabel_of c1) . b3 ) ) & ( for b3 being odd Nat holds
( b3 < len c2 implies ( ( 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() ) ) ) ) ) implies b1 = b2 )
end;
:: deftheorem Def20 defines FF:PushFlow GLIB_005:def 20 :
:: deftheorem Def21 defines FF:AugmentPath GLIB_005:def 21 :
definition
let c
1 be
finite real-weighted real-elabeled complete-elabeled WEGraph;
let c
2, c
3 be
Vertex of c
1;
func FF:Step c
1,c
3,c
2 -> finite real-weighted real-elabeled complete-elabeled WEGraph equals :
Def22:
:: GLIB_005:def 22
FF:AugmentPath a
1,
(AP:GetAugPath a1,a3,a2) if a
2 in (AP:FindAugPath a1,a3) .labeledV() otherwise a
1;
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 b
1 being
finite real-weighted real-elabeled complete-elabeled WEGraphfor b
2, b
3 being
Vertex of b
1 holds
( ( b
2 in (AP:FindAugPath b1,b3) .labeledV() implies
FF:Step b
1,b
3,b
2 = FF:AugmentPath b
1,
(AP:GetAugPath b1,b3,b2) ) & ( not b
2 in (AP:FindAugPath b1,b3) .labeledV() implies
FF:Step b
1,b
3,b
2 = b
1 ) );
definition
let c
1 be
finite real-weighted WGraph;
let c
2, c
3 be
Vertex of c
1;
func FF:CompSeq c
1,c
2,c
3 -> finite real-weighted real-elabeled complete-elabeled WEGraphSeq means :
Def23:
:: GLIB_005:def 23
( a
4 .-> 0
= a
1 .set ELabelSelector ,
((the_Edges_of a1) --> 0) & ( for b
1 being
Nat holds
ex b
2, b
3 being
Vertex of
(a4 .-> b1) st
( b
2 = a
2 & b
3 = a
3 & a
4 .-> (b1 + 1) = FF:Step (a4 .-> b1),b
2,b
3 ) ) );
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 holds
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 holds
( b1 .-> 0 = c1 .set ELabelSelector ,((the_Edges_of c1) --> 0) & ( for b3 being Nat holds
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 holds
ex b4, b5 being Vertex of (b2 .-> b3) st
( b4 = c2 & b5 = c3 & b2 .-> (b3 + 1) = FF:Step (b2 .-> b3),b4,b5 ) ) implies 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