4.6.27 · D1Theory of Computation

Foundations — NP-hard — harder than NP, may not be in NP

1,586 words7 min readBack to topic

Before you can read the parent note NP-hard, you need to own every squiggle it uses. This page builds each one from nothing, in the order they depend on each other. Never trust a symbol you haven't seen born.


0. What even is a "problem" here?

The picture: a machine with one input slot and exactly two output lamps, a green YES lamp and a red NO lamp.

Figure — NP-hard — harder than NP, may not be in NP

1. The symbol and the idea of a "language" / class

Picture as a box. Every input string is either dropped inside the box (a YES-instance) or left outside (a NO-instance).

  • sits inside the box.
  • sits outside.

The parent note calls these boxes languages. A class is just a box of boxes: a family of problems grouped by how hard they are.


2. The class — the "easy-to-check" box

The picture: two roles.

Figure — NP-hard — harder than NP, may not be in NP
  • A prover (untrusted) shouts a certificate.
  • A verifier (trusted, fast) inspects input + certificate and lights YES only if the hint truly works.

3. What "polynomial time" means (and why we care)

The picture: two curves rising with input size .

Figure — NP-hard — harder than NP, may not be in NP

4. The reduction arrow — "transfers difficulty"

This is the heart of the whole topic, so build it slowly.

The picture: a pipe. Pour an -instance in, the translator reshapes it, out comes an equivalent -instance; solve that, and the answer is also the answer to .

Figure — NP-hard — harder than NP, may not be in NP

5. Assembling NP-hard from these pieces

Now every symbol in the definition is defined. Read it and nothing is a stranger:


Prerequisite map

Decision problem YES or NO

Language L a box of YES inputs

Certificate a checkable hint

Class NP easy to check

Polynomial time n to the k

Reduction arrow A leq p L

NP-hard floor of NP

NP-complete hard and in NP

Transitivity of reductions

The classic seeds that make this machinery run live in Cook–Levin Theorem (the first NP-hard proof), 3-SAT and reduction templates (the reusable starting point), and the boundary cases in Halting Problem — undecidability and P vs NP.


Equipment checklist

Cover the right side and answer aloud. If any stalls, reread that section before the parent note.

What does mean in plain words?
The answer to problem on input is YES — sits inside the "YES box."
What is a decision problem?
A question whose only answers are YES or NO (a single bit).
What is a certificate?
A short hint that lets a verifier quickly confirm a YES-answer.
What is the class NP?
All decision problems whose YES-instances have a poly-time-checkable certificate.
What is "polynomial time"?
Running in at most steps for some fixed power (tame growth, not exploding like ).
Why is a polynomial-of-a-polynomial still polynomial important?
It lets reductions chain: stays polynomial.
What does mean, and which side is harder?
translates into in poly time; (the right side) is at least as hard.
Write the definition of NP-hard using , , "every".
For every , .
NP-hard vs NP-complete?
NP-hard = floor beneath NP (may not be in NP); NP-complete = NP-hard AND in NP.