AFTD Auto-Formalizing Theoretical Domains

interval_r

def

The sequence R : ℕ → ℚ of rational numbers, defined by R 0 = 0, R 1 = 0, and for l = n + 2, R l = 1 - 1 / (2^(l - 1) : ℚ) + (R (l / 2) + R ((l + 1) / 2)) / 2.

Statement

def interval_r : ℕ → ℚ
Defined in
arXiv:2611.28727 Section 9, before Lemma 29
Verified
24 Nov 2026
Axioms
none listed
Used by 1
  • interval_r_doublingFor every positive natural number ℓ ≥ 1, the rational sequence interval_r satisfies interval_r (2 * ℓ) = interval_r ℓ + 1 - (1 : ℚ) / (2 ^…

Read back from the Lean

interval_r is a function from $\mathbb{N}$ to $\mathbb{Q}$ defined by recursion: - $\text{interval\_r}(0) = 0$ - $\text{interval\_r}(1) = 0$ - for $l = n + 2 \ge 2$, $\text{interval\_r}(l) = 1 - \frac{1}{2^{l - 1}} + \frac{\text{interval\_r}(\lfloor l / 2 \rfloor) + \text{interval\_r}(\lfloor (l + 1) / 2 \rfloor)}{2}$, where the division in the recursive calls is natural number (floor) division.

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 sequence R(ℓ) defined by R(1) = 0 and R(ℓ) = 1 - 2^(1 - ℓ) + (1/2)(R(⌊ℓ/2⌋) + R(⌈ℓ/2⌉)) for ℓ ≥ 2. -/
def interval_r : ℕ → ℚ
  | 0 => 0
  | 1 => 0
  | n + 2 =>
    let l := n + 2
    1 - (1 : ℚ) / (2 ^ (l - 1) : ℚ) + (interval_r (l / 2) + interval_r ((l + 1) / 2)) / 2
termination_by l => l
See it in the graphDiscuss this resultChallenge it