/theory-of-computation:toc-beyond-np-space-and-distributed-limitsfrom theory-of-computation
Covers complexity classes beyond NP (polynomial hierarchy, PSPACE, counting classes), fine-grained complexity (SETH, 3SUM, APSP), space/streaming/sublinear algorithms, and distributed impossibility results (FLP, CAP, consensus). Useful when analyzing hardness past NP or distributed system limits.
Ships in theory-of-computation. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Part 3 of 5 of the Theory of Computation reference (plugin
theory-of-computation), covering §8–§11. Sibling skills:toc-automata-regex-and-parsing(§0–§3),toc-computability-and-complexity(§4–§7),toc-type-systems-and-randomization(§12–§13),toc-reference(§14–§19). Section numbers are shared across the set; a reference written as §N →skillpoints into that sibling skill.Currency: Verified August 2026. See §16 →
toc-referencefor the currency snapshot and what goes stale first.
How to read this. Reference, not a course. Three markers:
- [DURABLE] — proven theorems and stable practice. This is most of the document, and it does not expire.
- [VERSIONED] — the small moving parts: recent results, solver capability, open problems.
- [CONTESTED] — genuine disagreement, mostly about pedagogy and practical relevance.
⚠️ GOTCHA boxes mark places where ignorance of the theory produces a specific, expensive production failure — which is the whole argument for learning it.
The three framings that organize everything below:
- This is the only branch of CS that tells you what you cannot do. Everything else teaches techniques. Theory tells you when to stop looking — and knowing a problem is undecidable or NP-hard is more valuable than any algorithm, because it redirects you from an impossible goal to a tractable approximation of it.
- You already use it; you may not know the names. Regex is finite automata. Your parser is a pushdown automaton. Your state machine is a DFA. Your build system's cycle detection is graph theory. The theory isn't an addition to your practice — it's a description of it, and knowing the description tells you where the edges are.
- "Hard" is not "impossible," and this is the most consequential practical point. NP-complete problems with thousands of variables are solved routinely (§9). The theory tells you no algorithm is fast on all inputs — it says nothing about your inputs, which are usually structured. Treating NP-hardness as a verdict rather than a warning is the single most common misapplication of this material.
[DURABLE] Worth knowing the landscape so you recognize when you're in worse trouble than NP.
PSPACE — solvable in polynomial space, any amount of time. PSPACE-complete problems include quantified Boolean formulas (QBF), most two-player games, and many planning problems. ⚠️ The tell: alternating quantifiers. "Is there a move such that for all responses there is a move such that…" That's QBF, that's PSPACE, and it is a qualitatively harder thing than a single existential search. If your problem has an adversary, you are probably here.
EXPTIME and above — provably harder than P (by the time hierarchy theorem, this one is not conjectural). Generalized games on n×n boards, some type-system and logic decision problems.
Undecidable — §4 → toc-computability-and-complexity.
[DURABLE] The hierarchy theorems are among the few unconditional separations we have:
more time and more space strictly buy you more. Almost everything else in §5 → toc-computability-and-complexity's map is open.
[DURABLE, and under-taught relative to its practical value.] Classical complexity asks "polynomial or not." Fine-grained complexity asks: is my O(n²) algorithm actually optimal? — and it answers via conditional lower bounds.
The method: assume a hardness conjecture, then use fine-grained reductions — so tight that any improvement to the target implies an improvement to the source — to transfer hardness. The core conjectures: SETH (the Strong Exponential Time Hypothesis: for any ε > 0 there's a k such that k-SAT can't be solved in 2^((1-ε)n)), the Orthogonal Vectors hypothesis, 3SUM, and APSP.
[DURABLE] Why an engineer should care: it tells you when to stop optimizing. Well-known results in this line establish, under SETH, that Edit Distance and Longest Common Subsequence have no strongly subquadratic algorithm, that Orthogonal Vectors needs n², and that Bellman's classic O(nT) Subset Sum algorithm can't be substantially improved. Similar conditional bounds cover graph diameter approximation, dominating set, and a range of computational-geometry problems.
⚠️ The engineering translation: if your string-diff is quadratic, that is very likely not your fault, and no amount of profiling will fix it. The right move is to change the problem — restrict the input, exploit structure, approximate, or use a different similarity measure — not to keep optimizing the constant.
⚠️ These are conditional results. If SETH is false the bounds evaporate — but SETH has survived decades of attack and is treated as a working assumption.
[VERSIONED] Quantum analogues exist and are active (§16 → toc-reference): SETH itself fails quantumly
because Grover solves CNF-SAT in about 2^(n/2), so researchers built QSETH frameworks
to get meaningful quantum conditional lower bounds instead.
[DURABLE] Space is the resource engineers under-model. The classes: L (logarithmic space — you can hold a constant number of pointers, not a copy of the input), NL, PSPACE.
Two results worth carrying:
[DURABLE] Streaming and sublinear algorithms are the applied face of space complexity, and they're everywhere in production infrastructure: HyperLogLog (cardinality in kilobytes), Count-Min Sketch (frequency estimation), Bloom filters (membership with one-sided error), reservoir sampling. If you have a "count distinct over a firehose" problem, the theory already solved it — and the solution trades exactness for a bounded error you choose.
[VERSIONED — the one genuinely major recent theorem in this document.] In February 2025, Ryan Williams proved TIME[t] ⊆ SPACE[√(t log t)] — every multitape Turing machine running in time t can be simulated in O(√(t log t)) space. This replaced the Hopcroft–Paul–Valiant bound of t/log t that had stood since 1975, a near-quadratic improvement described in the field as "an earthquake of a result" and "a true classic complexity theorem." The proof reduces time-t computation to Tree Evaluation and applies the Cook–Mertz space-efficient algorithm from the catalytic-computing line.
⚠️ Read this correctly. It is a space simulation — it does not preserve the time bound, so it is not an algorithm you deploy tomorrow. Its significance is theoretical: it is a real step toward separating P from PSPACE, and it demolished a decades-old belief about what was possible. The engineering-adjacent lesson is epistemic: a 50-year-old "obvious barrier" fell, which is worth remembering whenever someone says something is known to be impossible when what they mean is that nobody has done it.
[DURABLE] Theory's most immediately actionable contribution to systems engineering. These are theorems, not architectural opinions, and violating them is not a design trade-off — it's a claim to have solved something proven impossible.
FLP impossibility (1985): in an asynchronous system with even one faulty process, there is no deterministic algorithm guaranteeing consensus. ⚠️ This is why every real consensus protocol uses timeouts, randomization, or a partial-synchrony assumption — Paxos and Raft don't refute FLP, they add an assumption FLP excludes. Anyone claiming deterministic asynchronous consensus is wrong.
CAP: under network partition, choose consistency or availability. ⚠️ CAP is routinely over-applied. It is about behaviour during a partition, not a general licence to be inconsistent, and the more useful modern framing is PACELC: under Partition, choose A or C; Else, choose Latency or Consistency — which is the trade-off you're actually making 99.9% of the time.
The Two Generals Problem: no protocol achieves guaranteed agreement over a lossy
channel. ⚠️ This is why exactly-once delivery does not exist, and why the achievable
target is at-least-once plus idempotency (which is why §3 → toc-automata-regex-and-parsing of a payments reference and this
paragraph are the same fact).
Byzantine fault tolerance: tolerating arbitrary (malicious) faults requires n > 3f nodes for f faults.
Linearizability, serializability, and the consistency zoo — these are formal definitions with precise meanings, and "eventual consistency" without specifying which model is not a specification.
[DURABLE] The practical instruction: when a design assumes reliable delivery, ordered delivery, synchronized clocks, or partition-free operation, name the assumption explicitly — because you have just chosen a side of one of these theorems, and it should be a decision rather than an accident.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
5 skills in this plugin
/toc-automata-regex-and-parsingUse when reasoning about what a language or matcher can express: automata and the Chomsky hierarchy as a practical design tool, DFAs, NFAs and state machines, what regular expressions actually are and what they cannot do, ReDoS and catastrophic backtracking, and parsing and grammar classes (LL, LR, PEG, ambiguity) with the practical points. Includes the router for the whole theory-of-computation reference./toc-computability-and-complexityUse when you need to know whether a problem is solvable and how hard it is: the halting problem, Rice's theorem and why static analysis has false positives, reductions as the most transferable skill here, complexity classes and the P versus NP map, recognizing NP-hardness and the escape hatches in order of usefulness, and SAT and SMT solvers and why 'NP-complete' is not a verdict./toc-referenceUse when checking a theory anti-pattern, weighing a contested question (does P equal NP, how much theory a working engineer needs, whether the Turing machine is still the right model, whether formal methods are worth it), confirming whether a claim is still current (snapshot verified August 2026 — the most durable domain in this collection), finding the books and courses, or needing the recognition table and the before-you-optimize checklist. Companion to the other theory-of-computation skills./toc-type-systems-and-randomizationUse when reasoning about type systems, verification, or randomized algorithms: types as logic and the Curry–Howard correspondence, decidability of type checking and inference, what formal methods actually buy and where lightweight methods win, and randomness and approximation — BPP, Monte Carlo versus Las Vegas, the PCP theorem and hardness of approximation, heuristics and No Free Lunch.npx claudepluginhub the-vibey-project/vibey --plugin theory-of-computation