Documentation

Complexity.Computability.Circuit.Rational.Runtime.Lift

Magnitude bounds and polynomial-time certificates for the integer lift tables #

Complexity/Computability/Circuit/Rational/Runtime/Lift/Defs.lean defines the list-level programs coeffRow, testRows, liftTable, and liftRows that materialize the integer Taylor test matrices and integer lift tables at a grid point. This file bounds the magnitude and bit length of every value those programs compute: each coefficient, each shift-and-add intermediate, each power, each partial product and term, every prefix sum, and every entry. For n + 1 matrices, M residues and grid coordinates at most H, all of them have at most Rational.liftBits n M H bits, which at the generator's parameters is Rational.PolynomialBounds.logarithmic n s + 2. Using these bounds, it certifies that coeffRows, testRows, liftTable, and liftRows are computable in polynomial time on multi-tape Turing machines.

Main definitions #

Main results #

References #

Magnitude bounds #

theorem Cslib.Circuits.Rational.natAbs_pow_le {z : ℤ} {H : ℕ} (hH : 1 ≤ H) (hz : z.natAbs ≤ H) {q M : ℕ} (hq : q ≤ M) :
(z ^ q).natAbs ≤ H ^ M
theorem Cslib.Circuits.Rational.natAbs_getD_coeffRow_le {c : ℤ} {w : ℕ} (hw : 1 ≤ w) (hc : c.natAbs ≤ w) (k i : ℕ) :
((coeffRow c k).getD i 0).natAbs ≤ (2 * w) ^ k

The coefficients of (X + c) ^ k are at most (2 * w) ^ k in absolute value, by IntegralTest.coeff_bound.

theorem Cslib.Circuits.Rational.natAbs_shiftAdd_le {c : ℤ} {w : ℕ} (hw : 1 ≤ w) (hc : c.natAbs ≤ w) (k i : ℕ) :
((0 :: coeffRow c k).getD i 0).natAbs ≤ (2 * w) ^ (k + 1) ∧ (c * (coeffRow c k).getD i 0).natAbs ≤ (2 * w) ^ (k + 1) ∧ ((0 :: coeffRow c k).getD i 0 + c * (coeffRow c k).getD i 0).natAbs ≤ (2 * w) ^ (k + 1)

The values computed by the shift-and-add step from coeffRow c k: the shifted coefficient, the scaled coefficient and their sum.

theorem Cslib.Circuits.Rational.natAbs_rowEntry_coeffRows_le {c : ℤ} {w : ℕ} (hw : 1 ≤ w) (hc : c.natAbs ≤ w) (M k i : ℕ) :
(rowEntry (coeffRows c M) k i).natAbs ≤ (2 * w) ^ M
theorem Cslib.Circuits.Rational.natAbs_coeffProduct_le {M : ℕ} {a : ℤ} {w : ℕ} (hw : 1 ≤ w) (ha : a.natAbs ≤ w) (k u v q : ℕ) :
(rowEntry (coeffRows (-a) M) k u * rowEntry (coeffRows a M) v q).natAbs ≤ (2 * w) ^ (2 * M)
theorem Cslib.Circuits.Rational.natAbs_testTerm_le {M : ℕ} {a t : ℤ} {w H : ℕ} (hw : 1 ≤ w) (ha : a.natAbs ≤ w) (hH : 1 ≤ H) (ht : t.natAbs ≤ H) {q : ℕ} (hq : q ≤ M) (u v : ℕ) :
(testTerm M (coeffRows (-a) M) (coeffRows a M) t u v q).natAbs ≤ (2 * w) ^ (2 * M) * H ^ M
theorem Cslib.Circuits.Rational.natAbs_testTerms_take_sum_le {M : ℕ} {a t : ℤ} {w H : ℕ} (hw : 1 ≤ w) (ha : a.natAbs ≤ w) (hH : 1 ≤ H) (ht : t.natAbs ≤ H) (u v m : ℕ) :
(List.take m (testTerms M (coeffRows (-a) M) (coeffRows a M) t u v)).sum.natAbs ≤ M * ((2 * w) ^ (2 * M) * H ^ M)

Every prefix sum of the summands of a Taylor entry.

theorem Cslib.Circuits.Rational.natAbs_rowEntry_testRows_le {M : ℕ} {a t : ℤ} {w H : ℕ} (hw : 1 ≤ w) (ha : a.natAbs ≤ w) (hH : 1 ≤ H) (ht : t.natAbs ≤ H) (N u v : ℕ) :
(rowEntry (testRows M N a t) u v).natAbs ≤ M * ((2 * w) ^ (2 * M) * H ^ M)
theorem Cslib.Circuits.Rational.natAbs_liftPartial_le {Dg : ℕ} {T : List (List ℤ)} {A : ℕ} (hT : ∀ (k l : ℕ), (rowEntry T k l).natAbs ≤ A) (k l z i j : ℕ) :
(rowEntry T k l * signedCoeff Dg z i j).natAbs ≤ A

The partial products of a lift term, for any indices.

