BanditRLlib
Lean gate passed before this site build; local proof declarations are shown as compiled.Lean-verified build · exact declarations linked.

Teaching chapter 02 of 31 · Canonical route compiled

Why Follow-the-Leader can incur linear regret

An actual strict-past FTL family on [-1,1] has exact comparator-zero regret T-1-x1/2 on the alternating loss sequence.

How to read the status. It describes this page's canonical local Lean route, not completion of the cited textbook chapter or every extension listed below.

Orientation

Who should read this. Readers of Orabona Chapter 2 convex-analysis foundations.

Learning goals

  • Compute the decision using strictly previous losses.
  • Verify feasibility and the historical minimization rule.
  • Derive the exact alternating-stream regret including the initial loss.

Textbook crosswalk

Read the mathematics before the Lean interface

This reading follows Online Learning: A Modern Introduction Using Convex Optimization. Teaching routes group mathematical dependencies across the shared library. Visible page labels use the cited source's numbered pages; source buttons use the PDF viewer's physical page index, including front matter. Companion papers cover algorithm-specific results.

Primary spine · arXiv:1912.13213v10, 21 June 2026

Online Learning: A Modern Introduction Using Convex Optimization

Francesco Orabona

Location
Section2.1.2, Example2.10 (Failure of FTL)
Pages
printedp12/PDF24
Open at the cited pages
causal recursive predictor · ordered flow

Actual linear-loss FTL

Read top to bottom to follow the argument or procedure.

  1. Accumulate past coefficients

    Let S_0=0. Before round t, S_t contains precisely the earlier coefficients. Reveal the current loss after the action and update S_(t+1)=S_t+z_t.

  2. Choose the historical minimizer

    At Lean time0 output feasible x0. At positive times choose1 if S_t<0 and -1 otherwise; zero-prefix ties choose -1. The source witness has S_t=+/-1/2 at every positive time.

  3. Evaluate the alternating stream

    The initial coefficient is -1/2. Later coefficients alternate +1,-1 and each later played loss equals 1.

Source theorem · faithful restatement

Example 2.10: Failure of FTL

Original at printedp12 ↗
Causal FTL and exact source counterexampleOne explicit FTL selection family with every feasible initialization, on the specified deterministic loss sequence. The generic positive-time zero-prefix tie chooses -1; this failure stream never has such a tie. The Lean target names this family rather than quantifying over arbitrary argmin trajectories. This is not an all-algorithm lower bound or Chapter 2/book completion.

An actual FTL strategy can have linear regret on convex linear losses.

Model
Linear losses z_t x on V=[-1,1].
Assumptions
Fixed x1 in [-1,1], T>=1. Source z1=-1/2, z_t=+1 on even t and -1 on odd t>1. Lean time0 corresponds to source round1; positive-time generic zero-prefix ties choose -1.
Algorithm parameters
All positive integer horizons and feasible initial choices.
Regret notion
Deterministic actual played-loss regret against the fixed feasible comparator0; no expectation or optimal-hindsight-comparator equality.
Guarantee
T-1-x1/2, hence at least T-3/2.
Source mathematical statement. Every later round incurs loss1; the initial loss is minus half the initial decision.

BanditRLlib relationship. The source lets the first action be arbitrary and asserts the later alternating endpoints. Lean realizes the rule with an explicit family indexed by the same arbitrary feasible initial action. The strict signs in this loss sequence force those endpoints. Generic ties are handled by choosing -1. Membership plus the objective inequality certify the concrete feasible FTL selection, including the empty past. The regret formula is then proved from actual played losses. Six helper theorems and three definitions refine this one example.

Natural-language and Lean side by side

The mathematical readings are explanatory summaries. The exact generated Lean statement and its source link remain authoritative for hypotheses, types, constants, and indexing.

Mathematics ↔ Lean

FTL uses only the strict past

Lean declarationBanditRL.OnlineLearning.linearFTLPredict_prefix

Compiled

Plain-English statement. FTL uses only the strict past

Mathematical reading. FTL uses only the strict past
Intuition
Equal past coefficient streams give the same prediction.
Why it is needed
Connects the actual causal FTL algorithm to the source counterexample.
Place in the proof
Orabona v10, Example 2.10, printed page 12 / PDF page 24.
Proof and Lean reading notes
Proof idea
Equal past coefficient streams give the same prediction.
Lean reading notes
Generic coefficient streams and any fixed real initial x0; strict-prefix equality excludes the current coefficient. This causality theorem alone does not assert feasibility or restrict an external initialization procedure.
Teaching dependencies
BanditRL.OnlineLearning.prefixCoefficient_eq_sum
Exact Lean statement
theorem linearFTLPredict_prefix (z w : ℕ → ℝ) (x0 : ℝ) (t : ℕ) (h : ∀ i < t, z i = w i) : linearFTLPredict z x0 t = linearFTLPredict w x0 t
Mathematics ↔ Lean

