Documentation

CslibFrontier.Computability.Circuit.Frontier.TensorNetwork.TruncatedResources

Resources of the truncation-order reduction #

The native machine Cslib.Circuits.Frontier.engineCertificate of CslibFrontier/Computability/Circuit/Frontier/TensorNetwork/TruncatedPolyTime.lean runs the reduction of truncation order ℓ to contractions over A_P = (ℤ / 2 ^ P)[U] / (f): it streams over the N = (ℓ - 1) k + 1 digit points, calling a given certificate of the contraction over A_P once per point, and then interpolates. This file bounds its time and space by those of the calls.

The loop (Cslib.Circuits.Frontier.engineCertificate_le). If at every point the call takes time at most R, space at most Q, and outputs at most Yb bits, then the machine takes time at most (N + 1) (K (n + Yb + 1) ^ K + R) and space at most K (n + Yb + 1) ^ K + Q, for a constant K and the encoded length n of the input. The live state is the binary index, the input and the values so far (Cslib.Circuits.Frontier.length_run_engineStep_le), and N ≤ n ^ 2 + 1 (Cslib.Circuits.Frontier.pointCount_le).

The calls. The input of a call has length at most 9 (n + 1) ^ 2 (Cslib.Circuits.Frontier.length_encCore_coreInput_le): the specialized network copies the precision, the truncation order, the modulus and the point into every vertex.

Specialized entries (Cslib.Circuits.Frontier.specEntryCertificate_le). Evaluating a specialized entry costs the original entry plus a polynomial in the lengths of the input and of the original entry.

Direct summation (Cslib.Circuits.Frontier.directCoreCertificate_le, Cslib.Circuits.Frontier.truncDirectCertificate_le). If the entry certificate takes time at most E and space at most ES on the vertices of a network with m edges, direct summation over a specialized network, and the truncated contraction by direct summation, take time K (n + ES + 1) ^ K 2 ^ m (E + 1) and space K (n + ES + 1) ^ K.

Main results #

References #

Sizes #

The length of an input (fl, P, ℓ, r, G) of the reduction, by components.

theorem Cslib.Circuits.Frontier.pointCount_le {T : Type} {encT : T ↪ List Bool} (fl : List ℕ) (P ℓ r : ℕ) (G : DescribedNetwork T) :
DescribedNetwork.pointCount ℓ G ≤ ((encEngine encT) (fl, P, ℓ, r, G)).length * ((encEngine encT) (fl, P, ℓ, r, G)).length + 1

The number of points is at most n ^ 2 + 1 for an input of length n: the truncation order is in unary, and there are at most n vertices.

The size of a call. The input of the contraction at a digit point is at most 9 (n + 1) ^ 2 bits for an input of the reduction of length n: the specialized network copies the precision, the truncation order, the modulus and the point, at most 3 n bits, into each of at most n vertices.

The live state of the loop. After j rounds, if each of the first j values is at most Yb bits, the state is at most 2 |j| + 2 n + 2 + j (2 Yb + 1) bits, for the binary length |j| of j and the length n of the input.

The loop #

theorem Cslib.Circuits.Frontier.engineCertificate_le {T : Type} {encT : T ↪ List Bool} (core : ℕ × List ℕ × ℕ × DescribedNetwork (SpecDesc T) → List ℕ) (cc : GenericRAM.NativeCertificate core (encCore encT) (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat)) :
∃ (K : ℕ), ∀ (fl : List ℕ) (P ℓ r : ℕ) (G : DescribedNetwork T) (R Q Yb : ℕ), (∀ k ≤ DescribedNetwork.pointCount ℓ G, cc.time (coreInput (fl, P, ℓ, r, G) k) ≤ R ∧ cc.space (coreInput (fl, P, ℓ, r, G) k) ≤ Q ∧ ((Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat) (core (coreInput (fl, P, ℓ, r, G) k))).length ≤ Yb) → (engineCertificate core cc).time (fl, P, ℓ, r, G) ≤ (DescribedNetwork.pointCount ℓ G + 1) * (K * (((encEngine encT) (fl, P, ℓ, r, G)).length + Yb + 1) ^ K + R) ∧ (engineCertificate core cc).space (fl, P, ℓ, r, G) ≤ K * (((encEngine encT) (fl, P, ℓ, r, G)).length + Yb + 1) ^ K + Q

