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:
cramerRows A B colA colBreplaces columncolAofAby columncolBofB;matrixEntryWord A B den i jencodesRat.divInt (detRows (cramerRows A B i j)) den;matrixWord A B denandtupleWord tables denserialize one normalized matrix and the full tuple ofnnormalized matrices;pointWordOfTables,pointWordsOfTables,pointWord, andpointWordsperform the singularity test onU₀and emit the encoded tuple (or[]when singular).
Main definitions #
Cslib.Circuits.Rational.cramerRows: column replacement on lists of integer rows.Cslib.Circuits.Rational.matrixEntryWord,Cslib.Circuits.Rational.matrixWord,Cslib.Circuits.Rational.tupleWord: encoded entry, matrix, and tuple from integer row tables and a common denominator.Cslib.Circuits.Rational.pointWordOfTables,Cslib.Circuits.Rational.pointWordsOfTables,Cslib.Circuits.Rational.pointWord,Cslib.Circuits.Rational.pointWords: the singularity-tested encoded tuple at a grid point, as a bit word and as a singleton-or-empty list of bit words.
Main results #
Cslib.Circuits.Rational.cramerRows_eq:cramerRowsagrees withMatrix.updateColonrowsOf.Cslib.Circuits.Rational.matrixEntryWord_eq,Cslib.Circuits.Rational.matrixWord_eq,Cslib.Circuits.Rational.tupleWord_eq: agreement withExecutableGenerator.normalizedEntry,ExecutableGenerator.normalized, andencodeTuple.Cslib.Circuits.Rational.pointWord_eq,Cslib.Circuits.Rational.pointWords_eq:pointWordandpointWordsagree withExecutableGenerator.atPointcomposed withencodeTuple.Cslib.Circuits.Rational.computableInPolyTime_cramerRows,Cslib.Circuits.Rational.computableInPolyTime_matrixEntryWord,Cslib.Circuits.Rational.computableInPolyTime_matrixWord,Cslib.Circuits.Rational.computableInPolyTime_tupleWord,Cslib.Circuits.Rational.pointWordOfTables_polytime,Cslib.Circuits.Rational.pointWordsOfTables_polytime,Cslib.Circuits.Rational.computableInPolyTime_pointWord,Cslib.Circuits.Rational.computableInPolyTime_pointWords,Cslib.Circuits.Rational.pointWord_polytime: polynomial-time certificates for the per-point pipeline.
References #
List-level Cramer normalization and tuple encoding #
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
Agreement with the executable generator #
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 #
Column replacement cramerRows is polynomial-time.
Encoding one normalized rational entry via Cramer's rule and detRows is polynomial-time.
Encoding a full normalized rational matrix is polynomial-time.
Encoding a tuple of normalized rational matrices from tables and den is polynomial-time.
Singularity-tested tuple encoding on a list of integer tables is polynomial-time.
Compositional polynomial-time certificate for pointWordOfTables.
Singularity-tested singleton-or-empty tuple encoding on a list of integer tables is polynomial-time.
Compositional polynomial-time certificate for pointWordsOfTables.
Computing the encoded normalized tuple at a grid point is polynomial-time.
Computing the singleton-or-empty list of encoded tuples at a grid point is polynomial-time.
Standalone polynomial-time certificate for pointWord on a 7-tuple of unary naturals.