allUniqueSums A is the set of elements in α that can be written as the sum of exactly one
unordered pair of elements from A.
Equations
Instances For
A set A has no unique representation in its sumset A + A if for every pair of elements
a₁, a₂ ∈ A, there exist another pair of elements b₁, b₂ ∈ A such that a₁ + a₂ = b₁ + b₂
and {a₁, a₂} ≠ {b₁, b₂}.
Equations
- HasNoUniqueRepresentation A = (allUniqueSums ↑A = ∅)
Instances For
A Sidon set is a set, such that such that all pairwise sums of elements are distinct apart from coincidences forced by the commutativity of addition.
Equations
Instances For
Maximal Sidon sets in an interval.
We follow the convention that IsMaximalSidonSetIn A N means A ⊆ {1, …, N} is Sidon and
is inclusion-maximal among subsets of Set.Icc 1 N with the Sidon property.
IsMaximalSidonSetIn A N means A ⊆ {1, …, N} is Sidon and cannot be extended within
{1, …, N} while remaining Sidon.
Equations
Instances For
If A is a maximal Sidon set in {1, …, N}, then A ⊆ {1, …, N}.
If A is a maximal Sidon set in {1, …, N}, then A is Sidon.
The maximum size of a Sidon set in the supplied Finset.
Equations
- A.maxSidonSubsetCard = {B ∈ A.powerset | IsSidon ↑B}.sup Finset.card
Instances For
Given a finite Sidon set A and a lower bound m, go finds the smallest number m' ≥ m
such that A ∪ {m'} is Sidon. If A is empty then this returns the value m. Note that
the lower bound is required to avoid 0 being a contender in some cases.
Equations
Instances For
Main search loop for generating the greedy Sidon sequence. The return value for step n is the
finite set of numbers generated so far, a proof that it is Sidon, and the greatest element of
the finite set at that point. This is initialised at {1}, then greedySidon.go is
called iteratively using the lower bound max + 1 to find the next smallest Sidon preserving
number.
Equations
- One or more equations did not get rendered due to their size.
- Finset.greedySidon.aux 0 = (⟨{1}, Finset.greedySidon.aux._proof_5⟩, 1)
Instances For
greedySidon is the sequence obtained by the initial set $\{1\}$ and iteratively obtaining
the next smallest integer that preserves the Sidon property of the set. This gives the
sequence 1, 2, 4, 8, 13, 21, 31, ....
Equations
Instances For
The greedy Sidon set in {1, …, N}: starting from ∅, iterate through 1, …, N and
include x if and only if A ∪ {x} remains Sidon.
Alternatively, this is precisely the set of elements in the greedy Sidon sequence that are ≤ N.
Equations
- Finset.greedySidonBelow N = {x ∈ ↑(Finset.greedySidon.aux N).1 | x ≤ N}