A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

Co-NP and Complementary Complexity Classes

College Depth 85 in the knowledge graph ☐ I know this ☆ Set as goal
14topics build on this
486prerequisites beneath it
See this on the map →
NP and Polynomial-Time Verificationco-NP→→Complexity Classes and the Complexity HierarchyRandomized Complexity: RP, co-RP, and ZPP
complexity-classes complements decision-problems

Core Idea

Co-NP is the class of problems whose complement lies in NP: a language is in co-NP if its negation is in NP. While NP captures problems with efficiently verifiable 'yes' certificates, co-NP captures problems with efficiently verifiable 'no' certificates. Whether P = NP = co-NP remains a central unsolved question.

How It's Best Learned

Start with examples of NP problems (satisfiability, clique existence) and their co-NP complements (unsatisfiability, clique non-existence). Note that co-NP is the class where 'no' instances have short proofs, not 'yes' instances.

Common Misconceptions

Explainer

You already know that NP captures problems where "yes" answers are easy to verify: given a satisfying assignment for a Boolean formula, you can check it in polynomial time. The key move in understanding co-NP is to ask the symmetric question — what about "no" answers? The complement of a language L is the set of all strings not in L, written L̄. If L = SAT (satisfiable formulas), then L̄ = UNSAT (unsatisfiable formulas). Co-NP is precisely the class of languages whose complements are in NP.

Concretely: UNSAT is in co-NP because, to verify that a formula is *not* satisfiable, you don't have a short certificate — but to verify that a formula *is* satisfiable (its complement), you do. Equivalently, a language is in co-NP if "no" instances have polynomial-size certificates that can be checked in polynomial time. For UNSAT, a "no" certificate would be a proof that no assignment works — and we currently know no such short certificate exists in general. For problems like PRIMES (is n prime?), both the problem and its complement have short certificates, so PRIMES ∈ NP ∩ co-NP.

The relationship between NP and co-NP is one of the deepest open questions in complexity theory. We strongly suspect NP ≠ co-NP, because if NP = co-NP, then every NP-complete problem would also have short "no" certificates. Yet SAT having short "no" certificates seems implausible: how could you concisely prove that a formula with millions of possible assignments has no solution? Formally, NP = co-NP if and only if some (equivalently, every) NP-complete problem is also in co-NP.

Note a critical subtlety: if P = NP, then P = NP = co-NP, because P is closed under complementation. But the converse does not hold — NP = co-NP does not imply P = NP. The inclusions are P ⊆ NP ∩ co-NP ⊆ NP ∪ co-NP, and collapsing NP = co-NP is a weaker statement than collapsing P = NP. The co-NP class also starts its own hierarchy: co-NP-complete problems (like UNSAT) are the hardest problems in co-NP, and any NP-hard problem's complement is co-NP-hard.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Dividing Integers → Unit Rates → Proportions → Percent Concept → Converting Between Fractions, Decimals, and Percents → Operations with Rational Numbers → Two-Step Equations → Solving Multi-Step Equations → Equations with Variables on Both Sides → Literal Equations → Slope-Intercept Form → Point-Slope Form → Writing Linear Equations → Parallel and Perpendicular Line Slopes → Graphing Linear Equations → Piecewise Functions → Step Functions → Composition of Functions → Inverse Functions → Radical Functions and Graphs → Rational Exponents → Exponential Functions and Graphs → Logarithms Introduction → Big-O Notation and Asymptotic Analysis → Breadth-First Search (BFS) → Shortest Paths in Unweighted Graphs → Dijkstra's Shortest Path Algorithm → Algorithm Analysis and Big-O Notation → Turing Machines → Time Complexity and the Class P → Nondeterministic Turing Machines → NP and Polynomial-Time Verification → co-NP → Co-NP and Complementary Complexity Classes

Longest path: 86 steps · 486 total prerequisite topics

Prerequisites (2)

Leads To (2)