{"slug": "erdos-problem-340-evidence-on-a-a-of-the-mian-chowla-sequence", "title": "Erdős problem #340: evidence on A−A of the Mian–Chowla sequence", "summary": "A developer formalized a result on Erdős problem #340 in Lean 4, proving that growth information alone cannot settle whether the difference set A − A of the greedy Sidon (Mian–Chowla) sequence has positive density. The proof, written in core Lean 4 without Mathlib and with assistance from Claude Opus 5.5, constructs for every monotone f a Sidon set A whose difference set contains all positive integers while having at most 2N elements below f(N).", "body_md": "|  | /- | \n|  | A Sidon set whose difference set is ALL positive integers, | \n|  | and which is nevertheless as sparse as we like. | \n|  |  | \n|  | Context: Erdős problem #340 asks whether the difference set A − A of the | \n|  | greedy Sidon sequence (Mian–Chowla) has positive density. This file proves | \n|  | that growth information alone cannot settle such a question: for every | \n|  | monotone f there is a Sidon set A with A − A ⊇ {1,2,3,...} and at most 2N | \n|  | elements below f(N). | \n|  |  | \n|  | Core Lean 4 only (no Mathlib). Written with Claude Opus 5.5 (Anthropic). | \n|  | -/ | \n|  |  | \n|  | /-- A is a Sidon set: a + b = c + e forces {a,b} = {c,e}. -/ | \n|  | def IsSidon (A : Nat → Prop) : Prop := | \n|  | ∀ a b c e, A a → A b → A c → A e → a + b = c + e → | \n|  | (a = c ∧ b = e) ∨ (a = e ∧ b = c) | \n|  |  | \n|  | def mx : List Nat → Nat | \n|  | \\| [] => 0 | \n|  | \\| a :: l => max a (mx l) | \n|  |  | \n|  | theorem le_mx (S : List Nat) : ∀ s, s ∈ S → s ≤ mx S := by | \n|  | induction S with | \n|  | \\| nil => intro s h; simp at h | \n|  | \\| cons a l ih => | \n|  | intro s h | \n|  | simp only [List.mem_cons] at h | \n|  | simp only [mx] | \n|  | rcases h with h \\| h | \n|  | · subst h; exact Nat.le_max_left _ _ | \n|  | · exact Nat.le_trans (ih s h) (Nat.le_max_right _ _) | \n|  |  | \n|  | /-- Where the new pair goes at step k: far beyond everything so far. -/ | \n|  | def nxt (f : Nat → Nat) (k : Nat) (S : List Nat) : Nat := | \n|  | 2 * mx S + (k + 1) + f k + 1 | \n|  |  | \n|  | /-- Step k makes sure the difference k+1 occurs. -/ | \n|  | def step (f : Nat → Nat) (k : Nat) (S : List Nat) : List Nat := | \n|  | if ∃ s ∈ S, s + (k + 1) ∈ S then S | \n|  | else nxt f k S :: (nxt f k S + (k + 1)) :: S | \n|  |  | \n|  | def st (f : Nat → Nat) : Nat → List Nat | \n|  | \\| 0 => [] | \n|  | \\| k + 1 => step f k (st f k) | \n|  |  | \n|  | theorem step_pos (f : Nat → Nat) (k : Nat) (S : List Nat) | \n|  | (hc : ∃ s ∈ S, s + (k + 1) ∈ S) : step f k S = S := by | \n|  | unfold step; exact if_pos hc | \n|  |  | \n|  | theorem step_neg (f : Nat → Nat) (k : Nat) (S : List Nat) | \n|  | (hc : ¬ ∃ s ∈ S, s + (k + 1) ∈ S) : | \n|  | step f k S = nxt f k S :: (nxt f k S + (k + 1)) :: S := by | \n|  | unfold step; exact if_neg hc | \n|  |  | \n|  | theorem mem_aux {S : List Nat} {d x z : Nat} | \n|  | (hx : ∀ s, s ∈ S → 2 * s + d < x) (h : z ∈ x :: (x + d) :: S) : | \n|  | z = x ∨ z = x + d ∨ (z ∈ S ∧ 2 * z + d < x) := by | \n|  | simp only [List.mem_cons] at h | \n|  | rcases h with h \\| h \\| h | \n|  | · exact Or.inl h | \n|  | · exact Or.inr (Or.inl h) | \n|  | · exact Or.inr (Or.inr ⟨h, hx z h⟩) | \n|  |  | \n|  | /-- Key lemma: adding a far-away pair {x, x+d} to a Sidon set keeps it Sidon, | \n|  | provided d was not already a difference. -/ | \n|  | theorem sidon_add_pair (S : List Nat) (d x : Nat) | \n|  | (hS : IsSidon (· ∈ S)) (hd0 : 0 < d) | \n|  | (hd : ¬ ∃ s ∈ S, s + d ∈ S) | \n|  | (hx : ∀ s, s ∈ S → 2 * s + d < x) : | \n|  | IsSidon (· ∈ x :: (x + d) :: S) := by | \n|  | have hd' : ∀ s, s ∈ S → s + d ∈ S → False := fun s h1 h2 => hd ⟨s, h1, h2⟩ | \n|  | intro a b c e ha hb hc he h | \n|  | change a ∈ x :: (x + d) :: S at ha | \n|  | change b ∈ x :: (x + d) :: S at hb | \n|  | change c ∈ x :: (x + d) :: S at hc | \n|  | change e ∈ x :: (x + d) :: S at he | \n|  | rcases mem_aux hx ha with ha \\| ha \\| ⟨ha, ba⟩ <;> | \n|  | rcases mem_aux hx hb with hb \\| hb \\| ⟨hb, bb⟩ <;> | \n|  | rcases mem_aux hx hc with hc \\| hc \\| ⟨hc, bc⟩ <;> | \n|  | rcases mem_aux hx he with he \\| he \\| ⟨he, be⟩ | \n|  | all_goals first | \n|  | \\| omega | \n|  | \\| exact hS a b c e ha hb hc he h | \n|  | \\| exact (hd' a ha (by rw [show a + d = b by omega]; exact hb)).elim | \n|  | \\| exact (hd' a ha (by rw [show a + d = c by omega]; exact hc)).elim | \n|  | \\| exact (hd' a ha (by rw [show a + d = e by omega]; exact he)).elim | \n|  | \\| exact (hd' b hb (by rw [show b + d = a by omega]; exact ha)).elim | \n|  | \\| exact (hd' b hb (by rw [show b + d = c by omega]; exact hc)).elim | \n|  | \\| exact (hd' b hb (by rw [show b + d = e by omega]; exact he)).elim | \n|  | \\| exact (hd' c hc (by rw [show c + d = a by omega]; exact ha)).elim | \n|  | \\| exact (hd' c hc (by rw [show c + d = b by omega]; exact hb)).elim | \n|  | \\| exact (hd' c hc (by rw [show c + d = e by omega]; exact he)).elim | \n|  | \\| exact (hd' e he (by rw [show e + d = a by omega]; exact ha)).elim | \n|  | \\| exact (hd' e he (by rw [show e + d = b by omega]; exact hb)).elim | \n|  | \\| exact (hd' e he (by rw [show e + d = c by omega]; exact hc)).elim | \n|  |  | \n|  | theorem step_sup (f : Nat → Nat) (k : Nat) (S : List Nat) (n : Nat) | \n|  | (h : n ∈ S) : n ∈ step f k S := by | \n|  | by_cases hc : ∃ s ∈ S, s + (k + 1) ∈ S | \n|  | · rw [step_pos f k S hc]; exact h | \n|  | · rw [step_neg f k S hc]; simp [h] | \n|  |  | \n|  | theorem sidon_step (f : Nat → Nat) (k : Nat) (S : List Nat) | \n|  | (hS : IsSidon (· ∈ S)) : IsSidon (· ∈ step f k S) := by | \n|  | by_cases hc : ∃ s ∈ S, s + (k + 1) ∈ S | \n|  | · rw [step_pos f k S hc]; exact hS | \n|  | · rw [step_neg f k S hc] | \n|  | apply sidon_add_pair S (k + 1) (nxt f k S) hS (Nat.succ_pos k) hc | \n|  | intro s hs | \n|  | have := le_mx S s hs | \n|  | unfold nxt | \n|  | omega | \n|  |  | \n|  | theorem sidon_st (f : Nat → Nat) : ∀ k, IsSidon (· ∈ st f k) | \n|  | \\| 0 => by | \n|  | intro a b c e ha | \n|  | change a ∈ ([] : List Nat) at ha | \n|  | simp at ha | \n|  | \\| k + 1 => sidon_step f k (st f k) (sidon_st f k) | \n|  |  | \n|  | theorem st_mono (f : Nat → Nat) {k : Nat} : | \n|  | ∀ K, k ≤ K → ∀ n, n ∈ st f k → n ∈ st f K := by | \n|  | intro K | \n|  | induction K with | \n|  | \\| zero => | \n|  | intro hk n h | \n|  | have : k = 0 := by omega | \n|  | subst this; exact h | \n|  | \\| succ K ih => | \n|  | intro hk n h | \n|  | rcases Nat.lt_or_ge k (K + 1) with hlt \\| hge | \n|  | · exact step_sup f K (st f K) n (ih (by omega) n h) | \n|  | · have : k = K + 1 := by omega | \n|  | subst this; exact h | \n|  |  | \n|  | /-- The union of all stages is a Sidon set. -/ | \n|  | theorem sidon_A (f : Nat → Nat) : IsSidon (fun n => ∃ k, n ∈ st f k) := by | \n|  | rintro a b c e ⟨ka, ha⟩ ⟨kb, hb⟩ ⟨kc, hc⟩ ⟨ke, he⟩ h | \n|  | exact sidon_st f (ka + kb + kc + ke) a b c e | \n|  | (st_mono f _ (by omega) a ha) (st_mono f _ (by omega) b hb) | \n|  | (st_mono f _ (by omega) c hc) (st_mono f _ (by omega) e he) h | \n|  |  | \n|  | /-- Every positive integer is a difference of two elements. -/ | \n|  | theorem covers (f : Nat → Nat) (d : Nat) (hd : 0 < d) : | \n|  | ∃ a, (∃ k, a ∈ st f k) ∧ (∃ k, a + d ∈ st f k) := by | \n|  | obtain ⟨k, rfl⟩ : ∃ k, d = k + 1 := ⟨d - 1, by omega⟩ | \n|  | by_cases hc : ∃ s ∈ st f k, s + (k + 1) ∈ st f k | \n|  | · obtain ⟨s, hs1, hs2⟩ := hc | \n|  | exact ⟨s, ⟨k, hs1⟩, ⟨k, hs2⟩⟩ | \n|  | · refine ⟨nxt f k (st f k), ⟨k + 1, ?_⟩, ⟨k + 1, ?_⟩⟩ | \n|  | · show _ ∈ step f k (st f k) | \n|  | rw [step_neg f k _ hc]; simp | \n|  | · show _ ∈ step f k (st f k) | \n|  | rw [step_neg f k _ hc]; simp | \n|  |  | \n|  | theorem small_in (f : Nat → Nat) (hf : ∀ a b, a ≤ b → f a ≤ f b) (N : Nat) : | \n|  | ∀ j n, n ∈ st f (N + j) → n < f N → n ∈ st f N := by | \n|  | intro j | \n|  | induction j with | \n|  | \\| zero => intro n h _; exact h | \n|  | \\| succ j ih => | \n|  | intro n h hn | \n|  | have h' : n ∈ step f (N + j) (st f (N + j)) := h | \n|  | by_cases hc : ∃ s ∈ st f (N + j), s + (N + j + 1) ∈ st f (N + j) | \n|  | · rw [step_pos f _ _ hc] at h' | \n|  | exact ih n h' hn | \n|  | · rw [step_neg f _ _ hc] at h' | \n|  | simp only [List.mem_cons] at h' | \n|  | have hfj := hf N (N + j) (by omega) | \n|  | rcases h' with h' \\| h' \\| h' | \n|  | · unfold nxt at h'; omega | \n|  | · unfold nxt at h'; omega | \n|  | · exact ih n h' hn | \n|  |  | \n|  | /-- Every element below f N already lies in stage N. -/ | \n|  | theorem sparse (f : Nat → Nat) (hf : ∀ a b, a ≤ b → f a ≤ f b) (N : Nat) : | \n|  | ∀ n, (∃ k, n ∈ st f k) → n < f N → n ∈ st f N := by | \n|  | rintro n ⟨k, hk⟩ hn | \n|  | rcases Nat.le_total k N with h \\| h | \n|  | · exact st_mono f N h n hk | \n|  | · obtain ⟨j, rfl⟩ : ∃ j, k = N + j := ⟨k - N, by omega⟩ | \n|  | exact small_in f hf N j n hk hn | \n|  |  | \n|  | /-- Stage N has at most 2N elements. -/ | \n|  | theorem len_st (f : Nat → Nat) : ∀ N, (st f N).length ≤ 2 * N | \n|  | \\| 0 => by simp [st] | \n|  | \\| N + 1 => by | \n|  | have ih := len_st f N | \n|  | show (step f N (st f N)).length ≤ 2 * (N + 1) | \n|  | by_cases hc : ∃ s ∈ st f N, s + (N + 1) ∈ st f N | \n|  | · rw [step_pos f _ _ hc]; omega | \n|  | · rw [step_neg f _ _ hc]; simp only [List.length_cons]; omega | \n|  |  | \n|  | /-- MAIN THEOREM. For every monotone f : ℕ → ℕ there is a Sidon set A ⊆ ℕ such that | \n|  | every positive integer d is a difference a' − a of two elements of A, while | \n|  | A has at most 2N elements below f(N). Taking f fast-growing makes A | \n|  | arbitrarily sparse. -/ | \n|  | theorem sparse_sidon_with_all_differences (f : Nat → Nat) | \n|  | (hf : ∀ a b, a ≤ b → f a ≤ f b) : | \n|  | ∃ A : Nat → Prop, | \n|  | IsSidon A ∧ | \n|  | (∀ d, 0 < d → ∃ a, A a ∧ A (a + d)) ∧ | \n|  | (∀ N, ∃ T : List Nat, T.length ≤ 2 * N ∧ ∀ n, A n → n < f N → n ∈ T) := | \n|  | ⟨fun n => ∃ k, n ∈ st f k, sidon_A f, covers f, | \n|  | fun N => ⟨st f N, len_st f N, sparse f hf N⟩⟩ | \n|  |  | \n|  | #print axioms sparse_sidon_with_all_differences |", "url": "https://wpnews.pro/news/erdos-problem-340-evidence-on-a-a-of-the-mian-chowla-sequence", "canonical_source": "https://gist.github.com/royallight1999-jpg/3fcee547c88a0b7af24e5dc52bcc0ccd", "published_at": "2026-11-26 16:49:50+00:00", "updated_at": "2026-11-27 03:43:46.745454+00:00", "lang": "en", "topics": ["artificial-intelligence", "large-language-models", "ai-research", "ai-tools"], "entities": ["Erdős", "Mian", "Chowla", "Lean 4", "Mathlib", "Anthropic", "Claude Opus 5.5"], "also_reported_by": [], "takeaway": "Growth-rate bounds alone cannot resolve Erdős problem #340: for every monotone f there exists a Sidon set A with A − A containing all positive integers yet at most 2N elements below f(N).", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/erdos-problem-340-evidence-on-a-a-of-the-mian-chowla-sequence", "markdown": "https://wpnews.pro/news/erdos-problem-340-evidence-on-a-a-of-the-mian-chowla-sequence.md", "text": "https://wpnews.pro/news/erdos-problem-340-evidence-on-a-a-of-the-mian-chowla-sequence.txt", "jsonld": "https://wpnews.pro/news/erdos-problem-340-evidence-on-a-a-of-the-mian-chowla-sequence.jsonld"}}