Documentation

FormalConjecturesForMathlib.Combinatorics.Basic

def IsSumFree {α : Type u_1} [AddCommMonoid α] (A : Set α) :

A set $A$ is said to be sum-free if the sumset $A + A$ is disjoint from $A$, i.e. if the equation $a + b = c$ has no solution with $a, b, c \in A$.

Equations
Instances For
    def allUniqueSums {α : Type u_1} [AddCommMonoid α] (A : Set α) :
    Set α

    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
      Instances For
        def IsSyndetic (A : Set ) :

        A set $A$ of natural numbers is said to have bounded gaps if there exists an integer $p$ such that $A ∩ [n, n + 1, ..., n + p]$ is nonempty for all $n$.

        Equations
        Instances For
          def IsSidon {α : Type u_1} [AddCommMonoid α] (A : Set α) :

          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
          • IsSidon A = i₁A, j₁A, i₂A, j₂A, i₁ + i₂ = j₁ + j₂i₁ = j₁ i₂ = j₂ i₁ = j₂ i₂ = j₁
          Instances For
            theorem Set.IsSidon.avoids_isAPOfLength_three {A : Set } (hA : IsSidon A) {Y : Set } (hY : Y.IsAPOfLength 3) :
            (A Y).ncard 2
            theorem Set.IsSidon.subset {α : Type u_1} [AddCommMonoid α] {A B : Set α} (hB : IsSidon B) (hAB : A B) :
            theorem Set.IsSidon.insert {α : Type u_1} [AddCommMonoid α] {A : Set α} {m : α} [IsRightCancelAdd α] [IsLeftCancelAdd α] (hA : IsSidon A) :
            IsSidon (A {m}) m A aA, bA, m + m a + b cA, m + a b + c

            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
              theorem Set.IsMaximalSidonSetIn.subset {A : Set } {N : } (hA : A.IsMaximalSidonSetIn N) :
              A Icc 1 N

              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.

              theorem Set.IsMaximalSidonSetIn.maximal {A : Set } {N : } (hA : A.IsMaximalSidonSetIn N) {x : } (hx : x Icc 1 N) (hxA : xA) :

              Maximality condition unpacked.

              Equations

              The maximum size of a Sidon set in the supplied Finset.

              Equations
              Instances For
                theorem Finset.IsSidon.insert_ge_max' {A : Finset } (h : A.Nonempty) (hA : IsSidon A) {s : } (hs : 2 * A.max' h + 1 s) :
                IsSidon (A {s})

                If A is finite Sidon, then A ∪ {s} is also Sidon provided s ≥ A.max + 1.

                theorem Finset.IsSidon.exists_insert {A : Finset } (h : A.Nonempty) (hA : IsSidon A) :
                mA, IsSidon (A {m})
                theorem Finset.IsSidon.exists_insert_ge {A : Finset } (h : A.Nonempty) (hA : IsSidon A) (s : ) :
                ms, mA IsSidon (A {m})
                def Finset.greedySidon.go (A : Finset ) (hA : IsSidon A) (m : ) :
                { m' : // m' m m'A IsSidon ↑(A {m'}) }

                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
                  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
                      Instances For