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

Teaching chapter 27 of 31 · Canonical route compiled

Absolute-loss guessing by projected subgradient descent

The full absolute-loss support set gives projected updates and square-root regret for canonical and played-legal finite-history policies.

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 Example 2.32.

Learning goals

  • Keep every support in [-1,1] when prediction equals the label.
  • Predict before feedback, then apply the actual selected support and interval projection.
  • Derive a same-run bound for every fixed comparator while retaining the sharp terminal-distance term.
  • Distinguish a horizon-indexed one-sided average bound from convergence of signed regret.
  • Distinguish support legality along the actual history from a universal off-path selector law.

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
Example 2.32, Algorithm 2.2 and its Theorem 2.13 transfer
Pages
printed1-3,13-20/PDF13-15,25-32
Open at the cited pages
canonical source-algorithm instance · ordered flow

Predict, reveal, select, clamp

Read top to bottom to follow the argument or procedure.

  1. Predict using the strict past

    Start at any X0 in [0,1] and output the current iterate before the current label is revealed.

  2. Select from the complete support set

    After feedback, use the actual canonical support of |x-y_t|. At a tie its value is unspecified within [-1,1].

  3. Apply the interval projection

    Clamp the raw selected-support update to [0,1]. The next iterate is feasible.

6 distinct theory routes, one frontier.Open the statement you want to compare; the other routes stay compact.
Source theorem · faithful restatementExample 2.32: the complete shifted support setCanonical absolute-loss OSDprinted20; dependencies printed1-3,13-15,16-19
Source theorem · faithful restatement

Example 2.32: the complete shifted support set

Original at printed20; dependencies printed1-3,13-15,16-19 ↗
Canonical absolute-loss OSDComplete ambient support-set equality for every real x and y, including all tie slopes. This card states no trajectory or cumulative-regret guarantee.

A matched prediction admits every slope between -1 and 1. Away from a match the supporting slope is unique.

Model
Literal absolute loss on all real x,y and its ambient global subdifferential.
Assumptions
Arbitrary real x and y; the supporting inequality is tested against every real comparison point, including outside [0,1].
Algorithm parameters
No horizon, rate, feasible-point or selected-support parameter appears in this equality.
Regret notion
Pointwise equality of sets, before a trajectory or cumulative regret is introduced.
Guarantee
Exact equality of the global subdifferential sets, including both interval endpoints at a tie.
Source mathematical statement. A matched prediction admits every slope between -1 and 1. Away from a match the supporting slope is unique.

BanditRLlib relationship. The source prints the full equality. The library proves it for arbitrary real x and y by translating the global absolute-value support condition. Theorem 2.28 alone gives only one inclusion.

Derived library resultThe actual canonical update, expressed as a clampCanonical absolute-loss OSDprinted20; dependencies printed1-3,13-15,16-19
Derived library result

The actual canonical update, expressed as a clamp

Source context at printed20; dependencies printed1-3,13-15,16-19 ↗
Canonical absolute-loss OSDCanonical and fixed deterministic finite-history absolute-loss policies are covered. Executable or randomized policy laws, independence of externally chosen policy/rates/initial state, an attained best-hindsight minimum, and chapter/book completion remain separate.

After the label is revealed, the shared selector chooses a global support at the current point and the genuine nearest-point projection clamps its update.

Model
Shared canonical selected-support update and actual nearest projection onto [0,1], applied at any real point and label.
Assumptions
The algebraic clamp and prefix identities have no positivity or feasibility premise. The selected-norm helper retains a feasible current point.
Algorithm parameters
The clamp identity allows every real eta; strict-prefix equality fixes the same initial point and compares labels/rates before t.
Regret notion
These are update and causality identities, not regret estimates.
Guarantee
The clamp identity holds for arbitrary real eta, label and current point. Prefix equality holds for equal strict-prefix labels and rates. Performance requires the separate feasible positive-horizon assumptions.
Derived mathematical statement. After the label is revealed, the shared selector chooses a global support at the current point and the genuine nearest-point projection clamps its update.

BanditRLlib relationship. This is the canonical-selector instantiation of Algorithm2.2, using the interval projection identity of Example2.14. The history-policy specialization below preserves the actual projected recurrence while allowing any legal tie choice.

Derived instantiation of source guaranteeA quantitative known-horizon regret boundCanonical absolute-loss OSDprinted20; dependencies printed1-3,13-15,16-19
Derived instantiation of source guarantee

A quantitative known-horizon regret bound

Source context at printed20; dependencies printed1-3,13-15,16-19 ↗
Canonical absolute-loss OSDCanonical and fixed deterministic finite-history absolute-loss policies are covered. Executable or randomized policy laws, independence of externally chosen policy/rates/initial state, an attained best-hindsight minimum, and chapter/book completion remain separate.

