Documentation

DescriptiveComplexity.Problems.Wide.DrawEnc

Encoding the points of an expansion as block values #

A point of an exponential expansion is a tag together with an assignment of the expansion's block – an exponential object. The EXPSPACE reduction stores one point per argument block of a machine address, so it needs an injective encoding of points as block values, the subsets of the tuple space Fin dd → A an address holds at one tag.

The encoding is a set of tuples, each carrying a discrete code and a payload laid out at fixed coordinates (DescriptiveComplexity.Draw.EncLayout fixes the coordinates, DescriptiveComplexity.Draw.encTup writes one tuple):

The discrete code is one-hot in the two designated elements, so DescriptiveComplexity.Draw.encTup_code_inj reads the code back and DescriptiveComplexity.Draw.encPt_injective makes the whole encoding injective; DescriptiveComplexity.Draw.mem_encPt_asg reads one bit of the assignment off one membership question, which is the form the machine's register lookups take. DescriptiveComplexity.Draw.IsEncbeing the encoding of a point of the expanded universe – is the condition the relativization lemma of DescriptiveComplexity.Problems.Wide.DrawRel asks for (DescriptiveComplexity.Draw.isEnc_iff).

The layout of one tuple #

The coordinates of an encoded tuple: where the discrete code sits, where the payload sits, disjointly. The reduction instantiates this once, with explicit arithmetic; everything else reads the coordinates through it.

  • cIx : DFin dd

    The coordinate of each component of the one-hot discrete code.

  • pIx : Fin a'Fin dd

    The coordinate of each payload position.

  • Code coordinates are distinct.

  • Payload coordinates are distinct.

  • disj (q : D) (p : Fin a') : self.cIx q self.pIx p

    Code and payload coordinates are disjoint.

Instances For
    Dependency graph
    noncomputable def DescriptiveComplexity.Draw.encTup {D : Type} {a' dd : } (ly : EncLayout D a' dd) {A : Type} (zero one : A) (d : D) (pay : Fin a'A) :
    Fin ddA

    One encoded tuple: the one-hot code of the discrete datum at the code coordinates, the payload at the payload coordinates, the designated zero everywhere else.

    Equations
    Instances For
      Dependency graph
      theorem DescriptiveComplexity.Draw.encTup_cIx {D : Type} {a' dd : } {ly : EncLayout D a' dd} {A : Type} {zero one : A} (d q : D) (pay : Fin a'A) :
      encTup ly zero one d pay (ly.cIx q) = if q = d then one else zero

      The code coordinates of an encoded tuple spell the one-hot code.

      Dependency graph
      theorem DescriptiveComplexity.Draw.encTup_pIx {D : Type} {a' dd : } {ly : EncLayout D a' dd} {A : Type} {zero one : A} (d : D) (pay : Fin a'A) (p : Fin a') :
      encTup ly zero one d pay (ly.pIx p) = pay p

      The payload coordinates of an encoded tuple spell the payload.

      Dependency graph
      theorem DescriptiveComplexity.Draw.encTup_of_ne {D : Type} {a' dd : } {ly : EncLayout D a' dd} {A : Type} {zero one : A} (d : D) (pay : Fin a'A) {j : Fin dd} (hc : ∀ (q : D), ly.cIx q j) (hp : ∀ (p : Fin a'), ly.pIx p j) :
      encTup ly zero one d pay j = zero

      The remaining coordinates of an encoded tuple hold the designated zero.

      Dependency graph
      theorem DescriptiveComplexity.Draw.encTup_code_inj {D : Type} {a' dd : } {ly : EncLayout D a' dd} {A : Type} {zero one : A} (hne : zero one) {d d' : D} {pay pay' : Fin a'A} (h : encTup ly zero one d pay = encTup ly zero one d' pay') :
      d = d'

      The code reads back: two encoded tuples that are equal carry the same discrete datum.

      Dependency graph
      theorem DescriptiveComplexity.Draw.encTup_pay_inj {D : Type} {a' dd : } {ly : EncLayout D a' dd} {A : Type} {zero one : A} {d d' : D} {pay pay' : Fin a'A} (h : encTup ly zero one d pay = encTup ly zero one d' pay') :
      pay = pay'

      The payload reads back: two encoded tuples that are equal carry the same payload.

      Dependency graph

      The encoding of a point #

      @[reducible, inline]

      The discrete data an encoded tuple can carry: either the witness of a tag – the tuple every encoding carries, and the only place a tag appears – or the relation variable of the block whose tuple the payload is.

      The tag is deliberately not in a member's code. It is what makes «this block value is well-shaped» a question about one cell and nothing else, so the machine's gate can ask it of every cell by a file test: a member of a foreign tag is not merely rejected, it does not exist. What is left for the control is «exactly one witness», and the machine reads every tag's witness cell anyway.

      Equations
      Instances For
        Dependency graph
        noncomputable def DescriptiveComplexity.Draw.encAsgTup {L : FirstOrder.Language} {X : ExpExpansion L} {dd : } (ly : EncLayout (PtCode X) (blockArityBound X.B) dd) {A : Type} (zero one : A) (i : X.B.ι) (w : Fin (X.B.arity i)A) :
        Fin ddA

        One member tuple of an encoded point: the relation variable in the code, the variable's tuple in the payload, canonically padded to the block's arity bound.

        Equations
        Instances For
          Dependency graph
          noncomputable def DescriptiveComplexity.Draw.encTagTup {L : FirstOrder.Language} {X : ExpExpansion L} {dd : } (ly : EncLayout (PtCode X) (blockArityBound X.B) dd) {A : Type} (zero one : A) (t : X.Tag) :
          Fin ddA

          The tag witness of an encoded point: the one tuple that carries the tag.

          Equations
          Instances For
            Dependency graph
            noncomputable def DescriptiveComplexity.Draw.encPt {L : FirstOrder.Language} {X : ExpExpansion L} {dd : } (ly : EncLayout (PtCode X) (blockArityBound X.B) dd) {A : Type} (zero one : A) (p : X.Point A) :
            (Fin ddA)Prop

            The encoding of a point as a block value: the tag witness, plus one member tuple per tuple of the assignment.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              Dependency graph
              theorem DescriptiveComplexity.Draw.not_encPt_zeroTup {L : FirstOrder.Language} {X : ExpExpansion L} {dd : } (ly : EncLayout (PtCode X) (blockArityBound X.B) dd) {A : Type} {zero one : A} (hne : zero one) (p : X.Point A) :
              ¬encPt ly zero one p fun (x : Fin dd) => zero

              An encoding is never everything: every member of it carries a one-hot code, so the all-zero tuple is not one. This is what puts a tuple's address strictly below the logical top – the top's blocks are full.

              Dependency graph
              theorem DescriptiveComplexity.Draw.encPt_tagTup {L : FirstOrder.Language} {X : ExpExpansion L} {dd : } (ly : EncLayout (PtCode X) (blockArityBound X.B) dd) {A : Type} {zero one : A} (p : X.Point A) :
              encPt ly zero one p (encTagTup ly zero one p.1)

              The tag witness belongs to the encoding.

              Dependency graph
              theorem DescriptiveComplexity.Draw.mem_encPt_tag {L : FirstOrder.Language} {X : ExpExpansion L} {dd : } (ly : EncLayout (PtCode X) (blockArityBound X.B) dd) {A : Type} {zero one : A} (hne : zero one) (p : X.Point A) (t : X.Tag) :
              encPt ly zero one p (encTagTup ly zero one t) p.1 = t

              A membership question at a tag witness reads the tag: the tag witness of t belongs to the encoding of p exactly when p carries the tag t.

              Dependency graph
              theorem DescriptiveComplexity.Draw.mem_encPt_asg {L : FirstOrder.Language} {X : ExpExpansion L} {dd : } (ly : EncLayout (PtCode X) (blockArityBound X.B) dd) {A : Type} {zero one : A} (hne : zero one) (p : X.Point A) (i : X.B.ι) (w : Fin (X.B.arity i)A) :
              encPt ly zero one p (encAsgTup ly zero one i w) p.2 i w

              A membership question at a member tuple reads one bit of the assignment: the member tuple of (t, i, w) belongs to the encoding of p exactly when p carries the tag t and its assignment holds of w at i. This is the form the machine's register lookups take.

              Dependency graph
              theorem DescriptiveComplexity.Draw.encPt_injective {L : FirstOrder.Language} {X : ExpExpansion L} {dd : } (ly : EncLayout (PtCode X) (blockArityBound X.B) dd) {A : Type} {zero one : A} (hne : zero one) :

              The encoding is injective on points.

              Dependency graph

              The gate #

              noncomputable def DescriptiveComplexity.Draw.encMap {L : FirstOrder.Language} {X : ExpExpansion L} {dd : } (ly : EncLayout (PtCode X) (blockArityBound X.B) dd) {A : Type} (zero one : A) [L.Structure A] [LinearOrder A] (m : X.Map A) :
              (Fin ddA)Prop

              The encoding of a point of the expanded universe: the domain condition is carried by the subtype, so this is the map whose image the machine's gates carve out.

              Equations
              Instances For
                Dependency graph
                def DescriptiveComplexity.Draw.IsEnc {L : FirstOrder.Language} {X : ExpExpansion L} {dd : } (ly : EncLayout (PtCode X) (blockArityBound X.B) dd) {A : Type} (zero one : A) [L.Structure A] [LinearOrder A] (S : (Fin ddA)Prop) :

                Being an encoding: the gate of the relativization – a block value passes exactly when it encodes a point of the expanded universe, domain condition included.

                Equations
                Instances For
                  Dependency graph
                  theorem DescriptiveComplexity.Draw.encMap_injective {L : FirstOrder.Language} {X : ExpExpansion L} {dd : } (ly : EncLayout (PtCode X) (blockArityBound X.B) dd) {A : Type} {zero one : A} [L.Structure A] [LinearOrder A] (hne : zero one) :

                  The encoding of the expanded universe is injective.

                  Dependency graph
                  theorem DescriptiveComplexity.Draw.isEnc_iff {L : FirstOrder.Language} {X : ExpExpansion L} {dd : } (ly : EncLayout (PtCode X) (blockArityBound X.B) dd) {A : Type} {zero one : A} [L.Structure A] [LinearOrder A] (S : (Fin ddA)Prop) :
                  IsEnc ly zero one S ∃ (m : X.Map A), encMap ly zero one m = S

                  The gate is the image of the encoding, in the orientation the relativization lemma asks for.

                  Dependency graph