sumset_rep_count
For natural numbers h, k, q and integer s, sumset_rep_count h k q s is the number of pairs (x, A) in (sumset_sum_vectors_finset (h + 1) k) × (Finset.Icc 1 (q : ℤ)).powersetCard k such that dotProduct x (sumset_finset_sorted_vector k A) = s.
Statement
def sumset_rep_count (h k : ℕ) (q : ℕ) (s : ℤ) : ℕ- Defined in
- arXiv:2611.07303 Proposition 5.7
- Verified
- 06 Nov 2026
- Axioms
- none listed
- Built on 4
- sumset_sum_vectors_finsetFor natural numbers h and k, the finite set sumset_sum_vectors_finset h k is the finset of all vectors x : Fin k → ℤ with components in…
- sumset_finset_sorted_vectorFor a natural number k and a finset A of integers, sumset_finset_sorted_vector k A is the vector in Fin k → ℤ whose entries are the…
- TotalPreorderA total preorder: a preorder where
≤is total (complete). This is weaker thanLinearOrder— it does NOT require antisymmetry or… - LinearOrder.toTotalPreorderEvery
LinearOrderis aTotalPreorder.
- Used by 4
- sumset_rep_count_eq_zero_of_ltFor any k ≥ 1, h, q, and integer s < h + 1, the representation count ν_q(s) is zero.
- sumset_rep_count_le_choose_mul_chooseFor any k ≥ 1, h, q, and integer s, the representation count ν_q(s) is bounded above by (h + k choose k - 1) * (q choose k - 1).
- sumset_rep_support_and_symmetryLet k ≥ 3, h ≥ 2, and q ≥ k be integers. Then sumset_dot_product_set h k q = Finset.Icc ((h : ℤ) + 1) (((h : ℤ) + 1) * (q : ℤ)), its…
- sumset_rep_count_eq_zero_of_gtFor any k ≥ 1, h, q, and integer s > (h + 1) * q, the representation count ν_q(s) is zero.
Read back from the Lean
sumset_rep_count h k q s is defined as the number of pairs (x, A) such that:
1. x : Fin k → ℤ is a vector whose entries are integers in {0, 1, ..., h + 1} such that ∑ i, x i = h + 1.
2. A is a k-element subset of the integer interval {1, ..., q} (i.e., A ⊆ Finset.Icc 1 (q : ℤ) with |A| = k).
3. The dot product of x with the vector of elements of A sorted in strictly increasing order equals s (that is, ∑ i, x i * a_i = s, where a_0 < a_1 < ... < a_{k-1} are the sorted elements of A).
Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.
Lean source view module on GitHub
/-- The representation count ν_q(s) of s as a dot product x · vec(A) for x ∈ X_{h+1,k} and A ∈ binom([q], k). -/ def sumset_rep_count (h k : ℕ) (q : ℕ) (s : ℤ) : ℕ := (((sumset_sum_vectors_finset (h + 1) k) ×ˢ ((Finset.Icc 1 (q : ℤ)).powersetCard k)).filter fun (x, A) => dotProduct x (sumset_finset_sorted_vector k A) = s).card