One prescribed run competes with every fixed comparator in [0,1]. The interval diameter and all-support norm bound are both one.

Model
Scalar real predictions and labels in [0,1]; the literal loss is |x-y|, embedded finitely in EReal.
Assumptions
Feasible initial point and comparator; label feasibility on the played prefix for the finite bound, on all rounds for the eventual corollary. Properness, global support existence, selected-support norm and regret bounds are proved from the loss.
Algorithm parameters
Source round1 is Lean index0. For positive known T, eta=1/sqrt(T) is constant during that run. The same run is compared with every u. At a tie the canonical support lies in the full interval [-1,1]; its value is unspecified.
Regret notion
R_T(u)=sum from t=0 to T-1 of |X_t-y_t|-|u-y_t|. It is signed. The source permits choosing y_t after observing X_t; the deterministic bound applies to each resulting label sequence.
Guarantee
R_T(u)<=sqrt(T). Dividing by T gives an eventual upper-epsilon inequality along separately tuned horizon runs. The finite theorem retains the source label premise even though the proof does not use it.
Derived explicit guarantee. One prescribed run competes with every fixed comparator in [0,1]. The interval diameter and all-support norm bound are both one.

BanditRLlib relationship. Example 2.32 states O(sqrt(T)) regret using the optimal rate. The displayed numerical constant and eta are derived by substituting D=G=1 into the preceding OSD/Theorem 2.13 tuning bound, rather than quoted as a printed formula.

Derived library resultDerived one-sided average guaranteeCanonical absolute-loss OSDprinted20; dependencies printed1-3,13-15,16-19
Derived library result

Derived one-sided average guarantee

Source context at printed20; dependencies printed1-3,13-15,16-19 ↗
Canonical absolute-loss OSDCanonical and fixed deterministic finite-history absolute-loss policies are covered. Executable or randomized policy laws, independence of externally chosen policy/rates/initial state, an attained best-hindsight minimum, and chapter/book completion remain separate.

The upper envelope 1/sqrt(T) vanishes. Actual signed average regret is eventually below each positive epsilon.

Model
Scalar real predictions and labels in [0,1]; the literal loss is |x-y|, embedded finitely in EReal.
Assumptions
Fixed globally feasible label sequence, feasible initial point, fixed feasible comparator u and epsilon>0.
Algorithm parameters
At each positive horizon T a separate run uses eta_T=1/sqrt(T). T=0 is outside the finite guarantee and immaterial to eventuality.
Regret notion
R_T(u)=sum from t=0 to T-1 of |X_t-y_t|-|u-y_t|. It is signed. The source permits choosing y_t after observing X_t; the deterministic bound applies to each resulting label sequence.
Guarantee
For fixed labels, initial point, comparator and epsilon>0, the signed average of the separately tuned runs is eventually <epsilon.
Derived mathematical statement. The upper envelope 1/sqrt(T) vanishes. Actual signed average regret is eventually below each positive epsilon.

BanditRLlib relationship. This is a library corollary of the finite bound. Each horizon selects its own constant-rate run. A one-sided inequality supplies no lower bound and does not establish signed convergence to zero or one anytime trajectory.

Derived instantiation of source guaranteeHistory policies: one run, every comparatorPlayed-legal absolute-loss policyprinted20/PDF32; fixed-rate transfer printed13-15,19
Derived instantiation of source guarantee

History policies: one run, every comparator

Source context at printed20/PDF32; fixed-rate transfer printed13-15,19 ↗
Played-legal absolute-loss policyCanonical and fixed deterministic finite-history absolute-loss policies are covered. Executable or randomized policy laws, independence of externally chosen policy/rates/initial state, an attained best-hindsight minimum, and chapter/book completion remain separate.

Any history-dependent tie choices are allowed when they are legal at the actual played points. The all-support bound is proved from the shared absolute-loss support set.

Model
Scalar absolute loss f_t(x)=|x-y_t| on the whole real line, shared nearest projection onto [0,1], and a fixed deterministic policy p receiving finite past losses/outputs and the current whole loss.
Assumptions
T is a positive integer, X0 is feasible, all played labels lie in [0,1], and every actual selected g_t is an ambient global support at the actual X_t. No universal off-path OracleLaw or supplied norm/regret bound is required.
Algorithm parameters
Use eta_T=1/sqrt(T) throughout the actual T-round run. Policy and initialization are held fixed across comparators; Lean index0 is source round1.
Regret notion
Signed sum R_T^p(u)=sum_(t<T)(|X_t-y_t|-|u-y_t|), compared with each fixed u in [0,1]. Source permits labels chosen after seeing the current prediction; the formal result is deterministic for the resulting exogenous sequence.
Guarantee
The same played-legal T-tuned run satisfies R_T^p(u)<=sqrt(T) for every feasible u.
Derived explicit guarantee. Any history-dependent tie choices are allowed when they are legal at the actual played points. The all-support bound is proved from the shared absolute-loss support set.

