ThreeSATToClique.ThreeSAT_to_Clique_equivalence
theoremverifiedformalizationimported Lean
Correctness of the 3-SAT to Clique reduction. Let $f$ be a 3-CNF formula with $m$ clauses. Then $f$ is satisfiable if and only if its conflict graph has a clique of size $m$; that is, the graph whose vertices are the literal positions of $f$, with two positions adjacent exactly when they lie in different clauses and their literals do not conflict, contains $m$ pairwise-adjacent vertices precisely when some truth assignment satisfies every clause of $f$.
Statement
set_option relaxedAutoImplicit false in set_option autoImplicit false in theorem ThreeSATToClique.ThreeSAT_to_Clique_equivalence {V : Type} (f : Formula3 V) : is3Satisfiable f ↔ hasClique (toCliqueGraph f) f.length
- Formalizes
- Correctness of the 3-SAT to Clique reduction, as formalized in TCSlib (`ThreeSATToClique.ThreeSAT_to_Clique_equivalence`)
- Lean proof
- By Yangshuo Zou, from github.com/Shilun-Allan-Li/tcslib at
c8a02591b1e5(Copyright (c) 2026 Yangshuo Zou. 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.ThreeSATToClique.ThreeSAT_to_Clique_equivalence← ThreeSATToClique.ThreeSAT_to_Clique_equivalence (TCSlib/Complexity/NPReductions/ThreeSATToClique.lean:338): verbatim
- Verified
- 07 Oct 2026
- Axioms
Classical.choiceQuot.soundpropext- Built on 8
- ThreeSATToClique.ThreeSAT_to_Clique_soundnessSoundness of the 3-SAT to clique reduction. Let $f$ be a 3-CNF formula consisting of $m$ clauses. If the conflict graph of $f$ has an…
- ThreeSATToClique.Formula3A 3-CNF formula over $V$ is a list of 3-clauses, representing their conjunction.
- ThreeSATToClique.hasCliqueA graph $G$ on vertex type $V$ has a $k$-clique if there exists a finite set $s \subseteq V$ of $k$ vertices that are pairwise…
- ThreeSATToClique.is3SatisfiableA 3-CNF formula $f$ is satisfiable if there exists an assignment $\alpha$ such that $\alpha$ satisfies $f$.
- ThreeSATToClique.ThreeSAT_to_Clique_completenessCompleteness of the 3-SAT to clique reduction. Let $f$ be a 3-CNF formula consisting of $m$ clauses, and let its conflict graph be the…
- ThreeSATToClique.toCliqueGraphThe conflict graph of a 3-CNF formula $f$ is the simple graph on vertex set $\mathtt{CliqueVertex}\,f.\mathtt{length}$ in which two…
- ThreeSATToClique.Clause3A 3-clause over $V$ is a structure with exactly three literals $l_1, l_2, l_3 : \mathtt{Literal}\,V$, representing a disjunction of…
- ThreeSATToClique.CliqueVertexA vertex of the conflict graph for a formula with $m$ clauses is a pair $\langle c\_idx, l\_idx \rangle$ where $c\_idx : \mathrm{Fin}\,m$…
Lean source view module on GitHub
set_option relaxedAutoImplicit false in set_option autoImplicit false in /-- **Equivalence**: a 3-CNF formula is satisfiable if and only if its conflict graph contains a clique of size equal to the number of clauses. -/ theorem ThreeSATToClique.ThreeSAT_to_Clique_equivalence {V : Type} (f : Formula3 V) : is3Satisfiable f ↔ hasClique (toCliqueGraph f) f.length := ⟨ThreeSAT_to_Clique_completeness f, ThreeSAT_to_Clique_soundness f⟩