Documentation

DescriptiveComplexity.TransitiveClosureFlatten

Flattening a walk whose steps are decided: the suspension #

The nested case of the normal form for FO(TC): a walk over an expansion – whose step formulas read the reachability relations of other walks – becomes a walk over the base vocabulary (DescriptiveComplexity.ParamTCSpec.flat), given a DescriptiveComplexity.Decider for each of its step formulas. The outer walk is suspended at a node, the decider of the step to a candidate successor is run, and where it exits yes the outer walk resumes at that successor.

Two ways to pick the candidate #

A node of the outer walk is encoded with the candidate and every decider's coordinates at the minimum (DescriptiveComplexity.ParamTCSpec.flatEnc), which is where the walk resumes after a yes; this is what makes the encoding a bijection onto the outer nodes the flat walk can stand on.

The flat walk carries its coordinates as a type rather than an arity (DescriptiveComplexity.CoordWalk), the coordinates of the deciders being a dependent sum over the pairs of modes; DescriptiveComplexity.CoordWalk.toParam enumerates them for the DescriptiveComplexity.ParamTCSpec the rest of the development consumes.

Walks with a type of coordinates #

A parameterized walk whose coordinates are an arbitrary finite type.

Instances For
    Dependency graph
    @[reducible, inline]

    A node: a mode and a tuple.

    Equations
    Instances For
      Dependency graph
      def DescriptiveComplexity.CoordWalk.StepAt {L : FirstOrder.Language} (C : CoordWalk L) {A : Type} [L.Structure A] (z : Fin C.parA) (a b : C.Node A) :

      One step, at a valuation of the parameters.

      Equations
      Instances For
        Dependency graph
        @[reducible, inline]
        abbrev DescriptiveComplexity.CoordWalk.ReachAt {L : FirstOrder.Language} (C : CoordWalk L) {A : Type} [L.Structure A] (z : Fin C.parA) :
        C.Node AC.Node AProp

        Reachability, at a valuation of the parameters.

        Equations
        Instances For
          Dependency graph

          The walk is functional when no node has two successors.

          Equations
          Instances For
            Dependency graph

            The coordinates, enumerated.

            Equations
            Instances For
              Dependency graph
              @[reducible]

              The walk with its coordinates enumerated, as a DescriptiveComplexity.ParamTCSpec. Reducible, so that its modes and parameters are those of the walk transparently.

              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                Dependency graph
                theorem DescriptiveComplexity.CoordWalk.stepAt_toParam {L : FirstOrder.Language} (C : CoordWalk L) {A : Type} [L.Structure A] (z : Fin C.parA) (a b : C.toParam.Node A) :
                C.toParam.StepAt z a b C.StepAt z (a.1, a.2 C.coordEquiv) (b.1, b.2 C.coordEquiv)
                Dependency graph
                theorem DescriptiveComplexity.CoordWalk.reachAt_toParam {L : FirstOrder.Language} (C : CoordWalk L) {A : Type} [L.Structure A] (z : Fin C.parA) (a b : C.toParam.Node A) :
                C.toParam.ReachAt z a b C.ReachAt z (a.1, a.2 C.coordEquiv) (b.1, b.2 C.coordEquiv)
                Dependency graph
                Dependency graph

                The flat walk #

                @[instance_reducible]

                An arbitrary linear order on the modes of the outer walk, for the search.

                Equations
                Instances For
                  Dependency graph
                  @[reducible, inline]

                  The coordinates of the flat walk: the current tuple and the candidate, then the coordinates of every decider.

                  Equations
                  Instances For
                    Dependency graph
                    @[reducible, inline]

                    The modes of the flat walk: a mode of the outer walk, or a pair of modes with a mode of their decider.

                    Equations
                    Instances For
                      Dependency graph

                      A coordinate belongs to the slice of a pair of modes.

                      Equations
                      Instances For
                        Dependency graph

                        The formulas #

                        def DescriptiveComplexity.ParamTCSpec.flatRunVar {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) (p : S.Mode × S.Mode) :
                        ((D p.1 p.2).Coord (D p.1 p.2).Coord) (Fin S.k Fin S.k) Fin S.par → (S.FlatCoord D S.FlatCoord D) Fin S.par

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

                        Equations
                        Instances For
                          Dependency graph

                          The variables of a decider's exit, in the flat walk's step (read on the current tuple).

                          Equations
                          Instances For
                            Dependency graph
                            @[reducible, inline]

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

                            Equations
                            Instances For
                              Dependency graph
                              @[reducible, inline]

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

                              Equations
                              Instances For
                                Dependency graph

                                Every coordinate outside a slice is copied.

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

                                  Every decider coordinate of the next tuple is at the minimum.

                                  Equations
                                  Instances For
                                    Dependency graph

                                    The next tuple is the candidate, with everything else at the minimum.

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

                                      The current tuple is copied.

                                      Equations
                                      Instances For
                                        Dependency graph

                                        The candidate advances: same mode and the successor tuple, or the next mode with the tuple from the maximum to the minimum.

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

                                          Entering a decider: the current tuple is copied and the decider's coordinates are reset; when searching, the candidate is the least node.

                                          Equations
                                          • One or more equations did not get rendered due to their size.
                                          Instances For
                                            Dependency graph
                                            noncomputable def DescriptiveComplexity.ParamTCSpec.runF {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) (p : S.Mode × S.Mode) (d d' : (D p.1 p.2).Mode) :

                                            Running a decider: its step on its slice, everything else copied.

                                            Equations
                                            Instances For
                                              Dependency graph
                                              noncomputable def DescriptiveComplexity.ParamTCSpec.retF {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) (p : S.Mode × S.Mode) (d : (D p.1 p.2).Mode) :

                                              Resuming the outer walk: the decider exits yes, and the walk stands on the candidate.

                                              Equations
                                              Instances For
                                                Dependency graph
                                                noncomputable def DescriptiveComplexity.ParamTCSpec.advF {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) (p : S.Mode × S.Mode) (d : (D p.1 p.2).Mode) (p' : S.Mode × S.Mode) :

                                                Trying the next candidate: the decider exits no, the candidate advances, and the decider's coordinates are reset.

                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For
                                                  Dependency graph
                                                  noncomputable def DescriptiveComplexity.ParamTCSpec.innerF {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) (det : Bool) (p : S.Mode × S.Mode) (d : (D p.1 p.2).Mode) (p' : S.Mode × S.Mode) (d' : (D p'.1 p'.2).Mode) :

                                                  The step between two decider nodes: the run, or (when searching) an advance to the start of the next candidate's decider.

                                                  Equations
                                                  Instances For
                                                    Dependency graph
                                                    @[reducible]

                                                    The flat walk: the outer walk with each step decided in place. Guessing (det = false) or searching (det = true) the candidate.

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

                                                      Tuples of the flat walk #

                                                      @[reducible, inline]
                                                      abbrev DescriptiveComplexity.ParamTCSpec.tx {L : FirstOrder.Language} {B : SOBlock} {S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)} {D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)} {A : Type} (t : S.FlatCoord DA) :
                                                      Fin S.kA

                                                      The current tuple.

                                                      Equations
                                                      Instances For
                                                        Dependency graph
                                                        @[reducible, inline]
                                                        abbrev DescriptiveComplexity.ParamTCSpec.ty {L : FirstOrder.Language} {B : SOBlock} {S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)} {D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)} {A : Type} (t : S.FlatCoord DA) :
                                                        Fin S.kA

                                                        The candidate.

                                                        Equations
                                                        Instances For
                                                          Dependency graph
                                                          @[reducible, inline]
                                                          abbrev DescriptiveComplexity.ParamTCSpec.tsl {L : FirstOrder.Language} {B : SOBlock} {S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)} {D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)} {A : Type} (t : S.FlatCoord DA) (p : S.Mode × S.Mode) :
                                                          (D p.1 p.2).CoordA

                                                          The slice of a pair of modes.

                                                          Equations
                                                          Instances For
                                                            Dependency graph
                                                            @[reducible, inline]
                                                            abbrev DescriptiveComplexity.ParamTCSpec.dpar {L : FirstOrder.Language} {B : SOBlock} {S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)} {D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)} {A : Type} (t : S.FlatCoord DA) (z : Fin S.parA) :
                                                            (Fin S.k Fin S.k) Fin S.parA

                                                            The valuation of a decider's parameters: the current tuple, the candidate and the outer parameters.

                                                            Equations
                                                            Instances For
                                                              Dependency graph
                                                              noncomputable def DescriptiveComplexity.ParamTCSpec.setSlice {L : FirstOrder.Language} {B : SOBlock} {S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)} {D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)} {A : Type} (t : S.FlatCoord DA) (p : S.Mode × S.Mode) (u : (D p.1 p.2).CoordA) :
                                                              S.FlatCoord DA

                                                              A tuple with one slice replaced.

                                                              Equations
                                                              Instances For
                                                                Dependency graph
                                                                theorem DescriptiveComplexity.ParamTCSpec.setSlice_inl {L : FirstOrder.Language} {B : SOBlock} {S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)} {D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)} {A : Type} (t : S.FlatCoord DA) (p : S.Mode × S.Mode) (u : (D p.1 p.2).CoordA) (q : Fin S.k Fin S.k) :
                                                                setSlice t p u (Sum.inl q) = t (Sum.inl q)
                                                                Dependency graph
                                                                theorem DescriptiveComplexity.ParamTCSpec.setSlice_comp_inl {L : FirstOrder.Language} {B : SOBlock} {S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)} {D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)} {A : Type} (t : S.FlatCoord DA) (p : S.Mode × S.Mode) (u : (D p.1 p.2).CoordA) :
                                                                Dependency graph
                                                                theorem DescriptiveComplexity.ParamTCSpec.tsl_setSlice_self {L : FirstOrder.Language} {B : SOBlock} {S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)} {D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)} {A : Type} (t : S.FlatCoord DA) (p : S.Mode × S.Mode) (u : (D p.1 p.2).CoordA) :
                                                                tsl (setSlice t p u) p = u
                                                                Dependency graph
                                                                theorem DescriptiveComplexity.ParamTCSpec.setSlice_of_not_inSlice {L : FirstOrder.Language} {B : SOBlock} {S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)} {D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)} {A : Type} (t : S.FlatCoord DA) (p : S.Mode × S.Mode) (u : (D p.1 p.2).CoordA) (c : S.FlatCoord D) (hc : ¬S.InSlice D p c) :
                                                                setSlice t p u c = t c
                                                                Dependency graph
                                                                theorem DescriptiveComplexity.ParamTCSpec.dpar_setSlice {L : FirstOrder.Language} {B : SOBlock} {S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)} {D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)} {A : Type} (t : S.FlatCoord DA) (p : S.Mode × S.Mode) (u : (D p.1 p.2).CoordA) (z : Fin S.parA) :
                                                                dpar (setSlice t p u) z = dpar t z
                                                                Dependency graph
                                                                theorem DescriptiveComplexity.ParamTCSpec.setSlice_tsl {L : FirstOrder.Language} {B : SOBlock} {S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)} {D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)} {A : Type} (t : S.FlatCoord DA) (p : S.Mode × S.Mode) :
                                                                setSlice t p (tsl t p) = t
                                                                Dependency graph
                                                                def DescriptiveComplexity.ParamTCSpec.flatEnc {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {A : Type} (det : Bool) (a₀ : A) (a : S.Node A) :
                                                                (S.flat D det).Node A

                                                                The encoding of a node of the outer walk, at a bottom element a₀.

                                                                Equations
                                                                Instances For
                                                                  Dependency graph

                                                                  Semantics of the formulas #

                                                                  theorem DescriptiveComplexity.ParamTCSpec.realize_copyExceptF {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {A : Type} [L.Structure A] [LinearOrder A] (z : Fin S.parA) (p : S.Mode × S.Mode) (t t' : S.FlatCoord DA) :
                                                                  (S.copyExceptF D p).Realize (Sum.elim (Sum.elim t t') z) ∀ (c : S.FlatCoord D), ¬S.InSlice D p ct' c = t c
                                                                  Dependency graph
                                                                  theorem DescriptiveComplexity.ParamTCSpec.realize_minSlicesF {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {A : Type} [L.Structure A] [LinearOrder A] (z : Fin S.parA) (t t' : S.FlatCoord DA) :
                                                                  (S.minSlicesF D).Realize (Sum.elim (Sum.elim t t') z) ∀ (c : (p : S.Mode × S.Mode) × (D p.1 p.2).Coord) (a : A), t' (Sum.inr c) a
                                                                  Dependency graph
                                                                  theorem DescriptiveComplexity.ParamTCSpec.realize_resetF {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {A : Type} [L.Structure A] [LinearOrder A] (z : Fin S.parA) (t t' : S.FlatCoord DA) :
                                                                  (S.resetF D).Realize (Sum.elim (Sum.elim t t') z) tx t' = ty t (∀ (i : Fin S.k) (a : A), t' (Sum.inl (Sum.inr i)) a) ∀ (c : (p : S.Mode × S.Mode) × (D p.1 p.2).Coord) (a : A), t' (Sum.inr c) a
                                                                  Dependency graph
                                                                  theorem DescriptiveComplexity.ParamTCSpec.realize_copyCurF {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {A : Type} [L.Structure A] [LinearOrder A] (z : Fin S.parA) (t t' : S.FlatCoord DA) :
                                                                  (S.copyCurF D).Realize (Sum.elim (Sum.elim t t') z) tx t' = tx t
                                                                  Dependency graph
                                                                  theorem DescriptiveComplexity.ParamTCSpec.realize_candSuccF {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {A : Type} [L.Structure A] [LinearOrder A] (z : Fin S.parA) [Nonempty A] (c c' : S.Mode) (t t' : S.FlatCoord DA) :
                                                                  (S.candSuccF D c c').Realize (Sum.elim (Sum.elim t t') z) toLex (c, toLex (ty t)) toLex (c', toLex (ty t'))
                                                                  Dependency graph
                                                                  theorem DescriptiveComplexity.ParamTCSpec.realize_initF {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {det : Bool} {A : Type} [L.Structure A] [LinearOrder A] (z : Fin S.parA) (p : S.Mode × S.Mode) (t t' : S.FlatCoord DA) :
                                                                  (S.initF D det p).Realize (Sum.elim (Sum.elim t t') z) (det = true(∀ (c' : S.Mode), p.2 c') ∀ (i : Fin S.k) (a : A), t' (Sum.inl (Sum.inr i)) a) tx t' = tx t ∀ (c : (p : S.Mode × S.Mode) × (D p.1 p.2).Coord) (a : A), t' (Sum.inr c) a
                                                                  Dependency graph
                                                                  theorem DescriptiveComplexity.ParamTCSpec.realize_runF {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {A : Type} [L.Structure A] [LinearOrder A] (z : Fin S.parA) (p : S.Mode × S.Mode) (d d' : (D p.1 p.2).Mode) (t t' : S.FlatCoord DA) :
                                                                  (S.runF D p d d').Realize (Sum.elim (Sum.elim t t') z) (D p.1 p.2).StepAt (dpar t z) (d, tsl t p) (d', tsl t' p) ∀ (c : S.FlatCoord D), ¬S.InSlice D p ct' c = t c
                                                                  Dependency graph
                                                                  theorem DescriptiveComplexity.ParamTCSpec.realize_exit_relabel {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {A : Type} [L.Structure A] [LinearOrder A] (z : Fin S.parA) (p : S.Mode × S.Mode) (d : (D p.1 p.2).Mode) (o : Bool) (t t' : S.FlatCoord DA) :
                                                                  (FirstOrder.Language.Formula.relabel (S.flatExitVar D p) ((D p.1 p.2).exit d o)).Realize (Sum.elim (Sum.elim t t') z) (D p.1 p.2).ExitAt (dpar t z) (d, tsl t p) o
                                                                  Dependency graph
                                                                  theorem DescriptiveComplexity.ParamTCSpec.realize_retF {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {A : Type} [L.Structure A] [LinearOrder A] (z : Fin S.parA) (p : S.Mode × S.Mode) (d : (D p.1 p.2).Mode) (t t' : S.FlatCoord DA) :
                                                                  (S.retF D p d).Realize (Sum.elim (Sum.elim t t') z) (D p.1 p.2).ExitAt (dpar t z) (d, tsl t p) true tx t' = ty t (∀ (i : Fin S.k) (a : A), t' (Sum.inl (Sum.inr i)) a) ∀ (c : (p : S.Mode × S.Mode) × (D p.1 p.2).Coord) (a : A), t' (Sum.inr c) a
                                                                  Dependency graph
                                                                  def DescriptiveComplexity.ParamTCSpec.Adv {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {A : Type} [L.Structure A] [LinearOrder A] (z : Fin S.parA) (p : S.Mode × S.Mode) (d : (D p.1 p.2).Mode) (p' : S.Mode × S.Mode) (t t' : S.FlatCoord DA) :

                                                                  The advance, as a relation between the two nodes.

                                                                  Equations
                                                                  • One or more equations did not get rendered due to their size.
                                                                  Instances For
                                                                    Dependency graph
                                                                    theorem DescriptiveComplexity.ParamTCSpec.realize_advF {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {A : Type} [L.Structure A] [LinearOrder A] (z : Fin S.parA) [Nonempty A] (p : S.Mode × S.Mode) (d : (D p.1 p.2).Mode) (p' : S.Mode × S.Mode) (t t' : S.FlatCoord DA) :
                                                                    (S.advF D p d p').Realize (Sum.elim (Sum.elim t t') z) S.Adv D z p d p' t t'
                                                                    Dependency graph

                                                                    Steps of the flat walk #

                                                                    theorem DescriptiveComplexity.ParamTCSpec.flat_stepAt_inl_inr {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {det : Bool} {A : Type} [L.Structure A] [LinearOrder A] (z : Fin S.parA) (m : S.Mode) (p : S.Mode × S.Mode) (d : (D p.1 p.2).Mode) (t t' : S.FlatCoord DA) :
                                                                    (S.flat D det).StepAt z (Sum.inl m, t) (Sum.inr p, d, t') p.1 = m d = (D p.1 p.2).start (det = true(∀ (c' : S.Mode), p.2 c') ∀ (i : Fin S.k) (a : A), t' (Sum.inl (Sum.inr i)) a) tx t' = tx t ∀ (c : (p : S.Mode × S.Mode) × (D p.1 p.2).Coord) (a : A), t' (Sum.inr c) a
                                                                    Dependency graph
                                                                    theorem DescriptiveComplexity.ParamTCSpec.flat_not_stepAt_inl_inl {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {det : Bool} {A : Type} [L.Structure A] [LinearOrder A] (z : Fin S.parA) (m n : S.Mode) (t t' : S.FlatCoord DA) :
                                                                    ¬(S.flat D det).StepAt z (Sum.inl m, t) (Sum.inl n, t')
                                                                    Dependency graph
                                                                    theorem DescriptiveComplexity.ParamTCSpec.flat_stepAt_inr_inl {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {det : Bool} {A : Type} [L.Structure A] [LinearOrder A] (z : Fin S.parA) (p : S.Mode × S.Mode) (d : (D p.1 p.2).Mode) (n : S.Mode) (t t' : S.FlatCoord DA) :
                                                                    (S.flat D det).StepAt z (Sum.inr p, d, t) (Sum.inl n, t') p.2 = n (D p.1 p.2).ExitAt (dpar t z) (d, tsl t p) true tx t' = ty t (∀ (i : Fin S.k) (a : A), t' (Sum.inl (Sum.inr i)) a) ∀ (c : (p : S.Mode × S.Mode) × (D p.1 p.2).Coord) (a : A), t' (Sum.inr c) a
                                                                    Dependency graph
                                                                    theorem DescriptiveComplexity.ParamTCSpec.flat_stepAt_inr_inr_same {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {det : Bool} {A : Type} [L.Structure A] [LinearOrder A] (z : Fin S.parA) [Nonempty A] (p : S.Mode × S.Mode) (d d' : (D p.1 p.2).Mode) (t t' : S.FlatCoord DA) :
                                                                    (S.flat D det).StepAt z (Sum.inr p, d, t) (Sum.inr p, d', t') ((D p.1 p.2).StepAt (dpar t z) (d, tsl t p) (d', tsl t' p) ∀ (c : S.FlatCoord D), ¬S.InSlice D p ct' c = t c) det = true d' = (D p.1 p.2).start S.Adv D z p d p t t'

                                                                    A step between decider nodes of the same pair of modes: the run, or an advance.

                                                                    Dependency graph
                                                                    theorem DescriptiveComplexity.ParamTCSpec.flat_stepAt_inr_inr_ne {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {det : Bool} {A : Type} [L.Structure A] [LinearOrder A] (z : Fin S.parA) [Nonempty A] {p p' : S.Mode × S.Mode} (hne : p p') (d : (D p.1 p.2).Mode) (d' : (D p'.1 p'.2).Mode) (t t' : S.FlatCoord DA) :
                                                                    (S.flat D det).StepAt z (Sum.inr p, d, t) (Sum.inr p', d', t') det = true d' = (D p'.1 p'.2).start S.Adv D z p d p' t t'

                                                                    A step between decider nodes of different pairs of modes: an advance only.

                                                                    Dependency graph

                                                                    Correctness #

                                                                    theorem DescriptiveComplexity.ParamTCSpec.dpar_eq {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {A : Type} (z : Fin S.parA) (t : S.FlatCoord DA) :
                                                                    Sum.elim (Sum.elim (tx t) (ty t)) z = dpar t z
                                                                    Dependency graph
                                                                    theorem DescriptiveComplexity.ParamTCSpec.tuple_ext {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {A : Type} {t t' : S.FlatCoord DA} (hx : tx t' = tx t) (hy : ty t' = ty t) (hs : ∀ (p : S.Mode × S.Mode), tsl t' p = tsl t p) :
                                                                    t' = t
                                                                    Dependency graph
                                                                    theorem DescriptiveComplexity.ParamTCSpec.tx_flatEnc {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {det : Bool} {A : Type} (a₀ : A) (a : S.Node A) :
                                                                    tx (S.flatEnc D det a₀ a).2 = a.2
                                                                    Dependency graph
                                                                    theorem DescriptiveComplexity.ParamTCSpec.ty_flatEnc {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {det : Bool} {A : Type} (a₀ : A) (a : S.Node A) :
                                                                    ty (S.flatEnc D det a₀ a).2 = fun (x : Fin S.k) => a₀
                                                                    Dependency graph
                                                                    theorem DescriptiveComplexity.ParamTCSpec.bot_unique {A : Type} [LinearOrder A] {u u' : A} (h : ∀ (a : A), u a) (h' : ∀ (a : A), u' a) :
                                                                    u = u'

                                                                    Coordinates at the minimum are equal.

                                                                    Dependency graph

                                                                    The step deciders decide the steps of the outer walk.

                                                                    Equations
                                                                    Instances For
                                                                      Dependency graph
                                                                      def DescriptiveComplexity.ParamTCSpec.FlatInv {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {det : Bool} {A : Type} [L.Structure A] [LinearOrder A] [instE : ((L.sum FirstOrder.Language.order).sum B.lang).Structure A] (z : Fin S.parA) (a : S.Node A) (c : (S.flat D det).Node A) :

                                                                      What the flat walk may have reached from the encoding of a: an outer node reached from a, or a decider node whose outer node is reached from a and whose decider has run from its start.

                                                                      Equations
                                                                      • One or more equations did not get rendered due to their size.
                                                                      Instances For
                                                                        Dependency graph
                                                                        theorem DescriptiveComplexity.ParamTCSpec.flatInv_of_reachAt {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {det : Bool} {A : Type} [L.Structure A] [LinearOrder A] [instE : ((L.sum FirstOrder.Language.order).sum B.lang).Structure A] {z : Fin S.parA} [Nonempty A] (hD : S.DecidesSteps D z) (a₀ : A) (a : S.Node A) {c : (S.flat D det).Node A} (h : (S.flat D det).ReachAt z (S.flatEnc D det a₀ a) c) :
                                                                        S.FlatInv D z a c
                                                                        Dependency graph
                                                                        theorem DescriptiveComplexity.ParamTCSpec.reachAt_of_flat_reachAt {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {det : Bool} {A : Type} [L.Structure A] [LinearOrder A] [instE : ((L.sum FirstOrder.Language.order).sum B.lang).Structure A] {z : Fin S.parA} [Nonempty A] (hD : S.DecidesSteps D z) (a₀ : A) (a b : S.Node A) (h : (S.flat D det).ReachAt z (S.flatEnc D det a₀ a) (S.flatEnc D det a₀ b)) :
                                                                        S.ReachAt z a b

                                                                        The flat walk reaches only what the outer walk reaches.

                                                                        Dependency graph
                                                                        theorem DescriptiveComplexity.ParamTCSpec.flat_reachAt_of_decider {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {det : Bool} {A : Type} [L.Structure A] [LinearOrder A] {z : Fin S.parA} [Nonempty A] (p : S.Mode × S.Mode) (t : S.FlatCoord DA) {e e' : (D p.1 p.2).Node A} (h : (D p.1 p.2).ReachAt (dpar t z) e e') :
                                                                        (S.flat D det).ReachAt z (Sum.inr p, e.1, setSlice t p e.2) (Sum.inr p, e'.1, setSlice t p e'.2)

                                                                        A run of a decider lifts to the flat walk, on its slice.

                                                                        Dependency graph
                                                                        theorem DescriptiveComplexity.ParamTCSpec.flat_finish {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {det : Bool} {A : Type} [L.Structure A] [LinearOrder A] [instE : ((L.sum FirstOrder.Language.order).sum B.lang).Structure A] {z : Fin S.parA} [Nonempty A] (hD : S.DecidesSteps D z) {a₀ : A} (hbot : ∀ (a : A), a₀ a) (m n : S.Mode) (x y : Fin S.kA) (h : S.StepAt z (m, x) (n, y)) :
                                                                        (S.flat D det).ReachAt z (Sum.inr (m, n), (D m n).start, Sum.elim (Sum.elim x y) fun (x : (p : S.Mode × S.Mode) × (D p.1 p.2).Coord) => a₀) (S.flatEnc D det a₀ (n, y))

                                                                        Finishing a step: from the start of the decider of a step that holds, the flat walk reaches the encoding of the step's target.

                                                                        Dependency graph
                                                                        theorem DescriptiveComplexity.ParamTCSpec.flat_reachAt_of_reachAt {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {A : Type} [L.Structure A] [LinearOrder A] [instE : ((L.sum FirstOrder.Language.order).sum B.lang).Structure A] {z : Fin S.parA} [Nonempty A] (hD : S.DecidesSteps D z) {a₀ : A} (hbot : ∀ (a : A), a₀ a) {a b : S.Node A} (h : S.ReachAt z a b) :
                                                                        (S.flat D false).ReachAt z (S.flatEnc D false a₀ a) (S.flatEnc D false a₀ b)

                                                                        Guessing: the flat walk reaches what the outer walk reaches.

                                                                        Dependency graph
                                                                        @[reducible, inline]

                                                                        The candidates, ordered.

                                                                        Equations
                                                                        Instances For
                                                                          Dependency graph
                                                                          theorem DescriptiveComplexity.ParamTCSpec.flat_reachAt_of_reachAt_det {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {A : Type} [L.Structure A] [LinearOrder A] [instE : ((L.sum FirstOrder.Language.order).sum B.lang).Structure A] {z : Fin S.parA} [Nonempty A] [Finite A] (hD : S.DecidesSteps D z) {a₀ : A} (hbot : ∀ (a : A), a₀ a) (hS : ∀ (a b c : S.Node A), S.StepAt z a bS.StepAt z a cb = c) {a b : S.Node A} (h : S.ReachAt z a b) :
                                                                          (S.flat D true).ReachAt z (S.flatEnc D true a₀ a) (S.flatEnc D true a₀ b)

                                                                          Searching: the flat walk reaches what a functional outer walk reaches.

                                                                          Dependency graph
                                                                          theorem DescriptiveComplexity.ParamTCSpec.reachAt_flat_iff {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {A : Type} [L.Structure A] [LinearOrder A] [instE : ((L.sum FirstOrder.Language.order).sum B.lang).Structure A] {z : Fin S.parA} [Nonempty A] (hD : S.DecidesSteps D z) {a₀ : A} (hbot : ∀ (a : A), a₀ a) (a b : S.Node A) :
                                                                          (S.flat D false).ReachAt z (S.flatEnc D false a₀ a) (S.flatEnc D false a₀ b) S.ReachAt z a b

                                                                          Guessing simulates the outer walk, at the encodings.

                                                                          Dependency graph
                                                                          theorem DescriptiveComplexity.ParamTCSpec.reachAt_flat_iff_of_functional {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {A : Type} [L.Structure A] [LinearOrder A] [instE : ((L.sum FirstOrder.Language.order).sum B.lang).Structure A] {z : Fin S.parA} [Nonempty A] [Finite A] (hD : S.DecidesSteps D z) {a₀ : A} (hbot : ∀ (a : A), a₀ a) (hS : ∀ (a b c : S.Node A), S.StepAt z a bS.StepAt z a cb = c) (a b : S.Node A) :
                                                                          (S.flat D true).ReachAt z (S.flatEnc D true a₀ a) (S.flatEnc D true a₀ b) S.ReachAt z a b

                                                                          Searching simulates a functional outer walk, at the encodings.

                                                                          Dependency graph

                                                                          Functionality of the searching flat walk #

                                                                          theorem DescriptiveComplexity.ParamTCSpec.adv_unique {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {A : Type} [L.Structure A] [LinearOrder A] {z : Fin S.parA} {p p₁ p₂ : S.Mode × S.Mode} {d : (D p.1 p.2).Mode} {t t₁ t₂ : S.FlatCoord DA} (h₁ : S.Adv D z p d p₁ t t₁) (h₂ : S.Adv D z p d p₂ t t₂) :
                                                                          p₁ = p₂ t₁ = t₂

                                                                          Two advances from the same node go to the same node.

                                                                          Dependency graph
                                                                          theorem DescriptiveComplexity.ParamTCSpec.functional_flat {L : FirstOrder.Language} {B : SOBlock} (S : ParamTCSpec ((L.sum FirstOrder.Language.order).sum B.lang)) (D : S.ModeS.ModeDecider L ((Fin S.k Fin S.k) Fin S.par)) {A : Type} [L.Structure A] [LinearOrder A] [Nonempty A] (hDf : ∀ (p : S.Mode × S.Mode), (D p.1 p.2).Functional A) :

                                                                          The searching flat walk is functional when the deciders are.

                                                                          Dependency graph