BanditRLlib relationship. Example2.32 prints O(sqrt(T)). The numerical constant follows from the fixed-rate OSD transfer with diameter and selected-support bound both one. The explicit policy interface and eventual family consequence are library refinements.

Derived instantiation of source guaranteeHistory-policy families: eventual upper averagePlayed-legal absolute-loss policyprinted20/PDF32; fixed-rate transfer printed13-15,19
Derived instantiation of source guarantee

History-policy families: eventual upper average

Source context at printed20/PDF32; fixed-rate transfer printed13-15,19 ↗
Played-legal absolute-loss policyCanonical and fixed deterministic finite-history absolute-loss policies are covered. Executable or randomized policy laws, independence of externally chosen policy/rates/initial state, an attained best-hindsight minimum, and chapter/book completion remain separate.

Hold the policy, labels, initial point and comparator fixed, and apply the finite bound to each separately prescribed horizon.

Model
Scalar absolute loss f_t(x)=|x-y_t| on the whole real line, shared nearest projection onto [0,1], and a fixed deterministic policy p receiving finite past losses/outputs and the current whole loss.
Assumptions
Fixed policy p, globally feasible label sequence y, feasible X0 and comparator u, and epsilon>0. For every positive T the separately T-tuned run has legal played supports.
Algorithm parameters
The same p,y,X0 are used across the horizon family; eta_T=1/sqrt(T) can change early predictions when T changes.
Regret notion
Signed sum R_T^p(u)=sum_(t<T)(|X_t-y_t|-|u-y_t|), compared with each fixed u in [0,1]. Source permits labels chosen after seeing the current prediction; the formal result is deterministic for the resulting exogenous sequence.
Guarantee
Eventually in integer T, R_T^{p,(T)}(u)/T<epsilon. This is one-sided upper control; it is neither signed convergence nor an absolute-regret bound nor a single anytime trajectory.
Derived explicit guarantee. Hold the policy, labels, initial point and comparator fixed, and apply the finite bound to each separately prescribed horizon.

BanditRLlib relationship. Example2.32 prints O(sqrt(T)). The numerical constant follows from the fixed-rate OSD transfer with diameter and selected-support bound both one. The explicit policy interface and eventual family consequence are library refinements.

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.

A curated route through definitions, key bridges, and canonical terminals stays visible. 12 additional dependency, extension, or research-frontier notes are grouped below.

Mathematics ↔ Lean

Three-case global support equality

Lean declarationBanditRL.OnlineGuessingSubgradient.example_2_32_subdifferential

Compiled

Plain-English statement. For arbitrary real x,y, the two strict cases and the full tie interval exhaust the global support set.

Mathematical reading. For arbitrary real x,y, the two strict cases and the full tie interval exhaust the global support set.
Intuition
For arbitrary real x,y, the two strict cases and the full tie interval exhaust the global support set.
Why it is needed
Explains one part of the canonical Example 2.32 integration.
Place in the proof
Orabona v10 Example 2.32, printed20/PDF32, with library support and derived specializations distinguished.
Proof and Lean reading notes
Proof idea
Split the order cases and compose the three support equalities.
Lean reading notes
The complete original declaration and proof remain unchanged; source assumptions and wider helper domains are described in the adjacent cards.
Teaching dependencies
BanditRL.OnlineGuessingSubgradient.loss_subgradient_positive, BanditRL.OnlineGuessingSubgradient.loss_subgradient_zero, BanditRL.OnlineGuessingSubgradient.loss_subgradient_negative
Exact Lean statement
theorem example_2_32_subdifferential (y x : ℝ) : SourceSubdifferential (loss y) x = if y < x then {(1 : ℝ)} else if x = y then Icc (-1 : ℝ) 1 else {(-1 : ℝ)}
Mathematics ↔ Lean

Same-run square-root regret

Lean declarationBanditRL.OnlineGuessingSubgradient.example_2_32

Compiled

Plain-English statement. For positive T, feasible initialization and played labels, one eta=1/sqrt(T) run satisfies R_T(u)<=sqrt(T) for every feasible u.

