SupplierDual
Abstract
The finite path-potential and normalized real dual-certificate interface retains the necessary live upstream proofs. The finite incompatibility adapter directly applies the repository frozen inequality_farkas result instead of copying a second Farkas proof. Source: https://github.com/elazarg/multitubes/tree/20d22aa7ca67f9843e5adf9edf173403a2f4033a. These are necessary reusable prerequisites of the circuit supplier.
Generic declarations use these source contexts: universe uV uE variable {π : Type*} [AddCommMonoid π] [LinearOrder π] [IsOrderedAddMonoid π] variable {V : Type uV} {E : Type uE} {G : EdgeGraph V E} variable {πg : Type*} [AddCommGroup πg] variable {πg : Type*} [AddCommGroup πg] variable {πp : Type*} [Add πp] [LE πp] variable {πg : Type*} [AddCommGroup πg] [Preorder πg] [IsOrderedAddMonoid πg] variable {πo : Type*} [AddCommMonoid πo] [Preorder πo] [IsOrderedAddMonoid πo] variable [IsOrderedCancelAddMonoid πo] variable [Finite E] variable [IsOrderedCancelAddMonoid π] universe uS uR variable {State : Type uS} {Row Action : Type uR} variable [Fintype State] [Fintype Row] universe uV uE variable {V : Type uV} {E : Type uE}
Definition 1.1 (walkWeight).
Lean statement: D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.walkWeight
Formalization. D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.walkWeight (β std3).
Source. Repository-derived.
Commentary.
Exact source telescope, in the module declared generic contexts: def walkWeight (weight : E β π) {start finish : V} (walk : G.Walk start finish) : π := (walk.edges.map weight).sum omit [LinearOrder π] in
Theorem 1.2 (walkWeight concat).
Lean statement: D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.walkWeight_concat
Proof. Machine-checked in Lean as D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.walkWeight_concat (β std3). β
Source. Repository-derived.
Commentary.
Exact source telescope, in the module declared generic contexts: @[simp] theorem walkWeight_concat (weight : E β π) {start finish : V} (walk : G.Walk start finish) (edge : E) (legal : G.source edge = finish) : walkWeight weight (walk.concat edge legal) = walkWeight weight walk + weight edge
Theorem 1.3 (walkWeight castFinish).
Lean statement: D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.walkWeight_castFinish
Proof. Machine-checked in Lean as D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.walkWeight_castFinish (β std3). β
Source. Repository-derived.
Commentary.
Exact source telescope, in the module declared generic contexts: @[simp] theorem walkWeight_castFinish (weight : E β π) {start finish finishβ : V} (walk : G.Walk start finish) (hfinish : finish = finishβ) : walkWeight weight (walk.castFinish hfinish) = walkWeight weight walk
Definition 1.4 (IsPotential).
Lean statement: D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.IsPotential
Formalization. D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.IsPotential (β std3).
Source. Repository-derived.
Commentary.
Exact source telescope, in the module declared generic contexts: def IsPotential (G : EdgeGraph V E) (weight : E β πp) (Ο : V β πp) : Prop := β e : E, Ο (G.source e) + weight e β€ Ο (G.target e)
Definition 1.5 (defect).
Lean statement: D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.defect
Formalization. D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.defect (β std3).
Source. Repository-derived.
Commentary.
Exact source telescope, in the module declared generic contexts: def defect (G : EdgeGraph V E) (weight : E β πg) (Ο : V β πg) (e : E) : πg := Ο (G.source e) + weight e - Ο (G.target e)
Definition 1.6 (nodupIncomingWeights).
Lean statement: D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.nodupIncomingWeights
Formalization. D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.nodupIncomingWeights (β std3).
Source. Repository-derived.
Commentary.
Exact source telescope, in the module declared generic contexts: def nodupIncomingWeights (G : EdgeGraph V E) (weight : E β π) (vertex : V) : Set π := {r | β (start : V) (walk : G.Walk start vertex), walk.edges.Nodup β§ walkWeight weight walk = r} omit [LinearOrder π] in
Theorem 1.7 (Nonpositive cycle deletion preserves endpoints and increases weight).
Lean statement: D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.exists_nodup_visited_walkWeight_le
Proof. Machine-checked in Lean as D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.exists_nodup_visited_walkWeight_le (β std3). β
Source. Repository-derived.
Commentary.
If every closed walk has nonpositive weight, every walk of length at most a supplied natural bound has a walk with the same endpoints, no repeated visited vertex, and at least the original weight. Deleting a nonempty closed subwalk decreases length and cannot decrease weight; induction on the bound terminates. In a graph with finitely many vertices the resulting walk has fewer edges than vertices, supplying the finite bound for max-plus relaxation.
Definition 1.8 (maxIncomingWeight).
Lean statement: D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.maxIncomingWeight
Formalization. D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.maxIncomingWeight (β std3).
Source. Repository-derived.
Commentary.
Exact source telescope, in the module declared generic contexts: def maxIncomingWeight (G : EdgeGraph V E) (weight : E β π) (vertex : V) : π := Finset.maxβ (Set.Finite.toFinset (finite_nodupIncomingWeights (G := G) weight vertex)) ((Set.Finite.toFinset_nonempty (finite_nodupIncomingWeights (G := G) weight vertex)).2 β¨0, zero_mem_nodupIncomingWeights (G := G) weight vertexβ©) omit [IsOrderedAddMonoid π] in
Definition 1.9 (IsNormalizedCertificate).
Lean statement: D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.IsNormalizedCertificate
Formalization. D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.IsNormalizedCertificate (β std3).
Source. Repository-derived.
Commentary.
Exact source telescope, in the module declared generic contexts: def IsNormalizedCertificate (delta : Row β State β β) (coefficient : Row β β) : Prop := (β row, 0 β€ coefficient row) β§ (β row, coefficient row = 1) β§ β state, β row, coefficient row * delta row state = 0
Definition 1.10 (certificateValue).
Lean statement: D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.certificateValue
Formalization. D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.certificateValue (β std3).
Source. Repository-derived.
Commentary.
Exact source telescope, in the module declared generic contexts: def certificateValue (base : Row β β) (coefficient : Row β β) : β := β row, coefficient row * base row
Definition 1.11 (WorstResidualAtMost).
Lean statement: D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.WorstResidualAtMost
Formalization. D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.WorstResidualAtMost (β std3).
Source. Repository-derived.
Commentary.
Exact source telescope, in the module declared generic contexts: def WorstResidualAtMost (delta : Row β State β β) (base : Row β β) (level : β) : Prop := β potential : State β β, β row, base row - dotProduct (delta row) potential β€ level
Theorem 1.12 (worstResidualAtMost iff normalizedDual le).
Lean statement: D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.worstResidualAtMost_iff_normalizedDual_le
Proof. Machine-checked in Lean as D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.worstResidualAtMost_iff_normalizedDual_le (β std3). β
Source. Repository-derived.
Commentary.
Exact source telescope, in the module declared generic contexts: theorem worstResidualAtMost_iff_normalizedDual_le (delta : Row β State β β) (base : Row β β) (level : β) : WorstResidualAtMost delta base level β β coefficient : Row β β, IsNormalizedCertificate delta coefficient β certificateValue base coefficient β€ level
Definition 1.13 (WorstDirectedResidualAtMost).
Lean statement: D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.WorstDirectedResidualAtMost
Formalization. D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.WorstDirectedResidualAtMost (β std3).
Source. Repository-derived.
Commentary.
Exact source telescope, in the module declared generic contexts: def WorstDirectedResidualAtMost (G : EdgeGraph V E) (weight : E β β) (level : β) : Prop := β potential : V β β, β edge, MaxPlusPotential.defect G weight potential edge β€ level
Theorem 1.14 (worstDirectedResidualAtMost iff closedWalk le).
Lean statement: D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.worstDirectedResidualAtMost_iff_closedWalk_le
Proof. Machine-checked in Lean as D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.worstDirectedResidualAtMost_iff_closedWalk_le (β std3). β
Source. Repository-derived.
Commentary.
Exact source telescope, in the module declared generic contexts: theorem worstDirectedResidualAtMost_iff_closedWalk_le [Finite E] (G : EdgeGraph V E) (weight : E β β) (level : β) : WorstDirectedResidualAtMost G weight level β β (vertex : V) (cycle : G.Walk vertex vertex), MaxPlusPotential.walkWeight weight cycle β€ cycle.length * level
Definition 1.15 (SignedEdge).
Lean statement: D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.SignedEdge
Formalization. D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.SignedEdge (β std3).
Source. Repository-derived.
Commentary.
Exact source telescope, in the module declared generic contexts: abbrev SignedEdge (E : Type uE) := E Γ Bool
Definition 1.16 (signedDelta).
Lean statement: D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.signedDelta
Formalization. D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.signedDelta (β std3).
Source. Repository-derived.
Commentary.
Exact source telescope, in the module declared generic contexts: def signedDelta [DecidableEq V] (G : EdgeGraph V E) : SignedEdge E β V β β | (edge, false) => fun vertex => (if vertex = G.target edge then 1 else 0) - (if vertex = G.source edge then 1 else 0) | (edge, true) => fun vertex => (if vertex = G.source edge then 1 else 0) - (if vertex = G.target edge then 1 else 0)
Theorem 1.17 (dotProduct signedDelta false).
Lean statement: D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.dotProduct_signedDelta_false
Proof. Machine-checked in Lean as D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.dotProduct_signedDelta_false (β std3). β
Source. Repository-derived.
Commentary.
Exact source telescope, in the module declared generic contexts: theorem dotProduct_signedDelta_false [Fintype V] [DecidableEq V] (G : EdgeGraph V E) (edge : E) (potential : V β β) : dotProduct (signedDelta G (edge, false)) potential = potential (G.target edge) - potential (G.source edge)
Theorem 1.18 (dotProduct signedDelta true).
Lean statement: D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.dotProduct_signedDelta_true
Proof. Machine-checked in Lean as D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.dotProduct_signedDelta_true (β std3). β
Source. Repository-derived.
Commentary.
Exact source telescope, in the module declared generic contexts: theorem dotProduct_signedDelta_true [Fintype V] [DecidableEq V] (G : EdgeGraph V E) (edge : E) (potential : V β β) : dotProduct (signedDelta G (edge, true)) potential = potential (G.source edge) - potential (G.target edge)
References
- Truth anchor:
D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.IsNormalizedCertificate - Truth anchor:
D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.IsPotential - Truth anchor:
D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.SignedEdge - Truth anchor:
D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.WorstDirectedResidualAtMost - Truth anchor:
D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.WorstResidualAtMost - Truth anchor:
D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.certificateValue - Truth anchor:
D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.defect - Truth anchor:
D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.dotProduct_signedDelta_false - Truth anchor:
D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.dotProduct_signedDelta_true - Truth anchor:
D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.exists_nodup_visited_walkWeight_le - Truth anchor:
D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.maxIncomingWeight - Truth anchor:
D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.nodupIncomingWeights - Truth anchor:
D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.signedDelta - Truth anchor:
D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.walkWeight - Truth anchor:
D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.walkWeight_castFinish - Truth anchor:
D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.walkWeight_concat - Truth anchor:
D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.worstDirectedResidualAtMost_iff_closedWalk_le - Truth anchor:
D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierDual.worstResidualAtMost_iff_normalizedDual_le - Dependency: D5/S3/Analytic/Convexity/FarkasAlternative
- Dependency: D5/S3/Combinatorics/Graph/LayeredCirculation/SupplierGraph