skip to content

A validator claims a rule's condition can never be satisfied by any request — which complexity class is that claim complete for?

level: seniorimportance: must knowfreq 50%

answer

  1. start from the complement
  2. the complete problem, negated
  3. no assignment works, for every assignment
  4. unsatisfiability and tautology travel together
  5. negation is a linear-time transformation

basics

~20 s

Co-NP: unsatisfiability is the canonical co-NP-complete problem, the exact complement of satisfiability. Its twin is tautology, since a formula is a tautology precisely when its negation is unsatisfiable, so hardness carries between the two by negation.

solid answer

~40 s

The claim is literally unsatisfiability of a boolean formula, and unsatisfiability is **co-NP-complete**. The argument is short: satisfiability is NP-complete, and complementing an NP-complete problem gives a co-NP-complete one, because a reduction that maps yes to yes also maps no to no. Its mirror is **tautology** — a formula holds under every assignment exactly when its negation holds under none — so the two are the same problem wearing opposite signs, and both are complete for co-NP. That completeness is what makes the claim awkward: a `never fires` verdict is at least as hard to certify as any claim in the whole class, so the validator cannot expect a short proof object in general. It can always certify the opposite verdict, by producing the one request that fires the rule.

go deeper

for a junior

Recall that 'no assignment satisfies this formula' is the complement of 'some assignment does', and that the complement is not the same problem with an easier answer. Name the class as co-NP.

for a middle

Explain why complementing an NP-complete problem lands you on a co-NP-complete one, and show how negation links unsatisfiability and tautology so hardness transfers between them.

for a senior

Demonstrate the reduction in the right direction on a concrete check of your own, and be explicit that a machine-checkable refutation can exist while still being superpolynomially long.

for a principal

Weigh what a 'never fires' guarantee commits the platform to. Decide whether the condition language is worth restricting so the claim leaves the complete class, and say what the verdict means when it cannot be settled.

## The claim is literally unsatisfiability 'This condition can never be satisfied by any request' is the statement that a boolean formula has **no** satisfying assignment. Strip the policy vocabulary and it is the classic decision problem `UNSAT`: given a formula, decide whether every assignment falsifies it. Its complement is `SAT`: decide whether some assignment satisfies it. One problem, one boundary, two names depending on which side you stand on. ## Complementing a complete problem Satisfiability is **NP-complete** — it is in NP, and every problem in NP reduces to it in polynomial time, which is the content of the Cook-Levin theorem. Now complement everything: - If `A` reduces to `B` by a polynomial-time map, the same map reduces the complement of `A` to the complement of `B`, because a many-one reduction preserves the verdict on both sides. - So if every problem in NP reduces to `SAT`, every problem in co-NP reduces to `UNSAT`. - And `UNSAT` is in co-NP by definition, since its complement `SAT` is in NP. Together those give **`UNSAT` is co-NP-complete**. The general fact is worth carrying: the complement of an NP-complete problem is co-NP-complete, never NP-complete again unless the two classes coincide. ## The tautology twin A formula is a **tautology** when every assignment satisfies it. Negate it: the assignments that satisfy the negation are exactly those that falsify the original. So `phi` is a tautology if and only if `not phi` is unsatisfiable, and negation is a linear-time transformation. Hardness travels across it in both directions, which is why tautology is the other standard co-NP-complete problem and why the two are usually named as a pair. ## Normal form decides which half is easy Both questions become trivial on the normal form that suits them, and this is the detail interviewers use to check you understand which quantifier is doing the work: | Formula shape | Is it satisfiable? | Is it a tautology? | |---|---|---| | Conjunctive normal form (an AND of clauses) | NP-complete | polynomial: every clause must contain some variable together with its negation | | Disjunctive normal form (an OR of terms) | polynomial: some term must contain no variable together with its negation | co-NP-complete | The rule behind the table: a conjunctive form makes the *falsifying* witness easy to reason about clause by clause, and a disjunctive form makes the *satisfying* witness easy to reason about term by term. Converting between the forms is what costs — the conversion can blow up exponentially, which is where the hardness hides rather than disappearing. ## What this means for the policy validator Suppose the table check is 'no request triggers two opposing rules'. Map an arbitrary formula `phi` onto a two-rule table: one rule permits when `phi` holds, one rule denies unconditionally. Then some request triggers both exactly when `phi` is satisfiable, so the table is conflict-free exactly when `phi` is unsatisfiable. That is a polynomial-time reduction **from** `UNSAT` **to** the conflict-free check, and its direction matters: 1. Reducing `A` to `B` shows `B` is at least as hard as `A` — any fast algorithm for `B` would yield a fast algorithm for `A`. 2. Here `A` is `UNSAT`, which is co-NP-complete, and `B` is the conflict-free check. 3. Therefore the conflict-free check is **co-NP-hard**. Getting this arrow backwards — concluding that `UNSAT` inherits something from the check — is the single most common error in this material. So the validator's universal claim is not merely inconvenient; it is as hard as anything in co-NP, and no clever engineering removes that while the condition language stays expressive. ## What a proof of unsatisfiability actually costs A refutation is a certificate: a derivation that a checker replays step by step, in time polynomial in the derivation's own length. That last clause is the catch. The check is fast in the size of the proof, but the proof itself need not be small — for some families of formulas, including the pigeonhole formulas, every resolution refutation is known to be superpolynomially long. So 'unsatisfiable, with a machine-checkable derivation attached' is a real and useful output format, and simultaneously not a promise of a short proof. Whether *some* proof system always gives short refutations is the NP versus co-NP question in another costume.

  • What would a certificate of unsatisfiability even look like?
    A derivation in a proof system — for instance a resolution refutation, a sequence of clauses each derived from earlier ones, ending in the empty clause. A checker replays it in time polynomial in the derivation's length. The catch is length: some formula families are known to need superpolynomially long resolution refutations, so the certificate exists but is not short.
  • Why does a reduction from unsatisfiability to the conflict-free check prove the check is hard, rather than the other way round?
    Because the reduction turns any algorithm for the target into an algorithm for the source. Mapping a formula to a table means a fast conflict-free check would settle unsatisfiability fast, so the check inherits the difficulty. The source lends its hardness to the target; the target lends nothing back.
  • If someone showed unsatisfiability was in NP, what would follow?
    NP and co-NP would collapse into one class. Unsatisfiability is co-NP-complete, so every co-NP problem reduces to it; membership in NP would drag all of co-NP into NP, and complementing gives the reverse inclusion. That is why a claimed short certificate for every unsatisfiable formula is an extraordinary claim.

saying these in an interview costs you the question

  • Calls unsatisfiability NP-complete because satisfiability is.
  • Treats tautology and satisfiability as the same question renamed.
  • Believes a solver's unsatisfiable verdict is a short proof for every formula.
  • Says the complement of an NP-complete problem is still NP-complete.
  • Assumes deciding a conjunctive-form formula is a tautology needs search.
  • Reads the reduction backwards and concludes the easy side is the hard one.