AFTD Auto-Formalizing Theoretical Domains

rec_seq_r

def

For each natural number k, rec_seq_r k is the natural number defined by Nat.floor (Real.sqrt (2 * (k : ℝ)) + 1 / 2), the natural floor of the real number sqrt(2k) + 1/2.

Statement

noncomputable def rec_seq_r (k : ℕ) : ℕ
Defined in
arXiv:2611.17360 line 118
Verified
16 Nov 2026
Axioms
none listed
Used by 1
  • rec_seq_uThe sequence rec_seq_u : ℕ → ℤ is defined recursively by rec_seq_u 0 = 0, rec_seq_u 1 = 1, and…

Read back from the Lean

The function rec_seq_r takes a natural number $k$ and returns the natural number floor of the real number $\sqrt{2k} + 1/2$ (that is, $\lfloor \sqrt{2k} + 1/2 \rfloor$, the nearest integer to $\sqrt{2k}$).

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- The recurrence step r(k) as a natural number: Nat.floor(Real.sqrt(2k) + 1/2). -/
noncomputable def rec_seq_r (k : ℕ) : ℕ := Nat.floor (Real.sqrt (2 * (k : ℝ)) + 1 / 2)
See it in the graphDiscuss this resultChallenge it