Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

A polynomial-time WordRAM reduction from 3-SAT to CLIQUE

Proved
CliqueNP.threeSat_ram_clique_reduction

by Lucas · Oct 9, 2026 · Mathlib 0df444a (Lean v4.33.1)

3-satcliquecook-levinnp-completenesswordram

There is a restricted-model WordRAM algorithm AAA computing a string function fff in polynomially many steps such that for every bit string xxx,

x∈KSAT3  ⟺  f(x)∈CLIQUE.x \in \mathrm{KSAT}_3 \iff f(x) \in \mathrm{CLIQUE}.x∈KSAT3​⟺f(x)∈CLIQUE.

Here KSAT3\mathrm{KSAT}_3KSAT3​ is the language of encodings of satisfiable CNF formulas whose clauses have at most 333 literals, and CLIQUE is the language of encodings of finite simple undirected graphs together with a threshold kkk such that the graph has a clique of at least kkk vertices.

The intended construction is Karp's: for a formula with clauses C1,…,CmC_1,\dots,C_mC1​,…,Cm​, create one vertex per literal occurrence, join two occurrences by an edge iff they lie in different clauses and are not complementary, and set the threshold to mmm. A clique of size mmm picks one consistent literal per clause, i.e. a satisfying assignment, and conversely. Strings that do not encode a 3-CNF formula must be mapped to a fixed non-member of CLIQUE (e.g. the empty graph with threshold 111). This is the NP-hardness half of CLIQUE's NP-completeness, in the same format as KSat.sat_ram_threeCNF_normalizer.

Preamble
import Definitions.Def_WordRAM_Complexity_BitIO
import Definitions.Def_KSat_Languages
import Definitions.Def_Clique_Language

set_option autoImplicit false

Formal statement
theorem CliqueNP.threeSat_ram_clique_reduction :
    ∃ (A : WordRAM.Complexity.Algorithm .restricted)
      (f : List Bool → List Bool),
      WordRAM.Complexity.RAMPolyTimeComputable A f ∧
      ∀ x, KSat.KSAT 3 x ↔ CliqueNP.CLIQUE (f x) := by sorry
Source
Richard M. Karp, Reducibility Among Combinatorial Problems, Complexity of Computer Computations, Plenum Press, pp. 85–103, 1972. https://doi.org/10.1007/978-1-4684-2001-2_9 . SAT-to-CLIQUE reduction, p. 97, restricted to clause width at most 3 (the language `KSat.KSAT 3`).

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