Mathematical reading. For positive T, feasible initialization and played labels, one eta=1/sqrt(T) run satisfies R_T(u)<=sqrt(T) for every feasible u.
Intuition
For positive T, feasible initialization and played labels, one eta=1/sqrt(T) run satisfies R_T(u)<=sqrt(T) for every feasible u.
Why it is needed
Explains one part of the canonical Example 2.32 integration.
Place in the proof
Orabona v10 Example 2.32, printed20/PDF32, with library support and derived specializations distinguished.
Proof and Lean reading notes
Proof idea
Produce diameter1, proper losses and the actual selected norm bound; instantiate shared OSD tuning.
Lean reading notes
The complete original declaration and proof remain unchanged; source assumptions and wider helper domains are described in the adjacent cards.
Teaching dependencies
BanditRL.OnlineGuessingSubgradient.loss_on_unitInterval, BanditRL.OnlineGuessingSubgradient.current_subgradient_bound, BanditRL.OnlineSubgradientDescent.iterate_mem, BanditRL.OnlineSubgradientDescent.regret_tuned
Exact Lean statement
theorem example_2_32 (y : ℕ → ℝ) (x₁ : ℝ) (hx₁ : x₁ ∈ Icc (0 : ℝ) 1) (T : ℕ) (hT : 0 < T) (hy : ∀ t < T, y t ∈ Icc (0 : ℝ) 1) : ∀ u ∈ Icc (0 : ℝ) 1, (∑ t ∈ range T, (|iterate BanditRL.OnlineGradientDescent.unitInterval (fun _ => 1 / Real.sqrt T) (fun s => loss (y s)) x₁ t - y t| - |u - y t|)) ≤ Real.sqrt T
Mathematics ↔ Lean

One played-legal run competes with every comparator

Lean declarationBanditRL.OnlineGuessingSubgradientPolicy.example_2_32

Compiled

Plain-English statement. Feasible initialization and played labels, positive prescribed T and played legality on the actual T-tuned run yield the same-run all-comparator constant-one bound.

Mathematical reading. Feasible initialization and played labels, positive prescribed T and played legality on the actual T-tuned run yield the same-run all-comparator constant-one bound.
Intuition
The policy receives whole functions and the actual finite history after prediction. Played legality is sufficient; the optional law for all off-path queries is stronger.
Why it is needed
An explicit absolute-loss specialization of the shared policy interface, with no duplicated loss, support or projection definition.
Place in the proof
Orabona v10 Example2.32 printed20/PDF32. Two helpers and two explicit refinements of one printed example.
Proof and Lean reading notes
Proof idea
Prove diameter1 and selected norm1 from the actual loss and instantiate generic policy tuning.
Lean reading notes
The original declaration and proof are preserved. Finite tuning retains the source label-feasibility premise although that binder is not used by its proof. The eventual result fixes policy and labels across separately prescribed horizons. Mathlib supplies the numerical reciprocal-square-root limit. Canonical and fixed deterministic finite-history absolute-loss policies are covered. Executable or randomized policy laws, independence of externally chosen policy/rates/initial state, an attained best-hindsight minimum, and chapter/book completion remain separate.
Teaching dependencies
BanditRL.OnlineSubgradientPolicy.regret_tuned, BanditRL.OnlineGuessingSubgradientPolicy.selected_bound, BanditRL.OnlineGuessingSubgradient.loss_on_unitInterval
Exact Lean statement
theorem example_2_32 (y : ℕ → ℝ) (x₁ : ℝ) (p : SupportPolicy (E := ℝ)) (hx₁ : x₁ ∈ Icc (0 : ℝ) 1) (T : ℕ) (hT : 0 < T) (hy : ∀ t < T, y t ∈ Icc (0 : ℝ) 1) (hlegal : LegalFeedback unitInterval (fun _ => 1 / Real.sqrt T) (fun s => loss (y s)) x₁ p T) : ∀ u ∈ Icc (0 : ℝ) 1, (∑ t ∈ range T, (|output unitInterval (fun _ => 1 / Real.sqrt T) (fun s => loss (y s)) x₁ p t - y t| - |u - y t|)) ≤ Real.sqrt T
Mathematics ↔ Lean

Upper average for the prescribed horizon family

Lean declarationBanditRL.OnlineGuessingSubgradientPolicy.example_2_32_average_eventually

Compiled

Plain-English statement. Fix p,y,X0 and a feasible comparator. Assume globally feasible labels and legal feedback for every positive T-tuned run. The signed average is eventually below every positive epsilon.

