NAEtoColor.NAEtoColorReduction
theoremverifiedformalizationimported Lean
Correctness of the NAE-SAT to 3-coloring reduction. Let $f$ be a NAE-SAT instance over a variable type $V$, and let $\Gamma(f)$ denote its reduction graph, the simple graph built from $f$ as described above (a ground vertex joined to every variable vertex, each variable vertex joined to the clause-gadget vertices for the clauses in which it occurs, and the three gadget vertices of each clause joined pairwise into a triangle). Then $f$ is satisfiable if and only if $\Gamma(f)$ is 3-colorable.
Statement
set_option relaxedAutoImplicit false in set_option autoImplicit false in theorem NAEtoColor.NAEtoColorReduction {V : Type} (f : NAESat3 V) : IsSatisfiable f ↔ Is3Colorable (ReductionGraph f)
- Formalizes
- Correctness of the NAE-SAT to 3-coloring reduction, as formalized in TCSlib (`NAEtoColor.NAEtoColorReduction`)
- Lean proof
- By CS 294-268 course staff (UC Berkeley, Spring 2026), from github.com/Shilun-Allan-Li/tcslib at
c8a02591b1e5(Copyright (c) 2026 UC Berkeley CS 294. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.25.0.NAEtoColor.NAEtoColorReduction← NAEtoColor.NAEtoColorReduction (TCSlib/Complexity/NPReductions/NAESATToColoring.lean:384): verbatim
- Verified
- 07 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 7
- NAEtoColor.NAEtoColorCompletenessCompleteness of the NAE-SAT to 3-coloring reduction. Let $f$ be a NAE-SAT instance over a variable type $V$, that is, a list of…
- NAEtoColor.NAEtoColorSoundnessSoundness of the NAE-SAT to 3-coloring reduction. Let $f$ be a NAE-SAT instance over a variable type $V$, that is, a list of Not-All-Equal…
- NAEtoColor.NAESat3A NAE-SAT instance over variable type $V$ is defined as a list of NAE clauses, i.e.\…
- NAEtoColor.ReductionGraphGiven a NAE-SAT instance $f$, $\texttt{NAEtoColor.ReductionGraph}\;f$ is the simple graph on $\texttt{NAEtoColor.OutputVertex}\;V$ whose…
- NAEtoColor.IsSatisfiableA NAE-SAT instance $f$ over variable type $V$ is satisfiable if there exists a Boolean assignment…
- NAEtoColor.Is3ColorableA simple graph $G$ on vertex type $V'$ is 3-colorable if there exists a proper coloring $G.\mathtt{Coloring}\;(\mathrm{Fin}\,3)$,…
- NAEtoColor.OutputVertexThe vertex set of the reduction graph is an inductive type with three constructors:
• $\mathtt{groundNode}$ --- a…
Lean source view module on GitHub
set_option relaxedAutoImplicit false in set_option autoImplicit false in /-- Main reduction theorem from NAE-SAT to 3-Coloring. -/ theorem NAEtoColor.NAEtoColorReduction {V : Type} (f : NAESat3 V) : IsSatisfiable f ↔ Is3Colorable (ReductionGraph f) := Iff.intro (NAEtoColorCompleteness f) (NAEtoColorSoundness f)