Documentation

DescriptiveComplexity.Problems.Wide.DrawCtl

The control's dictionary: which slot plays which role #

The program's states carry a pointer f : dt.CtlIx → A, and every semantic parameter of the machinery – the coordinates a name guard compares against, the accumulators the folds update, the flags a verdict is stored in – is a designation of some of its slots. This file fixes them, once, with the casts through the budgets that DescriptiveComplexity.Draw.Data.eDim and friends were computed for:

roleslots
the coordinates of the current loop elementlvC (the first dd₀ of the lv family)
the inner fold's accumulatorsaccC
an element loop's sub-fold accumulatorssacC
the verdicts of the matrix's atomsavC
the leaf reads of the current roundrdfC
the tag witnessestgfC
the gates' verdict, a copied bit, two scratchgateFlagC, bitFlagC, scratchC

and the two operations every parameter is built from: reading a slot as a bit, and writing one (DescriptiveComplexity.Draw.Data.ctlBit and setCtl), with their read-back equations. Nothing here is about the tape; the machinery's dstSt parameters are functions of the pointer alone, and this is their vocabulary.

The designations #

noncomputable def DescriptiveComplexity.Draw.Data.lvC {L : FirstOrder.Language} (dt : Data L) (j : Fin dt.dd0) :

The coordinates of the loop element: the first dd₀ loop-variable slots. A name guard compares a cell's name slots against these, so they are the coord of every read and write trip.

