AFTD Auto-Formalizing Theoretical Domains

op2130_variation_sum_lower

theoremverified

If n real martingale increments each have magnitude at least one half, their squared sum is at least n/4. The helper theorems give the alternating AND/OR suffix probability bounds needed by the decision-list construction.

Statement

theorem op2130_variation_sum_lower (n : ℕ) (a : Fin n → ℝ)
    (h : ∀ i, 1/2 ≤ |a i|) : (n : ℝ)/4 ≤ ∑ i, (a i)^2
Source
OP-2130, decision-list variation lower bound
Verified
24 Nov 2026
Axioms
Classical.choiceQuot.soundpropext
Used by 1

The proof, explained

The proof bounds the sum of squared increments from below by bounding each term individually and summing. Since each increment has magnitude at least $1/2$, its square is at least $1/4$ by expanding $(|a_i| - 1/2)^2 \ge 0$. Summing this lower bound over all $n$ indices gives $\sum_i a_i^2 \ge \sum_i 1/4 = n/4$. The accompanying helper theorems show by induction that the suffix probabilities of the alternating decision list stay within $[1/4, 1/2] \times [1/2, 3/4]$, ensuring each step has magnitude at least $1/2$.

  1. The probability bounds $1/4 \le (p_0)_1 \le 1/2$ and $1/2 \le (p_0)_2 \le 3/4$ hold in the base case $n = 0$. automation

    By definition, $p_0 = (1/2, 1/2)$, so the four inequalities evaluate to $1/4 \le 1/2 \le 1/2$ and $1/2 \le 1/2 \le 3/4$, which are verified by numerical evaluation.

    lines 8–9

      induction n with
      | zero => norm_num [op2130_decision_probs]
  2. If the probability bounds hold for $n$, they also hold for $n+1$. automation

    The recurrence defines $p_{n+1} = (p_n.2 / 2, (1 + p_n.1) / 2)$. Unpacking the induction hypothesis $1/4 \le p_n.1 \le 1/2$ and $1/2 \le p_n.2 \le 3/4$, dividing the bounds on $p_n.2$ by 2 gives $1/4 \le p_{n+1}.1 \le 3/8 \le 1/2$, and adding 1 then dividing the bounds on $p_n.1$ by 2 gives $1/2 \le 5/8 \le p_{n+1}.2 \le 3/4$. All four inequalities are verified by linear arithmetic.

    lines 10–16

      | succ n ih =>
          change 1/4 ≤ (op2130_decision_probs n).2 / 2 ∧
            (op2130_decision_probs n).2 / 2 ≤ 1/2 ∧
            1/2 ≤ (1 + (op2130_decision_probs n).1) / 2 ∧
            (1 + (op2130_decision_probs n).1) / 2 ≤ 3/4
          rcases ih with ⟨h1,h2,h3,h4⟩
          exact ⟨by linarith, by linarith, by linarith, by linarith⟩
  3. For every $n$, the decision increments satisfy $1/2 \le (p_n)_2$ and $1/2 \le 1 - (p_n)_1$. automation

    Applying the bounds from `op2130_decision_prob_bounds`, the inequality $1/2 \le (p_n)_2$ is immediate, and $(p_n)_1 \le 1/2$ rearranges to $1/2 \le 1 - (p_n)_1$. Linear arithmetic closes both conjuncts.

    lines 21–22

    uses op2130_decision_prob_bounds

      have h := op2130_decision_prob_bounds n
      constructor <;> linarith [h.1, h.2.1, h.2.2.1, h.2.2.2]
  4. For each index $i$, the squared increment satisfies $1/4 \le a_i^2$. automation

    From the assumption $|a_i| \ge 1/2$ and the identity $|a_i|^2 = a_i^2$ provided by `sq_abs`, the non-negativity of $(|a_i| - 1/2)^2$ from `sq_nonneg` implies $a_i^2 = |a_i|^2 \ge |a_i| - 1/4 \ge 1/4$, which non-linear arithmetic verifies.

    lines 26–30

    uses sq_abs, sq_nonneg

      have each : ∀ i, (1:ℝ)/4 ≤ (a i)^2 := by
        intro i
        have hi := h i
        have habs : |a i|^2 = (a i)^2 := sq_abs _
        nlinarith [sq_nonneg (|a i| - 1/2)]
  5. The sum of the squared increments is bounded below by $n/4 \le \sum_{i} a_i^2$. automation

    Summing the pointwise inequality $1/4 \le a_i^2$ over the entire index set of size $n$ using `Finset.sum_le_sum` over `Finset.univ` gives $\sum_{i} 1/4 \le \sum_{i} a_i^2$. The simplifier evaluates the sum of constants $\sum_{i=1}^n 1/4$ as $n \cdot (1/4) = n/4$ using `div_eq_mul_inv`.

    lines 31–32

    uses Finset.sum_le_sum, Finset.univ, div_eq_mul_inv

      have hs := Finset.sum_le_sum (s := Finset.univ) (fun i _ => each i)
      simpa [div_eq_mul_inv] using hs
