Documentation

DescriptiveComplexity.Problems.Wide.RegChannelLaid

The file of the register channel, laid out #

DescriptiveComplexity.Draw.Data.diagLaid reads the segment channel's ruler as a DescriptiveComplexity.Draw.LaidFile: one register per element of the universe, in the universe's own order, each naming its own tag's block and its own tuple. This file does the same for the register channel, whose file has one register per element the channel writes for.

Everything the evaluation asks of a layout is the elementwise one's, restricted:

@[reducible, inline]

The index of the register channel's file: the elements it writes for.

Equations
Instances For
    Dependency graph
    noncomputable def DescriptiveComplexity.Draw.Data.regLaid {L : FirstOrder.Language} {dt : Data L} {A R' P' : Type} [LinearOrder A] [LinearOrder R'] [LinearOrder P'] [FirstOrder.Language.wide.Structure (Univ A R' P' dt.KIx dt.dd)] [Finite A] [Finite R'] [Finite P'] [Finite dt.KIx] (h : IsLinOrd WMLe) (hord : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x y tagTupleLe x y) :
    LaidFile dt A R' P' dt.RegIx

    The register channel's file, laid out: one register per element the channel writes for, in the universe's own order, each naming its own tag's block and its own tuple.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      Dependency graph
      theorem DescriptiveComplexity.Draw.Data.isLinOrd_regLaid_le {L : FirstOrder.Language} {dt : Data L} {A R' P' : Type} [LinearOrder A] [LinearOrder R'] [LinearOrder P'] [FirstOrder.Language.wide.Structure (Univ A R' P' dt.KIx dt.dd)] [Finite A] [Finite R'] [Finite P'] [Finite dt.KIx] {h : IsLinOrd WMLe} {hord : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x y tagTupleLe x y} :

      The file's layout order is linear, being the universe's own read on a subtype.

      Dependency graph
      theorem DescriptiveComplexity.Draw.Data.nameSep_regLaid {L : FirstOrder.Language} {dt : Data L} {A R' P' : Type} [LinearOrder A] [LinearOrder R'] [LinearOrder P'] [FirstOrder.Language.wide.Structure (Univ A R' P' dt.KIx dt.dd)] [Finite A] [Finite R'] [Finite P'] [Finite dt.KIx] {h : IsLinOrd WMLe} {hord : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x y tagTupleLe x y} (zero : A) (hdd : dt.dd0 dt.dd) :
      (regLaid h hord).toLayout.NameSep zero hdd

      The file's marks tell its registers apart: a register is an element, so its block and its named coordinates spell it.

      Dependency graph
      theorem DescriptiveComplexity.Draw.Data.hasName_regLaid {L : FirstOrder.Language} {dt : Data L} {A R' P' : Type} [LinearOrder A] [LinearOrder R'] [LinearOrder P'] [FirstOrder.Language.wide.Structure (Univ A R' P' dt.KIx dt.dd)] [Finite A] [Finite R'] [Finite P'] [Finite dt.KIx] {h : IsLinOrd WMLe} {hord : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x y tagTupleLe x y} (zero : A) (harg : ∀ (b : Fin dt.ko Fin dt.ki) (c : Fin dt.dd0A), WMHasInp (Tag.arg (toLex b), padTup zero c)) :
      (regLaid h hord).toLayout.HasName zero

      The file has a register for every name, provided the channel writes for the argument elements: a register is an element, and a name is one of them. This is the one thing the reduction has to arrange about its channel, and arranging it is what puts the file in the working region – the argument tags are the greatest (DescriptiveComplexity.Draw.lt_arg).

      Dependency graph
      theorem DescriptiveComplexity.Draw.Data.work_regLaid {L : FirstOrder.Language} {dt : Data L} {A R' P' : Type} [LinearOrder A] [LinearOrder R'] [LinearOrder P'] [FirstOrder.Language.wide.Structure (Univ A R' P' dt.KIx dt.dd)] [Finite A] [Finite R'] [Finite P'] [Finite dt.KIx] {h : IsLinOrd WMLe} {hord : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x y tagTupleLe x y} {bot : Univ A R' P' dt.KIx dt.dd} (hbot : WMHasInp bot) (hleast : ∀ (y : Univ A R' P' dt.KIx dt.dd), WMHasInp yWMLe bot y) (hbotarg : ∀ (i : dt.KIx), bot.1 Tag.arg i) {r : Univ A R' P' dt.KIx dt.ddProp} (hr : ∀ (x : Univ A R' P' dt.KIx dt.dd), r x∃ (i : dt.KIx), x.1 = Tag.arg i) (u : dt.RegIx) :
      WMSetLt WMLe r ((regLaid h hord).cell u)

      The evaluation's working area lies below the file. A logical address is made of argument elements; the file's registers all hold the least marked element, which the reduction places below the argument tags. So no address the evaluation manipulates ever reaches into the file, and the walks that assume it (DescriptiveComplexity.Draw.Data.nexIxEvalB_reachesIn's hwork) apply unchanged.

      This is the one thing the reduction owes its own marking, and the reason the marks are «the argument elements and one element below them» rather than the argument elements alone: with the latter the least marked element would itself be an argument element, and an address holding it would be a register's neighbor instead of lying under the file.

      Dependency graph

      The coherences the evaluation asks of a file #

      The registers an address uses: the ones standing for argument elements. The register below them – the one the reduction marks so that the file lies above the working area – is never part of a logical address.

      Equations
      Instances For
        Dependency graph
        theorem DescriptiveComplexity.Draw.Data.elt_reg_regLaid {L : FirstOrder.Language} {dt : Data L} {A R' P' : Type} [LinearOrder A] [LinearOrder R'] [LinearOrder P'] [FirstOrder.Language.wide.Structure (Univ A R' P' dt.KIx dt.dd)] [Finite A] [Finite R'] [Finite P'] [Finite dt.KIx] {h : IsLinOrd WMLe} {hord : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x y tagTupleLe x y} (zero : A) (harg : ∀ (b : Fin dt.ko Fin dt.ki) (c : Fin dt.dd0A), WMHasInp (Tag.arg (toLex b), padTup zero c)) (b : Fin dt.ko Fin dt.ki) (c : Fin dt.dd0A) :
        ((regLaid h hord).toLayout.reg b c) = dt.blkElt b (pad zero c)

        A named register stands for the element it names: the heltP coherence.

        Dependency graph
        theorem DescriptiveComplexity.Draw.Data.blk_regLaid_eq_tagBlk {L : FirstOrder.Language} {dt : Data L} {A R' P' : Type} [LinearOrder A] [LinearOrder R'] [LinearOrder P'] [FirstOrder.Language.wide.Structure (Univ A R' P' dt.KIx dt.dd)] [Finite A] [Finite R'] [Finite P'] [Finite dt.KIx] {h : IsLinOrd WMLe} {hord : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x y tagTupleLe x y} (u : dt.RegIx) :
        (regLaid h hord).blk u = tagBlk (↑u).1

        A register's block is the block of the element it stands for: the hblkP coherence, both sides being the tag's own block.

        Dependency graph
        theorem DescriptiveComplexity.Draw.Data.mono_regLaid {L : FirstOrder.Language} {dt : Data L} {A R' P' : Type} [LinearOrder A] [LinearOrder R'] [LinearOrder P'] [FirstOrder.Language.wide.Structure (Univ A R' P' dt.KIx dt.dd)] [Finite A] [Finite R'] [Finite P'] [Finite dt.KIx] {h : IsLinOrd WMLe} {hord : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x y tagTupleLe x y} (u u' : dt.RegIx) :
        WMLt (regLaid h hord).le u u' WMLt WMLe u u'

        The registers are ordered like the elements they stand for: the hmono coherence, which at this file is the channel's own agreement between the tag order and the address order.

        Dependency graph
        theorem DescriptiveComplexity.Draw.Data.up_regLaid {L : FirstOrder.Language} {dt : Data L} {A R' P' : Type} [LinearOrder A] [LinearOrder R'] [LinearOrder P'] [FirstOrder.Language.wide.Structure (Univ A R' P' dt.KIx dt.dd)] {hord : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x y tagTupleLe x y} (hargall : ∀ (x : Univ A R' P' dt.KIx dt.dd), (∃ (i : dt.KIx), x.1 = Tag.arg i)WMHasInp x) {u : dt.RegIx} (hu : dt.RegUse u) {x : Univ A R' P' dt.KIx dt.dd} (hlt : WMLt WMLe (↑u) x) :
        ∃ (u' : dt.RegIx), dt.RegUse u' u' = x

        Nothing above a used register escapes the file: the argument tags come last, so an element above an argument element is an argument element, and the reduction marks all of them. This is the hup coherence.

        Dependency graph
        theorem DescriptiveComplexity.Draw.Data.ixHolds_regLaid {L : FirstOrder.Language} {dt : Data L} {A R' P' : Type} [FirstOrder.Language.wide.Structure (Univ A R' P' dt.KIx dt.dd)] (hargall : ∀ (x : Univ A R' P' dt.KIx dt.dd), (∃ (i : dt.KIx), x.1 = Tag.arg i)WMHasInp x) {s : Univ A R' P' dt.KIx dt.ddProp} (hs : ∀ (x : Univ A R' P' dt.KIx dt.dd), s x∃ (i : dt.KIx), x.1 = Tag.arg i) :
        IxHolds (fun (u : dt.RegIx) => u) dt.RegUse s

        A logical address is held by the file's registers: the hvh coherence.

        Dependency graph
        theorem DescriptiveComplexity.Draw.Data.regUse_reg_regLaid {L : FirstOrder.Language} {dt : Data L} {A R' P' : Type} [LinearOrder A] [LinearOrder R'] [LinearOrder P'] [FirstOrder.Language.wide.Structure (Univ A R' P' dt.KIx dt.dd)] [Finite A] [Finite R'] [Finite P'] [Finite dt.KIx] {h : IsLinOrd WMLe} {hord : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x y tagTupleLe x y} (zero : A) (harg : ∀ (b : Fin dt.ko Fin dt.ki) (c : Fin dt.dd0A), WMHasInp (Tag.arg (toLex b), padTup zero c)) (b : Fin dt.ko Fin dt.ki) (c : Fin dt.dd0A) :
        dt.RegUse ((regLaid h hord).toLayout.reg b c)

        A named register is a used one: it stands for an argument element. This is the hxdUse the stage atom's destination registers ask for.

        Dependency graph

        What the file costs to walk #

        The number the register channel's walks are charged against: 2 ^ the number of registers, which is the size of the working region and the bound every address of the file is under.

        Equations
        Instances For
          Dependency graph
          theorem DescriptiveComplexity.Draw.Data.wideRank_regLaid_cell_lt {L : FirstOrder.Language} {dt : Data L} {A R' P' : Type} [LinearOrder A] [LinearOrder R'] [LinearOrder P'] [FirstOrder.Language.wide.Structure (Univ A R' P' dt.KIx dt.dd)] [Finite A] [Finite R'] [Finite P'] [Finite dt.KIx] (h : IsLinOrd WMLe) (hord : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x y tagTupleLe x y) (hup : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x yWMHasInp xWMHasInp y) (u : dt.RegIx) :
          wideRank ((regLaid h hord).cell u) < dt.regBound

          Every register of the file lies below the bound: its address is supported on the elements the channel writes for, and so is every address below it once those are upward closed.

          Dependency graph
          theorem DescriptiveComplexity.Draw.Data.gap_regLaid {L : FirstOrder.Language} {dt : Data L} {A R' P' : Type} [LinearOrder A] [LinearOrder R'] [LinearOrder P'] [FirstOrder.Language.wide.Structure (Univ A R' P' dt.KIx dt.dd)] [Finite A] [Finite R'] [Finite P'] [Finite dt.KIx] (h : IsLinOrd WMLe) (hord : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x y tagTupleLe x y) (hup : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x yWMHasInp xWMHasInp y) (u u' : dt.RegIx) :
          wideRank ((regLaid h hord).cell u') - wideRank ((regLaid h hord).cell u) dt.regBound

          A step of a walk over the file costs at most the bound: consecutive registers differ by one bit of the address, and the whole file is below the bound. This is the w of every budgeted walk, where a file laid on consecutive addresses has w = 1 and pays the difference in the number of registers instead.

          Dependency graph
          noncomputable def DescriptiveComplexity.Draw.Data.regW {L : FirstOrder.Language} (dt : Data L) {A R' P' : Type} [FirstOrder.Language.wide.Structure (Univ A R' P' dt.KIx dt.dd)] :

          The width a walk to a register is charged: twice the bound, plus two.

          Equations
          Instances For
            Dependency graph
            noncomputable def DescriptiveComplexity.Draw.Data.regWP {L : FirstOrder.Language} (dt : Data L) {A R' P' : Type} [FirstOrder.Language.wide.Structure (Univ A R' P' dt.KIx dt.dd)] :

            The width of the pass over the whole file: the file's two ends, the walk between them at one bound a step, and the marker's own address.

            Equations
            Instances For
              Dependency graph
              noncomputable def DescriptiveComplexity.Draw.Data.regWR {L : FirstOrder.Language} (dt : Data L) {A R' P' : Type} [FirstOrder.Language.wide.Structure (Univ A R' P' dt.KIx dt.dd)] :

              The width of a read below the file: an address under the first register is under the bound.

              Equations
              Instances For
                Dependency graph
                noncomputable def DescriptiveComplexity.Draw.Data.regWK {L : FirstOrder.Language} (dt : Data L) {A R' P' : Type} [FirstOrder.Language.wide.Structure (Univ A R' P' dt.KIx dt.dd)] :

                The width of a stage's inner loop: a pass per bit of the address it carries, each pass priced as regWP.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  Dependency graph
                  theorem DescriptiveComplexity.Draw.Data.hwP_regLaid {L : FirstOrder.Language} {dt : Data L} {A R' P' : Type} [LinearOrder A] [LinearOrder R'] [LinearOrder P'] [FirstOrder.Language.wide.Structure (Univ A R' P' dt.KIx dt.dd)] [Finite A] [Finite R'] [Finite P'] [Finite dt.KIx] (h : IsLinOrd WMLe) (hord : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x y tagTupleLe x y) (hup : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x yWMHasInp xWMHasInp y) (gtop gbot : dt.RegIx) :
                  wideRank ((regLaid h hord).cell gtop) + 2 + ((ixRank (regLaid h hord).le gtop - ixRank (regLaid h hord).le gbot) * dt.regBound + 1) + wideRank ((regLaid h hord).cell gbot) dt.regWP

                  The pass over the file fits regWP.

                  Dependency graph
                  theorem DescriptiveComplexity.Draw.Data.hwR_regLaid {L : FirstOrder.Language} {dt : Data L} {A R' P' : Type} [LinearOrder A] [LinearOrder R'] [LinearOrder P'] [FirstOrder.Language.wide.Structure (Univ A R' P' dt.KIx dt.dd)] [Finite A] [Finite R'] [Finite P'] [Finite dt.KIx] (h : IsLinOrd WMLe) (hord : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x y tagTupleLe x y) (hup : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x yWMHasInp xWMHasInp y) (gbot : dt.RegIx) (s : Univ A R' P' dt.KIx dt.ddProp) (hs : WMSetLt WMLe s ((regLaid h hord).cell gbot)) :

                  A read below the file fits regWR.

                  Dependency graph
                  theorem DescriptiveComplexity.Draw.Data.hwK_regLaid {L : FirstOrder.Language} {dt : Data L} {A R' P' : Type} [LinearOrder A] [LinearOrder R'] [LinearOrder P'] [FirstOrder.Language.wide.Structure (Univ A R' P' dt.KIx dt.dd)] [Finite A] [Finite R'] [Finite P'] [Finite dt.KIx] (h : IsLinOrd WMLe) (hord : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x y tagTupleLe x y) (hup : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x yWMHasInp xWMHasInp y) (gtop gbot : dt.RegIx) (T : Univ A R' P' dt.KIx dt.ddProp) (hT : WMSetLt WMLe T ((regLaid h hord).cell gbot)) :
                  wideRank T * (1 + (wideRank ((regLaid h hord).cell gtop) + 3 + (ixRank (regLaid h hord).le gtop - ixRank (regLaid h hord).le gbot) * dt.regBound + wideRank ((regLaid h hord).cell gbot)) + (wideRank ((regLaid h hord).cell gtop) + ((ixRank (regLaid h hord).le gtop - ixRank (regLaid h hord).le gbot) * dt.regBound + 1) + wideRank ((regLaid h hord).cell gbot) + 4)) + 1 + (wideRank ((regLaid h hord).cell gtop) + 3 + (ixRank (regLaid h hord).le gtop - ixRank (regLaid h hord).le gbot) * dt.regBound + wideRank ((regLaid h hord).cell gbot)) dt.regWK

                  A stage's inner loop fits regWK.

                  Dependency graph
                  theorem DescriptiveComplexity.Draw.Data.hcostR_regLaid {L : FirstOrder.Language} {dt : Data L} {A R' P' : Type} [LinearOrder A] [LinearOrder R'] [LinearOrder P'] [FirstOrder.Language.wide.Structure (Univ A R' P' dt.KIx dt.dd)] [Finite A] [Finite R'] [Finite P'] [Finite dt.KIx] (h : IsLinOrd WMLe) (hord : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x y tagTupleLe x y) (hup : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x yWMHasInp xWMHasInp y) (zero : A) (harg : ∀ (b : Fin dt.ko Fin dt.ki) (c : Fin dt.dd0A), WMHasInp (Tag.arg (toLex b), padTup zero c)) (v : Univ A R' P' dt.KIx dt.ddProp) (b : Fin dt.ko Fin dt.ki) (c : Fin dt.dd0A) :
                  2 * (wideRank ((regLaid h hord).cell ((regLaid h hord).toLayout.reg b c)) - wideRank v) + 2 dt.regW

                  A walk to a register fits regW.

                  Dependency graph

                  The file's two ends #

                  theorem DescriptiveComplexity.Draw.Data.exists_regTop {L : FirstOrder.Language} {dt : Data L} {A R' P' : Type} [LinearOrder A] [LinearOrder R'] [LinearOrder P'] [FirstOrder.Language.wide.Structure (Univ A R' P' dt.KIx dt.dd)] [Finite A] [Finite R'] [Finite P'] [Finite dt.KIx] (h : IsLinOrd WMLe) (hord : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x y tagTupleLe x y) (hne : ∃ (x : Univ A R' P' dt.KIx dt.dd), WMHasInp x) :
                  ∃ (g : dt.RegIx), ∀ (u : dt.RegIx), (regLaid h hord).le u g

                  The file has a greatest register, the marked elements being finitely many and linearly ordered.

                  Dependency graph
                  theorem DescriptiveComplexity.Draw.Data.exists_regBot {L : FirstOrder.Language} {dt : Data L} {A R' P' : Type} [LinearOrder A] [LinearOrder R'] [LinearOrder P'] [FirstOrder.Language.wide.Structure (Univ A R' P' dt.KIx dt.dd)] [Finite A] [Finite R'] [Finite P'] [Finite dt.KIx] (h : IsLinOrd WMLe) (hord : ∀ (x y : Univ A R' P' dt.KIx dt.dd), WMLe x y tagTupleLe x y) (hne : ∃ (x : Univ A R' P' dt.KIx dt.dd), WMHasInp x) :
                  ∃ (g : dt.RegIx), ∀ (u : dt.RegIx), (regLaid h hord).le g u

                  The file has a least register, the one the reduction places below the argument elements.

                  Dependency graph