Peter Shor - Daddy of Quantum Computer


Peter Shor is an American mathematician and computer scientist, best known for creating Shor’s algorithm, a quantum algorithm that can factor large integers exponentially faster than the best known classical algorithms. This discovery, made in 1994, is what made quantum computing go from a weird theoretical curiosity to a field with teeth.

Why it’s a big deal:
・Most modern encryption—like RSA—depends on the fact that factoring huge numbers (hundreds or thousands of digits long) is extremely hard for classical computers.
・Shor showed that a quantum computer, if sufficiently large and stable, could factor those numbers efficiently, which means it could theoretically break RSA encryption.

In short: Shor proved that quantum mechanics could shatter classical cryptography.
He didn’t build the computer himself (no one had one at the time), but his math made the race to build quantum hardware suddenly matter.

Peter Shor himself is still an active researcher—he’s a professor at MIT—and has also contributed to quantum error correction, which helps stabilize quantum computations that would otherwise fall apart due to decoherence.

The fascinating bit is that Shor’s algorithm is simultaneously a triumph of pure mathematics and a warning shot to the entire field of cybersecurity. It’s one of those rare ideas that makes both mathematicians and engineers sweat for entirely different reasons.

If you like, we could unpack how Shor’s algorithm actually works—using Fourier transforms and periodicity detection—or explore how current “post-quantum cryptography” is trying to outpace it.


Here are key materials and a sketch of his main theorems.


 Milestone paper

The landmark paper is:
Title: “Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer” by Peter W. Shor. (arXiv)
URL (arXiv): https://arxiv.org/abs/quant-ph/9508027 (arXiv)
Also available (PDF): https://users.cs.duke.edu/~reif/courses/randlectures/Quantum.papers/shor.factoring.pdf (users.cs.duke.edu)
This is the main paper that introduced what we now colloquially call “Shor’s algorithm”.



 On-YouTube talk

Here’s a solid video:

The Story of Shor’s Algorithm, Straight From the Source

Title: “The Story of Shor’s Algorithm, Straight From the Source | Peter Shor” on YouTube. It features Shor himself narrating the origin and ideas behind his algorithm.


Selected theorems / results by Shor

Here are several of his major contributions (I’ll call them “theorems/results” loosely) with rough description. Note: some are more informal results than neatly labeled “theorem-X”.

Quantum factoring & discrete log polynomial-time result

  • In the milestone paper above, Shor shows that a quantum computer (ideal, error-free) can factor integers and compute discrete logarithms in polynomial time (in the input size). (arXiv)

  • The significance: classically factoring and discrete log are believed to require super-polynomial time; Shor’s result flips that in the quantum setting.

Quantum error correcting codes / “Shor code”

  • In his work he introduced quantum error-correcting codes (e.g., encoding 1 logical qubit into 9 physical qubits) to protect quantum information. (Fiveable)

  • One concrete statement: “Given any possible unitary, measurement, or quantum operation on a one-error quantum code, the code can correct it.” (Windows On Theory)
    This is a more technical theorem of his on error correction.

Fault‐tolerant quantum computation / threshold‐type results

  • Shor contributed to showing that quantum computers can perform arbitrarily long computations provided the physical error rate is below some threshold (rough version). (math.ucsd.edu)

  • While the full “quantum threshold theorem” was proven by others as well, Shor’s work laid much of the groundwork. (Wikipedia)

Quantum channel capacity (“hashing bound” / coherent information)

  • Shor also worked in quantum information theory: e.g. on the quantum channel capacity concept (though the full theorem is attributed to others too). (Wikipedia)

(Theorems & Prooves)

Here’s a consolidated narrative of four of Peter W. Shor’s most important theoretical results, each paired with the original paper and the exact theorem-level statements where available. No tables, just the flow of ideas and sources.


1. Polynomial-time quantum factoring and discrete logarithms
In his seminal paper “Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer” (arXiv:quant-ph/9508027), Shor rigorously proved that a quantum computer can factor integers and compute discrete logarithms in time polynomial in the size of the input number.
The core theorem is stated as follows:

“A quantum computer can find the period of a periodic function and hence factor integers and compute discrete logarithms in polynomial time.”

This proof combines two ingredients: the reduction of factoring to period finding, and the demonstration that the quantum Fourier transform can find that period efficiently. The theorem formally places factoring in the class BQP (bounded-error quantum polynomial time), implying that quantum mechanics changes the landscape of computational complexity itself.


2. Reduction of factoring to order-finding
Also proven in the same 1994 paper, Shor’s order-finding theorem shows that the difficult number-theoretic task of factoring can be converted into the task of finding the order (the smallest positive integer (r) such that (a^r ≡ 1 \pmod N)). Once this order is known, the factors of (N) can be extracted with high probability.
The theorem reads conceptually as:

“Given an efficient algorithm for finding the order of a randomly chosen integer modulo N, one can find a non-trivial factor of N with high probability.”

This is the mathematical hinge that turns quantum interference into number-theoretic power. The correctness proof shows that almost any choice of a random base (a) will yield a useful order unless (a) shares a factor with N — which is already a success case.


3. Existence of good quantum error-correcting codes
In collaboration with Andrew Calderbank, Shor proved in “Good Quantum Error-Correcting Codes Exist” (arXiv:quant-ph/9512032) that it is theoretically possible to design quantum codes that protect information from noise without destroying the encoded quantum state.
The formal theorem in that paper states:

“There exist families of quantum error-correcting codes with non-zero asymptotic rate and non-zero relative distance.”

In plain language, this means we can encode qubits in a way that allows us to correct many types of errors without the exponential overhead feared by early skeptics. This result provided a rigorous mathematical foundation for quantum reliability — before it, the field was unsure if error correction was even compatible with quantum physics.


4. Fault-tolerant quantum computation
In “Fault-Tolerant Quantum Computation” (arXiv:quant-ph/9605011), Shor extended the previous result to show that large-scale, accurate quantum computation is achievable in principle.
The core theorem is expressed as:

“Arbitrary long quantum computations can be performed reliably if the error per gate, measurement, and preparation is below a certain constant threshold.”

This means there exists a numerical threshold such that, by encoding qubits redundantly and performing corrections often enough, one can make errors decay faster than they accumulate. It is the theoretical assurance that scalable quantum computing is not forbidden by physics or information theory.



Cook's Theorem - Validation

https://dl.acm.org/doi/10.1145/800157.805047

(from several websites)

This paper, "The Complexity of Theorem-Proving Procedures" by Stephen A. Cook, introduces the concept of polynomial-time reducibility to classify the difficulty of computational problems1111. It famously demonstrates that the problem of determining whether a propositional formula is a tautology is "at least as hard" as any problem that can be solved by a nondeterministic Turing machine in polynomial time2.


Polynomial-Time Reducibility

The paper establishes a formal way to relate the complexity of different problems.

  • P-Reducibility: A set of strings $S$ is P-reducible (polynomial-time reducible) to a set $T$ if $S$ can be solved by a deterministic Turing machine in polynomial time, provided it has access to an "oracle" that can instantly decide membership in $T$3333. This is defined using "query machines"4.

  • Polynomial Degrees: This notion of reducibility is transitive 5, meaning it can be used to group problems into equivalence classes that share the same polynomial degree of difficulty6666.

  • The Class $L_*$ (P): The paper uses $L_*$ to denote the class of sets that can be recognized by a deterministic Turing machine in polynomial time7.


Theorem 1: The Cook-Levin Theorem

The paper's first main theorem establishes the foundational concept of NP-completeness (though not using that term).

Theorem 1 states that if a set $S$ is accepted by any nondeterministic Turing machine within polynomial time, then $S$ is P-reducible to the set of {DNF tautologies} (propositional formulas in disjunctive normal form that are tautologies)8.

The proof involves a "master reduction":

  1. Given a nondeterministic Turing machine $M$ and an input $w$, a propositional formula $A(w)$ in conjunctive normal form (CNF) is constructed9.

  2. This formula is built using proposition symbols that describe the machine's computation (e.g., $P_{s,t}^i$ for "tape square $s$ has symbol $\sigma_i$ at time $t$" 10, $Q_t^i$ for "machine is in state $q_i$ at time $t$" 11, and $S_{s,t}$ for "tape square $s$ is scanned at time $t$" 12).

  3. The formula $A(w)$ is constructed in parts (B, C, D, E, F, G, H, I) that assert the machine starts correctly 13, follows its transition rules 14, and reaches an accepting state15.

  4. Crucially, $A(w)$ is satisfiable if and only if $M$ accepts $w$16.

  5. Therefore, its negation, $\neg A(w)$, is a tautology if and only if $w$ is not in $S$ ($w \notin S$)17.

  6. This $\neg A(w)$ can be easily converted to disjunctive normal form (DNF) using De Morgan's laws18.

  7. Since this entire construction can be performed in polynomial time19, it reduces the problem $S$ to determining tautologyhood.

A corollary notes that this implies many other problems, such as the subgraph problem 2020, are also P-reducible to {DNF tautologies}, because these problems (or their complements) are accepted by nondeterministic machines in polynomial time21.


Theorem 2: Equivalent Difficult Problems

The second main theorem shows that several problems are equivalent in difficulty.

Theorem 2 states that the following sets are all P-reducible to each other, and thus share the same polynomial degree of difficulty2222:

  • {tautologies}

  • {DNF tautologies}

  • $D_3$ (DNF tautologies where each disjunct has at most three conjuncts) 23232323

  • {subgraph pairs} (determining if one graph is isomorphic to a subgraph of another) 24242424

The proof demonstrates the necessary reductions, including:

  • {DNF tautologies} to $D_3$: A DNF formula with large disjuncts (e.g., $R_1 \& \dots \& R_s$ where $s>3$) is reduced to a new formula with smaller disjuncts by introducing new proposition symbols, a process that can be repeated in polynomial time 25.

  • $D_3$ to {subgraph pairs}: For a $D_3$ formula $A$, two graphs $G_1$ and $G_2$ are constructed 26. The construction is designed so that $G_1$ can be embedded into $G_2$ if and only if the formula $A$ is not a tautology ($A \notin D_3$)27.

The paper remarks that {primes} and {isomorphic graph pairs} were not successfully added to this list of equivalent problems28.


Implications and Discussion

The theorems provide strong evidence that these problems are "difficult" to solve29292929.

  • The author suggests it is "fruitless" to search for a polynomial-time procedure for the subgraph problem, because success would provide polynomial-time procedures for many other "apparently intractible problems"30.

  • Cook conjectures that {tautologies} is a "good candidate for an interesting set not in $L_ [cite_start]*$ " (the class P)31.

  • He states that proving this conjecture (i.e., proving P $\neq$ NP) would be a "major breakthrough in complexity theory"32.


Complexity of Predicate Calculus

The paper also introduces a method to measure the complexity of proof procedures for the predicate calculus, which is known to be undecidable33333333.

  • This measure is based on the Herbrand theorem34.

  • It defines $\phi(A)$ as the smallest number $k$ such that the conjunction of the first $k$ substitution instances ($A_1 \& \dots \& A_k$) of a formula $A$ is truth-functionally inconsistent35.

  • The efficiency of a proof procedure $Q$ is then measured by a function $T_Q(k)$, which is the time required to terminate for a formula $A$ where $\phi(A) \le k$ and the length of $A$ is limited ($|A| \le \log_2 k$)36.

  • The paper provides a lower bound for $T_Q(k)$ 37373737and an upper bound 38383838, noting the "large gap" between them39.

  • This discussion is linked back to the P vs. NP problem, suggesting that improving these bounds is related to solving major open questions in complexity theory 40.

(VALIDATION)

Based on the provided text, the logical structure of the proofs is sound and follows a clear, deductive path. The paper's arguments are built on constructive reductions, where one problem is methodically transformed into another.

Here is a validation of the logic for the key theorems as presented in the document.


Theorem 1: NP P-reducible to {DNF tautologies}

The logic of this proof is to show that any problem $S$ in NP can be "disguised" as a tautology problem.

  1. The Setup: The proof starts with a nondeterministic Turing machine (NDTM) $M$ that accepts a set of strings $S$ in polynomial time, $Q(n)$1.

  2. The Construction: For any given input string $w$, the goal is to build a specific propositional formula $A(w)$ in Conjunctive Normal Form (CNF)2.

  3. The Formula's Meaning: This formula $A(w)$ is meticulously constructed using proposition symbols that describe the machine's computation (e.g., tape contents, machine state, and head position at each step) 3. The formula itself is a large conjunction of clauses that enforce all the rules of the Turing machine:

    • It must be in exactly one state at a time4444.

    • It must have exactly one symbol per tape square5.

    • It must start in the correct initial configuration for input $w$6666.

    • It must follow its transition rules at every step7.

    • It must eventually reach an accepting state8.

  4. The Logical Pivot: Because of this construction, the formula $A(w)$ has a critical property: $A(w)$ is satisfiable if and only if the machine $M$ accepts the input $w$9. If $M$ accepts $w$, there exists a valid, accepting computation, and the steps of that computation provide a "satisfying assignment" that makes $A(w)$ true10101010. If $M$ does not accept $w$, no such computation exists, and the formula $A(w)$ will be contradictory (unsatisfiable).

  5. The Final Transformation: The proof then uses a standard logical equivalence:

    • Since $A(w)$ is satisfiable if and only if $w \in S$, its negation, $\neg A(w)$, must be a tautology (always true) if and only if $w \notin S$11.

    • By De Morgan's laws, $\neg A(w)$ (the negation of a CNF formula) can be easily put into Disjunctive Normal Form (DNF)12.

    • This entire construction process (building $A(w)$ and negating it) is feasible in polynomial time13.

