Enumerating the tuples of bounded weight #
Give the coordinates of a tuple of natural numbers positive weights ws. The tuples of total
weight ∑ j, ws[j] * β[j] < p (weight) are the exponent tuples of the modes in the proof of the
Boolean tensor contraction theorem of [OAI26k] (§D.4.5, p. 63), where p is the
precision. The source enumerates them "with polynomial delay and space by ordering the variables
and successively choosing each exponent subject to the remaining budget". This file makes that
enumeration explicit:
budgetTuples ws plists the tuples in lexicographic order, the first coordinate most significant, by choosing each coordinate subject to the remaining budget;budgetNext ws p βis the successor ofβ: it advances the tail if it can, and otherwise increments the coordinate and resets the tail to zero, which is feasible since every feasible partial choice has the all-zero continuation.
The list holds exactly the tuples of weight below p (mem_budgetTuples), each once
(nodup_budgetTuples). It starts at the zero tuple (head?_budgetTuples), each entry is followed
by its successor (isChain_budgetTuples), and the last one has none (budgetNext_getLast?). So
iterating budgetNext from zero visits every tuple once. The successor is also a left scan
(budgetNextScan_eq), one pass over the coordinates; its polynomial-time certificate is in
CslibFrontier/Computability/PolyTime/BudgetTuples.lean.
For tuples indexed by a finite type M, listed by a duplicate-free list of all coordinates, a sum
over the tuples of weight below p, the mode budget of the contraction recursion, is the sum
along budgetTuples (sum_filter_weight_lt_eq).
Main definitions #
Cslib.BudgetTuples.weight: the weight of a tuple.Cslib.BudgetTuples.budgetTuples: the tuples of weight below a budget, in lexicographic order.Cslib.BudgetTuples.budgetNext: the successor of a tuple.Cslib.BudgetTuples.scanStep,Cslib.BudgetTuples.budgetNextScan: the successor as a left scan.Cslib.BudgetTuples.ofList: a listed tuple as a function of its coordinates.
Main results #
Cslib.BudgetTuples.mem_budgetTuples,Cslib.BudgetTuples.nodup_budgetTuples: the list holds each tuple of weight below the budget once.Cslib.BudgetTuples.lt_of_mem_budgetTuples: the entries of these tuples are below the budget.Cslib.BudgetTuples.head?_budgetTuples,Cslib.BudgetTuples.isChain_budgetTuples,Cslib.BudgetTuples.budgetNext_getLast?: the successor walks the list from the zero tuple.Cslib.BudgetTuples.budgetNextScan_eq: the scan computes the successor.Cslib.BudgetTuples.sum_filter_weight_lt_eq: a sum over the budget is a sum along the list.
References #
- OpenAI, The Exponential Time Hypothesis is False, §D.4.5, the enumeration after (D.15), p. 63.
The tuples of weight below p, in lexicographic order: the first coordinate takes each
value b with w * b < p (lt_ceilDiv_iff) in increasing order, and the rest is a tuple of
weight below p - w * b.
The tuples in the list #
Each tuple appears once.
The successor walks the list #
Each tuple is followed by its successor.
Tuples indexed by a finite type #
The tuple listed by l as a function of the coordinates listed by ms: coordinate Z reads
the entry of l at the position of Z in ms.
The sum over the tuples of weight below p is the sum along budgetTuples, for positive
weights and any duplicate-free list ms of all coordinates. The finite set is the mode budget
Cslib.Circuits.Frontier.modeBudget w p of the contraction recursion.
The successor as a left scan #
One step of the left scan behind budgetNext, reading a weight and a coordinate (w, b). The
state holds the remaining budget, the number of remaining weights, the coordinates read so far,
and the successor obtained by incrementing the deepest position read so far that has room.