A list program for the staged integer determinant #
Rational.DeterminantAlgorithm.determinant runs the stages of Bird's division-free determinant on
dense tables whose dimension is part of the type. This file restates the same staged algorithm as
an ordinary program on lists of rows, Rational.detRows, whose dimension is the number of rows,
and certifies that it is computable in polynomial time on multi-tape Turing machines over
framed lists of binary sign-magnitude integers (Rational.detRows_polytime). Missing entries read
as 0 and extra entries are ignored.
It also bounds the size of every value the program computes. For a d × d input whose entries
have absolute value below 2 ^ b, every entry of the k-th stage, and every partial sum and
product computed while producing it, has absolute value below 2 ^ (b + k * (1 + d + b)).
The bounds are also stated for the bit length Rational.intBits of a sign-magnitude binary
encoding, and, following the original development, for the stages of the dense tables.
Main definitions #
Rational.rowEntry: entry(i, j)of a list of rows,0when missing.Rational.rowsOf: the list of rows of a square matrix.Rational.stepRows,Rational.stagesRows: one Bird stage, and the iterated stages.Rational.detRows: the staged determinant of a list of rows.Rational.intBits: the bit length of a sign-magnitude binary integer.Rational.stageTableBound: upper bound on the encoded length of any stage table in the firstkBird stages.
Main results #
Rational.detRows_eq:detRows (rowsOf A) = A.det.Rational.detRows_eq_det_ofRows: on any list of rows,detRowsis the determinant of the square matrix it denotes, of dimension the number of rows.Rational.natAbs_rowEntry_stagesRows_lt,Rational.natAbs_stepEntryRows_lt,Rational.natAbs_traceTerms_take_sum_lt,Rational.natAbs_productTerms_take_sum_lt: the size bounds on stage entries and on the partial sums inside one stage.Rational.intBits_rowEntry_stagesRows_le: the stage bound in bit length.Rational.DeterminantAlgorithm.stages_power_bound: the stage bound for dense tables.Rational.length_encList_stagesRows_le: encoded length bound on intermediate stage tables.Rational.computableInPolyTime_stagesRows,Rational.detRows_polytime:stagesRowsanddetRowsare computable in polynomial time overencList (encList encIntBin).
References #
- The table bounds
step_bound,stages_boundandstages_power_boundare adapted from OpenAI's formalization [OAI26a] at revision adc7f1241b42e322a6451854ab7e4b4c146bf78a (file lean/OAI/Computability/RationalHitting/Determinant.lean), via the complexitylib port [Sch26d] at revision add0aca8ee0d71e68969f2cb45cf91554a50f787.
Bounds on the dense table stages #
The list program #
Entry (i, j) of one Bird stage, BirdDet.Spec.stepEntry, on lists of rows.
Instances For
The bit length of an integer in a sign-magnitude binary encoding: one sign bit followed by the binary digits of the absolute value.
Instances For
intBits z is the length of the binary sign-magnitude code of z.
Basic lemmas #
A tail of a range, summed as a list, is a tail sum over Fin.
Correctness #
The list program agrees with the staged determinant on dense tables.
Size bounds #
Every entry of the k-th stage of an input with entries below 2 ^ b in absolute value is
below 2 ^ (b + k * (1 + d + b)), where d is the number of rows.
Bounds in bit length #
The bit-length bound on every value computed in one stage: prefix sums of both term lists, the trace product and the new entry.
Polynomial-time certificate #
Upper bound on the bit length of any entry in the first k Bird stages of a matrix of encoded
length L.
Instances For
Upper bound on the encoded length of any row in the first k Bird stages of a matrix of
encoded length L.
Instances For
Upper bound on the encoded length of any stage table in the first k Bird stages of a matrix
of encoded length L.
Instances For
Every stage table up to stage k has encoded length bounded by stageTableBound.
Matrix entry lookup on a list of rows is polynomial-time.
Tabulating a d × d matrix of binary integers from a unary dimension is polynomial-time.
Padding or truncating a list of rows to a square table is polynomial-time.
Computing the diagonal terms summed in one Bird stage is polynomial-time.
Computing the product terms summed in one Bird stage is polynomial-time.
Computing one entry of a Bird stage is polynomial-time.
One Bird stage on lists of rows is polynomial-time.
Iterating k Bird stages on a list of rows is polynomial-time for a unary stage count k.
The staged division-free integer determinant detRows is computable in polynomial
time on lists of rows of binary sign-magnitude integers.