theorem Cslib.Circuits.Rational.natAbs_liftPartial_pow_le {M Dg : ℕ} {T : List (List ℤ)} {p : ℤ} {A H : ℕ} (hT : ∀ (k l : ℕ), (rowEntry T k l).natAbs ≤ A) (hH : 1 ≤ H) (hp : p.natAbs ≤ H) (k l z i j : ℕ) {α : ℕ} (hα : α ≤ M) :
(rowEntry T k l * signedCoeff Dg z i j * p ^ α).natAbs ≤ A * H ^ M
theorem Cslib.Circuits.Rational.natAbs_liftTerm_le {M Dg : ℕ} {T : List (List ℤ)} {p r : ℤ} {A H : ℕ} (hT : ∀ (k l : ℕ), (rowEntry T k l).natAbs ≤ A) (hH : 1 ≤ H) (hp : p.natAbs ≤ H) (hr : r.natAbs ≤ H) {α : ℕ} (hα : α < M) (u v i j κ : ℕ) :
(liftTerm M Dg T p r u v i j α κ).natAbs ≤ A * H ^ (2 * M)
theorem Cslib.Circuits.Rational.natAbs_liftTerms_take_sum_le {M Dg : ℕ} {T : List (List ℤ)} {p r : ℤ} {A H : ℕ} (hT : ∀ (k l : ℕ), (rowEntry T k l).natAbs ≤ A) (hH : 1 ≤ H) (hp : p.natAbs ≤ H) (hr : r.natAbs ≤ H) {α : ℕ} (hα : α < M) (u v i j m : ℕ) :
(List.take m (liftTerms M Dg T p r u v i j α)).sum.natAbs ≤ M * (A * H ^ (2 * M))

Every prefix sum of an inner sum of a lift entry.

theorem Cslib.Circuits.Rational.natAbs_liftSums_take_sum_le {M Dg : ℕ} {T : List (List ℤ)} {p r : ℤ} {A H : ℕ} (hT : ∀ (k l : ℕ), (rowEntry T k l).natAbs ≤ A) (hH : 1 ≤ H) (hp : p.natAbs ≤ H) (hr : r.natAbs ≤ H) (u v i j m : ℕ) :
(List.take m (liftSums M Dg T p r u v i j)).sum.natAbs ≤ M * (M * (A * H ^ (2 * M)))

Every prefix sum of the outer sum of a lift entry.

theorem Cslib.Circuits.Rational.natAbs_liftEntry_le {M Dg : ℕ} {T : List (List ℤ)} {p r : ℤ} {A H : ℕ} (hT : ∀ (k l : ℕ), (rowEntry T k l).natAbs ≤ A) (hH : 1 ≤ H) (hp : p.natAbs ≤ H) (hr : r.natAbs ≤ H) (u v i j : ℕ) :
(liftEntry M Dg T p r u v i j).natAbs ≤ M * (M * (A * H ^ (2 * M)))
theorem Cslib.Circuits.Rational.natAbs_rowEntry_liftTable_le {M Dg : ℕ} {T : List (List ℤ)} {p r : ℤ} {A H : ℕ} (hT : ∀ (k l : ℕ), (rowEntry T k l).natAbs ≤ A) (hH : 1 ≤ H) (hp : p.natAbs ≤ H) (hr : r.natAbs ≤ H) (i j : ℕ) :
(rowEntry (liftTable M Dg T p r) i j).natAbs ≤ M * (M * (A * H ^ (2 * M)))

Bit lengths #

The bit-length budget of the lift program, for n + 1 matrices, M residues and grid coordinates at most H. At the generator's parameters it is PolynomialBounds.logarithmic n s + 2 (liftBits_parameters).

