finset_unordered_sum_rep_count
def
r_{A,2}(s): the number of unordered pairs {a, b} (a = b allowed) of elements of A with a + b = s.
Statement
def finset_unordered_sum_rep_count {G : Type*} [AddCommMonoid G] [DecidableEq G] (A : Finset G) (s : G) : ℕ
- Defined in
- arXiv:2610.09349 (A near-quadratic lower bound for sets with no unique sums), Sec. 1 (definition of r_{A,2}); defined in any additive commutative monoid, the paper works in F_p.
- Verified
- 09 Oct 2026
- Axioms
- none listed
- Used by 12
- nus_min_card_ge_near_quadratic_of_rank_hadamard_boundIf every NUS set A ⊆ Z/pZ satisfies log p ≤ K(√|A| + |A|/log p)·log|A| with K ≥ 1, then m(p) ≥ (1/(32K²))(log p/log log p)² for every…
- finset_sum_collision_preserving_const_of_minimalIf A is NUS, no proper subset of A is NUS (A is inclusion-minimal), and x is a rational collision-preserving weight on A, then x is…
- finset_has_no_unique_sums_exists_rep_neIf A has no unique sums and a, b ∈ A, then the sum a + b has a second representation c + d with c, d ∈ A all four of c, d distinct from a…
- finset_has_no_unique_sums_univ_zmod_threeThe whole of Z/3Z has no unique sums.
- nus_collision_subspace_finrank_ge_twoFor a NUS set A ⊆ Z/pZ, the space of F_p-valued collision-preserving functions on A has dimension at least 2: the constant functions and…
- not_finset_has_no_unique_sums_zmod_five_pairThe set {0, 1} in Z/5Z has unique sums (0 + 0 has only one representation).
- finset_has_no_unique_sums_decidableHaving no unique sums is a decidable property for finite subsets of an additive commutative monoid with decidable equality.
- finset_has_no_unique_sums_univ_zmodFor an odd prime p, the whole of Z/pZ has no unique sums.
- finset_has_no_unique_sums_sumset_of_balancedIf B is a nonempty balanced finite subset of an abelian group, then its sumset B + B has no unique sums.
- finset_has_no_unique_sumsA has no unique sums (is NUS): |A| ≥ 2 and every sum a + b with a, b ∈ A has at least two representations as an unordered pair from A.
- finset_is_midpoint_balanced_of_has_no_unique_sumsFor an odd prime p, every subset of Z/pZ with no unique sums is balanced.
- finset_has_no_unique_sums_max_layerLet A be NUS and let x be a rational collision-preserving weight on A. Then the set of elements of A maximizing x (i.e. {a ∈ A : x a = M}…
Lean source view module on GitHub
/-- The number of ways to write `s` as `a + b` with `{a, b}` an unordered pair from `A`, repetition allowed: `r_{A,2}(s)`. -/ def finset_unordered_sum_rep_count {G : Type*} [AddCommMonoid G] [DecidableEq G] (A : Finset G) (s : G) : ℕ := (A.sym2.filter (fun z => Sym2.lift ⟨fun a b => a + b, fun a b => add_comm a b⟩ z = s)).card