{
  "id": "8503",
  "ident": "NS.08503",
  "slug": "wikipedia-sparseruler",
  "title": "Sparse Ruler",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "**Wichmann's conjecture on optimal rulers.** Every optimal ruler of sufficiently large\nlength is a Wichmann ruler $W(r, s)$ (up to reflection, i.e. reversing the segment list).\nPosed by Wichmann [Wi63]. The Wikipedia article records that no optimal ruler of length\n$1, 13, 17, 23$ or $58$ is a Wichmann ruler, and that every other optimal length up to $213$ is\nattained by one; non-Wichmann optimal rulers also occur alongside Wichmann ones at lengths\n$9, 29, 50$ and $68$.",
  "subjects": [
    "math.CO",
    "msc:05"
  ],
  "tags": [],
  "collection": "wikipedia",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "SparseRuler.wichmann_conjecture",
  "statement_lean": "theorem wichmann_conjecture :\n    ∃ N : ℕ, ∀ g : List ℕ, IsOptimal g → N < g.sum →\n      ∃ r s : ℕ, g = wichmannGaps r s ∨ g = (wichmannGaps r s).reverse",
  "challenge_source": "/-\nCopyright 2026 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\npublic import FormalConjectures.ErdosProblems.«170»\n\n\n/-!\n# Sparse Ruler\n\nA sparse ruler of length $L$ is a sequence of marks $0 = a_1 < a_2 < \\dots < a_m = L$.\nA distance $k \\in \\mathbb{N}$ can be measured if there are $i, j \\in \\{1, \\dots, m\\}$, such that\n$k = a_j - a_i$.\n\nOne question concerns the structure of *optimal* rulers. Wichmann [Wi63] gave a\nparametric family of sparse rulers and speculated that every sufficiently large optimal ruler\nis of his type. The Wikipedia article records that no optimal ruler of length $1, 13, 17, 23$\nor $58$ is a Wichmann ruler, and that every other optimal length up to $213$ is attained by one;\nnon-Wichmann optimal rulers also occur alongside Wichmann ones at lengths $9, 29, 50$ and $68$.\n\nThe asymptotic growth of the minimal number of marks of an optimal ruler of length $L$ — i.e.\nthe limit of $l(n)^2 / n$, conjectured to lie in $[2.434\\ldots, 3]$ — is the subject of\n`FormalConjectures.ErdosProblems.«170»` (there phrased via $F(N)/\\sqrt{N}$), and is not\nrestated here.\n\n*References:*\n- [Wi63] Wichmann, B. \"A note on restricted difference bases.\" Journal of the London\n  Mathematical Society 38 (1963): 465-466.\n- [Wikipedia](https://en.wikipedia.org/wiki/Sparse_ruler)\n-/\n\n@[expose] public section\n\nnamespace SparseRuler\n\n/-- A ruler is described by its list of *segment lengths* (gaps) `g`, so that its marks are\nthe partial sums $0 = m_0 < m_1 < \\cdots < m_n = L$, where $n$ (`g.length`) is the number of\nsegments and $L$ (`g.sum`) is the length. -/\ndef marks (g : List ℕ) : Finset ℕ :=\n  (Finset.range (g.length + 1)).image (fun i => (g.take i).sum)\n\n/-- A ruler is *complete* (a perfect ruler) if its marks form a difference basis for\n$\\{0, 1, \\ldots, L\\}$, i.e. every distance $k \\le L$ is the difference of two marks. This is\n`Finset.IsDifferenceBasis` applied to the marks. -/\ndef IsComplete (g : List ℕ) : Prop :=\n  (marks g).IsDifferenceBasis (Finset.range (g.sum + 1))\n\n/-- A complete ruler is *minimal* if no complete ruler of the same length $L$ has fewer marks\n(equivalently, fewer segments). -/\ndef IsMinimal (g : List ℕ) : Prop :=\n  IsComplete g ∧ ∀ g' : List ℕ, IsComplete g' → g'.sum = g.sum → g.length ≤ g'.length\n\n/-- A complete ruler is *maximal* if no complete ruler with the same number of marks\n(equivalently, the same number of segments) has greater length. -/\ndef IsMaximal (g : List ℕ) : Prop :=\n  IsComplete g ∧ ∀ g' : List ℕ, IsComplete g' → g'.length = g.length → g'.sum ≤ g.sum\n\n/-- A ruler is *optimal* if it is both minimal and maximal. -/\ndef IsOptimal (g : List ℕ) : Prop := IsMinimal g ∧ IsMaximal g\n\n/-- The *Wichmann ruler* $W(r, s)$ [Wi63], given by its segment-length sequence\n$$1^r,\\; (r+1),\\; (2r+1)^r,\\; (4r+3)^s,\\; (2r+2)^{r+1},\\; 1^r,$$\nwhere $a^b$ denotes $b$ consecutive segments of length $a$. -/\ndef wichmannGaps (r s : ℕ) : List ℕ :=\n  List.replicate r 1 ++ [r + 1] ++ List.replicate r (2 * r + 1) ++\n    List.replicate s (4 * r + 3) ++ List.replicate (r + 1) (2 * r + 2) ++ List.replicate r 1\n\n/-- The Wichmann ruler $W(r, s)$ has $4r + s + 2$ segments, hence $4r + s + 3$ marks [Wi63]. -/\n@[category API, AMS 5]\nlemma wichmannGaps_length (r s : ℕ) : (wichmannGaps r s).length = 4 * r + s + 2 := by\n  simp only [wichmannGaps, List.length_append, List.length_replicate, List.length_cons,\n    List.length_nil]\n  omega\n\n/-- The Wichmann ruler $W(r, s)$ has length $4r(r + s + 2) + 3(s + 1)$ [Wi63]. -/\n@[category API, AMS 5]\nlemma wichmannGaps_sum (r s : ℕ) :\n    (wichmannGaps r s).sum = 4 * r * (r + s + 2) + 3 * (s + 1) := by\n  simp only [wichmannGaps, List.sum_append, List.sum_replicate, List.sum_cons, List.sum_nil,\n    smul_eq_mul]\n  ring\n\n/-- **Wichmann's conjecture on optimal rulers.** Every optimal ruler of sufficiently large\nlength is a Wichmann ruler $W(r, s)$ (up to reflection, i.e. reversing the segment list).\nPosed by Wichmann [Wi63]. The Wikipedia article records that no optimal ruler of length\n$1, 13, 17, 23$ or $58$ is a Wichmann ruler, and that every other optimal length up to $213$ is\nattained by one; non-Wichmann optimal rulers also occur alongside Wichmann ones at lengths\n$9, 29, 50$ and $68$. -/\n@[category research open, AMS 5]\ntheorem wichmann_conjecture :\n    ∃ N : ℕ, ∀ g : List ℕ, IsOptimal g → N < g.sum →\n      ∃ r s : ℕ, g = wichmannGaps r s ∨ g = (wichmannGaps r s).reverse := by\n  sorry\n\nend SparseRuler\n",
  "statement_hash": "4bea61e0c974eef408474a74350f78138e716acab967e783e3a70d9d799d449a",
  "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."
}