Executable confluent Hermite Cramer recovery #
Executable list-of-rows builders and plain Turing.MultiTapeTM.ComputableInPolyTime certificates
for recovering the integer constant term H(0) = (H_zero : ℚ) of a rational polynomial
H ∈ ℚ[X] with H.natDegree < N (N = nodes.length * J) from a nodes.length × J table jets
(jets.length = nodes.length, each row of length J) of integer-scaled order-J Taylor jets
Ω · [z ^ j] H(t_i + z) with nonzero scale Ω ≠ 0 at distinct integer nodes
nodes = [t_0, …, t_{Q-1}] (nodes.Nodup).
Following Appendix B.3, equation (B.1), of [OAI26c], hermiteRows nodes J tabulates the
N × N integer confluent Vandermonde matrix V (Polynomial.hermiteMatrix), cramerColZeroRows
replaces column 0 with the flattened scaled jet vector b = Ω y to form V_{(0)}, and
hermiteRecoverZero evaluates N_H = detRows V_{(0)} and D_H = detRows V via the division-free
staged determinant of Complexity/Computability/Circuit/Rational/Runtime/Determinant.lean
before performing the single total integer
division N_H / (Ω · D_H) (Int.ediv, exact when nodes.Nodup and Ω ≠ 0, and returning 0
when Ω = 0 or D_H = 0). hermiteRecoverModPowTwo composes this recovery with Int.modPowTwo
to extract bounded counts modulo 2 ^ ℓ.
Main definitions #
Cslib.Circuits.Rational.hermiteRows: executable(nodes.length * J) × (nodes.length * J)integer confluent Vandermonde matrix asList (List ℤ).Cslib.Circuits.Rational.cramerColZeroRows: replace column0of each rowkwithrhs[k].Cslib.Circuits.Rational.hermiteRecoverZero: recover integerH(0) = det V_{(0)} / (Ω · det V)for nonzeroΩ ≠ 0and distinctnodesviadetRowsand totalInt.ediv(returning0whenΩ = 0ordet V = 0).Cslib.Circuits.Rational.hermiteRecoverModPowTwo: recover the least nonnegative residue of integerH(0)modulo2 ^ ℓunder the sameΩ ≠ 0,nodes.Nodup, degree, and jet-shape hypotheses.
Main results #
Cslib.Circuits.Rational.length_hermiteRows,Cslib.Circuits.Rational.length_of_mem_hermiteRows,Cslib.Circuits.Rational.length_cramerColZeroRows,Cslib.Circuits.Rational.length_of_mem_cramerColZeroRows: shape well-formedness.Cslib.Circuits.Rational.ofRows_hermiteRows,Cslib.Circuits.Rational.detRows_hermiteRows,Cslib.Circuits.Rational.detRows_hermiteRows_ne_zero:ofRowsanddetRowsagreement withPolynomial.hermiteMatrixand nonsingularity fornodes.Nodup.Cslib.Circuits.Rational.detRows_cramerColZeroRows_eq_mul_eval_zero,Cslib.Circuits.Rational.hermiteRecoverZero_eq_of_rowEntry,Cslib.Circuits.Rational.hermiteRecoverZero_eq,Cslib.Circuits.Rational.hermiteRecoverModPowTwo_eq,Cslib.Circuits.Rational.modPowTwo_sum_hermiteRecoverZero_eq: exact Cramer numerator identity and integer / modular recovery ofH(0)and coordinate sums.Cslib.Circuits.Rational.intBits_tdiv_le,Cslib.Circuits.Rational.intBits_ediv_le,Cslib.Circuits.Rational.intBits_emod_le_of_ne_zero,Cslib.Circuits.Rational.intBits_emod_le_add_one_of_ne_zero,Cslib.Circuits.Rational.intBits_emod_le_max,Cslib.Circuits.Rational.intBits_modPowTwo_le,Cslib.Circuits.Rational.intBits_le_of_mem_hermiteRows,Cslib.Circuits.Rational.intBits_le_of_mem_cramerColZeroRows: sign-magnitude bit-length bounds for division, modular reduction, and Hermite/Cramer table entries.Cslib.Circuits.Rational.computableInPolyTime_hermiteRows,Cslib.Circuits.Rational.hermiteRows_polytime,Cslib.Circuits.Rational.computableInPolyTime_cramerColZeroRows,Cslib.Circuits.Rational.cramerColZeroRows_polytime,Cslib.Circuits.Rational.computableInPolyTime_hermiteRecoverZero,Cslib.Circuits.Rational.hermiteRecoverZero_polytime,Cslib.Circuits.Rational.computableInPolyTime_hermiteRecoverModPowTwo,Cslib.Circuits.Rational.hermiteRecoverModPowTwo_polytime,Cslib.Circuits.Rational.computableInPolyTime_modPowTwo_sum_hermiteRecoverZero: plain polynomial-time certificates.
References #
Executable list-of-rows builders #
The (nodes.length * J) × (nodes.length * J) integer confluent Vandermonde (Hermite) matrix
at nodes of uniform order J, stored in row-major (node, jet-order) order: row i * J + j
and column m holds (m.choose j : ℤ) * nodes[i] ^ (m - j), which vanishes for m < j.
Instances For
Recover the integer value H(0) = (H_zero : ℚ) of H ∈ ℚ[X] with
H.natDegree < nodes.length * J from a nodes.length × J table jets
(jets.length = nodes.length, each row of length J) of its Ω-scaled order-J Taylor jets
with nonzero scale Ω ≠ 0 at distinct integer nodes (nodes.Nodup), via Cramer's rule,
detRows, and total Int.ediv (returning 0 when Ω = 0 or
detRows (hermiteRows nodes J) = 0; see hermiteRecoverZero_eq).
Instances For
Recover the least nonnegative residue of integer H(0) modulo 2 ^ ℓ from Ω-scaled
order-J Taylor jets jets under the hypotheses of hermiteRecoverZero_eq (nodes.Nodup,
Ω ≠ 0, H.natDegree < nodes.length * J, integer H(0), and nodes.length × J jet shape; see
hermiteRecoverModPowTwo_eq).
Instances For
Shape and well-formedness #
hermiteRows nodes J has nodes.length * J rows.
Every row of hermiteRows nodes J has length nodes.length * J.
cramerColZeroRows mat rhs preserves the number of rows of mat.
If every row of mat has length mat.length, then every row of cramerColZeroRows mat rhs
has length mat.length.
Every row of cramerColZeroRows (hermiteRows nodes J) rhs has length nodes.length * J.
Agreement with Polynomial.hermiteMatrix and Matrix.updateCol #
Entry (finProdFinEquiv r, finProdFinEquiv c) of hermiteRows nodes J equals entry (r, c)
of Polynomial.hermiteMatrix.
ofRows (hermiteRows nodes J) is Polynomial.hermiteMatrix reindexed along
finProdFinEquiv.
detRows (hermiteRows nodes J) equals the determinant of Polynomial.hermiteMatrix.
At distinct integer nodes (nodes.Nodup), detRows (hermiteRows nodes J) is nonzero.
For nonempty mat, ofRows (cramerColZeroRows mat rhs) is (ofRows mat).updateCol 0
reindexed along length_cramerColZeroRows.
detRows of cramerColZeroRows (hermiteRows nodes J) jets.flatten equals the determinant of
Polynomial.hermiteMatrix with column (0, 0) replaced by (i, j) ↦ rowEntry jets i j.
Exact Cramer recovery of H(0) #
Exact integer Cramer identity for scaled Taylor jets: without any distinctness or nonzero-scale
assumption, detRows (cramerColZeroRows (hermiteRows nodes J) jets.flatten) equals
(Ω * detRows (hermiteRows nodes J)) * H_zero.
Exact confluent Hermite Cramer recovery (rowEntry form). When nodes are distinct,
Ω ≠ 0, H ∈ ℚ[X] has natDegree < nodes.length * J and integer value H(0) = H_zero, and
jets holds the Ω-scaled order-J Taylor jets at nodes, hermiteRecoverZero returns
H_zero.
Exact confluent Hermite Cramer recovery (getElem form, [OAI26c] eq. (B.1)).
Modular recovery of a count count ∈ [0, 2 ^ ℓ) congruent to H(0) modulo 2 ^ ℓ.
Multi-coordinate count recovery modulo 2 ^ ℓ ([OAI26c], Appendix B.3): summing the
recovered integer constant terms H_s(0) across coordinates and reducing modulo 2 ^ ℓ yields
count whenever 0 ≤ count < 2 ^ ℓ and 2 ^ ℓ ∣ ∑_s H_s(0) - count.
Entry magnitude and bit-length bounds #
If every node in nodes has magnitude below 2 ^ b, then every entry of
hermiteRows nodes J has magnitude strictly below 2 ^ ((nodes.length * J) * (b + 1)).
Entry bit-length bound for hermiteRows: if every node has intBits t ≤ b + 1, then every
entry z of hermiteRows nodes J satisfies intBits z ≤ (nodes.length * J) * (b + 1) + 1.
Entry bit-length bound for cramerColZeroRows: replacing column 0 with rhs preserves any
common bit-length bound on mat and rhs.
Plain polynomial-time certificates #
Constructing hermiteRows (nodes x) (J x) from binary integer nodes and a unary order J is
computable in polynomial time.
hermiteRows is computable in polynomial time on encPair (encList encIntBin) encUnary.
Replacing column 0 via cramerColZeroRows is computable in polynomial time.
cramerColZeroRows is computable in polynomial time on pairs of integer matrix and RHS.
Confluent Hermite Cramer recovery hermiteRecoverZero is computable in polynomial time.
Direct tuple certificate for hermiteRecoverZero over binary integers and unary order J.
Modular confluent Hermite Cramer recovery hermiteRecoverModPowTwo is computable in
polynomial time when J and ℓ are given in unary.
Direct tuple certificate for hermiteRecoverModPowTwo.
Recovering a coordinate sum ∑_s H_s(0) mod 2 ^ ℓ across a list of scaled jet tables sharing
nodes, J, and Ω ([OAI26c], Appendix B.3) is computable in polynomial time.