Documentation

DescriptiveComplexity.Exponential.GameSpec

The graph game, as a second-order alternating game #

The four sentences of DescriptiveComplexity.ExpExpansion.graphGame, and what each of them says. Every one is a static disjunction over the phase type, which is finite: the phases carry the tags of the two nodes a state holds, so naming a tag costs a disjunct rather than a quantifier.

The one asymmetry worth naming: the move that fills a play round guards nothing. DescriptiveComplexity.altBlockQuant ranges over all assignments and the point guards of a prefix live inside its kernel (DescriptiveComplexity.ExpExpansion.stepF), so guarding there would count them twice and break the correspondence with DescriptiveComplexity.ExpExpansion.exists_paramKernel.

The rounds a move carries over #

Carry over every round: the move freezes the state.

Equations
Instances For
    Dependency graph
    def DescriptiveComplexity.keepOff (n : ) (S : Fin nBool) :
    List (Fin n × Fin n)

    Carry over every round outside S, in place.

    Equations
    Instances For
      Dependency graph

      The rounds holding the second node's points.

      Equations
      Instances For
        Dependency graph

        The rounds holding the second node's points, as a list.

        Equations
        Instances For
          Dependency graph
          def DescriptiveComplexity.shiftIx (d n : ) (h : 2 * d n) (i : Fin n) :
          Fin n

          Where round i of the state a shifting move enters reads from: the second node's points become the first node's.

          Equations
          Instances For
            Dependency graph
            def DescriptiveComplexity.keepShift (d n : ) (h : 2 * d n) :
            List (Fin n × Fin n)

            Carry the second node's points onto the first node's slots.

            Equations
            Instances For
              Dependency graph
              theorem DescriptiveComplexity.forall_keepAll {n : } {α : Type} (ρs σs : Fin nα) :
              (∀ ekeepAll n, ρs e.1 = σs e.2) ρs = σs
              Dependency graph
              theorem DescriptiveComplexity.forall_keepOff {n : } {α : Type} (S : Fin nBool) (ρs σs : Fin nα) :
              (∀ ekeepOff n S, ρs e.1 = σs e.2) ∀ (i : Fin n), S i = falseρs i = σs i
              Dependency graph
              theorem DescriptiveComplexity.forall_keepShift {d n : } {α : Type} (h : 2 * d n) (ρs σs : Fin nα) :
              (∀ ekeepShift d n h, ρs e.1 = σs e.2) ∀ (i : Fin n), ρs (shiftIx d n h i) = σs i
              Dependency graph
              theorem DescriptiveComplexity.mem_midRounds {d n : } (i : Fin n) :
              i midRounds d n d i i < 2 * d
              Dependency graph
              theorem DescriptiveComplexity.isMid_eq_false {d n : } (i : Fin n) :
              isMid d n i = false ¬(d i i < 2 * d)
              Dependency graph

              The moves out of a phase #

              structure DescriptiveComplexity.MoveTo (T : Type) (Dm n : ) :

              A move of the graph game, seen from the phase it leaves: where it goes, which rounds it carries over – as pairs (round of the state left, round of the state entered) – and which rounds of the state entered it guards to hold a point.

              • tgt : Ph T Dm

                The phase the move enters.

              • keep : List (Fin n × Fin n)

                The rounds it carries over.

              • guard : List (Fin n)

                The rounds of the state it enters that it guards to hold a point.

              Instances For
                Dependency graph
                def DescriptiveComplexity.ExpExpansion.preEntry {T : Type} {n Dm : } (D : SubTT) (hD : ∀ (s : Sub) (tx ty : T), D s tx ty Dm) (s : Sub) (tx ty : T) :
                MoveTo T Dm n

                Entering the prefix that decides the question s about the nodes tagged tx, ty: nothing moves, and all D s tx ty play rounds are still to fill.

                Equations
                Instances For
                  Dependency graph
                  noncomputable def DescriptiveComplexity.ExpExpansion.movesFrom {T : Type} [Finite T] {d n Dm : } (hn : n = 2 * d + Dm) (D : SubTT) (hD : ∀ (s : Sub) (tx ty : T), D s tx ty Dm) :
                  Ph T DmList (MoveTo T Dm n)

                  The moves out of each phase. This is the game.

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    Dependency graph

                    The four sentences #

                    noncomputable def DescriptiveComplexity.ExpExpansion.moveOf {L : FirstOrder.Language} (X : ExpExpansion L) {T : Type} [Finite T] {n Dm : } (p : Ph T Dm) (m : MoveTo T Dm n) :

                    The sentence of one move: it names the phase it leaves and the phase it enters, carries its rounds over, and guards the rounds it says are points.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      Dependency graph
                      noncomputable def DescriptiveComplexity.ExpExpansion.graphGame {L : FirstOrder.Language} (X : ExpExpansion L) {T : Type} [Finite T] {d n Dm : } (hn : n = 2 * d + Dm) (D : SubTT) (hD : ∀ (s : Sub) (tx ty : T), D s tx ty Dm) (K : SubTT((L.sum FirstOrder.Language.order).sum (repMerged X.pointBlock n).lang).Sentence) :

                      The graph game: the game whose positions are the nodes of the AND/OR graph an interpretation draws on the expanded universe, together with the prefix positions that decide the six questions about them.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        Dependency graph

                        What the four sentences say #

                        theorem DescriptiveComplexity.ExpExpansion.realize_moveOf {L : FirstOrder.Language} {X : ExpExpansion L} {T : Type} [Finite T] {n Dm : } {A : Type} [instL : L.Structure A] [LinearOrder A] (p' p q : Ph T Dm) (m : MoveTo T Dm n) (ρs σs : Fin nX.pointBlock.Assignment A) :
                        A X.moveOf p' m p' = p m.tgt = q (∀ em.keep, ρs e.1 = σs e.2) im.guard, IsPointAssign (σs i)
                        Dependency graph
                        @[instance_reducible]
                        noncomputable def DescriptiveComplexity.ExpExpansion.stateStructure {L : FirstOrder.Language} {X : ExpExpansion L} {T : Type} [Finite T] {n Dm : } {A : Type} [instL : L.Structure A] [LinearOrder A] (σ : (X.gameBlock n T Dm).Assignment A) :

                        The one-copy structure a state of the graph game is read against.

                        Equations
                        Instances For
                          Dependency graph
                          theorem DescriptiveComplexity.ExpExpansion.graphGame_isUniv {L : FirstOrder.Language} {X : ExpExpansion L} {T : Type} [Finite T] {d n Dm : } {A : Type} [instL : L.Structure A] [LinearOrder A] {hn : n = 2 * d + Dm} {D : SubTT} {hD : ∀ (s : Sub) (tx ty : T), D s tx ty Dm} {K : SubTT((L.sum FirstOrder.Language.order).sum (repMerged X.pointBlock n).lang).Sentence} (p : Ph T Dm) (ρs : Fin nX.pointBlock.Assignment A) :
                          (X.graphGame hn D hD K).IsUniv (stateAssign p ρs) p.IsUniv

                          The universal positions are the phases Ph.IsUniv names.

                          Dependency graph
                          theorem DescriptiveComplexity.ExpExpansion.graphGame_isWon {L : FirstOrder.Language} {X : ExpExpansion L} {T : Type} [Finite T] {d n Dm : } {A : Type} [instL : L.Structure A] [LinearOrder A] {hn : n = 2 * d + Dm} {D : SubTT} {hD : ∀ (s : Sub) (tx ty : T), D s tx ty Dm} {K : SubTT((L.sum FirstOrder.Language.order).sum (repMerged X.pointBlock n).lang).Sentence} (p : Ph T Dm) (ρs : Fin nX.pointBlock.Assignment A) :
                          (X.graphGame hn D hD K).IsWon (stateAssign p ρs) ∃ (s : Sub) (tx : T) (ty : T) (pol : Bool), p = Ph.pre s tx ty 0, pol A K s tx ty

                          The positions that win outright are the leaves whose kernel holds.

                          Dependency graph
                          theorem DescriptiveComplexity.ExpExpansion.graphGame_isStart {L : FirstOrder.Language} {X : ExpExpansion L} {T : Type} [Finite T] {d n Dm : } {A : Type} [instL : L.Structure A] [LinearOrder A] {hn : n = 2 * d + Dm} {D : SubTT} {hD : ∀ (s : Sub) (tx ty : T), D s tx ty Dm} {K : SubTT((L.sum FirstOrder.Language.order).sum (repMerged X.pointBlock n).lang).Sentence} (τ : (X.gameBlock n T Dm).Assignment A) :
                          (X.graphGame hn D hD K).IsStart τ ∃ (tx : T) (pts : Fin nX.Map A), τ = stateAssign (Ph.startPick tx) fun (i : Fin n) => pointAssign (pts i)

                          The starting positions are the startPick states whose rounds are all points.

                          Dependency graph
                          theorem DescriptiveComplexity.ExpExpansion.graphGame_move {L : FirstOrder.Language} {X : ExpExpansion L} {T : Type} [Finite T] {d n Dm : } {A : Type} [instL : L.Structure A] [LinearOrder A] {hn : n = 2 * d + Dm} {D : SubTT} {hD : ∀ (s : Sub) (tx ty : T), D s tx ty Dm} {K : SubTT((L.sum FirstOrder.Language.order).sum (repMerged X.pointBlock n).lang).Sentence} (p q : Ph T Dm) (ρs σs : Fin nX.pointBlock.Assignment A) :
                          (X.graphGame hn D hD K).Move (stateAssign p ρs) (stateAssign q σs) mmovesFrom hn D hD p, m.tgt = q (∀ em.keep, ρs e.1 = σs e.2) im.guard, IsPointAssign (σs i)

                          The moves are the listed ones.

                          Dependency graph
                          theorem DescriptiveComplexity.ExpExpansion.graphGame_move_shape {L : FirstOrder.Language} {X : ExpExpansion L} {T : Type} [Finite T] {d n Dm : } {A : Type} [instL : L.Structure A] [LinearOrder A] {hn : n = 2 * d + Dm} {D : SubTT} {hD : ∀ (s : Sub) (tx ty : T), D s tx ty Dm} {K : SubTT((L.sum FirstOrder.Language.order).sum (repMerged X.pointBlock n).lang).Sentence} {p : Ph T Dm} {ρs : Fin nX.pointBlock.Assignment A} {τ : (X.gameBlock n T Dm).Assignment A} (h : (X.graphGame hn D hD K).Move (stateAssign p ρs) τ) :
                          ∃ (q : Ph T Dm) (σs : Fin nX.pointBlock.Assignment A), τ = stateAssign q σs

                          Every move lands on a state: each disjunct pins the tag bits of the state it enters, so a junk assignment is never reachable.

                          Dependency graph