:: GLIB_004 semantic presentation
theorem Th1: :: GLIB_004:1
theorem Th2: :: GLIB_004:2
theorem Th3: :: GLIB_004:3
theorem Th4: :: GLIB_004:4
theorem Th5: :: GLIB_004:5
for
A being
set for
b1,
b2 being
Rbag of
A st ( for
x being
set st
x in A holds
b1 . x <= b2 . x ) holds
Sum b1 <= Sum b2
theorem Th6: :: GLIB_004:6
for
A being
set for
b1,
b2 being
Rbag of
A st ( for
x being
set st
x in A holds
b1 . x = b2 . x ) holds
Sum b1 = Sum b2
theorem Th7: :: GLIB_004:7
for
A1,
A2 being
set for
b1 being
Rbag of
A1 for
b2 being
Rbag of
A2 st
b1 = b2 holds
Sum b1 = Sum b2
theorem Th8: :: GLIB_004:8
theorem Th9: :: GLIB_004:9
:: deftheorem Def1 defines is_mincost_DTree_rooted_at GLIB_004:def 1 :
:: deftheorem Def2 defines is_mincost_DPath_from GLIB_004:def 2 :
definition
let G be
finite real-weighted WGraph;
let x be
set ,
y be
set ;
func c1 .min_DPath_cost c2,
c3 -> Real means :
Def3:
:: GLIB_004:def 3
ex
W being
DPath of
G st
(
W is_mincost_DPath_from x,
y &
it = W .cost() )
if ex
W being
DWalk of
G st
W is_Walk_from x,
y otherwise it = 0;
existence
( ( ex W being DWalk of G st W is_Walk_from x,y implies ex b1 being Real ex W being DPath of G st
( W is_mincost_DPath_from x,y & b1 = W .cost() ) ) & ( ( for W being DWalk of G holds not W is_Walk_from x,y ) implies ex b1 being Real st b1 = 0 ) )
uniqueness
for b1, b2 being Real holds
( ( ex W being DWalk of G st W is_Walk_from x,y & ex W being DPath of G st
( W is_mincost_DPath_from x,y & b1 = W .cost() ) & ex W being DPath of G st
( W is_mincost_DPath_from x,y & b2 = W .cost() ) implies b1 = b2 ) & ( ( for W being DWalk of G holds not W is_Walk_from x,y ) & b1 = 0 & b2 = 0 implies b1 = b2 ) )
consistency
for b1 being Real holds verum
;
end;
:: deftheorem Def3 defines .min_DPath_cost GLIB_004:def 3 :
definition
let G be
real-WEV WEVGraph;
func DIJK:NextBestEdges c1 -> Subset of
(the_Edges_of a1) means :
Def4:
:: GLIB_004:def 4
for
e1 being
set holds
(
e1 in it iff (
e1 DSJoins G .labeledV() ,
(the_Vertices_of G) \ (G .labeledV() ),
G & ( for
e2 being
set st
e2 DSJoins G .labeledV() ,
(the_Vertices_of G) \ (G .labeledV() ),
G holds
((the_VLabel_of G) . ((the_Source_of G) . e1)) + ((the_Weight_of G) . e1) <= ((the_VLabel_of G) . ((the_Source_of G) . e2)) + ((the_Weight_of G) . e2) ) ) );
existence
ex b1 being Subset of (the_Edges_of G) st
for e1 being set holds
( e1 in b1 iff ( e1 DSJoins G .labeledV() ,(the_Vertices_of G) \ (G .labeledV() ),G & ( for e2 being set st e2 DSJoins G .labeledV() ,(the_Vertices_of G) \ (G .labeledV() ),G holds
((the_VLabel_of G) . ((the_Source_of G) . e1)) + ((the_Weight_of G) . e1) <= ((the_VLabel_of G) . ((the_Source_of G) . e2)) + ((the_Weight_of G) . e2) ) ) )
uniqueness
for b1, b2 being Subset of (the_Edges_of G) st ( for e1 being set holds
( e1 in b1 iff ( e1 DSJoins G .labeledV() ,(the_Vertices_of G) \ (G .labeledV() ),G & ( for e2 being set st e2 DSJoins G .labeledV() ,(the_Vertices_of G) \ (G .labeledV() ),G holds
((the_VLabel_of G) . ((the_Source_of G) . e1)) + ((the_Weight_of G) . e1) <= ((the_VLabel_of G) . ((the_Source_of G) . e2)) + ((the_Weight_of G) . e2) ) ) ) ) & ( for e1 being set holds
( e1 in b2 iff ( e1 DSJoins G .labeledV() ,(the_Vertices_of G) \ (G .labeledV() ),G & ( for e2 being set st e2 DSJoins G .labeledV() ,(the_Vertices_of G) \ (G .labeledV() ),G holds
((the_VLabel_of G) . ((the_Source_of G) . e1)) + ((the_Weight_of G) . e1) <= ((the_VLabel_of G) . ((the_Source_of G) . e2)) + ((the_Weight_of G) . e2) ) ) ) ) holds
b1 = b2
end;
:: deftheorem Def4 defines DIJK:NextBestEdges GLIB_004:def 4 :
:: deftheorem Def5 defines DIJK:Step GLIB_004:def 5 :
:: deftheorem Def6 defines DIJK:Init GLIB_004:def 6 :
:: deftheorem Def7 defines DIJK:CompSeq GLIB_004:def 7 :
:: deftheorem Def8 defines DIJK:SSSP GLIB_004:def 8 :
theorem Th10: :: GLIB_004:10
theorem Th11: :: GLIB_004:11
theorem Th12: :: GLIB_004:12
theorem Th13: :: GLIB_004:13
theorem Th14: :: GLIB_004:14
theorem Th15: :: GLIB_004:15
theorem Th16: :: GLIB_004:16
theorem Th17: :: GLIB_004:17
theorem Th18: :: GLIB_004:18
theorem Th19: :: GLIB_004:19
theorem Th20: :: GLIB_004:20
theorem Th21: :: GLIB_004:21
theorem Th22: :: GLIB_004:22
theorem Th23: :: GLIB_004:23
theorem Th24: :: GLIB_004:24
theorem Th25: :: GLIB_004:25
theorem Th26: :: GLIB_004:26
:: deftheorem Def9 defines WGraphSelectors GLIB_004:def 9 :
Lemma330:
for G being WGraph holds WGraphSelectors c= dom G
Lemma331:
for G being WGraph holds
( G == G .strict WGraphSelectors & the_Weight_of G = the_Weight_of (G .strict WGraphSelectors ) )
Lemma332:
for G being WGraph holds dom (G .strict WGraphSelectors ) = WGraphSelectors
:: deftheorem Def10 defines .allWSubgraphs() GLIB_004:def 10 :
:: deftheorem Def11 defines .cost() GLIB_004:def 11 :
theorem Th27: :: GLIB_004:27
theorem Th28: :: GLIB_004:28
theorem Th29: :: GLIB_004:29
theorem Th30: :: GLIB_004:30
theorem Th31: :: GLIB_004:31
theorem Th32: :: GLIB_004:32
theorem Th33: :: GLIB_004:33
theorem Th34: :: GLIB_004:34
definition
let G be
real-weighted WVGraph;
func PRIM:NextBestEdges c1 -> Subset of
(the_Edges_of a1) means :
Def12:
:: GLIB_004:def 12
for
e1 being
set holds
(
e1 in it iff (
e1 SJoins G .labeledV() ,
(the_Vertices_of G) \ (G .labeledV() ),
G & ( for
e2 being
set st
e2 SJoins G .labeledV() ,
(the_Vertices_of G) \ (G .labeledV() ),
G holds
(the_Weight_of G) . e1 <= (the_Weight_of G) . e2 ) ) );
existence
ex b1 being Subset of (the_Edges_of G) st
for e1 being set holds
( e1 in b1 iff ( e1 SJoins G .labeledV() ,(the_Vertices_of G) \ (G .labeledV() ),G & ( for e2 being set st e2 SJoins G .labeledV() ,(the_Vertices_of G) \ (G .labeledV() ),G holds
(the_Weight_of G) . e1 <= (the_Weight_of G) . e2 ) ) )
uniqueness
for b1, b2 being Subset of (the_Edges_of G) st ( for e1 being set holds
( e1 in b1 iff ( e1 SJoins G .labeledV() ,(the_Vertices_of G) \ (G .labeledV() ),G & ( for e2 being set st e2 SJoins G .labeledV() ,(the_Vertices_of G) \ (G .labeledV() ),G holds
(the_Weight_of G) . e1 <= (the_Weight_of G) . e2 ) ) ) ) & ( for e1 being set holds
( e1 in b2 iff ( e1 SJoins G .labeledV() ,(the_Vertices_of G) \ (G .labeledV() ),G & ( for e2 being set st e2 SJoins G .labeledV() ,(the_Vertices_of G) \ (G .labeledV() ),G holds
(the_Weight_of G) . e1 <= (the_Weight_of G) . e2 ) ) ) ) holds
b1 = b2
end;
:: deftheorem Def12 defines PRIM:NextBestEdges GLIB_004:def 12 :
:: deftheorem Def13 defines PRIM:Init GLIB_004:def 13 :
definition
let G be
real-WEV WEVGraph;
set e =
choose (PRIM:NextBestEdges G);
func PRIM:Step c1 -> real-WEV WEVGraph equals :
Def14:
:: GLIB_004:def 14
G if PRIM:NextBestEdges G = {} (G .labelEdge (choose (PRIM:NextBestEdges G)),1) .labelVertex ((the_Target_of G) . (choose (PRIM:NextBestEdges G))),1
if (
PRIM:NextBestEdges G <> {} &
(the_Source_of G) . (choose (PRIM:NextBestEdges G)) in G .labeledV() )
otherwise (G .labelEdge (choose (PRIM:NextBestEdges G)),1) .labelVertex ((the_Source_of G) . (choose (PRIM:NextBestEdges G))),1;
coherence
( ( PRIM:NextBestEdges G = {} implies G is real-WEV WEVGraph ) & ( PRIM:NextBestEdges G <> {} & (the_Source_of G) . (choose (PRIM:NextBestEdges G)) in G .labeledV() implies (G .labelEdge (choose (PRIM:NextBestEdges G)),1) .labelVertex ((the_Target_of G) . (choose (PRIM:NextBestEdges G))),1 is real-WEV WEVGraph ) & ( not PRIM:NextBestEdges G = {} & ( not PRIM:NextBestEdges G <> {} or not (the_Source_of G) . (choose (PRIM:NextBestEdges G)) in G .labeledV() ) implies (G .labelEdge (choose (PRIM:NextBestEdges G)),1) .labelVertex ((the_Source_of G) . (choose (PRIM:NextBestEdges G))),1 is real-WEV WEVGraph ) )
;
consistency
for b1 being real-WEV WEVGraph st PRIM:NextBestEdges G = {} & PRIM:NextBestEdges G <> {} & (the_Source_of G) . (choose (PRIM:NextBestEdges G)) in G .labeledV() holds
( b1 = G iff b1 = (G .labelEdge (choose (PRIM:NextBestEdges G)),1) .labelVertex ((the_Target_of G) . (choose (PRIM:NextBestEdges G))),1 )
;
end;
:: deftheorem Def14 defines PRIM:Step GLIB_004:def 14 :
:: deftheorem Def15 defines PRIM:CompSeq GLIB_004:def 15 :
:: deftheorem Def16 defines PRIM:MST GLIB_004:def 16 :
Lemma348:
for G being real-weighted WGraph holds
( G == PRIM:Init G & the_Weight_of G = the_Weight_of (PRIM:Init G) & the_ELabel_of (PRIM:Init G) = {} & the_VLabel_of (PRIM:Init G) = (choose (the_Vertices_of G)) .--> 1 )
Lemma349:
for G being real-weighted WGraph holds
( (PRIM:Init G) .labeledV() = {(choose (the_Vertices_of G))} & (PRIM:Init G) .labeledE() = {} )
Lemma350:
for G being real-WEV WEVGraph st PRIM:NextBestEdges G <> {} holds
ex v being Vertex of G st
( not v in G .labeledV() & PRIM:Step G = (G .labelEdge (choose (PRIM:NextBestEdges G)),1) .labelVertex v,1 )
Lemma352:
for G being real-WEV WEVGraph holds
( G == PRIM:Step G & the_Weight_of G = the_Weight_of (PRIM:Step G) & G .labeledE() c= (PRIM:Step G) .labeledE() & G .labeledV() c= (PRIM:Step G) .labeledV() )
Lemma353:
for G being finite real-weighted WGraph
for n being Element of NAT holds
( G == (PRIM:CompSeq G) . n & the_Weight_of ((PRIM:CompSeq G) . n) = the_Weight_of G )
Lemma354:
for G being finite real-weighted WGraph
for n being Element of NAT holds
( ((PRIM:CompSeq G) . n) .labeledV() is non empty Subset of (the_Vertices_of G) & ((PRIM:CompSeq G) . n) .labeledE() c= G .edgesBetween (((PRIM:CompSeq G) . n) .labeledV() ) )
Lemma355:
for G1 being finite real-weighted WGraph
for n being Element of NAT
for G2 being inducedSubgraph of G1,((PRIM:CompSeq G1) . n) .labeledV() ,((PRIM:CompSeq G1) . n) .labeledE() holds G2 is connected
Lemma362:
for G1 being finite real-weighted WGraph
for n being Element of NAT
for G2 being inducedSubgraph of G1,(((PRIM:CompSeq G1) . n) .labeledV() ) holds G2 is connected
Lemma366:
for G being finite real-weighted WGraph
for n being Element of NAT holds ((PRIM:CompSeq G) . n) .labeledV() c= G .reachableFrom (choose (the_Vertices_of G))
Lemma368:
for G being finite real-weighted WGraph
for i, j being Element of NAT st i <= j holds
( ((PRIM:CompSeq G) . i) .labeledV() c= ((PRIM:CompSeq G) . j) .labeledV() & ((PRIM:CompSeq G) . i) .labeledE() c= ((PRIM:CompSeq G) . j) .labeledE() )
Lemma371:
for G being finite real-weighted WGraph
for n being Element of NAT holds
( PRIM:NextBestEdges ((PRIM:CompSeq G) . n) = {} iff ((PRIM:CompSeq G) . n) .labeledV() = G .reachableFrom (choose (the_Vertices_of G)) )
Lemma376:
for G being finite real-weighted WGraph
for n being Element of NAT holds card (((PRIM:CompSeq G) . n) .labeledV() ) = min (n + 1),(card (G .reachableFrom (choose (the_Vertices_of G))))
Lemma378:
for G being finite real-weighted WGraph holds
( PRIM:CompSeq G is halting & ((PRIM:CompSeq G) .Lifespan() ) + 1 = card (G .reachableFrom (choose (the_Vertices_of G))) )
Lemma381:
for G1 being finite real-weighted WGraph
for n being Element of NAT
for G2 being inducedSubgraph of G1,((PRIM:CompSeq G1) . n) .labeledV() ,((PRIM:CompSeq G1) . n) .labeledE() holds G2 is Tree-like
Lemma384:
for G being finite connected real-weighted WGraph holds (PRIM:MST G) .labeledV() = the_Vertices_of G
:: deftheorem Def17 defines min-cost GLIB_004:def 17 :
theorem Th35: :: GLIB_004:35
theorem Th36: :: GLIB_004:36
theorem Th37: :: GLIB_004:37
theorem Th38: :: GLIB_004:38
theorem Th39: :: GLIB_004:39
theorem Th40: :: GLIB_004:40
theorem Th41: :: GLIB_004:41
theorem Th42: :: GLIB_004:42
theorem Th43: :: GLIB_004:43
theorem Th44: :: GLIB_004:44
theorem Th45: :: GLIB_004:45
theorem Th46: :: GLIB_004:46
theorem Th47: :: GLIB_004:47
theorem Th48: :: GLIB_004:48
theorem Th49: :: GLIB_004:49
theorem Th50: :: GLIB_004:50
theorem Th51: :: GLIB_004:51
theorem Th52: :: GLIB_004:52
theorem Th53: :: GLIB_004:53