Validation: The logic holds. It successfully reduces the problem of "Is $w \in S$?" to the problem of "Is this corresponding DNF formula $\neg A(w)$ a tautology?". This establishes that {DNF tautologies} is at least as hard as any problem in NP.


Theorem 2: Equivalence of Problems

The logic here is to show that several problems are P-reducible to each other, forming a "cycle" of reductions which proves they all have the same degree of difficulty14.

The proof logic, as described, relies on two key new reductions:

1. {DNF tautologies} is P-reducible to $D_3$

  • Goal: To take any DNF formula $A$ and transform it into a $D_3$ formula $A'$ (where disjuncts have at most 3 conjuncts) such that $A$ is a tautology iff $A'$ is15.

  • Logic: The proof uses a "splitting" trick. If a disjunct $B_1$ has too many parts (e.g., $R_1 \& R_2 \& \dots \& R_s$), it is replaced by introducing a new, unused atom $P$ 16.

  • The single disjunct $B_1$ is replaced by two new ones: $(P \& R_3 \& \dots \& R_s) \vee (\neg P \& R_1 \& R_2)$17.

  • This transformation preserves tautologyhood. The process is repeated until all disjuncts are small enough18.

  • Validation: This is a standard and logically sound reduction. The transformation can be completed in polynomial time19.

2. $D_3$ is P-reducible to {subgraph pairs}

  • Goal: To take a $D_3$ formula $A$ and transform it into two graphs, $G_1$ and $G_2$, such that $G_1$ is isomorphic to a subgraph of $G_2$ if and only if $A$ is not a tautology20.

  • Logic: This is the most complex reduction in the paper.

    • The formula $A$ is a disjunction of clauses: $C_1 \vee \dots \vee C_k$21.

    • $A$ is not a tautology if there is some "falsifying assignment" that makes every clause $C_i$ false.

    • Since each $C_i$ is a conjunction ($R_{i1} \& R_{i2} \& R_{i3}$), making $C_i$ false means making at least one of its literals ($R_{ij}$) false.

    • Graph $G_1$ is a complete graph with $k$ vertices, $\{v_1, \dots, v_k\}$ (one vertex per clause)22.

    • Graph $G_2$ has vertices $\{u_{ij}\}$ (one vertex for each literal in the formula)23.

    • Edges in $G_2$ are created very specifically: an edge connects $u_{ij}$ and $u_{rs}$ only if the corresponding literals $R_{ij}$ and $R_{rs}$ are not contradictory (i.e., they are not an "opposite pair" like $P$ and $\neg P$) 24.

  • The Logical Pivot: A mapping from the vertices of $G_1$ to the vertices of $G_2$ (a "homomorphism") corresponds to picking one literal to falsify from each clause 25. The edge structure of $G_2$ guarantees that such a mapping can only exist if the chosen literals are consistent (i.e., you never try to falsify both $P$ and $\neg P$).

  • Therefore, a subgraph embedding exists if and only if a consistent falsifying assignment exists 26.

  • The paper then refines this by adding "gadget" graphs to $G_1$ and $G_2$ to ensure the mapping is one-to-one (an isomorphism), but the core logic remains 27.

  • Validation: The logic of this construction is sound. It successfully translates the properties of the formula $A$ into the properties of the graphs $G_1$ and $G_2$.

Overall Conclusion: The proof logic described in the paper is valid. It relies on a series of ingenious, polynomial-time constructions that correctly map the properties of one problem (like NP machine acceptance or DNF tautology) onto the properties of another (like DNF tautology or subgraph isomorphism).


(HOW TO INCREASE THE READABILITY)

Of course. The provided text is a landmark academic paper, but it's famously dense. To make the core ideas more readable, you can apply several modern communication techniques.

The key is to add structure, define terms in plain English, and use analogies before presenting the formal logic.

Here is a breakdown of how to "refactor" the theorem's explanation for clarity.

1. Start with a "Why It Matters" Summary

Before diving into "P-reducibility" or "Turing machines," tell the reader the main takeaway. People will follow the complex details if they know the destination.

Original Concept: "It is shown that any recognition problem solved by a polynomial time-bounded nondeterministic Turing machine can be 'reduced' to the problem of determining whether a given propositional formula is a tautology."

More Readable Version:

"This paper proves that a huge class of 'hard' problems (called NP) can all be translated into one single, famous problem: SAT (Boolean Satisfiability).

This means that if you could find a fast way to solve SAT, you would automatically have a fast way to solve thousands of other hard problems, like the 'subgraph problem', protein folding, or cracking many forms of encryption.

The paper proves this by showing how to build a 'problem-translating machine' (a "reduction") that turns any NP problem into a giant SAT formula."


2. Define Key Concepts with Simple Analogies

The paper assumes the reader is an expert. A readable explanation defines its terms first.

Concept 1: Nondeterministic Turing Machine (The "Perfect Guesser")

  • Paper's Language: "a polynomial time-bounded nondeterministic Turing machine"

  • Simple Analogy: "Imagine a computer that can perfectly guess the right path.

    • A normal (deterministic) computer trying to solve a maze has to try one path, hit a dead end, backtrack, and try another. This takes a long time.

    • A nondeterministic computer gets to a fork in the road and clones itself, with each clone trying one path simultaneously. If any clone finds the exit, the machine says 'Yes, a path exists!'

    • Problems in NP (Nondeterministic Polynomial time) are all the problems this 'perfect guesser' could solve quickly (in polynomial time)."

Concept 2: Tautology / Satisfiability (The "Logic Puzzle")

  • Paper's Language: "determining whether a given propositional formula is a tautology." (Note: The paper's proof actually constructs a satisfiable formula, which is the flip-side of a tautology. We'll focus on Satisfiability (SAT) as it's more direct.)

  • Plain English: "A SAT problem is a big logic formula, like:

    (A or B) AND (NOT A or C) AND (B or NOT C)

  • The Goal: Can you find a set of True/False values for A, B, and C that makes the entire statement True? (For this one, the answer is True. Try A=True, B=False, C=True).

  • Why it's hard: For 3 variables, there are only $2^3 = 8$ combinations to check. For 100 variables, there are $2^{100}$—more atoms than in the observable universe. There's no known "shortcut."

Concept 3: P-Reducibility (The "Problem Translator")

  • Paper's Language: "Here 'reduced' means... that the first problem can be solved deterministically in polynomial time provided an oracle is available for solving the second."

  • Simple Analogy: "This is the 'problem translator.' We are 'reducing' Problem A to Problem B.

    • Imagine you don't know how to solve Sudoku (Problem A), but you have a magic 'friend' (an oracle) who can instantly solve any SAT puzzle (Problem B).

    • A reduction is a rulebook that lets you translate any Sudoku puzzle into a giant SAT formula. This translation process itself must be fast (polynomial time).

    • How you solve Sudoku: You get a new Sudoku, use your rulebook to translate it into a SAT formula, and hand it to your friend. When they instantly give you the True/False answer, that answer also tells you the solution to your Sudoku.

    • What this proves: This proves that Sudoku (Problem A) is "no harder than" SAT (Problem B).


3. Re-structure the Proof Logic

Now, you can put these pieces together to explain the actual proof clearly.

Readable Proof Outline:

The paper's "master-stroke" is proving that any NP problem can be translated into a SAT problem. It does this with a universal "rulebook."

  1. The Goal: Take any program $M$ (our "perfect guesser" NDTM) and an input $w$, and build a giant SAT formula $A(w)$ that is satisfiable if and only if the program $M$ accepts the input $w$.

  2. The "Blueprint" for the Formula: The formula is built from thousands of variables that represent the entire computation history of the machine over time. The variables are like cells in a giant spreadsheet:

    • State_is_q_at_time_t: Is the machine in state $q$ at step $t$? (True/False)

    • Head_is_at_cell_s_at_time_t: Is the tape head at position $s$ at step $t$? (True/False)

    • Cell_s_has_symbol_i_at_time_t: Is the symbol $\sigma_i$ written in cell $s$ at step $t$? (True/False)

  3. The "Rules" of the Formula: The formula $A(w)$ is a massive AND of several groups of rules, which force the variables to behave like a real computation:

    • Part E (Start): "At time $t=1$, the machine must be in the start state, and the tape must contain the input $w$."

    • Part C (Unique state): "At any given time $t$, the machine must be in one and only one state."

    • Parts F, G, H (Valid moves): "If at time $t$ the machine is in state $q_i$ and reads symbol $\sigma_j$, then at time $t+1$ it must be in a valid next state and the tape must be updated according to the machine's rules."

    • Part I (Finish): "At some point in time, the machine must enter the 'accepting' state."

  4. The "Aha!" Moment: If the machine $M$ can accept the input $w$, then a valid, accepting computation history exists. This history provides the exact set of True/False values that will make the entire giant formula $A(w)$ satisfiable. If no such computation exists, the rules will contradict each other, and the formula will be unsatisfiable.

By doing this, Cook created a "translator" that turns any NP problem into a SAT problem, proving that SAT is the "hardest" problem in all of NP.



(TRY TO WRITE THIS IN LEAN)

Writing a complete, machine-verified proof of the Cook-Levin theorem in Lean is a massive, research-level undertaking that would span thousands of lines.

However, I can provide a rigorous outline of the proof in Lean, defining the key structures and theorems. This demonstrates how the proof from the paper is formally constructed, which is a common practice in formalization.

We will follow the paper's structure precisely, building the formula $A(w)$ from parts B, C, D, E, F, G, H, and I.


1. Preliminaries: Defining Boolean Logic

First, we define what a propositional formula (PropForm) and satisfiability (Sat) mean. We will use a Fin n type to represent a finite set of $n$ atomic variables.

Lean
import Mathlib.Data.Fin.VecNotation
import Mathlib.Data.Polynomial.Basic

-- A valuation is an assignment of True/False to `n` variables
def Valuation (n : Nat) := Fin n → Bool

-- Define propositional formulas inductively
inductive PropForm (n : Nat)
  | atom  : Fin n → PropForm n
  | neg   : PropForm n → PropForm n
  | and   : PropForm n → PropForm n → PropForm n
  | or    : PropForm n → PropForm n → PropForm n

-- Define what it means for a valuation `v` to satisfy a formula `f`
def Sat (v : Valuation n) : PropForm n → Prop
  | .atom i   => v i = true
  | .neg f    => ¬ (Sat v f)
  | .and f₁ f₂ => (Sat v f₁) ∧ (Sat v f₂)
  | .or f₁ f₂  => (Sat v f₁) ∨ (Sat v f₂)

-- The set of satisfiable formulas
def IsSat (f : PropForm n) : Prop := ∃ (v : Valuation n), Sat v f

2. Defining Nondeterministic Turing Machines (NDTM)

The paper's proof relies on a nondeterministic Turing machine (NDTM). mathlib has deterministic TMs. We must define a nondeterministic one, where step returns a Finset (finite set) of possible next configurations.

Lean
-- Define the components of a Turing Machine
structure NDTM where
  (State : Type)
  (TapeSymbol : Type)
  (blank : TapeSymbol)
  (initialState : State)
  (acceptState : State)
  [finState : Fintype State]
  [finTape : Fintype TapeSymbol]

-- A configuration is the machine's state, tape, and head position
structure Config (M : NDTM) where
  state : M.State
  tape : ℤ → M.TapeSymbol
  headPos : ℤ

-- The nondeterministic transition function
-- Given a state and a symbol, returns a set of next moves
-- (new state, symbol to write, direction to move)
def Transition (M : NDTM) :=
  M.State → M.TapeSymbol → Finset (M.State × M.TapeSymbol × (ℤ → ℤ))

-- A single nondeterministic step
def nd_step (M : NDTM) (t : Transition M) (c : Config M) : Finset (Config M) :=
  let (q, σ) := (c.state, c.tape c.headPos)
  t q σ.map (fun (q', σ', move) =>
    { state := q',
      tape := Function.update c.tape c.headPos σ',
      headPos := move c.headPos }
  )

-- A computation is a sequence of configurations
def Computation (M : NDTM) (t : Transition M) (c₀ : Config M) : Prop :=
  ∃ (steps : ℕ → Config M),
    steps 0 = c₀ ∧
    (∀ n, steps (n + 1) ∈ nd_step M t (steps n))

-- Acceptance: there exists a computation that reaches the accept state
def Accepts (M : NDTM) (t : Transition M) (w : String) : Prop :=
  let c₀ : Config M := -- ... (definition of initial config from w) ...
  ∃ (comp : ℕ → Config M),
    (comp 0 = c₀) ∧
    (∀ n, comp (n + 1) ∈ nd_step M t (comp n)) ∧
    (∃ n, (comp n).state = M.acceptState)

3. Defining the Variables for the Formula

The proof constructs a formula $A(w)$ based on a polynomial time bound $T = Q(n)$. The variables describe the machine's computation tableau (a $T \times T$ grid).

We follow the paper's variable names: $P$, $Q$, and $S$. We need a way to map these 3D indices (e.g., (i, s, t)) to a single flat index for our PropForm (n).

Lean
variable (T : ℕ) (l : ℕ) (r : ℕ) -- T = time, l = symbols, r = states

-- We need (T * T * l) + (T * r) + (T * T) total variables
def num_vars (T l r : ℕ) : ℕ := (T * T * l) + (T * r) + (T * T)

-- We define functions that map our semantic indices to the flat `Fin n`
-- These are our "proposition symbols" from the paper

def varP (s t i : Fin T) (i : Fin l) : Fin (num_vars T l r) :=
  -- ... (math to compute a unique flat index) ...

def varQ (t : Fin T) (i : Fin r) : Fin (num_vars T l r) :=
  -- ... (math to compute a unique flat index) ...

def varS (s t : Fin T) : Fin (num_vars T l r) :=
  -- ... (math to compute a unique flat index) ...

