AFTD Auto-Formalizing Theoretical Domains

arrival_walk_error_bound_lt_one_eighth

theoremverified

For any natural numbers M and T such that 1 ≤ M and T ≤ M, the quantity (1 - (1 - 1 / (4 * (M : ℝ)^2))) * ((T : ℝ) * ((T : ℝ) - 1) / 2) is strictly less than 1 / 8.

Statement

theorem arrival_walk_error_bound_lt_one_eighth (M T : ℕ) (hM : 1 ≤ M) (hT : T ≤ M) :
    (1 - (1 - 1 / (4 * (M : ℝ) ^ 2))) * ((T : ℝ) * ((T : ℝ) - 1) / 2) < 1 / 8
Source
arXiv:2611.33785 Lemma 2.2
Verified
29 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
Used by 1

Read back from the Lean

For all natural numbers $M$ and $T$, if $1 \le M$ and $T \le M$, then in the real numbers: $$\left(1 - \left(1 - \frac{1}{4M^2}\right)\right) \cdot \frac{T(T - 1)}{2} < \frac{1}{8}$$

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

The proof, explained

The error expression (1 - (1 - 1 / (4 * M^2))) * (T * (T - 1) / 2) simplifies algebraically to T * (T - 1) / (8 * M^2). Since 0 ≤ T ≤ M and 1 ≤ M, the numerator is bounded by T * (T - 1) ≤ M * (M - 1), which gives T * (T - 1) / (8 * M^2) ≤ M * (M - 1) / (8 * M^2) upon division by the positive denominator. Transitivity with the established bound M * (M - 1) / (8 * M^2) < 1 / 8 then yields the desired strict inequality.

  1. The expression simplifies algebraically to T * (T - 1) / (8 * M^2), reducing the goal to T * (T - 1) / (8 * M^2) < 1 / 8.

    Ring arithmetic simplifies the left-hand factor 1 - (1 - 1 / (4 * M^2)) to 1 / (4 * M^2), which when multiplied by T * (T - 1) / 2 yields T * (T - 1) / (8 * M^2). Rewriting with this algebraic identity replaces the goal with T * (T - 1) / (8 * M^2) < 1 / 8.

    lines 4–6

      have h_eq : (1 - (1 - 1 / (4 * (M : ℝ) ^ 2))) * ((T : ℝ) * ((T : ℝ) - 1) / 2) =
          (T : ℝ) * ((T : ℝ) - 1) / (8 * (M : ℝ) ^ 2) := by ring
      rw [h_eq]
  2. The numerator satisfies T * (T - 1) ≤ M * (M - 1).

    After casting the natural number hypotheses 1 ≤ M and T ≤ M to the real numbers (via Nat.one_le_cast.mpr and Nat.cast_le.mpr), we split into cases on whether T = 0 or T ≠ 0 (using eq_or_ne). If T = 0, the product T * (T - 1) is 0, which is at most M * (M - 1) since M ≥ 1. If T ≠ 0, then 1 ≤ T (via Nat.pos_iff_ne_zero.mpr and Nat.one_le_cast.mpr), and the quadratic inequality T * (T - 1) ≤ M * (M - 1) follows from 1 ≤ T ≤ M by nonlinear arithmetic.

    lines 7–13

    uses Nat.one_le_cast.mpr, Nat.cast_le.mpr, eq_or_ne, Nat.pos_iff_ne_zero.mpr

      have hM_real : (1 : ℝ) ≤ (M : ℝ) := Nat.one_le_cast.mpr hM
      have hT_real : (T : ℝ) ≤ (M : ℝ) := Nat.cast_le.mpr hT
      have h_num : (T : ℝ) * ((T : ℝ) - 1) ≤ (M : ℝ) * ((M : ℝ) - 1) := by
        rcases eq_or_ne T 0 with rfl | hT0
        · simp; nlinarith
        · have : (1 : ℝ) ≤ (T : ℝ) := Nat.one_le_cast.mpr (Nat.pos_iff_ne_zero.mpr hT0)
          nlinarith
  3. T * (T - 1) / (8 * M^2) ≤ M * (M - 1) / (8 * M^2).

    Since M ≥ 1, the denominator 8 * M^2 is strictly positive (verified by positivity). Dividing both sides of T * (T - 1) ≤ M * (M - 1) by this non-negative denominator (using le_of_lt) preserves the inequality (div_le_div_of_nonneg_right).

    lines 14–16

    uses div_le_div_of_nonneg_right, le_of_lt

      have h_den : 0 < 8 * (M : ℝ) ^ 2 := by positivity
      have h_le : (T : ℝ) * ((T : ℝ) - 1) / (8 * (M : ℝ) ^ 2) ≤ (M : ℝ) * ((M : ℝ) - 1) / (8 * (M : ℝ) ^ 2) :=
        div_le_div_of_nonneg_right h_num (le_of_lt h_den)
  4. T * (T - 1) / (8 * M^2) < 1 / 8, completing the proof.

    Chaining T * (T - 1) / (8 * M^2) ≤ M * (M - 1) / (8 * M^2) with the known strict upper bound M * (M - 1) / (8 * M^2) < 1 / 8 from arrival_discount_error_bound_lt_one_eighth via transitivity (lt_of_le_of_lt) proves the theorem.

    line 17

    uses lt_of_le_of_lt, arrival_discount_error_bound_lt_one_eighth

      exact lt_of_le_of_lt h_le (arrival_discount_error_bound_lt_one_eighth M hM)
