{
  "id": "2127",
  "ident": "NS.02127",
  "slug": "erdos-434",
  "title": "Erdős Problem 434",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Let $k \\le n$. What choice of $A\\subseteq\\{1, \\dots, n\\}$ (with $\\text{gcd}(A) = 1$) of size $|A| = k$\nmaximises the number of integers not representable as the sum of finitely\nmany elements from $A$ (with repetitions allowed)?\nIs it $\\{n, n - 1, \\dots, n - k + 1\\}$?\n\nThe maximal choice is indeed $\\{n, \\dots, n - k + 1\\}$, as proved by Kiss [Ki02].\n\nThe Lean theorem assumes $2 \\le k$. When $k = 1 < n$, the proposed singleton $\\{n\\}$ does not\nhave gcd $1$; the gcd condition instead forces the unique admissible choice $A = \\{1\\}$.",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "question",
    "formal_proof"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos434.erdos_434.parts.i",
  "statement_lean": "theorem erdos_434.parts.i (n k : ℕ) (hn : 1 ≤ n) (hk : 2 ≤ k) (h : k ≤ n) :\n    IsGreatest\n      { Nat.NcardUnrepresentable S | (S : Finset ℕ) (_ : S ⊆ Finset.Icc 1 n)\n        (_ : #S = k) (_ : S.gcd id = 1) }\n      (Nat.NcardUnrepresentable <| erdos_434.parts.i.answer n k)",
  "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 434\n\n*References:*\n- [erdosproblems.com/434](https://www.erdosproblems.com/434)\n- [Ki02] Kiss, G., On the extremal Frobenius problem in a new aspect. Ann. Univ. Sci.\n  Budapest. Eötvös Sect. Math. (2002), 139–142.\n-/\n\n@[expose] public section\n\nnamespace Erdos434\n\nopen Erdos434 Finset\n\n/--\nA natural $n$ is representable as a set $A$ if it can be\nwritten as the sum of finitely many elements of $A$\n(with repetition allowed).\n-/\nabbrev Nat.IsRepresentableAs (n : ℕ) (A : Set ℕ) :=\n    ∃ (S : Multiset ℕ), (∀ a ∈ S, a ∈ A) ∧ S.sum = n\n\n/--\nThe number of naturals that cannot be written as the sum of\nfinitely many elements of the set $A$, with repetition allowed.\n-/\nnoncomputable abbrev Nat.NcardUnrepresentable (A : Set ℕ) :=\n    { n : ℕ | ¬n.IsRepresentableAs A }.ncard\n\ndef erdos_434.parts.i.answer (n : ℕ) (k : ℕ) : Set ℕ := Set.Icc (n - k + 1 : ℕ) n\n\nset_option linter.style.formal_proof_palomar false in\n/--\nLet $k \\le n$. What choice of $A\\subseteq\\{1, \\dots, n\\}$ (with $\\text{gcd}(A) = 1$) of size $|A| = k$\nmaximises the number of integers not representable as the sum of finitely\nmany elements from $A$ (with repetitions allowed)?\nIs it $\\{n, n - 1, \\dots, n - k + 1\\}$?\n\nThe maximal choice is indeed $\\{n, \\dots, n - k + 1\\}$, as proved by Kiss [Ki02].\n\nThe Lean theorem assumes $2 \\le k$. When $k = 1 < n$, the proposed singleton $\\{n\\}$ does not\nhave gcd $1$; the gcd condition instead forces the unique admissible choice $A = \\{1\\}$.\n-/\n@[category research solved, question value, AMS 11, formal_proof using lean4 at \"https://www.erdosproblems.com/forum/thread/434#post-4437\"]\ntheorem erdos_434.parts.i (n k : ℕ) (hn : 1 ≤ n) (hk : 2 ≤ k) (h : k ≤ n) :\n    IsGreatest\n      { Nat.NcardUnrepresentable S | (S : Finset ℕ) (_ : S ⊆ Finset.Icc 1 n)\n        (_ : #S = k) (_ : S.gcd id = 1) }\n      (Nat.NcardUnrepresentable <| erdos_434.parts.i.answer n k) := by\n  sorry\n\nset_option linter.style.formal_proof_palomar false in\n/--\nFor $2 \\le k \\le n$, the interval $A = \\{n, n - 1, \\dots, n - k + 1\\}$ maximises the number\nof integers not representable as the sum of finitely many elements from $A$ (with repetitions\nallowed), as proved by Kiss [Ki02].\n-/\n@[category research solved, question, AMS 11, formal_proof using lean4 at \"https://www.erdosproblems.com/forum/thread/434#post-4437\"]\ntheorem erdos_434.parts.ii : ∀ᵉ (n ≥ 1) (k ≥ 2), k ≤ n →\n    IsGreatest\n      { Nat.NcardUnrepresentable S | (S : Finset ℕ) (_ : S ⊆ Finset.Icc 1 n)\n        (_ : #S = k) (_ : S.gcd id = 1)}\n      (Nat.NcardUnrepresentable <| Set.Icc (n - k + 1 : ℕ) n) := by\n  sorry\n\nend Erdos434\n",
  "statement_hash": "e26d7897ac5ea7fc86f736dcad9c82f999f69685828f6ac991ea7f07967f9e9b",
  "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."
}