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

Space Hierarchy Theorem

Research Depth 106 in the knowledge graph ☐ I know this ☆ Set as goal
4topics build on this
745prerequisites beneath it
See this on the map →
Space Complexity: PSPACE, L, and NLTuring Machines+1 more→→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 → Combining Small Groups Within 5 → Number Bonds Within 5 → Number Bonds to 10 → Tens and Ones Place Value → Reading and Writing Three-Digit Numbers → Comparing Three-Digit Numbers → Comparing and Ordering Three-Digit Quantities → Comparing and Ordering Whole Numbers → Comparing Numbers 1 to 20 → Ordering Numbers to 20 → Number Line 0 to 20 → 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 → Opposites and Additive Inverses → 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 → Introduction to Propositional Logic → Introduction to Predicate Logic (First-Order Logic) → First-Order Logic Syntax → Terms and Atomic Formulas in FOL → Variable Binding and Scope → Open and Closed Formulas in First-Order Logic → Variable Substitution and Capture-Avoidance in First-Order Logic → Quantifier Instantiation Rules in First-Order Proof Systems → Universal Quantification: Meaning and Scope → Free Variables and Bound Variables → Substitution and Instantiation in Predicate Logic → Terms and Atomic Formulas → Formulas and Well-Formed Expressions → Structures and Interpretations → Model Interpretation and Satisfaction → Interpretation, Truth, and Satisfaction of Formulas → Logical Consequence and Entailment → Soundness Theorem and Validity of Proof Systems → Deductive Reasoning and Formal Proof Systems → First-Order Resolution → Propositional Resolution → Semantic Tableaux (Propositional) → Semantic Tableaux (First-Order) → Decidable Fragments of First-Order Logic → Gödel's Completeness Theorem for First-Order Logic → Gödel's Incompleteness Theorems → The Arithmetical Hierarchy → Time Hierarchy Theorem → Space Hierarchy Theorem

Longest path: 107 steps · 745 total prerequisite topics

Prerequisites (3)

Leads To (1)