Nat.one_le_cast.mpr
For any natural number n, if 1 ≤ n then 1 ≤ (n : ℝ).
Nat.cast_le.mpr
For any natural numbers m and n, if m ≤ n then (m : ℝ) ≤ (n : ℝ).
eq_or_ne
For any values x and y, either x = y or x ≠ y.
Nat.pos_iff_ne_zero.mpr
For any natural number n, if n ≠ 0 then 0 < n.
div_le_div_of_nonneg_right
For real numbers a, b, c, if a ≤ b and 0 ≤ c, then a / c ≤ b / c.
le_of_lt
If a < b, then a ≤ b.
lt_of_le_of_lt
If a ≤ b and b < c, then a < c.
arrival_discount_error_bound_lt_one_eighth
For any natural number M ≥ 1, M * (M - 1) / (8 * M^2) < 1 / 8.

Written by a model (gemini-3.8-flash) from the Lean proof and the goal states Lean reported at each step. Lean verified the proof; this explanation is a reading aid and is not itself machine-checked.

Lean source view module on GitHub

/-- The discounted walk error bound (1 - q) * T * (T - 1) / 2 is strictly less than 1 / 8 when T ≤ M and 1 ≤ M with discount denominator 4 * M^2. -/theorem arrival_walk_error_bound_lt_one_eighth (M T : ℕ) (hM : 1 ≤ M) (hT : T ≤ M) :    (1 - (1 - 1 / (4 * (M : ℝ) ^ 2))) * ((T : ℝ) * ((T : ℝ) - 1) / 2) < 1 / 8 := by  have h_eq : (1 - (1 - 1 / (4 * (M : ℝ) ^ 2))) * ((T : ℝ) * ((T : ℝ) - 1) / 2) =      (T : ℝ) * ((T : ℝ) - 1) / (8 * (M : ℝ) ^ 2) := by ring  rw [h_eq]  have hM_real : (1 : ℝ) ≤ (M : ℝ) := Nat.one_le_cast.mpr hM  have hT_real : (T : ℝ) ≤ (M : ℝ) := Nat.cast_le.mpr hT  have h_num : (T : ℝ) * ((T : ℝ) - 1) ≤ (M : ℝ) * ((M : ℝ) - 1) := by    rcases eq_or_ne T 0 with rfl | hT0    · simp; nlinarith    · have : (1 : ℝ) ≤ (T : ℝ) := Nat.one_le_cast.mpr (Nat.pos_iff_ne_zero.mpr hT0)      nlinarith  have h_den : 0 < 8 * (M : ℝ) ^ 2 := by positivity  have h_le : (T : ℝ) * ((T : ℝ) - 1) / (8 * (M : ℝ) ^ 2) ≤ (M : ℝ) * ((M : ℝ) - 1) / (8 * (M : ℝ) ^ 2) :=    div_le_div_of_nonneg_right h_num (le_of_lt h_den)  exact lt_of_le_of_lt h_le (arrival_discount_error_bound_lt_one_eighth M hM)
See it in the graphDiscuss this resultChallenge it