Mathematical reading. Fix p,y,X0 and a feasible comparator. Assume globally feasible labels and legal feedback for every positive T-tuned run. The signed average is eventually below every positive epsilon.
Intuition
The policy receives whole functions and the actual finite history after prediction. Played legality is sufficient; the optional law for all off-path queries is stronger.
Why it is needed
An explicit absolute-loss specialization of the shared policy interface, with no duplicated loss, support or projection definition.
Place in the proof
Orabona v10 Example2.32 printed20/PDF32. Two helpers and two explicit refinements of one printed example.
Proof and Lean reading notes
Proof idea
Divide the actual finite bound by positive T and use the reciprocal-square-root upper envelope.
Lean reading notes
The original declaration and proof are preserved. Finite tuning retains the source label-feasibility premise although that binder is not used by its proof. The eventual result fixes policy and labels across separately prescribed horizons. Mathlib supplies the numerical reciprocal-square-root limit. Canonical and fixed deterministic finite-history absolute-loss policies are covered. Executable or randomized policy laws, independence of externally chosen policy/rates/initial state, an attained best-hindsight minimum, and chapter/book completion remain separate.
Teaching dependencies
BanditRL.OnlineGuessingSubgradientPolicy.example_2_32
Exact Lean statement
theorem example_2_32_average_eventually (y : ℕ → ℝ) (x₁ : ℝ) (p : SupportPolicy (E := ℝ)) (hx₁ : x₁ ∈ Icc (0 : ℝ) 1) (hy : ∀ t, y t ∈ Icc (0 : ℝ) 1) (hlegal : ∀ T : ℕ, 0 < T → LegalFeedback unitInterval (fun _ => 1 / Real.sqrt T) (fun s => loss (y s)) x₁ p T) (u : ℝ) (hu : u ∈ Icc (0 : ℝ) 1) (ε : ℝ) (hε : 0 < ε) : ∀ᶠ T : ℕ in atTop, (∑ t ∈ range T, (|output unitInterval (fun _ => 1 / Real.sqrt T) (fun s => loss (y s)) x₁ p t - y t| - |u - y t|)) / T < ε
Explore 12 additional Lean teaching notes
Mathematics ↔ Lean

Translate global absolute supports

Lean declarationBanditRL.OnlineGuessingSubgradient.loss_subdifferential_translate

Compiled

Plain-English statement. The global support set of |x-y| at x equals that of |r| at r=x-y, for arbitrary real x,y.

Mathematical reading. The global support set of |x-y| at x equals that of |r| at r=x-y, for arbitrary real x,y.
Intuition
The global support set of |x-y| at x equals that of |r| at r=x-y, for arbitrary real x,y.
Why it is needed
Explains one part of the canonical Example 2.32 integration.
Place in the proof
Orabona v10 Example 2.32, printed20/PDF32, with library support and derived specializations distinguished.
Proof and Lean reading notes
Proof idea
Change the global comparison variable by translation in both directions.
Lean reading notes
The complete original declaration and proof remain unchanged; source assumptions and wider helper domains are described in the adjacent cards.
Teaching dependencies
BanditRL.OnlineGuessingSubgradient.loss
Exact Lean statement
theorem loss_subdifferential_translate (y x : ℝ) : SourceSubdifferential (loss y) x = SourceSubdifferential (fun z : ℝ => ((|z| : ℝ) : EReal)) (x - y)
Mathematics ↔ Lean

Support above the label

Lean declarationBanditRL.OnlineGuessingSubgradient.loss_subgradient_positive

Compiled

Plain-English statement. For y<x the entire support set is the singleton {1}.

Mathematical reading. For y<x the entire support set is the singleton {1}.
Intuition
For y<x the entire support set is the singleton {1}.
Why it is needed
Explains one part of the canonical Example 2.32 integration.
Place in the proof
Orabona v10 Example 2.32, printed20/PDF32, with library support and derived specializations distinguished.
Proof and Lean reading notes
Proof idea
Translate, then apply the positive absolute-value support equality.
Lean reading notes
The complete original declaration and proof remain unchanged; source assumptions and wider helper domains are described in the adjacent cards.
Teaching dependencies
BanditRL.OnlineGuessingSubgradient.loss_subdifferential_translate, BanditRL.OnlineConvex.abs_subgradient_positive
Exact Lean statement
theorem loss_subgradient_positive (y x : ℝ) (hxy : y < x) : SourceSubdifferential (loss y) x = {(1 : ℝ)}
Mathematics ↔ Lean

Every tie support

Lean declarationBanditRL.OnlineGuessingSubgradient.loss_subgradient_zero

Compiled

Plain-English statement. At x=y the entire support set is [-1,1], including nonzero supports and both endpoints.

Mathematical reading. At x=y the entire support set is [-1,1], including nonzero supports and both endpoints.
Intuition
At x=y the entire support set is [-1,1], including nonzero supports and both endpoints.
Why it is needed
Explains one part of the canonical Example 2.32 integration.
Place in the proof
Orabona v10 Example 2.32, printed20/PDF32, with library support and derived specializations distinguished.
Proof and Lean reading notes
Proof idea
Translate to zero and use the full interval characterization.
Lean reading notes
The complete original declaration and proof remain unchanged; source assumptions and wider helper domains are described in the adjacent cards.
Teaching dependencies
BanditRL.OnlineGuessingSubgradient.loss_subdifferential_translate, BanditRL.OnlineConvex.abs_subgradient_zero
Exact Lean statement
theorem loss_subgradient_zero (y : ℝ) : SourceSubdifferential (loss y) y = Icc (-1 : ℝ) 1
Mathematics ↔ Lean

