Documentation

Atlas.ProbabilisticMethodsInCombinatorics.code.Chapter9.Martingales

@[implicit_reducible]

The discrete $\sigma$-algebra (every subset is measurable) on the finite set of simple graphs on $\{0, 1, \dots, n-1\}$.

Instances For
    noncomputable def ShamirSpencer.erdosRenyiMeasure (n : ) (p : ) (hp : 0 p) (hp1 : p 1) :

    The Erdős–Rényi random graph measure $G(n, p)$ on simple graphs over $\{0, \dots, n-1\}$, where each edge is included independently with probability $p \in [0, 1]$.

    Instances For

      The Erdős–Rényi measure $G(n, p)$ is a probability measure on simple graphs.

      noncomputable def ShamirSpencer.chromaticNumberNat (n : ) (G : SimpleGraph (Fin n)) :

      The chromatic number $\chi(G)$ of a finite simple graph $G$ on $\{0, \dots, n-1\}$ as a natural number (converted from the ℕ∞-valued chromatic number in Mathlib via ENat.toNat).

      Instances For
        noncomputable def ShamirSpencer.probEvent (n : ) (p : ) (hp : 0 p) (hp1 : p 1) (E : Set (SimpleGraph (Fin n))) :

        The probability $\mathbb{P}_{G(n,p)}(E)$ of an event $E$ under the Erdős–Rényi measure $G(n, p)$, returned as a real number via ENNReal.toReal.

        Instances For
          theorem ShamirSpencer.colorable_of_induce_compl_colorable {n : } (G : SimpleGraph (Fin n)) (u : ) (S : Finset (Fin n)) (h1 : (SimpleGraph.induce (↑S) G).Colorable u) (h2 : (SimpleGraph.induce (↑S) G).Colorable 3) :
          G.Colorable (u + 3)

          If $G[\bar S]$ is $u$-colourable and $G[S]$ is $3$-colourable, then $G$ itself is $(u + 3)$-colourable: combine the two colourings using disjoint palettes.

          Corollary of colorable_of_induce_compl_colorable: under the same hypotheses, $\chi(G) \le u + 3$.

          theorem ShamirSpencer.three_events_subset (n u : ) (C : ) :
          {G : SimpleGraph (Fin n) | ∃ (S : Finset (Fin n)), S.card C * n (SimpleGraph.induce (↑S) G).Colorable u} {G : SimpleGraph (Fin n) | ∀ (S : Finset (Fin n)), S.card C * n(SimpleGraph.induce (↑S) G).Colorable 3} {G : SimpleGraph (Fin n) | u chromaticNumberNat n G} {G : SimpleGraph (Fin n) | u chromaticNumberNat n G chromaticNumberNat n G u + 3}

          Set-level lemma underlying the Shamir–Spencer concentration argument: the intersection of the three events (existence of a small "deletion set" $S$ making $G[\bar S]$ $u$-colourable, all small $S$ make $G[S]$ $3$-colourable, and $\chi(G) \ge u$) is contained in the event $\{u \le \chi(G) \le u + 3\}$.

          theorem ShamirSpencer.shamir_spencer_chromatic_four_concentration ( : ) (_hα : > 5 / 6) (p : ) (hp : ∀ (n : ), 0 p n) (hp1 : ∀ (n : ), p n 1) (_hpn : ∀ᶠ (n : ) in Filter.atTop, p n < n ^ (-)) (ε : ) (_hε : 0 < ε) (_hε1 : ε < 1) (h_bounded_diff : ∀ (n₀ u : ), probEvent n₀ (p n₀) {G : SimpleGraph (Fin n₀) | chromaticNumberNat n₀ G u} > εprobEvent n₀ (p n₀) {G : SimpleGraph (Fin n₀) | ∃ (S : Finset (Fin n₀)), S.card 2 * (-Real.log ε / 2) * n₀ (SimpleGraph.induce (↑S) G).Colorable u} 1 - ε) (h_three_col : ∀ᶠ (n₀ : ) in Filter.atTop, probEvent n₀ (p n₀) {G : SimpleGraph (Fin n₀) | ∀ (S : Finset (Fin n₀)), S.card 2 * (-Real.log ε / 2) * n₀(SimpleGraph.induce (↑S) G).Colorable 3} 1 - ε) (h_exists_u : ∀ (n₀ : ), ∃ (u : ), probEvent n₀ (p n₀) {G : SimpleGraph (Fin n₀) | chromaticNumberNat n₀ G u} > ε probEvent n₀ (p n₀) {G : SimpleGraph (Fin n₀) | u chromaticNumberNat n₀ G} 1 - ε) :
          ∃ (u : ), ∀ᶠ (n : ) in Filter.atTop, probEvent n (p n) {G : SimpleGraph (Fin n) | u n chromaticNumberNat n G chromaticNumberNat n G u n + 3} 1 - 3 * ε

          Shamir–Spencer four-value concentration of the chromatic number. For sparse Erdős–Rényi graphs $G(n, p)$ with $p < n^{-\alpha}$ and $\alpha > 5/6$, there exists a sequence $u(n)$ such that with probability at least $1 - 3\varepsilon$, $u(n) \le \chi(G) \le u(n) + 3$ for all sufficiently large $n$. The proof combines the Azuma-type bounded-difference inequality with a $3$-colourability property of small induced subgraphs.

          def Martingales.IsMartingale {Ω : Type u_1} {m0 : MeasurableSpace Ω} (μ : MeasureTheory.Measure Ω) ( : MeasureTheory.Filtration m0) (Z : Ω) :

          Definition 9.2.1 (Martingale). A sequence $(Z_n)_{n \ge 0}$ is a martingale with respect to a filtration $(\mathcal F_n)$ and probability measure $\mu$ if each $Z_n$ is $\mathcal F_n$-measurable, integrable, and $\mathbb{E}[Z_{n+1} \mid \mathcal F_n] = Z_n$. This is a thin wrapper around Mathlib's MeasureTheory.Martingale.

          Instances For
            theorem Martingales.azuma_inequality_adapted {Ω : Type u_1} { : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] [StandardBorelSpace Ω] { : MeasureTheory.Filtration } {Z : Ω} (hmart : MeasureTheory.Martingale Z μ) (n : ) (hbdd : i < n, ∀ᵐ (ω : Ω) μ, |Z (i + 1) ω - Z i ω| 1) :
            MeasureTheory.StronglyAdapted fun (i : ) (ω : Ω) => Z (i + 1) ω - Z i ω

            Helper for Azuma's inequality: the martingale-difference process $i \mapsto Z_{i+1} - Z_i$ is strongly adapted to the filtration $\mathcal F$.

            theorem Martingales.azuma_inequality_hasSubgaussianMGF {Ω : Type u_1} { : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] [StandardBorelSpace Ω] { : MeasureTheory.Filtration } {Z : Ω} (hmart : MeasureTheory.Martingale Z μ) (n : ) (hbdd : i < n, ∀ᵐ (ω : Ω) μ, |Z (i + 1) ω - Z i ω| 1) :
            ProbabilityTheory.HasSubgaussianMGF (fun (ω : Ω) => Z 1 ω - Z 0 ω) 1 μ

            Helper for Azuma's inequality: the first martingale increment $Z_1 - Z_0$ is sub-Gaussian with parameter $1$ when the increments satisfy $|Z_{i+1} - Z_i| \le 1$.

            theorem Martingales.azuma_inequality_hasCondSubgaussianMGF {Ω : Type u_1} { : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] [StandardBorelSpace Ω] { : MeasureTheory.Filtration } {Z : Ω} (hmart : MeasureTheory.Martingale Z μ) (n : ) (hbdd : i < n, ∀ᵐ (ω : Ω) μ, |Z (i + 1) ω - Z i ω| 1) (i : ) :
            i < n - 1ProbabilityTheory.HasCondSubgaussianMGF ( i) (fun (ω : Ω) => Z (i + 2) ω - Z (i + 1) ω) 1 μ

            Helper for Azuma's inequality: each subsequent martingale increment $Z_{i+2} - Z_{i+1}$ is conditionally sub-Gaussian (parameter $1$) given $\mathcal F_i$.

            theorem Martingales.azuma_inequality {Ω : Type u_1} { : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] [StandardBorelSpace Ω] { : MeasureTheory.Filtration } {Z : Ω} (hmart : MeasureTheory.Martingale Z μ) (n : ) (hn : 0 < n) (hbdd : i < n, ∀ᵐ (ω : Ω) μ, |Z (i + 1) ω - Z i ω| 1) {t : } (ht : 0 < t) :
            μ.real {ω : Ω | Z n ω - Z 0 ω t * n} Real.exp (-t ^ 2 / 2)

            Azuma's inequality (Theorem 9.2.7 / 9.2.8). For a martingale $(Z_n)$ with bounded increments $|Z_{i+1} - Z_i| \le 1$, the upper tail satisfies $\mathbb{P}(Z_n - Z_0 \ge t\sqrt{n}) \le \exp(-t^{2}/2)$ for every $t > 0$.

            theorem Martingales.azuma_inequality_alt {Ω : Type u_1} { : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] [StandardBorelSpace Ω] { : MeasureTheory.Filtration } {Z : Ω} (hmart : MeasureTheory.Martingale Z μ) (n : ) (c : Fin n) (hc_pos : ∀ (i : Fin n), 0 c i) (hbdd : ∀ (i : Fin n), ∀ᵐ (ω : Ω) μ, |Z (i + 1) ω - Z (↑i) ω| c i) (h_adapted : MeasureTheory.StronglyAdapted fun (i : ) (ω : Ω) => Z (i + 1) ω - Z i ω) (σ : NNReal) ( : ∀ (i : ) (hi : i < n), (σ i) = c i, hi ^ 2) (h0 : ProbabilityTheory.HasSubgaussianMGF (fun (ω : Ω) => Z 1 ω - Z 0 ω) (σ 0) μ) (h_subG : i < n - 1, ProbabilityTheory.HasCondSubgaussianMGF ( i) (fun (ω : Ω) => Z (i + 2) ω - Z (i + 1) ω) (σ (i + 1)) μ) {t : } (ht : 0 < t) :
            μ.real {ω : Ω | Z n ω - Z 0 ω t} Real.exp (-t ^ 2 / (2 * i : Fin n, c i ^ 2))

            Azuma's inequality, weighted form. With increments bounded by $|Z_{i+1} - Z_i| \le c_i$ and sub-Gaussian parameters $\sigma_i = c_i^{2}$, one has $\mathbb{P}(Z_n - Z_0 \ge t) \le \exp\!\big({-t^{2} / (2\sum_i c_i^{2})}\big)$ for $t > 0$.

            noncomputable def Martingales.hoeffdingSubGParam (c : ) :
            0 cNNReal

            The Hoeffding sub-Gaussian parameter $c^{2}/4$ for a centred random variable bounded in an interval of length $c$, packaged as a non-negative real.

            Instances For
              theorem Martingales.hoeffding_lemma {Ω : Type u_1} [MeasurableSpace Ω] {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] {X : Ω} (hX : AEMeasurable X μ) (hE : (ω : Ω), X ω μ = 0) (a : ) (hℓ : 0 ) (hbnd : ∀ᵐ (ω : Ω) μ, a X ω X ω a + ) (t : ) :
              (ω : Ω), Real.exp (t * X ω) μ Real.exp (t ^ 2 * ^ 2 / 8)

              Hoeffding's lemma (Lemma 9.2.12). If $X$ is a centred random variable taking values in $[a, a + \ell]$, then its moment generating function satisfies $\mathbb{E}[e^{tX}] \le \exp(t^{2} \ell^{2} / 8)$ for all $t \in \mathbb{R}$.

              theorem Martingales.azuma_doob_martingale_subG {Ω : Type u_1} { : MeasurableSpace Ω} [StandardBorelSpace Ω] {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] { : MeasureTheory.Filtration } {Y : Ω} {c : } (hc : ∀ (i : ), 0 c i) (h_adapted : MeasureTheory.StronglyAdapted Y) (h0 : ProbabilityTheory.HasSubgaussianMGF (Y 0) (hoeffdingSubGParam (c 0) ) μ) (n : ) (h_subG : i < n - 1, ProbabilityTheory.HasCondSubgaussianMGF ( i) (Y (i + 1)) (hoeffdingSubGParam (c (i + 1)) ) μ) {ε : } ( : 0 ε) :
              μ.real {ω : Ω | ε iFinset.range n, Y i ω} Real.exp (-2 * ε ^ 2 / iFinset.range n, c i ^ 2)

              Azuma–Doob martingale concentration (sub-Gaussian form). For an adapted sequence $(Y_i)$ with sub-Gaussian (resp. conditionally sub-Gaussian given $\mathcal F_i$) MGFs of Hoeffding parameter $c_i^{2}/4$, the partial sum satisfies $\mathbb{P}\!\big(\sum_i Y_i \ge \varepsilon\big) \le \exp\!\big({-2\varepsilon^{2} / \sum_i c_i^{2}}\big)$ for every $\varepsilon \ge 0$.

              theorem Martingales.hasSubgaussianMGF_of_bounded {Ω : Type u_1} { : MeasurableSpace Ω} [StandardBorelSpace Ω] {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] {X : Ω} {c : } (hc : 0 c) (h_mean : (ω : Ω), X ω μ = 0) (h_meas : AEMeasurable X μ) (h_bnd : ∃ (a₀ : ), ∀ᵐ (ω : Ω) μ, X ω Set.Icc a₀ (a₀ + c)) :

              A centred random variable supported in an interval $[a_0, a_0 + c]$ has a sub-Gaussian MGF with the Hoeffding parameter $c^{2}/4$.

              theorem Martingales.hasCondSubgaussianMGF_of_condBounded {Ω : Type u_1} [ : MeasurableSpace Ω] [StandardBorelSpace Ω] {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] (m : MeasurableSpace Ω) (hm : m ) {X : Ω} {c : } (hc : 0 c) (h_condMean : μ[X | m] =ᵐ[μ] 0) (h_bnd : ∃ (a : Ω), Measurable a ∀ᵐ (ω : Ω) μ, X ω Set.Icc (a ω) (a ω + c)) :

              Conditional version of hasSubgaussianMGF_of_bounded: a variable with vanishing conditional mean given $m$ and contained in an interval $[a(\omega), a(\omega) + c]$ (with $a$ being $m$-measurable) has a conditionally sub-Gaussian MGF with the Hoeffding parameter $c^{2}/4$.

              theorem Martingales.azuma_doob_martingale {Ω : Type u_1} { : MeasurableSpace Ω} [StandardBorelSpace Ω] {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] { : MeasureTheory.Filtration } {Y : Ω} {c : } (hc : ∀ (i : ), 0 c i) (h_adapted : MeasureTheory.StronglyAdapted Y) (h_mean0 : (ω : Ω), Y 0 ω μ = 0) (h_meas0 : AEMeasurable (Y 0) μ) (h_bnd0 : ∃ (a₀ : ), ∀ᵐ (ω : Ω) μ, Y 0 ω Set.Icc a₀ (a₀ + c 0)) (n : ) (h_condMean : i < n - 1, μ[Y (i + 1) | i] =ᵐ[μ] 0) (h_bnd : i < n - 1, ∃ (a : Ω), Measurable a ∀ᵐ (ω : Ω) μ, Y (i + 1) ω Set.Icc (a ω) (a ω + c (i + 1))) {ε : } ( : 0 ε) :
              μ.real {ω : Ω | ε iFinset.range n, Y i ω} Real.exp (-2 * ε ^ 2 / iFinset.range n, c i ^ 2)

              Azuma's inequality for a Doob martingale (Theorem 9.2.9). If the increments $Y_i$ are centred (conditionally on $\mathcal F_{i-1}$) and lie in intervals of length $c_i$, then $\mathbb{P}\!\big(\sum_i Y_i \ge \varepsilon\big) \le \exp\!\big({-2\varepsilon^{2} / \sum_i c_i^{2}}\big)$.