item_id
stringlengths
26
54
paper_id
stringlengths
10
22
target_name
stringlengths
4
33
source
stringclasses
2 values
nl_statement
stringlengths
78
1.64k
context
listlengths
1
16
⌀
nl_notes
stringlengths
0
1.77k
lean
stringlengths
395
9.09k
target_names
listlengths
1
4
topic_domain
stringclasses
6 values
topic_subtopic
stringclasses
16 values
holes
listlengths
1
1
ch9_theorem_9_2::ch9_theorem_9_2::A-stmt
ch9_theorem_9_2
ch9_theorem_9_2
Graduate-level
Let \(t \leqslant n\), \(L, R > 0\). There exists a convex \(L\)-Lipschitz function \(f\) such that any black-box procedure started at \(x_0 = 0\) satisfies \[ \min_{1 \leqslant s \leqslant t} f(x_s) - \min_{x \in B_2(R)} f(x) \geqslant \frac{RL}{2(1+\sqrt{t})}. \] Furthermore, there is an \(\alpha\)-strongly convex, \...
[ { "name": "Black-Box Procedure", "statement": "A \\textit{black-box procedure} generates a sequence of points \\(\\{x_t\\}\\) such that \\[ x_{t+1} \\in x_0 + \\Span\\{g_1, \\dots, g_t\\}, \\] and \\(g_s \\in \\partial f (x_s)\\)." } ]
SOURCE NOTE — the second claim of the source's Theorem 9.2 (eq. (9)) asserts an 'alpha-strongly convex, L-Lipschitz function f'. Read literally (Lipschitz on all of R^n), no such f exists for n >= 1: for g in the subdifferential at 0, f(r e_1) - f(0) >= -||g|| r + (alpha/2) r^2, which exceeds L r once r is large. So th...
import Mathlib open MeasureTheory RealInnerProductSpace namespace GraduateLevel def HasSubgradientAt {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] (f : E → ℝ) (g x : E) : Prop := ∀ y, f y ≥ f x + ⟪g, y - x⟫ def SubderivAt {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] (f : E → ℝ) ...
[ "ch9_theorem_9_2" ]
Optimization
Algorithms & Convergence
[ { "start": 670, "end": 1975, "gold": "(n t : ℕ) (L R α : ℝ)\n (ht : 1 ≤ t) (htn : t ≤ n) (hL : 0 < L) (hR : 0 < R) (hα : 0 < α) :\n (∃ f : EuclideanSpace ℝ (Fin n) → ℝ,\n ConvexOn ℝ Set.univ f ∧\n LipschitzOnWith L.toNNReal f (Metric.closedBall (0 : EuclideanSpace ℝ (Fin n)) R) ∧\n ...
ch3_theorem_3_3::ch3_theorem_3_3::A-stmt
ch3_theorem_3_3
ch3_theorem_3_3
Graduate-level
Assume \(f\colon\Omega\to\mathbb{R}\) is \emph{\(\alpha\)-strongly convex} and \emph{\(L\)-Lipschitz}. Let \(x^{*}\) be an optimizer of \(f\), and let \(x_{s}\) be the updated point at step \(s\) using projected gradient descent. Let the max number of iterations be \(t\) with an adaptive step size \(\eta_{s} = \frac{2}...
[ { "name": "lemma 2.3", "statement": "\\[\n\\| \\Pi_{\\Omega}(y) - x \\|^2 \\leqslant \\| y - x \\|^2 - \\| y - \\Pi_{\\Omega}(y) \\|^2\n\\]" }, { "name": "Jensen's inequality", "statement": "Assume \\(f\\colon\\Omega\\to\\mathbb{R}\\) is a convex function and \\(x_{1}, x_{2}, \\ldots, x_{n}, \\s...
NOTE — Model ∇f(x_s) as the g(x) of Definition 3.1: a vector satisfying the subgradient inequality of f at x_s on Ω. Do not assume f is differentiable. Assume this subgradient has norm at most L at every iterate x_s, 1 ≤ s ≤ t.
import Mathlib open scoped RealInnerProductSpace open Finset namespace GraduateLevel theorem ch3_theorem_3_3 {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E] (Ω : Set E) (f : E → ℝ) (f' : E → E) (proj : E → E) (α : ℝ) (L : NNReal) (t : ℕ) (x : ℕ → E) (xopt : E) ...
[ "ch3_theorem_3_3" ]
Optimization
Algorithms & Convergence
[ { "start": 116, "end": 1002, "gold": "{E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E] [CompleteSpace E]\n (Ω : Set E) (f : E → ℝ) (f' : E → E)\n (proj : E → E)\n (α : ℝ) (L : NNReal) (t : ℕ)\n (x : ℕ → E)\n (xopt : E)\n\n (hsc : StrongConvexOn Ω α f)\n\n (hLip : Lipschitz...
ch41_theorem_41_2::ch41_theorem_41_2::A-stmt
ch41_theorem_41_2
ch41_theorem_41_2
Graduate-level
Let \(x_1, \cdots, x_n\) be independent random variables (Lecture 41, opening paragraph). [Editorial, not in the source: each \(f_i\) is a function of \(x_i\), so that \(Z = \sup_{f\in\mathcal F}\sum_{i=1}^n f_i(x_i)\).] Let \(\mathcal{F}\) be a finite set of functions \(|{\mathcal{F}}| <\infty .\forall f=(f_{1},\cdots...
[ { "name": "Tensorization of entropy lemma (recalled, Lecture 41 opening paragraph)", "statement": "Recall the tensorization of entropy lemma we proved previously. Let \\(x_1, \\cdots, x_n\\) be independent random variables, \\(x'_1, \\cdots, x'_n\\) be their independent copies, \\(Z = Z(x_1, \\cdots, x_n)\\...
import Mathlib open MeasureTheory Real namespace GraduateLevel noncomputable def bennettH (u : ℝ) : ℝ := (1 + u) * Real.log (1 + u) - u theorem ch41_theorem_41_2 {n : ℕ} {α : Fin n → Type*} [∀ i, MeasurableSpace (α i)] (μ : ∀ i, Measure (α i)) [∀ i, IsProbabilityMeasure (μ i)] (F : Finset (∀ i, α i ...
[ "ch41_theorem_41_2" ]
Probability & Concentration
Functional & Supremum Concentration
[ { "start": 170, "end": 822, "gold": "{n : ℕ}\n {α : Fin n → Type*} [∀ i, MeasurableSpace (α i)]\n (μ : ∀ i, Measure (α i)) [∀ i, IsProbabilityMeasure (μ i)]\n (F : Finset (∀ i, α i → ℝ)) (hF : F.Nonempty)\n (hmeas : ∀ f ∈ F, ∀ i, Measurable (f i))\n (hbound : ∀ f ∈ F, ∀ i (a : α i), 0 ≤ f...
ch15_lemma_15_2::ch15_lemma_15_2::A-stmt
ch15_lemma_15_2
ch15_lemma_15_2
Graduate-level
Let \(x=(x_{1},\ldots,x_{n}),x^{\prime}=(x_{1}^{\prime},\ldots,x_{n}^{\prime})\) . If for functions \(\varphi_{1}(x,x^{\prime}),\varphi_{2}(x,x^{\prime}),\varphi_{3}(x,x^{\prime})\) \[\begin{array}{ r }{\mathbb{P}\left(\varphi_{1}(x,x^{\prime})\geq\varphi_{2}(x,x^{\prime})+\sqrt{\varphi_{3}(x,x^{\prime})\cdot t}\right)...
[ { "name": "lemma 15.1", "statement": "Let \\(\\xi,\\nu\\) - random variables.Assume that\n\\[\\mathbb{P}\\left(\\nu\\geq t\\right)\\leq\\Gamma e^{-\\gamma t}\\]\nwhere \\(\\Gamma\\geq 1,t\\geq 0\\) ,and \\(\\gamma > 0\\) . Furthermore, for all \\(a > 0\\) assume that\n\\[\\mathbb{E}\\phi(\\xi)\\le\\mathbb{E...
NOTE — The NL states the tail hypothesis at a single t. The Lean reads it as the source's proof uses it (through Lemma 15.1): `hyp` requires P(φ₁ ≥ φ₂ + √(φ₃·s)) ≤ Γe^{−γs} for every s ≥ 0, with Γ ≥ 1, γ > 0 and t ≥ 0 (`hΓ`, `hγ`, `ht`); the conclusion is at the given t.
import Mathlib open MeasureTheory ProbabilityTheory Real namespace GraduateLevel theorem ch15_lemma_15_2 {Ω Ω' : Type*} [MeasurableSpace Ω] [MeasurableSpace Ω'] (μ : Measure Ω) (μ' : Measure Ω') [IsProbabilityMeasure μ] [IsProbabilityMeasure μ'] (phi1 phi2 phi3 : Ω → Ω' → ℝ) (hmeas1 : Measurable ...
[ "ch15_lemma_15_2" ]
Probability & Concentration
Functional & Supremum Concentration
[ { "start": 112, "end": 1220, "gold": "{Ω Ω' : Type*} [MeasurableSpace Ω] [MeasurableSpace Ω']\n (μ : Measure Ω) (μ' : Measure Ω')\n [IsProbabilityMeasure μ] [IsProbabilityMeasure μ']\n (phi1 phi2 phi3 : Ω → Ω' → ℝ)\n (hmeas1 : Measurable (Function.uncurry phi1))\n (hmeas2 : Measurable (Fu...
ch7_theorem_7_3::ch7_theorem_7_3::A-stmt
ch7_theorem_7_3
ch7_theorem_7_3
Graduate-level
Let \(a_{1},\cdots,a_{n}\in\mathbb{R},\epsilon_{i},\cdots,\epsilon_{n}\) be i.i.d. Rademacher random variables: \(\mathbb{P}(\epsilon_{i}=1)=\mathbb{P}(\epsilon_{i}= -1)=0.5\) and \(0 < p < \infty\) . Then \[A_{p}\cdot\left(\sum_{i=1}^{n}\left|a_{i}\right|^{2}\right)^{1/2}\leq\left(\mathbb{E}\left|\sum_{i=1}^{n}a_{i}\e...
[ { "name": "theorem 7.1", "statement": "For \\(t \\geq 0\\)\n\\[\\mathbb{P}\\left(\\sum_{i=1}^{n}\\varepsilon_{i}a_{i}\\geq t\\right)\\leq\\exp\\left(-\\frac{t^{2}}{2\\sum_{i=1}^{n}a_{i}^{2}}\\right).\\]" } ]
import Mathlib open MeasureTheory ProbabilityTheory Real namespace GraduateLevel theorem ch7_theorem_7_3 : ∀ p : ℝ, 0 < p → ∃ Ap Bp : ℝ, 0 < Ap ∧ 0 < Bp ∧ ∀ (n : ℕ) {Ω : Type} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ] (ε : Fin n → Ω → ℝ) (_hindep : iIndepFun ε...
[ "ch7_theorem_7_3" ]
Probability & Concentration
Distributions, Tails & Moments
[ { "start": 108, "end": 675, "gold": ":\n ∀ p : ℝ, 0 < p →\n ∃ Ap Bp : ℝ, 0 < Ap ∧ 0 < Bp ∧\n ∀ (n : ℕ) {Ω : Type} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ]\n (ε : Fin n → Ω → ℝ)\n (_hindep : iIndepFun ε μ)\n (_hmeas : ∀ i, AEMeasurable (ε i) μ...
ch10_lemma_10_1::ch10_lemma_10_1::A-stmt
ch10_lemma_10_1
ch10_lemma_10_1
Graduate-level
If \(t\geq{\sqrt{\frac{2}{n}}}.\) then \[\mathbb{P}\left(\operatorname*{sup}_{C\in\mathcal{C}}\left|\frac{1}{n}\sum_{i=1}^{n}I(X_{i}\in C)-\mathbb{P}\left(C\right)\right|\geq t\right)\leq 2\mathbb{P}\left(\operatorname*{sup}_{C\in\mathcal{C}}\left|\frac{1}{n}\sum_{i=1}^{n}I(X_{i}\in C)-\frac{1}{n}\sum_{i=1}^{n}I(X_{i}^...
null
NOTE — The lemma as printed states no sampling model. The Lean uses the course's standard one: X_1, …, X_n have common law μ𝒳 and are independent (`hXlaw`, `hXindep`), X'_1, …, X'_n is an independent copy (`hX'law`, `hX'indep`, with X read on the first and X' on the second factor of μ.prod μ), and the sets in the clas...
import Mathlib open MeasureTheory ProbabilityTheory Real Filter open scoped ENNReal NNReal namespace GraduateLevel noncomputable def empFreq {Ω 𝒳 ι : Type*} (n : ℕ) (C : ι → Set 𝒳) (X : Fin n → Ω → 𝒳) (i' : ι) (ω : Ω) : ℝ := (n : ℝ)⁻¹ * ∑ k : Fin n, (C i').indicator (fun _ => (1 : ℝ)) (X k ω) noncomputable def...
[ "ch10_lemma_10_1" ]
Statistical Learning Theory
Generalization & Learnability
[ { "start": 689, "end": 1782, "gold": "{Ω 𝒳 ι : Type*} [MeasurableSpace Ω] [MeasurableSpace 𝒳]\n (μ : Measure Ω) [IsProbabilityMeasure μ]\n (μ𝒳 : Measure 𝒳)\n (n : ℕ) [NeZero n] (hn : 0 < n)\n (C : ι → Set 𝒳) (hC : ∀ i' : ι, MeasurableSet (C i'))\n (X X' : Fin n → Ω → 𝒳)\n (hXmeas...
ch4_theorem_4_12::ch4_theorem_4_12::A-stmt
ch4_theorem_4_12
ch4_theorem_4_12
Graduate-level
Assume that \(\phi(w, z) \in [0,1]\) for all \(w\) and \(z\). Then given \(\delta \in (0,1)\), with probability at least \(1 - \delta\), the following inequality holds: \[ \forall w\in\Omega:\phi(w,\mathcal{D})\leq\phi(w,\mathcal{S}_{n})+\epsilon_{n}(\delta), \] where \[ \epsilon_{n}(\delta)=\inf_{\epsilon>0}\left[2\ep...
[ { "name": "corollary 2.27", "statement": "Let \\(\\sigma_{i} = \\{\\pm 1\\}\\) be independent Bernoulli random variables ( each takes value \\(\\pm 1\\) with equal probability). Let \\(a_{i}\\) be fixed numbers \\((i=1,\\dots,n)\\) Then for all \\(\\epsilon >0\\) ..\n\\[\n\\Pr\\left(n^{-1}\\sum_{i=1}^{n}\\s...
NOTE — The Lean assumes the parameter set is countable (`hW_ctble`), which the NL statement does not state. Without it the statement is false: on the first uncountable ordinal with the countable/co-countable σ-algebra and φ(w, z) = 0 if z ≤ w else 1, every w has test loss 1 while any finite sample admits a w with empir...
import Mathlib open MeasureTheory ProbabilityTheory Real namespace GraduateLevel noncomputable def empLoss {𝒵 : Type*} {Ωp : Type*} {n : ℕ} (φ : Ωp → 𝒵 → ℝ) (Z : Fin n → 𝒵) (w : Ωp) : ℝ := (1 / (n : ℝ)) * ∑ i : Fin n, φ w (Z i) noncomputable def testLoss {𝒵 : Type*} [MeasurableSpace 𝒵] {Ωp : Type*} (...
[ "ch4_theorem_4_12" ]
Statistical Learning Theory
Generalization & Learnability
[ { "start": 1110, "end": 2459, "gold": "{𝒵 : Type*} [MeasurableSpace 𝒵]\n {Ωp : Type*}\n {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω) [IsProbabilityMeasure μ]\n (D : Measure 𝒵) [IsProbabilityMeasure D]\n (𝒲 : Set Ωp) (hW : 𝒲.Nonempty) (hW_ctble : 𝒲.Countable)\n (φ : Ωp → 𝒵 → ℝ)\n...
ch16_theorem_16_3::ch16_theorem_16_3::A-stmt
ch16_theorem_16_3
ch16_theorem_16_3
Graduate-level
Assume that rewards \(r_t(a) \in [0,1]\). Let \(a_* \in \arg \max_a \mu(a)\). With a choice of \[ \hat{c}_{t}(a)=\sqrt{\frac{\ln(2(\hat{n}_{t}(a)+1)^{2}/\delta)}{2\hat{n}_{t}(a)}}, \] we have with probability at least \(1 - \delta\): \[ \mathrm{REG}_{T}\leq(K-1)+\sqrt{8\ln(2 K T^{2}/\delta)(T-K)K}. \]
[ { "name": "Martingale Sub-Gaussian Inequality", "statement": "Consider a sequence of random functions \\(\\xi_1(S_1),\\ldots,\\xi_t(S_t),\\ldots\\) Assume each \\(\\xi_{i}\\) is sub-Gaussian with respect to \\(Z_{i}^{(y)}\\):\n\\[\n\\ln\\mathbb{E}_{Z_{i}^{(y)}}e^{\\lambda\\xi_{i}}\\leq\\lambda\\mathbb{E}_{Z...
NOTE — Do not use `ucbAlgorithmNL`. Model the run of Algorithm 16.1 by an arbitrary measurable, deterministic arm-selection rule that plays the arms in round-robin order during the warm-up and afterwards picks some maximiser of μ̂ + ĉ, with ties broken arbitrarily.
import Mathlib open MeasureTheory ProbabilityTheory Real Finset open scoped ENNReal NNReal namespace GraduateLevel lemma measurable_encode {α : Type*} {_ : MeasurableSpace α} [Encodable α] [MeasurableSingletonClass α] : Measurable (Encodable.encode (α := α)) := by refine measurable_to_nat fun a ↦ ?_ have...
[ "ch16_theorem_16_3" ]
Online Learning & RL
Bandits
[ { "start": 7277, "end": 8003, "gold": "{K T : ℕ} (hK : 0 < K) (hKT : K ≤ T)\n {δ : ℝ} (hδ0 : 0 < δ) (hδ1 : δ < 1)\n (ν : Kernel (Fin K) ℝ) [IsMarkovKernel ν]\n (hrew : ∀ a, (ν a) (Set.Icc 0 1) = 1)\n (nextA : (n : ℕ) → (Iic n → Fin K × ℝ) → Fin K)\n (hmeasA : ∀ n, Measurable (nextA n))\n ...
ch6_proposition_6_46::ch6_proposition_6_46::A-stmt
ch6_proposition_6_46
ch6_proposition_6_46
Graduate-level
Consider function class \(\mathcal{G} = \{\phi(w, z) : w \in \Omega\}\) with \(h(w) = \phi(w, \mathcal{D})\) and \(\inf_{w \in \Omega} h(w) = 0\). Assume that \(|\phi(\cdot)| \leq M\) and the variance condition (3.14) holds with \(c_0 = 0\). Assume that for any \(b > 0\), we have \[ \sup_{\mathcal{S}_{n}}R\left(\left\{...
[ { "name": "theorem 6.28", "statement": "Let \\(\\{\\phi_i\\}_{i=1}^n\\) be functions with Lipschitz constants \\(\\{\\gamma_i\\}_{i=1}^n\\) respectively. That is, \\(\\forall i \\in [n]\\):\n\\[\n\\left|\\phi_{i}(\\theta)-\\phi_{i}\\left(\\theta^{\\prime}\\right)\\right|\\leq\\gamma_{i}\\left|\\theta-\\thet...
NOTE — The Lean assumes the index set Ω is countable (`[Countable Ω]`), which the NL statement does not state. The conclusion is built from integrals of suprema over the class {φ w : w ∈ Ω}, and without countability the statement is false (on the first uncountable ordinal with the countable/co-countable 0–1 measure, φ(...
import Mathlib open MeasureTheory Real Set open scoped BigOperators ENNReal NNReal namespace GraduateLevel noncomputable def popVal {𝒵 Ω : Type*} [MeasurableSpace 𝒵] (D : Measure 𝒵) (φ : Ω → 𝒵 → ℝ) (w : Ω) : ℝ := ∫ z, φ w z ∂D noncomputable def empMean {𝒵 : Type*} (n : ℕ) (g : 𝒵 → ℝ) (S : Fin n → 𝒵) : ...
[ "ch6_proposition_6_46" ]
Statistical Learning Theory
Function Class Complexity
[ { "start": 936, "end": 2792, "gold": "{𝒵 Ω : Type*} [MeasurableSpace 𝒵] [Nonempty Ω] [Countable Ω]\n (D : Measure 𝒵) [IsProbabilityMeasure D]\n (n : ℕ) (hn : 1 ≤ n)\n (φ : Ω → 𝒵 → ℝ)\n (M c₁ α : ℝ)\n (hM : 0 < M) (hc₁ : 0 < c₁) (hα : 0 < α)\n (hInf : ⨅ w, popVal D φ w = 0)\n (hM...
ch13_theorem_13_2::ch13_theorem_13_2::A-stmt
ch13_theorem_13_2
ch13_theorem_13_2
Graduate-level
Consider a sequence of random functions \(\xi_1(S_1),\ldots,\xi_t(S_t),\ldots\) with filtration \(\{\mathcal{F}_t\}\). We have for any \(\delta \in (0,1)\) and \(\lambda >0\): \[ \operatorname*{Pr}\left[\exists n>0: -\sum_{i=1}^{n}\xi_{i}\geq\frac{\ln(1/\delta)}{\lambda}+\frac{1}{\lambda}\sum_{i=1}^{n}\ln\mathbb{E}_{Z_...
[ { "name": "lemma 13.1", "statement": "Consider a sequence of real-valued random (measurable) functions \\(\\xi_1(S_1),\\ldots,\\xi_T(S_T)\\). Let \\(\\tau \\leq T\\) be a stopping time so that \\(\\mathbb{1}(t\\leq \\tau)\\) is measurable in \\(S_{t}\\). We have\n\\[\n\\mathbb{E}_{\\mathcal{S}_{T}}\\exp\\le...
NOTE — The conditional MGF c(λ, i) is specified by its set-integral characterisation, not through Mathlib's `condExp`: for every λ > 0 and every F_{i−1}-measurable set s, ∫_s exp(−λ ξ_i) dμ = ∫_s c(λ, i) dμ, both as lintegrals of nonnegative functions (`hc_mgf`). No integrability of exp(−λ ξ_i) is assumed; where integr...
import Mathlib open MeasureTheory ProbabilityTheory namespace GraduateLevel def partialSum {Ω : Type*} (ξ : ℕ → Ω → ℝ) (n : ℕ) (ω : Ω) : ℝ := ∑ i ∈ Finset.Icc 1 n, ξ i ω theorem ch13_theorem_13_2 {Ω : Type*} [m₀ : MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m₀) (ξ : ℕ → Ω...
[ "ch13_theorem_13_2" ]
Probability & Concentration
Martingales & Dependent Data
[ { "start": 206, "end": 1290, "gold": "{Ω : Type*} [m₀ : MeasurableSpace Ω] {μ : Measure Ω} [IsProbabilityMeasure μ]\n (ℱ : Filtration ℕ m₀) (ξ : ℕ → Ω → ℝ) (hξ_adapted : Adapted ℱ ξ)\n (z : ℕ → Ω → ℝ) (hz_adapted : Adapted ℱ z)\n (A : ℕ → Set Ω) (hA : ∀ n, MeasurableSet[ℱ n] (A n))\n (c : ℝ ...
ch8_theorem_8_2::ch8_theorem_8_2::A-stmt
ch8_theorem_8_2
ch8_theorem_8_2
Graduate-level
Assume \(\sup_{Z,Z'}[\phi(f,Z) - \phi(f,Z')] \leq M\) for all \(f\), and the validation data \(\bar{S}_m\) contains \(m\) iid samples from \(\mathcal{D}\). Given training data \(S_n\), consider (8.2) with \[ r_{m}(q)=M\sqrt{\frac{\ln(1/q)}{2 m}}. \] Then with probability at least \(1 - \delta\) over the random selectio...
[ { "name": "Union Bound", "statement": "(Union Bound) Consider \\(m\\) events \\(E_1, \\ldots, E_m\\). The following probability inequality holds:\n\\[\n\\Pr (E_1 \\cup \\cdots \\cup E_m) \\leq \\sum_{j=1}^{m} \\Pr(E_j).\n\\]\n\nThe union bound has an alternative expression, which is often used in the learni...
import Mathlib open MeasureTheory ProbabilityTheory Real namespace GraduateLevel noncomputable def rPenalty (M : ℝ) (m : ℕ) (q : ℝ) : ℝ := M * Real.sqrt (Real.log (1 / q) / (2 * m)) noncomputable def popLoss {F Z : Type*} [MeasurableSpace Z] (φ : F → Z → ℝ) (D : MeasureTheory.Measure Z) (f : F) : ℝ := ∫ z, φ f ...
[ "ch8_theorem_8_2" ]
Statistical Learning Theory
Generalization & Learnability
[ { "start": 647, "end": 2457, "gold": "{F Z Θ : Type*} [MeasurableSpace Z] [Countable Θ] [Nonempty Θ]\n\n (φ : F → Z → ℝ)\n\n (D : MeasureTheory.Measure Z) [MeasureTheory.IsProbabilityMeasure D]\n\n (M : ℝ) (hM : 0 ≤ M)\n (hrange : ∀ (f : F) (z z' : Z), φ f z - φ f z' ≤ M)\n\n {m : ℕ} (hm ...
ch14_theorem_14_15::ch14_theorem_14_15::A-stmt
ch14_theorem_14_15
ch14_theorem_14_15
Graduate-level
Assume that for all \(t\): \[ \sup_{w\in\Omega}\ell_{t}(w)-\inf_{w\in\Omega}\ell_{t}(w)\leq M, \] then Algorithm 14.4 has regret \[ \sum_{t=1}^{T}\mathbb{E}_{w_{t-1}\sim p_{t-1}(\cdot)}\ell_{t}(w_{t-1})\leq\inf_{p\in\Delta(\Omega)}\left[\mathbb{E}_{w\sim p}\sum_{t=1}^{T}\ell_{t}(w)+\frac{1}{\eta}\mathrm{KL}(p| |p_{0})\...
[ { "name": "Hedge Algorithm", "statement": "Hedge Algorithm\nInput: \\(T\\), prior \\(p_{0}(w)\\) on \\(\\Omega\\), learning rate \\(\\eta > 0\\)\n1 Randomly draw \\(w_{0} \\sim p_{0}(w)\\)\n2 for \\(t = 1, 2, \\ldots, T\\) do\n3 \\quad Observe loss \\(\\ell_{t}(w_{t-1})\\)\n4 \\quad Randomly draw \\(w_{t} \...
import Mathlib open MeasureTheory ProbabilityTheory Real open scoped ENNReal namespace GraduateLevel noncomputable abbrev klDiv {α : Type*} [MeasurableSpace α] (μ ν : Measure α) : ℝ≥0∞ := _root_.InformationTheory.klDiv μ ν theorem ch14_theorem_14_15 {Ω : Type*} [MeasurableSpace Ω] [Nonempty Ω] (T : ℕ) (η...
[ "ch14_theorem_14_15" ]
Online Learning & RL
Online Learning & Regret
[ { "start": 261, "end": 1348, "gold": "{Ω : Type*} [MeasurableSpace Ω] [Nonempty Ω]\n (T : ℕ) (η M : ℝ) (hη : 0 < η)\n (ℓ : ℕ → Ω → ℝ)\n (p₀ : Measure Ω) [IsProbabilityMeasure p₀]\n (p : ℕ → Measure Ω) (hp₀ : p 0 = p₀)\n (hp : ∀ t < T, IsProbabilityMeasure (p t))\n (hpt_ac : ∀ t < T, p ...
ch9_theorem_9_35::ch9_ridge_excess_risk_bound::A-stmt
ch9_theorem_9_35
ch9_ridge_excess_risk_bound
Graduate-level
Assume that \( \mathcal{S}_n = \{(X_i, Y_i)\}_{1}^{n} \sim \mathcal{D}^n \), and \( \operatorname{Var}[\epsilon_i | X_i] \leq \sigma^2 \) for all \( X_i \). If we choose \( \lambda \) such that \( \lambda n > B^2 \geq \sup_x \psi(x)^\top \psi(x) \), then (9.18) satisfies \[ \mathbb{E}_{\mathcal{S}_{n}\sim\mathcal{D}^{n...
[ { "name": "lemma 9.34", "statement": "Let \\(\\{Y_i\\}_1^n\\) be independent samples conditioned on \\(\\{X_i\\}_1^n\\) according to (9.19). Given any vector \\(X\\) that is independent of \\(\\{Y_i\\}_1^n\\). If \\(\\mathbb{E}[\\epsilon_i|X_i] \\leq \\sigma^2\\) for all \\(i\\), then we have\n\\[\n\\mathbb...
NOTE — Model one data point as an outcome ω of a probability space with law D, and the training sample as n independent outcomes (ω_1, …, ω_n) ~ Dⁿ. The covariate X and the feature vector ψ = feat ∘ X are functions of ω. Give each sample position i its own response and noise functions on that space, Y_i = w_*ᵀψ + ε_i, ...
import Mathlib open MeasureTheory namespace GraduateLevel noncomputable def featureCovariance {Ω : Type*} [MeasurableSpace Ω] {d : ℕ} (D : Measure Ω) (ψ : Ω → (Fin d → ℝ)) : Matrix (Fin d) (Fin d) ℝ := Matrix.of fun j k => ∫ x, ψ x j * ψ x k ∂D noncomputable def linPred {Ω : Type*} {d : ℕ} (w : Fin d → ℝ)...
[ "ch9_ridge_excess_risk_bound" ]
Statistical Learning Theory
Statistical Estimation & Minimax Theory
[ { "start": 418, "end": 2180, "gold": "{Ω : Type*} [MeasurableSpace Ω] {𝒳 : Type*} [MeasurableSpace 𝒳] {d n : ℕ}\n (D : Measure Ω) [IsProbabilityMeasure D]\n (X : Ω → 𝒳) (feat : 𝒳 → (Fin d → ℝ))\n (ψ : Ω → (Fin d → ℝ)) (wstar : Fin d → ℝ)\n (ε : Fin n → Ω → ℝ) (Y : Fin n → Ω → ℝ)\n (wh...
ch5_theorem_5_14::ch5_theorem_5_14::A-stmt
ch5_theorem_5_14
ch5_theorem_5_14
Graduate-level
Consider any class \(\mathcal{F} = \{f_1, \ldots, f_d\}\), and assume that for a distribution \(\mathcal{D}\), \(\sup_{f \in \mathcal{F}} \|f\|_{L_2(\mathcal{D})} \leq A\). Then \[ \ln N(\epsilon,\operatorname{CONV}(\mathcal{F}),L_{2}(\mathcal{D}))\leq\lceil A^{2}/\epsilon^{2}\rceil\ln [e+e d\epsilon^{2}/A^{2}]. \]
[ { "name": "definition 5.12", "statement": "The convex hull of a function class \\(\\mathcal{F} = \\{f(\\theta, x) : \\theta \\in \\Theta\\}\\) is defined as\n\\[\n\\operatorname{CONV}(\\mathcal{F})=\\left\\{\\sum_{j=1}^{m}w_{j}f\\left(\\theta_{j},x\\right):m>0,\\|w\\|_{1}=1,w_{j}\\geq 0,\\theta_{j}\\in\\The...
import Mathlib open MeasureTheory Set open scoped ENNReal namespace GraduateLevel def IsENet {A : Type*} [PseudoMetricSpace A] (t : Finset A) (eps : ℝ) (s : Set A) : Prop := s ⊆ ⋃ x ∈ t, Metric.closedBall x eps noncomputable def coveringNumber {A : Type*} [PseudoMetricSpace A] (eps : ℝ) (s : Set A) : WithTop ...
[ "ch5_theorem_5_14" ]
Statistical Learning Theory
Function Class Complexity
[ { "start": 402, "end": 986, "gold": "{α : Type*} [MeasurableSpace α] (D : Measure α) [IsProbabilityMeasure D]\n [Fact (1 ≤ (2 : ℝ≥0∞))]\n {d : ℕ} (hd : 0 < d) (f : Fin d → (α → ℝ))\n (hf : ∀ j, MemLp (f j) 2 D)\n (ε A : ℝ) (hε : 0 < ε) (hA : 0 < A)\n (hbound : ∀ j, eLpNorm (f j) 2 D ≤ ENN...
ch6_corollary_6_34::corollary_6_34::A-stmt
ch6_corollary_6_34
corollary_6_34
Graduate-level
Consider a real valued function class \(\mathcal{F} = \{f(z):\mathcal{Z}\to \mathbb{R}\}\). Let \(\mathcal{D}\) be a distribution on \(\mathcal{Z}\). Assume that there exists \(M,\sigma >0\) so that \(\forall f\in \mathcal{F}\), \(\sigma^2 \geq \operatorname{Var}_{Z \sim \mathcal{D}}[f(Z)]\), and \(\sup_{z' \in \mathca...
[ { "name": "definition 6.1", "statement": "Given an empirical process \\(\\{\\phi(w, S_n) : w \\in \\Omega\\}\\), with \\(S_n \\sim \\mathcal{D}^n\\). Define the expected supremum of this empirical process as\n\\[\n\\epsilon_{n}(\\mathcal{G},\\mathcal{D})=\\mathbb{E}_{\\mathcal{S}_{n}}\\sup_{w\\in\\Omega}\\l...
import Mathlib open MeasureTheory ProbabilityTheory Real namespace GraduateLevel noncomputable def epsN {𝒵 : Type*} [MeasurableSpace 𝒵] (n : ℕ) (F : Set (𝒵 → ℝ)) (D : Measure 𝒵) : ℝ := ∫ ω, (⨆ f : F, ((∫ z, f.1 z ∂D) - (1 / (n : ℝ)) * ∑ i, f.1 (ω i))) ∂(Measure.pi (fun _ : Fin n => D)) theorem corolla...
[ "corollary_6_34" ]
Probability & Concentration
Functional & Supremum Concentration
[ { "start": 328, "end": 2661, "gold": "{𝒵 : Type*} [MeasurableSpace 𝒵]\n (n : ℕ) (hn : 0 < n)\n (F : Set (𝒵 → ℝ)) (hF : F.Nonempty)\n (D : Measure 𝒵) [IsProbabilityMeasure D]\n (hMemLp : ∀ f ∈ F, MemLp f 2 D)\n (hInt : Integrable (fun ω => ⨆ f : F,\n ((∫ z, f.1 z ∂D) - (1 / (n :...
ch15_theorem_15_6::ch15_theorem_15_6::A-stmt
ch15_theorem_15_6
ch15_theorem_15_6
Graduate-level
Consider the ridge regression method of (15.3), with \(\Lambda_0\) symmetric positive definite. We have the following result for any \(\sigma \geq 0\) and for all observed sequence \(S_T\): \[ \begin{array}{l}\sum_{t=1}^{T}\left[\frac{\left(Y_{t}-\hat{w}\left(\mathcal{S}_{t-1}\right)^{\top}\psi\left(X_{t}\right)\right)...
[ { "name": "proposition 15.5", "statement": "Consider probability model\n\\[\np(y|w,x)=N(w^{\\top}\\psi(x),\\sigma^{2}),\n\\]\nwith prior\n\\[\np_{0}(w)=N(0,\\sigma^{2}\\Lambda_{0}^{-1}).\n\\]\nThen given \\(\\mathcal{S}_n=\\{(X_1,Y_1),\\ldots,(X_n,Y_n)\\}\\) , we have\n\\[\np(w|\\mathcal{S}_{n})=N(\\hat{w}(...
import Mathlib open Matrix Finset namespace GraduateLevel def lambdaHat {d : ℕ} (Λ₀ : Matrix (Fin d) (Fin d) ℝ) (ψ : ℕ → (Fin d → ℝ)) (n : ℕ) : Matrix (Fin d) (Fin d) ℝ := Λ₀ + ∑ i ∈ Finset.range n, Matrix.vecMulVec (ψ i) (ψ i) noncomputable def ridgeEst {d : ℕ} (Λ₀ : Matrix (Fin d) (Fin d) ℝ) (ψ : ℕ → (F...
[ "ch15_theorem_15_6" ]
Online Learning & RL
Online Learning & Regret
[ { "start": 801, "end": 1185, "gold": "{d : ℕ}\n (Λ₀ : Matrix (Fin d) (Fin d) ℝ) (hΛ₀ : Λ₀.PosDef)\n (ψ : ℕ → (Fin d → ℝ)) (Y : ℕ → ℝ)\n (σ : ℝ) (hσ : 0 ≤ σ) (T : ℕ) :\n (∑ t ∈ Finset.range T,\n ((Y t - (ridgeEst Λ₀ ψ Y t) ⬝ᵥ (ψ t)) ^ 2 / bStep Λ₀ ψ t\n + σ ^ 2 * Real.log (bSt...
ch15_proposition_15_5::ch15_proposition_15_5::A-stmt
ch15_proposition_15_5
ch15_proposition_15_5
Graduate-level
Consider probability model \[ p(y|w,x)=N(w^{\top}\psi(x),\sigma^{2}), \] with prior \[ p_{0}(w)=N(0,\sigma^{2}\Lambda_{0}^{-1}). \] Then given \(\mathcal{S}_n=\{(X_1,Y_1),\ldots,(X_n,Y_n)\}\) , we have \[ p(w|\mathcal{S}_{n})=N(\hat{w}(\mathcal{S}_{n}),\sigma^{2}\hat{\Lambda}(\mathcal{S}_{n})^{-1}), \] where \(\hat{w} ...
[ { "name": "equation (15.3)", "statement": "The ridge regression method defines, for each \\(n\\),\n\\[\n\\hat{w}(\\mathcal{S}_{n})=\\arg\\min_{w}\\left[\\sum_{i=1}^{n}(Y_{i}-w^{\\top}\\psi(X_{i}))^{2}+\\|w\\|_{\\Lambda_{0}}^{2}\\right].\n\\]\nEquivalently,\n\\[\n\\hat{w}(\\mathcal{S}_{n})=\\Lambda_{n}^{-1}\...
import Mathlib open MeasureTheory ProbabilityTheory Real Matrix namespace GraduateLevel noncomputable def postPrec {d n : ℕ} (Λ₀ : Matrix (Fin d) (Fin d) ℝ) (ψ : (Fin n) → (Fin d → ℝ)) : Matrix (Fin d) (Fin d) ℝ := Λ₀ + ∑ i : Fin n, vecMulVec (ψ i) (ψ i) noncomputable def postMean {d n : ℕ} (Λ₀ : Matrix (Fin ...
[ "ch15_proposition_15_5" ]
Statistical Learning Theory
Statistical Estimation & Minimax Theory
[ { "start": 1248, "end": 1982, "gold": "{d n : ℕ} (σ : ℝ) (hσ : 0 < σ)\n (Λ₀ : Matrix (Fin d) (Fin d) ℝ) (hΛ₀ : Λ₀.PosDef)\n (ψ : (Fin n) → (Fin d → ℝ)) (Y : (Fin n) → ℝ)\n (φ : Fin d → ℝ)\n (prior : Measure (Fin d → ℝ))\n (hprior : ∀ c : Fin d → ℝ,\n prior.map (fun w => c ⬝ᵥ w)\n ...
ch2_theorem_2_1::theorem_2_1::A-stmt
ch2_theorem_2_1
theorem_2_1
Graduate-level
Let \(X_{1},\ldots,X_{n}\) be \(n\) iid Gaussian random variables \(X_{i}\sim N(\mu,\sigma^{2})\) and let \(\bar{X}_n = n^{-1}\sum_{i = 1}^n X_i\). Then given any \(\epsilon >0\): \[ 0.5e^{-n(\epsilon+\sigma/\sqrt{n})^{2}/2\sigma^{2}}\leq\operatorname*{Pr}(\bar{X}_{n}\geq\mu+\epsilon)\leq 0.5e^{-n\epsilon^{2}/2\sigma^{...
null
import Mathlib open MeasureTheory ProbabilityTheory Real namespace GraduateLevel noncomputable def sampleMean {Ω : Type*} {n : ℕ} (X : Fin n → Ω → ℝ) (ω : Ω) : ℝ := (1 / (n : ℝ)) * ∑ i, X i ω theorem theorem_2_1 {Ω : Type*} [MeasurableSpace Ω] (P : Measure Ω) [IsProbabilityMeasure P] (n : ℕ) (μ σ : ℝ) (X ...
[ "theorem_2_1" ]
Probability & Concentration
Distributions, Tails & Moments
[ { "start": 218, "end": 858, "gold": "{Ω : Type*} [MeasurableSpace Ω]\n (P : Measure Ω) [IsProbabilityMeasure P]\n (n : ℕ) (μ σ : ℝ) (X : Fin n → Ω → ℝ)\n (hσ : 0 < σ) (hn : 0 < n)\n (hX_meas : ∀ i, Measurable (X i))\n (hX_indep : ProbabilityTheory.iIndepFun X P)\n (hX_gaussian :\n ...
ch8_corollary_8_3::ch8_corollary_8_3::A-stmt
ch8_corollary_8_3
ch8_corollary_8_3
Graduate-level
Consider a countable family of approximate ERM algorithms \(\{\mathcal{A}(\theta, \cdot): \theta = 1, 2, \ldots\}\), each characterized by its model space \(\mathcal{F}(\theta)\), and returns a function \(\hat{f}_{\theta} \in \mathcal{F}(\theta)\) such that \[ \phi(\hat{f},\mathcal{S}_{n})\leq\inf_{f\in\mathcal{F}(\the...
[ { "name": "definition 8.1", "statement": "Consider a loss function \\(\\phi(f, z): \\mathcal{F} \\times \\mathcal{Z} \\to \\mathbb{R}\\), and a model family \\(\\{\\mathcal{A}(\\theta, S_n): \\Theta \\times \\mathcal{Z}^n \\to \\mathcal{F}, n \\geq 0\\}\\). Consider \\(N \\geq n \\geq 0\\), and iid dataset ...
import Mathlib open MeasureTheory ProbabilityTheory Real namespace GraduateLevel def RadSigns (n : ℕ) : Type := Fin n → ({-1, 1} : Finset ℤ) instance {n} : Fintype (RadSigns n) := inferInstanceAs (Fintype (Fin n → { x // x ∈ {-1, 1} })) noncomputable def empRadSigned {ι : Type*} {𝒳 : Type*} (n : ℕ) (f : ι →...
[ "ch8_corollary_8_3" ]
Statistical Learning Theory
Generalization & Learnability
[ { "start": 1011, "end": 3384, "gold": "{Z Pred : Type*} [MeasurableSpace Z] [Nonempty Z] [MeasurableSpace Pred]\n (D : Measure Z) [IsProbabilityMeasure D]\n (φ : Pred → Z → ℝ)\n (F : ℕ+ → Set Pred)\n (hFne : ∀ θ, (F θ).Nonempty)\n (hint : ∀ f, Integrable (fun z => φ f z) D)\n (M ε' εt ...
ch16_theorem_16_7::ch16_theorem_16_7::A-stmt
ch16_theorem_16_7
ch16_theorem_16_7
Graduate-level
Assume that the reward \(r_t(a) \in [0,1]\). Let \(a_* \in \arg \max_a \mu(a)\). With a choice of \[ \hat{c}_{t}(a)=\sqrt{\frac{\ln(2(\hat{n}_{t}(a)+1)^{2}/\delta)}{2\hat{n}_{t}(a)}}, \] we have \[ \mathrm{REG}_{T}\leq\inf_{\Delta_{0}>0}\left[(T-K)\Delta_{0}+\sum_{a=1}^{K}\frac{2\ln(2 K T^{2}/\delta)}{\Delta(a)}\mathbb...
[ { "name": "theorem 16.3", "statement": "Assume that rewards \\(r_t(a) \\in [0,1]\\). Let \\(a_* \\in \\arg \\max_a \\mu(a)\\). With a choice of\n\\[\n\\hat{c}_{t}(a)=\\sqrt{\\frac{\\ln(2(\\hat{n}_{t}(a)+1)^{2}/\\delta)}{2\\hat{n}_{t}(a)}},\n\\]\nwe have with probability at least \\(1 - \\delta\\):\n\\[\n\\m...
NOTE — Do not use `nlAlgo`. Model the run of Algorithm 16.1 by an arbitrary measurable, deterministic arm-selection rule that plays the arms in round-robin order during the warm-up and afterwards picks some maximiser of μ̂ + ĉ, with ties broken arbitrarily.
import Mathlib open MeasureTheory ProbabilityTheory Real Finset namespace GraduateLevel lemma measurable_encode {α : Type*} {_ : MeasurableSpace α} [Encodable α] [MeasurableSingletonClass α] : Measurable (Encodable.encode (α := α)) := by refine measurable_to_nat fun a ↦ ?_ have : Encodable.encode ⁻¹' {En...
[ "ch16_theorem_16_7" ]
Online Learning & RL
Bandits
[ { "start": 7133, "end": 8086, "gold": "{K : ℕ} (hK : 0 < K) (ν : Kernel (Fin K) ℝ) [IsMarkovKernel ν]\n (T : ℕ) (hKT : K ≤ T) (hT : 0 < T) (δ : ℝ) (hδ : 0 < δ) (hδ1 : δ ≤ 1)\n (hrewards : ∀ a, ∀ᵐ x ∂(ν a), x ∈ Set.Icc (0 : ℝ) 1)\n (nextA : (n : ℕ) → (Iic n → Fin K × ℝ) → Fin K)\n (hmeasA : ∀...
ch5_theorem_5_13::ch5_theorem_5_13::A-stmt
ch5_theorem_5_13
ch5_theorem_5_13
Graduate-level
Consider a finite function class \(\mathcal{F} = \{f_1, \ldots, f_d\}\), and assume that for a distribution \(\mathcal{D}\) and \(p \in [1, p]\), \(\sup_{f \in F} \|f\|_{L_p(\mathcal{D})} \leq A\). Then for \(\epsilon \leq A\): \[ \ln M(\epsilon,\operatorname{CONV}(\mathcal{F}),L_{p}(\mathcal{D}))\leq d\ln(3 A/\epsilon...
[ { "name": "theorem 5.3", "statement": "Let \\(\\| \\cdot \\|\\) be a seminorm on \\(\\mathbb{R}^k\\). Let \\(B(r) = \\{z \\in \\mathbb{R}^k : \\| z \\| \\leq r\\}\\) be the \\(\\| \\cdot \\|\\)-ball with radius \\(r\\). Then\n\\[\nM(\\epsilon,B(r),\\|\\cdot\\|)\\leq\\left(1+2 r/\\epsilon\\right)^{k}.\n\\]\n...
import Mathlib open MeasureTheory Real ENNReal namespace GraduateLevel def IsPacking {A : Type*} [PseudoMetricSpace A] (t : Finset A) (eps : ℝ) (s : Set A) : Prop := ↑t ⊆ s ∧ (↑t : Set A).Pairwise fun x y => eps < dist x y theorem ch5_theorem_5_13 {Ω : Type*} [MeasurableSpace Ω] (D : Measure Ω) [IsProbabi...
[ "ch5_theorem_5_13" ]
Statistical Learning Theory
Function Class Complexity
[ { "start": 258, "end": 661, "gold": "{Ω : Type*} [MeasurableSpace Ω]\n (D : Measure Ω) [IsProbabilityMeasure D]\n (d : ℕ)\n (p : ℝ≥0∞) [Fact (1 ≤ p)] (hp_top : p ≠ ⊤)\n (f : Fin d → Lp ℝ p D)\n (A : ℝ) (hA : 0 < A)\n (hbound : ∀ j, ‖f j‖ ≤ A)\n (ε : ℝ) (hε : 0 < ε) (hεA : ε ≤ A)\n ...