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

Space Hierarchy Theorem

Research Depth 95 in the knowledge graph ☐ I know this ☆ Set as goal
4topics build on this
496prerequisites beneath it
See this on the map →
Space Complexity: PSPACE, L, and NLTuring Machines→→The Polynomial Hierarchy
complexity-theory hierarchy provable-separation

Core Idea

The space hierarchy theorem states that for space-constructible f(n) ≥ log n, DSPACE(f(n)) ⊂ DSPACE(f(n) log f(n)). Unlike time (which requires quadratic growth), space only needs logarithmic growth because space is 'reusable'—the machine can overwrite previous values. The theorem shows space classes strictly increase even with tighter bounds than time, but the proof technique differs fundamentally: verifying space usage requires tracking maximum usage, not cumulative cost.

Explainer

From your study of space complexity classes, you know that DSPACE(f(n)) collects all languages decidable by a deterministic Turing machine using at most f(n) tape cells. A natural question follows: does giving a machine genuinely more space let it solve strictly more problems? The space hierarchy theorem answers yes — and it does so with a surprisingly tight bound. If you allow a machine f(n) · log f(n) space instead of f(n), there exist languages decidable with the larger budget that no f(n)-bounded machine can handle. The strict inclusion DSPACE(f(n)) ⊊ DSPACE(f(n) log f(n)) is provable, not conjectured.

The proof uses diagonalization, the same technique that underlies the halting problem and the time hierarchy theorem, but adapted for space. The key idea is to construct a language L that a machine M with the larger space budget can decide by simulating every f(n)-bounded machine and then doing the opposite of what each one does on a carefully chosen input. The simulator needs to track how much space the simulated machine uses, and this bookkeeping — counting tape cells up to f(n) — costs an additional log f(n) factor, since writing down a number up to f(n) requires log f(n) bits.

Compare this to the time hierarchy theorem, which requires a quadratic blowup: DTIME(f(n)) ⊊ DTIME(f(n)²). The reason space gets away with only a logarithmic overhead is that space is reusable. A Turing machine can overwrite tape cells and reuse them for different parts of the simulation. Time, once spent, is gone forever — each simulation step of the simulated machine costs the simulator real steps, and the overhead accumulates multiplicatively. Space overhead, by contrast, only reflects the maximum simultaneous usage, not cumulative consumption. This reusability is what makes space hierarchies tighter than time hierarchies.

The practical consequence is a clean ladder of provably distinct complexity classes. DSPACE(n) is strictly contained in DSPACE(n log n), which is strictly contained in DSPACE(n²), and so on. Each rung of the ladder contains languages that genuinely require that much space — no clever algorithm can compress them into a smaller class. This is powerful because most separations in complexity theory (like P vs. NP) remain unproven. The hierarchy theorems are among the few tools that deliver unconditional, proven separations between complexity classes, giving the field its backbone of known structure.

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 → Introduction to Exponents → Order of Operations → Integer Order of Operations → Variable Expressions → The Distributive Property → Variables and Expressions Review → Introduction to Polynomials → Adding and Subtracting Polynomials → Multiplying Polynomials → Factorial → Permutations → Combinations → Counting Principles: Addition and Multiplication Rules → Introduction to Graph Theory → Propositional Logic Foundations → Logical Equivalences → Boolean Algebra → Boolean Type and Truth Values → Comparison Operators and Boolean Tests → Logical Operators and Boolean Algebra → Boolean Algebra and Fundamental Laws → Logic Gates Fundamentals → Implementing Boolean Functions with Gates → Karnaugh Map Simplification → Combinational Circuit Design → Flip-Flops and Latches → Finite State Machines (FSMs) → Deterministic Finite Automata (DFA) → Nondeterministic Finite Automata (NFA) → Two-Way Finite Automata → NFA to DFA Conversion (Subset Construction) → DFA Properties and Minimization Algorithms → Regular Languages: Definition and Characterization → Context-Free Grammars (CFGs) → Pushdown Automata (PDA) → Equivalence of CFGs and Pushdown Automata → Closure Properties of Context-Free Languages → Limitations of Context-Free Languages → Pumping Lemma for Context-Free Languages → Turing Machines → Variants of Turing Machines and Equivalence → Nondeterministic Time Complexity and NP → Space Complexity: PSPACE, L, and NL → Space Hierarchy Theorem

Longest path: 96 steps · 496 total prerequisite topics

Prerequisites (2)

Leads To (1)