Documentation

CslibFrontier.Algorithms.Lean.MaxTwoSAT.GoemansWilliamsonMaxTwoSAT

Goemans–Williamson rounding for the MaxTwoSAT problem #

This module connects the Goemans–Williamson MAX-2SAT analysis in CslibFrontier.Algorithms.Lean.MaxTwoSAT.GoemansWilliamson [GW95] to the complexity-theoretic Cslib.Complexity.MaxTwoSAT problem on MaxTwoSATInstance, whose satisfied-clause count is φ.countP (Clause.eval σ). Indexing clauses by Fin φ.length, satValue equals (φ.countP (Clause.eval σ) : ℝ) (satValue_eq_countP), and the ε-optimal rounding guarantee restates directly for MaxTwoSAT.

Main results #

References #

theorem Cslib.Algorithms.Lean.MaxTwoSAT.satValue_eq_countP {V : Type u_1} (φ : Logic.PL.CNF V) (σ : V → Bool) :
satValue (fun (i : Fin (List.length φ)) => φ[i]) (fun (x : Fin (List.length φ)) => 1) σ = ↑(List.countP (Logic.PL.Clause.eval σ) φ)

satValue counts satisfied clauses. For any φ : CNF V indexed by Fin φ.length with unit weights, satValue is (φ.countP (Clause.eval σ) : ℝ).

theorem Cslib.Algorithms.Lean.MaxTwoSAT.goemansWilliamsonConstant_mul_countP_le_integral {V : Type u_1} {F : Type u_2} [NormedAddCommGroup F] [InnerProductSpace ℝ F] [FiniteDimensional ℝ F] [MeasurableSpace F] [BorelSpace F] (φ : Logic.PL.CNF V) (hφ : ∀ c ∈ φ, List.length c ≤ 2) {v : Option V → F} (hv : ∀ (o : Option V), ‖v o‖ = 1) {ε : ℝ} (hopt : ∀ (v' : Option V → F), (∀ (o : Option V), ‖v' o‖ = 1) → satSdpValue (fun (i : Fin (List.length φ)) => φ[i]) (fun (x : Fin (List.length φ)) => 1) v' ≤ satSdpValue (fun (i : Fin (List.length φ)) => φ[i]) (fun (x : Fin (List.length φ)) => 1) v + ε) (σ : V → Bool) :

Goemans–Williamson guarantee for CNF.countP. Given φ : CNF V with all clauses of length at most 2 and ε-optimal unit vectors v : Option V → F, the expected satisfied-clause count is at least α ((φ.countP (Clause.eval σ) : ℝ) - ε) for every assignment σ.

theorem Cslib.Algorithms.Lean.MaxTwoSAT.goemansWilliamsonConstant_mul_target_le_integral_of_mem {F : Type u_2} [NormedAddCommGroup F] [InnerProductSpace ℝ F] [FiniteDimensional ℝ F] [MeasurableSpace F] [BorelSpace F] {φ : Logic.PL.CNF ℕ} {K : ℕ} (hmem : { formula := φ, target := K } ∈ Complexity.MaxTwoSAT) {v : Option ℕ → F} (hv : ∀ (o : Option ℕ), ‖v o‖ = 1) {ε : ℝ} (hopt : ∀ (v' : Option ℕ → F), (∀ (o : Option ℕ), ‖v' o‖ = 1) → satSdpValue (fun (i : Fin (List.length φ)) => φ[i]) (fun (x : Fin (List.length φ)) => 1) v' ≤ satSdpValue (fun (i : Fin (List.length φ)) => φ[i]) (fun (x : Fin (List.length φ)) => 1) v + ε) :

Goemans–Williamson guarantee for Cslib.Complexity.MaxTwoSAT. If ⟨φ, K⟩ ∈ MaxTwoSAT and unit vectors v are within ε of optimal for satSdpValue, then the expected number of clauses satisfied by satHyperplaneAssignment v r is at least α ((K : ℝ) - ε).