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 MachinesThe 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 ZeroThe Number ZeroCounting to FiveCounting to 10Counting to 20Counting a Set of Objects Up to 20Cardinality: The Last Number CountedMatching Numerals to QuantitiesSubitizing Small QuantitiesAddition Within 10Number Bonds to 10Addition Within 20Doubles and Near DoublesDoubles Facts Within 10Near Doubles Facts Within 20Mental Math Strategies for AdditionMental Math: Adding and Subtracting TensAddition Within 100Repeated Addition as MultiplicationMultiplication as Equal GroupsMultiplication: ArraysBasic Multiplication Facts (0s, 1s, 2s, 5s, 10s)Multiplication Facts Within 100Division as Equal SharingDivision as Grouping (Measurement Division)Division: Grouping (Repeated Subtraction) ModelDivision: Fair Sharing ModelDivision as Equal SharingDivision as GroupingBasic Division FactsDivision Facts Within 100Multiplication and Division Fact FamiliesRelationship Between Multiplication and DivisionDivision Facts as Inverse of MultiplicationRemainders and Quotients in DivisionDivision Word ProblemsMulti-Step Word ProblemsSolving Multi-Step Word ProblemsMultiplication Word ProblemsDivision Word ProblemsIntroduction to Long DivisionFactors and MultiplesPrime and Composite NumbersEquivalent FractionsRelating Fractions and DecimalsDecimal Place ValueIntegers and the Number LineComparing and Ordering IntegersAbsolute ValueAdding IntegersSubtracting IntegersMultiplying IntegersIntroduction to ExponentsOrder of OperationsInteger Order of OperationsVariable ExpressionsThe Distributive PropertyVariables and Expressions ReviewIntroduction to PolynomialsAdding and Subtracting PolynomialsMultiplying PolynomialsFactorialPermutationsCombinationsCounting Principles: Addition and Multiplication RulesIntroduction to Graph TheoryPropositional Logic FoundationsLogical EquivalencesBoolean AlgebraBoolean Type and Truth ValuesComparison Operators and Boolean TestsLogical Operators and Boolean AlgebraBoolean Algebra and Fundamental LawsLogic Gates FundamentalsImplementing Boolean Functions with GatesKarnaugh Map SimplificationCombinational Circuit DesignFlip-Flops and LatchesFinite State Machines (FSMs)Deterministic Finite Automata (DFA)Nondeterministic Finite Automata (NFA)Two-Way Finite AutomataNFA to DFA Conversion (Subset Construction)DFA Properties and Minimization AlgorithmsRegular Languages: Definition and CharacterizationContext-Free Grammars (CFGs)Pushdown Automata (PDA)Equivalence of CFGs and Pushdown AutomataClosure Properties of Context-Free LanguagesLimitations of Context-Free LanguagesPumping Lemma for Context-Free LanguagesTuring MachinesVariants of Turing Machines and EquivalenceNondeterministic Time Complexity and NPSpace Complexity: PSPACE, L, and NLSpace Hierarchy Theorem

Longest path: 96 steps · 496 total prerequisite topics

Prerequisites (2)

Leads To (1)