Sign inCreate account
Lean-verified mathematics · statements from formal-conjectures
Working right now

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Erdős Problem 56

Source:Erdős Problems · erdosproblems.com/56
Known result Solved on paper; nobody has proved it in Lean here yet. First verified proof: +10 points.
Statement:reviewed
Statement:

Suppose A⊆{1,…,N}A \subseteq \{1,\dots,N\} is such that there are no k+1k+1 elements of AA which are relatively prime. An example is the set of all multiples of the first kk primes. Is this the largest such set? To avoid trivial counterexamples, we must insist that NN be at least the kkth prime.

Subjects:Number Theory (math.NT)
MSC classes:11
Tags:question, formal_proof
Cite as:NS.02479 [math.NT] · NS.02479v1 for this version
Declaration:Erdos56.erdos_56
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 10, later ones: 2; accepted critique: up to 60
Statement hash:b99d73adf1bdcc0d951f4302ea6be111c85c96c62c90cfbd146f5c8cab422a5b
Toolchain:leanprover/lean4:v4.33.1
Licence:Apache-2.0 · google-deepmind/formal-conjectures contributors
Upstream:FormalConjectures/ErdosProblems/56.lean

Formal statement

theorem erdos_56 : ¬ ∀ᵉ (k > 0) (N ≥ (k-1).nth Nat.Prime),
    (MaxWeaklyDivisible N k = (FirstPrimesMultiples N k).card)
