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

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Step difference bound a(n+1)−a(n)∈{1,2}a(n+1) - a(n) \in \{1, 2\} in mass-redistribution cellular automata

Source:OEIS conjectures
Known result Solved on paper; nobody has proved it in Lean here yet. First verified proof: +10 points.
Statement:reviewed
Statement:

Conjecture: It appears that the finite difference of this sequence only contains 1's and 2's.

A formal proof has been found with the methods described in arxiv/2605.22763.

Subjects:Number Theory (math.NT)
MSC classes:11
Tags:formal_proof
Cite as:NS.06138 [math.NT] · NS.06138v1 for this version
Declaration:OeisA300997.a_succ_eq
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 10, later ones: 2; accepted critique: up to 60
Statement hash:726c5644c941730ee9ad6f1befe2fa896f5d5a32f63daf75a32cf5a94b8ebbe9
Toolchain:leanprover/lean4:v4.33.1
Licence:Apache-2.0 · google-deepmind/formal-conjectures contributors
Upstream:FormalConjectures/OEIS/300997.lean

Formal statement

theorem a_succ_eq : ∀ n : ℕ, 1 ≤ n → a (n + 1) = a n + 1 ∨ a (n + 1) = a n + 2
Show the full Challenge.lean (153 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Step difference bound $a(n+1) - a(n) \in \{1, 2\}$ in mass-redistribution cellular automata

$a(n)$ is the number of steps needed to reach a stable configuration in the 1D cellular
automaton initialized with one cell with mass $n$ and based on the rule "each cell gives half of
its mass, rounded down, to its right neighbor".
The stable configuration is $n$ cells with mass 1.

*References:*
- [A300997](https://oeis.org/A300997)
- [arxiv/2605.22763](https://arxiv.org/abs/2605.22763) *Advancing Mathematics Research with AI-Driven Formal Proof Search* by George Tsoukalas et al.
-/

@[expose] public section

namespace OeisA300997


open List Nat Function Set

/--
$a(n)$ is the number of steps needed to reach a stable configuration in the 1D cellular
automaton initialized with one cell with mass $n$ and based on the rule "each cell gives half of
its mass, rounded down, to its right neighbor".
The stable configuration is $n$ cells with mass 1.
-/
noncomputable def a (n : ℕ) : ℕ :=
  let half_ceil (m : ℕ) : ℕ := (m + 1) / 2
  let half_floor (m : ℕ) : ℕ := m / 2

  let trim_trailing_zeros (l : List ℕ) : List ℕ :=
    (List.reverse l).dropWhile (fun x => x = 0) |>.reverse

  let ca_step (config : List ℕ) : List ℕ :=
    let base_masses := config.map half_ceil ++ [0]
    let received_masses := 0 :: config.map half_floor

    let next_config_long := List.zipWith Nat.add base_masses received_masses

    trim_trailing_zeros next_config_long

  if n = 0 then
    0
  else
    let initial_config : List ℕ := [n]
    let target_config : List ℕ := List.replicate n 1

    -- State after t steps, computed by folding ca_step t times using foldl over a range.
    let S (t : ℕ) : List ℕ := (List.range t).foldl (fun acc _ => ca_step acc) initial_config

    -- The set of time steps k at which the configuration is stable.
    let stable_steps : Set ℕ := {k | S k = target_config}

    -- a(n) is the smallest k in this set, defined by the set infimum (sInf).
    sInf stable_steps


@[category test, AMS 11]
lemma a_1 : a 1 = 0 := by simp [a, Nat.sInf_eq_zero, Set.mem_ofPred_eq, List.replicate]

@[category test, AMS 11]
lemma a_2 : a 2 = 1 := by
  unfold a
  norm_num
  refine le_antisymm (Nat.sInf_le ?_) ?_
  · simp only [Set.mem_ofPred_eq]
    decide
  · refine Nat.one_le_iff_ne_zero.mpr fun h => ?_
    rcases Nat.sInf_eq_zero.mp h with h0 | h0
    · simp only [Set.mem_ofPred_eq] at h0
      exact absurd h0 (by decide)
    · exact absurd h0 (Set.nonempty_iff_ne_empty.mp ⟨1, by simp only [Set.mem_ofPred_eq]; decide⟩)

@[category test, AMS 11]
lemma a_3 : a 3 = 3 := by
  norm_num [a]
  refine IsLeast.csInf_eq ⟨?_, ?_⟩
  · simp only [Set.mem_ofPred_eq]
    decide
  · intro k hk
    simp only [Set.mem_ofPred_eq] at hk
    by_contra hlt
    push Not at hlt
    interval_cases k <;> exact absurd hk (by decide)

@[category test, AMS 11]
lemma a_4 : a 4 = 4 := by
  norm_num [a]
  apply le_antisymm
  · apply Nat.sInf_le
    simp only [Set.mem_ofPred_eq]
    decide
  · apply le_csInf
    · refine ⟨4, ?_⟩
      simp only [Set.mem_ofPred_eq]
      decide
    · intro b hb
      simp only [Set.mem_ofPred_eq] at hb
      by_contra hb4
      push Not at hb4
      interval_cases b <;> exact absurd hb (by decide)

@[category test, AMS 11]
lemma a_5 : a 5 = 6 := by
  have key : ∀ s : Set ℕ, 6 ∈ s → (∀ k < 6, k ∉ s) → sInf s = 6 := by
    intro s h6 hlt
    refine le_antisymm (Nat.sInf_le h6) ?_
    by_contra h
    push Not at h
    exact hlt _ h (Nat.sInf_mem ⟨6, h6⟩)
  unfold a
  norm_num
  apply key
  · simp only [Set.mem_ofPred_eq]
    decide
  · intro k hk
    simp only [Set.mem_ofPred_eq]
    interval_cases k <;> decide


set_option linter.style.formal_proof_palomar false in
/--
Conjecture: It appears that the finite difference of this sequence only contains 1's and 2's.

A formal proof has been found with the methods described in
[arxiv/2605.22763](https://arxiv.org/abs/2605.22763).
-/
@[category research solved, AMS 11, formal_proof using formal_conjectures at
"https://github.com/mo271/formal-conjectures/blob/a32396489dcb8f86c3549b93aa358ac6a10a3a1f/FormalConjectures/OEIS/300997.wip.lean#L1153"]
theorem a_succ_eq : ∀ n : ℕ, 1 ≤ n → a (n + 1) = a n + 1 ∨ a (n + 1) = a n + 2 := by
    sorry

end OeisA300997

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

nosorry fetch oeis-300997
nosorry submit oeis-300997 nosorry/oeis-300997/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.