While this submission is a draft, it cannot be used by other submissions.

Alternating machines in bounded space

Lax480241.AlternatingSpace · concepts/Lax480241/AlternatingSpace.lean · lax-480241

definition

Loading review…

Sign in with ORCID

Community review

Flags

Each flag is tied to a public ORCID identity and explains why this concept may be incorrect.

No flags have been submitted.

    Community review

    Flag this concept

    State precisely what appears incorrect. This explanation will be public under your ORCID name.

    No source line selected.

    Natural Language Statement

    Definition

    An alternating Turing machine instance of the polynomial hierarchy accepts in bounded space when an initial configuration wins the game played on its configurations, without a bound on the number of steps; its states are split in two by the marks, one per player. Acceptance by alternating machines in bounded space, the problem defining APSPACE, holds of a well-formed instance whose states are so split and which accepts in bounded space.

    Concept map
    5 concepts; 6 descendants hidden
    100%
    Proven claimDefinitionThis conceptRelated conceptA → B: B builds on A

    Lean source view on GitHub

    1import Mathlib.Algebra.BigOperators.Finprod
    2import Mathlib.Data.Set.Finite.Lemmas
    3import Mathlib.Data.Fintype.EquivFin
    4import Mathlib.Data.Set.Card
    5import Mathlib.SetTheory.Cardinal.Finite
    6import Mathlib.Logic.Equiv.Prod
    7import Lax564036.AlternatingMachines
    8import Lax904597.Machines
    9import Lax485149.Problems
    10
    11/-!
    12---
    13title: Alternating machines in bounded space
    14type: definition
    15---
    16An alternating Turing machine instance of the polynomial hierarchy accepts
    17in bounded space when an initial configuration wins the game played on its
    18configurations, without a bound on the number of steps; its states are split
    19in two by the marks, one per player. Acceptance by alternating machines in
    20bounded space, the problem defining APSPACE, holds of a well-formed instance
    21whose states are so split and which accepts in bounded space.
    22-/
    23
    24namespace Lax480241.AlternatingSpace
    25
    26open Lax564036.AlternatingMachines Lax904597.Machines
    27
    28namespace ATMData
    29
    30variable {A : Type} (M : ATMData A)
    31
    32/-- **Winning the alternating game**, with no bound on the length of a play: an
    33accepting state wins; an existential configuration wins when some successor
    34does; a universal one wins when it has a successor and every successor wins.
    35
    36Being a least fixed point, this makes an infinite play a loss for the
    37existential player – the standard convention, and the one the budgeted
    38`ATMData.AltAcc` already has. -/
    39inductive AltWin (start : Bool) : Config A → Prop
    40 /-- An accepting state wins outright. -/
    41 | acc {c : Config A} : M.Acc c.state → AltWin start c
    42 /-- An existential configuration wins when some successor does. -/
    43 | ex {c c' : Config A} : ¬M.IsUniv start c.state → M.Step c c' → AltWin start c' →
    44 AltWin start c
    45 /-- A universal configuration wins when it has a successor and every
    46 successor wins. -/
    47 | all {c : Config A} : M.IsUniv start c.state → (∃ c', M.Step c c') →
    48 (∀ c', M.Step c c' → AltWin start c') → AltWin start c
    49
    50/-- **Acceptance in bounded space**: an initial configuration wins, the choice
    51of that configuration belonging to the player who moves first – exactly as in
    52`ATMData.AltAccepts`, and for the same reason. -/
    53def AltAcceptsSpace (start : Bool) : Prop :=
    54 guardQ start (fun c₀ : Config A => M.IsInit c₀) (fun c₀ => ATMData.AltWin M start c₀)
    55
    56variable {M}
    57
    58variable (M)
    59
    60/-- **The marks split the states in two.** This is all the block discipline an
    61unbounded alternation needs: no state carries a mark above `1`, and every state
    62carries exactly one of the two. `ATMData.BlocksWellFormed`
    63is deliberately *not* required – its ordering clause is what bounds the number
    64of alternations. -/
    65def BlocksSplit : Prop :=
    66 (∀ q, ∃ j, j < 2 ∧ M.Blk j q ∧ ∀ j', M.Blk j' q → j' = j)
    67
    68end ATMData
    69
    70open Lax904597.Problems Lax485149.Problems
    71
    72/-- **Alternating acceptance in bounded space**: the instance is a well-formed
    73alternating machine whose states the marks split in two, and it accepts in
    74bounded space. -/
    75def ATMAcceptSpace : DecisionProblem (turingAlt 2) :=
    76 DecisionProblem.ofPred fun A _ => TMData.WellFormed (atmData 2 A).toTMData ∧
    77 ATMData.BlocksSplit (atmData 2 A) ∧ ATMData.AltAcceptsSpace (atmData 2 A) true
    78
    79end Lax480241.AlternatingSpace
    80

    Discussion

    Ask a question or add context. Endorsements and structured flags are kept in the review panel above.

    Loading discussion…