Documentation

CslibFrontier.Algorithms.Lean.Karger.FastCut

Karger–Stein recursion as a client of the contraction specification #

fastCut asks an oracle to contract a graph to a requested size. Its canonical handler contractLaw is the law of the existing contraction client, with its graph state observed. Two calls of the same oracle are fresh independent runs under OracleComp.evalWith.

Recursion decreases the explicit size parameter, not the size of an arbitrary oracle reply. The canonical handler's support theorem establishes that replies have the requested size. At a leaf the client returns half the doubled weight after contracting to two vertices; at a node it returns the minimum of two recursive trials. No native execution model is introduced.

The threshold and cutoff are the existing integer choices of this formalization, documented in CslibFrontier.Algorithms.Karger.FastCut: recurse at size at least seven, and choose the least integer threshold whose cut-survival ratio is at least one half. The source is [KS96], Section 4, Figure 6 and Lemma 4.3; this is a paraphrase, with the same documented integer deviations.

Main definitions #

Main results #

References #

One oracle reply observes the graph left by the existing contraction client.

@[irreducible]

Recursive contraction with two fresh branches. The explicit size parameter decreases even when an arbitrary oracle supplies a reply of an unrelated size.

The canonical recursive answer law, using the existing contraction semantics.

Below the recursion cutoff, contract to two vertices and read their cut value.

At a recursive node, each branch starts from the original graph independently.

A leaf has exactly the existing single-trial Karger answer law.

theorem Cslib.Algorithms.Lean.Karger.fastCutLaw_node {k : ℕ} (hk : 7 ≤ k) (G : Graph) :
fastCutLaw k G = have branch := (contractLaw (G, Karger.fastCutThreshold k)).bind fun (child : Graph) => fastCutLaw (Karger.fastCutThreshold k) child; branch.bind fun (a : ℕ) => PMF.map (min a) branch

The node law is the minimum of two independent answers from the same branch law.

theorem Cslib.Algorithms.Lean.Karger.survives_contractLaw {n k target : ℕ} (ht : 2 ≤ target) (htk : target ≤ k) {W₀ : Fin n → Fin n → ℕ} (hmin : 0 < WeightedCut.minCut W₀) {W : Fin k → Fin k → ℕ} {part : Fin n → Fin k} (hC : WeightedCut.IsContractionOf W₀ part W) {B : Finset (Fin k)} (hB : WeightedCut.IsNonTrivialCut B) (hBmin : WeightedCut.cutWeight W₀ (WeightedCut.pullbackCut part B) = WeightedCut.minCut W₀) :
↑(target * (target - 1)) / ↑(k * (k - 1)) ≤ (contractLaw ({ size := k, weight := W }, target)).toOuterMeasure {G : Graph | Survives W₀ (WeightedCut.pullbackCut part B) target G}

Contracting from k to target ≥ 2 retains a fixed minimum cut with the existing exact survival lower bound. The target remains a variable before the recursive threshold is chosen.