The predictor minimizes historical loss

Lean declarationBanditRL.OnlineLearning.linearFTLPredict_minimizes

Compiled

Plain-English statement. The selected action has no larger historical objective than any feasible comparator.

Mathematical reading. The selected action has no larger historical objective than any feasible comparator.
Intuition
The sign of the accumulated coefficient selects the correct interval endpoint.
Why it is needed
Connects the actual causal FTL algorithm to the source counterexample.
Place in the proof
Orabona v10, Example 2.10, printed page 12 / PDF page 24.
Proof and Lean reading notes
Proof idea
The sign of the accumulated coefficient selects the correct interval endpoint.
Lean reading notes
The inequality permits any real x0: at time0 both sums vanish. Combine linearFTLPredict_mem with feasible x0 in[-1,1] to obtain an actual feasible argmin. Later zero-prefix ties use -1; the source failure witness has none.
Teaching dependencies
BanditRL.OnlineLearning.prefixCoefficient_eq_sum
Exact Lean statement
theorem linearFTLPredict_minimizes (z : ℕ → ℝ) (x0 : ℝ) (t : ℕ) (u : ℝ) (hu : u ∈ Icc (-1 : ℝ) 1) : (∑ i ∈ range t, z i * linearFTLPredict z x0 t) ≤ ∑ i ∈ range t, z i * u
Mathematics ↔ Lean

Exact linear-regret counterexample

Lean declarationBanditRL.OnlineLearning.example_2_10

Compiled

Plain-English statement. Exact linear-regret counterexample

Mathematical reading. Exact linear-regret counterexample
Intuition
The alternating prefix forces each later prediction to incur loss1; keep the initial loss exactly.
Why it is needed
Connects the actual causal FTL algorithm to the source counterexample.
Place in the proof
Orabona v10, Example 2.10, printed page 12 / PDF page 24.
Proof and Lean reading notes
Proof idea
The alternating prefix forces each later prediction to incur loss1; keep the initial loss exactly.
Lean reading notes
Every feasible x0 and T>=1; comparator0 is fixed and feasible. Equality and lower bound use actual played losses, with initial loss -x0/2. Lean0 is source1. No T0 formula or lower bound against all algorithms. One explicit FTL selection family with every feasible initialization, on the specified deterministic loss sequence. The generic positive-time zero-prefix tie chooses -1; this failure stream never has such a tie. The Lean target names this family rather than quantifying over arbitrary argmin trajectories. This is not an all-algorithm lower bound or Chapter 2/book completion.
Teaching dependencies
BanditRL.OnlineLearning.failure_prediction
Exact Lean statement
theorem example_2_10 (x0 : ℝ) (hx0 : x0 ∈ Icc (-1 : ℝ) 1) (T : ℕ) (hT : 0 < T) : (∑ t ∈ range T, failureCoefficient t * linearFTLPredict failureCoefficient x0 t) - (∑ t ∈ range T, failureCoefficient t * (0 : ℝ)) = (T : ℝ) - 1 - x0 / 2 ∧ (T : ℝ) - 3/2 ≤ (∑ t ∈ range T, failureCoefficient t * linearFTLPredict failureCoefficient x0 t) - (∑ t ∈ range T, failureCoefficient t * (0 : ℝ))

Maintainer contract

Open the canonical completion definition and blockers

One source example, three literal definitions, six structural helper theorems and the exact regret theorem, with the two complete original canaries. One explicit FTL selection family with every feasible initialization, on the specified deterministic loss sequence. The generic positive-time zero-prefix tie chooses -1; this failure stream never has such a tie. The Lean target names this family rather than quantifying over arbitrary argmin trajectories. This is not an all-algorithm lower bound or Chapter 2/book completion.

Remaining blockers

  • Other Chapter 2 statements and full-book acceptance are separate.

Chapter implementation status

The compact summary keeps the reading route visible. Open it for source-linked declarations and exact remaining gaps.

Open 0 implementation records0 compiled · 0 partial · 0 blocked · 0 planned
MilestoneStatusLean declarationRemaining gap

Open boundaries

  • A universal theorem over externally supplied argmin trajectories is not part of this concrete-family API.
  • Purification and a full Exposition Seal remain separate.

All Lean modules in this chapter

Open the complete module list (1 modules)
ModuleDeclarationsProject importsStatus
BanditRLProof.OnlineFTLFailure101Compiled