Documentation

DescriptiveComplexity.TransitiveClosureDecideReach

Deciding reachability in a walk: Immerman–Szelepcsényi with parameters #

The atom case of the normal form for FO(TC): the reachability relation of a parameterized walk (DescriptiveComplexity.ParamTCSpec) has a DescriptiveComplexity.Decider (DescriptiveComplexity.ParamTCSpec.reachDecider). Its yes exit is the walk itself, run from the first endpoint until it stands on the second; its no exit is the inductive-counting walk of DescriptiveComplexity.TransitiveClosureCompl, which certifies that the second endpoint is not reached.

Parameters as constants #

The complement construction is stated for a sentence: a DescriptiveComplexity.TCSpec, whose source and target formulas have no free variables beyond the tuple. What is needed here is the complement of a relation – the parameters of the walk and its two endpoints are free. The two are reconciled without touching the 950 lines of the counting machine: the free variables become constants of the vocabulary (FirstOrder.Language.withConstants), the walk becomes a sentence over the enlarged vocabulary (DescriptiveComplexity.ParamTCSpec.constSpec), the complement is taken there, and its formulas are read back with the constants as variables (DescriptiveComplexity.fromConst). Mathlib's FirstOrder.Language.BoundedFormula.constantsVarsEquiv is the bridge, in both directions, and a structure interprets the constants by the valuation of the parameters (DescriptiveComplexity.constStructure).

Formulas with parameters, as sentences with constants #

@[reducible, inline]

The vocabulary with one constant per parameter.

