Documentation

DescriptiveComplexity.Problems.Wide.DrawGeom

Where the states, the symbols and the transitions sit #

The instance the reduction emits has universe Draw.Tag R P K × (Fin dd → A), and its states, symbols and transitions are elements of it. This file says which elements they are.

The layout is the simplest one that works. A state, a symbol and a transition each carry a payload of c coordinates – c is the program's choice, and dd is at least c – and the coordinates beyond the payload hold a designated element. That padding is not decoration: without it an element would have n^(dd-c) spellings, and the machine's promises are that there is one start state, one blank, and at most one transition per state and symbol (DescriptiveComplexity.TMData.Deterministic). A canonical spelling is what makes those provable.

What distinguishes the three is the tag, which is also what carries everything about a transition except its data: its rule index. So

Two elements with different tags are different, and two with the same tag differ exactly when their payloads do (DescriptiveComplexity.Draw.pad_injective). Those are the distinctness facts the well-formedness and determinism obligations are discharged from.

Canonical payloads #

noncomputable def DescriptiveComplexity.Draw.pad {A : Type} {c dd : } (zero : A) (w : Fin cA) :
Fin ddA

The canonical tuple carrying a payload: the payload in the first c coordinates, the designated element in the rest.

Equations
Instances For
    Dependency graph
    def DescriptiveComplexity.Draw.unpad {A : Type} {c dd : } (hc : c dd) (v : Fin ddA) :
    Fin cA

    Reading a payload back.

    Equations
    Instances For
      Dependency graph
      def DescriptiveComplexity.Draw.IsPad {A : Type} {dd : } (c : ) (zero : A) (v : Fin ddA) :

      Being canonically padded: nothing but the designated element beyond the payload. This is the condition that gives an element one spelling, and so the machine's promises their uniqueness.

      Equations
      Instances For
        Dependency graph
        @[simp]
        theorem DescriptiveComplexity.Draw.pad_of_lt {A : Type} {c dd : } {zero : A} {w : Fin cA} (j : Fin dd) (h : j < c) :
        pad zero w j = w j, h
        Dependency graph
        @[simp]
        theorem DescriptiveComplexity.Draw.pad_of_ge {A : Type} {c dd : } {zero : A} {w : Fin cA} (j : Fin dd) (h : c j) :
        pad zero w j = zero
        Dependency graph
        theorem DescriptiveComplexity.Draw.isPad_pad {A : Type} {c dd : } {zero : A} {w : Fin cA} :
        IsPad c zero (pad zero w)
        Dependency graph
        @[simp]
        theorem DescriptiveComplexity.Draw.unpad_pad {A : Type} {c dd : } {zero : A} {w : Fin cA} (hc : c dd) :
        unpad hc (pad zero w) = w

        A payload reads back.

        Dependency graph
        theorem DescriptiveComplexity.Draw.pad_unpad {A : Type} {c dd : } {zero : A} {v : Fin ddA} (hc : c dd) (hv : IsPad c zero v) :
        pad zero (unpad hc v) = v

        A canonically padded tuple is the padding of what it carries, so the two descriptions of an element – “it is pad of something” and “it is padded” – are the same.

        Dependency graph
        theorem DescriptiveComplexity.Draw.pad_injective {A : Type} {c dd : } {zero : A} (hc : c dd) :

        Distinct payloads give distinct tuples, which is where every uniqueness promise of the emitted machine comes from.

        Dependency graph

        The three kinds of element #

        noncomputable def DescriptiveComplexity.Draw.stateElt {A : Type} {c dd : } {R P K : Type} (zero : A) (p : P) (w : Fin cA) :
        Tag R P K × (Fin ddA)

        A state: the call site in the tag, the pointer in the payload.

        Equations
        Instances For
          Dependency graph
          noncomputable def DescriptiveComplexity.Draw.symElt {A : Type} {c dd : } {R P K : Type} (zero : A) (w : Fin cA) :
          Tag R P K × (Fin ddA)

          A symbol: the tracks in the payload.

          Equations
          Instances For
            Dependency graph
            noncomputable def DescriptiveComplexity.Draw.trElt {A : Type} {c dd : } {R P K : Type} (zero : A) (r : R) (w : Fin cA) :
            Tag R P K × (Fin ddA)

            A transition: the rule in the tag, the rule's data in the payload.

            Equations
            Instances For
              Dependency graph
              theorem DescriptiveComplexity.Draw.stateElt_inj {A : Type} {c dd : } {zero : A} {R P K : Type} (hc : c dd) {p p' : P} {w w' : Fin cA} (h : stateElt zero p w = stateElt zero p' w') :
              p = p' w = w'

              A state is determined by its call site and its pointer.

              Dependency graph
              theorem DescriptiveComplexity.Draw.symElt_inj {A : Type} {c dd : } {zero : A} {R P K : Type} (hc : c dd) {w w' : Fin cA} (h : symElt zero w = symElt zero w') :
              w = w'

              A symbol is determined by its tracks.

              Dependency graph