Theorem 3 — R[B2, MS(k)] ≤ 2^k/(2^k − 1), attained for every k ≥ 2
ProvedJohnsonApprox.MaxSatWeighted.weighted_maxsat_ratioJohnson's Theorem 3 reads: "For and , , with equality for all sufficiently large ." Here algorithm B2 is the weighted literal-selection algorithm for MAXIMUM SATISFIABILITY, is the largest number of clauses of satisfiable by one truth assignment, and the performance ratio of B2 on is for the worst output SUB the algorithm may return. The statement formalized here is:
- For every , every input of MS(k) (every clause has at least distinct literals) and every set SUB choosable by B2 on ,
- For every there are an input of MS(k) and a set SUB choosable by B2 on with and
Part 1 is the classical guarantee that B2 satisfies at least a fraction of the optimum; at it says B2 satisfies at least half of the optimum. Part 2 says the constant cannot be improved.
Formalization Note The paper's is a maximum over inputs of size at most in an unspecified encoding. Since it is a maximum over finitely many inputs and nondecreasing in , " for all " is equivalent to part 1 for every input, and "equality for all sufficiently large " is equivalent (given part 1) to the existence of one input attaining the ratio exactly, which is part 2. Ratios are multiplied out, so no division by zero can occur. Correction: the printed equality clause includes , where it is false: ratio 2 would force and every clause to be a unit clause, but on a jointly satisfiable set of unit clauses B2 never kills a clause. Equality is therefore stated for only; the separate item ratio_not_attained_k1 records the case.
import Mathlib import Definitions.Def_JohnsonApprox_Shared_Problem import Definitions.Def_JohnsonApprox_MaxSatWeighted_B2
namespace JohnsonApprox.MaxSatWeighted
/-- Theorem 3 (p. 263), size-free and with the equality range corrected to `k ≥ 2`:
(1) for `k ≥ 1`, every output of B2 on an input of `MS(k)` satisfies
`S*/|SUB| ≤ 2^k/(2^k − 1)` (multiplied out); (2) for every `k ≥ 2` some input of `MS(k)` and
some choosable output attain the ratio `2^k/(2^k − 1)` exactly. At `k = 1` the ratio `2` is
never attained, so the printed "with equality" fails there. -/
theorem weighted_maxsat_ratio :
(∀ k : ℕ, 1 ≤ k → ∀ S : Finset Shared.Clause, Shared.InMS k S → ∀ X : Finset Shared.Clause, Choosable S X →
(2 ^ k - 1) * Shared.opt S ≤ 2 ^ k * X.card) ∧
(∀ k : ℕ, 2 ≤ k → ∃ S : Finset Shared.Clause, Shared.InMS k S ∧ ∃ X : Finset Shared.Clause, Choosable S X ∧
0 < X.card ∧ (2 ^ k - 1) * Shared.opt S = 2 ^ k * X.card) := by sorry
end JohnsonApprox.MaxSatWeighted
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
The statement is a conjunction of two claims. Both are about finite sets of clauses, meaning elements of the type Shared.Clause. The statement uses three notions from the imported definition files, and their definitions are not shown here. This read-back treats them as opaque and does not unfold them:
- (
Shared.InMS k S): a predicate on a natural number and a finite set of clauses. - (
Shared.opt S): a quantity assigned to the finite clause set . Its number type is not visible. It is either a natural number or some other ordered semiring value into which natural numbers are cast. - : a relation between two finite clause sets and .
For a finite set , is its number of elements. Nothing in the statement itself refers to weights or to the multiplicity of clauses. If the type of is , all the arithmetic below is in . Otherwise, , and are read in that type.
Part (1). For every natural number , every finite clause set with , and every finite clause set with :
This is stated in multiplied-out form and does not divide by .
Part (2). For every natural number there are finite clause sets and such that all of the following hold:
- ;
- ;
- ;
- .
Part (2) says nothing about or . Part (1) says nothing about .
Degenerate cases. Because in Part (1) and in Part (2), we have . So the subtraction is never truncated, even in : it equals at , at , and so on.
- Empty in Part (1). If allows , the inequality becomes . That means , which in means .
- Empty . If allows , Part (1) still applies. The claim is then whatever the displayed inequality says for and the sets that are choosable from .
- Vacuous cases of Part (1). Part (1) holds automatically for any for which no satisfies , and for any that has no choosable .
- Part (2) cannot be vacuous. It requires witnesses to exist, and rules out the empty as a witness. In the witness, the equation forces , so is nonzero.
- Empty or one-element clause type. If
Shared.Clausehad no elements, the only possible and would be . Part (2) would then be false. The statement does not itself rule this out; that depends on the imported definitions.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.