Documentation

CslibFrontier.Algorithms.Lean.MaxDicut.GoemansWilliamson

Goemans–Williamson random-hyperplane rounding for MAX-DICUT #

This module formalizes the MAX-DICUT extension of Goemans–Williamson random-hyperplane rounding [GoemansWilliamson1995, Section 7.3], reusing hyperplaneSide, signVector, and the Gaussian expectation framework from CslibFrontier.Algorithms.Lean.MaxCut.GoemansWilliamson, together with Real.goemansWilliamsonDicutConstant (β > 0.79607) and Real.goemansWilliamsonDicutConstant_mul_add_cos_le from CslibFrontier.Foundations.Analysis.SpecialFunctions.GoemansWilliamsonDicut.

Note on source typo: in display (Q'') of [GoemansWilliamson1995, Section 7.3, p. 1138], the d_{ijk} term is misprinted as 1 - y_i y_j + y_i y_k + y_j y_k; the surrounding prose on p. 1138, relaxation (P''), and Lemmas 7.3.1–7.3.2 on p. 1139 all use 1 + y_i y_j + y_i y_k + y_j y_k, which is the definition formalized here.

Main definitions #

Main results #

Limitations #

As with CslibFrontier.Algorithms.Lean.MaxCut.GoemansWilliamson, this analyzes rounding of a given vector solution under Mathlib's exact stdGaussian; polynomial-time SDP solving and finite-precision sampling are not formalized.

References #

Lemma 7.3.1 & vector form of Lemma 7.3.2 #

Triangle inequalities for three unit vectors place (arccos ⟪u, w⟫, arccos ⟪u, z⟫, arccos ⟪w, z⟫) in Real.DicutAngleSet.

Vector form of Lemma 7.3.2. For any unit vectors u, w, z, (β / 4) · (1 + ⟪u, w⟫ + ⟪u, z⟫ + ⟪w, z⟫) ≤ 1 - (arccos ⟪u, w⟫ + arccos ⟪u, z⟫ + arccos ⟪w, z⟫) / (2π).

Negated-first variant of Lemma 7.3.2: (β / 4) · (1 - ⟪u, w⟫ - ⟪u, z⟫ + ⟪w, z⟫) ≤ 1 - (arccos ⟪-u, w⟫ + arccos ⟪-u, z⟫ + arccos ⟪w, z⟫) / (2π).

Goemans–Williamson, Lemma 7.3.1. Probability that a standard Gaussian hyperplane keeps three unit vectors on the same side.

Goemans–Williamson, Lemma 7.3.1 (opposite-first variant). Probability that a standard Gaussian hyperplane puts v i on the opposite side from both v j and v k.

Three-variable quadratic program (Q'') and relaxation (P'') #

noncomputable def Cslib.Algorithms.Lean.MaxDicut.tripleCutValue {ι : Type u_1} {V : Type u_2} [Fintype ι] (triples : ι → V × V × V) (c d : ι → ℝ) (side : V → Bool) :

Objective of the quadratic program (Q'') [GoemansWilliamson1995, Section 7.3], normalized by 1 / 4: c e pays when side i ≠ side j = side k, and d e pays when side i = side j = side k.

noncomputable def Cslib.Algorithms.Lean.MaxDicut.tripleSdpValue {ι : Type u_1} {V : Type u_2} {F : Type u_3} [Fintype ι] [NormedAddCommGroup F] [InnerProductSpace ℝ F] (triples : ι → V × V × V) (c d : ι → ℝ) (v : V → F) :

Objective of the semidefinite relaxation (P'') [GoemansWilliamson1995, Section 7.3], normalized by 1 / 4.

theorem Cslib.Algorithms.Lean.MaxDicut.tripleSdpValue_signVector {ι : Type u_1} {V : Type u_2} {F : Type u_3} [Fintype ι] [NormedAddCommGroup F] [InnerProductSpace ℝ F] (triples : ι → V × V × V) (c d : ι → ℝ) {u : F} (hu : ‖u‖ = 1) (side : V → Bool) :
tripleSdpValue triples c d (MaxCut.signVector u side) = tripleCutValue triples c d side

At a cut's ±u vector solution, tripleSdpValue equals tripleCutValue.

