Documentation

Complexitylib.Classes.PCP.Internal.TowerTable

The tower's rotation table #

TowerFin gives the tower's rotation map as arithmetic on numbers; this module runs that arithmetic. A level is held as a table — one record for each vertex and dart, holding the vertex reached and the label to come back by, both in unary — and one level is computed from the one below by writing a new table whose every record needs two lookups in the old one.

The base graph's own rotation map is a table on a bounded key, so it is polynomial time however it was chosen (FiniteKey).

Main definitions #

Main results #

theorem Complexity.mul_add_div_of_lt {a b c : } (hc : 0 < c) (h : b < c) :
(a * c + b) / c = a
theorem Complexity.mul_add_mod_of_lt {a b c : } (h : b < c) :
(a * c + b) % c = b

The table #

noncomputable def Complexity.FinBase.tableList (F : FinBase) (k : ) :

The records of the level-k table: for each vertex and dart, the vertex reached and the label pointing back, both in unary.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    @[simp]
    noncomputable def Complexity.FinBase.table (F : FinBase) (k : ) :

    The level-k table.

    Equations
    Instances For
      theorem Complexity.FinBase.tableFst_table (F : FinBase) {k j : } (hj : j < F.size k * F.deg ^ 2) :
      tableFst (F.table k) j = List.replicate (F.rotVal k (j / F.deg ^ 2, j % F.deg ^ 2)).1 true
      theorem Complexity.FinBase.tableSnd_table (F : FinBase) {k j : } (hj : j < F.size k * F.deg ^ 2) :
      tableSnd (F.table k) j = List.replicate (F.rotVal k (j / F.deg ^ 2, j % F.deg ^ 2)).2 true

      The base graph's own table #

      noncomputable def Complexity.FinBase.baseRaw (F : FinBase) (z : List Bool) :

      The record the base's rotation map gives, before the key is bounded.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        How long an argument to the base's table can be.

        Equations
        Instances For
          noncomputable def Complexity.FinBase.baseRec (F : FinBase) (z : List Bool) :

          The base's rotation map, as a record.

          Equations
          Instances For

            One record of the next level #

            noncomputable def Complexity.FinBase.stepRec (F : FinBase) (z : List Bool) :

            One record of the level above, from the table below. The argument is pair table (unary index): the index splits into a vertex and a dart, the vertex into a vertex of the level below and a base vertex, and the dart into two base darts.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              theorem Complexity.FinBase.stepRec_eq (F : FinBase) {k j : } (hj : j < F.size (k + 1) * F.deg ^ 2) :
              F.stepRec (pair (F.table k) (List.replicate j true)) = encPair (List.replicate (F.rotVal (k + 1) (j / F.deg ^ 2, j % F.deg ^ 2)).1 true) (List.replicate (F.rotVal (k + 1) (j / F.deg ^ 2, j % F.deg ^ 2)).2 true)

              The record rule computes the level above.

              One level of the table #

              noncomputable def Complexity.FinBase.tableStep (F : FinBase) (T : List Bool) :

              One level of the table: write out every record of the level above.

              Equations
              Instances For
                theorem Complexity.FinBase.length_table_le (F : FinBase) (l : ) :
                (F.table l).length 2 + F.size l * F.deg ^ 2 * (4 * F.size l + 4 * F.deg ^ 2 + 6)

                How long a level's table is: one record a vertex and dart, and a record holds two numbers below the level's size.

                Climbing to a level #

                theorem Complexity.FinBase.table_mem_FP (F : FinBase) {ruler width : List BoolList Bool} (hr : ruler FP) (hw : width FP) (hbound : ∀ (z : List Bool), l(ruler z).length, (F.table l).length (width z).length) :
                (fun (z : List Bool) => F.table (ruler z).length) FP

                The table of a requested level is polynomial time, as soon as there is room to write it down.