-- Helper functions to create atoms from these variables
def P (s t i) : PropForm (num_vars T l r) := .atom (varP s t i)
def Q (t i)   : PropForm (num_vars T l r) := .atom (varQ t i)
def S (s t)   : PropForm (num_vars T l r) := .atom (varS s t)

4. Rigorous Construction of the Formula $A(w)$

Now we build the formula $A(w)$, which the paper calls B & C & D & E & F & G & H & I. We use PropForm.and for & and PropForm.or for v.

Lean
-- Helper: "Exactly one of these formulas is true"
def ExactlyOne (fs : List (PropForm n)) : PropForm n :=
  let atLeastOne := fs.foldl (.or) (.neg (.atom 0)) -- Assuming non-empty
  let atMostOne := -- ... (complex definition) ...
  .and atLeastOne atMostOne

-- B: At each time t, one and only one square is scanned
def B_t (t : Fin T) : PropForm (num_vars T l r) :=
  ExactlyOne (List.finRange T |>.map (fun s => S s t))

def B : PropForm (num_vars T l r) :=
  List.foldl (.and) (.atom 0) (List.finRange T |>.map B_t) -- Assuming non-empty

-- C: At each time t and square s, one and only one symbol is present
def C_s_t (s t : Fin T) : PropForm (num_vars T l r) :=
  ExactlyOne (List.finRange l |>.map (fun i => P s t i))

def C : PropForm (num_vars T l r) :=
  -- ... (a conjunction of C_s_t for all s and t) ...

-- D: At each time t, there is one and only one state
def D_t (t : Fin T) : PropForm (num_vars T l r) :=
  ExactlyOne (List.finRange r |>.map (fun i => Q t i))

def D : PropForm (num_vars T l r) :=
  -- ... (a conjunction of D_t for all t) ...

-- E: Asserts initial conditions (w = σ_i₁...σ_in)
-- This depends on the specific input `w`
def E (w_symbols : List (Fin l)) : PropForm (num_vars T l r) :=
  let t₀ := 0 -- time 0
  let q₀ := 0 -- initial state
  let s₀ := 0 -- initial square
  let b := 0  -- blank symbol
  
  let initialState := Q t₀ q₀
  let initialScan := S s₀ t₀
  let tapeInit := -- ... (conjunction of P s t₀ i for each symbol i in w_symbols)
  let blankInit := -- ... (conjunction of P s t₀ b for squares after w)
  
  .and initialState (.and initialScan (.and tapeInit blankInit))

-- F, G, H: Assert that the computation follows the transition rules
-- This is the most complex part, encoding the machine's logic.
-- G_i_j_t asserts: if at time t, state is q_i and symbol is σ_j...
-- ... then at time t+1, the state is q_k (as per the transition)
def G (t : Transition M) : PropForm (num_vars T l r) :=
  -- ... (A massive conjunction over all s, t, i, j encoding the `nd_step` logic)
  -- Form: (¬Q t i) ∨ (¬S s t) ∨ (¬P s t j) ∨ (Q (t+1) k)
  -- This must be adapted for nondeterminism (a disjunction of possible next states)
  sorry

-- I: Asserts that the machine reaches an accepting state
def I (q_accept : Fin r) : PropForm (num_vars T l r) :=
  -- "At some time t, the machine is in the accept state"
  List.foldl (.or) (.neg (.atom 0)) (List.finRange T |>.map (fun t => Q t q_accept))

5. The Main Theorem

Finally, we state the Cook-Levin theorem.

Theorem 1 from the paper states that any set $S$ in NP is P-reducible to {DNF tautologies}. The proof constructs a satisfiable CNF formula $A(w)$ iff $M$ accepts $w$. The negation $\neg A(w)$ is then a DNF tautology iff $w \notin S$.

We will state the satisfiability part.

Lean
theorem CookLevinTheorem (M : NDTM) (t : Transition M) (w : String) :
  -- There exists a polynomial bound Q(n)
  ∃ (Q : Polynomial ℕ),
    let n := w.length
    let T := Q.eval n -- The time bound
    
    -- The formula A(w)
    let A_w := .and B (.and C (.and D (.and (E w) (.and G I)))) --

    -- The reduction function `f` (that builds A_w) is poly-time
    (PolyTimeConstructible A_w) ∧

    -- The core equivalence:
    -- M accepts w if and only if A(w) is satisfiable
    (Accepts M t w ↔ IsSat A_w)
  :=
begin
  -- The proof in Lean would be a massive, constructive argument.
  -- 1. `exists`: Provide the polynomial `Q` that bounds the NDTM.
  -- 2. `constructor`: Prove the two parts of the `∧`.
  -- 3. `left`: Prove that the construction of A_w is polynomial time.
  --    This involves showing the size of A_w is polynomial in `n`.
  -- 4. `right`: Prove the `↔` (iff).
  --    - `mp`: (Accepts → IsSat)
  --      Assume `h : Accepts M t w`.
  --      From `h`, we get an accepting computation (a sequence of Configs).
  --      We must build a `Valuation v` from this computation.
  --      Then prove `Sat v A_w` by showing it satisfies B, C, D... I.
  --    - `mpr`: (IsSat → Accepts)
  --      Assume `h : IsSat A_w`.
  --      From `h`, we get a satisfying valuation `v`.
  --      We must construct a valid accepting computation `steps : ℕ → Config M`.
  --      We prove `steps` is valid by showing that `v` satisfying B, C, D...
  --      forces the `steps` to follow the NDTM's transition rules.
  sorry
end


Karp's 21 NP-Complete Problems


Karp's 21 NP-Complete Problems

This is arguably Karp's most impactful contribution, for which he received the Turing Award in 1985. In his seminal 1972 paper, "Reducibility Among Combinatorial Problems," Karp established the practical importance of the P vs. NP problem.

While Stephen Cook (and Leonid Levin) had provided the first NP-complete problem (SAT) with Cook's Theorem, Karp demonstrated that a vast array of common and important problems from graph theory, logic, and operations research were also NP-complete. He did this by providing polynomial-time reductions from known NP-complete problems to these new ones.

His paper proved that all these problems were computationally equivalent—if you could solve one efficiently, you could solve them all.

Some of the 21 problems he proved NP-complete include:

  • 0-1 Integer Programming

  • Clique: Does a graph contain a clique (a fully connected subgraph) of size $k$?

  • Set Packing

  • Vertex Cover: Is there a set of $k$ vertices that touches every edge in a graph?

  • Set Covering

  • Feedback Vertex Set

  • Hamiltonian Cycle: Does a graph contain a path that visits every vertex exactly once and returns to the start?

  • Directed Hamiltonian Cycle

  • 3-Satisfiability (3-SAT): A restricted version of SAT, which he used as a starting point for many other reductions.

  • Graph Coloring (Chromatic Number): Can a graph be colored with $k$ colors so no adjacent vertices share a color?

  • Clique Cover

  • Exact Cover

  • 3D Matching

  • Subset Sum: Given a set of integers, is there a non-empty subset that sums to exactly zero?

  • Knapsack Problem

  • Job Sequencing

  • Partition


Other Major Theorems and Algorithms

Beyond his 1972 paper, Karp co-authored several other major theorems and algorithms.

Edmonds-Karp Algorithm

Developed with Jack Edmonds, this is an algorithm for solving the maximum flow problem in a network.

  • The "Theorem" Part: The key theoretical result is the analysis of its runtime. The Edmonds-Karp algorithm implements the Ford-Fulkerson method by specifically choosing the shortest augmenting path (found via a Breadth-First Search). They proved that this specific choice guarantees the algorithm terminates in polynomial time, specifically $O(VE^2)$, where $V$ is the number of vertices and $E$ is the number of edges. This was a crucial step in showing that max-flow is an efficiently solvable (polynomial-time) problem.

Karp-Lipton Theorem

This is a major theorem in computational complexity theory that explores the consequences of NP problems having small circuits.

  • The Theorem: It states that if the NP-complete problem SAT can be solved by polynomial-size Boolean circuits (a "non-uniform" model of computation), then the polynomial hierarchy collapses to its second level ($\Pi_2^p$).

  • Significance: Because it's widely believed that the polynomial hierarchy does not collapse, this theorem provides strong evidence that NP problems (including all NP-complete problems) cannot be solved by polynomial-size circuits. This is a related, but distinct, question from P vs. NP.

Karp-Rabin Algorithm

Developed with Michael O. Rabin, this is a probabilistic string-matching algorithm.

  • The Algorithm: It uses hashing (specifically, a rolling hash known as a Rabin fingerprint) to find occurrences of a pattern string within a larger text.

  • The "Theorem" Part: The analysis shows that the algorithm runs in expected linear time ($O(n+m)$, where $n$ is the text length and $m$ is the pattern length) and has a very low, controllable probability of returning a false positive (which can be made arbitrarily small). It's a classic example of the power of randomization in algorithm design.

Karp's Algorithm for Minimum Mean Weight Cycle

This is an efficient algorithm to find a cycle in a directed graph such that the average weight of the edges in the cycle is minimized. This problem has applications in areas like system performance analysis.


Here are those proofs explained without mathematical notation.

To prove these problems are "hard" (specifically, NP-complete), we use a domino-effect strategy. We start with one problem we know is super hard (like the SAT problem, which involves solving logic puzzles) and show that we can translate it into one of the new problems.

If we can build a "translator" that turns any SAT puzzle into, say, a Clique problem, it means the Clique problem must be at least as hard as SAT.

1. 0-1 Integer Programming

  • The Problem: Imagine you have a list of yes/no questions. You also have a list of rules like, "If you answer 'yes' to question 1, you must answer 'no' to question 2" or "You must answer 'yes' to at least two of questions 3, 4, and 5." The goal is to find a set of yes/no answers that follows all the rules. (Here, "1" means yes, and "0" means no).

  • Why It's Easy to Check: If someone gives you their list of yes/no answers, you can quickly check it. Just go down your rulebook, one rule at a time, and see if their answers violate anything. This is very fast.

  • How to Prove It's Hard (The Proof):

    We show that the SAT logic puzzle can be translated into a 0-1 Integer Programming problem.

    1. A SAT puzzle has logic variables (like $A$, $B$, $C$) that can be "True" or "False".

    2. We create a yes/no question for each logic variable. Let's say "yes" (1) means the variable is "True," and "no" (0) means it's "False."

    3. A SAT puzzle also has rules, like "($A$ must be True) OR ($B$ must be False) OR ($C$ must be True)."

    4. We translate this exact rule into a mathematical one for our yes/no questions. We can write a rule that says, "(The 'yes' for $A$) + (the 'no' for $B$) + (the 'yes' for $C$) must be at least 1."

    5. This new math rule works exactly like the logic rule. The only way it can fail is if $A$ is 'no' (False), $B$ is 'yes' (True), and $C$ is 'no' (False)—which is the same way the logic rule fails!

    6. Since we can translate every part of any SAT puzzle into a 0-1 Integer Programming problem, finding a solution to the programming problem is the same as finding a solution to the original SAT puzzle. Therefore, it must be just as hard.


2. Clique

  • The Problem: Imagine a social network where lines connect people who are friends. A "clique" is a group of people who are all friends with each other (everyone in the group is connected to everyone else). The problem is: "Is there a clique of, say, 10 people in this network?"

  • Why It's Easy to Check: If someone gives you a list of 10 people, you can easily check if they're a clique. Just go through every possible pair in that group and check if a "friends" line exists between them. If all pairs are connected, it's a clique. This is fast.

  • How to Prove It's Hard (The Proof):

    We also show that the SAT logic puzzle can be translated into a Clique problem. This translation is very clever:

    1. Take your SAT puzzle, which is made of rules (clauses) like "(A or B or not-C) AND (not-A or C or D)..."

    2. We will build a graph. For every single item in every single rule, we create a dot (a node). So, "A" in the first rule gets a dot, "B" in the first rule gets a dot, "not-C" in the first rule gets a dot, "not-A" in the second rule gets a dot, and so on.

    3. Now, we draw lines (edges) between these dots based on two simple "don't connect" rules:

      • Rule 1: Don't connect dots that came from the same rule. (So, "A" and "B" from the first rule are not connected).

      • Rule 2: Don't connect dots that are opposites. (So, "A" from the first rule is not connected to "not-A" from the second rule).

    4. Connect all other dots with lines.

    5. Finally, we ask: "Does this new graph have a clique of size $k$?", where $k$ is the number of rules we started with.

    6. Why this works: A clique of size $k$ must pick exactly one dot from each of the $k$ original rules (because of Rule 1). And, it cannot pick two dots that are opposites (because of Rule 2).

    7. This "winning" set of dots is the solution to the SAT puzzle! If the clique contains the "A" dot, you set $A$ to "True." If it contains the "not-C" dot, you set $C$ to "False." This assignment is guaranteed to solve the puzzle. Because of this perfect translation, Clique is just as hard as SAT.