Support below the label

Lean declarationBanditRL.OnlineGuessingSubgradient.loss_subgradient_negative

Compiled

Plain-English statement. For x<y the entire support set is the singleton {-1}.

Mathematical reading. For x<y the entire support set is the singleton {-1}.
Intuition
For x<y the entire support set is the singleton {-1}.
Why it is needed
Explains one part of the canonical Example 2.32 integration.
Place in the proof
Orabona v10 Example 2.32, printed20/PDF32, with library support and derived specializations distinguished.
Proof and Lean reading notes
Proof idea
Translate, then apply the negative absolute-value support equality.
Lean reading notes
The complete original declaration and proof remain unchanged; source assumptions and wider helper domains are described in the adjacent cards.
Teaching dependencies
BanditRL.OnlineGuessingSubgradient.loss_subdifferential_translate, BanditRL.OnlineConvex.abs_subgradient_negative
Exact Lean statement
theorem loss_subgradient_negative (y x : ℝ) (hxy : x < y) : SourceSubdifferential (loss y) x = {(-1 : ℝ)}
Mathematics ↔ Lean

Produce properness and support existence

Lean declarationBanditRL.OnlineGuessingSubgradient.loss_on_unitInterval

Compiled

Plain-English statement. Every real label gives a proper absolute loss with a nonempty global support at every feasible point.

Mathematical reading. Every real label gives a proper absolute loss with a nonempty global support at every feasible point.
Intuition
Every real label gives a proper absolute loss with a nonempty global support at every feasible point.
Why it is needed
Explains one part of the canonical Example 2.32 integration.
Place in the proof
Orabona v10 Example 2.32, printed20/PDF32, with library support and derived specializations distinguished.
Proof and Lean reading notes
Proof idea
Finite loss values prove properness; the three cases exhibit a support.
Lean reading notes
The complete original declaration and proof remain unchanged; source assumptions and wider helper domains are described in the adjacent cards.
Teaching dependencies
BanditRL.OnlineGuessingSubgradient.loss_subgradient_positive, BanditRL.OnlineGuessingSubgradient.loss_subgradient_zero, BanditRL.OnlineGuessingSubgradient.loss_subgradient_negative
Exact Lean statement
theorem loss_on_unitInterval (y : ℝ) : SubdifferentiableOn BanditRL.OnlineGradientDescent.unitInterval (loss y)
Mathematics ↔ Lean

Bound every global support

Lean declarationBanditRL.OnlineGuessingSubgradient.loss_subgradient_bound

Compiled

Plain-English statement. Every global support at any real prediction and label has norm at most1.

Mathematical reading. Every global support at any real prediction and label has norm at most1.
Intuition
Every global support at any real prediction and label has norm at most1.
Why it is needed
Explains one part of the canonical Example 2.32 integration.
Place in the proof
Orabona v10 Example 2.32, printed20/PDF32, with library support and derived specializations distinguished.
Proof and Lean reading notes
Proof idea
The singleton cases have norm1; the tie interval gives the same bound.
Lean reading notes
The complete original declaration and proof remain unchanged; source assumptions and wider helper domains are described in the adjacent cards.
Teaching dependencies
BanditRL.OnlineGuessingSubgradient.loss_subgradient_positive, BanditRL.OnlineGuessingSubgradient.loss_subgradient_zero, BanditRL.OnlineGuessingSubgradient.loss_subgradient_negative
Exact Lean statement
theorem loss_subgradient_bound (y x g : ℝ) (hg : g ∈ SourceSubdifferential (loss y) x) : ‖g‖ ≤ 1
Mathematics ↔ Lean

Bound the actual selected support

Lean declarationBanditRL.OnlineGuessingSubgradient.current_subgradient_bound

Compiled

Plain-English statement. At a feasible current point the canonical support selected for any real label has norm at most1.

Mathematical reading. At a feasible current point the canonical support selected for any real label has norm at most1.
Intuition
At a feasible current point the canonical support selected for any real label has norm at most1.
Why it is needed
Explains one part of the canonical Example 2.32 integration.
Place in the proof
Orabona v10 Example 2.32, printed20/PDF32, with library support and derived specializations distinguished.
Proof and Lean reading notes
Proof idea
Produce support membership through the shared interface, then apply the all-support bound.
Lean reading notes
The complete original declaration and proof remain unchanged; source assumptions and wider helper domains are described in the adjacent cards.
Teaching dependencies
BanditRL.OnlineGuessingSubgradient.loss_subgradient_bound, BanditRL.OnlineGuessingSubgradient.loss_on_unitInterval, BanditRL.OnlineSubgradientDescent.currentSubgradient_mem
Exact Lean statement
theorem current_subgradient_bound (y x : ℝ) (hx : x ∈ Icc (0 : ℝ) 1) : ‖currentSubgradient (loss y) x‖ ≤ 1
Mathematics ↔ Lean