op2130_decision_prob_bounds
For every $n$, the decision probabilities satisfy $1/4 \le (p_n)_1 \le 1/2$ and $1/2 \le (p_n)_2 \le 3/4$.
sq_abs
The square of the absolute value of an element equals its square: $|a|^2 = a^2$.
sq_nonneg
The square of any element in an ordered semiring is non-negative: $0 \le a^2$.
Finset.sum_le_sum
If $f(i) \le g(i)$ for all $i$ in a finite set $s$, then $\sum_{i \in s} f(i) \le \sum_{i \in s} g(i)$.
Finset.univ
The finset of all elements of a finite type.
div_eq_mul_inv
Division by $b$ is equal to multiplication by the inverse $b^{-1}$: $a / b = a \cdot b^{-1}$.

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

noncomputable def op2130_decision_probs : ℕ → ℝ × ℝ  | 0 => (1/2, 1/2)  | n+1 => let p := op2130_decision_probs n; (p.2 / 2, (1 + p.1) / 2)theorem op2130_decision_prob_bounds (n : ℕ) :    1/4 ≤ (op2130_decision_probs n).1 ∧ (op2130_decision_probs n).1 ≤ 1/2 ∧    1/2 ≤ (op2130_decision_probs n).2 ∧ (op2130_decision_probs n).2 ≤ 3/4 := by  induction n with  | zero => norm_num [op2130_decision_probs]  | succ n ih =>      change 1/4 ≤ (op2130_decision_probs n).2 / 2 ∧        (op2130_decision_probs n).2 / 2 ≤ 1/2 ∧        1/2 ≤ (1 + (op2130_decision_probs n).1) / 2 ∧        (1 + (op2130_decision_probs n).1) / 2 ≤ 3/4      rcases ih with ⟨h1,h2,h3,h4⟩      exact ⟨by linarith, by linarith, by linarith, by linarith⟩theorem op2130_decision_increment_bound (n : ℕ) :    1/2 ≤ (op2130_decision_probs n).2 ∧      1/2 ≤ 1 - (op2130_decision_probs n).1 := by  have h := op2130_decision_prob_bounds n  constructor <;> linarith [h.1, h.2.1, h.2.2.1, h.2.2.2]theorem op2130_variation_sum_lower (n : ℕ) (a : Fin n → ℝ)    (h : ∀ i, 1/2 ≤ |a i|) : (n : ℝ)/4 ≤ ∑ i, (a i)^2 := by  have each : ∀ i, (1:ℝ)/4 ≤ (a i)^2 := by    intro i    have hi := h i    have habs : |a i|^2 = (a i)^2 := sq_abs _    nlinarith [sq_nonneg (|a i| - 1/2)]  have hs := Finset.sum_le_sum (s := Finset.univ) (fun i _ => each i)  simpa [div_eq_mul_inv] using hs
See it in the graphDiscuss this resultChallenge it