Lean gate passed before this site build; local proof declarations are shown as compiled.Lean-verified build · exact declarations linked.
Teaching chapter 04 of 31 · Canonical route compiled
Projected OGD for the squared-loss guessing game
The actual projected square-loss OGD has a2sqrtT upper bound; a derived zero-stream construction compares its loss with the strict-prefix mean predictor.
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
Identify the actual interval projection with a clamp.
Derive square-loss regularity and gradient bounds.
Apply the shared OGD theorem to the same feasible trajectory.
Distinguish an upper-bound guarantee from an actual lower witness.
Produce both actual losses and a later natural witness for every prescribed loss-gap threshold.
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.14 and Equation(2.1); Chapter1 mean predictor
Read top to bottom to follow the argument or procedure.
01
Predict before the current label
The actual OGD iterate at time t uses only strict-prefix losses; every feasible initial point and comparator is allowed for the upper guarantee.
02
Differentiate and project the actual square loss
Its ambient gradient is2(x-y_t); global square regularity is proved, and actual projection clamps x-2eta(x-y_t) into[0,1]. Feasibility produces gradient norm<=2.
03
Use a horizon known in advance
For T>0 the shared same-trajectory tuned bound gives2sqrtT with eta1/(2sqrtT). This is a derived constant for the printed O(sqrtT), not future-gradient optimization.
04
Compare actual algorithms on the same zero stream
For square horizons, the actual OGD initial1 learns geometrically slowly. The source mean predictor starts1/2 and then predicts the zero strict-prefix average. Subtract their produced losses, rather than comparing two upper bounds.
3 distinct theory routes, one frontier.Open the statement you want to compare; the other routes stay compact.
Derived instantiation of source guaranteeExample 2.14: square-loss OGD, with a derived constantConcrete square-loss OGD source instanceprintedp15+
Derived instantiation of source guarantee
Example 2.14: square-loss OGD, with a derived constant
Concrete square-loss OGD source instanceOne square-loss OGD source instance and an explicit derived zero-stream comparison. The upper bound allows every feasible initial point; the comparison fixes OGD initialization1 and mean initialization1/2. Steps are tuned separately to known positive horizons. Other Chapter1/2 obligations and whole-book acceptance remain separate.
The square-loss gradient bound and clamp are derived for the actual OGD algorithm.
Model
Predictions, observations and comparator in[0,1]; squared loss.
Assumptions
Arbitrary feasible initial value, T>=1, observations feasible for all rounds before T.
Algorithm parameters
One horizon-tuned fixed step1/(2sqrtT).
Regret notion
Actual shared OGD recurrence versus every fixed feasible comparator.
Guarantee
At most2sqrtT, with exact gradient and projection identities.
Derived explicit guarantee.Formula renderer unavailable; readable fallback: The source O(sqrtT) upper-regret claim is established with an explicit valid constant2.\(R_T(u)\le 2\sqrt T,\qquad\eta=\frac1{2\sqrt T}\)Swipe to read the full formula →
BanditRLlib relationship. Example2.14 prints the gradient and projection formulas and an O(sqrtT) rate. Instantiating Equation(2.1) with interval diameter1 and gradient bound2 gives the displayed constant2 and step1/(2sqrtT). Square regularity is proved globally, so the historical stronger regularity API adds no hypothesis to the public upper theorem. The theorem quantifies over each feasible comparator; the source best-fixed interpretation additionally uses a feasible hindsight minimizer, never knowledge of that minimizer before prediction.
This displayed statement is derived in the library. The linked printedp15 supplies its source context; this explicit statement is not printed there as-is.
Derived library resultDerived zero-stream lower witnessActual lower witness for the comparisonprintedp15+
Actual lower witness for the comparisonPositive n only; the separate eta identity at n0 is total-division algebra, not a legal zero-horizon guarantee. At n1 the displayed gap lower bound is zero, not strict superiority.
The actual geometric OGD trajectory has loss at least n/4; the actual source mean predictor has loss1/4 on the same zero stream, so their gap is at least n/4-1/4.
Model
Same unit-interval squared-loss OGD, all labels0, initial1, comparator0.
Assumptions
n>=1, T=(2n)^2 and the same source step1/(2sqrtT)=1/(4n).
Algorithm parameters
Arbitrarily large square horizons.
Regret notion
Actual causal OGD regret, not a postulated prediction sequence.
Guarantee
Exact OGD trajectory and regret>=n/4, actual mean cumulative loss1/4, gap>=n/4-1/4; for every real C and natural N, some n>N has gap>C.
Derived mathematical statement.Formula renderer unavailable; readable fallback: All labels0 and initial1 produce square-root regret on arbitrarily large square horizons under the same tuned step.\(T=(2n)^2,\qquad R_T(0)\ge n/4=\sqrt T/8\)Swipe to read the full formula →
BanditRLlib relationship. This is a proved refinement supporting the source informal comparison, not a lower-bound theorem printed in Example2.14. It fixes OGD initial1, all-zero labels, comparator0 and positive square horizons. The numerical lower bound does not concern all streams, initializations, algorithms or Chapter4 optimality.
This displayed statement is derived in the library. The linked printedp15 supplies its source context; this explicit statement is not printed there as-is.
Derived library resultDerived comparison with the actual mean predictorActual direct same-stream comparisonprintedp15; source mean predictor printedp4+
Actual direct same-stream comparisonOne square-loss OGD source instance and an explicit derived zero-stream comparison. The upper bound allows every feasible initial point; the comparison fixes OGD initialization1 and mean initialization1/2. Steps are tuned separately to known positive horizons. Other Chapter1/2 obligations and whole-book acceptance remain separate. The comparison is not an equal-initialization or uniform-over-streams claim.
This is a direct comparison of two actual causal algorithms, with different disclosed fixed initializations.
Model
Same deterministic real zero stream/unit interval/squared losses.
Assumptions
Mean initial1/2; OGD initial1/comparator0; n>0 and T=(2n)^2. Zero comparator has zero optimal loss on this stream.
Algorithm parameters
Known-horizon OGD family eta=1/(4n); C any real and N any natural, with no extra positivity assumption on C.
Regret notion
OGD comparator0 regret equals its cumulative loss; subtract the actual mean-predictor cumulative loss, also its comparator0 regret on this stream.
Guarantee
Produced exact mean loss and actual lower gap, then an actual natural witness n>N with strict gap>C.
Derived mathematical statement.Formula renderer unavailable; readable fallback: The same zero labels yield exact mean-predictor loss one quarter and an OGD loss gap exceeding every threshold at some index beyond every cutoff.\(B_T=1/4\ (T>0),\quad R_{(2n)^2}(0)-B_{(2n)^2}\ge n/4-1/4,\quad\forall C\in\mathbb R\ \forall N\in\mathbb N\ \exists n>N:\ C<R_{(2n)^2}(0)-B_{(2n)^2}.\)Swipe to read the full formula →
BanditRLlib relationship. These are three derived statements, not three source-numbered results. The mean predictor definition uses the Chapter1 initial1/2 and strict-prefix average. The loss1/4 is proved directly from that definition, without using its general logarithmic regret theorem as a proof dependency. The terminal theorem is literal exists n>N, not a compiled Tendsto theorem or an anytime run.
This displayed statement is derived in the library. The linked printedp15; source mean predictor printedp4 supplies its source context; this explicit statement is not printed there as-is.
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. 4 additional dependency, extension, or research-frontier notes are grouped below.
Mathematical reading.Formula renderer unavailable; readable fallback: Interval projection equals clamp\(\Pi_{[0,1]}z=\min(\max(z,0),1)\)Swipe to read the full formula →
Intuition
Use the variational projection identity in the below/inside/above cases.
Why it is needed
Instantiates the source example in the same shared causal OGD library.
Place in the proof
Orabona v10 printedp15/PDF27.
Proof and Lean reading notes
Proof idea
Use the variational projection identity in the below/inside/above cases.
Lean reading notes
No regularity or gradient bound is assumed as a consumer premise; both are derived from squared loss and feasibility.
Mathematical reading.Formula renderer unavailable; readable fallback: Concrete projected square-loss update\(x_{t+1}=\min(\max(x_t-2\eta(x_t-y_t),0),1)\)Swipe to read the full formula →
Intuition
Rewrite the shared step with its proved gradient and interval projection.
Why it is needed
Instantiates the source example in the same shared causal OGD library.
Place in the proof
Orabona v10 printedp15/PDF27.
Proof and Lean reading notes
Proof idea
Rewrite the shared step with its proved gradient and interval projection.
Lean reading notes
No regularity or gradient bound is assumed as a consumer premise; both are derived from squared loss and feasibility.
Mathematical reading.Formula renderer unavailable; readable fallback: Explicit square-root regret bound\(R_T(u)\le2\sqrt T\)Swipe to read the full formula →
Intuition
Bound actual iterate gradients by feasibility and instantiate the shared tuned OGD theorem.
Why it is needed
Instantiates the source example in the same shared causal OGD library.
Place in the proof
Orabona v10 printedp15/PDF27.
Proof and Lean reading notes
Proof idea
Bound actual iterate gradients by feasibility and instantiate the shared tuned OGD theorem.
Lean reading notes
No regularity or gradient bound is assumed as a consumer premise; both are derived from squared loss and feasibility.
Plain-English statement. Actual unbounded gap beyond each cutoff
Mathematical reading.Formula renderer unavailable; readable fallback: Actual unbounded gap beyond each cutoff\(\forall C,N\ \exists n>N:\ C<R_{(2n)^2}(0)-B_{(2n)^2}.\)Swipe to read the full formula →
Intuition
Choose n>max(4C+1,N) using the actual Archimedean API, then use the produced lower gap.
Why it is needed
Directly supports source Example2.14 comparison with produced losses.
Place in the proof
Derived refinement supporting Example2.14, printed page15 / PDF page27; mean predictor defined on printed page4 / PDF page16.
Proof and Lean reading notes
Proof idea
Choose n>max(4C+1,N) using the actual Archimedean API, then use the produced lower gap.
Lean reading notes
Tail-existence for separately known-horizon runs, same zero stream/different fixed initializations; not a Tendsto/anytime/every-stream result.
Mathematical reading.Formula renderer unavailable; readable fallback: Exact square-loss gradient\(\nabla\ell_t(x)=2(x-y_t)\)Swipe to read the full formula →
Intuition
Differentiate the actual squared residual and identify its gradient.
Why it is needed
Instantiates the source example in the same shared causal OGD library.
Place in the proof
Orabona v10 printedp15/PDF27.
Proof and Lean reading notes
Proof idea
Differentiate the actual squared residual and identify its gradient.
Lean reading notes
No regularity or gradient bound is assumed as a consumer premise; both are derived from squared loss and feasibility.
Teaching dependencies
No direct teaching dependency recorded.
Exact Lean statement
theorem gradient_square (y x : ℝ) : gradient (fun x : ℝ => (x-y)^2) x = 2 * (x-y)
Plain-English statement. Constant zero labels yield a square-root regret lower bound for the tuned OGD.
Mathematical reading.Formula renderer unavailable; readable fallback: Constant zero labels yield a square-root regret lower bound for the tuned OGD.\(R_{(2n)^2}(0)\ge n/4\)Swipe to read the full formula →
Intuition
A small fixed step learns a constant target slowly.
Why it is needed
Substantiates the source comparison with an actual lower witness.
Place in the proof
Derived refinement supporting Example2.14, printed page15 / PDF page27; mean predictor defined on printed page4 / PDF page16.
Proof and Lean reading notes
Proof idea
Prove the exact geometric trajectory, apply Bernoulli to its first n terms, and sum their squared losses.
Lean reading notes
The exact horizon-selected step is identified separately; the initial point1 and comparator0 are fixed admissible choices.
Plain-English statement. Actual mean-predictor loss on zero labels
Mathematical reading.Formula renderer unavailable; readable fallback: Actual mean-predictor loss on zero labels\(B_T=1/4\quad(T>0).\)Swipe to read the full formula →
Intuition
Unfold the true initial1/2 and strict-prefix empirical mean0; only the first finite-sum term survives.
Why it is needed
Directly supports source Example2.14 comparison with produced losses.
Place in the proof
Derived refinement supporting Example2.14, printed page15 / PDF page27; mean predictor defined on printed page4 / PDF page16.
Proof and Lean reading notes
Proof idea
Unfold the true initial1/2 and strict-prefix empirical mean0; only the first finite-sum term survives.
Lean reading notes
Positive horizon needed; zero comparator is optimal on this stream.
Plain-English statement. Produced two-algorithm loss-gap lower
Mathematical reading.Formula renderer unavailable; readable fallback: Produced two-algorithm loss-gap lower\(R_{(2n)^2}(0)-B_{(2n)^2}\ge n/4-1/4.\)Swipe to read the full formula →
Intuition
Subtract produced exact mean loss from the actual OGD lower at the same positive square horizon.
Why it is needed
Directly supports source Example2.14 comparison with produced losses.
Place in the proof
Derived refinement supporting Example2.14, printed page15 / PDF page27; mean predictor defined on printed page4 / PDF page16.
Proof and Lean reading notes
Proof idea
Subtract produced exact mean loss from the actual OGD lower at the same positive square horizon.
Lean reading notes
At n1 displayed gap lower is0; fixed initializations differ.
Open the canonical completion definition and blockers
One source Example2.14 instance plus derived lower and direct-comparison refinements:12 theorem statements and one domain definition, with all three original canary modules. Chapter2 mandatory total remains null; not completion of Chapter2 or Chapter1 migration.
Remaining blockers
Other source, appendix and legacy obligations require separate target-level acceptance; compiled supporting code alone does not close them.
Chapter implementation status
The compact summary keeps the reading route visible. Open it for source-linked declarations and exact remaining gaps.