Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Best copy of an optimal independent set of the union of masked graphs

Proved
WilliamsonShmoys.baker_union_output_bound

by もち · Nov 25, 2026 · Mathlib 0df444a (Lean v4.33.1)

bakercombinatoricsindependent-set

This is the combinatorial core of extracting Baker's answer from one solver call on the disjoint union of the kkk masked graphs.

Let GGG be a graph on {0,…,n−1}\{0,\dots,n-1\}{0,…,n−1} with levels ℓ(v)\ell(v)ℓ(v), and let k≥1k\ge1k≥1. Let UUU be the graph on {0,…,k−1}×{0,…,n−1}\{0,\dots,k-1\}\times\{0,\dots,n-1\}{0,…,k−1}×{0,…,n−1} in which (c,v)∼(c,w)(c,v)\sim(c,w)(c,v)∼(c,w) iff vw∈E(G)vw\in E(G)vw∈E(G) and ℓ(v) mod k≠c≠ℓ(w) mod k\ell(v)\bmod k\ne c\ne\ell(w)\bmod kℓ(v)modk=c=ℓ(w)modk. Give (c,v)(c,v)(c,v) the weight w′(c,v)=w(v)w'(c,v)=w(v)w′(c,v)=w(v) if ℓ(v) mod k≠c\ell(v)\bmod k\ne cℓ(v)modk=c and 000 otherwise. Let AAA be a maximum-w′w'w′ independent set of UUU, and let c\*c^\*c\* be a copy maximising w′(A∩({c}×V))w'(A\cap(\{c\}\times V))w′(A∩({c}×V)). Put

O={v: (c\*,v)∈A, ℓ(v) mod k≠c\*}.O=\{v:\ (c^\*,v)\in A,\ \ell(v)\bmod k\ne c^\*\}.O={v: (c\*,v)∈A, ℓ(v)modk=c\*}.

Then OOO is independent in GGG. Moreover, for every j<kj<kj<k and every independent set SSS of the masked graph Gj=G−{v:ℓ(v) mod k=j}G_j=G-\{v:\ell(v)\bmod k=j\}Gj​=G−{v:ℓ(v)modk=j},

∑i∈S, ℓ(i) mod k≠jw(i) ≤ ∑i∈Ow(i).\sum_{i\in S,\ \ell(i)\bmod k\ne j} w(i)\ \le\ \sum_{i\in O} w(i).i∈S, ℓ(i)modk=j∑​w(i) ≤ i∈O∑​w(i).

So the single call produces a solution at least as good as the best of the kkk shifted solutions, as Baker's shifting argument requires.

Formalization Note. GjG_jGj​ is written as SimpleGraph.fromRel (fun u v => G.Adj u v ∧ lvl u % k ≠ j ∧ lvl v % k ≠ j). Sums over SSS use the masked weight.

Preamble
import Mathlib

set_option autoImplicit false
open Classical
Formal statement
theorem WilliamsonShmoys.baker_union_output_bound {n : ℕ} (G : SimpleGraph (Fin n)) (lvl : Fin n → ℕ) (k : ℕ) (weight : Fin n → ℝ)
    (A : Finset (Fin k × Fin n))
    (hA : (SimpleGraph.fromRel (fun (x y : Fin k × Fin n) => x.1 = y.1 ∧ G.Adj x.2 y.2 ∧
        lvl x.2 % k ≠ x.1.val ∧ lvl y.2 % k ≠ x.1.val)).IsIndepSet (A : Set (Fin k × Fin n)))
    (hopt : ∀ S : Finset (Fin k × Fin n),
      (SimpleGraph.fromRel (fun (x y : Fin k × Fin n) => x.1 = y.1 ∧ G.Adj x.2 y.2 ∧
        lvl x.2 % k ≠ x.1.val ∧ lvl y.2 % k ≠ x.1.val)).IsIndepSet (S : Set (Fin k × Fin n)) →
      ∑ x ∈ S, (if lvl x.2 % k ≠ x.1.val then weight x.2 else 0) ≤
        ∑ x ∈ A, (if lvl x.2 % k ≠ x.1.val then weight x.2 else 0))
    (cs : Fin k)
    (hbest : ∀ c : Fin k, ∑ x ∈ A.filter (fun x => x.1 = c), (if lvl x.2 % k ≠ x.1.val then weight x.2 else 0) ≤
      ∑ x ∈ A.filter (fun x => x.1 = cs), (if lvl x.2 % k ≠ x.1.val then weight x.2 else 0)) :
    G.IsIndepSet ((Finset.univ.filter (fun v => (cs, v) ∈ A ∧ lvl v % k ≠ cs.val) : Finset (Fin n)) : Set (Fin n)) ∧
    ∀ j < k, ∀ S : Finset (Fin n),
      (SimpleGraph.fromRel (fun u v => G.Adj u v ∧ lvl u % k ≠ j ∧ lvl v % k ≠ j)).IsIndepSet (S : Set (Fin n)) →
      ∑ i ∈ S, (if lvl i % k ≠ j then weight i else 0) ≤
        ∑ i ∈ Finset.univ.filter (fun v => (cs, v) ∈ A ∧ lvl v % k ≠ cs.val), weight i := by sorry
Source
Williamson–Shmoys, The Design of Approximation Algorithms, Sect. 10.2 (shifting technique)

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me