theorem Cslib.Algorithms.Lean.Karger.isContractionOf_of_mem_support_contractLaw {n k target : ℕ} (ht : 1 ≤ target) (htk : target ≤ k) {W₀ : Fin n → Fin n → ℕ} {W : Fin k → Fin k → ℕ} {part : Fin n → Fin k} (hC : WeightedCut.IsContractionOf W₀ part W) {G : Graph} (hG : G ∈ (contractLaw ({ size := k, weight := W }, target)).support) :
∃ (W' : Fin target → Fin target → ℕ) (part' : Fin n → Fin target), G = { size := target, weight := W' } ∧ WeightedCut.IsContractionOf W₀ part' W'

Every supported reply has the requested size and is a contraction of the same original graph. In particular the canonical handler validates the size used for recursion.

theorem Cslib.Algorithms.Lean.Karger.minCut_eq_zero_of_mem_support_contractLaw {k target : ℕ} (ht : 2 ≤ target) (htk : target ≤ k) {W : Fin k → Fin k → ℕ} (hW : WeightedCut.IsMultigraph W) (hmin : WeightedCut.minCut W = 0) {G : Graph} (hG : G ∈ (contractLaw ({ size := k, weight := W }, target)).support) :
∃ (W' : Fin target → Fin target → ℕ), G = { size := target, weight := W' } ∧ WeightedCut.IsMultigraph W' ∧ WeightedCut.minCut W' = 0

Contracting a disconnected (minCut W = 0) multigraph down to target ≥ 2 preserves minCut = 0 on every supported reply of contractLaw.

theorem Cslib.Algorithms.Lean.Karger.exists_cut_of_mem_support_fastCutLaw {n k : ℕ} (hk : 2 ≤ k) {W₀ : Fin n → Fin n → ℕ} {W : Fin k → Fin k → ℕ} {part : Fin n → Fin k} (hC : WeightedCut.IsContractionOf W₀ part W) {v : ℕ} (hv : v ∈ (fastCutLaw k { size := k, weight := W }).support) :

Every recursive answer is the weight of a non-trivial cut of the original graph, including when recursion starts from a contraction of that graph.

theorem Cslib.Algorithms.Lean.Karger.minCut_le_of_mem_support_fastCutLaw {n k : ℕ} (hk : 2 ≤ k) {W₀ : Fin n → Fin n → ℕ} {W : Fin k → Fin k → ℕ} {part : Fin n → Fin k} (hC : WeightedCut.IsContractionOf W₀ part W) {v : ℕ} (hv : v ∈ (fastCutLaw k { size := k, weight := W }).support) :

Recursive contraction has one-sided error relative to the original graph.

theorem Cslib.Algorithms.Lean.Karger.eq_zero_of_mem_support_fastCutLaw {k : ℕ} (hk : 2 ≤ k) {W : Fin k → Fin k → ℕ} (hW : WeightedCut.IsMultigraph W) (hmin : WeightedCut.minCut W = 0) {v : ℕ} (hv : v ∈ (fastCutLaw k { size := k, weight := W }).support) :
v = 0

On a disconnected (minCut W = 0) multigraph with k ≥ 2 vertices, every recursive answer of fastCutLaw is 0.

theorem Cslib.Algorithms.Lean.Karger.answerLaw_hit_prob_ge {n k : ℕ} (hk : 2 ≤ k) {W₀ : Fin n → Fin n → ℕ} (hmin : 0 < WeightedCut.minCut W₀) {W : Fin k → Fin k → ℕ} {part : Fin n → Fin k} (hC : WeightedCut.IsContractionOf W₀ part W) {B : Finset (Fin k)} (hB : WeightedCut.IsNonTrivialCut B) (hBmin : WeightedCut.cutWeight W₀ (WeightedCut.pullbackCut part B) = WeightedCut.minCut W₀) :
2 / ↑(k * (k - 1)) ≤ (answerLaw { size := k, weight := W }).toOuterMeasure {v : ℕ | v = WeightedCut.minCut W₀}

A single contraction trial from a contraction of the original graph retains any represented minimum cut with the usual 2 / (k (k - 1)) lower bound.

theorem Cslib.Algorithms.Lean.Karger.fastCutLaw_hit_prob_ge {n : ℕ} {W₀ : Fin n → Fin n → ℕ} (hmin : 0 < WeightedCut.minCut W₀) (d : ℕ) {k : ℕ} {W : Fin k → Fin k → ℕ} {part : Fin n → Fin k} :
2 ≤ k → Karger.fastCutDepth k ≤ d → WeightedCut.IsContractionOf W₀ part W → ∀ (B : Finset (Fin k)), WeightedCut.IsNonTrivialCut B → WeightedCut.cutWeight W₀ (WeightedCut.pullbackCut part B) = WeightedCut.minCut W₀ → 2 / ↑(d + 30) ≤ (fastCutLaw k { size := k, weight := W }).toOuterMeasure {v : ℕ | v = WeightedCut.minCut W₀}

A represented minimum cut is found with probability at least 2 / (d + 30) when the recursive depth is at most d. Probability reasoning concerns only the specification law.

theorem Cslib.Algorithms.Lean.Karger.fastCutLaw_root_hit_prob_ge {n : ℕ} (hn : 2 ≤ n) {W : Fin n → Fin n → ℕ} (hW : WeightedCut.IsMultigraph W) (hmin : 0 < WeightedCut.minCut W) :
1 / ↑(Nat.log 2 n + 15) ≤ (fastCutLaw n { size := n, weight := W }).toOuterMeasure {v : ℕ | v = WeightedCut.minCut W}

A single root trial finds the minimum cut with probability at least 1 / (log₂ n + 15). The connectedness hypothesis is the existing positive-minimum-cut condition.

The law of independent recursive trials, keeping their least answer. The trial schedule is the existing concrete O(log² n) schedule; no additional native model is used.

Every answer of the amplified law is still a non-trivial cut weight.

theorem Cslib.Algorithms.Lean.Karger.eq_zero_of_mem_support_fastCutHighProbLaw {n : ℕ} (hn : 2 ≤ n) {W : Fin n → Fin n → ℕ} (hW : WeightedCut.IsMultigraph W) (hmin : WeightedCut.minCut W = 0) {v : ℕ} (hv : v ∈ (fastCutHighProbLaw n { size := n, weight := W }).support) :
v = 0

On a disconnected (minCut W = 0) multigraph with n ≥ 2 vertices, every answer of fastCutHighProbLaw is 0.

theorem Cslib.Algorithms.Lean.Karger.fastCutHighProbLaw_failure_le {n : ℕ} (hn : 2 ≤ n) {W : Fin n → Fin n → ℕ} (hW : WeightedCut.IsMultigraph W) (hmin : 0 < WeightedCut.minCut W) :
(fastCutHighProbLaw n { size := n, weight := W }).toOuterMeasure {v : ℕ | v ≠ WeightedCut.minCut W} ≤ 1 / ↑(2 * n)

The existing independent-trial schedule misses the minimum cut with probability at most 1 / (2 n). The bound is for the recursive specification's answer law.

theorem Cslib.Algorithms.Lean.Karger.fastCutLaw_update_failure_le {n : ℕ} (hn : 2 ≤ n) {W : Fin n → Fin n → ℕ} (hW : WeightedCut.IsMultigraph W) (hmin : 0 < WeightedCut.minCut W) (i b : ℕ) (hb : 0 < i → WeightedCut.minCut W ≤ b) :
(PMF.map (fun (v : ℕ) => if i = 0 then v else min v b) (fastCutLaw n { size := n, weight := W })).toOuterMeasure {v : ℕ | v ≠ WeightedCut.minCut W} ≤ 1 - 1 / ↑(Nat.log 2 n + 15)

Updating a previously valid least answer cannot increase a trial's failure probability. The first trial ignores the initial least-answer word. This is a law of the specification.