Equations
Instances For
    Dependency graph

    The vocabulary map reading the second copy of the order, in the ordered expansion of the vocabulary with constants, as the first.

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

      A formula with parameters, as a formula over the vocabulary with constants, over its ordered expansion.

      Equations
      Instances For
        Dependency graph

        A formula over the ordered expansion of the vocabulary with constants, as a formula with parameters.

        Equations
        Instances For
          Dependency graph
          @[instance_reducible]
          noncomputable def DescriptiveComplexity.constStructure {L₀ : FirstOrder.Language} {γ A : Type} [L₀.Structure A] [LinearOrder A] (c : γA) :

          The structure over the vocabulary with constants, the constants read by a valuation of the parameters.

          Equations
          Instances For
            Dependency graph
            theorem DescriptiveComplexity.realize_toConst {L₀ : FirstOrder.Language} {γ A : Type} [L₀.Structure A] [LinearOrder A] {β : Type} (c : γA) (φ : (L₀.sum FirstOrder.Language.order).Formula (γ β)) (u : βA) :
            Dependency graph
            theorem DescriptiveComplexity.realize_fromConst {L₀ : FirstOrder.Language} {γ A : Type} [L₀.Structure A] [LinearOrder A] {β : Type} (c : γA) (φ : ((withPar (L₀.sum FirstOrder.Language.order) γ).sum FirstOrder.Language.order).Formula β) (u : βA) :
            Dependency graph

            A parameterized walk, as a sentence over the vocabulary with constants #

            @[reducible, inline]

            The parameters of the reachability atom of a walk: the two endpoints and the walk's own parameters, packed as DescriptiveComplexity.ParamTCSpec.pack does.

            Equations
            Instances For
              Dependency graph

              The variables of the step formula, the walk's parameters read off the atom's parameters.

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

                The walk as a sentence over the vocabulary with one constant per parameter of the atom: the same walk, whose sources are the first endpoint in the first mode and whose targets are the second endpoint in the second mode. Reducible: a node of it is a node of the walk.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  Dependency graph
                  theorem DescriptiveComplexity.ParamTCSpec.constSpec_step {L : FirstOrder.Language} (W : ParamTCSpec (L.sum FirstOrder.Language.order)) {A : Type} [L.Structure A] [LinearOrder A] (ma mb : W.Mode) (w : W.AtomParA) (a b : W.Node A) :
                  (W.constSpec ma mb).Step a b W.StepAt (w W.parIx) a b
                  Dependency graph
                  theorem DescriptiveComplexity.ParamTCSpec.constSpec_isSrc {L : FirstOrder.Language} (W : ParamTCSpec (L.sum FirstOrder.Language.order)) {A : Type} [L.Structure A] [LinearOrder A] (ma mb : W.Mode) (w : W.AtomParA) (a : W.Node A) :
                  (W.constSpec ma mb).IsSrc a a.1 = ma a.2 = w W.leftIx
                  Dependency graph
                  Dependency graph
                  Dependency graph

                  The sentence says reachability between the two endpoints.

                  Dependency graph

                  The complement, with parameters #

                  The complement of the walk between two endpoints, with parameters: the inductive-counting walk of DescriptiveComplexity.TCCompl.complSpec run on the sentence with constants.

                  Equations
                  Instances For
                    Dependency graph

                    The complement accepts exactly when the second endpoint is not reached.

                    Dependency graph

                    The decider #

                    The variables of the walk's step, in the decider's.

                    Equations
                    Instances For
                      Dependency graph

                      The variables of the complement's step, in the decider's.

                      Equations
                      Instances For
                        Dependency graph

                        The variables of the complement's source formula, read on the next tuple of the decider's step.

                        Equations
                        Instances For
                          Dependency graph

                          The variables of the complement's target formula, in the decider's exit.

                          Equations
                          Instances For
                            Dependency graph
                            @[reducible]

                            The decider of reachability between two modes, at the two endpoints and the parameters: from its start it either enters the walk at the first endpoint and exits yes on standing at the second, or enters the complement walk at one of its sources and exits no at one of its targets. The coordinates of the idle branch are copied along.

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

                              Steps and exits #

                              Dependency graph
                              Dependency graph
                              Dependency graph
                              theorem DescriptiveComplexity.ParamTCSpec.reachDecider_stepAt_inr_inr {L : FirstOrder.Language} (W : ParamTCSpec (L.sum FirstOrder.Language.order)) {A : Type} [L.Structure A] [LinearOrder A] {ma mb : W.Mode} (w : W.AtomParA) (c c' : (W.coSpec ma mb).Mode) (t t' : Fin W.k Fin (W.coSpec ma mb).kA) :
                              Dependency graph
                              Dependency graph
                              Dependency graph
                              theorem DescriptiveComplexity.ParamTCSpec.reachDecider_not_stepAt_inl_inr {L : FirstOrder.Language} (W : ParamTCSpec (L.sum FirstOrder.Language.order)) {A : Type} [L.Structure A] [LinearOrder A] {ma mb : W.Mode} (w : W.AtomParA) (m : W.Mode) (c : (W.coSpec ma mb).Mode) (t t' : Fin W.k Fin (W.coSpec ma mb).kA) :
                              Dependency graph
                              theorem DescriptiveComplexity.ParamTCSpec.reachDecider_not_stepAt_inr_inl {L : FirstOrder.Language} (W : ParamTCSpec (L.sum FirstOrder.Language.order)) {A : Type} [L.Structure A] [LinearOrder A] {ma mb : W.Mode} (w : W.AtomParA) (c : (W.coSpec ma mb).Mode) (m : W.Mode) (t t' : Fin W.k Fin (W.coSpec ma mb).kA) :
                              Dependency graph
                              Dependency graph
                              Dependency graph
                              Dependency graph
                              Dependency graph
                              Dependency graph

                              Lifting the two walks #

                              theorem DescriptiveComplexity.ParamTCSpec.reachDecider_reachAt_of_reachAt {L : FirstOrder.Language} (W : ParamTCSpec (L.sum FirstOrder.Language.order)) {A : Type} [L.Structure A] [LinearOrder A] {ma mb : W.Mode} (w : W.AtomParA) {a b : W.Node A} (h : W.ReachAt (w W.parIx) a b) (r : Fin (W.coSpec ma mb).kA) :
                              (W.reachDecider ma mb).ReachAt w (some (Sum.inl a.1), Sum.elim a.2 r) (some (Sum.inl b.1), Sum.elim b.2 r)

                              A path of the walk lifts to the yes branch.

                              Dependency graph
                              theorem DescriptiveComplexity.ParamTCSpec.reachDecider_reachAt_of_coReach {L : FirstOrder.Language} (W : ParamTCSpec (L.sum FirstOrder.Language.order)) {A : Type} [L.Structure A] [LinearOrder A] {ma mb : W.Mode} (w : W.AtomParA) {a b : (W.coSpec ma mb).Node A} (h : (W.coSpec ma mb).Reach a b) (l : Fin W.kA) :
                              (W.reachDecider ma mb).ReachAt w (some (Sum.inr a.1), Sum.elim l a.2) (some (Sum.inr b.1), Sum.elim l b.2)

                              A path of the complement lifts to the no branch.

                              Dependency graph
                              def DescriptiveComplexity.ParamTCSpec.ReachInv {L : FirstOrder.Language} (W : ParamTCSpec (L.sum FirstOrder.Language.order)) {A : Type} [L.Structure A] [LinearOrder A] {ma mb : W.Mode} (w : W.AtomParA) (t : Fin W.k Fin (W.coSpec ma mb).kA) (c : (W.reachDecider ma mb).Node A) :

                              What the decider may have reached: its start, a node of the walk reached from the first endpoint, or a node of the complement reached from one of its sources.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                Dependency graph
                                theorem DescriptiveComplexity.ParamTCSpec.reachInv_of_reachAt {L : FirstOrder.Language} (W : ParamTCSpec (L.sum FirstOrder.Language.order)) {A : Type} [L.Structure A] [LinearOrder A] {ma mb : W.Mode} (w : W.AtomParA) (t : Fin W.k Fin (W.coSpec ma mb).kA) {c : (W.reachDecider ma mb).Node A} (h : (W.reachDecider ma mb).ReachAt w (none, t) c) :
                                W.ReachInv w t c
                                Dependency graph

                                The decider decides reachability between its two modes, at the two endpoints and the parameters.

                                Dependency graph

                                The deciders of a family #

                                The reachability deciders of a family: one per relation variable of its block.

                                Equations
                                Instances For
                                  Dependency graph

                                  The deciders decide the family's reachability relations.

                                  Dependency graph