Documentation

DescriptiveComplexity.TransitiveClosureDecide

Deciders: walks with two exits, closed under the first-order connectives #

Immerman's normal form for FO(TC) – a TC of a formula containing TCs is a single TC – is proved here not as a normal form on formulas but as an algebra of walks. A DescriptiveComplexity.Decider is a walk (modes and a tuple of coordinates, as DescriptiveComplexity.TCSpec) with two exits, yes and no, and a parameter type β its formulas may mention. It decides a proposition at a valuation of its parameters when, from its start mode and any tuple of coordinates, the yes exit is reachable exactly if the proposition holds and the no exit exactly if it fails (DescriptiveComplexity.Decider.Decides).

Starting from any tuple, rather than from a canonical one, is what makes the constructions below compose without resets: a decider run after another one simply starts where the previous one exited.

The algebra #

Disjunction, implication and the existential quantifier are De Morgan combinations (DescriptiveComplexity.Decider.exTup is an existential over a whole tuple). What is not here is the atom case for a walk's own reachability relation, which is where nondeterminism (or a step budget) comes in: DescriptiveComplexity.TransitiveClosureDecideReach and DescriptiveComplexity.TransitiveClosureDecideReachDet.

Determinism travels #

Every construction preserves functionality – at most one move, step or exit, out of every node (DescriptiveComplexity.Decider.Functional). This is what makes the same algebra serve the deterministic logic: a functional decider, turned into a specification (DescriptiveComplexity.Decider.toSpec), is unchanged by determinization.

Copying coordinates #

