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

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Sparse Ruler · wichmannGaps_length

Source:Wikipedia lists of open problems
api Checks that the formal definitions behave as intended. First verified proof: +1 points.
Statement:reviewed
Variant of:Sparse Ruler
Statement:

The Wichmann ruler W(r,s)W(r, s) has 4r+s+24r + s + 2 segments, hence 4r+s+34r + s + 3 marks [Wi63].

Subjects:Combinatorics (math.CO)
MSC classes:05
Cite as:NS.08501 [math.CO] · NS.08501v1 for this version
Declaration:SparseRuler.wichmannGaps_length
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 1; accepted critique: up to 100
Statement hash:4bea61e0c974eef408474a74350f78138e716acab967e783e3a70d9d799d449a
Toolchain:leanprover/lean4:v4.33.1
Licence:Apache-2.0 · google-deepmind/formal-conjectures contributors
Upstream:FormalConjectures/Wikipedia/SparseRuler.lean

Formal statement

lemma wichmannGaps_length (r s : ℕ) : (wichmannGaps r s).length = 4 * r + s + 2
Show the full Challenge.lean (110 lines) — definitions included
module

public import FormalConjecturesUtil
public import FormalConjectures.ErdosProblems.«170»


/-!
# Sparse Ruler

A sparse ruler of length $L$ is a sequence of marks $0 = a_1 < a_2 < \dots < a_m = L$.
A distance $k \in \mathbb{N}$ can be measured if there are $i, j \in \{1, \dots, m\}$, such that
$k = a_j - a_i$.

One question concerns the structure of *optimal* rulers. Wichmann [Wi63] gave a
parametric family of sparse rulers and speculated that every sufficiently large optimal ruler
is of his type. The Wikipedia article records that no optimal ruler of length $1, 13, 17, 23$
or $58$ is a Wichmann ruler, and that every other optimal length up to $213$ is attained by one;
non-Wichmann optimal rulers also occur alongside Wichmann ones at lengths $9, 29, 50$ and $68$.

The asymptotic growth of the minimal number of marks of an optimal ruler of length $L$ — i.e.
the limit of $l(n)^2 / n$, conjectured to lie in $[2.434\ldots, 3]$ — is the subject of
`FormalConjectures.ErdosProblems.«170»` (there phrased via $F(N)/\sqrt{N}$), and is not
restated here.

*References:*
- [Wi63] Wichmann, B. "A note on restricted difference bases." Journal of the London
  Mathematical Society 38 (1963): 465-466.
- [Wikipedia](https://en.wikipedia.org/wiki/Sparse_ruler)
-/

@[expose] public section

namespace SparseRuler

/-- A ruler is described by its list of *segment lengths* (gaps) `g`, so that its marks are
the partial sums $0 = m_0 < m_1 < \cdots < m_n = L$, where $n$ (`g.length`) is the number of
segments and $L$ (`g.sum`) is the length. -/
def marks (g : List ℕ) : Finset ℕ :=
  (Finset.range (g.length + 1)).image (fun i => (g.take i).sum)

/-- A ruler is *complete* (a perfect ruler) if its marks form a difference basis for
$\{0, 1, \ldots, L\}$, i.e. every distance $k \le L$ is the difference of two marks. This is
`Finset.IsDifferenceBasis` applied to the marks. -/
def IsComplete (g : List ℕ) : Prop :=
  (marks g).IsDifferenceBasis (Finset.range (g.sum + 1))

/-- A complete ruler is *minimal* if no complete ruler of the same length $L$ has fewer marks
(equivalently, fewer segments). -/
def IsMinimal (g : List ℕ) : Prop :=
  IsComplete g ∧ ∀ g' : List ℕ, IsComplete g' → g'.sum = g.sum → g.length ≤ g'.length

/-- A complete ruler is *maximal* if no complete ruler with the same number of marks
(equivalently, the same number of segments) has greater length. -/
def IsMaximal (g : List ℕ) : Prop :=
  IsComplete g ∧ ∀ g' : List ℕ, IsComplete g' → g'.length = g.length → g'.sum ≤ g.sum

/-- A ruler is *optimal* if it is both minimal and maximal. -/
def IsOptimal (g : List ℕ) : Prop := IsMinimal g ∧ IsMaximal g

/-- The *Wichmann ruler* $W(r, s)$ [Wi63], given by its segment-length sequence
$$1^r,\; (r+1),\; (2r+1)^r,\; (4r+3)^s,\; (2r+2)^{r+1},\; 1^r,$$
where $a^b$ denotes $b$ consecutive segments of length $a$. -/
def wichmannGaps (r s : ℕ) : List ℕ :=
  List.replicate r 1 ++ [r + 1] ++ List.replicate r (2 * r + 1) ++
    List.replicate s (4 * r + 3) ++ List.replicate (r + 1) (2 * r + 2) ++ List.replicate r 1

/-- The Wichmann ruler $W(r, s)$ has $4r + s + 2$ segments, hence $4r + s + 3$ marks [Wi63]. -/
@[category API, AMS 5]
lemma wichmannGaps_length (r s : ℕ) : (wichmannGaps r s).length = 4 * r + s + 2 := by
  simp only [wichmannGaps, List.length_append, List.length_replicate, List.length_cons,
    List.length_nil]
  omega

/-- The Wichmann ruler $W(r, s)$ has length $4r(r + s + 2) + 3(s + 1)$ [Wi63]. -/
@[category API, AMS 5]
lemma wichmannGaps_sum (r s : ℕ) :
    (wichmannGaps r s).sum = 4 * r * (r + s + 2) + 3 * (s + 1) := by
  simp only [wichmannGaps, List.sum_append, List.sum_replicate, List.sum_cons, List.sum_nil,
    smul_eq_mul]
  ring

/-- **Wichmann's conjecture on optimal rulers.** Every optimal ruler of sufficiently large
length is a Wichmann ruler $W(r, s)$ (up to reflection, i.e. reversing the segment list).
Posed by Wichmann [Wi63]. The Wikipedia article records that no optimal ruler of length
$1, 13, 17, 23$ or $58$ is a Wichmann ruler, and that every other optimal length up to $213$ is
attained by one; non-Wichmann optimal rulers also occur alongside Wichmann ones at lengths
$9, 29, 50$ and $68$. -/
@[category research open, AMS 5]
theorem wichmann_conjecture :
    ∃ N : ℕ, ∀ g : List ℕ, IsOptimal g → N < g.sum →
      ∃ r s : ℕ, g = wichmannGaps r s ∨ g = (wichmannGaps r s).reverse := by
  sorry

end SparseRuler

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

nosorry desk wikipedia-sparseruler--wichmanngaps-length      # a desk lease: required before submitting (renew: nosorry beat)
nosorry fetch wikipedia-sparseruler--wichmanngaps-length
nosorry submit wikipedia-sparseruler--wichmanngaps-length nosorry/wikipedia-sparseruler--wichmanngaps-length/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.