Samplinglib
Lean gate not recorded for this source state main · 9bb7a7394ab0
Samplinglib mathematical lesson

Actual countable unit-exponential product inputs

AutoSamplingTheory.TechnicalLemmas.Probability.UnitExponentialProduct.unit_exponential_product_laws · theorem · Teaching coverage

Read this first

Mathematical statement

Equip Ω=ℝ^ℕ with its canonical product measurable structure. Let μ=Exp(1) be the unit-rate exponential Borel measure on ℝ, define the actual countable product P=⊗_(k∈ℕ)μ, and define X_k(ω)=ω_k and ε_k(ω)=max{X_k(ω),0}, with ε_k regarded as a nonnegative real. There are no public mathematical premises. Then: (1) P is a probability measure; (2) for every k∈ℕ, X_k and ε_k are measurable and the real-coordinate pushforward (X_k)_#P equals μ exactly; (3) the entire real coordinate family (X_k) is mutually independent under P; (4) for P-almost every ω, simultaneously for every k, X_k(ω)>0 and the real coercion of ε_k(ω) equals X_k(ω); (5) for P-almost every ω, ∑_(k=0)^(n−1)ε_k(ω)→+∞ in ℝ as n→∞. The two almost-sure clauses may be intersected when used together. The sum at n=0 is zero. The carrier contains negative and zero coordinates, so positivity and clamp agreement are not universal pathwise claims. Source E_(k+1) is represented by X_k, and the actual waiting-time API may use ε_k on the simultaneous full-measure event. Explicit marginal and independence conjuncts concern X, not separately exported ε laws. This supplies the stochastic numerator background for AppendixA.1 Ex9; it does not assert an actual event-time comparison, nonaccumulation, global process, Markov property, invariant law, sampler error or expected query cost.

