Documentation

FormalConjectures.ForMathlib.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 IsSidon {α : Type u_1} [AddCommMonoid α] {S : Type u_2} [Membership α S] (A : S) :

    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
      @[simp]
      theorem coe {α : Type u_1} [AddCommMonoid α] {S : Type u_2} [SetLike S α] {A : S} :
      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.

        @[simp]
        theorem Finset.isSidon_toSet {α : Type u_1} [AddCommMonoid α] {A : Finset α} :
        Equations

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

        Equations
        Instances For
          theorem Finset.IsSidon.insert {α : Type u_1} [AddCommMonoid α] {A : Finset α} {m : α} [DecidableEq α] [IsRightCancelAdd α] [IsLeftCancelAdd α] (hA : IsSidon A) :
          IsSidon (A {m}) m A aA, bA, m + m a + b cA, m + a b + c
          theorem Finset.IsSidon.insert_ge_max' {A : Finset } (h : A.Nonempty) (hA : IsSidon A) {s : } (hs : 2 * A.max' h + 1 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})