Documentation

DescriptiveComplexity.Problems.Wide.DrawKindRule

The rules of an atom's machinery, dispatched by its kind #

One atom of a step matrix gets the machinery its kind names: a stage atom the random access of DescriptiveComplexity.Problems.Wide.DrawStageAtom, an expansion atom the tag-branched loops of DescriptiveComplexity.Problems.Wide.DrawTagged, a comparison the coordinate loop of DescriptiveComplexity.Problems.Wide.DrawElem. This file is the dispatch: per kind a parameter pack (DescriptiveComplexity.Draw.StageArgs and friends) mirroring the machinery's semantic parameters – the matches, the control updates, the loop operations, and for the tag branch its exclusivity proof – then DescriptiveComplexity.Draw.Data.kindRule/kindSep/kindEntry: the rules, their separation, and the machinery's entry phase.

The packs keep the semantic content where it belongs – it is fixed with the runs – while the shapes and their separation are closed here: kindSep needs nothing beyond the packs and the embedding's injectivity.

The parameter packs #

structure DescriptiveComplexity.Draw.StageArgs (A Q W KB : Type) (dd0 k : ) :

The parameters of a stage atom's machinery (see DescriptiveComplexity.Draw.Data.stageRule).

  • srcTrack : Fin kW

    The source track of each argument position.

  • srcBlk : Fin kKB

    The source block of each argument position.

  • dstBlk : Fin kKB

    The target block of each argument position.

  • coord : Fin dd0Q

    The control location of the coordinate loop.

  • bitFlag : (QA)Prop

    The copied bit, read back from the control.

  • setBit : Bool(QA)(WA)QA

    Storing the read bit.

  • initLv : (QA)(WA)QA

    Initializing the coordinate loop.

  • advLv : (QA)(WA)QA

    Advancing the coordinate loop.

  • IsMaxLv : (QA)Prop

    The coordinate loop is exhausted.

  • oldSlot : W

    The stage track read under the head.

  • setAv : Bool(QA)(WA)QA

    Storing the atom's verdict.

Instances For
    Dependency graph
    structure DescriptiveComplexity.Draw.TagArgs (A Q W : Type) (m : ) (T : Type) (nrOf : T) :

    The parameters of a tag-branched machinery (see DescriptiveComplexity.Draw.tagRule), with the branch's exclusivity proof.

    • rdTrackT : Fin mW

      The track of each witness read.

    • MatchT : Fin m(QA)(WA)Prop

      The name guard of each witness read.

    • setTagFlag : Fin mBool(QA)(WA)QA

      Storing a witness bit.

    • TagsAre : T(QA)Prop

      The branch's decoding.

    • hTags (τ τ' : T) (f : QA) : self.TagsAre τ fself.TagsAre τ' fτ = τ'

      The decoding is exclusive.

    • rdTrackE (τ : T) : Fin (nrOf τ)W

      The track of each leaf read, per branch.

    • MatchE (τ : T) : Fin (nrOf τ)(QA)(WA)Prop

      The name guard of each leaf read, per branch.

    • setFlagE (τ : T) : Fin (nrOf τ)Bool(QA)(WA)QA

      Storing a leaf bit.

    • initEl : T(QA)(WA)QA

      Initializing the loop and accumulators.

    • advEl : T(QA)(WA)QA

      Advancing and folding.

    • exitSt : T(QA)(WA)QA

      The final fold.

    • IsMaxEl : T(QA)Prop

      The loop is exhausted.

    Instances For
      Dependency graph
      structure DescriptiveComplexity.Draw.ElemArgs (A Q W : Type) (nr : ) :

      The parameters of a plain element loop (see DescriptiveComplexity.Draw.elemRule).

      • rdTrack : Fin nrW

        The track of each leaf read.

      • MatchOf : Fin nr(QA)(WA)Prop

        The name guard of each leaf read.

      • setFlag : Fin nrBool(QA)(WA)QA

        Storing a leaf bit.

      • initEl : (QA)(WA)QA

        Initializing the loop and accumulators.

      • advEl : (QA)(WA)QA

        Advancing and folding.

      • exitSt : (QA)(WA)QA

        The final fold.

      • IsMaxEl : (QA)Prop

        The loop is exhausted.

      Instances For
        Dependency graph
        Dependency graph
        noncomputable def DescriptiveComplexity.Draw.Data.kindEntry {L : FirstOrder.Language} (dt : Data L) {n : } (κ : MatAtom dt.X dt.d.B n) :
        dt.KindPh κ

        The entry phase of an atom kind's machinery: the machinery's own first phase – for an expansion atom the first witness read, so the tag chain is entered, not skipped (the branch checkpoint only when there is no read at all).

        Equations
        Instances For
          Dependency graph
          noncomputable def DescriptiveComplexity.Draw.Data.kindRule {L : FirstOrder.Language} (dt : Data L) {A Q P : Type} (zero one : A) {n : } (κ : MatAtom dt.X dt.d.B n) (_args : dt.KindArgs κ) (_emb : dt.KindPh κP) (_exitPh : P) (s : dt.KindSite κ) :
          dt.KindSh κ sRule A Q dt.SlotIx P

          The rules of an atom kind's machinery, at its parameter pack.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            Dependency graph
            theorem DescriptiveComplexity.Draw.Data.kindDstIn {L : FirstOrder.Language} {dt : Data L} {A Q P : Type} (zero one : A) {S : PProp} {n : } (κ : MatAtom dt.X dt.d.B n) (args : dt.KindArgs κ) {emb : dt.KindPh κP} (exitPh : P) (hemb : ∀ (p : dt.KindPh κ), S (emb p)) (hexit : S exitPh) (s : dt.KindSite κ) (ρ : dt.KindSh κ s) :
            S (dt.kindRule zero one κ args emb exitPh s ρ).dstPh

            A property of an atom kind's phases and its exit holds of every phase it can move to: whichever kind it is, its machinery stays inside its own phases and only its verdict leaves. This is what a determinism-after-the-guess argument asks of an atom (DescriptiveComplexity.Draw.Data.nexProg_uniqueFrom).

            Dependency graph
            theorem DescriptiveComplexity.Draw.Data.kindHosrc {L : FirstOrder.Language} {dt : Data L} {A Q P : Type} (zero one : A) {n : } (κ : MatAtom dt.X dt.d.B n) (args : dt.KindArgs κ) {emb : dt.KindPh κP} (exitPh : P) (s : dt.KindSite κ) (ρ : dt.KindSh κ s) :
            ∃ (p : dt.KindPh κ), (dt.kindRule zero one κ args emb exitPh s ρ).srcPh = emb p dt.kindOwn κ p = s

            Every rule of an atom kind's machinery fires from a phase its site owns.

            Dependency graph
            theorem DescriptiveComplexity.Draw.Data.kindSep {L : FirstOrder.Language} {dt : Data L} {A Q P : Type} (zero one : A) (hzo : zero one) {n : } (κ : MatAtom dt.X dt.d.B n) (args : dt.KindArgs κ) {emb : dt.KindPh κP} (hemb : Function.Injective emb) (exitPh : P) (s : dt.KindSite κ) (ρ ρ' : dt.KindSh κ s) (f : QA) (g : dt.SlotIxA) :
            (dt.kindRule zero one κ args emb exitPh s ρ).guard f g(dt.kindRule zero one κ args emb exitPh s ρ').guard f g(dt.kindRule zero one κ args emb exitPh s ρ).srcPh = (dt.kindRule zero one κ args emb exitPh s ρ').srcPhρ = ρ'

            An atom kind's machinery separates in-shape.

            Dependency graph