{
  "id": "2070",
  "ident": "NS.02070",
  "slug": "erdos-42",
  "title": "Erdős Problem 42: Maximal Sidon Sets and Disjoint Difference Sets",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "**Erdős Problem 42**: Let M ≥ 1 and N be sufficiently large in terms of M. Is it true that for every\nmaximal Sidon set `A ⊆ {1,…,N}` there is another Sidon set `B ⊆ {1,…,N}` of size M such that\n`(A - A) ∩ (B - B) = {0}`?\n\nThis was proved for all $M$ by GPT 5.5 Pro (prompted by Sandhu), see discussion thread for more details.",
  "subjects": [
    "math.CO",
    "math.NT",
    "msc:05",
    "msc:11"
  ],
  "tags": [
    "question",
    "formal_proof"
  ],
  "collection": "erdos",
  "source_url": "https://www.erdosproblems.com/42",
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos42.erdos_42",
  "statement_lean": "theorem erdos_42 :\n    ∀ M ≥ 1, ∀ᶠ N in atTop, ∀ (A : Set ℕ) (_ : IsMaximalSidonSetIn A N),\n    ∃ᵉ (B : Set ℕ), B ⊆ Set.Icc 1 N ∧ IsSidon B ∧ B.ncard = M ∧\n    ((A - A) ∩ (B - B)) = {0}",
  "challenge_source": "/-\nCopyright 2025 The Formal Conjectures Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-/\nmodule\n\npublic import FormalConjecturesUtil\n\n/-!\n# Erdős Problem 42: Maximal Sidon Sets and Disjoint Difference Sets\n\n*Reference:* [erdosproblems.com/42](https://www.erdosproblems.com/42)\n\nThis problem asks whether maximal Sidon sets can coexist with other Sidon sets that have\ndisjoint difference sets (apart from 0).\n-/\n\n@[expose] public section\n\nopen Function Set Filter\nopen scoped Pointwise\n\nnamespace Erdos42\n\nset_option linter.style.formal_proof_palomar false in\n/--\n**Erdős Problem 42**: Let M ≥ 1 and N be sufficiently large in terms of M. Is it true that for every\nmaximal Sidon set `A ⊆ {1,…,N}` there is another Sidon set `B ⊆ {1,…,N}` of size M such that\n`(A - A) ∩ (B - B) = {0}`?\n\nThis was proved for all $M$ by GPT 5.5 Pro (prompted by Sandhu), see discussion thread for more details.\n-/\n@[category research solved, question, AMS 5 11, formal_proof using lean4 at \"https://github.com/Shashi456/erdos-formalizations/blob/main/Erdos/P42/CompactCayley/Proof.lean\"]\ntheorem erdos_42 :\n    ∀ M ≥ 1, ∀ᶠ N in atTop, ∀ (A : Set ℕ) (_ : IsMaximalSidonSetIn A N),\n    ∃ᵉ (B : Set ℕ), B ⊆ Set.Icc 1 N ∧ IsSidon B ∧ B.ncard = M ∧\n    ((A - A) ∩ (B - B)) = {0} := by\n  sorry\n\nset_option linter.style.formal_proof_palomar false in\n/--\nA variant asking for explicit bounds on how large N needs to be in terms of M.\n\nThis version provides a constructive function f such that for all M ≥ 1 and N ≥ f(M),\nevery maximal Sidon set A ⊆ {1,…,N} has another Sidon set B ⊆ {1,…,N} of size M with\ndisjoint difference sets (apart from 0).\n-/\n@[category research solved, question, AMS 5 11,\n  formal_proof using formal_conjectures at \"https://github.com/KitaKen1/erdos-42-constructive-variant/blob/1f82c76be43cb56f22e2f7f792e392d5fb3ff78c/lean/Erdos42Constructive.lean\"]\ntheorem erdos_42.variants.constructive :\n    ∃ (f : ℕ → ℕ), ∀ (M N : ℕ) (_ : 1 ≤ M) (_ : f M ≤ N),\n    ∀ (A : Set ℕ) (_ : IsMaximalSidonSetIn A N), ∃ᵉ (B : Set ℕ),\n      B ⊆ Set.Icc 1 N ∧ IsSidon B ∧ B.ncard = M ∧\n      ((A - A) ∩ (B - B)) = {0} := by\n  sorry\n\n\n/-  ## Related results and examples -/\n\n/--\nThe set `{1, 2, 4}` is a maximal Sidon set in `{1, ..., 4}`.\n-/\n@[category textbook, AMS 5 11]\ntheorem example_maximal_sidon : IsMaximalSidonSetIn {1, 2, 4} 4 := by\n  refine ⟨?_, ?_, ?_⟩\n  · intro x hx\n    simp only [Set.mem_insert_iff, Set.mem_singleton_iff] at hx\n    rcases hx with rfl | rfl | rfl <;> simp [Set.mem_Icc]\n  · intro i₁ hi₁ j₁ hj₁ i₂ hi₂ j₂ hj₂ hsum\n    simp only [Set.mem_insert_iff, Set.mem_singleton_iff] at hi₁ hj₁ hi₂ hj₂\n    rcases hi₁ with rfl | rfl | rfl <;>\n    rcases hj₁ with rfl | rfl | rfl <;>\n    rcases hi₂ with rfl | rfl | rfl <;>\n    rcases hj₂ with rfl | rfl | rfl <;>\n    simp_all\n  · intro x hx hxA\n    simp only [Set.mem_Icc] at hx; obtain ⟨hx1, hx2⟩ := hx\n    simp only [Set.mem_insert_iff, Set.mem_singleton_iff, not_or] at hxA\n    obtain ⟨hne1, hne2, hne4⟩ := hxA\n    have hx3 : x = 3 := (by omega); subst hx3\n    intro hbad\n    have := hbad 1 (by simp) 2 (by simp) 3 (by simp) 2 (by simp) (by norm_num)\n    rcases this with ⟨h1, h2⟩ | ⟨h1, h2⟩ <;> omega\n\n/--\nThe difference set of `{1, 2, 4}` is `{0, 1, 2, 3}`.\n-/\n@[category textbook, AMS 5 11]\ntheorem example_difference_set : ({1, 2, 4} : Set ℕ) - {1, 2, 4} = {0, 1, 2, 3} := by\n  ext x\n  simp only [Set.mem_sub, Set.mem_insert_iff, Set.mem_singleton_iff]\n  constructor\n  · rintro ⟨a, ha, b, hb, rfl⟩\n    rcases ha with rfl | rfl | rfl <;>\n    rcases hb with rfl | rfl | rfl <;>\n    simp\n  · rintro (rfl | rfl | rfl | rfl)\n    · exact ⟨1, by decide, 1, by decide, by decide⟩\n    · exact ⟨2, by decide, 1, by decide, by decide⟩\n    · exact ⟨4, by decide, 2, by decide, by decide⟩\n    · exact ⟨4, by decide, 1, by decide, by decide⟩\n\n/--\nFor any maximal Sidon set, the difference set contains 0.\n-/\n@[category textbook, AMS 5 11]\ntheorem maximal_sidon_contains_zero (A : Set ℕ) (N : ℕ) (hN : 1 ≤ N)\n    (hA : IsMaximalSidonSetIn A N) : 0 ∈ A - A := by\n  obtain ⟨hAsub, hAsidon, hAmax⟩ := hA\n  have hne : A.Nonempty\n  · by_contra hemp; rw [Set.not_nonempty_iff_eq_empty] at hemp\n    exact hAmax (Set.mem_Icc.mpr ⟨le_refl 1, hN⟩)\n      (by rw [hemp]; exact id) (by\n        rw [hemp, Set.empty_union]\n        exact fun _ hi _ hj _ hk _ hl _ => by\n          simp only [Set.mem_singleton_iff] at hi hj hk hl\n          subst hi\n          subst hj\n          subst hk\n          subst hl\n          exact Or.inl ⟨rfl, rfl⟩)\n  obtain ⟨a, ha⟩ := hne\n  have := Set.sub_mem_sub ha ha\n  rwa [Nat.sub_self] at this\n\nend Erdos42\n",
  "statement_hash": "c501a823cedf5cc9ee4bac50aba044c9c2aa59c0f2b14c40166c7123e2df8127",
  "toolchain": "leanprover/lean4:v4.33.1",
  "upstream_commit": "f9b3868d5ca994a7bf95039bcec05338c0c21e2f",
  "workspace": "formal-conjectures",
  "field": "math",
  "formalization": "formal",
  "verification": "lean-kernel",
  "license": "Apache-2.0",
  "attribution": "google-deepmind/formal-conjectures contributors",
  "metric_name": null,
  "metric_direction": null,
  "critiques": [],
  "public_partial_proofs": [],
  "research_threads": [],
  "instructions": "Read research_threads first: other people's public repositories and what they already tried. Write Solution.lean starting from challenge_source. Keep every definition identical, prove decl_name with exactly the same type, no sorry in its dependency closure, no new axioms, no native_decide, no metaprogramming. Submit with POST /api/v1/submissions."
}