Instances For

    At the generator's parameters, the bit-length budget is polynomial in n + s + 1.

    theorem Cslib.Circuits.Rational.intBits_le_liftBits {n M H : ℕ} {z : ℤ} (hz : z.natAbs ≤ M ^ 3 * (2 * (n + 1)) ^ (2 * M) * H ^ (3 * M)) :

    Every value of magnitude at most M ^ 3 * (2 * (n + 1)) ^ (2 * M) * H ^ (3 * M) fits in the budget.

    theorem Cslib.Circuits.Rational.le_liftMagnitude {M w H i j k : ℕ} (hM : 1 ≤ M) (hw : 1 ≤ w) (hH : 1 ≤ H) (hi : i ≤ 3) (hj : j ≤ 2 * M) (hk : k ≤ 3 * M) :
    M ^ i * (2 * w) ^ j * H ^ k ≤ M ^ 3 * (2 * w) ^ (2 * M) * H ^ (3 * M)

    Each factor of the magnitude bound can be weakened.

    theorem Cslib.Circuits.Rational.intBits_coeffRow_le {n M H : ℕ} (hM : 1 ≤ M) (hH : 1 ≤ H) {c : ℤ} (hc : c.natAbs ≤ n) {k : ℕ} (hk : k < M) (i : ℕ) :
    intBits ((coeffRow c k).getD i 0) ≤ liftBits n M H ∧ intBits ((0 :: coeffRow c k).getD i 0) ≤ liftBits n M H ∧ intBits (c * (coeffRow c k).getD i 0) ≤ liftBits n M H ∧ intBits ((0 :: coeffRow c k).getD i 0 + c * (coeffRow c k).getD i 0) ≤ liftBits n M H

    The bit lengths of the coefficients of (X + c) ^ k for k < M, and of the values computed by the shift-and-add step from them.

    theorem Cslib.Circuits.Rational.intBits_pow_le {n M H : ℕ} (hM : 1 ≤ M) (hH : 1 ≤ H) {z : ℤ} (hz : z.natAbs ≤ H) {q : ℕ} (hq : q ≤ M) :
    intBits (z ^ q) ≤ liftBits n M H

    The bit lengths of the powers z ^ q for q ≤ M; computing a power by repeated multiplication passes only through smaller powers.

    theorem Cslib.Circuits.Rational.intBits_test_le {n M H : ℕ} (hM : 1 ≤ M) (hH : 1 ≤ H) {a t : ℤ} (ha : a.natAbs ≤ n) (ht : t.natAbs ≤ H) (N k u v q m : ℕ) (hq : q < M) :
    intBits (rowEntry (coeffRows (-a) M) k u * rowEntry (coeffRows a M) v q) ≤ liftBits n M H ∧ intBits (testTerm M (coeffRows (-a) M) (coeffRows a M) t u v q) ≤ liftBits n M H ∧ intBits (List.take m (testTerms M (coeffRows (-a) M) (coeffRows a M) t u v)).sum ≤ liftBits n M H ∧ intBits (rowEntry (testRows M N a t) u v) ≤ liftBits n M H

    The bit lengths of the values computed for the Taylor test matrix testRows M N a t: the products of coefficients, the terms, every prefix sum of the terms of an entry, and the entries.

    theorem Cslib.Circuits.Rational.intBits_lift_le {n M H : ℕ} (hM : 1 ≤ M) (hH : 1 ≤ H) {a t p r : ℤ} (ha : a.natAbs ≤ n) (ht : t.natAbs ≤ H) (hp : p.natAbs ≤ H) (hr : r.natAbs ≤ H) (N Dg u v i j k l z m : ℕ) {α κ : ℕ} (hα : α < M) :
    intBits (rowEntry (testRows M N a t) k l * signedCoeff Dg z i j) ≤ liftBits n M H ∧ intBits (rowEntry (testRows M N a t) k l * signedCoeff Dg z i j * p ^ α) ≤ liftBits n M H ∧ intBits (liftTerm M Dg (testRows M N a t) p r u v i j α κ) ≤ liftBits n M H ∧ intBits (List.take m (liftTerms M Dg (testRows M N a t) p r u v i j α)).sum ≤ liftBits n M H ∧ intBits (List.take m (liftSums M Dg (testRows M N a t) p r u v i j)).sum ≤ liftBits n M H ∧ intBits (liftEntry M Dg (testRows M N a t) p r u v i j) ≤ liftBits n M H ∧ intBits (rowEntry (liftTable M Dg (testRows M N a t) p r) k l) ≤ liftBits n M H

    The bit lengths of the values computed for the integer lift with the Taylor test matrix testRows M N a t: the partial products and the terms, every prefix sum of an inner sum and of the outer sum, the entries and the entries of the lift table.

    theorem Cslib.Circuits.Rational.intBits_le_of_mem_liftRows {n M H : ℕ} (hM : 1 ≤ M) (hH : 1 ≤ H) {N Dg t p r : ℕ} (ht : t ≤ H) (hp : p ≤ H) (hr : r ≤ H) {table : List (List ℤ)} (htable : table ∈ liftRows n N M Dg t p r) {row : List ℤ} (hrow : row ∈ table) {z : ℤ} (hz : z ∈ row) :

    Every entry of every integer lift table at a grid point with coordinates at most H has at most liftBits n M H bits.

    theorem Cslib.Circuits.Rational.intBits_le_of_mem_liftRows_parameters {n s t p r : ℕ} (ht : t ≤ Parameters.gridSize n s) (hp : p ≤ Parameters.gridSize n s) (hr : r ≤ Parameters.gridSize n s) {table : List (List ℤ)} (htable : table ∈ liftRows n (Parameters.truncation n s) (Parameters.ambientDimension n s) (CyclotomicRing.degree (Parameters.exponent n s)) t p r) {row : List ℤ} (hrow : row ∈ table) {z : ℤ} (hz : z ∈ row) :

    At the generator's parameters, every entry of every integer lift table at a grid point has at most logConstant * (n + s + 1) ^ 22 + 2 bits.

    Polynomial-time certificates #

    Upper bound on the bit length of any entry of coeffRow c i for i ≤ k, where L is the encoded length of c.

    Instances For

      Upper bound on the encoded length of coeffRow c i for i ≤ k, where L is the encoded length of c.

      Instances For

        Every intermediate coefficient row up to stage k has encoded length bounded by coeffRowBound.

        Computing the coefficient row coeffRow c k is polynomial-time for a binary integer c and a unary degree k.