Documentation

CslibFrontier.Computability.Circuit.Frontier.TensorNetwork.TruncatedPolyTime

The reduction of truncation order ℓ as a native machine #

The reduction of CslibFrontier/Computability/Circuit/Frontier/TensorNetwork/Truncated.lean (Cslib.Circuits.Frontier.DescribedNetwork.interpContract) contracts specialized networks over A_P = (ℤ / 2 ^ P)[U] / (f) and interpolates. This file runs it as one native machine around any native certificate of the contraction over A_P (engineCertificate), with the precision P and the truncation order ℓ in unary.

Polynomial-time steps. Specializing a network at a point (DescribedNetwork.specNet_polyTime), the binary-digit points (DescribedNetwork.digitPoints_polyTime), the inputs of the contractions (coreInput_polyTime) and reading the truncated contraction off the interpolant (interpRecover_polyTime, engineRecover_polyTime) are polynomial-time.

The loop. The machine visits the digit points with the binary-index fold Cslib.GenericRAM.IndexFold, keeping the index, the input and the values so far; each round calls the given certificate once (engineStep, engineStepCertificate, run_engineStep). Then it interpolates (engineRecover).

Direct summation. A native certificate of the entries gives one of the specialized entries (specEntryCertificate: the entry, then Horner's rule), hence direct summation over A_P of a specialized network (directCoreCertificate). Through the reduction at the modulus FastContraction.modulus n for n = (ℓ - 1) k + 1 points, which has enough residues (le_two_pow_length_modulus), this computes the truncated contraction on every input (truncDirectCertificate). Its cost is that of direct summation.

The time and space of the loop are bounded in CslibFrontier/Computability/Circuit/Frontier/TensorNetwork/TruncatedResources.lean. With the contraction of Theorem D.1 at ℓ = 1 over A_P in place of direct summation, that bound gives Theorem D.1 at truncation order ℓ (#1538).

Main definitions #

Main results #

References #

@[reducible, inline]

The encoding of the data (P, ℓ, fl, ζ) of a specialization: P and ℓ in unary, the coefficients of the modulus and the point in binary.

@[reducible, inline]

The encoding of a specialized descriptor: the original descriptor, then the data of the specialization.

Horner's rule on the first ℓ coefficients, from the data of a specialization and a coefficient list, with P and ℓ in unary.

The native evaluator of specialized entries, from a native certificate of the entries: evaluate the original entry, then apply Horner's rule in A_P.

Specializing is polynomial-time: from the data (P, ℓ, fl, ζ) and the network to the specialized network.

The reduction as a streaming loop #

@[reducible, inline]

The encoding of an input (P, ℓ, r, G) of the truncated contraction: P and ℓ in unary, r in binary, then the network.

@[reducible, inline]

The encoding of an input (P, fl, r, G') of a contraction over A_P of specialized networks: P in unary, the modulus, r in binary, then the specialized network.

@[reducible, inline]

The input of the reduction: the modulus and the input (P, ℓ, r, G).

@[reducible, inline]

The state (k, (y, ys)) of the loop of the reduction: the index k in binary, framed, the input y of the reduction (encEngine), framed, then the values ys so far, each framed, an element of A_P as its coefficient list of framed binary numbers. The last component is the layout of encElems but is spelled encList (encList encNat) so that the omega steps of TruncatedResources see the expected encoding constructors after simplifying encEngineState.

The input (P, fl, r, G') of the contraction at the k-th digit point, for a modulus fl and an input (P, ℓ, r, G): G' is G specialized at that point.

One round of the reduction at the index k, for the modulus and input y and the values ys so far: append the contraction at the k-th digit point.

After j rounds, the values are the contractions at the first j digit points.

Recovery from a final state (k, ((fl, P, ℓ, r, G), ys)) of the loop: read the truncated contraction off the interpolant of the values ys at the digit points.

The reduction is the streaming loop followed by recovery.

The number of points is polynomial-time, in unary.

The input of the contraction at a binary index is polynomial-time.

The reduction as one native machine, from a native certificate of the contraction over A_P of specialized networks: the streaming loop over the digit points, keeping only the binary index, the input and the values so far, then recovery. On input (fl, (P, ℓ, r, G)) it computes interpContract core fl P ℓ r G.

Direct summation as the contraction over A_P #

Direct summation over a specialized network, as a contraction over A_P with the input (P, fl, r, G'), from a native certificate of the entries.

n ≤ 2 ^ deg f for the modulus FastContraction.modulus n: it has enough residues for n points.

Choosing the modulus FastContraction.modulus n for n = (ℓ - 1) k + 1 points is polynomial-time.

Direct summation through the reduction computes the truncated contraction, at the modulus FastContraction.modulus n for n = (ℓ - 1) k + 1 points.

The truncated contraction by direct summation, as one native machine on every input (P, ℓ, r, G): the reduction with direct summation over A_P at the modulus FastContraction.modulus n, for n = (ℓ - 1) k + 1 points. It is correct everywhere; its cost is that of direct summation, exponential in the number of edges.