Explicit finite B_k-sequences #
A subset B of a commutative additive monoid is a B_k-set (or B_k-sequence, also called a
Sidon set at k = 2) when every k-fold sum of elements of B determines its multiset of
summands (Cslib.IsBkSet). Any B_k-subset B of a finite commutative additive monoid M
satisfies (|B| + k - 1).choose k ≤ |M| (Cslib.IsBkSet.choose_le_card), giving
(|B| + k - 1).choose k ≤ N in ZMod N.
Following [Ser23], we construct an explicit size-n B_k-sequence H[n, k]
(Cslib.sergeevBkSequence) whose elements are bounded by ((n + 2) * (2 * ⌊log₂(n + 2)⌋ + 4)) ^ k
(= n ^ (k + o(k))) and whose entries can be computed in time (n + k) ^ O(1) (certified in
CslibFrontier.Computability.Complexity.BkSequencePolyTime):
- 2-adic unit decomposition and bit-by-bit discrete logarithm (pp. 2–3): for
r ≥ 3, every odd integerxhas a unique representationx ≡ (-1) ^ j · 5 ^ h (mod 2 ^ r)withj ∈ Fin 2andh < 2 ^ (r - 2)(Cslib.existsUnique_neg_one_pow_mul_five_pow_eq). After normalizingxmodulo4, ther - 2binary digits ofhare extracted sequentially in the order-2subgroup⟨5 ^ (2 ^ (r - 3))⟩ = {1, 2 ^ (r - 1) + 1}(Cslib.dlogFiveModTwoPow,Cslib.zmod_eq_neg_one_pow_mul_five_pow_dlogFiveModTwoPow). - Prime factor base and
B_kcorrectness (p. 2): takingp₁ < ⋯ < pₙto be the firstnodd primes (Cslib.firstOddPrimes, found belowCslib.primeSearchBound nviaNat.le_card_primesLE_mul_log) andr = max 3 (1 + ⌈log₂(pₙ ^ k)⌉)(Cslib.sergeevModulusExp), distinctk-multisets of odd primes have distinct products strictly below2 ^ (r - 1). Hence any collision ofk-sums modulo2 ^ (r - 2)would forceP ≡ ±Q (mod 2 ^ r)with0 < P, Q < 2 ^ (r - 1), forcingP = Qinℕand identical prime multisets (Cslib.isBkSequence_map_zmod_sergeevBkSequence,Cslib.isBkSequence_sergeevBkSequence).
Main definitions #
Cslib.IsBkSet:B_k-sets in a commutative additive monoid (distinctk-multiset sums).Cslib.IsBkSequence: finiteB_k-sequences (List.Noduptogether withIsBkSeton entries).Cslib.dlogFiveStep,Cslib.dlogFiveModTwoPow: bit-by-bit discrete logarithmlog₅(±x)modulo2 ^ r.Cslib.primeSearchBound,Cslib.firstOddPrimes: explicit search bound and list of the firstnodd primes.Cslib.sergeevModulusExp,Cslib.sergeevBkSequence: modulus exponentrand Sergeev's explicitB_k-sequenceH[n, k].
Main results #
Cslib.IsBkSet.choose_le_card: counting lower bound(#B + k - 1).choose k ≤ Fintype.card M.Cslib.IsBkSet.of_injOn_map,Cslib.IsBkSequence.of_map: homomorphic pullback ofB_k-sets andB_k-sequences (modular lift fromZMod mtoℕ).Cslib.dlogFiveModTwoPow_lt,Cslib.zmod_eq_neg_one_pow_mul_five_pow_dlogFiveModTwoPow,Cslib.existsUnique_neg_one_pow_mul_five_pow_eq: range, correctness, and uniqueness of the(-1) ^ j · 5 ^ h (mod 2 ^ r)decomposition of odd residues forr ≥ 3.Cslib.isBkSequence_map_zmod_sergeevBkSequence,Cslib.isBkSequence_sergeevBkSequence:sergeevBkSequence n kis aB_k-sequence inZMod (2 ^ (r - 2))and inℕfor1 ≤ k.Cslib.two_pow_sergeevModulusExp_sub_two_lt,Cslib.mem_sergeevBkSequence_lt: explicit((n + 2) * (2 * Nat.log 2 (n + 2) + 4)) ^ kupper bound on2 ^ (r - 2)and on every element ofsergeevBkSequence n k.
References #
- I. S. Sergeev, An Explicit Finite $B_k$-Sequence, arXiv:2304.03988v1, pp. 1–3.
B_k-sets and B_k-sequences #
A subset B of a commutative additive monoid is a B_k-set (or B_k-sequence; a Sidon
set when k = 2) if k-element sums from B uniquely determine their multiset of summands
([Ser23], p. 1).
A list L in a commutative additive monoid is a finite B_k-sequence if its entries are
pairwise distinct and form a B_k-set ([Ser23], p. 1).
Counting lower bound for finite B_k-sets ([Ser23], p. 1): the k-element
multisets drawn from B have pairwise distinct sums in M, so (#B + k - 1).choose k ≤ |M|.
Specializing M = ZMod N ([NeZero N]) gives (#B + k - 1).choose k ≤ N.
Pulling back a B_k-set along an additive monoid homomorphism that is injective on B yields
a B_k-set.
If the homomorphic image L.map φ is a B_k-sequence, then L itself is a B_k-sequence
(since (L.map φ).Nodup already forces φ to be injective on the entries of L).
2-adic unit decomposition and bit-by-bit discrete logarithm #
One bit-extraction step of Sergeev's base-5 discrete logarithm modulo 2 ^ r
([Ser23], p. 3): given (r, x'), accumulator a < 2 ^ i with
x' ≡ 5 ^ a (mod 2 ^ (i + 2)), and bit index i < r - 2, test whether
(5 ^ (-a) * x') ^ (2 ^ (r - 3 - i)) ≡ 2 ^ (r - 1) + 1 (mod 2 ^ r) in the order-2 subgroup.
Base-5 discrete logarithm of ±x modulo 2 ^ r ([Ser23], pp. 2–3):
normalizes x modulo 4 so that odd inputs satisfy x' ≡ 1 (mod 4), then extracts the r - 2
binary digits of h < 2 ^ (r - 2) sequentially.
After j ≤ m bit-extraction steps over List.range m, the base-5 discrete-logarithm
accumulator is strictly less than 2 ^ j.
dlogFiveModTwoPow r x always lies strictly below 2 ^ (r - 2).
Correctness of Sergeev's bit-by-bit discrete logarithm ([Ser23], pp. 2–3):
for r ≥ 3 and odd x, x ≡ (-1) ^ j · 5 ^ (dlogFiveModTwoPow r x) (mod 2 ^ r) where
j = 0 when x % 4 = 1 and j = 1 when x % 4 = 3.
Prime factor base #
Upper bound (n + 2) * (2 * ⌊log₂(n + 2)⌋ + 4) guaranteed by Nat.le_card_primesLE_mul_log
to exceed at least n + 1 primes (and hence at least n odd primes).
The first n odd prime numbers in strictly increasing order.
firstOddPrimes n has length n for every n.
firstOddPrimes n is strictly increasing.
Every entry of firstOddPrimes n is an odd prime (p.Prime ∧ 2 < p).
Every entry of firstOddPrimes n is bounded by primeSearchBound n.
Sergeev's H[n, k] construction, correctness, and density #
Modulus exponent r = max 3 (1 + ⌈log₂(pₙ ^ k)⌉) of Sergeev's construction
([Ser23], p. 2), using default base 3 when n = 0.
sergeevBkSequence n k has length n.
Every element of sergeevBkSequence n k is strictly less than
2 ^ (sergeevModulusExp n k - 2).
Explicit upper bound on the modulus 2 ^ (r - 2) of Sergeev's B_k-sequence
([Ser23], p. 2): 2 ^ (r - 2) < pₙ ^ k ≤ ((n + 2) * (2 * ⌊log₂(n + 2)⌋ + 4)) ^ k
for all n and 1 ≤ k.
Every element of sergeevBkSequence n k (1 ≤ k) is strictly bounded by
((n + 2) * (2 * Nat.log 2 (n + 2) + 4)) ^ k (= n ^ (k + o(k)), [Ser23],
Abstract and p. 2).
Sergeev's modular B_k-sequence theorem ([Ser23], p. 2): for every n
and 1 ≤ k, the residues of sergeevBkSequence n k form a size-n B_k-sequence in
ZMod (2 ^ (sergeevModulusExp n k - 2)).
Sergeev's integer B_k-sequence theorem ([Ser23], Abstract and p. 2):
for every n and 1 ≤ k, sergeevBkSequence n k is a size-n B_k-sequence in ℕ.