3. Set Packing

  • The Problem: Imagine you have a list of grocery bags, each containing a few items. For example:

    • Bag 1: {apple, banana}

    • Bag 2: {banana, orange}

    • Bag 3: {apple, pear}

    • Bag 4: {orange, lime}

      The goal is to pick, say, 3 bags that have no items in common. (Here, you could pick Bag 1, 3, and 4, but you couldn't pick Bag 1 and 2 because they both have a "banana").

  • Why It's Easy to Check: If someone hands you 3 bags, you can just compare them, pair by pair, and check if any two bags share an item. If there are no overlaps, the solution is good. This is fast.

  • How to Prove It's Hard (The Proof):

    We can show that the Clique problem (which we now know is hard) can be translated into a Set Packing problem.

    1. Take any Clique problem (a graph of dots and lines) where you're looking for a clique of, say, 10 people.

    2. We're going to build a Set Packing problem from this graph.

    3. Create a "bag" (a set) for every dot (person) in the graph.

    4. What do we put in the bags? We create an item for every pair of dots that are NOT connected.

    5. Let's say in our graph, dot $A$ is not connected to dot $B$. We invent an item called "non-edge $AB$". We put this item into Bag $A$ and also into Bag $B$.

    6. We do this for every single missing line in the entire graph.

    7. Now, we ask: "Can you pick 10 bags from this new setup that have no items in common?"

    8. Why this works: What does it mean if we pick two bags, Bag $A$ and Bag $B$, that have no items in common? It means they didn't share any "non-edge" items. This could only happen if the "non-edge $AB$" item was never created. And that item would only be missing if $A$ and $B$ were connected by a line in the original graph.

    9. Therefore, finding 10 bags with no overlaps is the exact same thing as finding 10 dots (people) in the original graph where every single pair is connected. This is the definition of a clique!

    10. Since solving the Set Packing problem is the same as solving the Clique problem, it must also be just as hard.


(PROOF in LEAN)

Providing a complete, compilable LEAN 4 proof for even one of these NP-complete problems would be a significant research project, as it requires a massive formal library for computational complexity (defining Turing machines, polynomial time, etc.) that is not yet fully mature in mathlib.

However, I can provide the rigorous structure of these proofs in LEAN. This will show you how a formal proof is constructed, what needs to be defined, and what theorems (axioms) must be established.

We will imagine a hypothetical library Computability.NP that provides the foundational definitions. All our proofs will rest on one central, universally accepted axiom: 3-SAT is NP-complete.


1. Foundational Axioms (The Computability.NP Library)

First, we must import our hypothetical framework and real mathlib tools.

Lean
-- We assume a (mostly hypothetical) library for complexity theory
import Computability.NP
-- We use real mathlib tools for graphs, finite sets, and matrices
import Mathlib.Combinatorics.SimpleGraph
import Mathlib.Data.Fintype
import Mathlib.Data.Matrix.Basic
import Mathlib.Data.Finset

open Finset SimpleGraph

-- This (hypothetical) library would define:

-- A type for decision problems (languages) over an input type α
class Language (α : Type) where
  P : α → Prop

-- A definition for a problem being in NP
def NP {α} (L : Language α) : Prop := sorry -- (Exists a poly-time verifier)

-- A definition for a problem being NP-hard
def NPHard {α} (L : Language α) : Prop := sorry -- (All NP problems poly-time reduce to L)

-- A problem is NP-complete if it's in NP and is NP-hard
def NPComplete {α} (L : Language α) : Prop :=
  NP L ∧ NPHard L

-- A type for Boolean formulas in 3-Conjunctive Normal Form (3-CNF)
structure ThreeSAT.Formula (v : Type) :=
  clauses : Finset (Fin 3 → Option Bool × v) -- Each clause has 3 literals

-- The 3-SAT decision problem
def ThreeSAT_problem : Language (ThreeSAT.Formula ℕ) :=
  { P := fun φ => ∃ (assign : ℕ → Bool), sorry -- ... formula φ is satisfied by assign
  }

-- The foundational axiom for all subsequent proofs:
axiom ThreeSAT_is_NPComplete : NPComplete ThreeSAT_problem

2. 0-1 Integer Programming

This problem asks if a system of linear inequalities $A\vec{x} \le \vec{b}$ has a solution where $\vec{x}$ contains only 0s and 1s.

Step 1: Define the problem in LEAN

Lean
-- An instance of 0-1 ILP is a matrix A and a vector b over integers
structure ZeroOneILP.Instance :=
  (m n : ℕ)
  (A : Matrix (Fin m) (Fin n) ℤ)
  (b : Fin m → ℤ)

-- The decision problem for 0-1 ILP
def ZeroOneILP_problem : Language ZeroOneILP.Instance :=
  { P := fun inst =>
      -- There exists a vector x of 0s and 1s
      ∃ (x : Fin inst.n → Fin 2),
        -- Such that A * x <= b
        ∀ (i : Fin inst.m),
          (Matrix.dotProduct (inst.A i) (fun j => (x j : ℤ))) ≤ inst.b i
  }

Step 2: State and Prove the Theorem

The proof works by reducing 3-SAT to 0-1 ILP.

Lean
-- Theorem: 0-1 Integer Programming is NP-complete
theorem ZeroOneILP_is_NPComplete : NPComplete ZeroOneILP_problem :=
by
  constructor
  · -- Part 1: Prove ZeroOneILP is in NP
    -- We must show that a given solution x can be verified in polynomial time.
    -- This involves a polynomial-time matrix-vector multiplication and comparison.
    apply (NP_verifier_poly_time :
      NP ZeroOneILP_problem)
    sorry -- This proof is complex, involving formalizing algorithm runtime.
  · -- Part 2: Prove ZeroOneILP is NP-hard
    -- We show this by reducing 3-SAT to it.
    apply (NPHard_of_reduction :
      -- We assume 3-SAT is NP-hard (from our axiom)
      NPHard ThreeSAT_problem →
      -- We provide a polynomial-time reduction from 3-SAT to 0-1 ILP
      (∃ (f : ThreeSAT.Formula ℕ → ZeroOneILP.Instance),
        (PolyTimeReduction f) ∧
        -- And prove the reduction is correct
        (∀ (φ : ThreeSAT.Formula ℕ),
          ThreeSAT_problem.P φ ↔ ZeroOneILP_problem.P (f φ))) →
      NPHard ZeroOneILP_problem)

    · -- Supply the NP-hardness of 3-SAT
      exact ThreeSAT_is_NPComplete.right

    · -- Supply the reduction and its proofs
      -- We must define the reduction function
      use (fun φ =>
        -- This function builds the matrix A and vector b from the 3-SAT formula φ
        -- 1. For each variable x, create a 0-1 variable in the ILP.
        -- 2. For each clause (l1 ∨ l2 ∨ l3), create an inequality.
        --    e.g., (x ∨ y ∨ ¬z) becomes x + y + (1-z) ≥ 1
        --    In our A*x <= b form, this is: -x - y + z ≤ 0
        (construct_ILP_from_3SAT φ))
      constructor
      · -- Proof that `construct_ILP_from_3SAT` runs in polynomial time
        sorry
      · -- Proof that the reduction is correct
        -- (φ is satisfiable ↔ the constructed ILP instance has a 0-1 solution)
        sorry

3. Clique

This problem asks if a graph $G$ contains a "clique" (a fully connected subgraph) of size $k$.

Step 1: Define the problem in LEAN

Lean
-- A graph G is defined over a vertex type V. `SimpleGraph V` is from mathlib.
-- An instance of Clique is a graph and a natural number k.
structure Clique.Instance (V : Type) [Fintype V] :=
  (G : SimpleGraph V)
  (k : ℕ)

-- The decision problem for Clique
def Clique_problem (V : Type) [Fintype V] : Language (Clique.Instance V) :=
  { P := fun inst =>
      -- There exists a subset of vertices 'S'
      ∃ (S : Finset V),
        -- Such that the size of S is k
        S.card = inst.k ∧
        -- And S is a clique (all pairs in S are adjacent)
        ∀ (u v : V), u ∈ S → v ∈ S → u ≠ v → inst.G.Adj u v
  }

Step 2: State and Prove the Theorem

This proof also works by reducing 3-SAT to Clique.

Lean
-- Theorem: Clique is NP-complete
theorem Clique_is_NPComplete (V : Type) [Fintype V] : NPComplete (Clique_problem V) :=
by
  constructor
  · -- Part 1: Prove Clique is in NP
    -- We must show that a given subset S can be verified as a k-clique
    -- in polynomial time. This involves checking |S| = k and checking all
    -- pairs of vertices in S for adjacency.
    apply (NP_verifier_poly_time :
      NP (Clique_problem V))
    sorry -- This proof involves reasoning about O(k^2) checks.
  · -- Part 2: Prove Clique is NP-hard
    -- We show this by reducing 3-SAT to it.
    apply (NPHard_of_reduction :
      NPHard ThreeSAT_problem →
      (∃ (f : ThreeSAT.Formula ℕ → Clique.Instance V),
        (PolyTimeReduction f) ∧
        (∀ (φ : ThreeSAT.Formula ℕ),
          ThreeSAT_problem.P φ ↔ (Clique_problem V).P (f φ))) →
      NPHard (Clique_problem V))

    · -- Supply the NP-hardness of 3-SAT
      exact ThreeSAT_is_NPComplete.right

    · -- Supply the reduction and its proofs
      -- We must define the reduction function
      use (fun φ =>
        -- This function builds the graph G and k from the 3-SAT formula φ
        -- 1. Create one vertex for each literal in φ.
        -- 2. k = number of clauses in φ.
        -- 3. Add an edge between two vertices (literals) IF:
        --    a) They are in different clauses
        --    b) They are not opposites (e.g., not x and ¬x)
        (construct_Graph_from_3SAT φ))
      constructor
      · -- Proof that `construct_Graph_from_3SAT` runs in polynomial time
        sorry
      · -- Proof that the reduction is correct
        -- (φ is satisfiable ↔ the graph G has a k-clique)
        -- A k-clique in G corresponds to picking one literal from each
        -- clause that are all mutually compatible, which is a
        -- satisfying assignment.
        sorry

4. Set Packing

This problem asks if, given a collection of sets $S$, we can find $k$ sets from $S$ that are all mutually disjoint (no two share an element).

Step 1: Define the problem in LEAN

Lean
-- A Set Packing instance is a collection of Finsets (our 'sets')
-- and a number k.
structure SetPacking.Instance (U : Type) [Fintype U] :=
  (collection : Finset (Finset U)) -- A collection of sets
  (k : ℕ)

-- The decision problem for Set Packing
def SetPacking_problem (U : Type) [Fintype U] : Language (SetPacking.Instance U) :=
  { P := fun inst =>
      -- There exists a sub-collection 'S_pack'
      ∃ (S_pack : Finset (Finset U)),
        S_pack ⊆ inst.collection ∧
        S_pack.card = inst.k ∧
        -- And all sets in S_pack are pairwise disjoint
        ∀ (s1 ∈ S_pack), ∀ (s2 ∈ S_pack), s1 ≠ s2 →
          Disjoint s1 s2
  }

Step 2: State and Prove the Theorem

This proof works by reducing Clique to Set Packing. Since we just "proved" Clique is NP-hard, we can use it as our new base.

Lean
-- Theorem: Set Packing is NP-complete
theorem SetPacking_is_NPComplete (U V : Type) [Fintype U] [Fintype V] :
  NPComplete (SetPacking_problem U) :=
by
  constructor
  · -- Part 1: Prove Set Packing is in NP
    -- We must show that a given sub-collection S_pack can be verified
    -- in polynomial time. This involves checking its size and checking all
    -- O(k^2) pairs for disjointness.
    apply (NP_verifier_poly_time :
      NP (SetPacking_problem U))
    sorry -- Formalizing O(k^2) checks.
  · -- Part 2: Prove Set Packing is NP-hard
    -- We reduce Clique to Set Packing
    apply (NPHard_of_reduction :
      NPHard (Clique_problem V) → -- We use Clique's NP-hardness
      (∃ (f : Clique.Instance V → SetPacking.Instance U),
        (PolyTimeReduction f) ∧
        (∀ (cl : Clique.Instance V),
          (Clique_problem V).P cl ↔ (SetPacking_problem U).P (f cl))) →
      NPHard (SetPacking_problem U))

    · -- Supply the NP-hardness of Clique
      -- This comes from the `right` (NPHard) part of our previous theorem
      exact (Clique_is_NPComplete V).right

    · -- Supply the reduction and its proofs
      -- We must define the reduction function
      use (fun cl_inst =>
        -- This function builds a Set Packing instance from a Clique instance (G, k)
        -- 1. The new 'universe' U will be the set of *edges* in G.
        -- 2. For each *vertex* v in G, create a set containing all edges
        --    that are *incident* to v.
        -- 3. The new k is the same as the old k.
        (construct_SetPacking_from_Clique cl_inst))
      constructor
      · -- Proof that `construct_SetPacking_from_Clique` runs in poly time
        sorry
      · -- Proof that the reduction is correct
        -- (G has a k-clique ↔ The collection has a k-packing)
        -- A k-clique is k vertices where every pair is connected.
        -- The corresponding k sets will be disjoint *if and only if*
        -- no two vertices share an edge.
        -- Wait... this reduction is for *Independent Set*, not Clique.
        -- Let's use the reduction from your previous request:
        --
        -- **Correct Reduction (Clique to Set Packing):**
        -- 1. The universe U is the set of *non-edges* in G.
        -- 2. For each *vertex* v, create a set containing all *non-edges*
        --    incident to v.
        -- 3. The new k is the same k.
        --
        -- **Proof of correctness:**
        -- A k-clique is k vertices with *no* "non-edges" between them.
        -- A k-packing is k sets (vertices) that share no common elements.
        -- The elements are "non-edges".
        -- So, a k-packing is k vertices that share no "non-edges".
        -- This is the definition of a k-clique.
        sorry



Cook's Theorem : SAT(Boolean Satisfiability Problem) is NP-Complete

Stephen Cook is most famously associated with one monumental theorem that essentially created an entire field of computer science.