Equations
Instances For
    Dependency graph
    noncomputable def DescriptiveComplexity.Draw.Data.accC {L : FirstOrder.Language} (dt : Data L) (j : Fin dt.naDim) :

    The inner fold's accumulators: one per level of the quantifier prefix, and one over.

    Equations
    Instances For
      Dependency graph
      noncomputable def DescriptiveComplexity.Draw.Data.sacC {L : FirstOrder.Language} (dt : Data L) (j : Fin dt.eDim) :

      A sub-fold's accumulators: one per level of an element loop's own prefix.

      Equations
      Instances For
        Dependency graph
        noncomputable def DescriptiveComplexity.Draw.Data.avC {L : FirstOrder.Language} (dt : Data L) (a : Fin dt.natMax) :

        The verdict of an atom of the matrix.

        Equations
        Instances For
          Dependency graph
          noncomputable def DescriptiveComplexity.Draw.Data.rdfC {L : FirstOrder.Language} (dt : Data L) (a : Fin dt.nfDim) :

          The verdict of a leaf read of the current element-loop round.

          Equations
          Instances For
            Dependency graph
            noncomputable def DescriptiveComplexity.Draw.Data.tgfC {L : FirstOrder.Language} (dt : Data L) (a : Fin dt.ntgDim) :

            A tag-witness flag.

            Equations
            Instances For
              Dependency graph

              The gates' verdict flag: cleared by a failing block, read by the verdict checkpoint.

              Equations
              Instances For
                Dependency graph

                The copied bit of a tuple loop: written by the read trip's verdict exit, read back by the write trip.

                Equations
                Instances For
                  Dependency graph
                  noncomputable def DescriptiveComplexity.Draw.Data.scratchC {L : FirstOrder.Language} (dt : Data L) (k : Fin 6) :

                  The remaining scratch flags: the last leaf's value, the comparison loops' accumulator and their two verdict bits, and two spare.

                  Equations
                  Instances For
                    Dependency graph

                    The ∃-levels' gate flag of a VAL round: the conjunction, over the existentially quantified levels of the variable's pack, of “this level's inner block is an encoding”. The last free scratch flag.

                    Equations
                    Instances For
                      Dependency graph

                      The ∀-levels' gate flag of a VAL round: the same conjunction over the universally quantified levels. Reuses the outer gates' flag, which is dead once the verdict checkpoint has dispatched on it – nothing inside the VAL loop reads it again.

                      Equations
                      Instances For
                        Dependency graph
                        Dependency graph
                        Dependency graph

                        Distinctness #

                        The roles are disjoint families of the same inductive, so telling them apart is a matter of constructors – except inside a family, where it is the index. These are the facts an update needs: writing one slot leaves the others alone.

                        Dependency graph
                        Dependency graph
                        Dependency graph
                        Dependency graph
                        Dependency graph

                        Reading and writing one slot #

                        def DescriptiveComplexity.Draw.Data.ctlBit {L : FirstOrder.Language} (dt : Data L) {A : Type} (one : A) (f : dt.CtlIxA) (q : dt.CtlIx) :

                        A control slot, read as a bit.

                        Equations
                        Instances For
                          Dependency graph
                          noncomputable def DescriptiveComplexity.Draw.Data.setCtl {L : FirstOrder.Language} (dt : Data L) {A : Type} (zero one : A) (q : dt.CtlIx) (b : Prop) (f : dt.CtlIxA) :
                          dt.CtlIxA

                          A control slot, written: the pointer with one slot set to a bit.

                          Equations
                          Instances For
                            Dependency graph
                            @[simp]
                            theorem DescriptiveComplexity.Draw.Data.ctlBit_setCtl_self {L : FirstOrder.Language} {dt : Data L} {A : Type} {zero one : A} (hzo : zero one) (q : dt.CtlIx) (b : Prop) (f : dt.CtlIxA) :
                            dt.ctlBit one (dt.setCtl zero one q b f) q b
                            Dependency graph
                            @[simp]
                            theorem DescriptiveComplexity.Draw.Data.ctlBit_setCtl_of_ne {L : FirstOrder.Language} {dt : Data L} {A : Type} {zero one : A} {q q' : dt.CtlIx} (hne : q' q) (b : Prop) (f : dt.CtlIxA) :
                            dt.ctlBit one (dt.setCtl zero one q b f) q' dt.ctlBit one f q'
                            Dependency graph
                            theorem DescriptiveComplexity.Draw.Data.setCtl_of_ne {L : FirstOrder.Language} {dt : Data L} {A : Type} {zero one : A} {q q' : dt.CtlIx} (hne : q' q) (b : Prop) (f : dt.CtlIxA) :
                            dt.setCtl zero one q b f q' = f q'

                            A write leaves the other slots' values alone, not only their bits.

                            Dependency graph

                            The tuple enumeration #

                            An element loop runs over the tuples of source elements in the lexicographic order, one coordinatewise successor per round (DescriptiveComplexity.TupSucc, which DescriptiveComplexity.Draw.reflTransGen_of_tupLoop indexes its rounds by). The loop's three semantic parameters are the functions behind that relation: where it starts, what it advances to, and when it is done.

                            def DescriptiveComplexity.Draw.IsMaxTup {D : } {A : Type} [LinearOrder A] (t : Fin DA) :

                            The tuple is exhausted: every coordinate is maximal, i.e., it is the lexicographic top.

                            Equations
                            Instances For
                              Dependency graph
                              theorem DescriptiveComplexity.Draw.exists_tupSucc_of_not_isMaxTup {D : } {A : Type} [LinearOrder A] [Finite A] {t : Fin DA} (h : ¬IsMaxTup t) :
                              ∃ (w : Fin DA), TupSucc t w

                              A non-exhausted tuple has a successor.

                              Dependency graph
                              noncomputable def DescriptiveComplexity.Draw.tupNext {D : } {A : Type} [LinearOrder A] (t : Fin DA) :
                              Fin DA

                              The next tuple, the lexicographic successor – itself at the top, where no round follows.

                              Equations
                              Instances For
                                Dependency graph
                                theorem DescriptiveComplexity.Draw.tupSucc_tupNext {D : } {A : Type} [LinearOrder A] [Finite A] {t : Fin DA} (h : ¬IsMaxTup t) :

                                Below the top, the next tuple is a successor.

                                Dependency graph

                                The coordinate a round carries #

                                A fold's update rule needs to know which coordinate rolled over, and the loop's control does: it is the greatest non-maximal coordinate of the tuple, which is the witness of DescriptiveComplexity.TupSucc – unique, so the machine's dstSt may name it.

                                def DescriptiveComplexity.Draw.TupSuccAt {D : } {A : Type} [LinearOrder A] (p : Fin D) (t t' : Fin DA) :

                                The body of DescriptiveComplexity.TupSucc at a named coordinate.

                                Equations
                                Instances For
                                  Dependency graph
                                  theorem DescriptiveComplexity.Draw.tupSuccAt_unique {D : } {A : Type} [LinearOrder A] {p p' : Fin D} {t t' : Fin DA} (h : TupSuccAt p t t') (h' : TupSuccAt p' t t') :
                                  p = p'

                                  The carried coordinate is unique: above it every coordinate is already maximal, and it is not.

                                  Dependency graph
                                  noncomputable def DescriptiveComplexity.Draw.tupCarry {D : } {A : Type} [LinearOrder A] (t : Fin DA) :

                                  The coordinate a round carries, read off the tuple – as a level index, so that a fold's rules may use it directly; at the top, where no round follows, it is past the last coordinate.

                                  Equations
                                  Instances For
                                    Dependency graph
                                    theorem DescriptiveComplexity.Draw.tupCarry_eq {D : } {A : Type} [LinearOrder A] {t : Fin DA} {p : Fin D} (hp : TupSuccAt p t (tupNext t)) :
                                    tupCarry t = p

                                    What the carried coordinate is: the witness of the tuple's step, which is unique.

                                    Dependency graph
                                    theorem DescriptiveComplexity.Draw.tupSuccAt_tupCarry {D : } {A : Type} [LinearOrder A] [Finite A] [Nonempty A] {t : Fin DA} (h : ¬IsMaxTup t) :
                                    ∃ (p : Fin D), p = tupCarry t TupSuccAt p t (tupNext t)

                                    Below the top the carried coordinate is a level, and the round steps there.

                                    Dependency graph
                                    noncomputable def DescriptiveComplexity.Draw.botTup {D : } {A : Type} [LinearOrder A] [Finite A] [Nonempty A] :
                                    Fin DA

                                    The first tuple: every coordinate the least element.

                                    Equations
                                    Instances For
                                      Dependency graph
                                      theorem DescriptiveComplexity.Draw.botTup_le {D : } {A : Type} [LinearOrder A] [Finite A] [Nonempty A] (p : Fin D) (a : A) :
                                      Dependency graph

                                      The loop element, read and written #

                                      Two widths, one family of slots: an element loop of an expansion atom or a domain gate enumerates the whole prefix of its defining sentence – up to eDim coordinates – while a coordinate loop (a block copy, a comparison) enumerates the dd₀ coordinates a cell's name carries. The first dd₀ slots of the wide tuple are the narrow one (lvC_eq_lvE), so a leaf read of a wide loop names its cell from the coordinates it computes and a leaf read of a narrow one from the slots directly.

                                      noncomputable def DescriptiveComplexity.Draw.Data.readLv {L : FirstOrder.Language} (dt : Data L) {A : Type} (f : dt.CtlIxA) :
                                      Fin dt.dd0A

                                      The loop element's coordinates, read out of the control.

                                      Equations
                                      Instances For
                                        Dependency graph
                                        noncomputable def DescriptiveComplexity.Draw.Data.putLv {L : FirstOrder.Language} (dt : Data L) {A : Type} (f : dt.CtlIxA) (w : Fin dt.dd0A) :
                                        dt.CtlIxA

                                        The loop element's coordinates, written: the pointer with the loop-variable slots set to a tuple.

                                        Equations
                                        Instances For
                                          Dependency graph
                                          theorem DescriptiveComplexity.Draw.Data.putLv_of_not_lv {L : FirstOrder.Language} {dt : Data L} {A : Type} {f : dt.CtlIxA} {w : Fin dt.dd0A} {q : dt.CtlIx} (h : ∀ (j : Fin dt.dd0), q dt.lvC j) :
                                          dt.putLv f w q = f q
                                          Dependency graph
                                          @[simp]
                                          theorem DescriptiveComplexity.Draw.Data.readLv_putLv {L : FirstOrder.Language} {dt : Data L} {A : Type} (f : dt.CtlIxA) (w : Fin dt.dd0A) :
                                          dt.readLv (dt.putLv f w) = w
                                          Dependency graph
                                          theorem DescriptiveComplexity.Draw.Data.putLv_acc {L : FirstOrder.Language} {dt : Data L} {A : Type} (f : dt.CtlIxA) (w : Fin dt.dd0A) (k : Fin dt.naDim) :
                                          dt.putLv f w (dt.accC k) = f (dt.accC k)
                                          Dependency graph
                                          theorem DescriptiveComplexity.Draw.Data.putLv_av {L : FirstOrder.Language} {dt : Data L} {A : Type} (f : dt.CtlIxA) (w : Fin dt.dd0A) (a : Fin dt.natMax) :
                                          dt.putLv f w (dt.avC a) = f (dt.avC a)
                                          Dependency graph
                                          noncomputable def DescriptiveComplexity.Draw.Data.lvE {L : FirstOrder.Language} (dt : Data L) (j : Fin dt.eDim) :

                                          A loop variable of an element loop, at the full width.

                                          Equations
                                          Instances For
                                            Dependency graph
                                            Dependency graph
                                            Dependency graph
                                            noncomputable def DescriptiveComplexity.Draw.Data.readLvE {L : FirstOrder.Language} (dt : Data L) {A : Type} (f : dt.CtlIxA) :
                                            Fin dt.eDimA

                                            The wide loop element, read out of the control.

                                            Equations
                                            Instances For
                                              Dependency graph
                                              noncomputable def DescriptiveComplexity.Draw.Data.putLvE {L : FirstOrder.Language} (dt : Data L) {A : Type} (f : dt.CtlIxA) (w : Fin dt.eDimA) :
                                              dt.CtlIxA

                                              The wide loop element, written.

                                              Equations
                                              Instances For
                                                Dependency graph
                                                theorem DescriptiveComplexity.Draw.Data.putLvE_of_not_lv {L : FirstOrder.Language} {dt : Data L} {A : Type} {f : dt.CtlIxA} {w : Fin dt.eDimA} {q : dt.CtlIx} (h : ∀ (j : Fin dt.eDim), q dt.lvE j) :
                                                dt.putLvE f w q = f q
                                                Dependency graph
                                                @[simp]
                                                theorem DescriptiveComplexity.Draw.Data.readLvE_putLvE {L : FirstOrder.Language} {dt : Data L} {A : Type} (f : dt.CtlIxA) (w : Fin dt.eDimA) :
                                                dt.readLvE (dt.putLvE f w) = w
                                                Dependency graph
                                                theorem DescriptiveComplexity.Draw.Data.putLvE_acc {L : FirstOrder.Language} {dt : Data L} {A : Type} (f : dt.CtlIxA) (w : Fin dt.eDimA) (k : Fin dt.naDim) :
                                                dt.putLvE f w (dt.accC k) = f (dt.accC k)

                                                The accumulators, the verdicts and the flags ride along a write of the wide loop element.

                                                Dependency graph
                                                theorem DescriptiveComplexity.Draw.Data.putLvE_av {L : FirstOrder.Language} {dt : Data L} {A : Type} (f : dt.CtlIxA) (w : Fin dt.eDimA) (a : Fin dt.natMax) :
                                                dt.putLvE f w (dt.avC a) = f (dt.avC a)
                                                Dependency graph

                                                The loop's three operations #

                                                DescriptiveComplexity.Draw.tupNext and friends, in the slots: where a loop starts, what it advances to, and when it is done – the initEl/advEl/ IsMaxEl of every element loop, at either width.

                                                noncomputable def DescriptiveComplexity.Draw.Data.initLvE {L : FirstOrder.Language} (dt : Data L) {A : Type} [LinearOrder A] [Finite A] [Nonempty A] (f : dt.CtlIxA) :
                                                dt.CtlIxA

                                                The wide loop, started.

                                                Equations
                                                Instances For
                                                  Dependency graph
                                                  noncomputable def DescriptiveComplexity.Draw.Data.advLvE {L : FirstOrder.Language} (dt : Data L) {A : Type} [LinearOrder A] (f : dt.CtlIxA) :
                                                  dt.CtlIxA

                                                  The wide loop, advanced.

                                                  Equations
                                                  Instances For
                                                    Dependency graph

                                                    The wide loop, exhausted.

                                                    Equations
                                                    Instances For
                                                      Dependency graph
                                                      noncomputable def DescriptiveComplexity.Draw.Data.initLvN {L : FirstOrder.Language} (dt : Data L) {A : Type} [LinearOrder A] [Finite A] [Nonempty A] (f : dt.CtlIxA) :
                                                      dt.CtlIxA

                                                      The narrow loop, started.

                                                      Equations
                                                      Instances For
                                                        Dependency graph
                                                        noncomputable def DescriptiveComplexity.Draw.Data.advLvN {L : FirstOrder.Language} (dt : Data L) {A : Type} [LinearOrder A] (f : dt.CtlIxA) :
                                                        dt.CtlIxA

                                                        The narrow loop, advanced.

                                                        Equations
                                                        Instances For
                                                          Dependency graph

                                                          The narrow loop, exhausted.

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