rent_or_buy_cost
def
Given 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 : ℝ is the sum over all calls t : Fin T of (schedule_history T a r t : ℝ) + (if r t then K else 0).
Statement
noncomputable def rent_or_buy_cost (T : ℕ) (a : Fin (T - 1) → NNReal) (K : ℝ) (r : Fin T → Bool) : ℝ
- Defined in
- arXiv:2611.06955, Definition 3
- Verified
- 08 Nov 2026
- Axioms
- none listed
- Built on 1
- schedule_historyGiven 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…
- 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_twois false: The reset priceK : ℝis unrestricted, and for negativeKthe claim… - is_optimal_scheduleA schedule r_star : Fin T → Bool is optimal with hindsight for increments a : Fin (T - 1) → NNReal and reset price K : ℝ if for every…
Read back from the Lean
rent_or_buy_cost defines a real-valued function of four arguments:
- a time horizon T : ℕ,
- an incremental/rental cost sequence a : Fin (T - 1) → NNReal,
- a fixed buy/reset cost K : ℝ,
- a decision sequence r : Fin T → Bool.
It computes the sum over all time steps t : Fin T of:
- the accumulated schedule history at time t (cast from NNReal to ℝ), plus
- K if r t is true, and 0 if r t is false.
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 total cost of a schedule r on a session of horizon T with increments a and reset price K. -/ noncomputable def rent_or_buy_cost (T : ℕ) (a : Fin (T - 1) → NNReal) (K : ℝ) (r : Fin T → Bool) : ℝ := ∑ t : Fin T, ((schedule_history T a r t : ℝ) + if r t then K else 0)