Documentation

Complexity.Computability.Circuit.Boolean.Iteration.CounterChart.Encode

Sparse orbit coordinates from interval labels #

Each interval stores its cycle representative, cycle length, and the phase of its first state. One modular addition encodes its other states. Decoding tests the phase distance from each interval start. This proves a chart without an enumeration of payload states or an assumed constant-time table primitive.

Main definitions #

Main results #

References #

@[instance_reducible]

Numeric order chooses canonical representatives of word cycles. Kept local to charts.

Instances For
    @[reducible, inline]

    Two spare bits hold cycle lengths and sums even for a cycle of length 2^n.

    Instances For
      noncomputable def Cslib.Circuits.Boolean.Iteration.wordCycleLabel {n : ℕ} (f : BitVec n → BitVec n) (x : BitVec n) :

      Canonical coordinates of a cyclic word.

      Instances For

        The first word of an interval.

        Instances For

          Cycle length of the interval, in the widened coordinate width.

          Instances For

            Canonical phase of the interval start.

            Instances For

              Number of words in an interval.

              Instances For
                @[simp]
                theorem Cslib.Circuits.Boolean.Iteration.CounterIntervalChart.length_toNat {n R : ℕ} {f : BitVec n → BitVec n} (chart : CounterIntervalChart f R) (j : Fin R) :
                (chart.length j).toNat = chart.stop j - chart.start j

                Test membership in the half-open numerical interval.

                Instances For
                  @[simp]
                  theorem Cslib.Circuits.Boolean.Iteration.CounterIntervalChart.contains_iff {n R : ℕ} {f : BitVec n → BitVec n} (chart : CounterIntervalChart f R) (j : Fin R) (x : BitVec n) :
                  chart.contains j x = true ↔ chart.start j ≤ x.toNat ∧ x.toNat < chart.stop j

                  Numerical distance from the interval start.

                  Instances For
                    theorem Cslib.Circuits.Boolean.Iteration.CounterIntervalChart.offset_toNat {n R : ℕ} {f : BitVec n → BitVec n} (chart : CounterIntervalChart f R) (j : Fin R) (x : BitVec n) (hx : chart.start j ≤ x.toNat) :
                    (chart.offset j x).toNat = x.toNat - chart.start j

                    Canonical coordinates predicted by one interval.

                    Instances For

                      Encode by selecting any interval containing the input.

                      Instances For