Vertex splitting for the directed flow–cut algorithm

Lax263307.VertexSplitting · concepts/Lax263307/VertexSplitting.lean · lax-263307

proven

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Natural Language Statement

    Lemma

    Replace each original vertex vv by two ports v−v^- and v+v^+. The capacity of v−→v+v^-\to v^+ is its cost xvx_v. Reverse port arcs and arcs v+→u−v^+\to u^- for graph edges receive a sufficiently large finite capacity. A directed cut of capacity less than this large capacity crosses none of these arcs and projects to a separation of the original graph. Its capacity equals the vertex cost of the projected separator.

    The registered directed uniform flow–cut algorithm applies to this rational split network with its actual RAM polynomial-time guarantee. Each original ordered pair uses the distinct split endpoints u−,v+u^-,v^+, also when u=vu=v.

    Concept map
    9 concepts
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on ADescendants are omitted for concepts with more than 10 descendants.
    Evidence

    Lean source view on GitHub

    1import Lax455465.RamDirectedUniformFlowCut
    2import Mathlib.Combinatorics.SimpleGraph.Finite
    3
    4/-!
    5---
    6title: Vertex splitting for the directed flow–cut algorithm
    7type: lemma
    8---
    9Replace each original vertex vv by two ports v−v^- and v+v^+.
    10The capacity of v−→v+v^-\to v^+ is its cost xvx_v. Reverse port arcs and arcs
    11v+→u−v^+\to u^- for graph edges receive a sufficiently large finite capacity.
    12A directed cut of capacity less than this large capacity crosses none of
    13these arcs and projects to a separation of the original graph. Its capacity
    14equals the vertex cost of the projected separator.
    15
    16The registered directed uniform flow–cut algorithm applies to this rational
    17split network with its actual RAM polynomial-time guarantee. Each original
    18ordered pair uses the distinct split endpoints u−,v+u^-,v^+, also when u=vu=v.
    19
    20# Formalization notes
    21
    22Ports are numbered 2v2v and 2v+12v+1. The cut shores are the vertices whose
    23minus ports lie inside the cut and whose plus ports lie outside it.
    24The cut projection and the external solver's application are proved here;
    25flow projection and the RAM cost of constructing the split input are separate
    26steps of the reduction.
    27-/
    28
    29namespace Lax263307.VertexSplitting
    30
    31open Lax455465.FlowCutCertificate (Certificate encodeCertificate)
    32open Lax759944.RamPolytime (RamPolytime)
    33open scoped NNReal NNRat
    34open Lax455465.RationalEncoding Lax455465.ProductNetwork Lax455465.ConcurrentFlow
    35
    36/-- The input port of an original vertex. -/
    37def minus {n : ℕ} (v : Fin n) : Fin (2 * n) :=
    38 ⟨2 * v.val, Nat.mul_lt_mul_of_pos_left v.isLt (Nat.succ_pos 1)⟩
    39/-- The output port of an original vertex. -/
    40def plus {n : ℕ} (v : Fin n) : Fin (2 * n) :=
    41 ⟨2 * v.val + 1, (Nat.mul_succ 2 v.val).symm.trans_le (Nat.mul_le_mul_left 2 v.isLt)⟩
    42/-- Forget which of the two ports represents a vertex. -/
    43def original {n : ℕ} (v : Fin (2 * n)) : Fin n :=
    44 ⟨v.val / 2, (Nat.div_lt_iff_lt_mul (Nat.succ_pos 1)).mpr
    45 (Nat.mul_comm 2 n ▸ v.isLt)⟩
    46
    47/-- Rational capacities and uniform demands on the split network. -/
    48def splitInstance {n : ℕ} (G : SimpleGraph (Fin n)) [DecidableRel G.Adj]
    49 (x : Fin n → ℚ≥0) (large : ℚ≥0) : RationalInstance (2 * n) where
    50 capacity u v :=
    51 if u.val % 2 = 0 ∧ v.val = u.val + 1 then x (original u)
    52 else if u.val % 2 = 1 ∧ v.val + 1 = u.val then large
    53 else if u.val % 2 = 1 ∧ v.val % 2 = 0 ∧ G.Adj (original u) (original v) then large
    54 else 0
    55 loopless v :=
    56 (if_neg (fun h => Nat.ne_of_lt (Nat.lt_succ_self v.val) h.2)).trans
    57 ((if_neg (fun h => Nat.ne_of_gt (Nat.lt_succ_self v.val) h.2)).trans
    58 (if_neg (fun h => h.2.2.ne rfl)))
    59 weight _ := 1
    60
    61/-- Original vertices whose input ports lie inside the split cut. -/
    62def leftShore {n : ℕ} (U : Finset (Fin (2 * n))) : Finset (Fin n) :=
    63 Finset.univ.filter fun v => minus v ∈ U
    64
    65/-- Original vertices whose output ports lie outside the split cut. -/
    66def rightShore {n : ℕ} (U : Finset (Fin (2 * n))) : Finset (Fin n) :=
    67 Finset.univ.filter fun v => plus v ∉ U
    68
    69/-- A small split cut projects to a nontrivial separation with controlled shores. -/
    70axiom small_cut_separation {n : ℕ} (G : SimpleGraph (Fin n)) [DecidableRel G.Adj]
    71 (x : Fin n → ℚ≥0) (large : ℚ≥0) (U : Finset (Fin (2 * n)))
    72 (small : cutCapacity (splitInstance G x large).network U < (large : ℝ≥0))
    73 (nonempty : U.Nonempty) (proper : Uᶜ.Nonempty) :
    74 (leftShore U).Nonempty ∧ (rightShore U).Nonempty ∧
    75 leftShore U ∪ rightShore U = Finset.univ ∧
    76 (∀ u ∈ leftShore U \ rightShore U, ∀ v ∈ rightShore U \ leftShore U, ¬G.Adj u v) ∧
    77 U.card ≤ 2 * (leftShore U).card ∧ Uᶜ.card ≤ 2 * (rightShore U).card
    78
    79/-- Only the vertex-capacity arcs contribute to a small split cut. -/
    80axiom small_cut_cost {n : ℕ} (G : SimpleGraph (Fin n)) [DecidableRel G.Adj]
    81 (x : Fin n → ℚ≥0) (large : ℚ≥0) (U : Finset (Fin (2 * n)))
    82 (small : cutCapacity (splitInstance G x large).network U < (large : ℝ≥0)) :
    83 cutCapacity (splitInstance G x large).network U =
    84 ∑ v ∈ leftShore U ∩ rightShore U, (x v : ℝ≥0)
    85
    86/-- Translate a directed cut ratio into the original separator's vertex cost. -/
    87axiom separator_cost_bound {n : ℕ} (G : SimpleGraph (Fin n)) [DecidableRel G.Adj]
    88 (x : Fin n → ℚ≥0) (large : ℚ≥0) (U : Finset (Fin (2 * n))) (ρ : ℝ)
    89 (nonnegative : 0 ≤ ρ)
    90 (small : cutCapacity (splitInstance G x large).network U < (large : ℝ≥0))
    91 (admissible : AdmissibleCut (splitInstance G x large).weights U)
    92 (ratio : (ratioCost (splitInstance G x large).network
    93 (splitInstance G x large).weights U : ℝ) ≤ ρ) :
    94 (∑ v ∈ leftShore U ∩ rightShore U, (x v : ℝ)) ≤
    95 4 * ρ * (leftShore U).card * (rightShore U).card
    96
    97/-- Apply the existing directed uniform solver to every split network. -/
    98axiom split_certificate :
    99 ∃ (solve : List ℕ → List ℕ) (C : ℝ), RamPolytime solve ∧ 0 < C ∧
    100 ∀ (n : ℕ) (G : SimpleGraph (Fin n)) [DecidableRel G.Adj]
    101 (x : Fin n → ℚ≥0) (large : ℚ≥0), 0 < n →
    102 let I := splitInstance G x large
    103 ∃ certificate : Certificate (2 * n),
    104 solve (encodeInput .directed I) = encodeCertificate certificate ∧
    105 AdmissibleCut I.weights certificate.cut ∧
    106 IsArcConcurrentFlow .directed I.network I.weights
    107 (certificate.flow.value : ℝ≥0) certificate.flow.flow ∧
    108 (ratioCost I.network I.weights certificate.cut : ℝ) ≤
    109 C * logFactor (2 * n) * (certificate.flow.value : ℝ)
    110
    111/-- A split flow–cut certificate yields a high-value flow or a cheap separation. -/
    112axiom flow_or_separation {n : ℕ} (G : SimpleGraph (Fin n)) [DecidableRel G.Adj]
    113 (x : Fin n → ℚ≥0) (large : ℚ≥0)
    114 (certificate : Certificate (2 * n)) (ρ γ : ℝ)
    115 (nonnegative : 0 ≤ ρ) (positive : 0 < γ)
    116 (admissible : AdmissibleCut (splitInstance G x large).weights certificate.cut)
    117 (flow_valid : IsArcConcurrentFlow .directed (splitInstance G x large).network
    118 (splitInstance G x large).weights (certificate.flow.value : ℝ≥0) certificate.flow.flow)
    119 (ratio : (ratioCost (splitInstance G x large).network
    120 (splitInstance G x large).weights certificate.cut : ℝ) ≤
    121 ρ * (certificate.flow.value : ℝ))
    122 (large_capacity : ρ * (2 * n : ℕ) ^ 2 / γ < (large : ℝ)) :
    123 ((1 / γ ≤ (certificate.flow.value : ℝ)) ∧
    124 IsArcConcurrentFlow .directed (splitInstance G x large).network
    125 (splitInstance G x large).weights (certificate.flow.value : ℝ≥0) certificate.flow.flow) ∨
    126 ((leftShore certificate.cut).Nonempty ∧ (rightShore certificate.cut).Nonempty ∧
    127 leftShore certificate.cut ∪ rightShore certificate.cut = Finset.univ ∧
    128 (∀ u ∈ leftShore certificate.cut \ rightShore certificate.cut,
    129 ∀ v ∈ rightShore certificate.cut \ leftShore certificate.cut, ¬G.Adj u v) ∧
    130 (∑ v ∈ leftShore certificate.cut ∩ rightShore certificate.cut, (x v : ℝ)) ≤
    131 4 * ρ * (leftShore certificate.cut).card * (rightShore certificate.cut).card / γ)
    132
    133end Lax263307.VertexSplitting
    134
    Show ProofShow ProofShow ProofShow ProofShow Proof
    Formalization notes

    Ports are numbered 2v2v and 2v+12v+1. The cut shores are the vertices whose minus ports lie inside the cut and whose plus ports lie outside it. The cut projection and the external solver's application are proved here; flow projection and the RAM cost of constructing the split input are separate steps of the reduction.

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…