Native tapered recovery (Lemma D.5) on coefficient lists #
This file gives the native procedure behind the recovery step of the contraction algorithm of
[OAI26k] (§D.4.4, Lemma D.5, pp. 60–61), and proves that it computes the mathematical
recovery Cslib.Circuits.Frontier.recoverFromValues of
CslibFrontier/Computability/Circuit/Frontier/TensorNetwork/ActiveCall.lean modulo 2 ^ p.
Input. A precision p, a shift Δ, the monic polynomial fl of
CslibFrontier/Computability/PolyTime/GaloisRingArithmetic.lean, the parameters a, u, h, the
interpolation points ζ and, for each node index k < 2 ^ (a + 1), k ≠ 2 ^ a (the node
t = k - 2 ^ a, NativeRecovery.node), the values at the points. All arithmetic is in
A_N = (ℤ / 2 ^ N)[U] / (f) with N = p + Δ.
Procedure (NativeRecovery.recover). For each node t of multiplicity J = q_t:
- interpolate the values (
GaloisRingArith.interp); - multiply by the reciprocal of
E_t(t + α z)belowz ^ J(NativeRecovery.recip). Each factor ofE_t(t + α z)is a power of1 + c_q zwithc_q = α / (t - q), a2-adic integer (NativeRecovery.slopeConst), whose reciprocal is the geometric series of-c_q; - combine the
Jcoefficients with the multipliers2 ^ Δ E_t(0) (-t / α) ^ j(NativeRecovery.coeffMult). SinceE_t(0) = ∏_q (-q c_q / α) ^ (q_q), the multiplier is2 ^ (Δ - (a + 1)(M_t + j)) ∏_q (-q c_q) ^ (q_q) (-t) ^ jwithM_t = ∑_q q_q, a2-adic integer onceΔ ≥ (a + 1)(M_t + j).
The sum over the nodes is 2 ^ Δ times the recovered value. Dividing its coordinates by
2 ^ Δ (GaloisRingArith.shiftDown) gives the recovered value modulo 2 ^ p.
Precision. The values at node t need only be known modulo 2 ^ p_t: the multipliers have
2-adic valuation at least Δ + p - p_t when p + 6 h D_t + q_t (a + 1) ≤ p_t
((D.10) and the evaluation loss), so the error is killed in A_N. This is the precision estimate
of Lemma D.5 (Cslib.Circuits.Frontier.exists_taperedRecovery_eq_add), carried out natively.
Correctness. Let π : B → A_N be a ring homomorphism from a subring B ⊇ ℤ_(2) of a
ℚ-algebra K (in the manuscript, B = O). The native interpolant is the image of the
interpolant over B modulo 2 ^ p_t (NativeRecovery.exists_pval_interp_eq_add), the Hermite
quotient over K of a polynomial over B is the image of its product with the reciprocal series
(NativeRecovery.hermiteQuotient_map_subtype), and 2 ^ Δ times the recovered value is the sum
of the node contributions over B (NativeRecovery.two_pow_mul_recoverFromValues). So when the
recovered value recoverFromValues B a u h ζ v lies in B, native recovery computes its image
modulo 2 ^ p (NativeRecovery.val_recover).
Polynomial time. Every loop is a fold over a range or over the other node indices, so native
recovery is polynomial-time with the precision, the shift, the parameters and 2 ^ a in unary
(NativeRecovery.computableInPolyTime_recover).
Main definitions #
Cslib.Circuits.Frontier.NativeRecovery.slopeConst: the constantα / (t - q).Cslib.Circuits.Frontier.NativeRecovery.recip: the truncated reciprocal ofE_t(t + α z).Cslib.Circuits.Frontier.NativeRecovery.coeffMult: the multipliers.Cslib.Circuits.Frontier.NativeRecovery.recover: native tapered recovery.Cslib.Circuits.Frontier.NativeRecovery.storeValue: storing a value in the table thatrecoverreads, the accumulator update of a recursive call.Cslib.Circuits.Frontier.NativeRecovery.recipSeries,Cslib.Circuits.Frontier.NativeRecovery.gamma: the reciprocal and the multipliers overℤ_(2).Cslib.Circuits.Frontier.NativeRecovery.nodeSum: the contribution of a node overB.
Main results #
Cslib.Circuits.Frontier.NativeRecovery.val_slopeConst: the constantα / (t - q)is correct.Cslib.Circuits.Frontier.NativeRecovery.val_recip: the native reciprocal is correct belowz ^ J.Cslib.Circuits.Frontier.NativeRecovery.val_coeffMult,Cslib.Circuits.Frontier.NativeRecovery.coe_gamma: the native multiplier is the image of2 ^ Δ E_t(0) (-t / α) ^ j.Cslib.Circuits.Frontier.NativeRecovery.gamma_mul_two_pow_eq_zero: under the precision hypothesis of Lemma D.5, the multipliers annihilate2 ^ p_tinA_(p + Δ).Cslib.Circuits.Frontier.NativeRecovery.sum_recoveryNodes,Cslib.Circuits.Frontier.NativeRecovery.prod_others: sums and products over the nodes as iterations over node indices.Cslib.Circuits.Frontier.NativeRecovery.exists_pval_interp_eq_add: the interpolation bridge.Cslib.Circuits.Frontier.NativeRecovery.invOfUnit_hermiteBasis_comp,Cslib.Circuits.Frontier.NativeRecovery.hermiteQuotient_map_subtype: the reciprocal series invertsE_t(t + α z), so the Hermite quotient of a polynomial overBis integral.Cslib.Circuits.Frontier.NativeRecovery.two_pow_mul_recoverFromValues:2 ^ Δtimes the recovered value as a sum overB.Cslib.Circuits.Frontier.NativeRecovery.val_recover,Cslib.Circuits.Frontier.NativeRecovery.val_recover_of_eq_add: native recovery computes the mathematical recovery modulo2 ^ p.Cslib.Circuits.Frontier.NativeRecovery.computableInPolyTime_recover: native recovery is polynomial-time.Cslib.Circuits.Frontier.NativeRecovery.getD_foldl_storeValue,Cslib.Circuits.Frontier.NativeRecovery.computableInPolyTime_storeValue: storing a sequence of values gives each node index its values in order, in polynomial time.
References #
- OpenAI, The Exponential Time Hypothesis is False, §D.4.4, Lemma D.5, (D.9)–(D.10), pp. 60–61.
Nodes #
The node t = k - 2 ^ a of index k.
The 2-adic valuation of d, capped at b: the number of i < b with 2 ^ (i + 1) ∣ d,
and 0 for d = 0. It is v₂ d when d < 2 ^ b (NativeRecovery.twoVal_eq).
The multiplicity q_t = h (u - v₂ t) of the node of index k.
The indices of the nodes other than the node of index k.
The total multiplicity M_t = ∑_{q ≠ t} q_q of the other nodes.
Constants #
The reciprocal of E_t(t + α z) #
The multipliers #
Recovery #
The contribution of the node of index k, from its values w at the points ζ:
interpolate, divide by E_t(t + α z) below z ^ q_t, and combine the coefficients with the
multipliers.
Native tapered recovery. From the values W.getD k [] at the points ζ for each node
index k, the value recovered modulo 2 ^ p, computing in A_(p + Δ) and dividing by
2 ^ Δ at the end.
Storing the values #
Store the value y at node index k, after the values already stored there. This is the
accumulator update of a recursive call once the value at an interpolation point is complete;
NativeRecovery.recover reads the table.
Correctness of the constants #
The 2-adic integer 2 ^ (a + 1) / (t - q) for distinct grid points.
The slope constant is correct: for every ring homomorphism ρ from ℤ_(2), it is the
image of 2 ^ (a + 1) / (t - q).
The slope 2 ^ (a + 1) / (t - q) for node indices k, k', and 0 off the grid.
Correctness of the reciprocal #
The geometric series ∑ (-c) ^ i z ^ i, the inverse of 1 + c z.
The reciprocal of E_t(t + α z) over ℤ_(2) for the node of index k, in the order of
NativeRecovery.recip.
A truncated product computes the coefficients of the product of power series.
The native reciprocal is correct: its coefficients below z ^ J are the images of those
of NativeRecovery.recipSeries.
Products over the nodes #
The nodes are the images of the indices k < 2 ^ (a + 1), k ≠ 2 ^ a.
The other nodes, as integers, are the nonzero grid points other than t.
The other nodes, as integers, are the nonzero grid points other than t.
A sum over the nodes is a sum over the node indices.
Correctness of the multipliers #
A fold of multiplications is a product.
The multiplier 2 ^ Δ E_t(0) (-t / α) ^ j as a 2-adic integer:
2 ^ (Δ - (a + 1)(M_t + j)) ∏_{q ≠ t} (-q c_q) ^ (q_q) (-t) ^ j.
The native multiplier is correct.
The value E_t(0) over ℚ as a product over the other node indices.
Precision #
The multipliers kill the input error. If p + 6 h D_t + q_t (a + 1) ≤ p_t, the
multiplier of every coefficient below z ^ q_t is divisible by 2 ^ (N - p_t) in ℤ_(2),
N = p + Δ, so it annihilates 2 ^ p_t in A_N.
The interpolation bridge #
The interpolation bridge. Let π : B → A_N be a ring homomorphism, and let the native
nodes ζl represent the images of nodes ζ i ∈ B with unit differences. If the native values
w agree with the images of r i ∈ B modulo 2 ^ e, then the native interpolant agrees with the
image of the interpolant of r over B modulo 2 ^ e.
The Hermite quotient over B #
A fold of multiplications is a list product.
A fold of additions is a list sum.
Over ℚ, E_t(t + α z) times the reciprocal series is one.
The reciprocal series is the inverse of E_t(t + α z) over every ℚ-algebra.
The Hermite quotient over B. For a polynomial P over B, the Hermite quotient over
K at the node of index k is the image of the truncation below z ^ q_t of the product of P
with the reciprocal series.
Assembly #
The contribution of the node of index k to 2 ^ Δ times the recovered value, over B:
∑_{j < q_t} γ_{t,j} c_j, where c_j is the coefficient of z ^ j in the product of P with
the reciprocal series and γ_{t,j} = 2 ^ Δ E_t(0) (-t / α) ^ j (NativeRecovery.gamma).
2 ^ Δ times the recovered value lies in B, as the sum of the node contributions
NativeRecovery.nodeSum, once Δ ≥ (a + 1) ∑_t q_t.
A fold that adds a term at each index of a range sums the terms.
The native contribution of a node is correct: if the native values agree with the
images of r i modulo 2 ^ p_t, where p + 6 h D_t + q_t (a + 1) ≤ p_t, then the native
contribution of the node of index k is the image of NativeRecovery.nodeSum.
Native recovery computes the mathematical recovery modulo 2 ^ p. Let π : B → A_N,
N = p + Δ, be a ring homomorphism, with Δ ≥ (a + 1) ∑_t q_t. Let the native points ζl
represent the images of points ζ i ∈ B with unit differences, and at every node index k of
positive multiplicity let the native values W.getD k [] agree with the images of the values
v t i at t = node a k modulo 2 ^ p_t, where p + 6 h D_t + q_t (a + 1) ≤ p_t. If the
recovered value recoverFromValues B a u h ζ v is an element R of B, then native recovery
computes the reduction of π R modulo 2 ^ p.
Native recovery is correct modulo 2 ^ p. Under the hypotheses of
NativeRecovery.val_recover, if the recovered value agrees with an element x of B modulo
2 ^ p (as TensorNetwork.exists_recoverFromValues_eq_add_of_children gives for the
contraction), then native recovery computes the reduction of π x modulo 2 ^ p.
Polynomial time #
The capped 2-adic valuation is polynomial-time, in unary.
The multiplicities are polynomial-time, in unary, given 2 ^ a in unary.
The other node indices are polynomial-time, given 2 ^ a in unary.
The total multiplicity of the other nodes is polynomial-time, in unary.
Integer differences as constants are polynomial-time, with x, y in unary.
The slope constants are polynomial-time, with a, x, y in unary.
Truncated geometric series are polynomial-time, with J in unary.
A multiplication by a power of a geometric series is the input or a truncated product.
Multiplication by a power of a geometric series is polynomial-time, with J, m in
unary.
The truncated reciprocal of E_t(t + α z) is polynomial-time, given 2 ^ a in
unary.
The products ∏_q (-q c_q) ^ (q_q) are polynomial-time, given 2 ^ a in unary.
The multipliers are polynomial-time, given 2 ^ a in unary.
The contribution of a node is polynomial-time, given 2 ^ a in unary.
Native tapered recovery is polynomial-time, with the precision p, the shift Δ, the
parameters a, u, h and 2 ^ a in unary, and the points and values as coefficient lists.
Storing a value is polynomial-time, with the node index in unary.