Documentation

Complexity.Logics.FirstOrder.Ordered.BitSum.Encoding

Native access to packed bit-sum trees #

Eight first-order variables represent eight fixed-width bit strings. Their access formula uses a fixed disjunction and fixed chains of PLUS formulas, never a variable multiplication relation. The tree address uses the proved exact shift formula. Node decoding constrains all bits above the node's level to zero.

Main definitions #

Main results #

References #

noncomputable def Cslib.Logic.FO.Ordered.BitSum.treeAddress (L : FirstOrder.Language) {α : Type u_1} (m j b q a : (language L).Term α) :

A bit-plane address, using only PLUS, a literal three, and an exact binary shift.

Instances For
    noncomputable def Cslib.Logic.FO.Ordered.BitSum.packedBit (L : FirstOrder.Language) {α : Type u_1} (h : (language L).Term α) (w : Fin 8 → (language L).Term α) (a : (language L).Term α) :

    Read an address in eight fixed-width words. The eight scales are syntactic literals.

    Instances For
      noncomputable def Cslib.Logic.FO.Ordered.BitSum.nodeValue (L : FirstOrder.Language) {α : Type u_1} (m h : (language L).Term α) (w : Fin 8 → (language L).Term α) (j q z : (language L).Term α) :

      Decode the whole node value, explicitly zeroing all bits above its level.

      Instances For
        def Cslib.Logic.FO.Ordered.BitSum.EncodesNode (m h : ℕ) (w : Fin 8 → ℕ) (j q z : ℕ) :

        The explicit bitwise meaning of the packed node decoder.

        Instances For
          theorem Cslib.Logic.FO.Ordered.BitSum.EncodesNode.unique {m h : ℕ} {w : Fin 8 → ℕ} {j q z z' : ℕ} (hz : EncodesNode m h w j q z) (hz' : EncodesNode m h w j q z') :
          z = z'

          A packed node has at most one value, including all its high bits.

          theorem Cslib.Logic.FO.Ordered.BitSum.encodesNode_sumTree (f : ℕ → Bool) {m h j q : ℕ} (hspace : 4 * 2 ^ m ≤ 8 * h) (hj : j ≤ m) (hq : q < 2 ^ (m - j)) :

          The actual packed tree decodes to the actual sum at every valid node.

          @[simp]

          treeAddress L m j b q a holds exactly when j ≤ m and a is the address BitString.sumTreeAddress m j b q.

          @[simp]
          theorem Cslib.Logic.FO.Ordered.BitSum.realize_packedBit {L : FirstOrder.Language} {n : ℕ} [Fact (2 ≤ n)] [L.Structure (Fin n)] {α : Type u_1} (h : (language L).Term α) (w : Fin 8 → (language L).Term α) (a : (language L).Term α) (v : α → Fin n) :

          packedBit L h w a holds exactly when position a falls in one of the eight words w, of width h, at a set bit.

          When j ≤ m and eight words of width h fit in the universe, nodeValue L m h w j q z holds exactly when the words encode the value z at node j (EncodesNode).