theorem Cslib.Algorithms.Lean.MaxDicut.tripleCutValue_le_tripleSdpValue_add {ι : Type u_1} {V : Type u_2} {F : Type u_3} [Fintype ι] [NormedAddCommGroup F] [InnerProductSpace ℝ F] {triples : ι → V × V × V} {c d : ι → ℝ} {v : V → F} {ε : ℝ} (hv : ∀ (i : V), ‖v i‖ = 1) (hopt : ∀ (v' : V → F), (∀ (i : V), ‖v' i‖ = 1) → tripleSdpValue triples c d v' ≤ tripleSdpValue triples c d v + ε) (side : V → Bool) :
tripleCutValue triples c d side ≤ tripleSdpValue triples c d v + ε

If unit vectors v are within ε of optimal for tripleSdpValue, every Boolean cut has value at most tripleSdpValue triples c d v + ε.

theorem Cslib.Algorithms.Lean.MaxDicut.integrable_tripleCutValue_hyperplaneSide {ι : Type u_1} {V : Type u_2} {F : Type u_3} [Fintype ι] [NormedAddCommGroup F] [InnerProductSpace ℝ F] [MeasurableSpace F] [BorelSpace F] (triples : ι → V × V × V) (c d : ι → ℝ) (v : V → F) (μ : MeasureTheory.Measure F) [MeasureTheory.IsFiniteMeasure μ] :
MeasureTheory.Integrable (fun (r : F) => tripleCutValue triples c d (MaxCut.hyperplaneSide v r)) μ

tripleCutValue along a random hyperplane is integrable under any finite measure.

theorem Cslib.Algorithms.Lean.MaxDicut.goemansWilliamsonDicutConstant_mul_tripleSdpValue_le_integral {ι : Type u_1} {V : Type u_2} {F : Type u_3} [Fintype ι] [NormedAddCommGroup F] [InnerProductSpace ℝ F] [MeasurableSpace F] [BorelSpace F] [FiniteDimensional ℝ F] (triples : ι → V × V × V) {c d : ι → ℝ} (hc : ∀ (e : ι), 0 ≤ c e) (hd : ∀ (e : ι), 0 ≤ d e) {v : V → F} (hv : ∀ (i : V), ‖v i‖ = 1) :

Goemans–Williamson (P'') rounding bound. For nonnegative weights c and d and unit vectors v, the expected tripleCutValue under random-hyperplane rounding is at least β * tripleSdpValue triples c d v [GoemansWilliamson1995, Section 7.3].

theorem Cslib.Algorithms.Lean.MaxDicut.goemansWilliamsonDicutConstant_mul_tripleCutValue_sub_le_integral {ι : Type u_1} {V : Type u_2} {F : Type u_3} [Fintype ι] [NormedAddCommGroup F] [InnerProductSpace ℝ F] [MeasurableSpace F] [BorelSpace F] [FiniteDimensional ℝ F] (triples : ι → V × V × V) {c d : ι → ℝ} (hc : ∀ (e : ι), 0 ≤ c e) (hd : ∀ (e : ι), 0 ≤ d e) {v : V → F} (hv : ∀ (i : V), ‖v i‖ = 1) {ε : ℝ} (hopt : ∀ (v' : V → F), (∀ (i : V), ‖v' i‖ = 1) → tripleSdpValue triples c d v' ≤ tripleSdpValue triples c d v + ε) (side : V → Bool) :

The (β, ε) guarantee for (Q'').

theorem Cslib.Algorithms.Lean.MaxDicut.exists_isMaxOn_tripleSdpValue {ι : Type u_1} {V : Type u_2} {F : Type u_3} [Fintype ι] [NormedAddCommGroup F] [InnerProductSpace ℝ F] [FiniteDimensional ℝ F] [Nontrivial F] (triples : ι → V × V × V) (c d : ι → ℝ) :
∃ (v : V → F), (∀ (i : V), ‖v i‖ = 1) ∧ IsMaxOn (tripleSdpValue triples c d) {v' : V → F | ∀ (i : V), ‖v' i‖ = 1} v

Optimal unit vectors exist for tripleSdpValue in every nontrivial finite-dimensional F.

Weighted MAX-DICUT #

noncomputable def Cslib.Algorithms.Lean.MaxDicut.dicutValue {ι : Type u_1} {V : Type u_2} [Fintype ι] (ends : ι → V × V) (w : ι → ℝ) (S : V → Bool) :

The weight of the directed cut S : V → Bool (true on vertices in S) for directed arcs ends : ι → V × V with weights w: sums w e over arcs with tail in S and head outside S.

noncomputable def Cslib.Algorithms.Lean.MaxDicut.dicutSdpValue {ι : Type u_1} {V : Type u_2} {F : Type u_3} [Fintype ι] [NormedAddCommGroup F] [InnerProductSpace ℝ F] (ends : ι → V × V) (w : ι → ℝ) (v : Option V → F) :

Semidefinite relaxation objective of weighted MAX-DICUT at unit vectors v : Option V → F using truth-anchor none : Option V [GoemansWilliamson1995, Section 7.3]: ∑ e, w e * (1 + ⟪v (some u), v none⟫ - ⟪v (some w), v none⟫ - ⟪v (some u), v (some w)⟫) / 4.

noncomputable def Cslib.Algorithms.Lean.MaxDicut.dicutHyperplaneSet {V : Type u_2} {F : Type u_3} [NormedAddCommGroup F] [InnerProductSpace ℝ F] (v : Option V → F) (r : F) (x : V) :

Directed cut produced by random-hyperplane rounding: vertex x lies in S iff hyperplaneSide v r (some x) = hyperplaneSide v r none [GoemansWilliamson1995, Section 7.3].

def Cslib.Algorithms.Lean.MaxDicut.liftDicutSet {V : Type u_2} {F : Type u_3} [NormedAddCommGroup F] (u : F) (S : V → Bool) :
Option V → F

Homogeneous ±u vector lift of a directed cut S : V → Bool.

theorem Cslib.Algorithms.Lean.MaxDicut.dicutSdpValue_liftDicutSet {ι : Type u_1} {V : Type u_2} {F : Type u_3} [Fintype ι] [NormedAddCommGroup F] [InnerProductSpace ℝ F] (ends : ι → V × V) (w : ι → ℝ) {u : F} (hu : ‖u‖ = 1) (S : V → Bool) :
dicutSdpValue ends w (liftDicutSet u S) = dicutValue ends w S

At liftDicutSet u S (for ‖u‖ = 1), dicutSdpValue equals dicutValue.

The directed-cut value under random-hyperplane rounding is integrable.

Goemans–Williamson MAX-DICUT relaxation bound. For nonnegative arc weights w and unit vectors v : Option V → F, the expected directed-cut weight under random-hyperplane rounding is at least β * dicutSdpValue ends w v [GoemansWilliamson1995, Section 7.3], with β > 0.79607.

theorem Cslib.Algorithms.Lean.MaxDicut.goemansWilliamsonDicutConstant_mul_sub_le_integral {ι : Type u_1} {V : Type u_2} {F : Type u_3} [Fintype ι] [NormedAddCommGroup F] [InnerProductSpace ℝ F] [MeasurableSpace F] [BorelSpace F] [FiniteDimensional ℝ F] (ends : ι → V × V) {w : ι → ℝ} (hw : ∀ (e : ι), 0 ≤ w e) {v : Option V → F} (hv : ∀ (o : Option V), ‖v o‖ = 1) {ε : ℝ} (hopt : ∀ (v' : Option V → F), (∀ (o : Option V), ‖v' o‖ = 1) → dicutSdpValue ends w v' ≤ dicutSdpValue ends w v + ε) (S : V → Bool) :

Goemans–Williamson MAX-DICUT ε-optimal guarantee. If v are within ε of optimal for dicutSdpValue, then for every directed cut S, the expected rounded weight is at least β * (dicutValue ends w S - ε) [GoemansWilliamson1995, Section 7.3].

theorem Cslib.Algorithms.Lean.MaxDicut.goemansWilliamsonDicutConstant_mul_dicutValue_le_integral {ι : Type u_1} {V : Type u_2} {F : Type u_3} [Fintype ι] [NormedAddCommGroup F] [InnerProductSpace ℝ F] [MeasurableSpace F] [BorelSpace F] [FiniteDimensional ℝ F] (ends : ι → V × V) {w : ι → ℝ} (hw : ∀ (e : ι), 0 ≤ w e) {v : Option V → F} (hv : ∀ (o : Option V), ‖v o‖ = 1) (hopt : IsMaxOn (dicutSdpValue ends w) {v' : Option V → F | ∀ (o : Option V), ‖v' o‖ = 1} v) (S : V → Bool) :

Goemans–Williamson MAX-DICUT exact-optimum guarantee.

theorem Cslib.Algorithms.Lean.MaxDicut.exists_forall_goemansWilliamsonDicutConstant_mul_sub_le {ι : Type u_1} {V : Type u_2} {F : Type u_3} [Fintype ι] [NormedAddCommGroup F] [InnerProductSpace ℝ F] [MeasurableSpace F] [BorelSpace F] [FiniteDimensional ℝ F] (ends : ι → V × V) {w : ι → ℝ} (hw : ∀ (e : ι), 0 ≤ w e) {v : Option V → F} (hv : ∀ (o : Option V), ‖v o‖ = 1) {ε : ℝ} (hopt : ∀ (v' : Option V → F), (∀ (o : Option V), ‖v' o‖ = 1) → dicutSdpValue ends w v' ≤ dicutSdpValue ends w v + ε) :
∃ (r : F), ∀ (S : V → Bool), Real.goemansWilliamsonDicutConstant * (dicutValue ends w S - ε) ≤ dicutValue ends w (dicutHyperplaneSet v r)

Some hyperplane induces a directed cut achieving the (β, ε) MAX-DICUT guarantee against every cut S.

theorem Cslib.Algorithms.Lean.MaxDicut.exists_isMaxOn_dicutSdpValue {ι : Type u_1} {V : Type u_2} {F : Type u_3} [Fintype ι] [NormedAddCommGroup F] [InnerProductSpace ℝ F] [FiniteDimensional ℝ F] [Nontrivial F] (ends : ι → V × V) (w : ι → ℝ) :
∃ (v : Option V → F), (∀ (o : Option V), ‖v o‖ = 1) ∧ IsMaxOn (dicutSdpValue ends w) {v' : Option V → F | ∀ (o : Option V), ‖v' o‖ = 1} v

Optimal unit vectors exist for dicutSdpValue in every nontrivial finite-dimensional F.

Balanced (Eulerian) directed graphs achieve α > 0.87856 #

def Cslib.Algorithms.Lean.MaxDicut.IsBalancedDigraph {ι : Type u_1} {V : Type u_2} [Fintype ι] (ends : ι → V × V) (w : ι → ℝ) :

A weighted directed graph is balanced (Eulerian) when every vertex has equal weighted outdegree and weighted indegree, equivalently ∑ e, w e * φ (ends e).1 = ∑ e, w e * φ (ends e).2 for every potential φ : V → ℝ [GoemansWilliamson1995, Section 7.3, p. 1138].

theorem Cslib.Algorithms.Lean.MaxDicut.isBalancedDigraph_of_outdeg_eq_indeg {ι : Type u_1} {V : Type u_2} [Fintype ι] [DecidableEq V] {ends : ι → V × V} {w : ι → ℝ} (hdeg : ∀ (x : V), (∑ e : ι, if (ends e).1 = x then w e else 0) = ∑ e : ι, if (ends e).2 = x then w e else 0) :

Equal weighted outdegree and indegree at every vertex implies IsBalancedDigraph.

theorem Cslib.Algorithms.Lean.MaxDicut.two_mul_dicutValue_eq_cutValue_of_isBalancedDigraph {ι : Type u_1} {V : Type u_2} [Fintype ι] {ends : ι → V × V} {w : ι → ℝ} (hbal : IsBalancedDigraph ends w) (S : V → Bool) :
2 * dicutValue ends w S = MaxCut.cutValue ends w S

On a balanced digraph, 2 * dicutValue ends w S = cutValue ends w S.

theorem Cslib.Algorithms.Lean.MaxDicut.two_mul_dicutSdpValue_eq_sdpValue_of_isBalancedDigraph {ι : Type u_1} {V : Type u_2} {F : Type u_3} [Fintype ι] [NormedAddCommGroup F] [InnerProductSpace ℝ F] {ends : ι → V × V} {w : ι → ℝ} (hbal : IsBalancedDigraph ends w) (v : Option V → F) :
2 * dicutSdpValue ends w v = MaxCut.sdpValue ends w fun (x : V) => v (some x)

On a balanced digraph, 2 * dicutSdpValue ends w v equals the MAX-CUT relaxation value of v ∘ some.

theorem Cslib.Algorithms.Lean.MaxDicut.goemansWilliamsonConstant_mul_sub_le_integral_of_isBalancedDigraph {ι : Type u_1} {V : Type u_2} {F : Type u_3} [Fintype ι] [NormedAddCommGroup F] [InnerProductSpace ℝ F] [MeasurableSpace F] [BorelSpace F] [FiniteDimensional ℝ F] (ends : ι → V × V) {w : ι → ℝ} (hw : ∀ (e : ι), 0 ≤ w e) (hbal : IsBalancedDigraph ends w) {v : Option V → F} (hv : ∀ (o : Option V), ‖v o‖ = 1) {ε : ℝ} (hopt : ∀ (v' : Option V → F), (∀ (o : Option V), ‖v' o‖ = 1) → dicutSdpValue ends w v' ≤ dicutSdpValue ends w v + ε) (S : V → Bool) :

Goemans–Williamson balanced MAX-DICUT guarantee. When w is balanced (equal weighted outdegree and indegree at every vertex), random-hyperplane rounding achieves ratio α > 0.87856 [GoemansWilliamson1995, Section 7.3, p. 1138].