The Cook-Levin Theorem (Cook's Theorem)

This is, without a doubt, the most important theorem attributed to Stephen Cook.

  • What it states: The theorem proves that the Boolean Satisfiability Problem (SAT) is NP-complete.

  • Why it matters:

    1. It was the first: This was the very first problem ever proven to be NP-complete.

    2. It established a foundation: Cook's 1971 paper, "The Complexity of Theorem-Proving Procedures," formally defined the concept of NP-completeness and established the significance of the P vs. NP problem 

    3. It provides a "master" problem: The theorem shows that any problem in the class NP can be reduced (in polynomial time) to SAT. This means if someone were to find an efficient, polynomial-time algorithm for solving SAT, it would automatically provide an efficient algorithm for every single problem in NP, thus proving P = NP.


Other Major Contributions & Related Work

While the Cook-Levin theorem is his most famous named theorem, Cook's work includes many other foundational results and definitions in computational complexity and proof complexity.

  • Formalization of P vs. NP: His 1971 paper is credited with formally defining the class NP (Nondeterministic Polynomial time) and posing the P versus NP problem as a major open question in mathematics and computer science.

  • Proof Complexity: Cook is a leading figure in proof complexity, which studies the length of proofs in formal logical systems.

    • Cook-Reckhow Thesis: Along with Robert A. Reckhow, he defined "p-simulation" and characterized the relationship between proof systems and complexity classes. Their work suggests that NP = co-NP if and only if there exists a propositional proof system in which every tautology has a polynomial-length proof.

  • Parallel Computation: Cook helped define and explore the complexity class NC (Nick's Class). This class contains problems that can be solved very efficiently on a parallel computer (in polylogarithmic time using a polynomial number of processors).

  • Bounded Arithmetic: He has done extensive work on systems of "bounded arithmetic" (like $PV$), which are weak logical theories used to formally capture the concept of polynomial-time reasoning.

------
(PROOF)

This is a foundational proof in computer science, and its "rigor" comes from a very clever, step-by-step construction. Explaining it rigorously without any notation is a challenge, but the core logic can be described in plain English.

To prove the Boolean Satisfiability Problem (SAT) is NP-complete, we must prove two separate things:

  1. SAT is in the class NP.

  2. SAT is NP-hard.

Let's break down each part.

Part 1: Proving SAT is in NP

  • What this means: "NP" stands for "Nondeterministic Polynomial time." A simpler way to think about it is "efficiently verifiable." If someone hands you a problem and a potential solution, can you check if the solution is correct quickly (in polynomial time)?

  • The Proof:

    1. Imagine a SAT problem (a big logical formula) and a potential solution (a list of TRUE/FALSE assignments for every variable, also called a "certificate").

    2. To verify this solution, you simply plug the TRUE/FALSE values into the formula.

    3. You then evaluate the formula, step-by-step, just like a calculator. You check each small clause ("A or not B"), see if it's TRUE, and then check if all the clauses are TRUE.

    4. This checking process is very fast. The time it takes is directly proportional to the size of the formula. Because this verification is efficient and fast, SAT is, by definition, in the class NP.

This is the easy part of the proof.


Part 2: Proving SAT is NP-hard

  • What this means: This is the hard part and the core of Cook's Theorem. We must prove that every other problem in NP can be transformed (or "reduced") into an equivalent SAT problem quickly (in polynomial time).

  • If this is true, it means SAT is at least as hard as every other problem in NP. If you could solve SAT efficiently, you could solve everything in NP efficiently.

  • The Proof (The "Grand Construction"):

    1. The "Checking Machine": First, we must agree on a universal model for a computer that "checks" solutions. The formal model for this is a Turing machine, but we can just think of it as a basic, idealized computer. Let's call it our "Checker." Since any problem in NP is efficiently verifiable (from Part 1), we know that for any NP problem, there is a "Checker" program that can verify a "YES" answer in a quick, limited number of steps (a polynomial number).

    2. The Goal: Cook's brilliant idea was to prove that you can take any of these "Checker" programs (for any NP problem) and automatically convert it into one, massive SAT formula. This formula will be satisfiable if and only if the "Checker" program would have output "YES."

    3. The Construction: We build this giant formula by creating variables and rules that perfectly simulate the "Checker" machine's computation, step-by-step.

    4. Step A: Define the Variables. We create millions of Boolean (TRUE/FALSE) variables to describe the entire state of the "Checker" at every single step of its computation.

      • Tape Variables: For every tape square on the machine, and for every step in time, we create a variable. For example: Is_Tape_Square_5_Symbol_A_at_Step_12? (This would be TRUE or FALSE).

      • Head Variables: For every tape square and every step in time: Is_Machine_Head_at_Square_7_at_Step_3?

      • State Variables: For every machine state and every step in time: Is_Machine_in_State_Q_at_Step_8?

    5. Step B: Define the Rules (The Clauses). Now we add logical rules (the clauses of our SAT formula) to force these variables to behave like a real computation.

      • Start Rule: We add clauses that force the variables at "Step 0" to match the machine's starting conditions (e.g., the input problem is written on the tape).

      • Transition Rules: This is the biggest part. We add clauses that enforce the machine's logic. For every step t, these rules ensure that the machine's state at step t+1 is a valid next move from its state at step t. For example, a rule might say:

        "IF (at step 5, the head is at square 20) AND (the symbol at square 20 is a '1') AND (the machine is in 'State K')

        THEN

        (at step 6, the head must be at square 21) AND (the symbol at square 20 must now be a '0') AND (the machine must be in 'State L')."

        This entire logical statement is just a (complex) clause in our SAT formula.

      • Uniqueness Rules: We add rules to prevent impossible situations, like the machine's head being in two places at once, or a single tape square containing two different symbols at the same time.

      • Final "Accept" Rule: We add one last, simple rule: "At some point in time before the final step, the machine must enter the 'YES, the answer is correct' state."

    6. The Conclusion of the Proof: We have now built a giant SAT formula.

      • If a "YES" answer for the original problem exists: Then a valid computation history of the "Checker" machine also exists. This history (the exact sequence of head moves, state changes, and tape symbols) provides a set of TRUE/FALSE assignments for all our variables that makes our entire formula TRUE. Therefore, the formula is satisfiable.

      • If no "YES" answer exists: Then no possible computation of the "Checker" can ever reach the "YES" state. This means it is impossible to find a set of TRUE/FALSE assignments that satisfies all our rules at once. Therefore, the formula is unsatisfiable.

This process shows that any NP problem can be transformed into a SAT problem. Because this transformation is itself a systematic, fast (polynomial-time) process, it proves that SAT is NP-hard.


Final Summary

Because we proved (1) SAT is in NP (it's easy to check a given answer) and (2) SAT is NP-hard (every other NP problem can be converted into it), we have proven that SAT is NP-complete.


(LEAN code)



# The Cook-Levin theorem proves: SAT is NP-complete.
# This requires proving two distinct parts.

# -----------------------------------------------------------------
# PART 1: Prove that SAT is in NP (SAT ∈ NP)
# -----------------------------------------------------------------
# A problem is in NP if a proposed solution (a "certificate")
# can be verified in polynomial time.

def verify_SAT(formula: BooleanFormula, certificate: TruthAssignment) -> bool:
    """
    Verifies if a given truth assignment satisfies a boolean formula.
    
    Args:
        formula: The boolean formula to check (e.g., (x1 or ~x2) and (x2 or x3)).
        certificate: A map of variables to True/False values (e.g., {x1: True, x2: False, x3: True}).
    """
    
    # 1. Substitute all variables in the formula with their values
    #    from the certificate.
    #    Example: (True or ~False) and (False or True)
    substituted_formula = formula.substitute(certificate)
    
    # 2. Evaluate the resulting expression.
    #    Example: (True or True) and (False or True) -> (True) and (True) -> True
    result = substituted_formula.evaluate()
    
    # 3. Return the final boolean result.
    return result

# ---
# Proof Conclusion for Part 1:
# The `verify_SAT` function runs in polynomial time (relative to the size of the
# formula and certificate). Step 1 is a linear pass. Step 2 is also fast
# (proportional to the formula's length).
#
# Because a polynomial-time verifier exists, SAT is in NP.
# ---


# -----------------------------------------------------------------
# PART 2: Prove that SAT is NP-hard (SAT is NP-Hard)
# -----------------------------------------------------------------
# A problem is NP-hard if *every* problem in NP can be
# reduced to it in polynomial time.

def build_SAT_formula_from_NP_problem(problem_L, input_w) -> BooleanFormula:
    """
    This is a *conceptual* function that performs the Cook-Levin reduction.
    
    It takes *any* NP problem L (defined by its polynomial-time verifier,
    a Turing Machine M) and an input 'w', and builds a SAT formula 'phi'
    that is satisfiable *if and only if* M accepts 'w'.
    """
    
    # 1. Define the Machine 'M' and time 'p(n)'.
    #    By definition of NP, 'problem_L' has a verifier (Turing Machine 'M')
    #    that runs in polynomial time, let's call it p(n), where n is len(w).
    M = problem_L.verifier
    n = len(input_w)
    poly_time_steps = calculate_polynomial_bound(M, n) # e.g., n^2
    
    # 2. Generate all boolean variables.
    #    We create a variable for every possible state of the machine
    #    at every possible time step. This forms a "tableau" (a grid)
    #    of size p(n) x p(n).
    
    variables = {}
    for t in range(poly_time_steps):
        for i in range(poly_time_steps): # Tape position
            for s in M.symbols:
                # 'Is tape cell i symbol s at time t?'
                variables[f'tape_{t}_{i}_{s}'] = BooleanVar()
            
            for q in M.states:
                # 'Is machine in state q at time t?'
                variables[f'state_{t}_{q}'] = BooleanVar()
            
            # 'Is head at position i at time t?'
            variables[f'head_{t}_{i}'] = BooleanVar()

    # 3. Build the four sets of rules (clauses).
    
    # Rule 1: phi_start
    # The machine starts in the correct initial configuration at time 0.
    phi_start = create_start_rules(M, input_w, variables)
    # e.g., (head_0_0 == True) AND (state_0_q_start == True) AND ...
    #       (tape_0_0_w[0] == True) AND (tape_0_1_w[1] == True) ...

    # Rule 2: phi_cell
    # The tableau is well-formed. (e.g., "a cell can't be 'A' and 'B'
    # at the same time," "the head can't be in two places at once").
    phi_cell = create_uniqueness_rules(variables, poly_time_steps)
    # e.g., (tape_t_i_A OR tape_t_i_B OR ...) AND (~tape_t_i_A OR ~tape_t_i_B) ...

    # Rule 3: phi_move
    # The machine's transitions are valid. For every time 't',
    # the state at time 't+1' must correctly follow from time 't'
    # according to M's rules. This is the most complex part.
    phi_move = create_transition_rules(M, variables, poly_time_steps)
    # e.g., FOR t from 0 to p(n)-1:
    #   IF (head at i, state is q, symbol is s) at time t
    #   THEN (must be valid next move) at time t+1
    
    # Rule 4: phi_accept
    # The machine must enter the "accept" state at some point in time.
    phi_accept = create_accept_rules(M, variables, poly_time_steps)
    # e.g., (state_0_q_accept == True) OR (state_1_q_accept == True) OR ...
    
    # 4. Combine all rules into the final formula.
    phi = AND(phi_start, phi_cell, phi_move, phi_accept)
    
    return phi

# ---
# Proof Conclusion for Part 2:
# The function `build_SAT_formula_from_NP_problem` itself runs in
# polynomial time. The number of variables is polynomial (p(n) * p(n) * ...).
# The number of clauses is also polynomial (it's generated by loops
# running in polynomial time).
#
# Because this polynomial-time reduction exists, SAT is NP-hard.
# ---


# -----------------------------------------------------------------
# FINAL THEOREM: SAT is NP-Complete
# -----------------------------------------------------------------

def prove_Cook_Levin_Theorem():
    
    # Part 1: SAT is in NP.
    # We proved this with the 'verify_SAT' function.
    SAT_is_in_NP = True 
    
    # Part 2: SAT is NP-hard.
    # We proved this by showing the 'build_SAT_formula_from_NP_problem'
    # reduction exists and runs in polynomial time.
    SAT_is_NP_Hard = True
    
    # By definition, a problem that is both in NP and NP-hard
    # is NP-complete.
    is_NP_Complete = SAT_is_in_NP and SAT_is_NP_Hard
    
    return is_NP_Complete

# Q.E.D.

(AXIOMS in LEAN)


-- Import libraries for complexity theory.
-- (We assume a mature library like Mathlib)
import Mathlib.Computability.TuringMachine
import Mathlib.Complexity.ComplexityClass
import Mathlib.Complexity.Reduction

-- Use the standard namespaces for complexity
open Complexity
open Computability

/-!
### Section 1: Defining the SAT Problem

First, we must define the *syntax* of a Boolean formula.
We do this as an inductive type, where 'var n' represents
a variable like x₁, x₂, etc.
-/
inductive PropForm (ν : Type) : Type
  | var   : ν → PropForm ν           -- A variable (e.g., x_n)
  | neg   : PropForm ν → PropForm ν  -- Negation (¬P)
  | conj  : PropForm ν → PropForm ν → PropForm ν -- Conjunction (P ∧ Q)
  | disj  : PropForm ν → PropForm ν → PropForm ν -- Disjunction (P ∨ Q)

-- An "assignment" is a function that maps variables to True/False.
abbrev Assignment (ν : Type) := ν → Bool

-- A function to evaluate a formula given an assignment.
def eval (a : Assignment ν) : PropForm ν → Bool
  | .var n    => a n
  | .neg p    => not (eval a p)
  | .conj p q => (eval a p) && (eval a q)
  | .disj p q => (eval a p) || (eval a q)

/-!
The SAT problem is the set of all formulas (over natural number
variables) for which *there exists* an assignment that
makes the formula evaluate to True.
-/
def SAT : Problem (PropForm Nat) :=
  { phi | exists (a : Assignment Nat), eval a phi = true }


/-!
### Section 2: Defining NP-Completeness

We rely on definitions from the complexity library.
(These are simplified for clarity).

`IsNP (L : Problem)` := The language L is in NP.
`IsNPComplete (L : Problem)` := L is NP-complete.

The definition of NP-complete is:
1. The problem is in NP.
2. The problem is NP-hard.

`IsNPComplete (L)` is defined as:
`IsNP L ∧ (∀ (L' : Problem), IsNP L' → L' ≤ₚ L)`

Where `L' ≤ₚ L` means "L' polynomially reduces to L".
-/


/-!
### Section 3: The Cook-Levin Theorem Statement

Here is the formal statement of the theorem. Proving this
is the hard part, so we use `sorry`. In Lean, `sorry` is a
placeholder for a proof that has not yet been completed.
-/

theorem cook_levin : IsNPComplete SAT := by
  -- 1. Prove that SAT is in NP.
  have sat_is_in_np : IsNP SAT := by
    -- We must build a polynomial-time verifier.
    -- The verifier takes a formula `phi` and a certificate `a` (an assignment).
    -- It then runs `eval a phi` and checks if the result is `true`.
    -- This `eval` function is computable in polynomial time.
    sorry -- This part is non-trivial but much easier than Part 2.

  -- 2. Prove that SAT is NP-hard.
  have sat_is_np_hard : ∀ (L' : Problem), IsNP L' → L' ≤ₚ SAT := by
    -- This is the core of the proof.
    -- We must take *any* NP problem L'...
    intro L' h_L_is_np
    
    -- ...find its non-deterministic Turing machine (NTM) verifier M...
    -- ...and construct a polynomial-time reduction `f`.
    -- This function `f` builds the giant "tableau" formula `phi_M`.
    
    -- `f(w)` must be satisfiable IFF M accepts `w`.
    sorry -- This is the massive construction we discussed.
  
  -- 3. Combine the two parts.
  -- By definition, NP-complete means (in NP) AND (NP-hard).
  exact And.intro sat_is_in_np sat_is_np_hard


Richard Karp — The Man Who Mapped the Landscape of Computational Hardness

In 1972, Richard Manning Karp did just that. His work transformed computer science from a collection of clever tricks into a discipline with deep structure — revealing why some problems stubbornly resist all efficient solutions.


Profile: A Mathematician Turned Architect of Complexity

Richard M. Karp was born in 1935 in Boston, Massachusetts. He showed early brilliance in mathematics, earning his bachelor’s, master’s, and Ph.D. from Harvard University, completing the latter in 1959 under mathematician Ivan Niven.

After joining IBM’s Thomas J. Watson Research Center, Karp became fascinated by the emerging field of theoretical computer science. Later, at the University of California, Berkeley, he built one of the world’s most influential schools of thought in algorithms and computational complexity.

Over his long career, he has held key positions at UC Berkeley, the University of Washington, and several research institutes. His honors include the Turing Award (1985), the National Medal of Science (1996), and membership in both the National Academy of Sciences and the American Philosophical Society.

But beyond accolades, Karp’s enduring contribution is a conceptual framework — a way of understanding why some computational problems are inherently difficult.


The 1972 Paper: “Reducibility Among Combinatorial Problems”

Karp’s 1972 paper in Complexity of Computer Computations is one of the foundational texts of theoretical computer science. Building upon Stephen Cook’s 1971 result — the Cook Theorem, which proved that the Boolean satisfiability problem (SAT) is NP-complete — Karp took the next monumental step: connecting theory to reality.

Where Cook’s work was a spark, Karp’s was the fire that spread.

The Idea: Reductions and the Web of Hardness

Karp introduced a systematic method for proving that diverse, seemingly unrelated problems are all computationally equivalent in difficulty.
He used polynomial-time reductions — efficient transformations that show how solving one problem could be used to solve another.

If problem A can be reduced to problem B efficiently, and A is already known to be NP-complete, then B must be NP-complete too. This logical chain turned out to be a powerful tool for mapping complexity across the entire computational universe.

The 21 NP-Complete Problems

In this paper, Karp identified 21 fundamental problems from across mathematics, logic, and computer science, and proved each to be NP-complete by reduction from SAT.
These include:

The Traveling Salesman Problem (TSP) — finding the shortest route visiting each city once.
Graph Coloring — coloring vertices so that no two adjacent ones share a color, using as few colors as possible.
The Knapsack Problem — selecting items with given weights and values to maximize value under a weight limit.
Hamiltonian Cycle, Vertex Cover, Subset Sum, and many others.

This list was not just academic bookkeeping — it revealed that practical optimization problems in logistics, design, and scheduling were all reflections of the same deep computational structure.


The Legacy: A Theory of Limits

Karp’s work solidified the concept of NP-completeness as a cornerstone of computer science. It unified hundreds of seemingly unrelated problems under a single theoretical umbrella — and, perhaps more importantly, defined the boundaries of algorithmic possibility.

Because of Karp, we now understand that if any one NP-complete problem can be solved efficiently (in polynomial time), then all of them can — and the long-standing question P = NP? would finally be answered.
That question remains one of the greatest open problems in mathematics.

Karp’s influence extends far beyond complexity theory. His later research spanned randomized algorithms, graph theory, network flows, and computational biology. Yet the spirit of his 1972 insight — that structure emerges when you look for deep equivalences — runs through all his work.


The Broader View

Karp’s genius lies not only in what he proved, but in how he thought.
He showed that the world’s messy puzzles — from routing trucks to sequencing genes — can be understood as instances of elegant mathematical universals. He taught us that “hardness” itself can be studied, classified, and sometimes even tamed.

In that sense, Richard Karp didn’t just solve problems. He explained why some problems refuse to be solved — and turned that refusal into a theory.


here’s a reading + YouTube list for Richard M. Karp (nerd-style) that you can use to deepen your understanding of his work and its context. You can pick and choose based on how deep you want to dive.


YouTube & Lecture Videos

Here are videos featuring Richard Karp (or about his topics) — good for hearing his voice (literally) and getting visual/lecture-style context.

NP‑Complete Problems, lecture by Richard Karp

— A direct lecture where he tackles how to distinguish “easy” vs “hard” combinatorial/search problems.

  • “NP-Completeness | Richard Karp and Lex Fridman” — a more informal interview/discussion format. (YouTube)

  • “Karp on the definition of P and NP.” — He explains how he sees the classes P and NP, in his own words. (YouTube)

  • “Richard M. Karp Distinguished Lectures” playlist — more advanced talks tied to his name, including recent ones at the Simons Institute for the Theory of Computing. (YouTube)

These are great for capturing both the intuition and the flavour of his thinking.


📚 Reading List

Below are suggested readings: some are by Karp (or his core work), others are about his topics (NP-completeness, algorithms). Because I couldn’t find a publicly published full “Karp reading list” curated by him, I’m giving a recommended list rather than a definitive list.

Core / Must-Read

・ Reducibility Among Combinatorial Problems (1972) by Karp — his foundational paper that lists the 21 NP-complete problems. (cgi.di.uoa.gr)
・ “The 21 NP-complete problems” (various expositions) — e.g., the Wikipedia article “Karp’s 21 NP-complete problems” gives good overview. (Wikipedia)
・ “Computational Complexity: A Modern Approach” by Sanjeev Arora & Boaz Barak — good modern context for NP-completeness (although not by Karp) and it mentions his work. (BookAuthority)

Broader Context / Further Depth

・ Any algorithm/design book that covers NP‐completeness, reductions, etc., to see how Karp’s ideas fit into the bigger landscape.
・ Research/biography piece: “Richard Karp” on the Simons Foundation site — gives good background on his contributions beyond just NP-completeness. (Simons Foundation)


How to Use These Lists 

・ Start with the 1972 paper to get the original.
・ Then watch one of the videos (the lecture) so you hear how Karp approaches the problem.
・ Follow with a broader book or article to see how the field built out from his work.
・ Along the way, make a list of “his problems” (the 21) and pick one or two to work through in more detail (e.g., graph-colouring, TSP, knapsack) to internalize the reduction concept.
・ Bonus: Seek out his later work (matching algorithms, flows, computational biology) to see how his thinking evolved.



Stephen Cook: The Mathematician Who Defined Computational Hardness

If modern computer science has a creation myth, it might begin in 1971 with a quiet revolution on paper. That year, a young mathematician named Stephen Arthur Cook published “The Complexity of Theorem-Proving Procedures.” In doing so, he didn’t just introduce a new idea — he gave birth to the language of computational hardness itself.


From Buffalo to the Foundations of Complexity

Stephen Cook was born in Buffalo, New York, in 1939. He earned his undergraduate degree at the University of Michigan, then completed a Ph.D. in mathematics at Harvard under Hao Wang — one of the early logicians who connected formal systems with computation.

After a few years at Berkeley, Cook joined the University of Toronto in 1970, where he still works today. Canada gained not just a brilliant logician but the man who would become one of the architects of theoretical computer science.

His field — computational complexity theory — asks deceptively simple questions: How much time and space does it take to solve a problem? When is a problem inherently difficult? These questions may sound abstract, but they touch everything from cryptography to AI.


The 1971 Breakthrough: NP-Completeness

In his 1971 paper, Cook analyzed the logical structure of theorem-proving and stumbled upon something universal: a class of problems that are easy to verify but possibly impossible to solve quickly.

He called this class NP, for nondeterministic polynomial time. Within NP, he identified a special subset — problems that are as hard as any other in NP. These became the NP-complete problems.

The key example was the Boolean satisfiability problem (SAT):
given a logical formula, can you assign truth values to make it true?

Cook proved that SAT is NP-complete — that every problem in NP can be translated into an instance of SAT in polynomial time. This result, now known as the Cook–Levin theorem (after Leonid Levin, who discovered it independently in the Soviet Union), became the cornerstone of complexity theory.

In one stroke, Cook gave us the conceptual scaffolding to understand why certain problems resist efficient solutions — and why finding a fast algorithm for any one of them would mean a fast algorithm for them all.

This became the essence of the P vs NP problem, still unsolved and still one of the great open questions in mathematics.


Beyond NP: Logic, Proofs, and Complexity

Cook didn’t stop there. His later work with Robert Reckhow, “The Relative Efficiency of Propositional Proof Systems” (1979), extended the same spirit of inquiry into the nature of mathematical proofs. They explored the proof complexity of logical systems — essentially, how long a proof must be to establish certain truths.

This line of thought connected complexity theory with logic in a deep way, showing that the efficiency of reasoning itself could be studied mathematically.

Cook’s influence extends through bounded arithmetic, propositional proof systems, and the structure of complexity classes. The field proof complexity, which he helped found, continues to ask how logical reasoning and computational limits intertwine.


Honors Fit for a Founding Father

Cook’s work didn’t go unnoticed. His achievements read like a résumé of theoretical immortality:

ACM A.M. Turing Award (1982) — the “Nobel Prize of Computing.”
Gödel Lecture (1999) from the Association for Symbolic Logic.
CRM–Fields–PIMS Prize (1999), Canada’s top research honor in mathematics.
Bernard Bolzano Medal (2008) from the Czech Academy of Sciences.
Gerhard Herzberg Canada Gold Medal for Science and Engineering (2012) — the nation’s highest scientific award.
Officer of the Order of Canada (2015) for his foundational role in computer science.

He’s also a fellow of the Royal Society (London), the Royal Society of Canada, and the U.S. National Academy of Sciences.


Why Stephen Cook Still Matters

Stephen Cook didn’t just define a problem; he defined a way of thinking about problems. Before his 1971 paper, computation was about algorithms — how to solve things. After Cook, it became equally about limitations — what can’t be solved efficiently.

This shift turned computer science into a mathematical discipline with its own deep philosophical questions. It tied together logic, mathematics, and engineering, and gave us the intellectual framework for cryptography, optimization, and theoretical AI.

And it left us with a hauntingly beautiful question:
Is every problem whose solution can be verified efficiently also one whose solution can be found efficiently?

That’s P vs NP — Cook’s enduring riddle.


Epilogue: The Philosopher of Difficulty

Cook is sometimes called the philosopher of computational hardness. His work reminds us that mathematics doesn’t just solve puzzles; it defines what puzzles mean.

Every time a cryptographer assures you your data is safe, every time an algorithm designer proves a problem intractable, they are, knowingly or not, speaking the language Stephen Cook invented.

He gave the world a way to quantify difficulty — and in doing so, helped illuminate one of the most profound frontiers of human reasoning: the boundary between the possible and the impossible.


here’s a curated reading list of key works by Stephen A. Cook (and related compilations) that are especially relevant for your research.
Since you’re a math researcher (hi Dave!), I’ve included classic–foundational papers and some of his more technical recent work. If you like, I can also pull a full bibliography with links.


Core Foundational Papers

These are the big ones — essential for complexity theory and proof complexity.
“The Complexity of Theorem-Proving Procedures” (1971) — the landmark NP-completeness paper.
“Characterizations of Pushdown Machines in Terms of Time-Bounded Computers” — discussing like time-bounds and machine models for branching. (U of T Computer Science)
“The Relative Efficiency of Propositional Proof Systems” (with Robert A. Reckhow, 1979) — proof complexity. (U of T Computer Science)
“A Time-Space Tradeoff for Sorting on a General Sequential Model of Computation” (with Allan Borodin, 1982) — time-space tradeoff results. (U of T Computer Science)
“The Importance of the P versus NP Question” (J. ACM, 2003) — more expository, but very helpful for context. (U of T Computer Science)


Selected More Recent & Technical Works

These might more directly interface with advanced current research (which you may appreciate).
“Pebbles and Branching Programs for Tree Evaluation” (Cook, McKenzie, Wehr, Braverman, Santhanam) — about branching programs and complexity of tree-evaluation. (U of T Computer Science)
“Relativizing Small Complexity Classes and their Theories” (Aehlig, Cook, Nguyen) — relates complexity classes and formal theories. (U of T Computer Science)
“Formal Theories for Linear Algebra” (Cook & Lila Fontes) — deals with complexity in linear algebraic settings. (U of T Computer Science)


Compilations & Overviews

“Logic, Automata, and Computational Complexity: The Works of Stephen A. Cook” (edited by Bruce M. Kapron) — a collection of his major papers + analysis. (Cambridge University Press & Assessment)
・ His home page lists many more papers, preprints and lecture slides. (U of T Computer Science)


here are several YouTube videos featuring Stephen A. Cook (yes, the NP-completeness guru) that you can watch. They range from lectures to interviews. Note: I’m not claiming this is an exhaustive list (there may be more out there), but it gives a strong start.

Title Description
Cook on his thesis work and introduction to complexity theory (YouTube) (YouTube) Cook talks about his early exposure to complexity theory and his thesis background.
A conversation with Stephen Cook (YouTube) (YouTube) An interview/discussion format where he reflects on his work and ideas.
Cook on “The Complexity of Theorem‑Proving Procedures” (YouTube) (YouTube) Focused talk on his landmark 1971 paper.
Lecture by Turing Award winner Stephen Cook at Techfest 2013, IIT Bombay (YouTube) (YouTube) A full lecture at Techfest, giving a broader view of complexity and his contribution.
S. A. Cook. From Computational Complexity to Proof Complexity. (YouTube) (YouTube) A deeper technical talk, moving into proof complexity.
Stephen Cook on P vs NP (YouTube) (YouTube) A more accessible discussion of the P vs NP problem from his perspective.
Stephen Cook, 1982 ACM Turing Award Recipient (YouTube) (YouTube) A video about his Turing Award and his recognition — useful for historical context.
Interview with Stephen Cook, Frontiers of Knowledge Award (YouTube) (YouTube) A recent interview reflecting on his career and impact.


Claude Shannon - A Mathematical Theory of Communication

Claude Shannon was a mathematician and electrical engineer whose work quietly detonated the modern world. His 1948 paper, “A Mathematical Theory of Communication,” founded the field of information theory—a discipline that quantifies information itself as a measurable quantity, expressed in bits. This sounds dry until you realize that every digital technology—from the Internet to DNA sequencing—runs on that insight.

Here’s what he achieved:

Information Theory: Shannon defined the concept of entropy for information. It measures uncertainty—how much “surprise” is in a message. This gave engineers a precise way to think about noise, compression, and error correction.

Binary Representation: He showed that any message (text, sound, image) could be represented by binary digits, 0s and 1s. This idea turned communication into logic, and logic into circuitry.

Digital Circuit Design: In his master’s thesis at MIT (1937), Shannon applied Boolean algebra to electrical circuits. That’s the intellectual ancestor of every computer’s logic gate today. It was arguably one of the most influential master’s theses in history.

Cryptography and Coding: During World War II, Shannon worked on code-breaking and secure communication. His later work linked cryptography and information theory, establishing fundamental limits for secrecy—concepts that still underpin modern encryption.

Concept of Channel Capacity: He proved that for any communication channel (like a wire or radio wave), there’s a maximum rate of information that can be sent reliably. That’s Shannon’s limit, still a guiding star for engineers.

Shannon also had a playful streak: he built juggling robots, mechanical mice that solved mazes, and once rode a unicycle while juggling. He treated intellect as a toy, and his toys reshaped civilization.

His achievement, in essence, was to mathematize communication. He took the chaos of signals, words, and noise, and turned it into order—a quantifiable, calculable science. The digital world is his cathedral.


Good call, Dave — let’s grab a handful of foundational papers by Claude E. Shannon (and I’ll flag them as must-reads). If you’d like a more complete list later, we can dig deeper.

Key papers and links

・ “A Mathematical Theory of Communication” (1948) — Shannon’s seminal paper that launched information theory. PDF: https://people.math.harvard.edu/~ctm/home/text/others/shannon/entropy/entropy.pdf (people.math.harvard.edu)

・ “Communication Theory of Secrecy Systems” (1949) — Shannon’s foundational work in cryptography from an information-theoretic vantage. PDF: https://pages.cs.wisc.edu/~rist/642-spring-2014/shannon-secrecy.pdf (UW Computer Sciences)

・ “Prediction and Entropy of Printed English” — later work (~1951) estimating entropy and redundancy in English text. PDF: https://www.princeton.edu/~wbialek/rome/refs/shannon_51.pdf (Princeton University)

・ “The Synthesis of Two‑Terminal Switching Circuits” (1949) — less about information theory, more about circuit‐design and logic gates (his master’s thesis direction). Listing here via DBLP. (DBLP)

・ “A Symbolic Analysis of Relay and Switching Circuits” (1938) — Shannon’s MIT thesis, very early but monumental. Info via Wikipedia. (Wikipedia)


here’s a curated list of key YouTube videos about Claude E. Shannon (and his work) that blend biography, theory, and historical context. You can pick and choose based on how deep you want to go.

Recommended videos

Claude Shannon ‑ Father of the Information Age

  1. “Claude Shannon – Father of the Information Age” (UCTV) — A broad biographical documentary, good for understanding his life and impact. (YouTube)

  2. “Claude Shannon: A Mathematical Theory of Communication” (Art of the Problem) — Focuses on his seminal 1948 paper and its theoretical implications. (YouTube)

  3. “Claude Shannon Explains Information Theory” (Discern) — A more accessible “mini-lecture” style video, good for digesting the basic ideas (entropy, bit, channel, etc.). (YouTube)

  4. “A Public Lecture Celebrating Claude E. Shannon” (Sergio Verdú, Institute for Advanced Study) — A more advanced talk, good if you’re comfortable with deeper math or want historical nuance. (YouTube)

  5. “The Story of Information Theory: from Morse to Shannon to ENTROPY” (Visual Electric) — Puts Shannon’s work in the broader history of communication and information, which can help tie things together. (YouTube)


Takagi Lectures XXV — Schedule, Context, and Reading List

Two days, three worlds: determinacy, graph codes, and proper actions

by Dave · October 18, 2025


Two short days at the University of Tokyo’s NISSAY Lecture Hall brought together three mathematicians who rarely cross orbits:
W. Hugh Woodin, logician of the set-theoretic cosmos;
Noga Alon, combinatorialist of near-infinite graphs;
and Fanny Kassel, geometer of proper actions and symmetry.
Each offered a distinct rhythm of infinity—logical, discrete, geometric.

Schedule Overview

Day 1 – October 18, 2025

・ 13:35–14:35 — W. Hugh Woodin (Harvard)
The AD⁺ Duality Program

・ 15:00–16:00 — Noga Alon (Princeton)
Graph-Codes: Questions, Results and Methods

・ 16:45–17:45 — Fanny Kassel (IHES)
Discrete Subgroups of Lie Groups and Proper Actions

Day 2 – October 19, 2025

・ 10:00–11:00 — W. Hugh Woodin
The HOD Conjecture and the Ultimate-L Conjecture

・ 11:30–12:30 — Noga Alon
Graph-Codes (continued)

・ 14:00–15:00 — Fanny Kassel
Proper Actions and Geometric Structures

・ 15:10–16:10 — Workshop closing with drinks


W. Hugh Woodin — The edges of the set-theoretic universe

Woodin treats foundations as an arena where consistency and truth spar endlessly.
The AD⁺ program explores worlds beyond ZFC’s reach, guided by determinacy axioms.
His Ultimate L project seeks a canonical inner model large enough to host every known large cardinal—Gödel’s constructible universe reinvented.

Recommended reading

The HOD Dichotomy (Davis, Rodriguez, Woodin) — arXiv 1605.00613
Suitable Extender Models IPhilPapers
Large Cardinals at the BrinkScienceDirect
What a Set Is: the V-ViewSpringerLink
The Equivalence of Axiom ()⁺ and Axiom ()⁺⁺PhilPapers


Noga Alon — The combinatorial imagination

Alon builds mathematics like a universal game of Lego.
His combinatorics fuses algebra, probability, and information theory; randomness becomes a tool for certainty.
In his Graph-Codes talks, graphs are treated as information carriers—structures that encode and decode through spectral behavior.

Recommended reading

・ Alon–Matias–Szegedy, The Space Complexity of Approximating Frequency MomentsPDF
High-Girth Near-Ramanujan Graphs with Localized EigenvectorsarXiv 1908.03694
・ Alon–Krivelevich–Sudakov, Embedding Nearly-Spanning Bounded Degree TreesarXiv 0706.4100
Unbalancing Sets and an Almost Quadratic Lower Bound for Syntactically Multilinear Arithmetic CircuitsarXiv 1708.02037
Tools from Higher AlgebraPDF


Fanny Kassel — Geometry acts properly

Kassel’s lectures orbit the geometry of discrete symmetry.
She studies when a discrete group acts properly on a homogeneous space—a question where algebra meets dynamics.
Her work ties Lie theory, hyperbolic geometry, and representation theory into a single geometric thread.

Recommended reading

Geometric Structures and Representations of Discrete Groups (ICM Rio survey) — PDF
・ Kobayashi–Kassel, Invariant Differential Operators on Spherical Homogeneous SpacesIHES
・ Kassel–Potrie, Eigenvalue Gaps for Hyperbolic Groups and SemigroupsarXiv 2002.07015


Reading pathways

・ Start with each speaker’s survey paper — they frame the terrain beautifully.
・ Pair the talks with one technical piece:

  • Woodin’s HOD Dichotomy,

  • Alon’s High-Girth Graphs,

  • Kassel’s Eigenvalue Gaps.
    ・ Look for the bridges: determinacy versus absoluteness, randomness versus structure, discreteness versus continuity.


Closing reflection

Across logic, combinatorics, and geometry, these lectures form a kind of functor network —
each field transforming ideas of regularity, infinity, and structure into its own syntax.
Woodin explores truth at the edge of definability; Alon extracts order from randomness;
Kassel measures the grace of symmetry when discreteness intrudes.
Together, they remind us that mathematics remains a living conversation between different infinities.


Location: University of Tokyo · Graduate School of Mathematical Sciences · NISSAY Lecture Hall
Dates: October 18–19, 2025



Here are some good YouTube (or video) lectures / talks for each of your three mathematicians.



W. Hugh Woodin

“Large cardinals and small sets” — W. Hugh Woodin (YouTube)
“W. Hugh Woodin — The HOD Dichotomy, weak extender models” (YouTube)
“Beyond the infinite: Hugh Woodin” (Rothschild Distinguished Lecture) (YouTube)

These give good insight into his work on inner model theory, determinacy, and large cardinals.


Noga Alon

“Graph-Codes: Problems, Results and Methods” — Noga Alon (YouTube)
“Topics in Combinatorics lecture 13.0 — Alon’s Combinatorial Nullstellensatz” (YouTube)
“Noga Alon: Combinatorial Reasoning in Information Theory” (YouTube)

These nicely illustrate his style: combinatorial methods, coding-theoretic interpretations, and the blending with information theory.


Fanny Kassel

“Geometric structures and representations of discrete groups (ICM Rio, 2018)” — Fanny Kassel (YouTube)
“Fanny Kassel (IHES) Convex projective structures and Anosov” (YouTube)
“Fanny Kassel — Sous-groupes discrets des groupes de Lie” (French talk) (YouTube)

These reflect her interests in discrete group actions, homogeneous spaces, and geometric/dynamical structures.



Mini Example of LLL Algo for Lattice SVP

The LLL algorithm's main goal is to take a "bad" basis (with long, nearly parallel vectors) and turn it into a "good" basis (with short, nearly orthogonal vectors) that generates the exact same lattice.

In 2D, LLL is just a more formal version of Gauss's Reduction Algorithm. It repeatedly does two simple steps:

  1. Reduce: Subtract the shortest vector from the longer one to make it shorter.

  2. Swap: If the "longer" vector becomes shorter than the "shortest" one, swap them.


Mini Example: 2D LLL (Gauss's Reduction)

Let's start with a "bad" 2D basis. These vectors are long and very close to each other.

  • Initial Basis:

    • $\mathbf{b_1} = (1, 9)$

    • $\mathbf{b_2} = (1, 10)$

The algorithm works in loops.

Loop 1

  1. Reduce: We want to make $\mathbf{b_2}$ shorter by subtracting a multiple of $\mathbf{b_1}$. The best multiple $q$ is the closest integer to $\frac{\mathbf{b_1} \cdot \mathbf{b_2}}{\|\mathbf{b_1}\|^2}$.

    • $\mathbf{b_1} \cdot \mathbf{b_2} = (1 \cdot 1) + (9 \cdot 10) = 91$

    • $\|\mathbf{b_1}\|^2 = 1^2 + 9^2 = 82$

    • $q = \text{round}(91 / 82) = \text{round}(1.11) = 1$

    • **New $\mathbf{b_2}$} $\leftarrow \mathbf{b_2} - 1 \cdot \mathbf{b_1} = (1, 10) - (1, 9) = \mathbf{(0, 1)}$

    • Current Basis: $\{\mathbf{b_1} = (1, 9), \mathbf{b_2} = (0, 1)\}$

  2. Swap Check (Lovász Condition): Is $\mathbf{b_1}$ "short enough" compared to $\mathbf{b_2}$? A simple check (Gauss's version) is: Is $\|\mathbf{b_1}\| \le \|\mathbf{b_2}\|$?

    • $\|\mathbf{b_1}\|^2 = 82$

    • $\|\mathbf{b_2}\|^2 = 1$

    • The condition is FALSE (82 is not $\le 1$). We must swap.

  • Basis after Loop 1: $\{\mathbf{b_1} = (0, 1), \mathbf{b_2} = (1, 9)\}$

Loop 2

  1. Reduce: Make the new $\mathbf{b_2}$ shorter by subtracting a multiple of the new $\mathbf{b_1}$.

    • $q = \text{round}\left( \frac{\mathbf{b_1} \cdot \mathbf{b_2}}{\|\mathbf{b_1}\|^2} \right) = \text{round}\left( \frac{(0 \cdot 1) + (1 \cdot 9)}{1^2} \right) = \text{round}(9) = 9$

    • **New $\mathbf{b_2}$} $\leftarrow \mathbf{b_2} - 9 \cdot \mathbf{b_1} = (1, 9) - 9 \cdot (0, 1) = (1, 9) - (0, 9) = \mathbf{(1, 0)}$

    • Current Basis: $\{\mathbf{b_1} = (0, 1), \mathbf{b_2} = (1, 0)\}$

  2. Swap Check: Is $\|\mathbf{b_1}\|^2 \le \|\mathbf{b_2}\|^2$?

    • $\|\mathbf{b_1}\|^2 = 1$

    • $\|\mathbf{b_2}\|^2 = 1$

    • The condition is TRUE (1 is $\le 1$). We do not swap.

The algorithm terminates.

  • Original "Bad" Basis: $\{(1, 9), (1, 10)\}$

  • LLL-Reduced "Good" Basis: $\{(0, 1), (1, 0)\}$

We found the shortest, most orthogonal basis for the lattice, which is just the standard integer grid $Z^2$.


Use Cases for 2D and 3D

You're right that solving SVP in 2D and 3D is "easy." We don't use LLL in low dimensions to solve hard crypto problems, but as a powerful tool for other mathematical problems.

2D Use Case: Finding Good Fractions (Diophantine Approximation)

Problem: Find a good, simple fraction $p/q$ that approximates an irrational number $\alpha$, like $\pi \approx 3.14159265...$

How LLL works:

  1. We build a 2D lattice basis using $\alpha$ and a large constant $C$:

    • $\mathbf{b_1} = (1, C \cdot \alpha)$

    • $\mathbf{b_2} = (0, C)$

  2. Any vector in this lattice looks like:

    q⋅b1​−p⋅b2​=(q,C⋅qα)−(0,C⋅p)=(q,C(qα−p))

  3. We run LLL on this basis to find a very short vector. A short vector will have a small $q$ (first component) and a very small $C(q\alpha - p)$ (second component).

  4. If C(qα−p) is tiny, it means qα−p≈0, which rearranges to:

    α≈p/q

Running this for $\alpha = \pi$ and a large $C$ will quickly spit out the short vector corresponding to the famous approximation $\mathbf{22/7}$ and the even better one, $\mathbf{355/113}$.


3D Use Case: Finding Integer Relations (The PSLQ Algorithm)

Problem: Find if a set of numbers are related by integers. For example, do $\log(2)$, $\log(3)$, and $\log(5)$ have an integer relation? (i.e., can you find integers $a, b, c$ such that $a \cdot \log(2) + b \cdot \log(3) + c \cdot \log(5) = 0$?)

How LLL works:

This is the same idea as 2D, but in 3D. We build a lattice where a short vector would prove a relationship.

  1. We build a 3D basis:

    • $\mathbf{b_1} = (1, 0, C \cdot \log(2))$

    • $\mathbf{b_2} = (0, 1, C \cdot \log(3))$

    • $\mathbf{b_3} = (0, 0, C \cdot \log(5))$

  2. Any vector in this lattice is:

    a⋅b1​+b⋅b2​+c⋅b3​=(a,b,C(a⋅log(2)+b⋅log(3)+c⋅log(5)))

  3. We run LLL to find the shortest vector in this lattice.

  4. If the shortest vector found is very short, its third component must be almost zero. This means we found integers $a, b, c$ such that $a \cdot \log(2) + b \cdot \log(3) + c \cdot \log(5) \approx 0$.

  5. (In this specific case, these numbers are known to be unrelated, so LLL would return a vector that isn't "short enough," proving no simple integer relation exists).

This technique was also the original motivation for LLL: factoring polynomials with rational coefficients.


Lattice SVP - Mini Examples in 2D 3D

2D Lattice SVP Examples

A 2D lattice is defined by a basis of two vectors, $\mathbf{b_1}$ and $\mathbf{b_2}$.

Example 1: Orthogonal Basis (The "Easy" Case)

This is the simplest lattice, where the basis vectors are already short and perpendicular.

  • $\mathbf{b_1} = (1, 0)$

  • $\mathbf{b_2} = (0, 1)$

This basis generates the standard integer grid $Z^2$. The shortest non-zero vectors are obviously $\mathbf{b_1}$, $\mathbf{b_2}$, and their negatives, all with a length of 1.

Example 2: Slightly Skewed Basis

This example shows how the shortest vector isn't always one of the basis vectors.

  • $\mathbf{b_1} = (5, 3)$

  • $\mathbf{b_2} = (2, 2)$

The basis vectors have lengths 52+32​=34​≈5.83 and 22+22​=8​≈2.83. However, a shorter vector can be found by combining them:

v=b1​−2b2​=(5,3)−2(2,2)=(5−4,3−4)=(1,−1)

The length of v is 12+(−1)2​=2​≈1.41, which is the shortest vector in this lattice.

Example 3: Highly Skewed Basis (The "Hard" Case)

This is a "bad" basis, where the vectors are long and nearly parallel. Finding the short vector is non-trivial and demonstrates why reduction algorithms like LLL are needed.

  • $\mathbf{b_1} = (65537, 65536)$

  • $\mathbf{b_2} = (65536, 65535)$

Both basis vectors are very long (length >92000). But a simple integer combination reveals a tiny vector:

v=b1​−b2​=(65537−65536,65536−65535)=(1,1)

The length of v is 12+12​=2​≈1.41.


3D Lattice SVP Examples

A 3D lattice is defined by a basis of three vectors, $\mathbf{b_1}$, $\mathbf{b_2}$, and $\mathbf{b_3}$.

Example 1: Orthogonal Basis

Similar to the 2D case, this is the standard $Z^3$ integer lattice.

  • $\mathbf{b_1} = (1, 0, 0)$

  • $\mathbf{b_2} = (0, 1, 0)$

  • $\mathbf{b_3} = (0, 0, 1)$

The shortest non-zero vectors have a length of 1.

Example 2: Symmetric, Non-Orthogonal Basis

This is a non-trivial but structured lattice.

  • $\mathbf{b_1} = (15, -7, -7)$

  • $\mathbf{b_2} = (-7, 15, -7)$

  • $\mathbf{b_3} = (-7, -7, 15)$

The basis vectors are relatively long (length $\approx 18.2$). The shortest vector is not immediately obvious from this basis. (For reference, a short vector in this lattice is $(1, 1, -1)$, which can be formed by a combination like $2\mathbf{b_1} + 3\mathbf{b_2} + 3\mathbf{b_3}$).

Example 3: Highly Skewed "Bad" Basis

This is a classic example used to show the power of the LLL algorithm. The basis vectors are enormous and almost orthogonal, yet they hide a very short vector.

  • $\mathbf{b_1} = (1, 1894885908, 0)$

  • $\mathbf{b_2} = (0, 1, 1894885908)$

  • $\mathbf{b_3} = (0, 0, 2147483648)$

The shortest vector in this lattice is v=(−3,17,4), which has a length of (−3)2+172+42​=9+289+16​=314​≈17.7. This vector is found using a massive integer combination:

v=−3b1​+5684657741b2​−5015999938b3​


(next - Upper vs Lower Boundary in caluculation size )

Here are my guesses for the calculation size boundaries for each of those 6 cases.

First, a quick clarification: "Calculation size" in this context isn't a single number but a measure of computational complexity. This complexity depends almost entirely on two things:

  1. Dimension ($n$): Fixed at 2 or 3. Because the dimension is so small, the problem is "easy" and can be solved efficiently.

  2. Bit-Length ($B$): The size of the numbers in your basis vectors. This is the main factor that will change the calculation time for your examples.

For a fixed dimension $n$, the time to solve SVP is polynomial in the bit-length $B$.

  • Lower Bound (all cases): $O(B)$. An algorithm must at least read the numbers, so the bare-minimum effort is proportional to the size of the numbers.

  • Upper Bound (2D): $O(B^2)$. 2D SVP is solved by Gauss's algorithm, which is very fast—its complexity is related to the square of the bit-length.

  • Upper Bound (3D): $O(B^3)$. 3D SVP can be solved by algorithms like LLL. The complexity is also polynomial, roughly scaling with the cube of the bit-length.


2D Lattice Guesses

Example 1: Orthogonal Basis

  • Basis: $\mathbf{b_1} = (1, 0)$, $\mathbf{b_2} = (0, 1)$

  • Bit-Length ($B$): Trivial ($B=1$).

  • Lower Bound: $O(1)$ operations.

  • Upper Bound: $O(1)$ operations.

  • Guess: This is a "zero-calculation" problem. Any algorithm would check the vectors, see they are orthogonal and of length 1, and stop immediately.

Example 2: Slightly Skewed Basis

  • Basis: $\mathbf{b_1} = (5, 3)$, $\mathbf{b_2} = (2, 2)$

  • Bit-Length ($B$): Very small ($B \approx 3$ bits).

  • Lower Bound: A few operations (proportional to $B$).

  • Upper Bound: A few dozen operations (proportional to $B^2$, so maybe $3^2 = 9$).

  • Guess: This is extremely fast. It's equivalent to running the Euclidean algorithm to find $\gcd(5, 2)$. It would take 1-2 reduction steps.

Example 3: Highly Skewed Basis

  • Basis: $\mathbf{b_1} = (65537, 65536)$, $\mathbf{b_2} = (65536, 65535)$

  • Bit-Length ($B$): Small ($B \approx 16$ bits).

  • Lower Bound: Proportional to 16.

  • Upper Bound: Proportional to $16^2 = 256$.

  • Guess: Still instantaneous for a computer. This is a "bad" basis but for such small numbers, the $O(B^2)$ complexity is trivial. It would perform a few more reduction steps than Example 2, but the calculation size is still very low.


3D Lattice Guesses

Example 1: Orthogonal Basis

  • Basis: $\mathbf{b_1} = (1, 0, 0)$, $\mathbf{b_2} = (0, 1, 0)$, $\mathbf{b_3} = (0, 0, 1)$

  • Bit-Length ($B$): Trivial ($B=1$).

  • Lower Bound: $O(1)$ operations.

  • Upper Bound: $O(1)$ operations.

  • Guess: Identical to the 2D orthogonal case. It's a "zero-calculation" problem.

Example 2: Symmetric, Non-Orthogonal Basis

  • Basis: $\mathbf{b_1} = (15, -7, -7)$, etc.

  • Bit-Length ($B$): Very small ($B \approx 4$ bits).

  • Lower Bound: Proportional to 4.

  • Upper Bound: Proportional to $4^3 = 64$.

  • Guess: Very fast. A 3D reduction algorithm (like LLL) would perform a handful of vector swaps and subtractions and finish.

Example 3: Highly Skewed "Bad" Basis

  • Basis: $\mathbf{b_1} = (1, 1894885908, 0)$, etc.

  • Bit-Length ($B$): Moderate ($B \approx 31$ bits, as $1.8 \times 10^9 \approx 2^{31}$).

  • Lower Bound: Proportional to 31.

  • Upper Bound: Proportional to $31^3 \approx 30,000$.

  • Guess: This is the only example with a non-trivial calculation size. The algorithm must perform many arithmetic operations (additions, multiplications, divisions) on 31-bit numbers. While still "instant" (microseconds) on a modern computer, its calculation size is thousands of times larger than any of the other examples. This is where you first see the algorithm actually having to do work.

(try to generalize it)


Here's the generalization for the upper and lower boundaries for 2D and 3D SVP, based on the bit-length $B$ of the largest number in your basis vectors.

The most important takeaway is that for a fixed, small dimension (like 2 or 3), the problem is not exponentially hard. The difficulty scales polynomially with the size of the numbers ($B$), not the dimension.


Lower Boundary (For both 2D and 3D)

The lower bound is determined by the "cost of reading the input." An algorithm can't solve the problem without at least looking at all the numbers.

  • Generalization: $O(B)$

  • Explanation: The input consists of a fixed number of integers (4 for 2D, 9 for 3D). The algorithm must read each of these integers, and the time this takes is proportional to their bit-length, $B$. Therefore, the absolute minimum time required is linear in $B$.


Upper Boundary (The "Hardest Case")

The upper bound is determined by the worst-case performance of the best-known algorithm for that dimension.

2D SVP

  • Algorithm: Gauss's Reduction Algorithm (which is essentially the Euclidean algorithm for vectors).

  • Generalization: $O(B^2)$

  • Explanation: The Gauss-Lagrange algorithm is guaranteed to find the shortest vector in 2D. Its computational complexity is well-known to be polynomial. It performs a number of steps related to $\log(B)$, but each step involves arithmetic operations (like division) on numbers of size $B$. This results in a total bit-complexity that is quadratic in $B$.

3D SVP

  • Algorithm: LLL Algorithm (Lenstra–Lenstra–Lovász).

  • Generalization (Classic): $O(B^3)$

  • Generalization (Modern): $O(B^2)$

  • Explanation: This is slightly more complex as algorithms have improved.

    • The classic LLL algorithm's complexity analysis (when fixing the dimension $n=3$) involves operations on numbers that can grow during the calculation, leading to a worst-case bound of $O(B^3)$.

    • More modern variants of LLL (like $L^2$) use clever floating-point arithmetic to control the size of the numbers, achieving a faster worst-case bound of $O(B^2)$.

For practical purposes, you can think of both 2D and 3D SVP as having a worst-case complexity of $O(B^2)$ using the best algorithms. The $O(B^3)$ bound is a more traditional, but still valid, upper bound for 3D if you are using a simpler LLL implementation.