Identify the actual clamp update

Lean declarationBanditRL.OnlineGuessingSubgradient.loss_step_clamp

Compiled

Plain-English statement. For arbitrary real rate, label and point, the actual step equals min(max(x-eta*G(f,x),0),1).

Mathematical reading. For arbitrary real rate, label and point, the actual step equals min(max(x-eta*G(f,x),0),1).
Intuition
For arbitrary real rate, label and point, the actual step equals min(max(x-eta*G(f,x),0),1).
Why it is needed
Explains one part of the canonical Example 2.32 integration.
Place in the proof
Orabona v10 Example 2.32, printed20/PDF32, with library support and derived specializations distinguished.
Proof and Lean reading notes
Proof idea
Unfold the shared step and its exact interval projection.
Lean reading notes
The complete original declaration and proof remain unchanged; source assumptions and wider helper domains are described in the adjacent cards.
Teaching dependencies
BanditRL.OnlineGradientDescent.project_unitInterval
Exact Lean statement
theorem loss_step_clamp (η y x : ℝ) : step BanditRL.OnlineGradientDescent.unitInterval η (loss y) x = min (max (x - η * currentSubgradient (loss y) x) 0) 1
Mathematics ↔ Lean

Strict-prefix equality

Lean declarationBanditRL.OnlineGuessingSubgradient.guessing_prefix

Compiled

Plain-English statement. Equal rates and labels before t give equal outputs at t from the same initial point.

Mathematical reading. Equal rates and labels before t give equal outputs at t from the same initial point.
Intuition
Equal rates and labels before t give equal outputs at t from the same initial point.
Why it is needed
Explains one part of the canonical Example 2.32 integration.
Place in the proof
Orabona v10 Example 2.32, printed20/PDF32, with library support and derived specializations distinguished.
Proof and Lean reading notes
Proof idea
Apply the shared recursive prefix theorem to the equal prefix losses.
Lean reading notes
The complete original declaration and proof remain unchanged; source assumptions and wider helper domains are described in the adjacent cards.
Teaching dependencies
BanditRL.OnlineSubgradientDescent.iterate_prefix
Exact Lean statement
theorem guessing_prefix (η η' : ℕ → ℝ) (y y' : ℕ → ℝ) (x₁ : ℝ) (t : ℕ) (hη : ∀ s < t, η s = η' s) (hy : ∀ s < t, y s = y' s) : iterate BanditRL.OnlineGradientDescent.unitInterval η (fun s => loss (y s)) x₁ t = iterate BanditRL.OnlineGradientDescent.unitInterval η' (fun s => loss (y' s)) x₁ t
Mathematics ↔ Lean

One-sided average over known horizons

Lean declarationBanditRL.OnlineGuessingSubgradient.example_2_32_average_eventually

Compiled

Plain-English statement. With globally feasible labels, the signed average regret against each fixed feasible comparator is eventually below every positive epsilon across separately tuned runs.

Mathematical reading. With globally feasible labels, the signed average regret against each fixed feasible comparator is eventually below every positive epsilon across separately tuned runs.
Intuition
With globally feasible labels, the signed average regret against each fixed feasible comparator is eventually below every positive epsilon across separately tuned runs.
Why it is needed
Explains one part of the canonical Example 2.32 integration.
Place in the proof
Orabona v10 Example 2.32, printed20/PDF32, with library support and derived specializations distinguished.
Proof and Lean reading notes
Proof idea
Divide the finite guarantee by positive T and use the reciprocal-square-root limit.
Lean reading notes
The eventual conclusion is one-sided; Mathlib Real.tendsto_sqrt_atTop and tendsto_inv_atTop_zero supply the numerical envelope limit.
Teaching dependencies
BanditRL.OnlineGuessingSubgradient.example_2_32
Exact Lean statement
theorem example_2_32_average_eventually (y : ℕ → ℝ) (x₁ : ℝ) (hx₁ : x₁ ∈ Icc (0 : ℝ) 1) (hy : ∀ t, y t ∈ Icc (0 : ℝ) 1) (u : ℝ) (hu : u ∈ Icc (0 : ℝ) 1) (ε : ℝ) (hε : 0 < ε) : ∀ᶠ T : ℕ in atTop, (∑ t ∈ range T, (|iterate BanditRL.OnlineGradientDescent.unitInterval (fun _ => 1 / Real.sqrt T) (fun s => loss (y s)) x₁ t - y t| - |u - y t|)) / T < ε
Mathematics ↔ Lean

