Contraction with entry procedures: the interface #
Theorem D.1 of [OAI26k] (p. 53) contracts Boolean tensor networks whose entries are not
given as tables but computed: it assumes, uniformly over the vertices and the Boolean choices of
their ports, that each entry is computable from the description in time
(s + L) ^ b 2 ^ (A s ^ (9/10)) and space (s + L) ^ b (a paraphrase), with maximum degree at
most ⌈s ^ (9/10)⌉. At that degree a table has
2 ^ ⌈s ^ (9/10)⌉ entries, so Lemma D.2 (p. 56), which applies the theorem with entries computed
by procedures, needs this form for its polynomial-space bound. This file states the interface
that the contraction algorithm provides for such networks, milestone E1 of #1538.
Entry procedures. A network is a described network DescribedNetwork T (the record shared
with explicit networks), with descriptors in a type T encoded by encT. An entry procedure
is a function entry : T → List Bool → List ℕ, the coefficient list over
A_P = (ℤ / 2 ^ P)[U] / (f) of the entry of a descriptor at the bits on its ports, with a native
certificate ce on encPair encT encBits. This is the evaluator of direct summation
(DescribedNetwork.contractionCertificate). Explicit networks are the case of tables, and the
specialized networks of the truncation-order reduction (#1538, E2) are another instance.
Admissible networks (EntryAdmissible). Theorem D.1's hypotheses with one constant C for
the theorem's C, A and b: rows-first bipartite, between s and C s edges, maximum degree
at most ⌈s ^ (9/10)⌉ (ceilNineTenths), and every entry within time
C (s + L + 1) ^ C 2 ^ (C ⌈s ^ (9/10)⌉) and space C (s + L + 1) ^ C, where L is the encoded
length of the network. Entry outputs need no separate size condition, because a native
certificate's space bound charges its encoded output. As for explicit networks
(Cslib.Complexity.CountingSimulation.ExplicitAdmissible), admissibility asks for at least s
edges; a caller can pad with disjoint edges whose row tensor is [x = 0] and column tensor 1,
which leave the contraction unchanged. The number of vertices is not bounded separately: the
encoded length bounds it.
The interface (EntryContractionAlgorithm). One native certificate maps an input
(P, fl, r, G), with the precision P in unary and the coefficients fl of a modulus, to a
coefficient list whose value in A_P at the modulus FastContraction.modulus m, for m the
number of edges, is the contraction of the entries' values, on every input. The admissibility
predicate is a parameter; Theorem D.1 takes it to be EntryAdmissible ce. On the inputs the
predicate selects at a size s ≥ 2, at that modulus and precision
1 ≤ P ≤ D s (⌊log₂ s⌋ + 1), for each fixed D, it runs in time
K (n + 1) ^ K 2 ^ (K s / √⌊log₂ s⌋) and space K (n + 1) ^ K. The original linear-precision
bound is a corollary (EntryContractionAlgorithm.bound). The input format is
that of the truncation-order reduction's contractions of specialized networks.
Direct summation (EntryContraction.directCore). Summing over all edge assignments with the
entry procedure computes the contraction on every input (EntryContraction.val_directCore), in
time (2 ^ m (k + 1) + 1) (K (n + ES + 1) ^ K + 2 E) and space K (n + ES + 1) ^ K + ES when the
procedure takes time E and space ES on the vertices (EntryContraction.directCore_le). On
admissible inputs that is K (n + 1) ^ K 2 ^ (K s) and polynomial space
(EntryContraction.exists_directCore_le): the fallback of the contraction algorithm for small s.
Instances. A polynomial-time entry procedure meets the entry bounds from some constant on
(EntryContraction.exists_entryAdmissible_of_isPolynomial), so admissibility reduces to the
shape of the network. Tables are the entry procedure tableEntry (VertexDesc.lean), and direct
summation with it is the contraction of the explicit network
(EntryContraction.val_directCore_tableEntry).
Main definitions #
Cslib.Circuits.Frontier.ceilNineTenths:⌈s ^ (9/10)⌉.Cslib.Circuits.Frontier.EntryContraction.encInput: the encoding of an input.Cslib.Circuits.Frontier.EntryAdmissible: Theorem D.1's hypotheses.Cslib.Circuits.Frontier.EntryContractionAlgorithm: the interface, for a given admissibility predicate.Cslib.Circuits.Frontier.EntryContraction.directCore: direct summation with an entry procedure.
Main results #
Cslib.Circuits.Frontier.le_ceilNineTenths_iff:x ≤ ⌈s ^ (9/10)⌉iff(x - 1) ^ 10 < s ^ 9.Cslib.Circuits.Frontier.ceilNineTenths_le_degreeBound: the degree bound of the schedule is at least⌈s ^ (9/10)⌉.Cslib.Circuits.Frontier.exists_mul_ceilNineTenths_le:A ⌈s ^ (9/10)⌉ ≤ s / √⌊log₂ s⌋from some size on, so entry costs fit the time budget.Cslib.Circuits.Frontier.EntryContraction.val_directCore: direct summation is correct.Cslib.Circuits.Frontier.EntryContraction.directCore_le,Cslib.Circuits.Frontier.EntryContraction.exists_directCore_le: its resources.Cslib.Circuits.Frontier.EntryContraction.exists_entryAdmissible_of_isPolynomial: polynomial-time entry procedures meet the entry bounds.Cslib.Circuits.Frontier.EntryContraction.val_directCore_tableEntry: direct summation of an explicit network.
References #
- OpenAI, The Exponential Time Hypothesis is False, Theorem D.1 (p. 53), Lemma D.2 (pp. 54–56) and Appendix D.4.6–D.4.7 (pp. 63–64).
The nine-tenths power #
⌈s ^ (9/10)⌉, the least x with s ^ 9 ≤ x ^ 10.
s ^ 9 ≤ ⌈s ^ (9/10)⌉ ^ 10.
⌈s ^ (9/10)⌉ ≤ x whenever s ^ 9 ≤ x ^ 10.
x ≤ ⌈s ^ (9/10)⌉ whenever x ^ 10 ≤ s ^ 9 and s ≥ 1.
⌈s ^ (9/10)⌉ ≤ s.
The degree bound of the schedule is at least ⌈s ^ (9/10)⌉
(ContractionSchedule.pow_nine_le_degreeBound_pow_ten).
Entry costs fit the budget: for every A, from some size on,
A ⌈s ^ (9/10)⌉ ≤ s / √⌊log₂ s⌋. So the entry time 2 ^ (A s ^ (9/10)) allowed by Theorem D.1
is within the 2 ^ O(s / √log s) budget of a leaf (§D.4.7, p. 64).
The interface #
The encoding of an input (P, fl, r, G): the precision P in unary, the coefficients of
the modulus and the number of rows in binary, then the network.
Admissible networks with an entry procedure at size s with constant C (Theorem D.1's
hypotheses, with C for its constants C, A and b): the network G with r row vertices is
rows-first bipartite, has between s and C s edges, every vertex has at most
⌈s ^ (9/10)⌉ ports, and on every vertex and bits on its ports the entry procedure's certificate
takes time at most C (s + L + 1) ^ C 2 ^ (C ⌈s ^ (9/10)⌉) and space at most C (s + L + 1) ^ C,
for L the encoded length of G.
The contraction interface for entry procedures, extending Theorem D.1 at ℓ = 1 to
logarithmic root precision, with entries in A_P. A native certificate maps (P, fl, r, G) to a
coefficient list core (P, fl, r, G). At
the modulus fl = FastContraction.modulus m, for m the number of edges of G, its value in
A_P is the contraction of the values of the entries, on every input. For all constants C and
D there is K such that on every (r, G) with Admissible C s (r, G) at a size s ≥ 2, and
every precision 1 ≤ P ≤ D s (⌊log₂ s⌋ + 1), at that modulus the certificate takes time at most
K (n + 1) ^ K 2 ^ (K s / √⌊log₂ s⌋) and space at most K (n + 1) ^ K, for n the encoded length
of the input. The predicate Admissible is a parameter; Theorem D.1's interface is the case
Admissible = EntryAdmissible ce for a native certificate ce of the entry procedure, which
Cslib.Complexity.CountingSimulation.entryContractionAlgorithm implements.
The output on an input
(P, fl, r, G).- certificate : GenericRAM.NativeCertificate self.core (EntryContraction.encInput encT) (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encNat)
Its native certificate.
- val_core (P r : ℕ) (G : DescribedNetwork T) : GaloisRingArith.val P (FastContraction.modulus G.numEdges) (self.core (P, FastContraction.modulus G.numEdges, r, G)) = DescribedNetwork.contraction (fun (t : T) (bs : List Bool) => GaloisRingArith.val P (FastContraction.modulus G.numEdges) (entry t bs)) G
Correctness: at the modulus of the number of edges, the value is the contraction.
- bound_logPrecision (C D : ℕ) : ∃ (K : ℕ), ∀ (s P r : ℕ) (G : DescribedNetwork T), 2 ≤ s → 1 ≤ P → P ≤ D * s * (Nat.log 2 s + 1) → Admissible C s (r, G) → self.certificate.time (P, FastContraction.modulus G.numEdges, r, G) ≤ K * (((EntryContraction.encInput encT) (P, FastContraction.modulus G.numEdges, r, G)).length + 1) ^ K * 2 ^ (K * s / (Nat.log 2 s).sqrt) ∧ self.certificate.space (P, FastContraction.modulus G.numEdges, r, G) ≤ K * (((EntryContraction.encInput encT) (P, FastContraction.modulus G.numEdges, r, G)).length + 1) ^ K
The same machine and rate allow a logarithmic factor in the root precision. This extension of Theorem D.1 follows from the inherited-precision estimate (D.11).
The original linear-precision bound follows from the logarithmic-precision bound of the same algorithm.
Direct summation #
The input of direct summation, ((P, fl), G), from (P, fl, r, G).
Direct summation with an entry procedure: on (P, fl, r, G), the sum over all edge
assignments of the products of the entries, with the operations of A_P at the modulus fl.
Direct summation is correct: at every modulus, the value is the contraction.
The time of direct summation: the input of the sum, then the sum.
The space of direct summation.
The resources of direct summation with an entry procedure. There is K such that on an
input (P, fl, r, G) of encoded length n, with m edges and k vertices in G, if the entry
procedure takes time at most E and space at most ES on every vertex and bits on its ports,
then direct summation takes time at most (2 ^ m (k + 1) + 1) (K (n + ES + 1) ^ K + 2 E) and
space at most K (n + ES + 1) ^ K + ES.
Direct summation on admissible inputs takes time K (n + 1) ^ K 2 ^ (K s) and space
K (n + 1) ^ K, at the modulus of the number of edges, for K depending only on the constants:
the fallback of the contraction algorithm for small sizes.
Polynomial-time entry procedures and tables #
Polynomial-time entry procedures meet the entry bounds. For a polynomial certificate of the
entry procedure there is C₀ such that, for every C ≥ C₀, a rows-first network with between
s and C s edges and degree at most ⌈s ^ (9/10)⌉ is admissible at size s with constant
C.
Direct summation of a table network is its contraction, in A_P at every modulus.