CLIQUE is NP-complete
ProvedCliqueNP.clique_npCompleteThe encoded CLIQUE language is NP-complete under the existing Cook–Levin definitions: it has a polynomial-time verifier with polynomially bounded accepted certificates, and every language in that NP class polynomial-time many-one reduces to it. The graph and requested clique size are both supplied as input.
The intended proof reduces the existing language KSat.KSAT 3 to CLIQUE, constructs the reduction and verifier with the shared WordRAM model, and reuses the proved polynomial backend. The published k-SAT theorem specialized to 3 supplies the intended NP-hardness prerequisite. The formal conclusion is unconditional and does not assume that prerequisite or a reduction as a hypothesis; it states NP-completeness without prescribing a particular proof.
import Definitions.Def_Clique_Language import Definitions.Def_KSat_Languages import Definitions.Def_WordRAM_Complexity_Simulation set_option autoImplicit false
theorem CliqueNP.clique_npComplete : CookLevin.NPComplete CliqueNP.CLIQUE := by sorry
Read-back
What the Lean code literally says, in plain math · GPT-6 (independent Codex sub-agent)
With no parameters, hypotheses, or typeclass assumptions, the declaration asserts that the following language of all finite Boolean strings is both in NP and NP-hard under the precise machine and encoding conventions described here. Identify false and true with the bits and , and let for every natural number , including . Membership means that there exist natural numbers , a finite Boolean list , and a finite set such that , , every diagonal entry for is false, for every , , and is true for every distinct ; concatenation is exact and indices start at zero. Equivalently, the underlying graph data are an arbitrary natural vertex count and Boolean list, adjacency requires both vertices to be below the count and the row-major list entry to be true, missing list entries default to false, and the language separately requires the list to have exactly the square of the vertex count entries and to describe a symmetric, loop-free graph. Thus the threshold is part of the input and ranges over all naturals, the selected vertices are distinct and in range, and the condition asks for at least selected vertices. A valid encoding has length . Every valid simple graph is accepted at threshold using the empty set, including the graph with zero vertices and empty matrix, whose threshold- encoding is the two-bit string ; threshold is satisfied precisely when a valid graph has at least one vertex, and thresholds greater than are unsatisfied. Strings with missing unary delimiters, wrong matrix length, loops, asymmetry, or otherwise no such representation are outside , including the empty string, even when a putative threshold is . To specify the NP assertion, write for this property of a language : there exist a total Boolean-valued function on pairs of finite bit strings, natural witness-bound constants , a machine , and natural numbers , such that is legal with tapes and alphabet size , for every pair its execution from the initial configuration for after exactly steps is in state and cell of tape contains the symbol for , every pair accepted by satisfies , and for every finite bit string , . The verdict and running-time conditions apply to every witness, including witnesses exceeding the certificate-length bound, which must be rejected; witnesses need not have exactly the bound length and need not be unique. The first conjunct of the theorem is . Its second conjunct says that for every language satisfying , there exist a total function , a machine , and natural numbers such that is legal with tapes and alphabet size and, for every finite bit string , if , then its execution from the initial configuration for after exactly steps is in state , its output as defined below is exactly , and . Here is the empty bit string; the output is read from cell of tape at that final configuration, decoding consecutive bit symbols until either the first non-bit symbol or a maximum of cells have been inspected. No additional terminator condition after that maximum is imposed by the output definition. The function, machine, tape count, alphabet size, and polynomial constants may depend on , but are fixed across all inputs to that reduction; the verifier and its constants are likewise fixed across all input/witness pairs for its language. In both conjuncts, a machine is a finite list of commands, with states numbered by natural numbers, initial state , and halting state the length of that list. A command is a total function of the list of scanned natural-number symbols returning a next state and a list of write/move actions. Legality requires at least two tapes and an alphabet size at least four; on every scanned list of the stipulated tape count each command produces exactly that many actions and a next state at most the machine length, rewrites tape with its scanned symbol, and, whenever all scanned symbols are less than the alphabet size, writes only symbols below that size. Tapes have cells indexed by natural numbers; an action writes at the current head and then moves left, stays, or moves right, with left movement from cell remaining at . One unit of time is one application of the transition operation, simultaneously applying the current command's actions to the tapes and setting its next state; at or above the machine length this operation leaves the configuration unchanged. Initially every head is at cell , every tape has start symbol in cell , tape holds the first bit string from cell , tape holds the second bit string from cell , all other tapes are empty after their start symbol, and all remaining cells contain blank symbol ; bit false is represented by symbol and bit true by symbol . Only tape is required to be read-only, and tape may also be the verdict/output tape when there are exactly two tapes. The definitions impose no general requirement to preserve the initial start symbol on writable tapes. Being halted at the stated bound permits halting earlier, because halting configurations are fixed points. All polynomial coefficients and exponents are naturals, with zero permitted by their quantifiers, and bounds and correctness include empty inputs and empty witnesses. The statement supplies no particular verifier, certificate format, reducing function, numerical exponent, or coefficient; it does not assert uniqueness or injectivity of any of them, a reduction specifically from a satisfiability language, a WordRAM algorithm or WordRAM running-time bound, a simulation backend, a fixed-threshold completeness result, an algorithm that outputs a clique, or any separation of complexity classes. For a negative instance of , reduction correctness requires only that lie outside , so it does not require the reduction to output a valid graph encoding on every input.
Confirmed by the mission captain (proposal self-audit).