Bound each actual legal support

Lean declarationBanditRL.OnlineGuessingSubgradientPolicy.selected_bound

Compiled

Plain-English statement. For arbitrary real labels, initialization and step schedule, legality of the actual selected supports through T implies norm at most1 at each t<T.

Mathematical reading. For arbitrary real labels, initialization and step schedule, legality of the actual selected supports through T implies norm at most1 at each t<T.
Intuition
The policy receives whole functions and the actual finite history after prediction. Played legality is sufficient; the optional law for all off-path queries is stronger.
Why it is needed
An explicit absolute-loss specialization of the shared policy interface, with no duplicated loss, support or projection definition.
Place in the proof
Orabona v10 Example2.32 printed20/PDF32. Two helpers and two explicit refinements of one printed example.
Proof and Lean reading notes
Proof idea
Apply the existing ambient absolute-loss support bound to played membership.
Lean reading notes
The original declaration and proof are preserved. Finite tuning retains the source label-feasibility premise although that binder is not used by its proof. The eventual result fixes policy and labels across separately prescribed horizons. Mathlib supplies the numerical reciprocal-square-root limit. Canonical and fixed deterministic finite-history absolute-loss policies are covered. Executable or randomized policy laws, independence of externally chosen policy/rates/initial state, an attained best-hindsight minimum, and chapter/book completion remain separate.
Teaching dependencies
BanditRL.OnlineGuessingSubgradient.loss_subgradient_bound
Exact Lean statement
theorem selected_bound (η : ℕ → ℝ) (y : ℕ → ℝ) (x₁ : ℝ) (p : SupportPolicy (E := ℝ)) (T : ℕ) (hlegal : LegalFeedback unitInterval η (fun s => loss (y s)) x₁ p T) (t : ℕ) (ht : t < T) : ‖selected unitInterval η (fun s => loss (y s)) x₁ p t‖ ≤ 1
Mathematics ↔ Lean

Identify the actual history-policy clamp

Lean declarationBanditRL.OnlineGuessingSubgradientPolicy.step_clamp

Compiled

Plain-English statement. The actual policy recurrence equals the interval clamp for every real initialization, label sequence and rate schedule, even without support legality.

Mathematical reading. The actual policy recurrence equals the interval clamp for every real initialization, label sequence and rate schedule, even without support legality.
Intuition
The policy receives whole functions and the actual finite history after prediction. Played legality is sufficient; the optional law for all off-path queries is stronger.
Why it is needed
An explicit absolute-loss specialization of the shared policy interface, with no duplicated loss, support or projection definition.
Place in the proof
Orabona v10 Example2.32 printed20/PDF32. Two helpers and two explicit refinements of one printed example.
Proof and Lean reading notes
Proof idea
Unfold the output successor and shared interval projection.
Lean reading notes
The original declaration and proof are preserved. Finite tuning retains the source label-feasibility premise although that binder is not used by its proof. The eventual result fixes policy and labels across separately prescribed horizons. Mathlib supplies the numerical reciprocal-square-root limit. Canonical and fixed deterministic finite-history absolute-loss policies are covered. Executable or randomized policy laws, independence of externally chosen policy/rates/initial state, an attained best-hindsight minimum, and chapter/book completion remain separate.
Teaching dependencies
BanditRL.OnlineSubgradientPolicy.output_succ, BanditRL.OnlineGradientDescent.project_unitInterval
Exact Lean statement
theorem step_clamp (η : ℕ → ℝ) (y : ℕ → ℝ) (x₁ : ℝ) (p : SupportPolicy (E := ℝ)) (t : ℕ) : output unitInterval η (fun s => loss (y s)) x₁ p (t + 1) = min (max (output unitInterval η (fun s => loss (y s)) x₁ p t - η t * selected unitInterval η (fun s => loss (y s)) x₁ p t) 0) 1

Maintainer contract

Open the canonical completion definition and blockers

One bounded Example2.32 route: the shared loss and twelve canonical proofs, plus four history-policy specialization proofs. All original canonical and policy canaries are retained.

Remaining blockers

  • Executable or randomized policy laws and an attained best-hindsight interface remain separate.
  • Other source obligations and chapter/book acceptance remain open.

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

  • Canonical and fixed deterministic finite-history absolute-loss policies are covered. Executable or randomized policy laws, independence of externally chosen policy/rates/initial state, an attained best-hindsight minimum, and chapter/book completion remain separate.
  • Purification is a separate status from compilation and integration.

All Lean modules in this chapter

Open the complete module list (2 modules)
ModuleDeclarationsProject importsStatus
BanditRLProof.OnlineGuessingSubgradient133Compiled
BanditRLProof.OnlineGuessingSubgradientPolicy42Compiled