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 moreLogarithmic 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 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 NPThe P vs. NP ProblemComplexity Class P: Polynomial TimeComplexity Class NP: Nondeterministic Polynomial TimeNP-Completeness and Cook-Levin TheoremThe Cook-Levin TheoremBoolean Satisfiability, Cook-Levin, and ReductionsExponential Time HypothesisTime and Space Hierarchy TheoremsSpace Hierarchy Theorem

Longest path: 103 steps · 740 total prerequisite topics

Prerequisites (3)

Leads To (1)