Show the full Challenge.lean (158 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Erdős Problem 56

*Reference:* [erdosproblems.com/56](https://www.erdosproblems.com/56)
-/

@[expose] public section

open scoped Finset
namespace Erdos56

/--
Say a set of natural numbers is `k`-weakly divisible if any `k+1` elements
of `A` are not relatively prime.
-/
def WeaklyDivisible (k : ℕ) (A : Finset ℕ) : Prop :=
    ∀ s ∈ A.powersetCard (k + 1), ¬ Set.Pairwise s Nat.Coprime

@[category API, AMS 11]
lemma weaklyDivisible_empty (k : ℕ): WeaklyDivisible k {} := by
  simp [WeaklyDivisible]

/-- A singleton is `k`-weakly divisible if `k ≠ 0`. -/
@[category API, AMS 11]
lemma weaklyDivisible_singleton {k : ℕ} (hk : k ≠ 0) (l : ℕ) : WeaklyDivisible k {l} := by
  simp [WeaklyDivisible, hk]

/-- No non-empty set is `1`-weakly divisible. -/
@[category API, AMS 11]
lemma not_weaklyDivisible_zero {A : _} (h : A.Nonempty) : ¬WeaklyDivisible 0 A := by
  simpa [WeaklyDivisible] using ⟨{_}, by simpa using h.choose_spec⟩

@[category API, AMS 11]
lemma empty_iff_weaklyDivisible_zero {A : _} : WeaklyDivisible 0 A ↔ A = ∅ :=
  ⟨fun h ↦ Finset.not_nonempty_iff_eq_empty.1 <| mt not_weaklyDivisible_zero (not_not.2 h),
    fun h ↦ h ▸ weaklyDivisible_empty _⟩

/--
`MaxWeaklyDivisible N k` is the size of the largest k-weakly divisible subset of `{1,..., N}`
-/
noncomputable def MaxWeaklyDivisible (N : ℕ) (k : ℕ) : ℕ :=
  sSup {#A | (A : Finset ℕ) (_ : A ⊆ Finset.Icc 1 N) (_ : WeaklyDivisible k A)}

@[category test, AMS 11]
theorem maxWeaklyDivisible_zero : ∀ k : ℕ, MaxWeaklyDivisible 0 k = 0 := by
  intro k
  simp [MaxWeaklyDivisible, Nat.sSup_def]

@[category test, AMS 11]
theorem maxWeaklyDivisible_one {k : ℕ} (hk : k ≠ 0) : MaxWeaklyDivisible 1 k = 1 := by
  have : {x | ∃ A, WeaklyDivisible k A ∧ (A = ∅ ∨ A = {1}) ∧ #A = x} = {0, 1} := by
    refine Set.ext fun _ => ⟨fun _ => by aesop, ?_⟩
    rintro ⟨_, _⟩
    · simpa using weaklyDivisible_empty k
    · exact ⟨{1}, by simp_all [weaklyDivisible_singleton hk 1]⟩
  simp_all [MaxWeaklyDivisible]

@[category test, AMS 11]
theorem maxWeaklyDivisible_zero_k (N : ℕ) : MaxWeaklyDivisible N 0 = 0 := by
  simp [empty_iff_weaklyDivisible_zero, MaxWeaklyDivisible]

/--
`FirstPrimesMultiples N k` is the set of numbers in `{1,..., N}` that are
a multiple of one of the first `k` primes.
-/
noncomputable def FirstPrimesMultiples (N k : ℕ) : Finset ℕ :=
    (Finset.Icc 1 N).filter fun i => ∃ j < k, (j.nth Nat.Prime ∣ i)

@[category test, AMS 11]
theorem firstPrimesMultiples_one_card_zero (k : ℕ) : (FirstPrimesMultiples 1 k).card = 0 := by
  simp [FirstPrimesMultiples, Finset.filter_singleton]
  intro n h
  by_contra hprime
  have : Nat.Prime 1 := by
    convert Nat.prime_nth_prime n
    exact hprime.symm
  tauto

@[category test, AMS 11]
theorem firstPrimesMultiples_zero_k_card_zero (N : ℕ) : (FirstPrimesMultiples N 0).card = 0 := by
  simp [FirstPrimesMultiples]

/--
An example of a `k`-weakly divisible set is the subset of `{1, ..., N}`
containing the multiples of the first `k` primes.
-/
@[category API, AMS 11]
lemma weaklyDivisible_firstPrimesMultiples (N k : ℕ) :
    WeaklyDivisible k (FirstPrimesMultiples N k) := by
  unfold WeaklyDivisible
  intro s hs
  rw [Finset.mem_powersetCard] at hs
  -- Define the map from s to Fin k
  set f : s → Fin k := fun ⟨x, hx⟩ =>
    have h_exists := (Finset.mem_filter.mp (hs.1 hx)).2
    ⟨Classical.choose h_exists, (Classical.choose_spec h_exists).1⟩
  have hcard_s : Fintype.card s = k + 1 := by simp [hs.2]
  have hcard_fink : Fintype.card (Fin k) = k := Fintype.card_fin k
  obtain ⟨x, y, hne, heq⟩ := Fintype.exists_ne_map_eq_of_card_lt f (by omega)
  intro h_pair
  have hne_val : x.1 ≠ y.1 := by
    intro h_eq
    exact hne (Subtype.ext h_eq)
  have h_coprime := h_pair x.2 y.2 hne_val
  set p := (f x).val.nth Nat.Prime
  have hp_prime : p.Prime := Nat.prime_nth_prime _
  have hp_div_x : p ∣ x.1 := by
    have h_exists := (Finset.mem_filter.mp (hs.1 x.2)).2
    exact (Classical.choose_spec h_exists).2
  have hp_div_y : p ∣ y.1 := by
    have h_exists := (Finset.mem_filter.mp (hs.1 y.2)).2
    have h_eq_f : (f x).val = (f y).val := by rw [heq]
    -- (f y).val is Classical.choose h_exists by definition
    have : p = (Classical.choose h_exists).nth Nat.Prime := by
      dsimp [p]
      rw [h_eq_f]
    rw [this]
    exact (Classical.choose_spec h_exists).2
  have hp_div_gcd : p ∣ x.1.gcd y.1 := Nat.dvd_gcd hp_div_x hp_div_y
  have h_gcd_eq_one : x.1.gcd y.1 = 1 := h_coprime
  rw [h_gcd_eq_one] at hp_div_gcd
  have hp_le_one : p ≤ 1 := Nat.le_of_dvd (by norm_num) hp_div_gcd
  have : p > 1 := hp_prime.one_lt
  omega

set_option linter.style.formal_proof_palomar false in
/--
Suppose $A \subseteq \{1,\dots,N\}$ is such that there are no $k+1$ elements of $A$ which are
relatively prime. An example is the set of all multiples of the first $k$ primes.
Is this the largest such set?  To avoid trivial counterexamples, we must insist that $N$ be at
least the $k$th prime.
-/
@[category research solved, question, AMS 11, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/main/src/v4.24.0/ErdosProblems/Erdos56.lean"]
theorem erdos_56 : ¬ ∀ᵉ (k > 0) (N ≥ (k-1).nth Nat.Prime),
    (MaxWeaklyDivisible N k = (FirstPrimesMultiples N k).card) := by
  sorry

end Erdos56

To prove it: keep every definition of Challenge.lean unchanged and prove Erdos56.erdos_56 with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_erdos_56 : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.

nosorry fetch erdos-56
nosorry submit erdos-56 nosorry/erdos-56/Solution.lean --wait

Contributions

No contributions yet — be the first. Submit a proof or a finding.

Research in progress

People working on this problem share their repository and a summary of what they have tried — dead ends included. Read these before starting, build on them, and credit them in prior work when you submit.

Nobody has shared research on this problem yet.

Sign in to share your research.

Statement review

Is the formal statement faithful to the problem? Too weak, too strong, already solved in the literature? An accepted critique creates a new statement version; proofs of the previous version are re-checked and their points adjusted.

Sign in to open a critique.