Time and space of the reduction. There is K such that, on an input (fl, P, ℓ, r, G) of length n with N = (ℓ - 1) k + 1 points, if at each of the indices 0, …, N the call takes time at most R and space at most Q and outputs at most Yb bits, the reduction takes time at most (N + 1) (K (n + Yb + 1) ^ K + R) and space at most K (n + Yb + 1) ^ K + Q. (The loop charges one more round than it runs, at the index N.)

Specialized entries #

Time and space of specialized entries. There is K such that, for every entry certificate ce, evaluating the specialized entry at ((t, P, ℓ, fl, ζ), bs) costs the original entry at (t, bs) plus K (n + e + 1) ^ K, in time and in space, for the length n of the input and the length e of the original entry.

Direct summation #

theorem Cslib.Circuits.Frontier.directCoreCertificate_le {T : Type} {encT : T ↪ List Bool} (entry : T → List Bool → List ℕ) (ce : GenericRAM.NativeCertificate (fun (q : T × List Bool) => entry q.1 q.2) (Turing.MultiTapeTM.encPair encT Turing.MultiTapeTM.encBits) (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat)) :
∃ (K : ℕ), ∀ (P ℓ r : ℕ) (fl ζ : List ℕ) (G : DescribedNetwork T) (E ES : ℕ), (∀ v ∈ G.vertices, ∀ (bs : List Bool), bs.length = v.1.length → ce.time (v.2, bs) ≤ E ∧ ce.space (v.2, bs) ≤ ES) → (directCoreCertificate entry ce).time (P, fl, r, DescribedNetwork.specNet P ℓ fl ζ G) ≤ K * (((encCore encT) (P, fl, r, DescribedNetwork.specNet P ℓ fl ζ G)).length + ES + 1) ^ K * 2 ^ G.numEdges * (E + 1) ∧ (directCoreCertificate entry ce).space (P, fl, r, DescribedNetwork.specNet P ℓ fl ζ G) ≤ K * (((encCore encT) (P, fl, r, DescribedNetwork.specNet P ℓ fl ζ G)).length + ES + 1) ^ K

Time and space of direct summation over a specialized network. There is K such that, at the input x = (P, fl, r, G') for the network G' specialized at a point, of length n, if the entry certificate takes time at most E and space at most ES at every vertex of the original network G with m edges and every list of bits on its ports, then direct summation takes time at most K (n + ES + 1) ^ K 2 ^ m (E + 1) and space at most K (n + ES + 1) ^ K.

theorem Cslib.Circuits.Frontier.truncDirectCertificate_le {T : Type} {encT : T ↪ List Bool} (entry : T → List Bool → List ℕ) (ce : GenericRAM.NativeCertificate (fun (q : T × List Bool) => entry q.1 q.2) (Turing.MultiTapeTM.encPair encT Turing.MultiTapeTM.encBits) (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat)) :
∃ (K : ℕ), ∀ (P ℓ r : ℕ) (G : DescribedNetwork T) (E ES : ℕ), (∀ v ∈ G.vertices, ∀ (bs : List Bool), bs.length = v.1.length → ce.time (v.2, bs) ≤ E ∧ ce.space (v.2, bs) ≤ ES) → (truncDirectCertificate entry ce).time (P, ℓ, r, G) ≤ K * (((encTrunc encT) (P, ℓ, r, G)).length + ES + 1) ^ K * 2 ^ G.numEdges * (E + 1) ∧ (truncDirectCertificate entry ce).space (P, ℓ, r, G) ≤ K * (((encTrunc encT) (P, ℓ, r, G)).length + ES + 1) ^ K

Time and space of the truncated contraction by direct summation. There is K such that, on an input (P, ℓ, r, G) of length n with m edges, if the entry certificate takes time at most E and space at most ES at every vertex and every list of bits on its ports, then truncDirectCertificate takes time at most K (n + ES + 1) ^ K 2 ^ m (E + 1) and space at most K (n + ES + 1) ^ K.