From f13c784088ac9a1216354ab2e7bb3939938406c6 Mon Sep 17 00:00:00 2001 From: Remy Degenne Date: Sat, 28 Nov 2026 11:12:59 +0100 Subject: [PATCH 1/3] =?UTF-8?q?EValues:=20the=20game=20and=20large=20devia?= =?UTF-8?q?tions,=20generalized=20null=20laws=20with=20the=20Yosida?= =?UTF-8?q?=E2=80=93Hewitt=20decomposition,=20tests=20for=20unions=20of=20?= =?UTF-8?q?convex=20pieces,=20and=20the=20classes=20on=20which=20one=20e-p?= =?UTF-8?q?rocess=20attains=20the=20rate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0196ftMTph1jcT2Bg6VzaDTm --- LMLRoadmaps/EValues/README.md | 218 +++++++++++++++++++++++++---- LMLRoadmaps/EValues/Suggested.lean | 211 ++++++++++++++++++++++++++++ 2 files changed, 399 insertions(+), 30 deletions(-) diff --git a/LMLRoadmaps/EValues/README.md b/LMLRoadmaps/EValues/README.md index d90f2bc..3c3696c 100644 --- a/LMLRoadmaps/EValues/README.md +++ b/LMLRoadmaps/EValues/README.md @@ -52,7 +52,8 @@ Build the surrounding library at the generality of the literature: - conditional e-variables and test supermartingales stated with set integrals, with no integrability side conditions; - Lagrange duality for finitely many constraints, the essential supremum of a family of functions, - and the discrete-time Snell envelope. + the discrete-time Snell envelope, and the Yosida–Hewitt decomposition of finitely additive set + functions. `README.md` is the definitive specification; `Suggested.lean` records selected interfaces and is not an exhaustive checklist. @@ -62,19 +63,21 @@ Suggested homes: `LMLExplore/EValues/` for the material of this roadmap, mirrori `ProbabilityTheory.IsEVar`; and the mathematical home of each general tool: `LMLExplore/Probability/Martingale/` for the convergence and optional stopping of `ℝ≥0∞`-valued supermartingales, the exact Ville identity and the Snell envelope, -`LMLExplore/MeasureTheory/Function/` for the essential supremum of a family of functions, and +`LMLExplore/MeasureTheory/Function/` for the essential supremum of a family of functions, +`LMLExplore/MeasureTheory/Measure/` for the Yosida–Hewitt decomposition, and `LMLExplore/Analysis/Convex/` for Lagrange duality. ## Scope and dependencies This roadmap owns e-values and e-processes: their definitions for composite nulls, their validity, optimality and growth, their merging, and their use in sequential testing, confidence -sequences, multiple testing, conformal prediction and change detection. It also owns four general -tools that it needs and that no dependency provides: Lagrange duality for convex programs with -finitely many constraints (Layer 1.4), the convergence and optional stopping of `ℝ≥0∞`-valued -supermartingales at arbitrary stopping times (Layer 2.2), the essential supremum of a family of -functions with the discrete-time Snell envelope (Layer 3.1), and first-passage times of random -walks with positive drift (Layer 6.3). It owns the dual formula of $\mathrm K_{\inf}$ for +sequences, multiple testing, conformal prediction and change detection. It also owns five general +tools that it needs and that no dependency provides: the Yosida–Hewitt decomposition of finitely +additive set functions (Layer 1.1), Lagrange duality for convex programs with finitely many +constraints (Layer 1.4), the convergence and optional stopping of `ℝ≥0∞`-valued supermartingales at +arbitrary stopping times (Layer 2.2), the essential supremum of a family of functions with the +discrete-time Snell envelope (Layer 3.1), and first-passage times of random walks with positive +drift (Layer 6.3). It owns the dual formula of $\mathrm K_{\inf}$ for nonparametric classes (Layer 1.4), which the Identification roadmap's Layer 1.4 defines and does not compute, and the Wald inequality with a design (Layer 6.4), which the Identification roadmap's Layers 2.3 and 5.4 and the Bandits roadmap's Layer 4.4 use. @@ -212,6 +215,15 @@ functions are `ℝ≥0∞`-valued, and expectations are lower integrals `∫⁻` null, `klDiv` adds the difference of the masses and `klIntegral` is the divergence that the theory produces. +**Finitely additive measures.** A finitely additive measure on `Ω` is an additive content on its +measurable sets, Mathlib's `AddContent ℝ≥0∞ {s | MeasurableSet s}`. The limits of measures of mass +at most one for the convergence on every measurable set (which, on them, is the convergence of the +integrals of the bounded measurable functions) are finitely additive measures (Layers 1.1 and 6.1). +Such closures may be taken among all set functions `Set Ω → ℝ≥0∞` with the product topology: by +compactness, their restrictions to the measurable sets are the closure of the restrictions. The +countably additive part of a set function is the supremum of the measures below it on the +measurable sets (Layer 1.1). + **Conditional statements.** Conditional expectations of `ℝ≥0∞`-valued variables are not used. "$\mathbb E_P[X\mid m]\le Y$" is stated as `∀ s, MeasurableSet[m] s → ∫⁻ ω in s, X ω ∂P ≤ ∫⁻ ω in s, Y ω ∂P`, the form of LMLExplore's @@ -292,6 +304,13 @@ against any conditional law of the observations. The Generalization roadmap list the pull request that builds Layer 4.2 derives the four declarations from the general statement, and `laplacePredictor` and its time-uniform bound from them. +Layer 6.1's characterization of the classes on which one e-process attains the rate generalizes +`ProbabilityTheory.exists_isEProcess_ae_tendsto_log_div_bipolarRate` +(`EValues/BipolarRate/Universal.lean`: the alternatives dominated by an s-finite measure on a +countably generated space), whose proof uses the domination only through the family of block bets +`ProbabilityTheory.exists_iSup_integral_div_eq_bipolarRate`. The pull request that builds the +e-process from a family derives the merged theorem from it and from that family. + ## Layers and dependencies | Layer | Content | Prerequisites | @@ -482,13 +501,40 @@ of nulls of the literature. smallest subset of `L⁰₊(μ)` that contains `𝓔` and is convex, solid and closed in `μ`-probability. With all of `polarNull 𝓔` in place of its dominated members the statement is false: for `𝓔 = {1}` the bets must then be at most one everywhere. + - **Finitely additive set functions** [YH52]. Let `m` be an additive content of finite mass on + the measurable sets of `Ω` (Conventions) and `m_c` its countably additive part. + - A content dominated by a finite measure is countably additive: Mathlib's + `VectorMeasure.of_additive_of_le_measure` states it for real values; derive the form in + `ℝ≥0∞` from it. Prove that `m_c` is at most `m` on the measurable sets, so that it is the + largest measure below `m`: every measure below `m` is below the measure induced by `m` + (Mathlib's `OuterMeasure.ofFunction`, for which the measurable sets are Carathéodory + measurable by finite additivity), which is at most `m` on the measurable sets. + - **The Yosida–Hewitt decomposition.** The remainder `p = m - m_c` is purely finitely additive + (the only measure below it on the measurable sets is `0`); `m = m_c + p` is the only + decomposition of `m`, on the measurable sets, into a measure and a purely finitely additive + set function; and `p` is singular to every finite measure `R`: for every `ε > 0` some + measurable `E` has `R E + p Eᶜ < ε`. For the last, the set function + `A ↦ ⨅ B ⊆ A, R B + p (A \ B)`, over the measurable `B`, is finitely additive and below `R`, + hence a measure by the previous bullet, and below `p`, hence `0`. + - **The divergence to a set function.** For a measure `R` and a set function `ν`, let + `H(R | ν)` be the supremum, over the finite measurable partitions of `Ω` (measurable maps + `f : Ω → Fin k`), of `klIntegral` from `R.map f` to the measure on `Fin k` with the masses + `ν (f ⁻¹' {j})`. For a probability measure `R` and `m` of mass at most one, prove + `H(R | m) = klIntegral R m_c`. The inequality `≤` is data processing, the masses of `m` + being at least those of `m_c`. For `≥`, Tau Ceti's variational formula + `TauCeti.klDiv_eq_iSup_integral_sub_integral_exp_sub_one` reduces to bounded measurable + functions, approximated by step functions on a finite partition, which is then refined by a + set `E` as above where `R` and `p` are small. + + The generalized null laws of Layer 6.1 use the maximality of `m_c`, the singularity of `p` and + the inequality `klIntegral R m_c ≤ H(R | m)`; the next bullet uses `m_c`. - **No domination.** For any null on any measurable space, a measure is in `effectiveSet S` exactly when it is setwise below a member of the weak-* closed convex hull of `S` among the finitely additive measures of mass at most one; and the smallest relative entropy from a probability measure `Q` to the effective null equals the smallest one to that closure, the second minimum being attained at a finitely additive measure whose countably additive part - dominates the reverse information projection [EVR26, Note 40; RLRR26, Corollary 3.6, for the - equality of the minima]. + (previous bullet) dominates the reverse information projection [EVR26, Note 40; RLRR26, + Corollary 3.6, for the equality of the minima]. - Under domination, the effective null is the closure of the countable mixtures of `S` under limits in probability of the densities, made solid. Without domination this fails: a null on the countable ordinals, with the countable–co-countable σ-algebra, has a probability measure @@ -1233,12 +1279,70 @@ the effective null of the `n`-sample null. Write of `S₁` (Layer 1.1) lies in the saturation and `d` is `klInf` from `Q₁` to the saturation; for the weakly closed null on `ℕ` of the bullet on finite types, the probability measures of the saturation are the null itself [EVR26, Note 43, Proposition 1, Theorem 2, Example 3]. - - For a null that is a finite union of closed convex pieces of a parametric family, a test - supermartingale for the i.i.d. null is one for the i.i.d. null of the closed convex hull, so - its tests need `log (1/α) / a 1` observations in expectation and have no power inside the - hull; the minimum over the pieces of the likelihood ratios against the projections on the - pieces is an e-process whose `(1/n) log` tends to `KL_inf`, so that `d = KL_inf` there [EVR26, - Note 32]. + - **Generalized null laws** [EVR26, Note 43, Theorem 4 and Corollary 5]. The laws of the blocks + of a measure `P` on `𝓧` are the family `k ↦ P^{⊗(k+1)}` of set functions on + `Fin (k + 1) → 𝓧`. The generalized null laws of `S₁` are the closure of the families of the + members of `S₁` for the convergence on every set of every block (Conventions). For a null of + probability measures, prove that every block of a generalized null law `ν` is an additive + content of mass one on the measurable sets; that, on the measurable sets, `ν` is symmetric + under the permutations of the coordinates and a product on rectangles (its value at `a + b` + observations on `A × B` is the product of its values at `a` observations on `A` and at `b` + observations on `B`), hence consistent, conditions that hold for the laws of the blocks of a + member and are closed; and that the divergence `H(Q₁^{⊗(k+1)} | ν k)` (Layer 1.1) from the + power of `Q₁` to the block of `k + 1` observations is superadditive in the number `k + 1` of + observations. Prove, on any measurable space and for any null of probability measures, + `d = ⨅ ν, ⨆ k, H(Q₁^{⊗(k+1)} | ν k) / (k + 1)` over the generalized null laws, the infimum + being attained when the null is nonempty: the rate is the smallest divergence rate from `Q₁` + to a generalized null law. The partition formula of the bullet on countable types is the other + expression of [EVR26, Note 43, Theorem 4]; the minimizer comes from the compactness of the + closure and the closed sets of the `ν` with `H_π(Q₁^{⊗(k+1)} | ν k) ≤ (k + 1) (d + ε)`, for + the finite measurable partitions `π` of the blocks and `ε > 0`. Corollary: if, for every + generalized null law `ν` and every `k`, the countably additive part of `ν k` is the + `(k + 1)`-th power of that of the first block `ν 0` (read on `𝓧`), then + `d = ⨅ ν, klIntegral Q₁ (ν 0)_c = klInf Q₁ (iidSaturation S₁)` [EVR26, Note 43, Corollary 5]. + The countably additive parts of the blocks are below limits of laws of blocks of members, + hence in the effective nulls of the sample nulls (Layer 1.1), so that `(ν 0)_c` is in the + saturation; and the inequality `klIntegral R m_c ≤ H(R | m)` of Layer 1.1 at the minimizer + gives `klIntegral Q₁ (ν 0)_c ≤ d` there. + - **Unions of convex pieces** [EVR26, Note 32]. For a null that is a finite union of closed + convex pieces of a parametric family, a test supermartingale for the i.i.d. null is one for the + i.i.d. null of the closed convex hull, so its tests need `log (1/α) / a 1` observations in + expectation and have no power inside the hull; the minimum over the pieces of the likelihood + ratios against the projections on the pieces is an e-process whose `(1/n) log` tends to + `KL_inf`, so that `d = KL_inf` there. + - **Tests between two nulls** [EVR26, Note 32, Statement 1]. For nulls `H₀` and `H₁` of + probability measures on a countable `𝓧` with measurable singletons, the members of `H₁` + charging every point, an e-process `M` for `iidNull H₀`, a test supermartingale `M'` for + `iidNull H₁`, and levels `α, β ∈ (0, 1)` with `α + β ≤ 1`, the test `τ` that stops the + first time `α⁻¹ ≤ M` (rejecting `H₀`) or `β⁻¹ ≤ M'` (rejecting `H₁`) has + `kl(1 - α, β) / a 1(Q, H₁) ≤ E_Q[τ]` in `ℝ≥0∞` under the i.i.d. law of every `Q ∈ H₀`, with + `kl` the relative entropy of Bernoulli laws and `a 1(Q, H₁) = maxEPower Q H₁`; if moreover + `Q` is a pointwise limit of mixtures of members of `H₁`, the test stops with probability at + most `α + β` under the i.i.d. law of `Q`. The proof bounds, under the i.i.d. law of each + countable mixture `R` of members of `H₁` (for which `M'` is a test supermartingale, by the + closure above), the bet on the event that the test stops by rejecting `H₁` (LMLExplore's + `ProbabilityTheory.testBet`) with the Wald inequality of item 3 for the simple null `{R}`; + the infimum of `klDiv Q R` over these `R` is `a 1(Q, H₁)` (Layer 1.2). + - **The plug-in intersection–union test** [EVR26, Note 32, Statement 4]. An observation is a + vector of independent coins indexed by a finite `ι`, with law `prodBernoulli θ`. Let `C j`, + for `j` in a finite type, be convex sets of parameters in the open cube, `λ j φ ∈ C j` a + minimizer of `θ ↦ klDiv (prodBernoulli φ) (prodBernoulli θ)` over `C j` for every `φ` in the + open cube, and `ψ̂ k` any estimate with values in the open cube that is a function of the + observations before `k`. Prove that + `∏ k < n, prodBernoulli (ψ̂ k) {X k} / prodBernoulli (λ j (ψ̂ k)) {X k}` is a test + supermartingale for the sequential null of the piece `C j`, whatever the estimate, so that + the minimum `M n` over `j` is an e-process for the union of the sequential nulls of the + pieces and its test at `α⁻¹` has level `α`. If `ψ̂ k → ψ` almost surely under the i.i.d. law + of `prodBernoulli ψ`, with `ψ` in the open cube, prove that almost surely `(1/n) log (M n)` + tends to `KL_inf`, from `prodBernoulli ψ` to the union of the pieces, and + `τ α / log (1/α) → 1 / KL_inf` as `α → 0`, with `1 / 0 = ∞`. Given the past, the factor of + round `k` is the likelihood ratio against the projection on the piece, with the alternative + `ψ̂ k` fixed. + - Instance [EVR26, Note 32, Statement 3]: three coins with parameters in `[1/20, 19/20]³` and + the null `{θ 0 ≤ 1/2} ∪ {θ 1 ≤ 1/2}` ("candidate 1 is not the Condorcet winner"). The law of + the coins `(7/10, 3/5, c)` is a mixture of three laws of the null, so that `a 1 = 0` and the + tests of the test supermartingales for the i.i.d. null have no power against it, while + `d = KL_inf = kl(3/5, 1/2)`. - The inequality `d ≤ KL_inf(Q₁, S₁)` can be strict [RR26, Proposition 5.4], and one observation may carry no evidence when `d = KL_inf(Q₁, S₁) > 0`. Instances on the circle `ℝ / ℤ`, with `Q₁` its Lebesgue measure and `ε ∈ (0, 1]`: for the null of the laws @@ -1269,6 +1373,30 @@ the effective null of the `n`-sample null. Write convergence along setwise-convergent probability measures (`∫ f k ∂R k → ∫ g ∂Q` for uniformly bounded measurable `f k` tending pointwise to `g`, when `R k A → Q A` for every measurable `A`), and the setwise convergence of `R k^{⊗n}` to `Q^{⊗n}` that it gives. + - **The game between bets and the null, and large deviations.** For a null `T` of probability + measures on any measurable space `Ω` and a probability measure `Q`, the bet `e^g`, with `g` + bounded measurable, pays `∫ g ∂Q - log ∫ e^g ∂P` against `P ∈ T`. Prove that the max–min value + `⨆ g, ⨅ P ∈ T` of the payoff is `maxEPower Q T`, by dividing a bet by its upper expectation + (Layer 0.6), and that the min–max value `⨅ P ∈ T, ⨆ g` is `klInf Q T`, by Tau Ceti's + Donsker–Varadhan formula `TauCeti.klDiv_eq_iSup_integral_sub_log_integral_exp` for each `P` + [EVR26]. For `n` observations, `T = sampleNull S₁ n` and `Q = Q₁^{⊗n}`, the values are `a n` + and `n * KL_inf(Q₁, S₁)`: `d` is the limit of the max–min values divided by `n`, while the + min–max values divided by `n` are all `KL_inf(Q₁, S₁)`. For finitely many bounded measurable + `gᵢ` on `Ω` and a real `δ`, let `π m` be the largest probability, under `P^{⊗m}` for `P ∈ T`, + of the event that the average of each `gᵢ` over `m` observations is within `δ` of `∫ gᵢ ∂Q`, + and `c δ` the infimum of `klInf R T` over the probability measures `R` with + `|∫ gᵢ ∂R - ∫ gᵢ ∂Q| ≤ δ` for every `i`. Prove `π m ≤ exp (-m * c δ)` for every `m` and every + `δ`, and, for `δ > 0`, `limsup (1/m) log (1 / π m) ≤ c (δ / 2)`, by a change of measure to a + law of the smaller neighbourhood, under whose powers the event has probability tending to + one. So the suprema over the basic neighbourhoods of `Q` of the lower and of the upper + exponents of `π m` are both the neighbourhood envelope of `R ↦ klInf R T` at `Q` [EVR26, + Note 15]. For blocks of `n` observations (`T = sampleNull S₁ n`, `Q = Q₁^{⊗n}`), the exponents + per observation are at most `d`, and their supremum over `n ≥ 1` and the basic neighbourhoods + is `d`, by the previous bullet: the rate is the exponent, at `Q₁`, of the upper probability + under the null of the events given by statistics of blocks. Instance: for the coset null on + the circle with `ε ∈ (0, 1)`, the largest probability under the null of the event that the + empirical measure of `m` observations lies in a given basic neighbourhood of `Q₁` tends to `1` + for every such neighbourhood, while `d = log (1/ε) > 0` [EVR26, Note 19]. - For the sequential null of Layer 4.5, `a n = n * maxUtility Q₁ S₁ logUtility` (Statlib's `maxUtility_prod_eq_add`), and the product of the numeraires has `(1/n) log (E n) → maxUtility Q₁ S₁ logUtility` almost surely when @@ -1305,7 +1433,34 @@ the effective null of the `n`-sample null. Write `{Q' | klDiv Q₁ Q' ≤ ε}` of `Q₁`, the numeraires of the `n`-sample nulls under the mixtures $\int Q'^{\otimes n}\,\nu(dQ')$ have `(1/n) log` tending to `d(Q₁)` almost surely under the i.i.d. law of `Q₁` [EVR26, Note 14]: the asymptotic log-optimality of the mixture numeraires - that [RW, Chapter 6] conjectures, with the rate `d`. + that [RW, Chapter 6] conjectures, with the rate `d`. The first statement is the case of the + alternatives `Q₁ ≪ ρ` of the classes on which the rate is attained (two bullets below), with + the family of block bets of the next bullet. + - **Block bets for a class of alternatives.** The lemma behind the first statement of the + previous bullet, as a statement of its own: for a countably generated `𝓧`, any null and a + σ-finite `ρ`, there are bounded measurable `g i` on `𝓧^{m i}` with `∫ e^{g i} dP^{⊗ m i} ≤ 1` + on the null and `⨆ i, (1 / m i) ∫ g i dQ^{⊗ m i} = d Q` for every probability measure + `Q ≪ ρ` [EVR26, Note 13]. Item 3 and item 4 use it. + - **The classes on which one e-process attains the rate** [EVR26, Note 55, Proposition 1]. A + process `E` attains the rate on a set `𝒬` of probability measures on `𝓧` when + `(1/n) log (E n)` tends to `d(Q)` almost surely under the i.i.d. law of every `Q ∈ 𝒬`. On any + measurable space, for any null `S₁` of probability measures and any `𝒬`, prove that the + following are equivalent: some e-process for the i.i.d. null, in the filtration `piLT`, + attains the rate on `𝒬`; some `n`-sample e-variables `M n`, `n ≥ 1`, evaluated at the first + `n` observations, have `d(Q) ≤ liminf (1/n) log (M n)` almost surely under the i.i.d. law of + every `Q ∈ 𝒬`; countably many bounded measurable `g i` on `𝓧^{m i}`, `m i ≥ 1`, with + `∫ e^{g i} dP^{⊗ m i} ≤ 1` for every `P ∈ S₁`, have `⨆ i, (1 / m i) ∫ g i dQ^{⊗ m i} = d(Q)` + for every `Q ∈ 𝒬`. From the second condition to the third, take the bets + `log (1/2 + min (M n) (exp (n²)) / 2)` of `n` observations and apply Fatou's lemma. From such + a family, with only `d(Q) ≤ ⨆ i, …` (the other inequality holds for every such family), build + one e-process for the i.i.d. null, nondecreasing in time, whose supremum over time is an + e-variable for the i.i.d. null, with `(1/n) log (E n) → d(Q)` almost surely and + `(1/n) E_Q[log (E n)] → d(Q)` at every `Q ∈ 𝒬`; item 3 gives its tests. The construction of the + dominated case applies, domination serving only to build the family. Instances: the + alternatives dominated by an s-finite measure on a countably generated space, with the family + of the previous bullet; and every countable class, with the union of families that approach + each `a n (Q) / n` at one alternative `Q`. [Ram26, Theorem 3.1] (item 2) is the analogue for + power one, with countably many finite-block events in place of block bets. - **Mixture numeraires: regret and growth in expectation.** On any measurable space, for a null `T` of measures of mass at most one, probability measures `μ`, `Qbar` and `R` with `∫⁻ Z ∂R ≤ c * ∫⁻ Z ∂Qbar` for every measurable `Z` and some `c < ∞`, `klDiv μ R < ∞`, and an @@ -1330,11 +1485,6 @@ the effective null of the `n`-sample null. Write (`ν {Q' | klDiv Q₁ Q' ≤ ε} > 0` for every `ε > 0`, as an outer measure), on any measurable space. For a countable class `{Q j}` and `ν = ∑ j, 2^{-(j+1)} • δ (Q j)`, this is one e-process at the rate at every `Q j`, with no countable generation and no dominating measure. - - **Block bets for a class of alternatives.** The lemma behind the previous bullet, as a - statement of its own: for a countably generated `𝓧`, any null and a σ-finite `ρ`, there are - bounded measurable `g i` on `𝓧^{m i}` with `∫ e^{g i} dP^{⊗ m i} ≤ 1` on the null and - `⨆ i, (1 / m i) ∫ g i dQ^{⊗ m i} = d Q` for every probability measure `Q ≪ ρ` [EVR26, - Note 13]. Item 3 and item 4 use it. - **Bahadur slopes.** For every sequence of p-variables `p n` of the `n`-sample nulls, `limsup (1/n) log (1 / p n) ≤ d` almost surely under `Q`, with convergence to `d` for the inverses of the numeraires, so that the best exact slope in Bahadur's sense is `2 d`. @@ -1395,13 +1545,15 @@ the effective null of the `n`-sample null. Write reaches `α⁻¹` [EVR26, Note 01]. The bound with $\mathrm{KL}_{\inf}$ is not attained in general: for the null of [RR26, Proposition 5.4], $\mathrm{KL}_{\inf}>1/2$ and no power-one test exists (item 2). - - **One test for every dominated alternative.** Under the hypotheses of the block bets of - item 1, one nondecreasing e-process, built from those bets with the adjusted running maximum - of [RW, Section 7.9], gives tests `τ α = inf {n | α⁻¹ ≤ E n}` with - `E_Q[τ α] / log (1/α) → 1 / d Q` and `τ α / log (1/α) → 1 / d Q` almost surely, for every - `Q ≪ ρ` with `0 < d Q < ∞`: the bound of the first bullet is attained in expectation at every + - **One test for every alternative of a class.** For a countable family of bounded block bets + with `d(Q) ≤ ⨆ i, (1 / m i) ∫ g i dQ^{⊗ m i}` at every `Q` of a class `𝒬` (item 1, the classes + on which the rate is attained), the nondecreasing e-process of item 1 built from it gives + tests `τ α = inf {n | α⁻¹ ≤ E n}` of level `α` with `E_Q[τ α] / log (1/α) → 1 / d Q` and + `τ α / log (1/α) → 1 / d Q` almost surely as `α → 0`, for every `Q ∈ 𝒬`, in `ℝ≥0∞` with + `1 / 0 = ∞` and `1 / ∞ = 0` [EVR26, Notes 13 and 55]. With the block bets of item 1 for the + alternatives `Q ≪ ρ`, the bound of the first bullet is attained in expectation at every dominated alternative at once. The proof uses Wald's identity for one block bet with values in - a compact interval of `(0, ∞)` [EVR26, Note 13]. + a compact interval of `(0, ∞)`. - **First passage times.** For i.i.d. real increments with mean $D\in(0,\infty)$, the first time the partial sums reach `a` has expectation equivalent to `a / D` as `a → ∞` [Gut09]. Tau Ceti's elementary renewal theorem covers nonnegative increments; prove the signed case. @@ -1773,6 +1925,10 @@ symmetry separately. `IsEProcess E ℱ S ↔ IsEVar (Function.uncurry E) (stoppedNull ℱ S)` (Layer 3.1). - The domination of e-merging functions by weighted means (Layer 7.1) is also a case of the complete class theorem of Layer 1.4. +- The e-process at the rate for the alternatives dominated by `ρ` (Layer 6.1) and its tests + (Layer 6.3) are the case of the block bets of the dominated alternatives in the characterization + of the classes on which the rate is attained; the max–min value `a n` and the min–max value + `n * KL_inf` of the game of Layer 6.1 are the two ends of the chain `a n ≤ n * d ≤ n * KL_inf`. - The Wald inequality of Layer 6.3 is the case of one source of Layer 6.4, and the transportation lemma of Identification 2.2, for stopping times of finite mean, and the lower bound of Identification 2.3 follow from Layer 6.4. @@ -1820,7 +1976,7 @@ Original sources cited in the layers: exact Ville identity with applications to e-values*, arXiv:2607.04620v2 (Layer 2.3). - [DR67] D. A. Darling and H. Robbins, *Confidence sequences for mean, variance, and median*, PNAS 58 (1967) (Layer 5.1). -- [EVR26] *Answers to open questions in e-values and anytime-valid inference*, notes 01 to 49 and +- [EVR26] *Answers to open questions in e-values and anytime-valid inference*, notes 01 to 55 and the Lean library `EValuesResearch` of github.com/RemyDegenne/evalues_research, 2026; written and refereed by AI agents, with part of the results cited here proved in Lean (Existing formalizations) (Layers 0–8). @@ -1898,7 +2054,7 @@ Original sources cited in the layers: - [Rob70] H. Robbins, *Statistical methods related to the law of the iterated logarithm*, Ann. Math. Statist. 41 (1970) (Layer 4.2). - [Ram26] A. Ramdas, *A complete characterization of sequential testability and change - detectability in i.i.d. models*, arXiv:2609.05752v1 (Layer 6.2). + detectability in i.i.d. models*, arXiv:2609.05752v1 (Layers 6.1, 6.2). - [RR26] A. Ram and A. Ramdas, *The optimal betting wealth growth rate*, arXiv:2604.25280v1 (Layer 6). - [RRLK] A. Ramdas, J. Ruf, M. Larsson and W. M. Koolen, *Admissible anytime-valid sequential @@ -1961,5 +2117,7 @@ Original sources cited in the layers: (Layer 8). - [XWR24] Z. Xu, R. Wang and A. Ramdas, *Post-selection inference for e-value based confidence intervals*, Electron. J. Statist. 18(1) (2024), 2292–2338 (Layer 8.4). +- [YH52] K. Yosida and E. Hewitt, *Finitely additive measures*, Trans. Amer. Math. Soc. 72 (1952), + 46–66 (Layer 1.1). - [ZRW24] Z. Zhang, A. Ramdas and R. Wang, *On the existence of powerful p-values and e-values for composite hypotheses*, Ann. Statist. 52 (2024) (Layers 1.1, 6.2). diff --git a/LMLRoadmaps/EValues/Suggested.lean b/LMLRoadmaps/EValues/Suggested.lean index 5d251d6..10d95f4 100644 --- a/LMLRoadmaps/EValues/Suggested.lean +++ b/LMLRoadmaps/EValues/Suggested.lean @@ -1,7 +1,9 @@ import Mathlib.Analysis.SpecialFunctions.Log.ENNRealLog import Mathlib.Analysis.SpecialFunctions.Log.PosLog import Mathlib.Basic.Real.ENatENNReal +import Mathlib.Data.List.TFAE import Mathlib.InformationTheory.KullbackLeibler.Basic +import Mathlib.MeasureTheory.Measure.AddContent import Mathlib.Probability.Independence.Basic import Mathlib.Probability.Martingale.Convergence import Mathlib.Probability.Process.HittingTime @@ -294,6 +296,54 @@ theorem effectiveSet_sampleNull_eq_of_countable {𝓧 : Type*} [MeasurableSpace ∀ A, MeasurableSet A → μ A ≤ ∫⁻ R, (Measure.pi fun _ : Fin n ↦ R) A ∂π} := by sorry +/-- The countably additive part of a set function: the supremum of the measures below it on the +measurable sets (Layer 1.1, Conventions). -/ +def countablyAdditivePart (ν : Set Ω → ℝ≥0∞) : Measure Ω := + sSup {μ : Measure Ω | ∀ s, MeasurableSet s → μ s ≤ ν s} + +/-- The countably additive part of an additive content on the measurable sets is below it, so that +it is the largest measure below the content (Layer 1.1). -/ +theorem countablyAdditivePart_apply_le (m : AddContent ℝ≥0∞ {s : Set Ω | MeasurableSet s}) + {s : Set Ω} (hs : MeasurableSet s) : (countablyAdditivePart ⇑m : Measure Ω) s ≤ m s := by + sorry + +/-- **The Yosida–Hewitt decomposition** [YH52] (Layer 1.1): the remainder of an additive content of +finite mass after its countably additive part is singular to every finite measure. -/ +theorem exists_measurableSet_add_sub_countablyAdditivePart_lt + (m : AddContent ℝ≥0∞ {s : Set Ω | MeasurableSet s}) (hm : m univ ≠ ∞) (R : Measure Ω) + [IsFiniteMeasure R] {ε : ℝ≥0∞} (hε : 0 < ε) : + ∃ E, MeasurableSet E ∧ R E + (m Eᶜ - (countablyAdditivePart ⇑m : Measure Ω) Eᶜ) < ε := by + sorry + +/-- The Yosida–Hewitt decomposition is unique [YH52] (Layer 1.1): if an additive content of finite +mass is, on the measurable sets, the sum of a measure `μ` and of a set function below which the +only measure is `0`, then `μ` is its countably additive part. -/ +theorem countablyAdditivePart_eq_of_eq_add (m : AddContent ℝ≥0∞ {s : Set Ω | MeasurableSet s}) + (hm : m univ ≠ ∞) (μ : Measure Ω) (p : Set Ω → ℝ≥0∞) + (hp : ∀ μ' : Measure Ω, (∀ s, MeasurableSet s → μ' s ≤ p s) → μ' = 0) + (hmp : ∀ s, MeasurableSet s → m s = μ s + p s) : + countablyAdditivePart ⇑m = μ := by + sorry + +/-- The measure on the cells of a finite partition `f : Ω → Fin k` with the masses of a set +function `ν` (Layer 1.1). -/ +def cellMeasure (ν : Set Ω → ℝ≥0∞) {k : ℕ} (f : Ω → Fin k) : Measure (Fin k) := + Measure.sum fun j ↦ ν (f ⁻¹' {j}) • Measure.dirac j + +/-- The divergence `H(R | ν)` from a measure to a set function: the supremum, over the finite +measurable partitions, of the divergence from the image of `R` to the cell masses of `ν` +(Layer 1.1). -/ +def partitionDivergence (R : Measure Ω) (ν : Set Ω → ℝ≥0∞) : EReal := + ⨆ (k : ℕ) (f : Ω → Fin k) (_ : Measurable f), klIntegral (R.map f) (cellMeasure ν f) + +/-- The divergence to an additive content of mass at most one is the divergence to its countably +additive part (Layer 1.1). The generalized null laws of Layer 6.1 use the inequality `≥`. -/ +theorem partitionDivergence_eq_klIntegral_countablyAdditivePart (R : Measure Ω) + [IsProbabilityMeasure R] (m : AddContent ℝ≥0∞ {s : Set Ω | MeasurableSet s}) + (hm : m univ ≤ 1) : + partitionDivergence R ⇑m = klIntegral R (countablyAdditivePart ⇑m) := by + sorry + /-! ## Layer 2: test supermartingales, optional stopping and Ville's inequality -/ /-- A conditional e-variable given `m` for `S`, in set-integral form (Layer 2.1). -/ @@ -664,6 +714,39 @@ theorem bipolarRate_eq_zero_iff_mem_iidSaturation {𝓧 : Type*} [MeasurableSpac bipolarRate Q₁ S₁ = 0 ↔ Q₁ ∈ iidSaturation S₁ := by sorry +/-- The laws of the blocks of `k + 1` observations of `P`, as set functions (Layer 6.1). -/ +def blockSetFunction {𝓧 : Type*} [MeasurableSpace 𝓧] (P : Measure 𝓧) : + (k : ℕ) → Set (Fin (k + 1) → 𝓧) → ℝ≥0∞ := + fun k A ↦ Measure.pi (fun _ : Fin (k + 1) ↦ P) A + +/-- The generalized null laws of `S₁`: the closure of the laws of the blocks of its members, for the +convergence on every set of every block (Layer 6.1, Conventions) [EVR26, Note 43]. -/ +def generalizedNullLaws {𝓧 : Type*} [MeasurableSpace 𝓧] (S₁ : Set (Measure 𝓧)) : + Set ((k : ℕ) → Set (Fin (k + 1) → 𝓧) → ℝ≥0∞) := + closure (blockSetFunction '' S₁) + +/-- The optimal growth rate is the smallest divergence rate from the alternative to a generalized +null law, and the smallest value is attained (Layer 6.1) [EVR26, Note 43, Theorem 4]. -/ +theorem isLeast_iSup_partitionDivergence_generalizedNullLaws {𝓧 : Type*} [MeasurableSpace 𝓧] + (Q₁ : Measure 𝓧) [IsProbabilityMeasure Q₁] {S₁ : Set (Measure 𝓧)} + (hS₁ : ∀ P ∈ S₁, IsProbabilityMeasure P) (hS₁_ne : S₁.Nonempty) : + IsLeast ((fun ν ↦ ⨆ k : ℕ, partitionDivergence (Measure.pi fun _ : Fin (k + 1) ↦ Q₁) (ν k) / + ((k + 1 : ℕ) : EReal)) '' generalizedNullLaws S₁) (bipolarRate Q₁ S₁) := by + sorry + +/-- When the countably additive parts of the generalized null laws are powers, the optimal growth +rate is the smallest divergence to the i.i.d. saturation (Layer 6.1) [EVR26, Note 43, +Corollary 5]. -/ +theorem bipolarRate_eq_klInf_iidSaturation_of_countablyAdditivePart_eq_pi {𝓧 : Type*} + [MeasurableSpace 𝓧] (Q₁ : Measure 𝓧) [IsProbabilityMeasure Q₁] {S₁ : Set (Measure 𝓧)} + (hS₁ : ∀ P ∈ S₁, IsProbabilityMeasure P) + (h : ∀ ν ∈ generalizedNullLaws S₁, ∀ k : ℕ, countablyAdditivePart (ν k) = + Measure.pi fun _ : Fin (k + 1) ↦ (countablyAdditivePart (ν 0)).map (fun x ↦ x 0)) : + bipolarRate Q₁ S₁ = ⨅ ν ∈ generalizedNullLaws S₁, + klIntegral Q₁ ((countablyAdditivePart (ν 0)).map (fun x ↦ x 0)) ∧ + bipolarRate Q₁ S₁ = klInf Q₁ (iidSaturation S₁) := by + sorry + /-- The infimum of `Φ` over the probability measures of a basic neighbourhood of `Q` for the integrals of bounded measurable functions (Layer 6.1). -/ def nbhdInf (Φ : Measure Ω → EReal) (Q : Measure Ω) {k : ℕ} (g : Fin k → Ω → ℝ) (ε : ℝ) : @@ -699,6 +782,81 @@ theorem bipolarRate_le_seqTauEnvelope {𝓧 : Type*} [MeasurableSpace 𝓧] (Q bipolarRate Q₁ S₁ ≤ seqTauEnvelope (fun R ↦ klInf R S₁) Q₁ := by sorry +/-- The payoff of the bet `exp g` against `P`, under the alternative `Q` (Layer 6.1). -/ +def gamePayoff (Q P : Measure Ω) (g : Ω → ℝ) : ℝ := + ∫ x, g x ∂Q - Real.log (∫ x, Real.exp (g x) ∂P) + +/-- The max–min value of the game between bounded bets and a null is the largest expected +logarithm of an e-variable (Layer 6.1). -/ +theorem iSup_iInf_gamePayoff_eq_maxEPower (Q : Measure Ω) [IsProbabilityMeasure Q] + {T : Set (Measure Ω)} (hT : ∀ P ∈ T, IsProbabilityMeasure P) : + ⨆ (g : Ω → ℝ) (_ : Measurable g) (_ : ∃ C, ∀ x, |g x| ≤ C), + ⨅ P ∈ T, (gamePayoff Q P g : EReal) = maxEPower Q T := by + sorry + +/-- The min–max value of the game between bounded bets and a null is the smallest relative entropy +to the null (Layer 6.1). -/ +theorem iInf_iSup_gamePayoff_eq_klInf (Q : Measure Ω) [IsProbabilityMeasure Q] + {T : Set (Measure Ω)} (hT : ∀ P ∈ T, IsProbabilityMeasure P) : + ⨅ P ∈ T, ⨆ (g : Ω → ℝ) (_ : Measurable g) (_ : ∃ C, ∀ x, |g x| ≤ C), + (gamePayoff Q P g : EReal) = klInf Q T := by + sorry + +/-- The event that the average of each statistic `g i` over `m` observations is within `δ` of its +mean under `Q` (Layer 6.1). -/ +def blockEvent (Q : Measure Ω) {k : ℕ} (g : Fin k → Ω → ℝ) (δ : ℝ) (m : ℕ) : Set (Fin m → Ω) := + {y | ∀ i, |(m : ℝ)⁻¹ * ∑ b, g i (y b) - ∫ x, g i x ∂Q| ≤ δ} + +/-- The largest probability of `blockEvent Q g δ m` under the laws of `m` independent observations +with one law in `T` (Layer 6.1). -/ +def blockUpperProb (T : Set (Measure Ω)) (Q : Measure Ω) {k : ℕ} (g : Fin k → Ω → ℝ) (δ : ℝ) + (m : ℕ) : ℝ≥0∞ := + ⨆ P ∈ T, (Measure.pi fun _ : Fin m ↦ P) (blockEvent Q g δ m) + +/-- The suprema over the basic neighbourhoods of the lower and of the upper exponents of the upper +probability of the empirical events are the neighbourhood envelope of the smallest relative +entropy to the null (Layer 6.1) [EVR26, Note 15]. -/ +theorem iSup_liminf_limsup_neg_log_blockUpperProb_eq_tauEnvelope (Q : Measure Ω) + {T : Set (Measure Ω)} (hT : ∀ P ∈ T, IsProbabilityMeasure P) : + (⨆ (k : ℕ) (g : Fin k → Ω → ℝ) (_ : ∀ i, Measurable (g i)) + (_ : ∀ i, ∃ C, ∀ x, |g i x| ≤ C) (δ : ℝ) (_ : 0 < δ), + liminf (fun m : ℕ ↦ ENNReal.log (blockUpperProb T Q g δ m)⁻¹ / (m : EReal)) atTop) = + tauEnvelope (fun R ↦ klInf R T) Q ∧ + (⨆ (k : ℕ) (g : Fin k → Ω → ℝ) (_ : ∀ i, Measurable (g i)) + (_ : ∀ i, ∃ C, ∀ x, |g i x| ≤ C) (δ : ℝ) (_ : 0 < δ), + limsup (fun m : ℕ ↦ ENNReal.log (blockUpperProb T Q g δ m)⁻¹ / (m : EReal)) atTop) = + tauEnvelope (fun R ↦ klInf R T) Q := by + sorry + +/-- The optimal growth rate is the exponent of the upper probability under the null of the events +given by statistics of blocks of observations (Layer 6.1) [EVR26, Note 15]. -/ +theorem iSup_liminf_neg_log_blockUpperProb_eq_bipolarRate {𝓧 : Type*} [MeasurableSpace 𝓧] + (Q₁ : Measure 𝓧) [IsProbabilityMeasure Q₁] (S₁ : Set (Measure 𝓧)) + (hS₁ : ∀ P ∈ S₁, IsProbabilityMeasure P) : + ⨆ (n : ℕ) (k : ℕ) (g : Fin k → (Fin (n + 1) → 𝓧) → ℝ) (_ : ∀ i, Measurable (g i)) + (_ : ∀ i, ∃ C, ∀ x, |g i x| ≤ C) (δ : ℝ) (_ : 0 < δ), + liminf (fun m : ℕ ↦ ENNReal.log (blockUpperProb (sampleNull S₁ (n + 1)) + (Measure.pi fun _ : Fin (n + 1) ↦ Q₁) g δ m)⁻¹ / (((n + 1) * m : ℕ) : EReal)) atTop = + bipolarRate Q₁ S₁ := by + sorry + +/-- **Tests between two nulls** (Layer 6.1) [EVR26, Note 32, Statement 1]. On a countable alphabet, +the members of `H₁` charging every point, the test that stops when an e-process for the i.i.d. null +of `H₀` reaches `α⁻¹` or a test supermartingale for the i.i.d. null of `H₁` reaches `β⁻¹` makes at +least `kl(1 - α, β) / a₁(Q, H₁)` observations in expectation under the i.i.d. law of every +`Q ∈ H₀`, with `kl` the relative entropy of Bernoulli laws. -/ +theorem ofReal_kl_div_maxEPower_le_lintegral_min_hittingAfter {𝓧 : Type*} [MeasurableSpace 𝓧] + [Countable 𝓧] [MeasurableSingletonClass 𝓧] {H₀ H₁ : Set (Measure 𝓧)} + (hH₁ : ∀ P ∈ H₁, IsProbabilityMeasure P) (hpos : ∀ P ∈ H₁, ∀ x, P {x} ≠ 0) + {M M' : ℕ → (ℕ → 𝓧) → ℝ≥0∞} (hM : IsEProcess M piLT (iidNull H₀)) + (hM' : IsTestSupermartingale M' piLT (iidNull H₁)) {α β : ℝ} (hα : α ∈ Ioo 0 1) + (hβ : β ∈ Ioo 0 1) (hαβ : α + β ≤ 1) {Q : Measure 𝓧} [IsProbabilityMeasure Q] (hQ : Q ∈ H₀) : + ENNReal.ofReal ((1 - α) * Real.log ((1 - α) / β) + α * Real.log (α / (1 - β))) / + (maxEPower Q H₁).toENNReal ≤ + ∫⁻ ω, ENat.toENNReal (min (hittingAfter M (Ici (ENNReal.ofReal α)⁻¹) 0 ω) + (hittingAfter M' (Ici (ENNReal.ofReal β)⁻¹) 0 ω)) ∂Measure.infinitePi (fun _ : ℕ ↦ Q) := by + sorry + /-- The regret of the numeraire of the `n`-sample null against a mixture of i.i.d. laws (Layer 6.1) [EVR26, Note 14, Theorem (1)]. -/ theorem maxLogGrowth_le_eintegral_log_numeraire_bind_add {𝓧 : Type*} [MeasurableSpace 𝓧] @@ -734,6 +892,59 @@ theorem isEProcess_timeMixture_and_ae_tendsto_log_div {𝓧 : Type*} [Measurable n ω) / (n : EReal)) atTop (𝓝 (bipolarRate Q₁ S₁)) := by sorry +/-- A process attains the optimal growth rate on a class `𝒬` of alternatives when, under the +i.i.d. law of every probability measure of `𝒬`, `(1/n) log (E n)` tends to the rate almost surely +(Layer 6.1) [EVR26, Note 55]. -/ +def AttainsBipolarRate {𝓧 : Type*} [MeasurableSpace 𝓧] (E : ℕ → (ℕ → 𝓧) → ℝ≥0∞) + (S₁ 𝒬 : Set (Measure 𝓧)) : Prop := + ∀ (Q : Measure 𝓧) [IsProbabilityMeasure Q], Q ∈ 𝒬 → + ∀ᵐ ω ∂Measure.infinitePi (fun _ : ℕ ↦ Q), + Tendsto (fun n : ℕ ↦ ENNReal.log (E n ω) / (n : EReal)) atTop (𝓝 (bipolarRate Q S₁)) + +/-- **The classes on which one e-process attains the rate** (Layer 6.1) [EVR26, Note 55, +Proposition 1]: an e-process at the rate on `𝒬`, sample e-variables at the rate on `𝒬`, and a +countable family of bounded block bets that determines the rate on `𝒬` exist together. -/ +theorem exists_attainsBipolarRate_tfae {𝓧 : Type*} [MeasurableSpace 𝓧] {S₁ : Set (Measure 𝓧)} + (hS₁ : ∀ P ∈ S₁, IsProbabilityMeasure P) (𝒬 : Set (Measure 𝓧)) : + List.TFAE [ + ∃ E : ℕ → (ℕ → 𝓧) → ℝ≥0∞, IsEProcess E piLT (iidNull S₁) ∧ AttainsBipolarRate E S₁ 𝒬, + ∃ M : (n : ℕ) → (Fin n → 𝓧) → ℝ≥0∞, (∀ n ≠ 0, IsEVar (M n) (sampleNull S₁ n)) ∧ + ∀ (Q : Measure 𝓧) [IsProbabilityMeasure Q], Q ∈ 𝒬 → + ∀ᵐ ω ∂Measure.infinitePi (fun _ : ℕ ↦ Q), bipolarRate Q S₁ ≤ + liminf (fun n : ℕ ↦ ENNReal.log (M n fun i ↦ ω i) / (n : EReal)) atTop, + ∃ (len : ℕ → ℕ) (g : (i : ℕ) → (Fin (len i) → 𝓧) → ℝ), (∀ i, 1 ≤ len i) ∧ + (∀ i, Measurable (g i)) ∧ (∀ i, ∃ C, ∀ x, |g i x| ≤ C) ∧ + (∀ i, IsEVar (fun x ↦ ENNReal.ofReal (Real.exp (g i x))) (sampleNull S₁ (len i))) ∧ + ∀ (Q : Measure 𝓧) [IsProbabilityMeasure Q], Q ∈ 𝒬 → + ⨆ i, (((∫ x, g i x ∂Measure.pi (fun _ : Fin (len i) ↦ Q)) / len i : ℝ) : EReal) = + bipolarRate Q S₁] := by + sorry + +/-- From a countable family of bounded block bets with the rate below the supremum of their +normalized means on a class `𝒬`, one nondecreasing e-process, valid at every random time, attains +the rate on `𝒬` almost surely and in expectation, and its tests attain the bound on expected +stopping times (Layers 6.1 and 6.3) [EVR26, Notes 13 and 55]. -/ +theorem exists_isEProcess_monotone_attainsBipolarRate_of_le_iSup {𝓧 : Type*} [MeasurableSpace 𝓧] + {S₁ : Set (Measure 𝓧)} (hS₁ : ∀ P ∈ S₁, IsProbabilityMeasure P) {𝒬 : Set (Measure 𝓧)} + {len : ℕ → ℕ} {g : (i : ℕ) → (Fin (len i) → 𝓧) → ℝ} (hgb : ∀ i, ∃ C, ∀ x, |g i x| ≤ C) + (hge : ∀ i, IsEVar (fun x ↦ ENNReal.ofReal (Real.exp (g i x))) (sampleNull S₁ (len i))) + (hsup : ∀ (Q : Measure 𝓧) [IsProbabilityMeasure Q], Q ∈ 𝒬 → bipolarRate Q S₁ ≤ + ⨆ i, (((∫ x, g i x ∂Measure.pi (fun _ : Fin (len i) ↦ Q)) / len i : ℝ) : EReal)) : + ∃ E : ℕ → (ℕ → 𝓧) → ℝ≥0∞, IsEProcess E piLT (iidNull S₁) ∧ Monotone E ∧ + IsEVar (fun ω ↦ ⨆ n, E n ω) (iidNull S₁) ∧ AttainsBipolarRate E S₁ 𝒬 ∧ + ∀ (Q : Measure 𝓧) [IsProbabilityMeasure Q], Q ∈ 𝒬 → + Tendsto (fun n : ℕ ↦ + (∫ᵉ ω, ENNReal.log (E n ω) ∂Measure.infinitePi (fun _ : ℕ ↦ Q)) / (n : EReal)) + atTop (𝓝 (bipolarRate Q S₁)) ∧ + (∀ᵐ ω ∂Measure.infinitePi (fun _ : ℕ ↦ Q), + Tendsto (fun α : ℝ≥0∞ ↦ ENat.toENNReal (hittingAfter E (Ici α⁻¹) 0 ω) / + (ENNReal.log α⁻¹).toENNReal) (𝓝[>] 0) (𝓝 (bipolarRate Q S₁).toENNReal⁻¹)) ∧ + Tendsto (fun α : ℝ≥0∞ ↦ + (∫⁻ ω, ENat.toENNReal (hittingAfter E (Ici α⁻¹) 0 ω) + ∂Measure.infinitePi (fun _ : ℕ ↦ Q)) / (ENNReal.log α⁻¹).toENNReal) + (𝓝[>] 0) (𝓝 (bipolarRate Q S₁).toENNReal⁻¹) := by + sorry + section Designs variable {α 𝓨 : Type*} [Fintype α] [MeasurableSpace 𝓨] From 2adf777094bf8fd4280f6f57d2018374880b55ef Mon Sep 17 00:00:00 2001 From: Remy Degenne Date: Sat, 28 Nov 2026 11:14:22 +0100 Subject: [PATCH 2/3] Identification: learning the design without domination, experts and test functions Layer 5.4 at the generality of [EVR26, Note 55]: the algorithm for any sequence of experts on any observation space, delta-correct when it stops (pinned in the Conventions, with the sharp lower bound of Layer 2.3 under it); the classes of models on which one algorithm attains D*; experts for single models and countable sets; experts from countably many integrable test functions, with weakly compact alternatives, the laws on [0, 1] and per-arm exponential families; the second countability of convergence in distribution on separable pseudo-metrizable spaces. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0196ftMTph1jcT2Bg6VzaDTm --- LMLRoadmaps/Identification/README.md | 260 +++++++++++++--- LMLRoadmaps/Identification/Suggested.lean | 360 +++++++++++++++++++++- 2 files changed, 584 insertions(+), 36 deletions(-) diff --git a/LMLRoadmaps/Identification/README.md b/LMLRoadmaps/Identification/README.md index 744a267..2c48b81 100644 --- a/LMLRoadmaps/Identification/README.md +++ b/LMLRoadmaps/Identification/README.md @@ -44,7 +44,8 @@ Suggested homes: `LMLExplore/Identification/` for identification material (names `LMLExplore/Probability/LargeDeviations/` for Cramér-type bounds, `LMLExplore/SequentialLearning/` for the change of measure and the run-to-stream transfer, `LMLExplore/Topology/Semicontinuous/` for Berge's maximum theorem, `LMLExplore/OnlineLearning/` for -AdaHedge). +AdaHedge, `LMLExplore/MeasureTheory/Measure/ProbabilityMeasure/` for the separability of +convergence in distribution). ## Scope and dependencies @@ -54,7 +55,9 @@ tasks, with single or multiple correct answers, in unstructured models and in li It also owns three sequential-learning tools that the Bandits and ReinforcementLearning roadmaps build on: the chain rule for the divergence of stopped histories (Layer 2.1), the transfer from runs to the per-arm observation streams (Layer 4.1), and conditional domination of moment -generating functions with its exponential supermartingales (Layer 4.2). +generating functions with its exponential supermartingales (Layer 4.2). It owns the separability +and second countability of convergence in distribution on the probability measures of a +separable pseudo-metrizable space (Layer 5.4). | Material | Owner and interface consumed here | | --- | --- | @@ -71,6 +74,8 @@ generating functions with its exponential supermartingales (Layer 4.2). | Tilts and transforms of standard laws | Tau Ceti `Probability/Distributions/Tilted.lean` (`gammaMeasure_tilted_mul`, `gaussianReal_tilted_mul`, `poissonMeasure_tilted_mul`), `Probability/Distributions/Gaussian/ChiSquared.lean` (`gaussianReal_map_sq`) | | Fenchel conjugates, Bregman divergences | Tau Ceti `Analysis/Convex/Conjugate.lean` (`fenchelConjugate`, for a bilinear pairing), LML `ForMathlib/Analysis/Convex/Bregman/Basic.lean` (`bregDiv`) | | Minimax theorems, continuity of suprema over compact sets | Mathlib `Topology/Sion.lean` (`Sion.minimax`, `Sion.exists_isSaddlePointOn`), Tau Ceti `Topology/Sion.lean`, Mathlib `Topology/Order/Compact.lean` (`IsCompact.continuous_sSup`, `IsCompact.continuous_sInf`) | +| Designs: their value, rate and growth, and the Wald inequality with a design | EValues roadmap, Layer 6.4; LMLExplore `EValues/BipolarRate/Design/` (`designLaw`, `designValue`, `designRate`, `designGrowth`, `designBlockEquiv`, `Learning.IsAlgEnvSeq.eintegral_log_le_designRate_mul_lintegral`, `Learning.IsAlgEnvSeq.eintegral_log_le_designGrowth`), `Probability/ProductMeasure/Table.lean` (`restartShape`), `Identification/Task/DesignRate.lean` (`IdentTask.designRate_le_inv_charTime`), `Identification/LowerBound.lean` (`IdentTask.IsDeltaCorrect.klBer_le_designRate_mul_expectedStoppingTime`) | +| Convergence in distribution, joint lower semicontinuity of the relative entropy | Mathlib `MeasureTheory/Measure/LevyProkhorovMetric.lean` (`LevyProkhorov.probabilityMeasureHomeomorph`, pseudo-metrizability of `ProbabilityMeasure X` for a separable pseudo-metrizable `X`), Tau Ceti `InformationTheory/KullbackLeibler/Variational.lean` (`TauCeti.lowerSemicontinuous_klDiv_probabilityMeasure`), `MeasureTheory/Measure/ProbabilityMeasure/Separable.lean` (separability for second-countable standard Borel spaces) | Build missing material in this roadmap where it is listed as a target, and consume existing implementations directly. The Bandits roadmap and this one do not overlap: regret minimization, @@ -94,8 +99,12 @@ Outside this roadmap: - stopping thresholds, deviation inequalities and sampling rules built on $\mathrm K_{\inf}$ or $\mathrm{KL}_{\inf}$ for nonparametric classes (bounded or heavy-tailed arms), including the bounded-arm Top Two results of [JDBdHK22]. The $\mathrm K_{\inf}$ transportation costs of these - classes (Layer 1.4), their lower bounds (Layer 2.3) and the elimination algorithms for - sub-Gaussian or bounded arms (Layers 7, 8.1–8.2) are in scope. + classes (Layer 1.4), their lower bounds (Layer 2.3), the elimination algorithms for + sub-Gaussian or bounded arms (Layers 7, 8.1–8.2) and the algorithm of Layer 5.4, which attains + $T^*$ for the best arm among the laws on $[0,1]$, are in scope; +- the Borel model of [EVR26, Note 55, Counterexample 11], in which no algorithm attains $D^*$ at + every model, and the one-stream counterexample it is built on + [EVR26, Note 55, Counterexample 2]: their proofs rest on an analytic set that is not Borel. ## Conventions @@ -148,7 +157,16 @@ Cramér rate function (Layer 1.2), also `ℝ≥0∞`-valued. - It is *$\delta$-correct* on a task [DK19] if on every model $\theta\in M$, with probability at least $1-\delta$, it stops and outputs a correct answer. - It is *$\delta$-PAC* if moreover it stops almost surely on every model of $M$. -- Both properties are stated on the laws of the runs, which the algorithm and the environment +- It is *$\delta$-correct when it stops* [EVR26, Notes 49 and 55] if on every model $\theta\in M$, + with probability at most $\delta$, it stops and outputs an answer that is not correct for + $\theta$; nothing is asked when it does not stop. So $\delta$-PAC $\Rightarrow$ $\delta$-correct + $\Rightarrow$ LML's `IsPAC` at level $\delta$ $\Rightarrow$ $\delta$-correct when it stops, and + an algorithm $\delta$-correct when it stops is $\delta$-PAC exactly when it stops almost surely + on every model of $M$. This is the guarantee of the algorithm of Layer 5.4, which need not stop + at the models where its experts do not determine $D^*$, and the hypothesis of the lower bounds + with $D^*$ (Layers 2.3 and 5.4). State those results with it, not with $\delta$-correctness, + which that algorithm does not have. +- These properties are stated on the laws of the runs, which the algorithm and the environment determine: the joint law of the stopped history and the output, built from LML's `stoppedHistMeasure` and the output kernel, and the law `IdentAlg.outputMeasure`. - The sample complexity is $\mathbb E_\theta[\tau]$, the `ℝ≥0∞`-valued lower integral of the @@ -230,6 +248,8 @@ forms above, and that development may be adapted to them. - Prove $\delta$-PAC $\Rightarrow$ $\delta$-correct $\Rightarrow$ LML's `IsPAC` at level $\delta$, monotonicity in $\delta$ and in the badness predicate, restriction to subfamilies, and the run forms of each property. + - Layer 5.4 builds the weaker notion of algorithms $\delta$-correct when they stop + (Conventions), with the same API. 3. **Sample complexity.** - Define $\mathbb E_{\mathrm{env}}[\tau]$ and prove it is the same along every run. - For stationary environments on finite arms, prove Wald's identities at the stopping time: @@ -514,13 +534,17 @@ product models with $\mathrm K_{\inf}$ costs [AJG20, JDK23a]. - For any task, a $\delta$-correct algorithm with $\delta\in(0,1/2)$ and an admissible model $\theta$ with a single correct answer, prove $\mathbb E_\theta[\tau]\ge T^*(\theta)\,\mathrm{kl}(\delta,1-\delta)$ [GK16, Theorem 1]. - - The sharp form, for arm laws in any measurable spaces: for every single-answer task and every - $\delta$-correct algorithm with $\delta\le1/2$ that stops almost surely at $\theta$, - $\mathbb E_\theta[\tau]\ge\mathrm{kl}(\delta,1-\delta)/D^*(\theta)$, with $D^*$ the rate of - designs for the alternatives of $\theta$ and the Wald inequality with a design of the EValues - roadmap's Layer 6.4 [EVR26, Note 41]. $D^*\le1/T^*$, with equality on finite alphabets and - strict inequality in the instances of EValues 6.4, so that the first bullet is its corollary - when $\mathbb E_\theta[\tau]<\infty$, and holds trivially otherwise. + - The sharp form, for arm laws in any measurable spaces: for every task, every algorithm + $\delta$-correct when it stops (Conventions) with $\delta\le1/2$, and every admissible model + $\theta$ with a single correct answer and an alternative, at which the algorithm stops almost + surely, $\mathbb E_\theta[\tau]\ge\mathrm{kl}(\delta,1-\delta)/D^*(\theta)$, with $D^*$ the + rate of designs for the alternatives of $\theta$ and the Wald inequality with a design of the + EValues roadmap's Layer 6.4 [EVR26, Notes 41 and 55]. Layer 5.4 proves it for algorithms + $\delta$-correct when they stop; the case of $\delta$-correct algorithms is LMLExplore's + `IdentTask.IsDeltaCorrect.klBer_le_designRate_mul_expectedStoppingTime`. $D^*\le1/T^*$, with + equality on finite alphabets and strict inequality in the instances of EValues 6.4, so that + the first bullet is its corollary when $\mathbb E_\theta[\tau]<\infty$, and holds trivially + otherwise. - Prove $\mathrm{kl}(\delta,1-\delta)\ge\log\frac1{2.4\delta}$ [KCG16], and the Bretagnolle–Huber variant $\mathbb E_\theta[\tau]\ge T^*(\theta)\log\frac1{4\delta}$ [LS, Theorem 33.5]. @@ -867,29 +891,185 @@ the alternatives, and conditional domination by any cumulant generating function multiple-answer task with finitely many answers whose costs satisfy either continuity hypothesis of Layer 3.3 [DK19, Theorems 10–11, Corollary 12, Lemmas 13–17]. -4. **Learning the design** [EVR26, Note 49]. For a task whose arm laws live on countably - generated spaces, with a σ-finite measure `ρ a` for each arm, countably many answers and one - correct answer per model: - - **Experts.** The countable family of bounded block bets of the EValues roadmap's Layer 6.1, - applied for each answer `j` and block shape `s` to the null of the blocks of the models whose - answer is not `j`, gives experts `(j, s, g)` with `g` bounded and `∫ e^g dλ^(s) ≤ 1` for those - models; at every model dominated by the `ρ a`, the experts of the correct answer have values - `∫ g dμ^(s) / |s|` of supremum `D*`, and those of a wrong answer have values at most `0`. - - **The algorithm.** Rounds `t = 1, 2, …`: each admitted expert reads `t` blocks of its shape to - estimate its value; the eligible expert with the largest estimate bets on about `2^t` - observations; its bets multiply into one product per answer, and the algorithm stops when the - product of an answer `j` reaches `1 / (δ w j)`, for weights `w` on the answers. - - **Guarantees.** Prove that it is `δ`-correct on every model, dominated or not (Ville's - inequality for each product), and that at every model `μ` dominated by the `ρ a`, - `E_μ[τ_δ] / log (1/δ) → 1 / D*(μ)` (with `1/∞ = 0`, and `∞` when `D* = 0`) and - `limsup τ_δ / log (1/δ) ≤ 1 / D*` almost surely. With Layer 2.3, `D*` is the complexity of - identification at every such model. - - The proof gives `E_μ[τ_δ] ≤ log (1/δ) / (D* - 9η) + C(η)` with a constant `C(η)` of order - `exp(Θ(η^{-4}))`; no continuity of the optimal proportions is used. +4. **Learning the design** [EVR26, Note 49; Note 55, Section 2]. The tasks have countably many + answers and observations in any measurable space `𝓨`, with no domination and no countable + generation; their models may have several correct answers, and the guarantees bear on the + models with a single correct answer. Write `D*(θ, ¬i)` for the rate of the designs of the + laws of the arms at `θ` against the laws of the arms at the alternatives to `i`, and `D̄` for + the growth of the designs (the EValues roadmap's Layer 6.4; LMLExplore's `designRate` and + `designGrowth`). + - **Correctness when stopping.** Define the algorithms `δ`-correct when they stop + (Conventions), for a family of environments and a badness predicate and for a task, with the + API of Layers 0.2 and 1.1 (monotonicity in `δ` and in the badness predicate, restriction, + pullbacks, run forms), and prove the implications of the Conventions. Prove the sharp bound of + Layer 2.3 for them: `kl(δ, 1 - δ) ≤ D*(θ, ¬i) E_θ[τ]` for `δ ≤ 1/2`, at every admissible + model `θ` with the single correct answer `i` and an alternative, at which the algorithm + stops almost surely. The proof is that of LMLExplore's + `IdentTask.IsDeltaCorrect.klBer_le_designRate_mul_expectedStoppingTime`, which becomes its + corollary. + - **Experts** [EVR26, Note 55, Definition 4]. An *expert* is a triple `(j, S, g)` of an answer + `j`, a block shape `S : α → ℕ` with `S ≠ 0` and a bounded measurable function `g` on the + tables `(Σ a, Fin (S a)) → 𝓨` of the design `S`, such that `∫ exp g dλ^(S) ≤ 1` for every + alternative `λ` to `j`, where `λ^(S)` is LMLExplore's `designLaw` of the laws of the arms at + `λ`. Its *value* at a model `θ` is `∫ g dθ^(S) / |S|`. Prove that the value of an expert of + the answer `j` is at most `D*(θ, ¬j)` at every model `θ`, and at most `0` at the alternatives + to `j` (Jensen's inequality). A sequence of experts `(j e, S e, g e)`, `e : ℕ`, *determines + `D*` at `θ` for the answer `i`* if the values at `θ` of its experts of the answer `i` have + supremum `D*(θ, ¬i)`. Prove that a countable family of experts, with a zero expert `(i, 1, 0)` + added (one observation of each arm, `g = 0`), is a sequence of experts with the same values. + - **The algorithm** [EVR26, Note 49, Section 3; Note 55, Theorem 5]. Given a sequence of + experts, integer bounds `c e ≥ sup |g e|` and weights `w j > 0` with `∑' j, w j ≤ 1`, round + `t` occupies a window of time fixed in advance. Every expert admitted in round `t` + (`e + |S e| + c e ≤ log₂ t`) reads `t²` fresh blocks of its shape and estimates its value by + the mean of `g e` on them divided by `|S e|`. Then the admitted expert with the largest + estimate, the smallest index among ties, reads `⌊2^t / |S e|⌋` fresh blocks, each multiplying + the product of its answer by `exp (g e)`, and a fixed arm fills the rest of the window. The + algorithm stops when the product of an answer `j` reaches `1 / (δ w j)`, and answers the first + such `j` in a fixed order. Construct it as an `IdentAlg` whose sampling rule does not depend + on `δ`, with its run lemmas. These windows are those of the Lean proof in [EVR26]; the rounds + of [EVR26, Note 49] have random lengths and estimate from all the records since admission. + - **Guarantees** [EVR26, Note 55, Theorem 5; Note 49, Theorems 2 and 3]. Prove that for every + `δ ∈ (0, 1)` the algorithm is `δ`-correct when it stops, at every model, dominated or not: + each block is fresh given the past, so the product of an answer `j` is a nonnegative + supermartingale under every alternative to `j`, and Ville's inequality with the weights bounds + the probability of a wrong answer. It is not `δ`-correct in general: it need not stop at a + model where its experts do not determine `D*`. Prove that at every admissible model `θ` with a + single correct answer `i`, at which the experts determine `D*` and `D*(θ, ¬i) > 0`, it stops + almost surely for every `δ ∈ (0, 1)`; almost surely, for every `b > 1 / D*`, + `τ_δ ≤ b log (1/δ)` for all small `δ`; and `E_θ[τ_δ] / log (1/δ) → 1 / D*` in `ℝ≥0∞`, with + `1/∞ = 0`, the lower half by the first bullet. When `D* = 0`, no algorithm `δ`-correct when it + stops with `δ < 1/2` stops almost surely at `θ` (first bullet), so `E_θ[τ_δ] = ∞`. On a task + whose admissible models all have a single correct answer, at which the experts determine a + positive `D*`, the algorithm is `δ`-PAC. The proof of [EVR26, Note 49] gives + `E_θ[τ_δ] ≤ log (1/δ) / (D* - 9η) + C(η)` with a constant `C(η)` of order `exp(Θ(η^{-4}))`; + no continuity of the optimal proportions is used. + - **Experts for the dominated models** [EVR26, Note 55, Lemma 6; Note 49, Lemma 1]. For a + countably generated `𝓨` and an s-finite measure `ρ a` for each arm, prove that one sequence of + experts determines `D*` at every model `θ`, admissible or not, with `ν_a(θ) ≪ ρ a` for every + arm, for every answer. The experts are the block bets of the EValues roadmap's Layer 6.1 + ("Block bets for a class of alternatives") for the i.i.d. null of the tables of each shape `s` + at the alternatives to each answer, dominated by the finite measure + `designLaw (fun a ↦ (ρ a).toFinite) s`; their bets on `m` tables are experts of shape `m • s` + (LMLExplore's `designBlockEquiv`), and `designRate_eq_iSup_bipolarRate` gives the supremum. + With these experts, the algorithm attains `D*` at every dominated model + [EVR26, Note 49, Theorem 3]. + - **The classes of models on which `D*` is attained** [EVR26, Note 55, Theorem 7]. For every set + `M'` of admissible models, prove that the following are equivalent: + - some sequence of experts determines `D*` at every model of `M'` with a single correct + answer, for that answer; + - there are identification algorithms `A δ`, `δ`-correct when they stop for every + `δ ∈ (0, 1/2)`, with `limsup_{δ → 0} E_θ[τ_δ] / log (1/δ) ≤ 1 / D*(θ, ¬i)`, where + `1/∞ = 0`, at every model `θ ∈ M'` with a single correct answer `i` and `D*(θ, ¬i) > 0`. + + The algorithm gives the first implication. Prove the converse from `δ`-correctness when they + stop for small `δ` only. The experts of an answer `j` are built from `A δ` as in the proof of + the Wald inequality with a design (EValues 6.4): the run of `A δ` stopped at `min τ k` pays + `(1 - δ) / δ` when it has stopped by `k` with the answer `j` and `δ / (1 - δ)` otherwise, an + e-variable for the alternatives to `j`; `m` such runs restarted on the entries not yet read + (LMLExplore's `restartShape`), the product of their payoffs mixed with the constant `1` and set + to `1/2` when they do not fit in the table of a design `n`, with the seeds integrated out, give + a bounded function of that table whose logarithm is an expert of `j`. These experts, for the + levels `δ = 1 / (r + 3)` and all `j`, `m`, `n` and `k`, with the zero experts, determine `D*` + on `M'`. + - **Single models and countable sets** [EVR26, Note 55, Section 2]. Prove that for every + countable set of pairs of a model and an answer some sequence of experts determines `D*` at + each model for its answer, on any spaces: `D*` is a supremum of values of designs, bounded + e-variables suffice in each, and a countable union of sequences of experts is one. So for + every task with countably many answers, at every admissible model `θ` with a single correct + answer `i` and an alternative, `1 / D*(θ, ¬i)` is the smallest + `limsup_{δ → 0} E_θ[τ_δ] / log (1/δ)` of a family of algorithms `δ`-correct when they stop, + and one algorithm attains it at all the models of any countable set. On an uncountable class + it may not: in a Borel model with one arm on `[0, 1]² × {0, 1}`, `D* = 1/T* > 0` at every + model and no family of algorithms `δ`-correct when they stop attains `D*` at every model + [EVR26, Note 55, Counterexample 11] (outside this roadmap: Scope). + - **Experts from test functions** [EVR26, Note 55, Proposition 8; Csi84]. For each arm `a` let + `G a` be a set of measurable real functions on `𝓨`, bounded or not, the *test functions*. A + *box* is a set `{κ | ∀ a, ∀ g ∈ F a, g is κ a-integrable and |∫ g dκ a - q a g| ≤ ε}` of + instances `κ : α → Measure 𝓨` of probability measures, in the model or not, for finite sets + `F a ⊆ G a`, centres `q a g` and `ε > 0`; it is *around* `μ` if its inequalities are strict at + `μ`. For a set `Λ` of instances and `x : α → ℝ≥0`, define in `ℝ≥0∞`, with `0 * ∞ = 0`, + `Ψ_x(κ) = ⨅ λ ∈ Λ, ∑ a, x a * KL(κ a, λ a)` and its envelope + `Ψ^G_x(μ) = ⨆ (V around μ), ⨅ κ ∈ V, Ψ_x(κ)`, at most `Ψ_x(μ)`; the equality is a lower + semicontinuity of `Ψ_x` at `μ` for the test functions. At the laws of the arms at a model + `θ`, against the laws at the alternatives to `i`, `Ψ_w` is the cost `D(θ, w, ¬i)` of Layer 3.1. + - If the test functions are integrable under the instances of `Λ`, prove + `Ψ^G_x(μ) ≤ D̄(x) ≤ Ψ_x(μ)` for every `x`, hence + `⨆ w ∈ Δ_K, Ψ^G_w(μ) ≤ D* ≤ ⨆ w ∈ Δ_K, Ψ_w(μ)`; `D̄(x) = Ψ_x(μ)` when + `Ψ^G_x(μ) = Ψ_x(μ)`, and `D* = ⨆ w ∈ Δ_K, Ψ_w(μ)` when `Ψ^G_w(μ) = Ψ_w(μ)` at the + allocations `w` with rational coordinates. The upper bounds are LMLExplore's + `designGrowth_le_iInf_sum_mul_klDiv` and `designRate_le_iSup_iInf_sum_mul_klDiv`. For the + lower bound, prove the Sanov-type bound for one arm and a box [Csi84]: under `λ^{⊗n}`, the + probability that the empirical measure of the `n` observations satisfies the inequalities of + the box is at most `exp (-n ⨅ R, KL(R, λ))` over the probability measures `R` that satisfy + them, for integrable test functions, unbounded ones included. Then `1/2 + (1/2) e^c 𝟙_A`, + for the event `A` that the empirical measures of the rows of a table satisfy the + inequalities of the box and `c` at most the cost `⨅ κ ∈ V, Ψ_n(κ)` of the box `V`, is an + e-variable for `Λ`, and the law of large numbers at `μ` gives the growth. + - If every `G a` is countable and its functions are integrable under the laws of the arms at + every alternative of every answer, prove that the experts of the boxes with rational centres + and radius (an answer `j`, a design `n`, a nonempty box and a rational level at most its + cost against the alternatives to `j`) form one sequence of experts, depending on the task and + the `G a` only, that determines `D*` at every model `θ` for the answer `i` at which + `Ψ^G_w = Ψ_w`, against the alternatives to `i`, for every allocation `w` with rational + coordinates. There `D* = 1/T*(θ)` when `i` is the only correct answer of `θ`. + - **Alternatives in a weakly compact set** [EVR26, Note 55, Corollary 9]. Let `𝓨` be a separable + pseudo-metrizable space with its Borel σ-algebra, and give `α → ProbabilityMeasure 𝓨` the + product of the topologies of convergence in distribution. Prove that one sequence of experts, + depending on the task only, determines `D*` at every model `θ` for the answer `i` such that + the laws of the arms at the alternatives to `i` lie in a compact set `K` of instances and, at + the laws of the arms at `θ`, `Ψ_w` is the same for `Λ = K` and for `Λ` the laws at the + alternatives to `i`, for every `w ∈ Δ_K`. There `D̄(x) = Ψ_x` for every `x`, and + `D* = 1/T*(θ)` when `i` is the only correct answer. A weakly compact set of alternatives is + the case of `K` that set. The test functions are countably many bounded continuous functions + whose boxes around each law form a basis of its neighbourhoods (from a countable basis of the + topology); the weighted relative entropy is jointly lower semicontinuous (Tau Ceti's + `TauCeti.lowerSemicontinuous_klDiv_probabilityMeasure`), so its infimum over `K` is lower + semicontinuous, and the bullet on test functions applies; [EVR26, Note 55] assumes a + metrizable space. This needs, and this item builds, the separability and second countability of + `ProbabilityMeasure X`, as instances, for every separable pseudo-metrizable `X` with + `OpensMeasurableSpace X`: the laws with finitely many atoms at the points of a dense sequence + and rational weights are dense for the Lévy–Prokhorov distance, which metrizes convergence in + distribution (Mathlib's `LevyProkhorov.probabilityMeasureHomeomorph`, from which Mathlib + derives the pseudo-metrizability). Tau Ceti has them for second-countable standard Borel + spaces only (`MeasureTheory.ProbabilityMeasure.instSeparableSpace`). + - **The best arm among the laws on `[0, 1]`.** For best arm identification on the model of all + bandits with real observations restricted to the laws on `[0, 1]` (Layer 1.1; LMLExplore's + `(baiTask lawBandit lawMean).restrict (Set.univ.pi fun _ ↦ unitIntervalLaws)`), with at + least two arms, prove that the instances of laws on `[0, 1]` in which some arm `b ≠ i` has a + mean at least that of `i` form such a `K` at every model with best arm `i`: the laws on + `[0, 1]` are weakly compact and their mean is continuous, and mixing with `δ_0` and `δ_1` + with weight `t` moves a point of `K` into the alternatives at a cost at most + `log (1 / (1 - t))` per arm. This equality of the infima is the closure property under which + Layer 1.4 writes these costs with `K_inf`. Prove `0 < D* = 1/T*(θ) < ∞` at every model (the + uniform allocation gives the positivity, mixtures with weight `2/3` the bound `log 3`). So + the algorithm with these experts is `δ`-PAC on this task for every `δ ∈ (0, 1)`, with + `E_θ[τ_δ] / log (1/δ) → T*(θ)` at every model: the lower bound of Layer 2.3 is attained on + this nonparametric class, by an algorithm that is not explicit. + - **Exponential families, without an algorithm** [EVR26, Note 55, Corollary 10]. For a task on + vectors of means of per-arm exponential families (the product model of Layer 1.4 with `κ a x` + the member of mean `x` of `(ρ a, T a)`, for `x` in an open set `S a` of means of the family, + and admissible models in `∏ a, S a`), take the statistic `T a` as the only test function of + the arm `a`. Prove that at every admissible model `θ` and answer `i` such that + `θ' ↦ D(θ', w, ¬i)` is lower semicontinuous at `θ` on `∏ a, S a` for every `w ∈ Δ_K`, + `Ψ^G_x = Ψ_x` for every `x`: so `D̄(x) = ⨅ λ ∈ ¬i, ∑ a, x a * d_a(θ a, λ a)`, the experts of + the test functions `T a` determine `D*` at `θ` for `i`, and `D* = 1/T*(θ)` when `i` is the + only correct answer. The key step is `KL(κ, κ a z) ≥ d_a(y, z)` for every law `κ` under which + `T a` is integrable with mean `y ∈ S a` and every `z ∈ S a`, the log-likelihood ratio of two + members being affine in `T a`. With `S a` all the means of the family, the continuity theorem + of Layer 3.3 gives the semicontinuity at every admissible model of every task under its + per-arm hypotheses, which the instances of Layer 1.2 satisfy; best arm identification in one + family, the case of [EVR26, Note 55, Corollary 10], has it from LMLExplore's + `continuousWithinAt_altCost_baiTask_restrict`. So `D* = 1/T*`, which EValues 6.4 derives from + Track-and-Stop (Layer 5.2), holds with no algorithm, for every such task and with `D̄`; and the + algorithm of this item with these experts attains `T*` at all these models, with no + hypothesis on the optimal allocations. -Generalization: arbitrary tasks, where [GK16] treats best arm identification; arbitrary dominated -models and the rate `D*` of designs (item 4), where Track-and-Stop has exponential families and -`T*`. +Generalization: arbitrary tasks, where [GK16] treats best arm identification; the rate `D*` of +designs on any observation space, attained by one algorithm on every class of models on which a +sequence of experts determines it, dominated or not, with these classes characterized (item 4), +where Track-and-Stop has exponential families and `T*`; `D* = 1/T*` for every task on per-arm +exponential families whose costs are lower semicontinuous, where [EVR26, Note 55, Corollary 10] +treats best arm identification in one family. ## Layer 6: Game-based, Top Two and Frank–Wolfe sampling rules @@ -1092,6 +1272,13 @@ all runs. Check in particular: sequential halving and RAGE are all built with the constructor of Layer 0.5. - **Fixed budget:** the fixed-budget lower bound of Layer 8.4 and the upper bounds of Layers 8.1–8.2 agree up to the $\log K$ factors stated. +- **Learning the design:** with the experts of the dominated models, the algorithm of Layer 5.4 + attains $D^*$ at every dominated model [EVR26, Note 49, Theorem 3]; for best arm identification + in one exponential family, the experts of the statistic give $D^*=1/T^*$, which EValues 6.4 + derives from Track-and-Stop; on a finite observation space with all its subsets measurable, + where $\mathrm{KL}(\mu_a,\cdot)$ is continuous with values in $[0,\infty]$, the bullet on + weakly compact sets with $K$ the closure of the laws at the alternatives gives the + finite-alphabet equality $D^*=1/T^*$ of EValues 6.4. Compilation of the suggested signatures checks their types, not the truth of their admitted theorems or the completion of these milestones. @@ -1120,6 +1307,9 @@ Section 4.6 describes the stack-of-rewards model. of the GLR stopping rule and of the game that defines the characteristic time. - [CL16] A. Carpentier and A. Locatelli, *Tight (lower) bounds for the fixed budget best arm identification bandit problem*, COLT 2016. +- [Csi84] I. Csiszár, *Sanov property, generalized I-projection and a conditional limit theorem*, + Ann. Probab. 12 (1984), for the bound on the probability that an empirical measure lies in a + convex set. - [D23] R. Degenne, *On the existence of a complexity in fixed budget bandit identification*, COLT 2023. - [DK19] R. Degenne and W. M. Koolen, *Pure exploration with multiple correct answers*, @@ -1136,7 +1326,7 @@ Section 4.6 describes the stack-of-rewards model. decision processes*, COLT 2002. - [EMM06] E. Even-Dar, S. Mannor and Y. Mansour, *Action elimination and stopping conditions for the multi-armed bandit and reinforcement learning problems*, JMLR 7 (2006). -- [EVR26] *Answers to open questions in e-values and anytime-valid inference*, notes 01 to 49 and +- [EVR26] *Answers to open questions in e-values and anytime-valid inference*, notes 01 to 55 and the Lean library `EValuesResearch` of github.com/RemyDegenne/evalues_research, 2026; written and refereed by AI agents. The EValues roadmap cites it in full. - [FJJR19] T. Fiez, L. Jain, K. Jamieson and L. Ratliff, *Sequential experimental design for diff --git a/LMLRoadmaps/Identification/Suggested.lean b/LMLRoadmaps/Identification/Suggested.lean index 8201159..59b927b 100644 --- a/LMLRoadmaps/Identification/Suggested.lean +++ b/LMLRoadmaps/Identification/Suggested.lean @@ -16,6 +16,7 @@ import LeanMachineLearning.SequentialLearning.IonescuTulceaSpace import LeanMachineLearning.SequentialLearning.Means import LeanMachineLearning.SequentialLearning.StationaryEnv import LeanMachineLearning.SequentialLearning.SumRewards +import Statlib.EValues.DPI /-! # Bandit identification: suggested target signatures @@ -28,7 +29,10 @@ the helper `armObs` are admitted definitions: constructing them, with their run target, and their docstrings and the README specify them. The names of the LML framework (`IdentAlg`, `Environment.bandit`, `stoppedHistMeasure`, ...) are -those of the LML version pinned by LMLExplore. +those of the LML version pinned by LMLExplore. The designs of the EValues roadmap's Layer 6.4 +(`designLaw`, `designValue`, `designRate`, `designGrowth`) are restated in the present form of +LMLExplore's, with Statlib's `maxUtility` and `logUtility`, so that this file imports only Mathlib, +LML (with Statlib) and Tau Ceti. -/ noncomputable section @@ -467,4 +471,358 @@ theorem trackAndStop_asymptotic (task : IdentTask α (α → ℝ) ℐ 𝓨) (ρ (Environment.bandit (task.ν μ)) ≤ c * ENNReal.ofReal (log (1 / δ)) := sorry +/-! ## Layer 5.4: learning the design -/ + +section LearningTheDesign + +/-! ### The designs of the EValues roadmap's Layer 6.4, as in LMLExplore -/ + +/-- The law of the table `(Σ a, Fin (n a)) → 𝓨` of the design `n` under the instance `μ` +(LMLExplore's `designLaw`). -/ +def designLaw (μ : α → Measure 𝓨) (n : α → ℕ) : Measure ((Σ a, Fin (n a)) → 𝓨) := + Measure.pi fun p ↦ μ p.1 + +/-- The value of the design `n`: the largest expected logarithm under `μ` of an e-variable of its +table for the instances of `Λ` (LMLExplore's `designValue`). -/ +def designValue (μ : α → Measure 𝓨) (Λ : Set (α → Measure 𝓨)) (n : α → ℕ) : EReal := + maxUtility (designLaw μ n) ((fun ν ↦ designLaw ν n) '' Λ) logUtility + +/-- The rate `D*` of the designs (LMLExplore's `designRate`). -/ +def designRate (μ : α → Measure 𝓨) (Λ : Set (α → Measure 𝓨)) : EReal := + ⨆ n : α → ℕ, designValue μ Λ n / ((∑ a, n a : ℕ) : EReal) + +/-- The design `⌈m (x + ε 𝟙_{supp x})⌉` (LMLExplore's `proportionalDesign`). -/ +def proportionalDesign (x : α → ℝ≥0) (ε : ℝ≥0) (m : ℕ) : α → ℕ := + fun a ↦ if x a = 0 then 0 else ⌈(m : ℝ≥0) * (x a + ε)⌉₊ + +/-- The growth `D̄ x` of the designs proportional to `x` (LMLExplore's `designGrowth`). -/ +def designGrowth (μ : α → Measure 𝓨) (Λ : Set (α → Measure 𝓨)) (x : α → ℝ≥0) : EReal := + ⨅ (ε : ℝ≥0) (_ : 0 < ε), + liminf (fun m : ℕ ↦ designValue μ Λ (proportionalDesign x ε m) / (m : EReal)) atTop + +/-! ### Correctness when stopping and experts -/ + +namespace IdentTask + +/-- `A` is `δ`-correct when it stops (README Conventions) [EVR26, Notes 49 and 55]: on every +admissible model, with probability at most `δ`, it stops and outputs an answer that is not +correct. Nothing is asked when it does not stop. -/ +def IsDeltaCorrectOnStop (task : IdentTask α Θ ℐ 𝓨) (A : IdentAlg Unit α 𝓨 ℐ) (δ : ℝ) : Prop := + ∀ θ ∈ task.M, (histOutputMeasure A (Environment.bandit (task.ν θ))).real + {p | p.1 ∈ A.stopSet ∧ p.2 ∉ task.correct θ} ≤ δ + +/-- A `δ`-correct algorithm is `δ`-correct when it stops. -/ +theorem IsDeltaCorrect.isDeltaCorrectOnStop (task : IdentTask α Θ ℐ 𝓨) + {A : IdentAlg Unit α 𝓨 ℐ} {δ : ℝ} (hA : task.IsDeltaCorrect A δ) : + task.IsDeltaCorrectOnStop A δ := + sorry + +/-- An algorithm is `δ`-PAC exactly when it is `δ`-correct when it stops and stops almost surely +on every admissible model (README Conventions). -/ +theorem isDeltaPAC_iff_isDeltaCorrectOnStop (task : IdentTask α Θ ℐ 𝓨) + {A : IdentAlg Unit α 𝓨 ℐ} {δ : ℝ} : + task.IsDeltaPAC A δ ↔ task.IsDeltaCorrectOnStop A δ ∧ ∀ θ ∈ task.M, + ∀ᵐ ω ∂(trajMeasure A.alg (Environment.bandit (task.ν θ))), + A.stoppingTime IT.obs IT.action IT.feedback ω ≠ ⊤ := + sorry + +/-- The laws of the arms at the alternatives to the answer `i`. -/ +def altInstances (task : IdentTask α Θ ℐ 𝓨) (i : ℐ) : Set (α → Measure 𝓨) := + (fun θ' a ↦ task.ν θ' a) '' task.alt i + +/-- **The lower bound with the rate of the designs**, for algorithms `δ`-correct when they stop +(README Layers 2.3 and 5.4) [EVR26, Notes 41 and 55]: `kl(δ, 1 - δ) ≤ D* E_θ[τ]`. LMLExplore's +`IdentTask.IsDeltaCorrect.klBer_le_designRate_mul_expectedStoppingTime` is the case of +`δ`-correct algorithms. -/ +theorem IsDeltaCorrectOnStop.klBer_le_designRate_mul_expectedStoppingTime + [MeasurableSingletonClass ℐ] (task : IdentTask α Θ ℐ 𝓨) {A : IdentAlg Unit α 𝓨 ℐ} {δ : ℝ} + (hA : task.IsDeltaCorrectOnStop A δ) (hδ : δ ∈ Set.Ioc 0 (1 / 2)) {θ : Θ} (hθ : θ ∈ task.M) + {i : ℐ} (hi : task.correct θ = {i}) (h_alt : (task.alt i).Nonempty) + (hstop : ∀ᵐ ω ∂(trajMeasure A.alg (Environment.bandit (task.ν θ))), + A.stoppingTime IT.obs IT.action IT.feedback ω ≠ ⊤) : + ((ENNReal.ofReal ((1 - 2 * δ) * log ((1 - δ) / δ)) : ℝ≥0∞) : EReal) ≤ + designRate (fun a ↦ task.ν θ a) (task.altInstances i) * + (expectedStoppingTime A (Environment.bandit (task.ν θ)) : EReal) := + sorry + +/-- A sequence of experts (README Layer 5.4) [EVR26, Note 55, Definition 4]: for every `e`, the +answer `j e`, the block shape `S e ≠ 0` and the bounded measurable function `g e` on the tables of +the design `S e` form an expert: `exp (g e)` is an e-variable of one table for the laws of the +arms at every alternative to `j e`. -/ +structure IsExpertSeq (task : IdentTask α Θ ℐ 𝓨) (j : ℕ → ℐ) (S : ℕ → α → ℕ) + (g : (e : ℕ) → ((Σ a, Fin (S e a)) → 𝓨) → ℝ) : Prop where + shape_ne_zero (e : ℕ) : S e ≠ 0 + measurable (e : ℕ) : Measurable (g e) + bounded (e : ℕ) : ∃ c : ℝ, ∀ y, |g e y| ≤ c + lintegral_exp_le_one (e : ℕ) : ∀ θ ∈ task.alt (j e), + ∫⁻ y, ENNReal.ofReal (exp (g e y)) ∂(designLaw (fun a ↦ task.ν θ a) (S e)) ≤ 1 + +/-- The value `∫ g e dθ^(S e) / |S e|` of the expert `e` at the model `θ`. -/ +def expertValue (task : IdentTask α Θ ℐ 𝓨) (S : ℕ → α → ℕ) + (g : (e : ℕ) → ((Σ a, Fin (S e a)) → 𝓨) → ℝ) (θ : Θ) (e : ℕ) : ℝ := + (∫ y, g e y ∂(designLaw (fun a ↦ task.ν θ a) (S e))) / (∑ a, S e a : ℕ) + +/-- The experts determine `D*` at `θ` for the answer `i`: the values at `θ` of the experts of the +answer `i` have supremum the rate of the designs of `θ` against the alternatives to `i`. -/ +def DeterminesDesignRate (task : IdentTask α Θ ℐ 𝓨) (j : ℕ → ℐ) (S : ℕ → α → ℕ) + (g : (e : ℕ) → ((Σ a, Fin (S e a)) → 𝓨) → ℝ) (θ : Θ) (i : ℐ) : Prop := + ⨆ (e : ℕ) (_ : j e = i), (task.expertValue S g θ e : EReal) = + designRate (fun a ↦ task.ν θ a) (task.altInstances i) + +/-- The value of an expert is at most `D*` against the alternatives to its answer, at every model, +and at most `0` at those alternatives. -/ +theorem IsExpertSeq.expertValue_le (task : IdentTask α Θ ℐ 𝓨) {j : ℕ → ℐ} {S : ℕ → α → ℕ} + {g : (e : ℕ) → ((Σ a, Fin (S e a)) → 𝓨) → ℝ} (hg : task.IsExpertSeq j S g) (θ : Θ) (e : ℕ) : + (task.expertValue S g θ e : EReal) ≤ + designRate (fun a ↦ task.ν θ a) (task.altInstances (j e)) ∧ + (θ ∈ task.alt (j e) → task.expertValue S g θ e ≤ 0) := + sorry + +end IdentTask + +/-! ### The algorithm -/ + +/-- The sampling rule of the algorithm that learns the design (README Layer 5.4) [EVR26, Note 49, +Section 3], for the block shapes `S e`, the functions `g e` and the integer bounds `c e` of the +experts: round `t` occupies a window of time fixed in advance, in which every admitted expert +(`e + |S e| + c e ≤ log₂ t`) reads `t²` fresh blocks to estimate its value, then the admitted +expert of largest estimate reads `⌊2^t / |S e|⌋` fresh blocks, and a fixed arm fills the window. -/ +def learnDesignAlg (S : ℕ → α → ℕ) (g : (e : ℕ) → ((Σ a, Fin (S e a)) → 𝓨) → ℝ) (c : ℕ → ℕ) : + Algorithm Unit α 𝓨 := + sorry + +/-- The algorithm that learns the design at level `δ` (README Layer 5.4): the sampling rule +`learnDesignAlg`, the blocks read by the selected expert `e` multiplying the product of its answer +`j e` by `exp (g e)`, and the rule that stops when the product of an answer `i` reaches +`1 / (δ w i)` and answers the first such `i` in a fixed order. -/ +def learnDesign (j : ℕ → ℐ) (S : ℕ → α → ℕ) (g : (e : ℕ) → ((Σ a, Fin (S e a)) → 𝓨) → ℝ) + (c : ℕ → ℕ) (w : ℐ → ℝ≥0) (δ : ℝ) : IdentAlg Unit α 𝓨 ℐ := + sorry + +/-- The sampling rule of the algorithm that learns the design does not depend on the level. -/ +theorem learnDesign_alg (j : ℕ → ℐ) (S : ℕ → α → ℕ) + (g : (e : ℕ) → ((Σ a, Fin (S e a)) → 𝓨) → ℝ) (c : ℕ → ℕ) (w : ℐ → ℝ≥0) (δ : ℝ) : + (learnDesign j S g c w δ).alg = learnDesignAlg S g c := + sorry + +namespace IdentTask + +variable [Countable ℐ] [MeasurableSingletonClass ℐ] {j : ℕ → ℐ} {S : ℕ → α → ℕ} + {g : (e : ℕ) → ((Σ a, Fin (S e a)) → 𝓨) → ℝ} {c : ℕ → ℕ} {w : ℐ → ℝ≥0} + +/-- **Validity of the algorithm that learns the design** [EVR26, Note 55, Theorem 5; Note 49, +Theorem 2]: for every sequence of experts, on every model, dominated or not, it is `δ`-correct when +it stops. -/ +theorem isDeltaCorrectOnStop_learnDesign (task : IdentTask α Θ ℐ 𝓨) + (hg : task.IsExpertSeq j S g) (hc : ∀ e y, |g e y| ≤ c e) (hw : ∀ i, 0 < w i) + (hw1 : ∑' i, (w i : ℝ≥0∞) ≤ 1) {δ : ℝ} (hδ : δ ∈ Set.Ioo 0 1) : + task.IsDeltaCorrectOnStop (learnDesign j S g c w δ) δ := + sorry + +/-- **The algorithm that learns the design attains `D*` wherever its experts determine it** +[EVR26, Note 55, Theorem 5; Note 49, Theorem 3]: at every admissible model `θ` with a single +correct answer `i`, at which the experts determine `D* > 0`, it stops almost surely; almost surely, +for every `t > 1 / D*`, `τ_δ ≤ t log (1/δ)` for all small `δ`; and `E_θ[τ_δ] / log (1/δ) → 1 / D*`, +with `1 / ∞ = 0`. -/ +theorem tendsto_expectedStoppingTime_learnDesign_div_log [Nonempty α] + (task : IdentTask α Θ ℐ 𝓨) (hg : task.IsExpertSeq j S g) (hc : ∀ e y, |g e y| ≤ c e) + (hw : ∀ i, 0 < w i) (hw1 : ∑' i, (w i : ℝ≥0∞) ≤ 1) {θ : Θ} (hθ : θ ∈ task.M) {i : ℐ} + (hi : task.correct θ = {i}) (hpos : 0 < designRate (fun a ↦ task.ν θ a) (task.altInstances i)) + (hdet : task.DeterminesDesignRate j S g θ i) : + (∀ δ ∈ Set.Ioo (0 : ℝ) 1, + ∀ᵐ ω ∂(trajMeasure (learnDesignAlg S g c) (Environment.bandit (task.ν θ))), + (learnDesign j S g c w δ).stoppingTime IT.obs IT.action IT.feedback ω ≠ ⊤) ∧ + (∀ᵐ ω ∂(trajMeasure (learnDesignAlg S g c) (Environment.bandit (task.ν θ))), + ∀ t : ℝ≥0, (designRate (fun a ↦ task.ν θ a) (task.altInstances i)).toENNReal⁻¹ < t → + ∀ᶠ δ in 𝓝[>] 0, + ENat.toENNReal ((learnDesign j S g c w δ).stoppingTime IT.obs IT.action IT.feedback ω) ≤ + t * ENNReal.ofReal (log (1 / δ))) ∧ + Tendsto (fun δ ↦ expectedStoppingTime (learnDesign j S g c w δ) + (Environment.bandit (task.ν θ)) / ENNReal.ofReal (log (1 / δ))) (𝓝[>] 0) + (𝓝 (designRate (fun a ↦ task.ν θ a) (task.altInstances i)).toENNReal⁻¹) := + sorry + +omit [MeasurableSingletonClass ℐ] in +/-- **Experts for the dominated models** [EVR26, Note 55, Lemma 6; Note 49, Lemma 1]: on a countably +generated observation space, with an s-finite measure `ρ a` for each arm, one sequence of experts +determines `D*` at every model whose laws are dominated by the `ρ a`, for every answer. -/ +theorem exists_isExpertSeq_determinesDesignRate_of_absolutelyContinuous [Nonempty α] [Nonempty ℐ] + [MeasurableSpace.CountablyGenerated 𝓨] (task : IdentTask α Θ ℐ 𝓨) (ρ : α → Measure 𝓨) + [∀ a, SFinite (ρ a)] : + ∃ (j : ℕ → ℐ) (S : ℕ → α → ℕ) (g : (e : ℕ) → ((Σ a, Fin (S e a)) → 𝓨) → ℝ), + task.IsExpertSeq j S g ∧ + ∀ θ, (∀ a, task.ν θ a ≪ ρ a) → ∀ i, task.DeterminesDesignRate j S g θ i := + sorry + +omit [Countable ℐ] [MeasurableSingletonClass ℐ] in +/-- **Experts for countably many models** [EVR26, Note 55, Section 2], on any spaces. -/ +theorem exists_isExpertSeq_determinesDesignRate_of_countable [Nonempty α] [Nonempty ℐ] + (task : IdentTask α Θ ℐ 𝓨) {T : Set (Θ × ℐ)} (hT : T.Countable) : + ∃ (j : ℕ → ℐ) (S : ℕ → α → ℕ) (g : (e : ℕ) → ((Σ a, Fin (S e a)) → 𝓨) → ℝ), + task.IsExpertSeq j S g ∧ ∀ p ∈ T, task.DeterminesDesignRate j S g p.1 p.2 := + sorry + +/-- **The classes of models on which `D*` is attained** [EVR26, Note 55, Theorem 7]: one sequence +of experts determines `D*` on a set `M'` of admissible models exactly when some algorithms, +`δ`-correct when they stop, have `limsup_{δ → 0} E_θ[τ_δ] / log (1/δ) ≤ 1 / D*` on `M'`. -/ +theorem exists_isExpertSeq_iff_exists_identAlg_limsup_le (task : IdentTask α Θ ℐ 𝓨) + {M' : Set Θ} (hM' : M' ⊆ task.M) : + (∃ (j : ℕ → ℐ) (S : ℕ → α → ℕ) (g : (e : ℕ) → ((Σ a, Fin (S e a)) → 𝓨) → ℝ), + task.IsExpertSeq j S g ∧ + ∀ θ ∈ M', ∀ i, task.correct θ = {i} → task.DeterminesDesignRate j S g θ i) ↔ + ∃ A : ℝ → IdentAlg Unit α 𝓨 ℐ, + (∀ δ ∈ Set.Ioo (0 : ℝ) (1 / 2), task.IsDeltaCorrectOnStop (A δ) δ) ∧ + ∀ θ ∈ M', ∀ i, task.correct θ = {i} → + 0 < designRate (fun a ↦ task.ν θ a) (task.altInstances i) → + limsup (fun δ ↦ expectedStoppingTime (A δ) (Environment.bandit (task.ν θ)) / + ENNReal.ofReal (log (1 / δ))) (𝓝[>] 0) ≤ + (designRate (fun a ↦ task.ν θ a) (task.altInstances i)).toENNReal⁻¹ := + sorry + +end IdentTask + +/-! ### Experts from test functions -/ + +/-- The weighted smallest relative entropy `Ψ_x(κ) = ⨅ ν ∈ Λ, ∑ a, x a * KL(κ a, ν a)`, with +`0 * ∞ = 0` (README Layer 5.4). -/ +def weightedKLInf (Λ : Set (α → Measure 𝓨)) (x : α → ℝ≥0) (κ : α → Measure 𝓨) : ℝ≥0∞ := + ⨅ ν ∈ Λ, ∑ a, (x a : ℝ≥0∞) * klDiv (κ a) (ν a) + +/-- The box of the instances of probability measures `κ` under which every test function `g` of +`F a` is integrable with `|∫ g dκ a - q a g| ≤ ε`, for every arm `a`. -/ +def testBox (F : α → Finset (𝓨 → ℝ)) (q : α → (𝓨 → ℝ) → ℝ) (ε : ℝ) : Set (α → Measure 𝓨) := + {κ | ∀ a, IsProbabilityMeasure (κ a) ∧ + ∀ g ∈ F a, Integrable g (κ a) ∧ |∫ y, g y ∂(κ a) - q a g| ≤ ε} + +/-- The box of `(F, q, ε)` is around `μ`: its inequalities are strict at `μ`. -/ +def IsTestBoxAround (F : α → Finset (𝓨 → ℝ)) (q : α → (𝓨 → ℝ) → ℝ) (ε : ℝ) + (μ : α → Measure 𝓨) : Prop := + 0 < ε ∧ ∀ a, IsProbabilityMeasure (μ a) ∧ + ∀ g ∈ F a, Integrable g (μ a) ∧ |∫ y, g y ∂(μ a) - q a g| < ε + +/-- The envelope `Ψ^G_x(μ) = ⨆ (V around μ), ⨅ κ ∈ V, Ψ_x(κ)` on the boxes of the test functions +`G a` (README Layer 5.4). -/ +def testEnvelope (G : α → Set (𝓨 → ℝ)) (Λ : Set (α → Measure 𝓨)) (x : α → ℝ≥0) + (μ : α → Measure 𝓨) : ℝ≥0∞ := + ⨆ (F : α → Finset (𝓨 → ℝ)) (q : α → (𝓨 → ℝ) → ℝ) (ε : ℝ) (_ : ∀ a, ↑(F a) ⊆ G a) + (_ : IsTestBoxAround F q ε μ), ⨅ κ ∈ testBox F q ε, weightedKLInf Λ x κ + +/-- **The lower bound on the growth of the designs** [EVR26, Note 55, Proposition 8; Csi84]: +`Ψ^G_x(μ) ≤ D̄(x)` for test functions integrable under the instances of `Λ`, bounded or not. -/ +theorem testEnvelope_le_designGrowth {G : α → Set (𝓨 → ℝ)} {Λ : Set (α → Measure 𝓨)} + {μ : α → Measure 𝓨} (hΛ : ∀ ν ∈ Λ, ∀ a, IsProbabilityMeasure (ν a)) + (hGm : ∀ a, ∀ g ∈ G a, Measurable g) (hGΛ : ∀ ν ∈ Λ, ∀ a, ∀ g ∈ G a, Integrable g (ν a)) + (x : α → ℝ≥0) : + (testEnvelope G Λ x μ : EReal) ≤ designGrowth μ Λ x := + sorry + +namespace IdentTask + +/-- **Experts from countably many test functions** [EVR26, Note 55, Proposition 8]: one sequence of +experts, depending on the task and the test functions only, determines `D*` at every model and +answer at which `Ψ^G_w = Ψ_w` against the alternatives for the rational allocations; there +`D* = 1 / T*` when the answer is the only correct one. -/ +theorem exists_isExpertSeq_determinesDesignRate_of_testEnvelope_eq [Nonempty α] [Countable ℐ] + [Nonempty ℐ] (task : IdentTask α Θ ℐ 𝓨) (G : α → Set (𝓨 → ℝ)) (hGc : ∀ a, (G a).Countable) + (hGm : ∀ a, ∀ f ∈ G a, Measurable f) + (hGi : ∀ i, ∀ θ ∈ task.alt i, ∀ a, ∀ f ∈ G a, Integrable f (task.ν θ a)) : + ∃ (j : ℕ → ℐ) (S : ℕ → α → ℕ) (g : (e : ℕ) → ((Σ a, Fin (S e a)) → 𝓨) → ℝ), + task.IsExpertSeq j S g ∧ ∀ (θ : Θ) (i : ℐ), + (∀ w ∈ simplex α, (∀ a, w a ∈ Set.range ((↑) : ℚ → ℝ)) → + testEnvelope G (task.altInstances i) (fun a ↦ (w a).toNNReal) (fun a ↦ task.ν θ a) = + weightedKLInf (task.altInstances i) (fun a ↦ (w a).toNNReal) (fun a ↦ task.ν θ a)) → + task.DeterminesDesignRate j S g θ i ∧ + (task.correct θ = {i} → designRate (fun a ↦ task.ν θ a) (task.altInstances i) = + (((task.charTime θ)⁻¹ : ℝ≥0∞) : EReal)) := + sorry + +/-- **Alternatives in a weakly compact set** [EVR26, Note 55, Corollary 9]: on a separable +pseudo-metrizable observation space with its Borel σ-algebra, one sequence of experts determines +`D*` at every model and answer whose alternatives have their laws in a weakly compact set `K` with +the same weighted entropy infima; there `D̄(x) = Ψ_x` and `D* = 1 / T*`. -/ +theorem exists_isExpertSeq_determinesDesignRate_of_isCompact [TopologicalSpace 𝓨] + [TopologicalSpace.PseudoMetrizableSpace 𝓨] [TopologicalSpace.SeparableSpace 𝓨] [BorelSpace 𝓨] + [Nonempty α] [Countable ℐ] [Nonempty ℐ] (task : IdentTask α Θ ℐ 𝓨) : + ∃ (j : ℕ → ℐ) (S : ℕ → α → ℕ) (g : (e : ℕ) → ((Σ a, Fin (S e a)) → 𝓨) → ℝ), + task.IsExpertSeq j S g ∧ ∀ (θ : Θ) (i : ℐ) (K : Set (α → ProbabilityMeasure 𝓨)), + IsCompact K → task.altInstances i ⊆ (fun ν a ↦ (ν a : Measure 𝓨)) '' K → + (∀ w ∈ simplex α, + weightedKLInf ((fun ν a ↦ (ν a : Measure 𝓨)) '' K) (fun a ↦ (w a).toNNReal) + (fun a ↦ task.ν θ a) = + weightedKLInf (task.altInstances i) (fun a ↦ (w a).toNNReal) (fun a ↦ task.ν θ a)) → + task.DeterminesDesignRate j S g θ i ∧ + (∀ x : α → ℝ≥0, designGrowth (fun a ↦ task.ν θ a) (task.altInstances i) x = + weightedKLInf (task.altInstances i) x (fun a ↦ task.ν θ a)) ∧ + (task.correct θ = {i} → designRate (fun a ↦ task.ν θ a) (task.altInstances i) = + (((task.charTime θ)⁻¹ : ℝ≥0∞) : EReal)) := + sorry + +end IdentTask + +/-- **Convergence in distribution on a separable space is second countable** (README Layer 5.4): +the laws with finitely many atoms at the points of a dense sequence and rational weights are dense +for the Lévy–Prokhorov distance. In LMLExplore, an instance. -/ +theorem secondCountableTopology_probabilityMeasure {X : Type*} [TopologicalSpace X] + [TopologicalSpace.PseudoMetrizableSpace X] [TopologicalSpace.SeparableSpace X] + [MeasurableSpace X] [OpensMeasurableSpace X] : + SecondCountableTopology (ProbabilityMeasure X) := + sorry + +/-- Best arm identification among all the laws on `[0, 1]` (README Layers 1.1 and 5.4): a model is +the vector of the arm laws, carried by `[0, 1]`, and its correct answer the arm of largest mean. -/ +def unitIntervalBaiTask : IdentTask α (α → ProbabilityMeasure ℝ) α ℝ where + M := (baiTask (productBandit fun _ (P : ProbabilityMeasure ℝ) ↦ (P : Measure ℝ)) + (fun θ a ↦ ∫ x, x ∂(θ a : Measure ℝ))).M ∩ + {θ | ∀ a, ∀ᵐ x ∂(θ a : Measure ℝ), x ∈ Set.Icc 0 1} + ν := productBandit fun _ (P : ProbabilityMeasure ℝ) ↦ (P : Measure ℝ) + isMarkovKernel_ν _ := inferInstance + correct θ := {a | ∀ b ≠ a, ∫ x, x ∂(θ b : Measure ℝ) < ∫ x, x ∂(θ a : Measure ℝ)} + +/-- **`0 < D* = 1 / T* < ∞` for the best arm among the laws on `[0, 1]`** [EVR26, Note 55, +Corollary 9], at every model, with at least two arms. -/ +theorem designRate_eq_inv_charTime_unitIntervalBaiTask [Nontrivial α] + {θ : α → ProbabilityMeasure ℝ} (hθ : θ ∈ (unitIntervalBaiTask (α := α)).M) {i : α} + (hi : i ∈ (unitIntervalBaiTask (α := α)).correct θ) : + designRate (fun a ↦ (unitIntervalBaiTask (α := α)).ν θ a) + ((unitIntervalBaiTask (α := α)).altInstances i) = + ((((unitIntervalBaiTask (α := α)).charTime θ)⁻¹ : ℝ≥0∞) : EReal) ∧ + (unitIntervalBaiTask (α := α)).charTime θ ≠ 0 ∧ (unitIntervalBaiTask (α := α)).charTime θ ≠ ⊤ := + sorry + +/-- **One algorithm at `T*` for the best arm among the laws on `[0, 1]`** [EVR26, Note 55, +Corollary 9]: the algorithm that learns the design, with the experts of the weakly compact +alternatives, is `δ`-PAC and has `E_θ[τ_δ] / log (1/δ) → T*(θ)` at every model. -/ +theorem exists_isDeltaPAC_tendsto_charTime_unitIntervalBaiTask [Nontrivial α] : + ∃ A : ℝ → IdentAlg Unit α ℝ α, + (∀ δ ∈ Set.Ioo (0 : ℝ) 1, (unitIntervalBaiTask (α := α)).IsDeltaPAC (A δ) δ) ∧ + ∀ θ ∈ (unitIntervalBaiTask (α := α)).M, + Tendsto (fun δ ↦ expectedStoppingTime (A δ) + (Environment.bandit ((unitIntervalBaiTask (α := α)).ν θ)) / + ENNReal.ofReal (log (1 / δ))) (𝓝[>] 0) + (𝓝 ((unitIntervalBaiTask (α := α)).charTime θ)) := + sorry + +/-- **Exponential families, without an algorithm** [EVR26, Note 55, Corollary 10], for any task on +vectors of means of per-arm exponential families `(ρ a, T a)` (README Layer 5.4): at a model `θ` +at which the costs `θ' ↦ D(θ', w, ¬i)` are lower semicontinuous on `∏ a, S a`, +`D̄(x) = ⨅ λ ∈ ¬i, ∑ a, x a d_a(θ a, λ a)` and `D* = 1 / T*(θ)`. Best arm identification in one +family is the case of [EVR26, Note 55, Corollary 10]. -/ +theorem designRate_eq_inv_charTime_of_expFamily (task : IdentTask α (α → ℝ) ℐ 𝓨) + (ρ : α → Measure 𝓨) [∀ a, IsProbabilityMeasure (ρ a)] (T : α → 𝓨 → ℝ) + (hT : ∀ a, Measurable (T a)) (κ : α → ℝ → Measure 𝓨) [∀ a x, IsProbabilityMeasure (κ a x)] + (S : α → Set ℝ) (hS : ∀ a, IsOpen (S a)) + (hκ : ∀ a, ∀ x ∈ S a, ∃ η ∈ interior (integrableExpSet (T a) (ρ a)), + κ a x = expFamily (ρ a) (T a) η ∧ ∫ y, T a y ∂(κ a x) = x) + (hν : task.ν = productBandit κ) (hM : task.M ⊆ Set.univ.pi S) + {θ : α → ℝ} (hθ : θ ∈ task.M) {i : ℐ} (hi : task.correct θ = {i}) + (hlsc : ∀ w ∈ simplex α, + LowerSemicontinuousWithinAt (fun θ' ↦ task.altCost θ' w i) (Set.univ.pi S) θ) : + (∀ x : α → ℝ≥0, designGrowth (fun a ↦ task.ν θ a) (task.altInstances i) x = + weightedKLInf (task.altInstances i) x (fun a ↦ task.ν θ a)) ∧ + designRate (fun a ↦ task.ν θ a) (task.altInstances i) = + (((task.charTime θ)⁻¹ : ℝ≥0∞) : EReal) := + sorry + +end LearningTheDesign + end LMLRoadmaps.Identification From 96e26cf13599e9b96daf22a6f1621da4b9193fdb Mon Sep 17 00:00:00 2001 From: Remy Degenne Date: Sat, 28 Nov 2026 11:16:41 +0100 Subject: [PATCH 3/3] EValues, Identification, Generalization: align the correctness of 6.4 and schedule two restatements EValues 6.4 "Consequences" asks its lower bounds for algorithms delta-correct when they stop (Identification, Conventions). Generalization 1.38 derives exists_isEProcess_ae_tendsto_log_div_bipolarRate from the e-process built from a family of block bets (EValues 6.1), and 1.39 derives IdentTask.IsDeltaCorrect.klBer_le_designRate_mul_expectedStoppingTime from the bound for algorithms delta-correct when they stop (Identification 5.4). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0196ftMTph1jcT2Bg6VzaDTm --- LMLRoadmaps/EValues/README.md | 15 +++++++++------ LMLRoadmaps/Generalization/README.md | 17 ++++++++++++++++- LMLRoadmaps/Identification/README.md | 2 +- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/LMLRoadmaps/EValues/README.md b/LMLRoadmaps/EValues/README.md index 3c3696c..b0ed8ff 100644 --- a/LMLRoadmaps/EValues/README.md +++ b/LMLRoadmaps/EValues/README.md @@ -290,7 +290,7 @@ names keep their names. ## Restatements of merged code The Generalization roadmap's e-values targets (its Layer 0, targets 0.17–0.26, and Layer 1, -targets 1.26–1.37) restate the merged e-values code in the conventions above: the operations on +targets 1.26–1.39) restate the merged e-values code in the conventions above: the operations on nulls, the polarity, the quasi-sure filter, tests, `klInf` and `maxEPower`, the filtration `piLT`, one conditional null that may depend on the past, and the canonical nulls of calibrators and merging functions. The items of this roadmap that define those objects are their prerequisites. @@ -309,7 +309,8 @@ Layer 6.1's characterization of the classes on which one e-process attains the r (`EValues/BipolarRate/Universal.lean`: the alternatives dominated by an s-finite measure on a countably generated space), whose proof uses the domination only through the family of block bets `ProbabilityTheory.exists_iSup_integral_div_eq_bipolarRate`. The pull request that builds the -e-process from a family derives the merged theorem from it and from that family. +e-process from a family derives the merged theorem from it and from that family (Generalization +1.38). ## Layers and dependencies @@ -1609,14 +1610,16 @@ the effective null of the `n`-sample null. Write It contains the Wald inequality of item 3 (one source) and, through `a n ≤ ⨅ λ ∈ Λ, ∑ a, n a * klDiv (μ a) (λ a)`, the transportation lemma of Identification 2.2 [KCG16, Lemma 1] for stopping times of finite mean, for e-variables rather than events. - - **Consequences** [EVR26, Note 41]. A `δ`-correct algorithm (Identification 0.2) with + - **Consequences** [EVR26, Note 41]. An algorithm `δ`-correct when it stops (Identification, + Conventions; the `δ`-correct algorithms of Identification 0.2 are such algorithms) with `δ ≤ 1/2` that stops almost surely at `μ` has `E_μ[τ] ≥ kl(δ, 1-δ) / D*` and `kl(δ, 1-δ) ≤ D̄ (E_μ[N τ])`, with `D*` for `Λ` the alternatives of `μ`, and `D* ≤ 1 / T* μ`, so that this is the sharp form of [GK16, Theorem 1]. For testing a known instance, blocks of a near-optimal shape with the tests of item 3 attain `log (1/δ) / D*` to - first order, and no sampling rule does better. If `δ`-correct algorithms attain `c` at `μ`, - then `D* ≥ 1 / c`; with Identification 5.2 this gives `D* = 1 / T*` for best arm - identification in exponential families. + first order, and no sampling rule does better. If algorithms `δ`-correct when they stop and + stopping almost surely at `μ` attain `c` at `μ`, then `D* ≥ 1 / c`; with Identification 5.2 + this gives `D* = 1 / T*` for best arm identification in exponential families, which + Identification 5.4 also gives with no algorithm. - **When `D*` is the entropy constant** [EVR26, Note 41]. On finite alphabets `D* = 1 / T* μ`, and `D̄ x = ⨅ λ ∈ Λ, ∑ a, x a * klDiv (μ a) (λ a)`, from the finite-alphabet equality of item 1; on countable alphabets `D*` is the same supremum with `klIntegral` in place of `klDiv` diff --git a/LMLRoadmaps/Generalization/README.md b/LMLRoadmaps/Generalization/README.md index 0adb832..941f5a1 100644 --- a/LMLRoadmaps/Generalization/README.md +++ b/LMLRoadmaps/Generalization/README.md @@ -114,7 +114,7 @@ targets here: | Layer | Content | Prerequisites | Unblocks | | --- | --- | --- | --- | | 0 | Generalizations that new work builds on | merged LMLExplore code; EValues 0.1, 0.5, 0.6, 1.1, 3.2, 3.3, 4.5, 6.1 for the e-values targets | Identification 1.1, 1.4, 2.1, 4, 5, 6, 7, 9.1; Bandits 6.3–6.6, 7, 8.2–8.5, 9, 10; ReinforcementLearning 6, 8–12, 23; EValues 1.1, 1.3, 3.6, 4.4, 5.3, 6.1–6.4 | -| 1 | Consolidation of finished developments | Layer 0 targets as listed; Identification 0.5, 1.1, 3.6; ReinforcementLearning 0.6, 8.1; EValues 0.1, 0.2, 1.2, 1.4, 5.3, 6.4, 7, 8; Bandits 4.4 | Identification 3.6, 4.2, 4.4, 5.2–5.3, 7, 8.1–8.2; Bandits 4.5, 6.4, 7.2–7.4, 8.4; ReinforcementLearning 1.4–1.5, 9.4, 10, 12.2; EValues 6.1, 6.3, 6.4 | +| 1 | Consolidation of finished developments | Layer 0 targets as listed; Identification 0.5, 1.1, 3.6, 5.4; ReinforcementLearning 0.6, 8.1; EValues 0.1, 0.2, 1.2, 1.4, 5.3, 6.1, 6.4, 7, 8; Bandits 4.4 | Identification 3.6, 4.2, 4.4, 5.2–5.3, 7, 8.1–8.2; Bandits 4.5, 6.4, 7.2–7.4, 8.4; ReinforcementLearning 1.4–1.5, 9.4, 10, 12.2; EValues 6.1, 6.3, 6.4 | | 2 | Material Tau Ceti provides | merged LMLExplore code | none | ## Layer 0: Generalizations that new work builds on @@ -879,6 +879,21 @@ targets here: mean (target 0.21). - Why: the Lai–Robbins theorem is the countably generated case of a bound that holds on every space, and its constant `dInf` is a third name for `klInf`. +38. **One e-process at the rate from a family of block bets.** Prerequisite: EValues 6.1, "The + classes on which one e-process attains the rate". + - Derive `exists_isEProcess_ae_tendsto_log_div_bipolarRate` (`BipolarRate/Universal.lean`), and + the tests at the rate built from the same e-process, as the case of the family of block bets + of `exists_iSup_integral_div_eq_bipolarRate`: the construction uses the domination only + through that family. + - Why: one construction proved for the dominated alternatives, when it holds for every class + on which a countable family of block bets determines the rate. +39. **The lower bound with `D*` for algorithms `δ`-correct when they stop.** Prerequisite: + Identification 5.4, "Correctness when stopping". + - Derive `IdentTask.IsDeltaCorrect.klBer_le_designRate_mul_expectedStoppingTime` + (`Identification/LowerBound.lean`) from the bound of Identification 2.3 for algorithms + `δ`-correct when they stop, a `δ`-correct algorithm being one. + - Why: one inequality proved under the stronger of two notions of correctness, when the + algorithm of Identification 5.4 only has the weaker one. ## Layer 2: Material Tau Ceti provides diff --git a/LMLRoadmaps/Identification/README.md b/LMLRoadmaps/Identification/README.md index 2c48b81..0dd7047 100644 --- a/LMLRoadmaps/Identification/README.md +++ b/LMLRoadmaps/Identification/README.md @@ -906,7 +906,7 @@ the alternatives, and conditional domination by any cumulant generating function model `θ` with the single correct answer `i` and an alternative, at which the algorithm stops almost surely. The proof is that of LMLExplore's `IdentTask.IsDeltaCorrect.klBer_le_designRate_mul_expectedStoppingTime`, which becomes its - corollary. + corollary (Generalization 1.39). - **Experts** [EVR26, Note 55, Definition 4]. An *expert* is a triple `(j, S, g)` of an answer `j`, a block shape `S : α → ℕ` with `S ≠ 0` and a bounded measurable function `g` on the tables `(Σ a, Fin (S a)) → 𝓨` of the design `S`, such that `∫ exp g dλ^(S) ≤ 1` for every