Documentation

Complexity.Computability.Circuit.Rational.Runtime.Point

Pointwise normalization and encoding in polynomial time #

At each point (t, p, r) of the three-dimensional integer grid, the executable hitting-list generator materializes the n + 1 integer lift matrices [U₀, U₁, …, Uₙ], tests whether det U₀ = 0, and when det U₀ ≠ 0 computes every entry of each normalized matrix U₀⁻¹ * Uₐ as the reduced rational ratio of two integer determinants via Cramer's rule, before serializing the resulting tuple with encodeTuple.

This module expresses that per-point pipeline directly on the list-of-rows tables produced by liftRows and certifies that it runs in polynomial time on a multi-tape Turing machine:

Main definitions #

Main results #

References #

List-level Cramer normalization and tuple encoding #

Replace column colA of A with column colB of B, producing an A.length × A.length list of rows.

Instances For

    Encoded reduced-rational (i, j)-entry of A⁻¹ * B given the common denominator den, computed by Cramer's rule and detRows.

    Instances For

      Encoded d × d rational matrix A⁻¹ * B in row-major order given the common denominator den, where d = A.length.

      Instances For

        Encoded tuple of n normalized rational matrices from a list tables of n + 1 integer tables [U₀, U₁, …, Uₙ] and the common denominator den.

        Instances For

          Emit the encoded normalized tuple for a list of integer tables [U₀, U₁, …, Uₙ], or [] when detRows U₀ = 0.

          Instances For

            Singleton list [tupleWord tables den] when detRows (tables.headD []) ≠ 0, and [] when singular; used to enumerate grid points by List.flatMap.

            Instances For

              Encoded normalized tuple at the grid coordinates (t, p, r), or [] if singular.

              Instances For

                Singleton list containing the encoded normalized tuple at (t, p, r) when nonsingular, or [] when singular.

                Instances For

                  Agreement with the executable generator #

                  theorem Cslib.Circuits.Rational.cramerRows_eq {d : ℕ} (A B : Matrix (Fin d) (Fin d) ℤ) (i j : Fin d) :
                  cramerRows (rowsOf A) (rowsOf B) ↑i ↑j = rowsOf (A.updateCol i fun (r : Fin d) => B r j)

                  cramerRows on rowsOf computes the rows of Matrix.updateCol.

                  matrixEntryWord agrees with encodeRat (ExecutableGenerator.normalizedEntry A B den i j).

                  matrixWord serializes all d × d entries of ExecutableGenerator.normalizedEntry A B den.

                  tupleWord on the row lists of A equals encodeTuple on the normalized tuple.

                  pointWordOfTables on the row lists of A tests determinant (A.get 0) = 0 and encodes the normalized tuple when nonsingular.

                  pointWordsOfTables on the row lists of A produces [] when singular and the singleton encoded tuple when nonsingular.

                  pointWord at (x 0, x 1, x 2) agrees with ExecutableGenerator.atPoint n N e x followed by encodeTuple.

                  pointWords at (x 0, x 1, x 2) agrees with ((ExecutableGenerator.atPoint n N e x).map encodeTuple).toList.

                  Polynomial-time certificates #

                  Encoding a tuple of normalized rational matrices from tables and den is polynomial-time.