\[\Omega=\mathbb R^{\mathbb N},\quad P=\bigotimes_{k\in\mathbb N}\mathrm{Exp}(1),\quad X_k(\omega)=\omega_k,\quad\varepsilon_k(\omega)=\max\{X_k(\omega),0\}.\quad P(\Omega)=1,\quad(X_k)_\#P=\mathrm{Exp}(1),\quad(X_k)_{k\in\mathbb N}\text{ mutually independent}.\quad P\!\left(\forall k:\ X_k>0,\ \varepsilon_k=X_k\right)=1,\qquad\sum_{k=0}^{n-1}\varepsilon_k\xrightarrow[n\to\infty]{P\text{-a.s.}}+\infty.\]
Lean statement · unit_exponential_product_laws

Equip Ω=ℝ^ℕ with its canonical product measurable structure. Let μ=Exp(1) be the unit-rate exponential Borel measure on ℝ, define the actual countable product P=⊗_(k∈ℕ)μ, and define X_k(ω)=ω_k and ε_k(ω)=max{X_k(ω),0}, with ε_k regarded as a nonnegative real. There are no public mathematical premises. Then: (1) P is a probability measure; (2) for every k∈ℕ, X_k and ε_k are measurable and the real-coordinate pushforward (X_k)_#P equals μ exactly; (3) the entire real coordinate family (X_k) is mutually independent under P; (4) for P-almost every ω, simultaneously for every k, X_k(ω)>0 and the real coercion of ε_k(ω) equals X_k(ω); (5) for P-almost every ω, ∑_(k=0)^(n−1)ε_k(ω)→+∞ in ℝ as n→∞. The two almost-sure clauses may be intersected when used together. The sum at n=0 is zero. The carrier contains negative and zero coordinates, so positivity and clamp agreement are not universal pathwise claims. Source E_(k+1) is represented by X_k, and the actual waiting-time API may use ε_k on the simultaneous full-measure event. Explicit marginal and independence conjuncts concern X, not separately exported ε laws. This supplies the stochastic numerator background for AppendixA.1 Ex9; it does not assert an actual event-time comparison, nonaccumulation, global process, Markov property, invariant law, sampler error or expected query cost.

Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

theorem unit_exponential_product_laws : unit_exponential_product_statement

Exact module and namespace context

Full Lean proposition (definition) · unit_exponential_product_statement

This literal definition stores the complete proposition asserted above. It supplies no mathematical proof or additional hypothesis; the theorem proof must establish its value.

Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

Download module (.lean)
private def unit_exponential_product_statement : Prop :=
  let P : Measure (ℕ → ℝ) := Measure.infinitePi (fun _ : ℕ => expMeasure (1 : ℝ))
  let X : ℕ → (ℕ → ℝ) → ℝ := fun k ω => ω k
  let ε : ℕ → (ℕ → ℝ) → ℝ≥0 := fun k ω => Real.toNNReal (X k ω)
  IsProbabilityMeasure P ∧
  (∀ k : ℕ, Measurable (X k) ∧ Measurable (ε k) ∧
    Measure.map (X k) P = expMeasure (1 : ℝ)) ∧
  iIndepFun X P ∧
  (∀ᵐ ω ∂P, ∀ k : ℕ, 0 < X k ω ∧ (ε k ω : ℝ) = X k ω) ∧
  (∀ᵐ ω ∂P, Tendsto (fun n : ℕ => ∑ k ∈ Finset.range n, (ε k ω : ℝ))
    atTop atTop)

Exact module and namespace context

Proof roadmap

  1. 1Fix the actual product and threshold representatives

    Use the canonical countable product of rate-one exponential measures on all real sequences. Coordinates are evaluations; ε is the total nonnegative truncation. Unfold the sealed five-clause proposition with these exact definitions. Probability, iid and good-event facts are conclusions to prove, not inputs.

  2. 2Construct probability, measurable coordinates and exact iid laws

    The positive-rate exponential theorem makes every factor a probability measure, so the canonical infinite product is a probability measure. Coordinate evaluation is measurable and has exactly the factor pushforward law; composition with Real.toNNReal is measurable. Apply the actual infinite-product independence theorem to identity coordinate maps.

  3. 3Prove one simultaneous positive and faithful threshold event

    The exponential CDF gives μ((−∞,0])=0. Pull this null event back by each coordinate law, then use countability to obtain a single full-measure event on which all coordinates are strictly positive. On that event max(X_k,0)=X_k, so the total NNReal threshold is faithful to the source clock.

  4. 4Build bounded iid indicators as an ASTIS sufficient OR-route

    Define b(x)=1_{x>1} and B_k=b(X_k). Its measurability follows from the Borel half-line; integrability follows because it is an indicator of the integrable constant1 on a probability space. Measurable coordinate transforms preserve mutual independence and common law. This supplements the author route without asserting that the paper used indicators.

  5. 5Compute the positive indicator mean from the actual exponential tail

    At1 the exponential CDF gives μ((1,∞))=1−F(1)=e^(−1). Push the integral of b through the exact coordinate marginal and integrate the indicator of this half-line. Thus E_P[B_0]=e^(−1)>0. No Exp first-moment calculation is supplied or assumed.

  6. 6Apply the real strong law to the proved integrable iid indicators

    Invoke the pinned real strong law with the internal integrability proof, pairwise independence obtained from mutual independence, and the internally derived identical distributions. Substitute the exact mean. The sample averages converge almost surely to e^(−1).

  7. 7Deduce actual threshold-sum divergence and assemble all five clauses

    Multiply the positive limiting average by n→∞ to obtain divergence of ∑B_k; handle n=0 separately when cancelling real division. For every real coordinate, B_k≤max(X_k,0)=ε_k: above1 use X_k>1, and otherwise B_k=0≤ε_k. Finite-sum domination therefore gives ∑ε_k→∞ on the strong-law event, even without restricting exceptional samples in the comparison. Combine the probability, marginal/measurability, independence, simultaneous good-event and divergence results.

Full assumptions and notation

All objects and hypotheses

  • Fixed carrier Ω=ℕ→ℝ, with the canonical product measurable space; ℝ and ℝ≥0 carry their canonical Borel measurable spaces. No dimension, potential, rate-cap, initialization, probability certificate, iid witness, integrability or convergence hypothesis is supplied.
  • The common rate is exactly1. The product, raw coordinate evaluations and total nonnegative clamp are literal definitions, with probability, measurable laws, independence and AE support proved internally.
  • Source E_(k+1) corresponds to X_k; range n contains exactly the first n clocks. Clamp/raw equality and positivity hold simultaneously for every k on a full-measure event, and may fail on exceptional samples.
  • The implementation proves divergence by the separately identified ASTIS bounded-indicator SLLN route: B_k=1_{X_k>1}, E[B_k]=exp(−1)>0 and B_k≤ε_k. The author direct Exp integrability/mean-one strong-law route is retained as an OPEN alternative source-background expansion.

Mathematical proof

1. Fix the actual product and threshold representatives

Use the canonical countable product of rate-one exponential measures on all real sequences. Coordinates are evaluations; ε is the total nonnegative truncation. Unfold the sealed five-clause proposition with these exact definitions. Probability, iid and good-event facts are conclusions to prove, not inputs.

\[\Omega=\mathbb R^{\mathbb N},\quad P=\bigotimes_{k\in\mathbb N}\mathrm{Exp}(1),\quad X_k(\omega)=\omega_k,\quad\varepsilon_k(\omega)=\max\{X_k(\omega),0\}.\]
Corresponding Lean step
  classical
  let P : Measure (ℕ → ℝ) := Measure.infinitePi (fun _ : ℕ => expMeasure (1 : ℝ))
  let X : ℕ → (ℕ → ℝ) → ℝ := fun k ω => ω k
  let ε : ℕ → (ℕ → ℝ) → ℝ≥0 := fun k ω => Real.toNNReal (X k ω)
  change IsProbabilityMeasure P ∧
    (∀ k : ℕ, Measurable (X k) ∧ Measurable (ε k) ∧
      Measure.map (X k) P = expMeasure (1 : ℝ)) ∧
    iIndepFun X P ∧
    (∀ᵐ ω ∂P, ∀ k : ℕ, 0 < X k ω ∧ (ε k ω : ℝ) = X k ω) ∧
    (∀ᵐ ω ∂P, Tendsto (fun n : ℕ => ∑ k ∈ Finset.range n, (ε k ω : ℝ))
      atTop atTop)

Exact contiguous compiled public BODY; local P/X/ε definitions remain in scope. Author direct Exp-moment proof and actual event-time composition are not claimed.

2. Construct probability, measurable coordinates and exact iid laws

The positive-rate exponential theorem makes every factor a probability measure, so the canonical infinite product is a probability measure. Coordinate evaluation is measurable and has exactly the factor pushforward law; composition with Real.toNNReal is measurable. Apply the actual infinite-product independence theorem to identity coordinate maps.

\[P(\Omega)=1,\quad(X_k)_\#P=\mathrm{Exp}(1),\quad(X_k)_{k\in\mathbb N}\text{ mutually independent}.\]
Corresponding Lean step
  -- The factor probability theorem activates the actual infinite-product APIs.
  let : IsProbabilityMeasure (expMeasure (1 : ℝ)) :=
    isProbabilityMeasure_expMeasure zero_lt_one
  have hP : IsProbabilityMeasure P := inferInstance
  let : IsProbabilityMeasure P := hP
  have hX (k : ℕ) : Measurable (X k) := measurable_pi_apply k
  have hε (k : ℕ) : Measurable (ε k) := measurable_real_toNNReal.comp (hX k)
  have hmap (k : ℕ) : Measure.map (X k) P = expMeasure (1 : ℝ) :=
    Measure.infinitePi_map_eval (fun _ : ℕ => expMeasure (1 : ℝ)) k
  have hindep : iIndepFun X P :=
    iIndepFun_infinitePi (X := fun _ : ℕ => (id : ℝ → ℝ))
      (fun _ => measurable_id)

Exact contiguous compiled public BODY; local P/X/ε definitions remain in scope. Author direct Exp-moment proof and actual event-time composition are not claimed.

3. Prove one simultaneous positive and faithful threshold event

The exponential CDF gives μ((−∞,0])=0. Pull this null event back by each coordinate law, then use countability to obtain a single full-measure event on which all coordinates are strictly positive. On that event max(X_k,0)=X_k, so the total NNReal threshold is faithful to the source clock.

\[F_{\mathrm{Exp}(1)}(0)=0\Longrightarrow P(X_k>0)=1\Longrightarrow P(\forall k:\ X_k>0,\ \varepsilon_k=X_k)=1.\]
Corresponding Lean step
  -- CDF(0)=0 gives strict positivity; countability gives a single good event.
  have hnull : expMeasure (1 : ℝ) (Set.Iic 0) = 0 := by
    apply (measureReal_eq_zero_iff (μ := expMeasure (1 : ℝ)) (s := Set.Iic 0)).mp
    rw [← cdf_eq_real, cdf_expMeasure_eq zero_lt_one]
    norm_num
  have hpos : ∀ᵐ x ∂expMeasure (1 : ℝ), 0 < x := by
    rw [ae_iff]
    simp only [not_lt]
    change expMeasure (1 : ℝ) (Set.Iic 0) = 0
    exact hnull
  have hpos_all : ∀ᵐ ω ∂P, ∀ k : ℕ, 0 < X k ω := by
    rw [ae_all_iff]
    intro k
    apply ae_of_ae_map (hX k).aemeasurable
    simpa only [hmap] using hpos
  have hgood : ∀ᵐ ω ∂P, ∀ k : ℕ, 0 < X k ω ∧ (ε k ω : ℝ) = X k ω := by
    filter_upwards [hpos_all] with ω hω
    exact fun k => ⟨hω k, Real.coe_toNNReal _ (hω k).le⟩

Exact contiguous compiled public BODY; local P/X/ε definitions remain in scope. Author direct Exp-moment proof and actual event-time composition are not claimed.

4. Build bounded iid indicators as an ASTIS sufficient OR-route

Define b(x)=1_{x>1} and B_k=b(X_k). Its measurability follows from the Borel half-line; integrability follows because it is an indicator of the integrable constant1 on a probability space. Measurable coordinate transforms preserve mutual independence and common law. This supplements the author route without asserting that the paper used indicators.

\[B_k=\mathbf1_{\{X_k>1\}},\quad0\le B_k\le1,\quad B_k\in L^1(P),\quad(B_k)\text{ iid}.\]
Corresponding Lean step
  -- ASTIS OR-route: a bounded indicator has a computable strictly positive mean.
  let b : ℝ → ℝ := (Set.Ioi (1 : ℝ)).indicator (fun _ => 1)
  have hb : Measurable b := measurable_const.indicator measurableSet_Ioi
  let B : ℕ → (ℕ → ℝ) → ℝ := fun k ω => b (X k ω)
  have hB0 : Integrable (B 0) P := by
    exact (integrable_const (1 : ℝ)).indicator
      (measurableSet_Ioi.preimage (hX 0))
  have hBindep : iIndepFun B P := hindep.comp (fun _ => b) (fun _ => hb)
  have hident (k : ℕ) : IdentDistrib (B k) (B 0) P P := by
    have hx : IdentDistrib (X k) (X 0) P P :=
      ⟨(hX k).aemeasurable, (hX 0).aemeasurable, (hmap k).trans (hmap 0).symm⟩
    exact hx.comp hb

Exact contiguous compiled public BODY; local P/X/ε definitions remain in scope. Author direct Exp-moment proof and actual event-time composition are not claimed.

5. Compute the positive indicator mean from the actual exponential tail

At1 the exponential CDF gives μ((1,∞))=1−F(1)=e^(−1). Push the integral of b through the exact coordinate marginal and integrate the indicator of this half-line. Thus E_P[B_0]=e^(−1)>0. No Exp first-moment calculation is supplied or assumed.

\[\mathbb E_P[B_0]=\mu((1,\infty))=1-(1-e^{-1})=e^{-1}>0.\]
Corresponding Lean step
  have htail : (expMeasure (1 : ℝ)).real (Set.Ioi (1 : ℝ)) = Real.exp (-1) := by
    rw [← Set.compl_Iic, measureReal_compl measurableSet_Iic, probReal_univ,
      ← cdf_eq_real, cdf_expMeasure_eq zero_lt_one]
    norm_num
  have hmean : (∫ ω, B 0 ω ∂P) = Real.exp (-1) := by
    calc
      (∫ ω, B 0 ω ∂P) = ∫ x, b x ∂Measure.map (X 0) P :=
        (integral_map (hX 0).aemeasurable hb.aestronglyMeasurable).symm
      _ = ∫ x, b x ∂expMeasure (1 : ℝ) := by rw [hmap]
      _ = (expMeasure (1 : ℝ)).real (Set.Ioi (1 : ℝ)) :=
        integral_indicator_one measurableSet_Ioi
      _ = Real.exp (-1) := htail

Exact contiguous compiled public BODY; local P/X/ε definitions remain in scope. Author direct Exp-moment proof and actual event-time composition are not claimed.

6. Apply the real strong law to the proved integrable iid indicators

Invoke the pinned real strong law with the internal integrability proof, pairwise independence obtained from mutual independence, and the internally derived identical distributions. Substitute the exact mean. The sample averages converge almost surely to e^(−1).

\[\frac1n\sum_{k=0}^{n-1}B_k\xrightarrow[n\to\infty]{P\text{-a.s.}}e^{-1}.\]
Corresponding Lean step
  have hslln : ∀ᵐ ω ∂P, Tendsto
      (fun n : ℕ => (∑ k ∈ Finset.range n, B k ω) / (n : ℝ))
      atTop (𝓝 (Real.exp (-1))) := by
    simpa only [hmean] using
      strong_law_ae_real B hB0 (fun _ _ hij => hBindep.indepFun hij) hident

Exact contiguous compiled public BODY; local P/X/ε definitions remain in scope. Author direct Exp-moment proof and actual event-time composition are not claimed.

7. Deduce actual threshold-sum divergence and assemble all five clauses

Multiply the positive limiting average by n→∞ to obtain divergence of ∑B_k; handle n=0 separately when cancelling real division. For every real coordinate, B_k≤max(X_k,0)=ε_k: above1 use X_k>1, and otherwise B_k=0≤ε_k. Finite-sum domination therefore gives ∑ε_k→∞ on the strong-law event, even without restricting exceptional samples in the comparison. Combine the probability, marginal/measurability, independence, simultaneous good-event and divergence results.

\[B_k\le\varepsilon_k\quad\Longrightarrow\quad\sum_{k<n}\varepsilon_k\ge\sum_{k<n}B_k\longrightarrow+\infty.\]
Corresponding Lean step
  -- Positive limiting average forces unbounded sums; each indicator is below ε.
  have hdiv : ∀ᵐ ω ∂P, Tendsto
      (fun n : ℕ => ∑ k ∈ Finset.range n, (ε k ω : ℝ)) atTop atTop := by
    filter_upwards [hslln] with ω hω
    have hmul := hω.pos_mul_atTop (Real.exp_pos (-1))
      (tendsto_natCast_atTop_atTop (R := ℝ))
    have hsum : Tendsto (fun n : ℕ => ∑ k ∈ Finset.range n, B k ω) atTop atTop := by
      apply hmul.congr'
      exact Filter.Eventually.of_forall fun n => by
        by_cases hn : n = 0
        · subst n
          simp
        · exact div_mul_cancel₀ _ (Nat.cast_ne_zero.mpr hn)
    apply tendsto_atTop_mono _ hsum
    intro n
    apply Finset.sum_le_sum
    intro k _
    by_cases hk : 1 < X k ω
    · have hraw := Real.le_coe_toNNReal (X k ω)
      simpa [B, b, Set.indicator_of_mem, hk, ε] using hk.le.trans hraw
    · simp [B, b, hk]
  exact ⟨hP, fun k => ⟨hX k, hε k, hmap k⟩, hindep, hgood, hdiv⟩

Exact contiguous compiled public BODY; local P/X/ε definitions remain in scope. Author direct Exp-moment proof and actual event-time composition are not claimed.

Lean verification

The exact proof begins folded immediately after the mathematical argument; the statement is folded beside the claim above.

Lean proof · unit_exponential_product_laws

Fix the actual product and threshold representatives; Construct probability, measurable coordinates and exact iid laws; Prove one simultaneous positive and faithful threshold event; Build bounded iid indicators as an ASTIS sufficient OR-route; Compute the positive indicator mean from the actual exponential tail; Apply the real strong law to the proved integrable iid indicators; Deduce actual threshold-sum divergence and assemble all five clauses

Braces mark parameters Lean can infer; square brackets request structures such as a measurable space or probability measure. Named hypotheses are mathematical premises, not facts established by this declaration. Section parameters are described in the mathematical hypotheses above; the module link retains their exact source context.

Download module (.lean)
theorem unit_exponential_product_laws : unit_exponential_product_statement := by
  classical
  let P : Measure (ℕ → ℝ) := Measure.infinitePi (fun _ : ℕ => expMeasure (1 : ℝ))
  let X : ℕ → (ℕ → ℝ) → ℝ := fun k ω => ω k
  let ε : ℕ → (ℕ → ℝ) → ℝ≥0 := fun k ω => Real.toNNReal (X k ω)
  change IsProbabilityMeasure P ∧
    (∀ k : ℕ, Measurable (X k) ∧ Measurable (ε k) ∧
      Measure.map (X k) P = expMeasure (1 : ℝ)) ∧
    iIndepFun X P ∧
    (∀ᵐ ω ∂P, ∀ k : ℕ, 0 < X k ω ∧ (ε k ω : ℝ) = X k ω) ∧
    (∀ᵐ ω ∂P, Tendsto (fun n : ℕ => ∑ k ∈ Finset.range n, (ε k ω : ℝ))
      atTop atTop)
  -- The factor probability theorem activates the actual infinite-product APIs.
  let : IsProbabilityMeasure (expMeasure (1 : ℝ)) :=
    isProbabilityMeasure_expMeasure zero_lt_one
  have hP : IsProbabilityMeasure P := inferInstance
  let : IsProbabilityMeasure P := hP
  have hX (k : ℕ) : Measurable (X k) := measurable_pi_apply k
  have hε (k : ℕ) : Measurable (ε k) := measurable_real_toNNReal.comp (hX k)
  have hmap (k : ℕ) : Measure.map (X k) P = expMeasure (1 : ℝ) :=
    Measure.infinitePi_map_eval (fun _ : ℕ => expMeasure (1 : ℝ)) k
  have hindep : iIndepFun X P :=
    iIndepFun_infinitePi (X := fun _ : ℕ => (id : ℝ → ℝ))
      (fun _ => measurable_id)
  -- CDF(0)=0 gives strict positivity; countability gives a single good event.
  have hnull : expMeasure (1 : ℝ) (Set.Iic 0) = 0 := by
    apply (measureReal_eq_zero_iff (μ := expMeasure (1 : ℝ)) (s := Set.Iic 0)).mp
    rw [← cdf_eq_real, cdf_expMeasure_eq zero_lt_one]
    norm_num
  have hpos : ∀ᵐ x ∂expMeasure (1 : ℝ), 0 < x := by
    rw [ae_iff]
    simp only [not_lt]
    change expMeasure (1 : ℝ) (Set.Iic 0) = 0
    exact hnull
  have hpos_all : ∀ᵐ ω ∂P, ∀ k : ℕ, 0 < X k ω := by
    rw [ae_all_iff]
    intro k
    apply ae_of_ae_map (hX k).aemeasurable
    simpa only [hmap] using hpos
  have hgood : ∀ᵐ ω ∂P, ∀ k : ℕ, 0 < X k ω ∧ (ε k ω : ℝ) = X k ω := by
    filter_upwards [hpos_all] with ω hω
    exact fun k => ⟨hω k, Real.coe_toNNReal _ (hω k).le⟩
  -- ASTIS OR-route: a bounded indicator has a computable strictly positive mean.
  let b : ℝ → ℝ := (Set.Ioi (1 : ℝ)).indicator (fun _ => 1)
  have hb : Measurable b := measurable_const.indicator measurableSet_Ioi
  let B : ℕ → (ℕ → ℝ) → ℝ := fun k ω => b (X k ω)
  have hB0 : Integrable (B 0) P := by
    exact (integrable_const (1 : ℝ)).indicator
      (measurableSet_Ioi.preimage (hX 0))
  have hBindep : iIndepFun B P := hindep.comp (fun _ => b) (fun _ => hb)
  have hident (k : ℕ) : IdentDistrib (B k) (B 0) P P := by
    have hx : IdentDistrib (X k) (X 0) P P :=
      ⟨(hX k).aemeasurable, (hX 0).aemeasurable, (hmap k).trans (hmap 0).symm⟩
    exact hx.comp hb
  have htail : (expMeasure (1 : ℝ)).real (Set.Ioi (1 : ℝ)) = Real.exp (-1) := by
    rw [← Set.compl_Iic, measureReal_compl measurableSet_Iic, probReal_univ,
      ← cdf_eq_real, cdf_expMeasure_eq zero_lt_one]
    norm_num
  have hmean : (∫ ω, B 0 ω ∂P) = Real.exp (-1) := by
    calc
      (∫ ω, B 0 ω ∂P) = ∫ x, b x ∂Measure.map (X 0) P :=
        (integral_map (hX 0).aemeasurable hb.aestronglyMeasurable).symm
      _ = ∫ x, b x ∂expMeasure (1 : ℝ) := by rw [hmap]
      _ = (expMeasure (1 : ℝ)).real (Set.Ioi (1 : ℝ)) :=
        integral_indicator_one measurableSet_Ioi
      _ = Real.exp (-1) := htail
  have hslln : ∀ᵐ ω ∂P, Tendsto
      (fun n : ℕ => (∑ k ∈ Finset.range n, B k ω) / (n : ℝ))
      atTop (𝓝 (Real.exp (-1))) := by
    simpa only [hmean] using
      strong_law_ae_real B hB0 (fun _ _ hij => hBindep.indepFun hij) hident
  -- Positive limiting average forces unbounded sums; each indicator is below ε.
  have hdiv : ∀ᵐ ω ∂P, Tendsto
      (fun n : ℕ => ∑ k ∈ Finset.range n, (ε k ω : ℝ)) atTop atTop := by
    filter_upwards [hslln] with ω hω
    have hmul := hω.pos_mul_atTop (Real.exp_pos (-1))
      (tendsto_natCast_atTop_atTop (R := ℝ))
    have hsum : Tendsto (fun n : ℕ => ∑ k ∈ Finset.range n, B k ω) atTop atTop := by
      apply hmul.congr'
      exact Filter.Eventually.of_forall fun n => by
        by_cases hn : n = 0
        · subst n
          simp
        · exact div_mul_cancel₀ _ (Nat.cast_ne_zero.mpr hn)
    apply tendsto_atTop_mono _ hsum
    intro n
    apply Finset.sum_le_sum
    intro k _
    by_cases hk : 1 < X k ω
    · have hraw := Real.le_coe_toNNReal (X k ω)
      simpa [B, b, Set.indicator_of_mem, hk, ε] using hk.le.trans hraw
    · simp [B, b, hk]
  exact ⟨hP, fun k => ⟨hX k, hε k, hmap k⟩, hindep, hgood, hdiv⟩

end AutoSamplingTheory.TechnicalLemmas.Probability.UnitExponentialProduct

Exact module and namespace context

Scope and omitted-condition boundaries
  • Countable unit-exponential input law only. No event-time nonaccumulation, global physical-time path/PDMP/Markov/invariance/kernel/hypocoercivity/main/error/expected-query cost/actual-input composition. Source author direct Exp-SLLN/mean-one route remains separate from any sufficient ASTIS bounded-indicator SLLN alternative. No full Exposition/PURIFIED/main/live/whole-paper/Goal credit. Focused compilation is local evidence; independent compiled-source, exact-commit and aggregate/reader acceptance remain separate.
Sources, dependencies, and reuse

Source and reuse

Samplinglib parents called

    Mathlib API called (external library)

    • ProbabilityTheory.isProbabilityMeasure_expMeasure
    • MeasureTheory.Measure.infinitePi_map_eval
    • ProbabilityTheory.iIndepFun_infinitePi
    • ProbabilityTheory.iIndepFun.comp
    • ProbabilityTheory.IdentDistrib.comp
    • ProbabilityTheory.cdf_expMeasure_eq
    • MeasureTheory.measureReal_eq_zero_iff
    • MeasureTheory.ae_all_iff
    • MeasureTheory.integral_map
    • MeasureTheory.integral_indicator_one
    • ProbabilityTheory.strong_law_ae_real
    • Filter.Tendsto.pos_mul_atTop
    • Filter.tendsto_natCast_atTop_atTop
    • Filter.tendsto_atTop_mono
    • Real.coe_toNNReal
    • Real.le_coe_toNNReal

    Mathematical sources

    Samplinglib prose is not a quotation or a source-equivalence certificate. Definitions and aliases are explained as constructions, not counted as new mathematical proofs.