AFTD Auto-Formalizing Theoretical Domains

schedule_history

def

Given a horizon T : ℕ, increments a : Fin (T - 1) → NNReal, and a schedule r : Fin T → Bool, schedule_history T a r : Fin T → NNReal is defined recursively: at index ⟨0, _⟩ it is 0, and at index ⟨t + 1, _⟩ it is a ⟨t, _⟩ if r ⟨t, _⟩ is true, and schedule_history T a r ⟨t, _⟩ + a ⟨t, _⟩ if r ⟨t, _⟩ is false.

Statement

def schedule_history (T : ℕ) (a : Fin (T - 1) → NNReal) (r : Fin T → Bool) : Fin T → NNReal
Defined in
arXiv:2611.06955, Definition 3
Verified
08 Nov 2026
Axioms
none listed
Used by 3
  • threshold_schedule_additive_boundFor every horizon T ≥ 2, nonnegative increments a : Fin (T - 1) → NNReal with P runs (P = rent_or_buy_num_runs T a), every positive reset…
  • not_threshold_schedule_competitive_ratio_twoThe statement threshold_schedule_competitive_ratio_two is false: The reset price K : ℝ is unrestricted, and for negative K the claim…
  • rent_or_buy_costGiven horizon T : ℕ, increments a : Fin (T - 1) → NNReal, reset price K : ℝ, and a schedule r : Fin T → Bool, rent_or_buy_cost T a K r : ℝ…

Read back from the Lean

Given a natural number $T$, a sequence $a : \mathrm{Fin}(T - 1) \to \mathbb{R}_{\ge 0}$, and a sequence of booleans $r : \mathrm{Fin}(T) \to \mathrm{Bool}$, schedule_history defines a function from $\mathrm{Fin}(T)$ to $\mathbb{R}_{\ge 0}$ by recursion on the index: - At index $0$, it evaluates to $0$. - At index $t + 1$ (where $t + 1 < T$): - If $r(t)$ is true, it evaluates to $a(t)$. - If $r(t)$ is false, it evaluates to $\mathrm{schedule\_history}(T, a, r)(t) + a(t)$. Termination is by the value of the index $t$.

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 history of a schedule r on a session of horizon T with increments a at each call. -/
def schedule_history (T : ℕ) (a : Fin (T - 1) → NNReal) (r : Fin T → Bool) : Fin T → NNReal
  | ⟨0, _⟩ => 0
  | ⟨t + 1, ht⟩ =>
    have ht_lt : t < T - 1 := by omega
    if r ⟨t, by omega⟩ then a ⟨t, ht_lt⟩
    else schedule_history T a r ⟨t, by omega⟩ + a ⟨t, ht_lt⟩
termination_by t => t.val
See it in the graphDiscuss this resultChallenge it