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

Graduate Depth 102 in the knowledge graph ☐ I know this ☆ Set as goal
2topics build on this
740prerequisites beneath it
See this on the map →
Space Complexity: PSPACE, L, and NLTime Hierarchy Theorem+1 more→→Logarithmic Space Classes (L and NL)
separations space-complexity resource-bounded

Core Idea

The space hierarchy theorem states that for space-constructible functions f and g with f = o(g), we have DSPACE(f) ⊊ DSPACE(g). Unlike the time hierarchy, the theorem is unconditional and requires no logarithmic factor. This implies strict hierarchy among space classes: L ⊂ PSPACE ⊂ EXPSPACE, guaranteeing more languages become decidable with more space.

Explainer

You've studied space complexity classes and the intuition that more resources enable more computation. The space hierarchy theorem makes this precise: if g(n) grows strictly faster than f(n) — formally, f = o(g), meaning f/g → 0 — then DSPACE(g) strictly contains DSPACE(f). There are languages that can be decided with g(n) space but provably cannot be decided with only f(n) space, no matter how clever the algorithm. More space means strictly more power, and no optimization can eliminate the gap.

The proof uses diagonalization, the same technique at the heart of the undecidability of the halting problem. You construct a language L that "diagonalizes" against all machines using only f(n) space. The diagonalizer M works as follows: on input ⟨e, x⟩, it simulates the e-th Turing machine on input x while carefully tracking its space usage, staying within g(n) space. At the end, M flips the answer. By construction, M disagrees with every f(n)-space machine on at least one input (the input that encodes the machine itself). So L — the language accepted by M — is not in DSPACE(f). But M itself uses g(n) space, so L ∈ DSPACE(g). This is the diagonal witness.

A key advantage of the space hierarchy over the time hierarchy theorem is that it requires no logarithmic slack. The time hierarchy needs g = Ω(f log f) because simulating a machine on a universal TM incurs a logarithmic overhead in time. Space simulation is more efficient: you can reuse space, so the constant-factor overhead in space is absorbed without a log penalty. This means the space hierarchy gives cleaner, tighter separations: DSPACE(n) ⊊ DSPACE(n²) follows immediately, without any caveat.

The practical consequence is that the classes you've already studied form a *strict* hierarchy. The inclusions L ⊊ PSPACE ⊊ EXPSPACE are not conjectured — they are theorems. Each class strictly contains the previous. This stands in sharp contrast to the situation between P and NP, or even P and PSPACE, where strict containment is expected but unproven. The space hierarchy theorem is one of the few clean, unconditional separations in complexity theory: a result that requires no unproven assumptions, no circuit lower bounds, no algebraic tools — just the diagonalization argument applied carefully.

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 → The P vs. NP Problem → Complexity Class P: Polynomial Time → Complexity Class NP: Nondeterministic Polynomial Time → NP-Completeness and Cook-Levin Theorem → The Cook-Levin Theorem → Boolean Satisfiability, Cook-Levin, and Reductions → Exponential Time Hypothesis → Time and Space Hierarchy Theorems → Space Hierarchy Theorem

Longest path: 103 steps · 740 total prerequisite topics

Prerequisites (3)

Leads To (1)