noncomputable def DescriptiveComplexity.copyF {L : FirstOrder.Language} {γ ι : Type} [Finite ι] (sel sel' : ιγ) :
L.Formula γ

The formula “the variables sel' hold the same values as the variables sel”, coordinate by coordinate.

Equations
Instances For
    Dependency graph
    @[simp]
    theorem DescriptiveComplexity.realize_copyF {L : FirstOrder.Language} {γ ι : Type} [Finite ι] {A : Type} [L.Structure A] {v : γA} (sel sel' : ιγ) :
    (copyF sel sel').Realize v v sel' = v sel
    Dependency graph

    Paths: an invariant and a lifting #

    theorem DescriptiveComplexity.reach_invariant {N : Type} {R : NNProp} {P : NProp} (hP : ∀ (a b : N), P aR a bP b) {a b : N} (h : Relation.ReflTransGen R a b) (ha : P a) :
    P b

    An invariant preserved by every step holds along a path.

    Dependency graph

    Deciders #

    A decider: a walk on tuples of Coord coordinates carrying a finite mode, with formulas that may mention parameters of type β, and two exitsyes (true) and no (false) – each a formula on the current tuple and the parameters. Its formulas are over the ordered expansion of the vocabulary, the iteration of DescriptiveComplexity.Decider.all needing the order.

    Instances For
      Dependency graph
      @[reducible, inline]

      A node of the walk: a mode together with a tuple.

      Equations
      Instances For
        Dependency graph
        def DescriptiveComplexity.Decider.StepAt {L : FirstOrder.Language} {β : Type} (D : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (a b : D.Node A) :

        One step of the walk, at a valuation of the parameters.

        Equations
        Instances For
          Dependency graph
          @[reducible, inline]
          abbrev DescriptiveComplexity.Decider.ReachAt {L : FirstOrder.Language} {β : Type} (D : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) :
          D.Node AD.Node AProp

          Reachability in the walk, at a valuation of the parameters.

          Equations
          Instances For
            Dependency graph
            def DescriptiveComplexity.Decider.ExitAt {L : FirstOrder.Language} {β : Type} (D : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (a : D.Node A) (o : Bool) :

            The walk exits at a node with an answer.

            Equations
            Instances For
              Dependency graph
              def DescriptiveComplexity.Decider.Out {L : FirstOrder.Language} {β : Type} (D : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (t : D.CoordA) (o : Bool) :

              The answer o is reachable from the start mode at the tuple t.

              Equations
              Instances For
                Dependency graph
                def DescriptiveComplexity.Decider.Decides {L : FirstOrder.Language} {β : Type} (D : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (P : Prop) :

                The decider decides P at a valuation of its parameters: from the start mode and any tuple, yes is reachable exactly when P holds, and no exactly when it fails.

                Equations
                Instances For
                  Dependency graph
                  def DescriptiveComplexity.Decider.Move {L : FirstOrder.Language} {β : Type} (D : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (a : D.Node A) :
                  D.Node A BoolProp

                  A move out of a node: a step to another node, or an exit.

                  Equations
                  Instances For
                    Dependency graph

                    A decider is functional when no node has two moves: the walk is deterministic, exits included.

                    Equations
                    Instances For
                      Dependency graph
                      theorem DescriptiveComplexity.Decider.Decides.congr {L : FirstOrder.Language} {β : Type} {D : Decider L β} {A : Type} [L.Structure A] [LinearOrder A] {v : βA} {P Q : Prop} (h : D.Decides v P) (hPQ : P Q) :
                      D.Decides v Q
                      Dependency graph
                      theorem DescriptiveComplexity.Decider.Decides.congr_val {L : FirstOrder.Language} {β : Type} {D : Decider L β} {A : Type} [L.Structure A] [LinearOrder A] {v w : βA} {P : Prop} (h : D.Decides v P) (hvw : v = w) :
                      D.Decides w P
                      Dependency graph
                      theorem DescriptiveComplexity.Decider.Functional.step_unique {L : FirstOrder.Language} {β : Type} {D : Decider L β} {A : Type} [L.Structure A] [LinearOrder A] (h : D.Functional A) {v : βA} {a b c : D.Node A} (hb : D.StepAt v a b) (hc : D.StepAt v a c) :
                      b = c
                      Dependency graph
                      theorem DescriptiveComplexity.Decider.Functional.not_exit_of_step {L : FirstOrder.Language} {β : Type} {D : Decider L β} {A : Type} [L.Structure A] [LinearOrder A] (h : D.Functional A) {v : βA} {a b : D.Node A} (hb : D.StepAt v a b) {o : Bool} (ho : D.ExitAt v a o) :
                      Dependency graph
                      theorem DescriptiveComplexity.Decider.Functional.exit_unique {L : FirstOrder.Language} {β : Type} {D : Decider L β} {A : Type} [L.Structure A] [LinearOrder A] (h : D.Functional A) {v : βA} {a : D.Node A} {o o' : Bool} (ho : D.ExitAt v a o) (ho' : D.ExitAt v a o') :
                      o = o'
                      Dependency graph
                      theorem DescriptiveComplexity.Decider.functional_of {L : FirstOrder.Language} {β : Type} {D : Decider L β} {A : Type} [L.Structure A] [LinearOrder A] (hstep : ∀ (v : βA) (a b c : D.Node A), D.StepAt v a bD.StepAt v a cb = c) (hexit : ∀ (v : βA) (a b : D.Node A) (o : Bool), D.StepAt v a b¬D.ExitAt v a o) (hboth : ∀ (v : βA) (a : D.Node A), D.ExitAt v a true¬D.ExitAt v a false) :

                      Functionality, from its three components.

                      Dependency graph

                      Renaming the parameters #

                      @[reducible]
                      noncomputable def DescriptiveComplexity.Decider.relabelPar {L : FirstOrder.Language} {β γ : Type} (D : Decider L β) (f : βγ) :
                      Decider L γ

                      The decider with its parameters renamed along f: a parameter of the new decider is read where f sends it.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        Dependency graph
                        theorem DescriptiveComplexity.Decider.stepAt_relabelPar {L : FirstOrder.Language} {β γ : Type} (D : Decider L β) (f : βγ) {A : Type} [L.Structure A] [LinearOrder A] (v : γA) (a b : D.Node A) :
                        (D.relabelPar f).StepAt v a b D.StepAt (v f) a b
                        Dependency graph
                        theorem DescriptiveComplexity.Decider.exitAt_relabelPar {L : FirstOrder.Language} {β γ : Type} (D : Decider L β) (f : βγ) {A : Type} [L.Structure A] [LinearOrder A] (v : γA) (a : D.Node A) (o : Bool) :
                        (D.relabelPar f).ExitAt v a o D.ExitAt (v f) a o
                        Dependency graph
                        theorem DescriptiveComplexity.Decider.reachAt_relabelPar {L : FirstOrder.Language} {β γ : Type} (D : Decider L β) (f : βγ) {A : Type} [L.Structure A] [LinearOrder A] (v : γA) (a b : D.Node A) :
                        (D.relabelPar f).ReachAt v a b D.ReachAt (v f) a b
                        Dependency graph
                        theorem DescriptiveComplexity.Decider.out_relabelPar {L : FirstOrder.Language} {β γ : Type} (D : Decider L β) (f : βγ) {A : Type} [L.Structure A] [LinearOrder A] (v : γA) (t : D.CoordA) (o : Bool) :
                        (D.relabelPar f).Out v t o D.Out (v f) t o
                        Dependency graph
                        theorem DescriptiveComplexity.Decider.decides_relabelPar {L : FirstOrder.Language} {β γ : Type} (D : Decider L β) (f : βγ) {A : Type} [L.Structure A] [LinearOrder A] (v : γA) {P : Prop} (h : D.Decides (v f) P) :
                        Dependency graph
                        theorem DescriptiveComplexity.Decider.functional_relabelPar {L : FirstOrder.Language} {β γ : Type} (D : Decider L β) (f : βγ) {A : Type} [L.Structure A] [LinearOrder A] (h : D.Functional A) :
                        Dependency graph

                        Atoms #

                        @[reducible]

                        The decider of a first-order formula over the base: no step, and it exits at once with the truth value of the formula.

                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          Dependency graph
                          theorem DescriptiveComplexity.Decider.exitAt_atom {L : FirstOrder.Language} {β : Type} (ψ : (L.sum FirstOrder.Language.order).Formula β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (a : (atom ψ).Node A) (o : Bool) :
                          (atom ψ).ExitAt v a o if o = true then ψ.Realize v else ¬ψ.Realize v
                          Dependency graph
                          theorem DescriptiveComplexity.Decider.not_stepAt_atom {L : FirstOrder.Language} {β : Type} (ψ : (L.sum FirstOrder.Language.order).Formula β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (a b : (atom ψ).Node A) :
                          ¬(atom ψ).StepAt v a b
                          Dependency graph
                          theorem DescriptiveComplexity.Decider.reachAt_atom {L : FirstOrder.Language} {β : Type} (ψ : (L.sum FirstOrder.Language.order).Formula β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) {a b : (atom ψ).Node A} (h : (atom ψ).ReachAt v a b) :
                          b = a
                          Dependency graph
                          Dependency graph
                          Dependency graph

                          Negation #

                          @[reducible]
                          noncomputable def DescriptiveComplexity.Decider.neg {L : FirstOrder.Language} {β : Type} (D : Decider L β) :
                          Decider L β

                          The decider with its two exits swapped.

                          Equations
                          Instances For
                            Dependency graph
                            theorem DescriptiveComplexity.Decider.stepAt_neg {L : FirstOrder.Language} {β : Type} (D : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (a b : D.Node A) :
                            D.neg.StepAt v a b D.StepAt v a b
                            Dependency graph
                            theorem DescriptiveComplexity.Decider.exitAt_neg {L : FirstOrder.Language} {β : Type} (D : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (a : D.Node A) (o : Bool) :
                            D.neg.ExitAt v a o D.ExitAt v a !o
                            Dependency graph
                            theorem DescriptiveComplexity.Decider.reachAt_neg {L : FirstOrder.Language} {β : Type} (D : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (a b : D.Node A) :
                            D.neg.ReachAt v a b D.ReachAt v a b
                            Dependency graph
                            theorem DescriptiveComplexity.Decider.out_neg {L : FirstOrder.Language} {β : Type} (D : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (t : D.CoordA) (o : Bool) :
                            D.neg.Out v t o D.Out v t !o
                            Dependency graph
                            theorem DescriptiveComplexity.Decider.decides_neg {L : FirstOrder.Language} {β : Type} (D : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) {P : Prop} (h : D.Decides v P) :
                            Dependency graph
                            Dependency graph

                            Sequential composition #

                            def DescriptiveComplexity.Decider.seqVarL {β C₁ C₂ : Type} :
                            (C₁ C₁) β → ((C₁ C₂) C₁ C₂) β

                            The variables of the first component's step, in the composite's.

                            Equations
                            Instances For
                              Dependency graph
                              def DescriptiveComplexity.Decider.seqVarR {β C₁ C₂ : Type} :
                              (C₂ C₂) β → ((C₁ C₂) C₁ C₂) β

                              The variables of the second component's step, in the composite's.

                              Equations
                              Instances For
                                Dependency graph
                                def DescriptiveComplexity.Decider.seqExitL {β C₁ C₂ : Type} :
                                C₁ β → (C₁ C₂) β

                                The variables of the first component's exit, in the composite's exit.

                                Equations
                                Instances For
                                  Dependency graph
                                  def DescriptiveComplexity.Decider.seqExitR {β C₁ C₂ : Type} :
                                  C₂ β → (C₁ C₂) β

                                  The variables of the second component's exit, in the composite's exit.

                                  Equations
                                  Instances For
                                    Dependency graph
                                    def DescriptiveComplexity.Decider.seqExitStep {β C₁ C₂ : Type} :
                                    C₁ β → ((C₁ C₂) C₁ C₂) β

                                    The variables of the first component's exit, in the composite's step (read on the current tuple).

                                    Equations
                                    Instances For
                                      Dependency graph
                                      @[reducible, inline]
                                      abbrev DescriptiveComplexity.Decider.curVar {β C : Type} (c : C) :
                                      (C C) β

                                      The current tuple's coordinate c, as a step variable.

                                      Equations
                                      Instances For
                                        Dependency graph
                                        @[reducible, inline]
                                        abbrev DescriptiveComplexity.Decider.nextVar {β C : Type} (c : C) :
                                        (C C) β

                                        The next tuple's coordinate c, as a step variable.

                                        Equations
                                        Instances For
                                          Dependency graph
                                          @[reducible]
                                          noncomputable def DescriptiveComplexity.Decider.seq {L : FirstOrder.Language} {β : Type} (D₁ D₂ : Decider L β) :
                                          Decider L β

                                          Sequential composition: the first decider runs, and where it exits yes the second one starts, from the tuple it left; the answer is the second's. The coordinates of the idle component are copied along.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            Dependency graph
                                            theorem DescriptiveComplexity.Decider.stepAt_seq_inl_inl {L : FirstOrder.Language} {β : Type} (D₁ D₂ : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (m m' : D₁.Mode) (t t' : D₁.Coord D₂.CoordA) :
                                            (D₁.seq D₂).StepAt v (Sum.inl m, t) (Sum.inl m', t') D₁.StepAt v (m, t Sum.inl) (m', t' Sum.inl) t' Sum.inr = t Sum.inr
                                            Dependency graph
                                            theorem DescriptiveComplexity.Decider.stepAt_seq_inl_inr {L : FirstOrder.Language} {β : Type} (D₁ D₂ : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (m : D₁.Mode) (m' : D₂.Mode) (t t' : D₁.Coord D₂.CoordA) :
                                            (D₁.seq D₂).StepAt v (Sum.inl m, t) (Sum.inr m', t') m' = D₂.start D₁.ExitAt v (m, t Sum.inl) true t' = t
                                            Dependency graph
                                            theorem DescriptiveComplexity.Decider.not_stepAt_seq_inr_inl {L : FirstOrder.Language} {β : Type} (D₁ D₂ : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (m : D₂.Mode) (m' : D₁.Mode) (t t' : D₁.Coord D₂.CoordA) :
                                            ¬(D₁.seq D₂).StepAt v (Sum.inr m, t) (Sum.inl m', t')
                                            Dependency graph
                                            theorem DescriptiveComplexity.Decider.stepAt_seq_inr_inr {L : FirstOrder.Language} {β : Type} (D₁ D₂ : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (m m' : D₂.Mode) (t t' : D₁.Coord D₂.CoordA) :
                                            (D₁.seq D₂).StepAt v (Sum.inr m, t) (Sum.inr m', t') D₂.StepAt v (m, t Sum.inr) (m', t' Sum.inr) t' Sum.inl = t Sum.inl
                                            Dependency graph
                                            theorem DescriptiveComplexity.Decider.exitAt_seq_inl {L : FirstOrder.Language} {β : Type} (D₁ D₂ : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (m : D₁.Mode) (t : D₁.Coord D₂.CoordA) (o : Bool) :
                                            (D₁.seq D₂).ExitAt v (Sum.inl m, t) o o = false D₁.ExitAt v (m, t Sum.inl) false
                                            Dependency graph
                                            theorem DescriptiveComplexity.Decider.exitAt_seq_inr {L : FirstOrder.Language} {β : Type} (D₁ D₂ : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (m : D₂.Mode) (t : D₁.Coord D₂.CoordA) (o : Bool) :
                                            (D₁.seq D₂).ExitAt v (Sum.inr m, t) o D₂.ExitAt v (m, t Sum.inr) o
                                            Dependency graph
                                            theorem DescriptiveComplexity.Decider.reachAt_seq_of_reachAt₁ {L : FirstOrder.Language} {β : Type} (D₁ D₂ : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) {a b : D₁.Node A} (h : D₁.ReachAt v a b) (y : D₂.CoordA) :
                                            (D₁.seq D₂).ReachAt v (Sum.inl a.1, Sum.elim a.2 y) (Sum.inl b.1, Sum.elim b.2 y)

                                            A path of the first component lifts to the composite, the second component's coordinates fixed.

                                            Dependency graph
                                            theorem DescriptiveComplexity.Decider.reachAt_seq_of_reachAt₂ {L : FirstOrder.Language} {β : Type} (D₁ D₂ : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) {a b : D₂.Node A} (h : D₂.ReachAt v a b) (x : D₁.CoordA) :
                                            (D₁.seq D₂).ReachAt v (Sum.inr a.1, Sum.elim x a.2) (Sum.inr b.1, Sum.elim x b.2)

                                            A path of the second component lifts to the composite, the first component's coordinates fixed.

                                            Dependency graph
                                            def DescriptiveComplexity.Decider.SeqInv {L : FirstOrder.Language} {β : Type} (D₁ D₂ : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (t : D₁.Coord D₂.CoordA) (c : (D₁.seq D₂).Node A) :

                                            What the composite may have reached from its start at t: a node of the first component reached by it, the second's coordinates untouched, or a node of the second component reached after the first exited yes.

                                            Equations
                                            • One or more equations did not get rendered due to their size.
                                            Instances For
                                              Dependency graph
                                              theorem DescriptiveComplexity.Decider.seqInv_of_reachAt {L : FirstOrder.Language} {β : Type} (D₁ D₂ : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (t : D₁.Coord D₂.CoordA) {c : (D₁.seq D₂).Node A} (h : (D₁.seq D₂).ReachAt v (Sum.inl D₁.start, t) c) :
                                              D₁.SeqInv D₂ v t c
                                              Dependency graph
                                              theorem DescriptiveComplexity.Decider.out_seq {L : FirstOrder.Language} {β : Type} (D₁ D₂ : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (t : D₁.Coord D₂.CoordA) (o : Bool) :
                                              (D₁.seq D₂).Out v t o o = false D₁.Out v (t Sum.inl) false D₁.Out v (t Sum.inl) true D₂.Out v (t Sum.inr) o
                                              Dependency graph
                                              theorem DescriptiveComplexity.Decider.decides_seq {L : FirstOrder.Language} {β : Type} (D₁ D₂ : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) {P Q : Prop} (h₁ : D₁.Decides v P) (h₂ : D₂.Decides v Q) :
                                              (D₁.seq D₂).Decides v (P Q)
                                              Dependency graph
                                              theorem DescriptiveComplexity.Decider.functional_seq {L : FirstOrder.Language} {β : Type} (D₁ D₂ : Decider L β) {A : Type} [L.Structure A] [LinearOrder A] (h₁ : D₁.Functional A) (h₂ : D₂.Functional A) :
                                              (D₁.seq D₂).Functional A
                                              Dependency graph

                                              Universal quantification: an iteration along the order #

                                              def DescriptiveComplexity.Decider.allVar {β C : Type} :
                                              (C C) β Unit → ((C Unit) C Unit) β

                                              The variables of the component's step in the iteration's: the quantified parameter is read off the current tuple's extra coordinate.

                                              Equations
                                              Instances For
                                                Dependency graph
                                                Dependency graph
                                                Dependency graph
                                                @[reducible, inline]

                                                The extra coordinate holding the quantified element, in a step.

                                                Equations
                                                Instances For
                                                  Dependency graph
                                                  @[reducible, inline]

                                                  The extra coordinate holding the quantified element, in a step.

                                                  Equations
                                                  Instances For
                                                    Dependency graph
                                                    @[reducible]
                                                    noncomputable def DescriptiveComplexity.Decider.all {L : FirstOrder.Language} {β : Type} (D : Decider L (β Unit)) :
                                                    Decider L β

                                                    Universal quantification: the component is run once per element of the universe, in the order of the structure, the element being held in one extra coordinate. The first step sets it to the minimum; where the component exits yes below the maximum, it is restarted at the successor; a yes at the maximum, or a no anywhere, is the answer.

                                                    Equations
                                                    • One or more equations did not get rendered due to their size.
                                                    Instances For
                                                      Dependency graph
                                                      @[reducible, inline]
                                                      abbrev DescriptiveComplexity.Decider.vy {β A : Type} (v : βA) (y : A) :
                                                      β UnitA

                                                      The valuation of the component's parameters: the iteration's, and the current element.

                                                      Equations
                                                      Instances For
                                                        Dependency graph
                                                        theorem DescriptiveComplexity.Decider.stepAt_all_none_some {L : FirstOrder.Language} {β : Type} (D : Decider L (β Unit)) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (n : D.Mode) (t t' : D.Coord UnitA) :
                                                        D.all.StepAt v (none, t) (some n, t') n = D.start t' Sum.inl = t Sum.inl ∀ (a : A), t' (Sum.inr ()) a
                                                        Dependency graph
                                                        theorem DescriptiveComplexity.Decider.not_stepAt_all_none_none {L : FirstOrder.Language} {β : Type} (D : Decider L (β Unit)) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (t t' : D.Coord UnitA) :
                                                        Dependency graph
                                                        theorem DescriptiveComplexity.Decider.not_stepAt_all_some_none {L : FirstOrder.Language} {β : Type} (D : Decider L (β Unit)) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (m : D.Mode) (t t' : D.Coord UnitA) :
                                                        Dependency graph
                                                        theorem DescriptiveComplexity.Decider.stepAt_all_some_some {L : FirstOrder.Language} {β : Type} (D : Decider L (β Unit)) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (m n : D.Mode) (t t' : D.Coord UnitA) :
                                                        D.all.StepAt v (some m, t) (some n, t') D.StepAt (vy v (t (Sum.inr ()))) (m, t Sum.inl) (n, t' Sum.inl) t' (Sum.inr ()) = t (Sum.inr ()) n = D.start D.ExitAt (vy v (t (Sum.inr ()))) (m, t Sum.inl) true (t (Sum.inr ()) < t' (Sum.inr ()) ∀ (a : A), ¬(t (Sum.inr ()) < a a < t' (Sum.inr ()))) t' Sum.inl = t Sum.inl
                                                        Dependency graph
                                                        theorem DescriptiveComplexity.Decider.not_exitAt_all_none {L : FirstOrder.Language} {β : Type} (D : Decider L (β Unit)) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (t : D.Coord UnitA) (o : Bool) :
                                                        Dependency graph
                                                        theorem DescriptiveComplexity.Decider.exitAt_all_some {L : FirstOrder.Language} {β : Type} (D : Decider L (β Unit)) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (m : D.Mode) (t : D.Coord UnitA) (o : Bool) :
                                                        D.all.ExitAt v (some m, t) o D.ExitAt (vy v (t (Sum.inr ()))) (m, t Sum.inl) o (o = true∀ (a : A), a t (Sum.inr ()))
                                                        Dependency graph
                                                        theorem DescriptiveComplexity.Decider.reachAt_all_of_reachAt {L : FirstOrder.Language} {β : Type} (D : Decider L (β Unit)) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) {y : A} {a b : D.Node A} (h : D.ReachAt (vy v y) a b) :
                                                        D.all.ReachAt v (some a.1, Sum.elim a.2 fun (x : Unit) => y) (some b.1, Sum.elim b.2 fun (x : Unit) => y)

                                                        A path of the component lifts to the iteration, the element fixed.

                                                        Dependency graph
                                                        theorem DescriptiveComplexity.Decider.all_reach_yes {L : FirstOrder.Language} {β : Type} (D : Decider L (β Unit)) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) [Finite A] {P : AProp} (h : ∀ (y : A), D.Decides (vy v y) (P y)) (y : A) (hy : ∀ (y' : A), y y'P y') (u : D.CoordA) :
                                                        ∃ (c : D.all.Node A), D.all.ReachAt v (some D.start, Sum.elim u fun (x : Unit) => y) c D.all.ExitAt v c true

                                                        Upwards from any element: if the component says yes at every element from y on, the iteration exits yes from the component's start at y.

                                                        Dependency graph
                                                        theorem DescriptiveComplexity.Decider.all_reach_no {L : FirstOrder.Language} {β : Type} (D : Decider L (β Unit)) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) [Finite A] {P : AProp} (h : ∀ (y : A), D.Decides (vy v y) (P y)) (hnot : ¬∀ (y : A), P y) (y : A) (hy : y' < y, P y') (u : D.CoordA) :
                                                        ∃ (c : D.all.Node A), D.all.ReachAt v (some D.start, Sum.elim u fun (x : Unit) => y) c D.all.ExitAt v c false

                                                        Upwards to a failure: if the component says yes below y but not everywhere, the iteration exits no from the component's start at y.

                                                        Dependency graph
                                                        def DescriptiveComplexity.Decider.AllInv {L : FirstOrder.Language} {β : Type} (D : Decider L (β Unit)) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) (P : AProp) (t : D.Coord UnitA) (c : D.all.Node A) :

                                                        What the iteration may have reached: its start, or a node of the component at some element, every smaller element having been answered yes.

                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For
                                                          Dependency graph
                                                          theorem DescriptiveComplexity.Decider.allInv_of_reachAt {L : FirstOrder.Language} {β : Type} (D : Decider L (β Unit)) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) {P : AProp} (h : ∀ (y : A), D.Decides (vy v y) (P y)) (t : D.Coord UnitA) {c : D.all.Node A} (hc : D.all.ReachAt v (none, t) c) :
                                                          D.AllInv v P t c
                                                          Dependency graph
                                                          theorem DescriptiveComplexity.Decider.out_all {L : FirstOrder.Language} {β : Type} (D : Decider L (β Unit)) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) [Finite A] [Nonempty A] {P : AProp} (h : ∀ (y : A), D.Decides (vy v y) (P y)) (t : D.Coord UnitA) :
                                                          (D.all.Out v t true ∀ (y : A), P y) (D.all.Out v t false ¬∀ (y : A), P y)
                                                          Dependency graph
                                                          theorem DescriptiveComplexity.Decider.decides_all {L : FirstOrder.Language} {β : Type} (D : Decider L (β Unit)) {A : Type} [L.Structure A] [LinearOrder A] (v : βA) [Finite A] [Nonempty A] {P : AProp} (h : ∀ (y : A), D.Decides (vy v y) (P y)) :
                                                          D.all.Decides v (∀ (y : A), P y)

                                                          The iteration decides the universal quantification.

                                                          Dependency graph
                                                          Dependency graph

                                                          Quantifying over a tuple, and the derived connectives #

                                                          def DescriptiveComplexity.Decider.snocVar (β : Type) (K : ) :
                                                          β Fin (K + 1) → (β Fin K) Unit

                                                          The parameters of a decider over a tuple of K + 1 variables, read as the parameters over K variables together with one more.

                                                          Equations
                                                          Instances For
                                                            Dependency graph
                                                            @[reducible]
                                                            noncomputable def DescriptiveComplexity.Decider.allTup {L : FirstOrder.Language} {β : Type} (K : ) :
                                                            Decider L (β Fin K)Decider L β

                                                            Universal quantification over a tuple: one iteration per coordinate.

                                                            Equations
                                                            Instances For
                                                              Dependency graph
                                                              @[reducible]
                                                              noncomputable def DescriptiveComplexity.Decider.exTup {L : FirstOrder.Language} {β : Type} (K : ) (D : Decider L (β Fin K)) :
                                                              Decider L β

                                                              Existential quantification over a tuple, by De Morgan.

                                                              Equations
                                                              Instances For
                                                                Dependency graph
                                                                @[reducible]
                                                                noncomputable def DescriptiveComplexity.Decider.imp {L : FirstOrder.Language} {β : Type} (D₁ D₂ : Decider L β) :
                                                                Decider L β

                                                                Implication, by De Morgan: not (the first and not the second).

                                                                Equations
                                                                Instances For
                                                                  Dependency graph
                                                                  theorem DescriptiveComplexity.Decider.decides_allTup {L : FirstOrder.Language} {A : Type} [L.Structure A] [LinearOrder A] [Finite A] [Nonempty A] {β : Type} (K : ) (D : Decider L (β Fin K)) (v : βA) {P : (Fin KA)Prop} (h : ∀ (xs : Fin KA), D.Decides (Sum.elim v xs) (P xs)) :
                                                                  (allTup K D).Decides v (∀ (xs : Fin KA), P xs)
                                                                  Dependency graph
                                                                  Dependency graph
                                                                  theorem DescriptiveComplexity.Decider.decides_exTup {L : FirstOrder.Language} {A : Type} [L.Structure A] [LinearOrder A] [Finite A] [Nonempty A] {β : Type} (K : ) (D : Decider L (β Fin K)) (v : βA) {P : (Fin KA)Prop} (h : ∀ (xs : Fin KA), D.Decides (Sum.elim v xs) (P xs)) :
                                                                  (exTup K D).Decides v (∃ (xs : Fin KA), P xs)
                                                                  Dependency graph
                                                                  Dependency graph
                                                                  theorem DescriptiveComplexity.Decider.decides_imp {L : FirstOrder.Language} {A : Type} [L.Structure A] [LinearOrder A] {β : Type} (D₁ D₂ : Decider L β) (v : βA) {P Q : Prop} (h₁ : D₁.Decides v P) (h₂ : D₂.Decides v Q) :
                                                                  (D₁.imp D₂).Decides v (PQ)
                                                                  Dependency graph
                                                                  theorem DescriptiveComplexity.Decider.functional_imp {L : FirstOrder.Language} {A : Type} [L.Structure A] [LinearOrder A] {β : Type} (D₁ D₂ : Decider L β) (h₁ : D₁.Functional A) (h₂ : D₂.Functional A) :
                                                                  (D₁.imp D₂).Functional A
                                                                  Dependency graph

                                                                  A decider with no parameters is a specification #

                                                                  The coordinates of a decider, enumerated.

                                                                  Equations
                                                                  Instances For
                                                                    Dependency graph

                                                                    The variables of the decider's step, as the specification's.

                                                                    Equations
                                                                    Instances For
                                                                      Dependency graph

                                                                      The variables of the decider's exit, as the specification's step.

                                                                      Equations
                                                                      Instances For
                                                                        Dependency graph
                                                                        @[reducible]

                                                                        A decider as a specification: the two exits become two terminal modes, the yes one accepting; the start mode is the source, at any tuple.

                                                                        Equations
                                                                        • One or more equations did not get rendered due to their size.
                                                                        Instances For
                                                                          Dependency graph
                                                                          @[reducible, inline]

                                                                          The valuation of the (absent) parameters.

                                                                          Equations
                                                                          Instances For
                                                                            Dependency graph
                                                                            Dependency graph
                                                                            Dependency graph
                                                                            Dependency graph
                                                                            Dependency graph
                                                                            Dependency graph
                                                                            Dependency graph
                                                                            theorem DescriptiveComplexity.Decider.toSpec_invariant {L : FirstOrder.Language} (D : Decider L Empty) {A : Type} [L.Structure A] [LinearOrder A] (x : Fin (Nat.card D.Coord)A) {c : D.toSpec.Node A} (h : D.toSpec.Reach (Sum.inl D.start, x) c) :
                                                                            (∃ (m : D.Mode) (x' : Fin (Nat.card D.Coord)A), c = (Sum.inl m, x') D.ReachAt (noPar A) (D.start, x D.coordEquiv) (m, x' D.coordEquiv)) ∃ (o : Bool) (x' : Fin (Nat.card D.Coord)A), c = (Sum.inr o, x') D.Out (noPar A) (x D.coordEquiv) o

                                                                            What the specification reaches from its source: a node of the decider it reaches, or an exit it reaches.

                                                                            Dependency graph

                                                                            A path of the decider is a path of the specification.

                                                                            Dependency graph

                                                                            The specification accepts exactly when the decider says yes from some tuple.

                                                                            Dependency graph

                                                                            A functional decider gives a functional specification.

                                                                            Dependency graph

                                                                            A functional decider's specification is unchanged by determinization: its deterministic reading accepts exactly when the decider says yes.

                                                                            Dependency graph