Datasets:
question_id int64 1 450 | problem_name stringlengths 28 66 | informal_statement stringlengths 49 702 | lean_statement stringlengths 110 2.66k ⌀ | true_to_source stringclasses 2
values | proof stringclasses 168
values | time_seconds int64 40 1.95k ⌀ | topic stringclasses 8
values | time_seconds_is_lower_bound bool 1
class |
|---|---|---|---|---|---|---|---|---|
8 | stochastic_processes_martingale_1 | Consider biased gambler’s ruin: at each step, the gambler gains one dollar
with probability p and losses one dollar with probability (1 − p).
Let X_n be the money in purse at time n.
Show that if p = 1/2, then (X_n) is a martingale. | theorem q8_gambler_martingale (μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
(X : ℕ → Ω → ℝ) (hadap : Adapted ℱ X) (hint : ∀ n, Integrable (X n) μ) (p : ℝ) (hp : p = 1 / 2)
(hstep : IsConstDrift μ ℱ X (2 * p - 1)) :
Martingale X ℱ μ := by sorry | literal | theorem q8_gambler_martingale (μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
(X : ℕ → Ω → ℝ) (hadap : Adapted ℱ X) (hint : ∀ n, Integrable (X n) μ) (p : ℝ) (hp : p = 1 / 2)
(hstep : IsConstDrift μ ℱ X (2 * p - 1)) :
Martingale X ℱ μ := by
apply martingale_of_condExp_sub_eq_zero_nat hadap.s... | 40 | Martingales & stopping | null |
10 | stochastic_processes_birth_death_reversible | Consider a birth-death Markov chain on a countable state space that possesses a stationary distribution.
Show that the chain is reversible. | theorem q10_birth_death_reversible
(P : ℕ → ℕ → ℝ) (hP0 : ∀ i j, 0 ≤ P i j) (hP1 : ∀ i, ∑' j, P i j = 1)
(hbd : ∀ i j, 1 < max i j - min i j → P i j = 0)
(π : ℕ → ℝ) (hπ0 : ∀ i, 0 ≤ π i) (hπsum : ∑' i, π i = 1)
(hstat : ∀ j, ∑' i, π i * P i j = π j) :
∀ i j, π i * P i j = π j * P j i := by
sorry | abstract | theorem q10_birth_death_reversible
(P : ℕ → ℕ → ℝ) (hP0 : ∀ i j, 0 ≤ P i j) (hP1 : ∀ i, ∑' j, P i j = 1)
(hbd : ∀ i j, 1 < max i j - min i j → P i j = 0)
(π : ℕ → ℝ) (hπ0 : ∀ i, 0 ≤ π i) (hπsum : ∑' i, π i = 1)
(hstat : ∀ j, ∑' i, π i * P i j = π j) :
∀ i j, π i * P i j = π j * P j i := by
-- P va... | 149 | Markov chains (finite & countable) | null |
11 | stochastic_processes_birth_death_process_stationary | Consider an irreducible birth-death continuous-time Markov chain with birth rate λ_i in state i and death rate μ_{i+1} from state i+1, and let ρ_i = λ_i/μ_{i+1}.
Show that the steady-state distribution, when it exists, satisfies p_i = p_0 ∏_{j<i} ρ_j and p_i λ_i = p_{i+1} μ_{i+1} for all i. | theorem q11_birth_death_stationary
(lam : ℕ → ℝ) (hlam : ∀ i, 0 < lam i)
(mu : ℕ → ℝ) (hmu : ∀ i, 0 < mu (i + 1))
(ρ : ℕ → ℝ) (hρ : ∀ i, ρ i = lam i / mu (i + 1))
(p : ℕ → ℝ) (hp0 : ∀ i, 0 ≤ p i) (hpsum : ∑' i, p i = 1)
(hbal0 : p 0 * lam 0 = p 1 * mu 1)
(hbal : ∀ n, p (n + 1) * (lam (n + 1) + m... | abstract | theorem q11_birth_death_stationary
(lam : ℕ → ℝ) (hlam : ∀ i, 0 < lam i)
(mu : ℕ → ℝ) (hmu : ∀ i, 0 < mu (i + 1))
(ρ : ℕ → ℝ) (hρ : ∀ i, ρ i = lam i / mu (i + 1))
(p : ℕ → ℝ) (hp0 : ∀ i, 0 ≤ p i) (hpsum : ∑' i, p i = 1)
(hbal0 : p 0 * lam 0 = p 1 * mu 1)
(hbal : ∀ n, p (n + 1) * (lam (n + 1) + m... | 130 | Continuous-time Markov & queues | null |
19 | stochastic_processes_martingale_stopping_time_1 | Let (X_n)_{n ≥ 0} be a martingale, and let S ≤ T be bounded stopping times.
Show that 𝔼[X_T] = 𝔼[X_S]. | theorem q19_optional_stopping_eq (μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
[SigmaFiniteFiltration μ ℱ] (X : ℕ → Ω → ℝ) (hX : Martingale X ℱ μ) (S T : Ω → ℕ)
(hS : IsStoppingTime ℱ (natStop S))
(hT : IsStoppingTime ℱ (natStop T))
(hST : ∀ ω, S ω ≤ T ω) (N : ℕ) (hTbdd : ∀ ω, T ω ≤ N) ... | literal | theorem q19_optional_stopping_eq (μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
[SigmaFiniteFiltration μ ℱ] (X : ℕ → Ω → ℝ) (hX : Martingale X ℱ μ) (S T : Ω → ℕ)
(hS : IsStoppingTime ℱ (natStop S))
(hT : IsStoppingTime ℱ (natStop T))
(hST : ∀ ω, S ω ≤ T ω) (N : ℕ) (hTbdd : ∀ ω, T ω ≤ N) ... | 300 | Martingales & stopping | null |
22 | stochastic_processes_martingale_2 | Let (ξ_i)_{i ≥ 1} be i.i.d with 𝔼[ξ1] = 0.
Show that X_n = sum_1^n ξ_i is a martingale. | theorem q22_martingale_sum (μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
(ξ : ℕ → Ω → ℝ) (hint : ∀ n, Integrable (ξ n) μ)
(hmeas : ∀ n, StronglyMeasurable[ℱ (n + 1)] (ξ n))
(hmean : ∀ n, μ[ξ n | ℱ n] =ᵐ[μ] 0) :
Martingale (fun n ω => ∑ i ∈ Finset.range n, ξ i ω) ℱ μ := by sorry | literal | theorem q22_martingale_sum (μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
(ξ : ℕ → Ω → ℝ) (hint : ∀ n, Integrable (ξ n) μ)
(hmeas : ∀ n, StronglyMeasurable[ℱ (n + 1)] (ξ n))
(hmean : ∀ n, μ[ξ n | ℱ n] =ᵐ[μ] 0) :
Martingale (fun n ω => ∑ i ∈ Finset.range n, ξ i ω) ℱ μ := by
apply martin... | 259 | Martingales & stopping | null |
24 | stochastic_processes_ctmc_embedded_vs_process_probabilities | Let (X(t)) be an irreducible positive-recurrent continuous-time Markov chain with embedded stationary distribution (π_j) and exit rates (ν_j), and process probabilities (p_j).
Show that p_j = π_j when all exit rates ν_j are equal, and give an example where the two distributions differ. | theorem q24_ctmc_embedded_vs_process {S : Type*} [Countable S]
(P : S → S → ℝ) (hP0 : ∀ i j, 0 ≤ P i j) (hPstoch : ∀ i, ∑' j, P i j = 1)
(hPloop : ∀ i, P i i = 0)
(π : S → ℝ) (hπpos : ∀ i, 0 < π i) (hπsum : ∑' i, π i = 1)
(hπstat : ∀ j, ∑' i, π i * P i j = π j)
(ν : S → ℝ) (hν : ∀ i, 0 < ν i)
(ν... | abstract | theorem q24_ctmc_embedded_vs_process {S : Type*} [Countable S]
(P : S → S → ℝ) (hP0 : ∀ i j, 0 ≤ P i j) (hPstoch : ∀ i, ∑' j, P i j = 1)
(hPloop : ∀ i, P i i = 0)
(π : S → ℝ) (hπpos : ∀ i, 0 < π i) (hπsum : ∑' i, π i = 1)
(hπstat : ∀ j, ∑' i, π i * P i j = π j)
(ν : S → ℝ) (hν : ∀ i, 0 < ν i)
(ν... | 110 | Continuous-time Markov & queues | null |
29 | stochastic_processes_round_robin_steady_state | Consider the round-robin service system modeled as a Markov chain with arrival probability λ per quantum and geometric service requirement with per-quantum completion probability, and let ρ be the ratio of arrival rate to service rate with ρ < 1.
Show that the steady-state distribution of the number in the system is g... | theorem q29_round_robin_steady_state
(lam mu ρ : ℝ) (hmu : 0 < mu) (hρdef : ρ = lam / mu) (hρ0 : 0 ≤ ρ) (hρ1 : ρ < 1)
(p q : ℕ → ℝ) (hp : ∀ i, 0 < p i) (hq : ∀ i, 0 < q (i + 1))
(hratio : ∀ i, p i / q (i + 1) = ρ) :
∀ π : ℕ → ℝ, (∀ i, 0 ≤ π i) → (∑' i, π i = 1) →
(∀ i, π i * p i = π (i + 1) * q (i... | abstract | theorem q29_round_robin_steady_state
(lam mu ρ : ℝ) (hmu : 0 < mu) (hρdef : ρ = lam / mu) (hρ0 : 0 ≤ ρ) (hρ1 : ρ < 1)
(p q : ℕ → ℝ) (hp : ∀ i, 0 < p i) (hq : ∀ i, 0 < q (i + 1))
(hratio : ∀ i, p i / q (i + 1) = ρ) :
∀ π : ℕ → ℝ, (∀ i, 0 ≤ π i) → (∑' i, π i = 1) →
(∀ i, π i * p i = π (i + 1) * q (i... | 90 | Continuous-time Markov & queues | null |
31 | stochastic_processes_submartingale_convergence_theorem | Let (Z_n) be a submartingale satisfying E[|Z_n|] ≤ M < ∞ for all n.
Show that Z_n converges with probability 1 to a finite limiting random variable. | theorem q31_submartingale_convergence (μ : Measure Ω) [IsProbabilityMeasure μ]
(ℱ : Filtration ℕ m0) (Z : ℕ → Ω → ℝ) (hZ : Submartingale Z ℱ μ)
(M : ℝ) (hbdd : ∀ n, ∫ ω, |Z n ω| ∂μ ≤ M) :
∃ Zinf : Ω → ℝ, ∀ᵐ ω ∂μ, Tendsto (fun n => Z n ω) atTop (𝓝 (Zinf ω)) := by
sorry | literal | theorem q31_submartingale_convergence (μ : Measure Ω) [IsProbabilityMeasure μ]
(ℱ : Filtration ℕ m0) (Z : ℕ → Ω → ℝ) (hZ : Submartingale Z ℱ μ)
(M : ℝ) (hbdd : ∀ n, ∫ ω, |Z n ω| ∂μ ≤ M) :
∃ Zinf : Ω → ℝ, ∀ᵐ ω ∂μ, Tendsto (fun n => Z n ω) atTop (𝓝 (Zinf ω)) := by
refine ⟨ℱ.limitProcess Z μ, ?_⟩
have hbo... | 115 | Martingales & stopping | null |
32 | stochastic_processes_markov_modulated_matrix_generating | Let a Markov-modulated random walk have modulating chain with transition matrix [P] and per-transition increment generating functions g_{ij}(r), and define [A(r)] by A_{ij}(r) = P_{ij} g_{ij}(r).
Show that E[e^{r S_n}] is obtained from the nth power of [A(r)], so that the growth rate of the walk's moment generating fu... | theorem q32_markov_modulated_matrix_generating {σ : Type*} [Fintype σ] [DecidableEq σ]
(P : Matrix σ σ ℝ) (g : σ → σ → ℝ)
(A : Matrix σ σ ℝ) (hA : ∀ i j, A i j = P i j * g i j)
(Φ : ℕ → σ → ℝ) (hΦ0 : ∀ i, Φ 0 i = 1)
(hΦrec : ∀ n i, Φ (n + 1) i = ∑ j, A i j * Φ n j) :
∀ n i, Φ n i = ∑ j, (A ^ n) i j ... | abstract | theorem q32_markov_modulated_matrix_generating {σ : Type*} [Fintype σ] [DecidableEq σ]
(P : Matrix σ σ ℝ) (g : σ → σ → ℝ)
(A : Matrix σ σ ℝ) (hA : ∀ i j, A i j = P i j * g i j)
(Φ : ℕ → σ → ℝ) (hΦ0 : ∀ i, Φ 0 i = 1)
(hΦrec : ∀ n i, Φ (n + 1) i = ∑ j, A i j * Φ n j) :
∀ n i, Φ n i = ∑ j, (A ^ n) i j ... | 124 | Random walks & large deviations | null |
33 | stochastic_processes_brownian_motion_martingale | Let B be a standard Brownian motion with its natural filtration.
Show that B(t) is a martingale. | theorem q33_brownian_motion_martingale (μ : Measure Ω) [IsProbabilityMeasure μ]
(ℱ : Filtration ℝ m0) (B : ℝ → Ω → ℝ)
(hadap : Adapted ℱ B)
(hint : ∀ t, Integrable (B t) μ)
(hB0 : ∀ᵐ ω ∂μ, B 0 ω = 0)
(hincr : ∀ s t : ℝ, 0 ≤ s → s ≤ t →
HasLaw (fun ω => B t ω - B s ω) (gaussianReal 0 (t - s).to... | abstract | theorem q33_brownian_motion_martingale (μ : Measure Ω) [IsProbabilityMeasure μ]
(ℱ : Filtration ℝ m0) (B : ℝ → Ω → ℝ)
(hadap : Adapted ℱ B)
(hint : ∀ t, Integrable (B t) μ)
(hB0 : ∀ᵐ ω ∂μ, B 0 ω = 0)
(hincr : ∀ s t : ℝ, 0 ≤ s → s ≤ t →
HasLaw (fun ω => B t ω - B s ω) (gaussianReal 0 (t - s).to... | 474 | Brownian motion & stochastic calculus | null |
38 | stochastic_processes_markov_chain_1 | A company issues N different types of coupons. Each coupon is equally likely to be each of the N types.
A collector desires a complete set. Let S represent the sum of (1/k), for 1 ≤ k ≤ N.
Show that the expected time for the collector to obtain all N types is N*S. | theorem q38_coupon_collector_expected (N : ℕ) (hN : 0 < N) (e : ℕ → ℝ) (hbN : e N = 0)
(hrec : ∀ k, k < N →
e k = 1 + ((k : ℝ) / N) * e k + (((N : ℝ) - k) / N) * e (k + 1)) :
e 0 = (N : ℝ) * ∑ k ∈ Finset.Icc 1 N, (1 : ℝ) / k := by sorry | abstract | theorem q38_coupon_collector_expected (N : ℕ) (hN : 0 < N) (e : ℕ → ℝ) (hbN : e N = 0)
(hrec : ∀ k, k < N →
e k = 1 + ((k : ℝ) / N) * e k + (((N : ℝ) - k) / N) * e (k + 1)) :
e 0 = (N : ℝ) * ∑ k ∈ Finset.Icc 1 N, (1 : ℝ) / k := by
have hNR : (0:ℝ) < N := by exact_mod_cast hN
have hNne : (N:ℝ) ≠ 0 := n... | 928 | Markov chains (finite & countable) | null |
40 | stochastic_processes_class_same_period | Let (X_n) be a finite-state Markov chain and let d(i) = gcd{n ≥ 1 : P_{ii}^n > 0} be the period of state i.
Show that all states in the same communicating class have the same period. | theorem q40_class_same_period {Ω : Type*} [Fintype Ω] [DecidableEq Ω]
(P : Matrix Ω Ω ℝ) (hP : IsStochastic P) :
∀ x y : Ω, ((∃ m : ℕ, 0 < (P ^ m) x y) ∧ (∃ k : ℕ, 0 < (P ^ k) y x)) →
∀ d : ℕ, (∀ n, 0 < (P ^ n) x x → d ∣ n) ↔ (∀ n, 0 < (P ^ n) y y → d ∣ n) := by
sorry | abstract | theorem q40_class_same_period {Ω : Type*} [Fintype Ω] [DecidableEq Ω]
(P : Matrix Ω Ω ℝ) (hP : IsStochastic P) :
∀ x y : Ω, ((∃ m : ℕ, 0 < (P ^ m) x y) ∧ (∃ k : ℕ, 0 < (P ^ k) y x)) →
∀ d : ℕ, (∀ n, 0 < (P ^ n) x x → d ∣ n) ↔ (∀ n, 0 < (P ^ n) y y → d ∣ n) := by
have hPnn : ∀ (t : ℕ) (u v : Ω), 0 ≤ (P ^... | 157 | Markov chains (finite & countable) | null |
41 | stochastic_processes_mdp_optimal_policy_finite_horizon | Consider a finite-state, finite-decision Markov decision problem over a horizon of n transitions.
Show that the dynamic programming recursion yields an optimal policy, and that the decision achieving the maximum at each stage depends only on the current state and the number of stages remaining. | theorem q41_optimal_policy_finite_horizon {Ω : Type*} [Fintype Ω] [DecidableEq Ω]
{K : Type*} [Fintype K] [Nonempty K]
(r : K → Ω → ℝ) (P : K → Matrix Ω Ω ℝ) (hP : ∀ k, IsStochastic (P k))
(v : ℕ → Ω → ℝ) (hv0 : ∀ i, v 0 i = 0)
(hvrec : ∀ n i, v (n + 1) i = ⨆ k, (r k i + ∑ j, P k i j * v n j)) :
∃ μ... | abstract | theorem q41_optimal_policy_finite_horizon {Ω : Type*} [Fintype Ω] [DecidableEq Ω]
{K : Type*} [Fintype K] [Nonempty K]
(r : K → Ω → ℝ) (P : K → Matrix Ω Ω ℝ) (hP : ∀ k, IsStochastic (P k))
(v : ℕ → Ω → ℝ) (hv0 : ∀ i, v 0 i = 0)
(hvrec : ∀ n i, v (n + 1) i = ⨆ k, (r k i + ∑ j, P k i j * v n j)) :
∃ μ... | 109 | Markov chains (finite & countable) | null |
43 | stochastic_processes_exponential_tilting | Let X have moment generating function M and let θ_0 be such that M(θ_0) < ∞. Define the tilted distribution by P(X_{θ_0} ≤ z) = M(θ_0)^{-1} ∫_{−∞}^z e^{θ_0 x} dP(x).
Show that this defines a probability distribution and that E[X_{θ_0}] = Ṁ(θ_0)/M(θ_0). | theorem q43_exponential_tilting (μ : Measure Ω) [IsProbabilityMeasure μ]
(X : Ω → ℝ) (hX : Measurable X) (θ₀ : ℝ)
(hInt : ∀ᶠ s in nhds θ₀, Integrable (fun ω => Real.exp (s * X ω)) μ) :
IsProbabilityMeasure (μ.tilted (fun ω => θ₀ * X ω)) ∧
∫ ω, X ω ∂(μ.tilted (fun ω => θ₀ * X ω))
= deriv (fun t => ... | literal | theorem q43_exponential_tilting (μ : Measure Ω) [IsProbabilityMeasure μ]
(X : Ω → ℝ) (hX : Measurable X) (θ₀ : ℝ)
(hInt : ∀ᶠ s in nhds θ₀, Integrable (fun ω => Real.exp (s * X ω)) μ) :
IsProbabilityMeasure (μ.tilted (fun ω => θ₀ * X ω)) ∧
∫ ω, X ω ∂(μ.tilted (fun ω => θ₀ * X ω))
= deriv (fun t => ... | 443 | Random walks & large deviations | null |
51 | stochastic_processes_brownian_marginal | Let B be standard Brownian motion: B(0) = 0 and the increment B(t) − B(s) is normal with mean 0 and variance t − s for 0 ≤ s ≤ t. Show that B(t) is normally distributed with mean 0 and variance t. | theorem q51_brownian_marginal (μ : Measure Ω) [IsProbabilityMeasure μ]
(B : ℝ → Ω → ℝ) (hB0 : ∀ᵐ ω ∂μ, B 0 ω = 0)
(hincr : ∀ s t : ℝ, 0 ≤ s → s ≤ t →
HasLaw (fun ω => B t ω - B s ω) (gaussianReal 0 (t - s).toNNReal) μ) :
∀ t : ℝ, 0 ≤ t → HasLaw (B t) (gaussianReal 0 t.toNNReal) μ := by
sorry | abstract | theorem q51_brownian_marginal (μ : Measure Ω) [IsProbabilityMeasure μ]
(B : ℝ → Ω → ℝ) (hB0 : ∀ᵐ ω ∂μ, B 0 ω = 0)
(hincr : ∀ s t : ℝ, 0 ≤ s → s ≤ t →
HasLaw (fun ω => B t ω - B s ω) (gaussianReal 0 (t - s).toNNReal) μ) :
∀ t : ℝ, 0 ≤ t → HasLaw (B t) (gaussianReal 0 t.toNNReal) μ := by
intro t ht
... | 52 | Brownian motion & stochastic calculus | null |
54 | stochastic_processes_continuous_mapping_theorem | Let P_n ⇒ P on a metric space S_1 and let f : S_1 → S_2 be continuous.
Show that P_n f^{-1} ⇒ P f^{-1}. | theorem q54_continuous_mapping_theorem
{S₁ S₂ : Type*} [MeasurableSpace S₁] [TopologicalSpace S₁] [OpensMeasurableSpace S₁]
[MeasurableSpace S₂] [TopologicalSpace S₂] [BorelSpace S₂]
(Ps : ℕ → ProbabilityMeasure S₁) (P : ProbabilityMeasure S₁)
(hconv : Tendsto Ps atTop (𝓝 P))
(f : S₁ → S₂) (hf : Co... | literal | theorem q54_continuous_mapping_theorem
{S₁ S₂ : Type*} [MeasurableSpace S₁] [TopologicalSpace S₁] [OpensMeasurableSpace S₁]
[MeasurableSpace S₂] [TopologicalSpace S₂] [BorelSpace S₂]
(Ps : ℕ → ProbabilityMeasure S₁) (P : ProbabilityMeasure S₁)
(hconv : Tendsto Ps atTop (𝓝 P))
(f : S₁ → S₂) (hf : Co... | 88 | Weak convergence & functional limits | null |
57 | stochastic_processes_doob_martingale | Let Z be a random variable with E[|Z|] < ∞, let (X_n) be an arbitrary sequence of random variables, and define Z_n = E[Z | X_n, X_{n−1}, …, X_1].
Show that (Z_n) is a martingale (Doob's martingale). | theorem q57_doob_martingale (μ : Measure Ω) [IsProbabilityMeasure μ]
(Z : Ω → ℝ) (hZ : Integrable Z μ)
(X : ℕ → Ω → ℝ) (hX : ∀ i, StronglyMeasurable (X i)) :
Martingale (fun n => μ[Z | (Filtration.natural X hX) n]) (Filtration.natural X hX) μ := by
sorry | literal | theorem q57_doob_martingale (μ : Measure Ω) [IsProbabilityMeasure μ]
(Z : Ω → ℝ) (hZ : Integrable Z μ)
(X : ℕ → Ω → ℝ) (hX : ∀ i, StronglyMeasurable (X i)) :
Martingale (fun n => μ[Z | (Filtration.natural X hX) n]) (Filtration.natural X hX) μ := by
exact martingale_condExp Z (Filtration.natural X hX) μ | 52 | Martingales & stopping | null |
60 | stochastic_processes_martingale_stopping_time_2 | Let (X_n)_{n ≥ 0} be a martingale, and let T be a stopping time.
Show that X^T is also a martingale. | theorem q60_stopped_martingale (μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
[SigmaFiniteFiltration μ ℱ] (X : ℕ → Ω → ℝ) (hX : Martingale X ℱ μ) (T : Ω → ℕ)
(hT : IsStoppingTime ℱ (natStop T)) :
Martingale (stoppedProcess X (natStop T)) ℱ μ := by sorry | literal | theorem q60_stopped_martingale (μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
[SigmaFiniteFiltration μ ℱ] (X : ℕ → Ω → ℝ) (hX : Martingale X ℱ μ) (T : Ω → ℕ)
(hT : IsStoppingTime ℱ (natStop T)) :
Martingale (stoppedProcess X (natStop T)) ℱ μ := by
rw [martingale_iff]
refine ⟨?_, hX.subma... | 93 | Martingales & stopping | null |
63 | stochastic_processes_product_form_unit_expectation | Let (S_n) be a random walk with i.i.d. steps X and semi-invariant generating function γ(r) = ln E[e^{rX}], and let Z_n = exp(r S_n − n γ(r)).
Show that E[Z_n] = 1 for all n. | theorem q63_product_form_unit_expectation (μ : Measure Ω) [IsProbabilityMeasure μ]
(X : ℕ → Ω → ℝ) (hindep : iIndepFun X μ) (hident : ∀ i, IdentDistrib (X i) (X 0) μ μ)
(r : ℝ) (hint : Integrable (fun ω => Real.exp (r * X 0 ω)) μ)
(γ : ℝ) (hγ : γ = cgf (X 0) μ r)
(S : ℕ → Ω → ℝ) (hS : ∀ n ω, S n ω = ∑ i... | abstract | theorem q63_product_form_unit_expectation (μ : Measure Ω) [IsProbabilityMeasure μ]
(X : ℕ → Ω → ℝ) (hindep : iIndepFun X μ) (hident : ∀ i, IdentDistrib (X i) (X 0) μ μ)
(r : ℝ) (hint : Integrable (fun ω => Real.exp (r * X 0 ω)) μ)
(γ : ℝ) (hγ : γ = cgf (X 0) μ r)
(S : ℕ → Ω → ℝ) (hS : ∀ n ω, S n ω = ∑ i... | 273 | Random walks & large deviations | null |
68 | stochastic_processes_slln_via_backward_martingale | Let ξ_1,ξ_2,… be i.i.d. with E|ξ_1| < ∞ and let S_n = Σ_{i=1}^n ξ_i.
Show, using the backward martingale convergence theorem, that S_n/n → E[ξ_1] almost surely. | theorem q68_slln_via_backward_martingale (μ : Measure Ω) [IsProbabilityMeasure μ]
(ξ : ℕ → Ω → ℝ) (hindep : iIndepFun ξ μ) (hident : ∀ i, IdentDistrib (ξ i) (ξ 0) μ μ)
(hint : Integrable (ξ 0) μ)
(S : ℕ → Ω → ℝ) (hS : ∀ n ω, S n ω = ∑ i ∈ Finset.range n, ξ i ω) :
∀ᵐ ω ∂μ, Tendsto (fun n => S n ω / (n : ... | literal | theorem q68_slln_via_backward_martingale (μ : Measure Ω) [IsProbabilityMeasure μ]
(ξ : ℕ → Ω → ℝ) (hindep : iIndepFun ξ μ) (hident : ∀ i, IdentDistrib (ξ i) (ξ 0) μ μ)
(hint : Integrable (ξ 0) μ)
(S : ℕ → Ω → ℝ) (hS : ∀ n ω, S n ω = ∑ i ∈ Finset.range n, ξ i ω) :
∀ᵐ ω ∂μ, Tendsto (fun n => S n ω / (n : ... | 165 | Martingales & stopping | null |
69 | stochastic_processes_ctmc_steady_state_process | Let (X(t)) be an irreducible continuous-time Markov chain whose embedded chain is positive-recurrent with stationary distribution (π_i), and whose transition rates ν_i satisfy Σ_i π_i/ν_i < ∞.
Show that the limiting process probabilities are p_j = (π_j/ν_j) / Σ_k (π_k/ν_k). | theorem q69_ctmc_steady_state_process
{S : Type*} [Countable S]
(P : S → S → ℝ) (hP0 : ∀ i j, 0 ≤ P i j) (hPstoch : ∀ i, ∑' j, P i j = 1)
(hPloop : ∀ i, P i i = 0)
(π : S → ℝ) (hπpos : ∀ i, 0 < π i) (hπsum : ∑' i, π i = 1)
(hπstat : ∀ j, ∑' i, π i * P i j = π j)
(ν : S → ℝ) (hν : ∀ i, 0 < ν i)
... | abstract | theorem q69_ctmc_steady_state_process
{S : Type*} [Countable S]
(P : S → S → ℝ) (hP0 : ∀ i j, 0 ≤ P i j) (hPstoch : ∀ i, ∑' j, P i j = 1)
(hPloop : ∀ i, P i i = 0)
(π : S → ℝ) (hπpos : ∀ i, 0 < π i) (hπsum : ∑' i, π i = 1)
(hπstat : ∀ j, ∑' i, π i * P i j = π j)
(ν : S → ℝ) (hν : ∀ i, 0 < ν i)
... | 639 | Continuous-time Markov & queues | null |
71 | stochastic_processes_stopping_times | Suppose τ and τ' are stopping times.
Show that τ + τ', τ ∧ τ', and τ ∨ τ' are also stopping times. | theorem q71_stopping_times {Ω : Type*} {m : MeasurableSpace Ω}
(ℱ : Filtration ℕ m) (τ σ : Ω → WithTop ℕ)
(hτ : IsStoppingTime ℱ τ) (hσ : IsStoppingTime ℱ σ) :
IsStoppingTime ℱ (fun ω => τ ω + σ ω) ∧ IsStoppingTime ℱ (τ ⊓ σ) ∧
IsStoppingTime ℱ (τ ⊔ σ) := by sorry | literal | theorem q71_stopping_times {Ω : Type*} {m : MeasurableSpace Ω}
(ℱ : Filtration ℕ m) (τ σ : Ω → WithTop ℕ)
(hτ : IsStoppingTime ℱ τ) (hσ : IsStoppingTime ℱ σ) :
IsStoppingTime ℱ (fun ω => τ ω + σ ω) ∧ IsStoppingTime ℱ (τ ⊓ σ) ∧
IsStoppingTime ℱ (τ ⊔ σ) :=
⟨hτ.add hσ, hτ.min hσ, hτ.max hσ⟩ | 76 | Martingales & stopping | null |
72 | stochastic_processes_submartingale_inequality_1 | Let X = (X_n)_{n ≥ 0} be a non-negative submartingale.
Let X_n^* = max_{0 ≤ k ≤ n} X_k.
Show that λℙ[X_n^* ≥ λ] ≤ 𝔼[X_n * 1_{X_n^* ≥ λ}] ≤ 𝔼[X_n]. | theorem q72_doob_maximal (μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
(X : ℕ → Ω → ℝ) (hX : Submartingale X ℱ μ) (hnn : ∀ n ω, 0 ≤ X n ω)
(lam : ℝ) (hlam : 0 < lam) (n : ℕ) :
lam * (μ {ω | lam ≤ runningMax X n ω}).toReal ≤ ∫ ω in {ω | lam ≤ runningMax X n ω}, X n ω ∂μ ∧
∫ ω in {ω | l... | literal | theorem q72_doob_maximal (μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
(X : ℕ → Ω → ℝ) (hX : Submartingale X ℱ μ) (hnn : ∀ n ω, 0 ≤ X n ω)
(lam : ℝ) (hlam : 0 < lam) (n : ℕ) :
lam * (μ {ω | lam ≤ runningMax X n ω}).toReal ≤ ∫ ω in {ω | lam ≤ runningMax X n ω}, X n ω ∂μ ∧
∫ ω in {ω | l... | 393 | Martingales & stopping | null |
75 | stochastic_processes_strong_stationary_time_1 | Let (X_n)_{n ≥ 0} be an irreducible Markov chain with stationary measure π.
Let the separation distance be S_x (n) = max_y (1 − P^n (x, y) / π(y)).
Show that ||P^n (x, ·) - π||_{TV} ≤ S_x (n). | theorem q75_tv_le_sep {Ω : Type*} [Fintype Ω] [Nonempty Ω] [DecidableEq Ω]
(P : Matrix Ω Ω ℝ) (hP : IsStochastic P) (π : Ω → ℝ) (hπ : IsStationary P π)
(hπpos : ∀ x, 0 < π x) (x : Ω) (n : ℕ) :
tvDist (fun y => (P ^ n) x y) π ≤ ⨆ y, (1 - (P ^ n) x y / π y) := by sorry | literal | theorem q75_tv_le_sep {Ω : Type*} [Fintype Ω] [Nonempty Ω] [DecidableEq Ω]
(P : Matrix Ω Ω ℝ) (hP : IsStochastic P) (π : Ω → ℝ) (hπ : IsStationary P π)
(hπpos : ∀ x, 0 < π x) (x : Ω) (n : ℕ) :
tvDist (fun y => (P ^ n) x y) π ≤ ⨆ y, (1 - (P ^ n) x y / π y) := by
-- power of stochastic matrix has nonneg ent... | 178 | Markov chains (finite & countable) | null |
78 | stochastic_processes_random_walk_square_martingale | Let X_1,X_2,… be i.i.d. with mean 0 and variance σ^2, and let S_n = Σ_{i=1}^n X_i.
Show that S_n^2 − nσ^2 is a martingale. | theorem q78_square_random_walk_martingale (μ : Measure Ω) [IsProbabilityMeasure μ]
(ℱ : Filtration ℕ m0) (X : ℕ → Ω → ℝ)
(hadap : Adapted ℱ (fun n ω => ∑ i ∈ Finset.range n, X i ω))
(hint : ∀ n, Integrable (fun ω => (X n ω) ^ 2) μ) (σ2 : ℝ)
(hmean : ∀ n, μ[X n | ℱ n] =ᵐ[μ] fun _ => (0 : ℝ))
(hvar : ... | abstract | theorem q78_square_random_walk_martingale (μ : Measure Ω) [IsProbabilityMeasure μ]
(ℱ : Filtration ℕ m0) (X : ℕ → Ω → ℝ)
(hadap : Adapted ℱ (fun n ω => ∑ i ∈ Finset.range n, X i ω))
(hint : ∀ n, Integrable (fun ω => (X n ω) ^ 2) μ) (σ2 : ℝ)
(hmean : ∀ n, μ[X n | ℱ n] =ᵐ[μ] fun _ => (0 : ℝ))
(hvar : ... | 491 | Martingales & stopping | null |
81 | stochastic_processes_markov_modulated_product_martingale | Let a Markov-modulated random walk have matrix [A(r)] with largest eigenvalue ρ(r) and corresponding positive right eigenvector ν(r), and define Z_n = exp(r S_n) ν_{Y_n}(r) / ρ(r)^n.
Show that (Z_n) is a martingale. | theorem q81_markov_modulated_product_martingale {σ : Type*} [Fintype σ]
(μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
(Y : ℕ → Ω → σ) (X S : ℕ → Ω → ℝ) (r ρ : ℝ) (hρ : 0 < ρ)
(ν : σ → ℝ) (hν : ∀ s, 0 < ν s)
(hS : ∀ n ω, S n ω = ∑ i ∈ Finset.range n, X i ω) (hSadap : Adapted ℱ S)
(Z ... | abstract | theorem q81_markov_modulated_product_martingale {σ : Type*} [Fintype σ]
(μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
(Y : ℕ → Ω → σ) (X S : ℕ → Ω → ℝ) (r ρ : ℝ) (hρ : 0 < ρ)
(ν : σ → ℝ) (hν : ∀ s, 0 < ν s)
(hS : ∀ n ω, S n ω = ∑ i ∈ Finset.range n, X i ω) (hSadap : Adapted ℱ S)
(Z ... | 300 | Martingales & stopping | null |
83 | stochastic_processes_class_transient_recurrent | Let (X_n) be a finite-state Markov chain.
Show that within any communicating class, either all states are transient or all states are recurrent. | theorem q83_class_transient_recurrent {Ω : Type*} [Fintype Ω] [DecidableEq Ω]
(P : Matrix Ω Ω ℝ) (hP : IsStochastic P) :
∀ x y : Ω, ((∃ m : ℕ, 0 < (P ^ m) x y) ∧ (∃ k : ℕ, 0 < (P ^ k) y x)) →
(Summable (fun n => (P ^ n) x x) ↔ Summable (fun n => (P ^ n) y y)) := by
sorry | abstract | theorem q83_class_transient_recurrent {Ω : Type*} [Fintype Ω] [DecidableEq Ω]
(P : Matrix Ω Ω ℝ) (hP : IsStochastic P) :
∀ x y : Ω, ((∃ m : ℕ, 0 < (P ^ m) x y) ∧ (∃ k : ℕ, 0 < (P ^ k) y x)) →
(Summable (fun n => (P ^ n) x x) ↔ Summable (fun n => (P ^ n) y y)) := by
obtain ⟨hnn, hstoch⟩ := hP
-- entrie... | 267 | Markov chains (finite & countable) | null |
85 | stochastic_processes_renewal_slln | Let S_n = X_1 + … + X_n where the X_i are i.i.d. with E[|X|] < ∞ and mean X̄.
Show that Pr[lim_{n→∞} S_n/n = X̄] = 1. | theorem q85_renewal_slln (μ : Measure Ω) [IsProbabilityMeasure μ]
(X : ℕ → Ω → ℝ) (hint : Integrable (X 0) μ)
(hindep : Pairwise (fun i j => IndepFun (X i) (X j) μ))
(hident : ∀ i, IdentDistrib (X i) (X 0) μ μ) :
∀ᵐ ω ∂μ, Tendsto (fun n : ℕ => (n : ℝ)⁻¹ • (∑ i ∈ Finset.range n, X i ω))
atTop (𝓝 (... | literal | theorem q85_renewal_slln (μ : Measure Ω) [IsProbabilityMeasure μ]
(X : ℕ → Ω → ℝ) (hint : Integrable (X 0) μ)
(hindep : Pairwise (fun i j => IndepFun (X i) (X j) μ))
(hident : ∀ i, IdentDistrib (X i) (X 0) μ μ) :
∀ᵐ ω ∂μ, Tendsto (fun n : ℕ => (n : ℝ)⁻¹ • (∑ i ∈ Finset.range n, X i ω))
atTop (𝓝 (... | 48 | Weak convergence & functional limits | null |
86 | stochastic_processes_birth_death_geometric | Consider an irreducible birth-death chain on {0,1,2,…} with constant ratio ρ = p/q < 1 (up-probability p, down-probability q at every interior state).
Show that the stationary distribution is π_i = (1 − ρ) ρ^i for i ≥ 0. | theorem q86_birth_death_geometric
(P : ℕ → ℕ → ℝ) (hP0 : ∀ i j, 0 ≤ P i j) (hP1 : ∀ i, ∑' j, P i j = 1)
(ρ : ℝ) (hρ0 : 0 < ρ) (hρ1 : ρ < 1)
(hratio : ∀ i, P i (i + 1) = ρ * P (i + 1) i)
(π : ℕ → ℝ) (hπ : ∀ i, π i = (1 - ρ) * ρ ^ i) :
(∀ i, 0 ≤ π i) ∧ (∑' i, π i = 1) ∧
(∀ i, π i * P i (i + 1) =... | abstract | theorem q86_birth_death_geometric
(P : ℕ → ℕ → ℝ) (hP0 : ∀ i j, 0 ≤ P i j) (hP1 : ∀ i, ∑' j, P i j = 1)
(ρ : ℝ) (hρ0 : 0 < ρ) (hρ1 : ρ < 1)
(hratio : ∀ i, P i (i + 1) = ρ * P (i + 1) i)
(π : ℕ → ℝ) (hπ : ∀ i, π i = (1 - ρ) * ρ ^ i) :
(∀ i, 0 ≤ π i) ∧ (∑' i, π i = 1) ∧
(∀ i, π i * P i (i + 1) =... | 94 | Markov chains (finite & countable) | null |
87 | stochastic_processes_martingale_simple_random_walk | Let X = (X_n)_{n ≥ 0} be the simple random walk on ℤ.
Show that (Y_n := X_n^3 − 3nX_n)_{n ≥ 0} is a martingale. | theorem q87_srw_cubic_martingale (μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
(X : ℕ → Ω → ℝ) (hadap : Adapted ℱ X) (hint : ∀ n, Integrable (fun ω => (X n ω) ^ 3) μ)
(hstep : ∀ n, ∀ᵐ ω ∂μ, X (n + 1) ω = X n ω + 1 ∨ X (n + 1) ω = X n ω - 1)
(hsym : IsConstDrift μ ℱ X 0) :
Martingale (fu... | literal | theorem q87_srw_cubic_martingale (μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
(X : ℕ → Ω → ℝ) (hadap : Adapted ℱ X) (hint : ∀ n, Integrable (fun ω => (X n ω) ^ 3) μ)
(hstep : ∀ n, ∀ᵐ ω ∂μ, X (n + 1) ω = X n ω + 1 ∨ X (n + 1) ω = X n ω - 1)
(hsym : IsConstDrift μ ℱ X 0) :
Martingale (fu... | 121 | Martingales & stopping | null |
88 | stochastic_processes_stopped_submartingale_bounds | Let (Z_n) be a submartingale and let J be a stopping trial with stopped process (Z_n*).
Show that E[Z_1] ≤ E[Z_n*] ≤ E[Z_n] for all n. | theorem q88_stopped_submartingale_bounds (μ : Measure Ω) [IsProbabilityMeasure μ]
(ℱ : Filtration ℕ m0) [SigmaFiniteFiltration μ ℱ]
(Z : ℕ → Ω → ℝ) (hZ : Submartingale Z ℱ μ)
(J : Ω → ℕ) (hJ : IsStoppingTime ℱ (natStop J)) (n : ℕ) :
∫ ω, Z 0 ω ∂μ ≤ ∫ ω, stoppedProcess Z (natStop J) n ω ∂μ ∧
∫ ω, s... | literal | theorem q88_stopped_submartingale_bounds (μ : Measure Ω) [IsProbabilityMeasure μ]
(ℱ : Filtration ℕ m0) [SigmaFiniteFiltration μ ℱ]
(Z : ℕ → Ω → ℝ) (hZ : Submartingale Z ℱ μ)
(J : Ω → ℕ) (hJ : IsStoppingTime ℱ (natStop J)) (n : ℕ) :
∫ ω, Z 0 ω ∂μ ≤ ∫ ω, stoppedProcess Z (natStop J) n ω ∂μ ∧
∫ ω, s... | 300 | Martingales & stopping | null |
96 | stochastic_processes_ctmc_reversibility_embedded | Let (X(t)) be an irreducible continuous-time Markov chain with embedded jump chain (X_n).
Show that the process (X(t)) is reversible if and only if the embedded chain (X_n) is reversible. | theorem q96_ctmc_reversibility_embedded {S : Type*} [Countable S]
(ν : S → ℝ) (hν : ∀ i, 0 < ν i)
(P : S → S → ℝ) (hP0 : ∀ i j, 0 ≤ P i j) (hPloop : ∀ i, P i i = 0)
(hPstoch : ∀ i, ∑' j, P i j = 1)
(q : S → S → ℝ) (hq : ∀ i j, q i j = ν i * P i j)
(p : S → ℝ) (hp0 : ∀ i, 0 < p i) (hpsum : ∑' i, p i ... | abstract | theorem q96_ctmc_reversibility_embedded {S : Type*} [Countable S]
(ν : S → ℝ) (hν : ∀ i, 0 < ν i)
(P : S → S → ℝ) (hP0 : ∀ i j, 0 ≤ P i j) (hPloop : ∀ i, P i i = 0)
(hPstoch : ∀ i, ∑' j, P i j = 1)
(q : S → S → ℝ) (hq : ∀ i j, q i j = ν i * P i j)
(p : S → ℝ) (hp0 : ∀ i, 0 < p i) (hpsum : ∑' i, p i ... | 85 | Continuous-time Markov & queues | null |
99 | stochastic_processes_simple_random_walk | Let X = (X_n)_{n ≥ 0} be the simple random walk on ℤ.
Let τ be the first time that the walker hits either 0 or N.
Show that, for 0 ≤ k ≤ N, we have 𝔼_k [τ | X_τ = N] = (N^2 - k^2) / 3. | theorem q99_srw_conditional_time (N : ℕ) (v : ℕ → ℝ) (hbN : v N = 0)
(hrec : ∀ k, 0 < k → k < N →
v k = 1 + (((k : ℝ) + 1) / (2 * k)) * v (k + 1) + (((k : ℝ) - 1) / (2 * k)) * v (k - 1))
(k : ℕ) (hk0 : 0 < k) (hk : k ≤ N) :
v k = ((N : ℝ) ^ 2 - (k : ℝ) ^ 2) / 3 := by sorry | abstract | theorem q99_srw_conditional_time (N : ℕ) (v : ℕ → ℝ) (hbN : v N = 0)
(hrec : ∀ k, 0 < k → k < N →
v k = 1 + (((k : ℝ) + 1) / (2 * k)) * v (k + 1) + (((k : ℝ) - 1) / (2 * k)) * v (k - 1))
(k : ℕ) (hk0 : 0 < k) (hk : k ≤ N) :
v k = ((N : ℝ) ^ 2 - (k : ℝ) ^ 2) / 3 := by
-- Invariant: (j+1)*v(j+1) - j*v... | 675 | Random walks & large deviations | null |
101 | stochastic_processes_optional_stopping_bounded_process_martingale | Let (X_n) be a martingale that is uniformly bounded, i.e. |X_n| ≤ M almost surely for all n, and let τ be a stopping time.
Show that E[X_τ] = E[X_0]. | theorem q101_optional_stopping_bounded_process_martingale (μ : Measure Ω) [IsProbabilityMeasure μ]
(ℱ : Filtration ℕ m0) [SigmaFiniteFiltration μ ℱ] (X : ℕ → Ω → ℝ)
(hX : Martingale X ℱ μ) (M : ℝ) (hbdd : ∀ n ω, |X n ω| ≤ M)
(T : Ω → ℕ) (hT : IsStoppingTime ℱ (natStop T)) :
∫ ω, stoppedValue X (natStop ... | literal | theorem q101_optional_stopping_bounded_process_martingale (μ : Measure Ω) [IsProbabilityMeasure μ]
(ℱ : Filtration ℕ m0) [SigmaFiniteFiltration μ ℱ] (X : ℕ → Ω → ℝ)
(hX : Martingale X ℱ μ) (M : ℝ) (hbdd : ∀ n ω, |X n ω| ≤ M)
(T : Ω → ℕ) (hT : IsStoppingTime ℱ (natStop T)) :
∫ ω, stoppedValue X (natStop ... | 1,110 | Martingales & stopping | null |
102 | stochastic_processes_chapman_kolmogorov_finite | Let (X_n) be a finite-state Markov chain with transition matrix [P].
Show that the n-step transition probabilities satisfy P_{ij}^{m+n} = Σ_k P_{ik}^m P_{kj}^n. | theorem q102_chapman_kolmogorov {Ω : Type*} [Fintype Ω] [DecidableEq Ω]
(P : Matrix Ω Ω ℝ) (hP : IsStochastic P) (m n : ℕ) (i j : Ω) :
(P ^ (m + n)) i j = ∑ k, (P ^ m) i k * (P ^ n) k j := by
sorry | literal | theorem q102_chapman_kolmogorov {Ω : Type*} [Fintype Ω] [DecidableEq Ω]
(P : Matrix Ω Ω ℝ) (hP : IsStochastic P) (m n : ℕ) (i j : Ω) :
(P ^ (m + n)) i j = ∑ k, (P ^ m) i k * (P ^ n) k j := by
rw [pow_add, Matrix.mul_apply] | 47 | Markov chains (finite & countable) | null |
103 | stochastic_processes_random_walk_centered_martingale | Let X_1,X_2,… be i.i.d. with mean μ and E|X_1| < ∞, and let S_n = Σ_{i=1}^n X_i.
Show that S_n − μn is a martingale with respect to the filtration generated by (X_i). | theorem q103_centered_random_walk_martingale (μ : Measure Ω) [IsProbabilityMeasure μ]
(ℱ : Filtration ℕ m0) (X : ℕ → Ω → ℝ)
(hadap : Adapted ℱ (fun n ω => ∑ i ∈ Finset.range n, X i ω))
(hint : ∀ n, Integrable (X n) μ) (m : ℝ)
(hincr : ∀ n, μ[X n | ℱ n] =ᵐ[μ] fun _ => m) :
Martingale (fun n ω => (∑ i... | abstract | theorem q103_centered_random_walk_martingale (μ : Measure Ω) [IsProbabilityMeasure μ]
(ℱ : Filtration ℕ m0) (X : ℕ → Ω → ℝ)
(hadap : Adapted ℱ (fun n ω => ∑ i ∈ Finset.range n, X i ω))
(hint : ∀ n, Integrable (X n) μ) (m : ℝ)
(hincr : ∀ n, μ[X n | ℱ n] =ᵐ[μ] fun _ => m) :
Martingale (fun n ω => (∑ i... | 173 | Martingales & stopping | null |
106 | stochastic_processes_birth_death_process_reversible | Consider a birth-death continuous-time Markov chain that possesses a steady-state distribution.
Show that the process is reversible. | theorem q106_birth_death_reversible
(lam : ℕ → ℝ) (hlam : ∀ i, 0 < lam i)
(mu : ℕ → ℝ) (hmu : ∀ i, 0 < mu (i + 1))
(q : ℕ → ℕ → ℝ)
(hqbirth : ∀ i, q i (i + 1) = lam i)
(hqdeath : ∀ i, q (i + 1) i = mu (i + 1))
(hqother : ∀ i j, j ≠ i + 1 → i ≠ j + 1 → q i j = 0)
(p : ℕ → ℝ) (hp0 : ∀ i, 0 ≤ p... | abstract | theorem q106_birth_death_reversible
(lam : ℕ → ℝ) (hlam : ∀ i, 0 < lam i)
(mu : ℕ → ℝ) (hmu : ∀ i, 0 < mu (i + 1))
(q : ℕ → ℕ → ℝ)
(hqbirth : ∀ i, q i (i + 1) = lam i)
(hqdeath : ∀ i, q (i + 1) i = mu (i + 1))
(hqother : ∀ i j, j ≠ i + 1 → i ≠ j + 1 → q i j = 0)
(p : ℕ → ℝ) (hp0 : ∀ i, 0 ≤ p... | 88 | Continuous-time Markov & queues | null |
107 | stochastic_processes_product_unit_mean_martingale | Let (X_i) be i.i.d. with E[X_i] = 1, and let Z_n = X_1 X_2 … X_n.
Show that (Z_n) is a martingale. | theorem q107_iid_product_martingale (μ : Measure Ω) [IsProbabilityMeasure μ]
(X : ℕ → Ω → ℝ) (hmeas : ∀ i, StronglyMeasurable (X i))
(hindep : iIndepFun X μ) (hident : ∀ i, IdentDistrib (X i) (X 0) μ μ)
(hint : ∀ n, Integrable (fun ω => ∏ i ∈ Finset.range (n + 1), X i ω) μ)
(hmean : ∫ ω, X 0 ω ∂μ = 1) :... | literal | theorem q107_iid_product_martingale (μ : Measure Ω) [IsProbabilityMeasure μ]
(X : ℕ → Ω → ℝ) (hmeas : ∀ i, StronglyMeasurable (X i))
(hindep : iIndepFun X μ) (hident : ∀ i, IdentDistrib (X i) (X 0) μ μ)
(hint : ∀ n, Integrable (fun ω => ∏ i ∈ Finset.range (n + 1), X i ω) μ)
(hmean : ∫ ω, X 0 ω ∂μ = 1) :... | 265 | Martingales & stopping | null |
110 | stochastic_processes_brownian_scaling_1 | Standard Brownian motion is invariant under Brownian scaling: for c > 0, the rescaled process W(t) = c B(t / c²) has the same increment law as B, namely W(t) − W(s) ~ Normal(0, t − s) for 0 ≤ s ≤ t. | theorem q110_brownian_scaling (μ : Measure Ω) [IsProbabilityMeasure μ]
(B : ℝ → Ω → ℝ) (c : ℝ) (hc : 0 < c)
(hincr : ∀ s t : ℝ, 0 ≤ s → s ≤ t →
HasLaw (fun ω => B t ω - B s ω) (gaussianReal 0 (t - s).toNNReal) μ) :
∀ s t : ℝ, 0 ≤ s → s ≤ t →
HasLaw (fun ω => c * B (t / c ^ 2) ω - c * B (s / c ^ ... | abstract | theorem q110_brownian_scaling (μ : Measure Ω) [IsProbabilityMeasure μ]
(B : ℝ → Ω → ℝ) (c : ℝ) (hc : 0 < c)
(hincr : ∀ s t : ℝ, 0 ≤ s → s ≤ t →
HasLaw (fun ω => B t ω - B s ω) (gaussianReal 0 (t - s).toNNReal) μ) :
∀ s t : ℝ, 0 ≤ s → s ≤ t →
HasLaw (fun ω => c * B (t / c ^ 2) ω - c * B (s / c ^ ... | 303 | Brownian motion & stochastic calculus | null |
113 | stochastic_processes_gamblers_ruin_1 | Consider a gambler betting on the outcome of a sequence of independent fair coin tosses.
If head, he gains one dollar. If tail, he loses one dollar.
If he reaches a fortune of N dollars, he stops. If his purse is ever empty, he stops.
Show that the probability that the gambler's fortune is equ... | theorem q113_gamblers_ruin_probability
(N : ℕ) (hN : 0 < N) (h : ℕ → ℝ)
(hb0 : h 0 = 0) (hbN : h N = 1)
(hharm : ∀ k, 0 < k → k < N → h k = (h (k - 1) + h (k + 1)) / 2)
(k : ℕ) (hk : k ≤ N) :
h k = (k : ℝ) / (N : ℝ) := by sorry | literal | theorem q113_gamblers_ruin_probability
(N : ℕ) (hN : 0 < N) (h : ℕ → ℝ)
(hb0 : h 0 = 0) (hbN : h N = 1)
(hharm : ∀ k, 0 < k → k < N → h k = (h (k - 1) + h (k + 1)) / 2)
(k : ℕ) (hk : k ≤ N) :
h k = (k : ℝ) / (N : ℝ) := by
-- Express everything in terms of the slope h 1.
have key : ∀ j, j ≤ N → h... | 80 | Random walks & large deviations | null |
119 | stochastic_processes_log_likelihood_random_walk | Consider a binary hypothesis test with i.i.d. observations Y_1, Y_2, … and let Z_n be the log-likelihood ratio after n observations.
Show that under each hypothesis (Z_n) is a random walk whose increments are the per-observation log-likelihood ratios. | theorem q119_log_likelihood_random_walk (μ : Measure Ω) [IsProbabilityMeasure μ]
(Y : ℕ → Ω → ℝ) (hindep : iIndepFun Y μ) (hident : ∀ i, IdentDistrib (Y i) (Y 0) μ μ)
(llr : ℝ → ℝ) (hllr : Measurable llr)
(W : ℕ → Ω → ℝ) (hW : ∀ i ω, W i ω = llr (Y i ω))
(Z : ℕ → Ω → ℝ) (hZ : ∀ n ω, Z n ω = ∑ i ∈ Finset... | abstract | theorem q119_log_likelihood_random_walk (μ : Measure Ω) [IsProbabilityMeasure μ]
(Y : ℕ → Ω → ℝ) (hindep : iIndepFun Y μ) (hident : ∀ i, IdentDistrib (Y i) (Y 0) μ μ)
(llr : ℝ → ℝ) (hllr : Measurable llr)
(W : ℕ → Ω → ℝ) (hW : ∀ i ω, W i ω = llr (Y i ω))
(Z : ℕ → Ω → ℝ) (hZ : ∀ n ω, Z n ω = ∑ i ∈ Finset... | 90 | Random walks & large deviations | null |
121 | stochastic_processes_martingale_stopping_time_3 | Let (X_n)_{n ≥ 0} be a martingale, and let T be a stopping time which is finite a.s.
Let there be an integrable random variable Y such that |Xn| ≤ Y for all n.
Show that 𝔼[X_T] = 𝔼[X_0]. | theorem q121_optional_stopping_dominated (μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
[SigmaFiniteFiltration μ ℱ] (X : ℕ → Ω → ℝ) (hX : Martingale X ℱ μ) (T : Ω → ℕ)
(hT : IsStoppingTime ℱ (natStop T)) (Y : Ω → ℝ) (hY : Integrable Y μ)
(hdom : ∀ n, ∀ᵐ ω ∂μ, |X n ω| ≤ Y ω) :
∫ ω, stoppe... | literal | theorem q121_optional_stopping_dominated (μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
[SigmaFiniteFiltration μ ℱ] (X : ℕ → Ω → ℝ) (hX : Martingale X ℱ μ) (T : Ω → ℕ)
(hT : IsStoppingTime ℱ (natStop T)) (Y : Ω → ℝ) (hY : Integrable Y μ)
(hdom : ∀ n, ∀ᵐ ω ∂μ, |X n ω| ≤ Y ω) :
∫ ω, stoppe... | 304 | Martingales & stopping | null |
123 | stochastic_processes_stopped_supermartingale | Let (X_n) be a supermartingale and let τ be a stopping time.
Show that the stopped process X_{n∧τ} is a supermartingale. | theorem q123_stopped_supermartingale (μ : Measure Ω) [IsProbabilityMeasure μ]
(ℱ : Filtration ℕ m0) [SigmaFiniteFiltration μ ℱ] (X : ℕ → Ω → ℝ)
(hX : Supermartingale X ℱ μ) (T : Ω → ℕ) (hT : IsStoppingTime ℱ (natStop T)) :
Supermartingale (stoppedProcess X (natStop T)) ℱ μ := by
sorry | literal | theorem q123_stopped_supermartingale (μ : Measure Ω) [IsProbabilityMeasure μ]
(ℱ : Filtration ℕ m0) [SigmaFiniteFiltration μ ℱ] (X : ℕ → Ω → ℝ)
(hX : Supermartingale X ℱ μ) (T : Ω → ℕ) (hT : IsStoppingTime ℱ (natStop T)) :
Supermartingale (stoppedProcess X (natStop T)) ℱ μ := by
have hsub : Submartingale ... | 120 | Martingales & stopping | null |
124 | stochastic_processes_markov_chain_2 | A company issues N different types of coupons. Each coupon is equally likely to be each of the N types.
A collector desires a complete set. Let τ be the first time that the collector obtains all N types.
Show that for any c > 0, P[τ > N log N + cN] ≤ e^{-c}. | theorem q124_coupon_collector_tail {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω)
[IsProbabilityMeasure μ] (N : ℕ) (hN : 0 < N) (c : ℝ) (hc : 0 < c)
(X : ℕ → Ω → ℕ)
(hXrange : ∀ k ω, X k ω < N)
(hXunif : ∀ (k : ℕ) (j : ℕ), j < N → (μ {ω | X k ω = j}).toReal = 1 / (N : ℝ))
(hXindep : iIndepFun X μ)
... | abstract | theorem q124_coupon_collector_tail {Ω : Type*} [MeasurableSpace Ω] (μ : Measure Ω)
[IsProbabilityMeasure μ] (N : ℕ) (hN : 0 < N) (c : ℝ) (hc : 0 < c)
(X : ℕ → Ω → ℕ)
(hXrange : ∀ k ω, X k ω < N)
(hXunif : ∀ (k : ℕ) (j : ℕ), j < N → (μ {ω | X k ω = j}).toReal = 1 / (N : ℝ))
(hXindep : iIndepFun X μ)
... | 875 | Markov chains (finite & countable) | null |
126 | stochastic_processes_target_time | Suppose that (X_n)_{n ≥ 0} is an irreducible Markov chain with transition
matrix P and stationary measure π.
Let τ_x be the hitting time: τ_x = min{n ≥ 0 : X_n = x}.
Show that the quantity sum_x (𝔼_a [τ_x]π(x)) does not depend on a. | theorem q126_target_time {Ω : Type*} [Fintype Ω] [DecidableEq Ω]
(P : Matrix Ω Ω ℝ) (hP : IsStochastic P) (hirr : IsIrreducible P)
(g : Ω → Ω → ℝ) (hg : IsHittingSolution P g)
(π : Ω → ℝ) (hπ : IsStationary P π) :
∀ a b : Ω, ∑ x, g a x * π x = ∑ x, g b x * π x := by sorry | abstract | theorem q126_target_time {Ω : Type*} [Fintype Ω] [DecidableEq Ω]
(P : Matrix Ω Ω ℝ) (hP : IsStochastic P) (hirr : IsIrreducible P)
(g : Ω → Ω → ℝ) (hg : IsHittingSolution P g)
(π : Ω → ℝ) (hπ : IsStationary P π) :
∀ a b : Ω, ∑ x, g a x * π x = ∑ x, g b x * π x := by
obtain ⟨hPnn, hProw⟩ := hP
obtain... | 122 | Markov chains (finite & countable) | null |
127 | stochastic_processes_scaled_branching_convergence | Consider a branching process (X_n) with i.i.d. offspring counts of mean Ȳ, and let Z_n = X_n/Ȳ^n be the scaled process.
Show that Z_n is a nonnegative martingale and therefore converges with probability 1 to a finite limiting random variable. | theorem q127_scaled_branching_convergence (μ : Measure Ω) [IsProbabilityMeasure μ]
(ℱ : Filtration ℕ m0)
(X : ℕ → Ω → ℝ) (hadap : Adapted ℱ X) (hint : ∀ n, Integrable (X n) μ)
(hnn : ∀ n ω, 0 ≤ X n ω)
(Ybar : ℝ) (hY : 0 < Ybar)
(hbranch : ∀ n, μ[X (n + 1) | ℱ n] =ᵐ[μ] fun ω => Ybar * X n ω) :
Ma... | abstract | theorem q127_scaled_branching_convergence (μ : Measure Ω) [IsProbabilityMeasure μ]
(ℱ : Filtration ℕ m0)
(X : ℕ → Ω → ℝ) (hadap : Adapted ℱ X) (hint : ∀ n, Integrable (X n) μ)
(hnn : ∀ n ω, 0 ≤ X n ω)
(Ybar : ℝ) (hY : 0 < Ybar)
(hbranch : ∀ n, μ[X (n + 1) | ℱ n] =ᵐ[μ] fun ω => Ybar * X n ω) :
Ma... | 85 | Martingales & stopping | null |
128 | stochastic_processes_drifted_brownian_martingale | Let B_μ(t) = μt + σB(t) be a Brownian motion with drift.
Show that B_μ(t) − μt is a martingale, and that (B_μ(t) − μt)^2 − σ^2 t is a martingale. | theorem q128_drifted_brownian_martingale (μ : Measure Ω) [IsProbabilityMeasure μ]
(ℱ : Filtration ℝ m0) (B : ℝ → Ω → ℝ) (c σ : ℝ)
(hadap : Adapted ℱ B)
(hint : ∀ t, Integrable (B t) μ)
(hint2 : ∀ t, Integrable (fun ω => (B t ω) ^ 2) μ)
(hB0 : ∀ᵐ ω ∂μ, B 0 ω = 0)
(hincr : ∀ s t : ℝ, 0 ≤ s → s ≤ t... | abstract | theorem q128_drifted_brownian_martingale (μ : Measure Ω) [IsProbabilityMeasure μ]
(ℱ : Filtration ℝ m0) (B : ℝ → Ω → ℝ) (c σ : ℝ)
(hadap : Adapted ℱ B)
(hint : ∀ t, Integrable (B t) μ)
(hint2 : ∀ t, Integrable (fun ω => (B t ω) ^ 2) μ)
(hB0 : ∀ᵐ ω ∂μ, B 0 ω = 0)
(hincr : ∀ s t : ℝ, 0 ≤ s → s ≤ t... | 846 | Brownian motion & stochastic calculus | null |
129 | stochastic_processes_random_walk_recurrent_1 | Show that simple random walk on ℤ^2 is recurrent. | theorem q129_z2_recurrent :
¬ Summable (fun n : ℕ => ((Nat.choose (2 * n) n : ℝ) / (4 : ℝ) ^ n) ^ 2) := by sorry | abstract | theorem q129_z2_recurrent :
¬ Summable (fun n : ℕ => ((Nat.choose (2 * n) n : ℝ) / (4 : ℝ) ^ n) ^ 2) := by
intro hsum
set a : ℕ → ℝ := fun n => (Nat.choose (2 * n) n : ℝ) / (4 : ℝ) ^ n with ha
-- a n ≥ 0
have hapos : ∀ n, 0 ≤ a n := by
intro n; rw [ha]; positivity
-- recurrence: (n+1) * a (n+1) = (2n+... | 83 | Random walks & large deviations | null |
131 | stochastic_processes_markov_modulated_threshold_bound | Let a Markov-modulated random walk have negative drift and let r* > 0 satisfy ρ(r*) = 1, where ρ(r) is the largest eigenvalue of [A(r)], with positive right eigenvector ν(r*).
Show that the probability the walk ever crosses a threshold α > 0 is bounded by a constant times exp(−r* α). | theorem q131_markov_modulated_threshold_bound {σ : Type*} [Fintype σ]
(μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
(Y : ℕ → Ω → σ) (S : ℕ → Ω → ℝ) (rstar : ℝ) (hr : 0 < rstar)
(ν : σ → ℝ) (νmin : ℝ) (hνmin : 0 < νmin) (hν : ∀ s, νmin ≤ ν s)
(Z : ℕ → Ω → ℝ) (hZ : ∀ n ω, Z n ω = Real.exp... | abstract | theorem q131_markov_modulated_threshold_bound {σ : Type*} [Fintype σ]
(μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
(Y : ℕ → Ω → σ) (S : ℕ → Ω → ℝ) (rstar : ℝ) (hr : 0 < rstar)
(ν : σ → ℝ) (νmin : ℝ) (hνmin : 0 < νmin) (hν : ∀ s, νmin ≤ ν s)
(Z : ℕ → Ω → ℝ) (hZ : ∀ n ω, Z n ω = Real.exp... | 207 | Random walks & large deviations | null |
132 | stochastic_processes_mm1_expected_queue_delay | Consider an M/M/1 queue in steady state with arrival rate λ, service rate μ, and ρ = λ/μ < 1.
Show that the expected waiting time in queue (excluding service) is ρ/(μ − λ). | theorem q132_mm1_expected_queue_delay
(lam mu : ℝ) (hlam : 0 < lam) (hmu : 0 < mu) (hstab : lam < mu)
(ρ : ℝ) (hρ : ρ = lam / mu) (hρ0 : 0 < ρ) (hρ1 : ρ < 1)
(p : ℕ → ℝ) (hp : ∀ i, p i = (1 - ρ) * ρ ^ i)
(Wq Lq : ℝ) (hLq : Lq = ∑' k : ℕ, (k : ℝ) * p (k + 1))
(hLittle : Lq = lam * Wq) :
Wq = ρ / ... | abstract | theorem q132_mm1_expected_queue_delay
(lam mu : ℝ) (hlam : 0 < lam) (hmu : 0 < mu) (hstab : lam < mu)
(ρ : ℝ) (hρ : ρ = lam / mu) (hρ0 : 0 < ρ) (hρ1 : ρ < 1)
(p : ℕ → ℝ) (hp : ∀ i, p i = (1 - ρ) * ρ ^ i)
(Wq Lq : ℝ) (hLq : Lq = ∑' k : ℕ, (k : ℝ) * p (k + 1))
(hLittle : Lq = lam * Wq) :
Wq = ρ / ... | 214 | Continuous-time Markov & queues | null |
136 | stochastic_processes_three_state_cycle_nonreversible | Let (X_n) be an irreducible positive-recurrent Markov chain with stationary distribution π containing three states i, j, k.
Show that the chain is reversible only if P_{ij} P_{jk} P_{ki} = P_{ik} P_{kj} P_{ji}; if this product condition fails on any cycle, the chain is not reversible. | theorem q136_three_state_cycle
{S : Type*}
(P : S → S → ℝ) (π : S → ℝ) (hπpos : ∀ s, 0 < π s)
(hDB : ∀ a b, π a * P a b = π b * P b a)
(i j k : S) :
P i j * P j k * P k i = P i k * P k j * P j i := by
sorry | abstract | theorem q136_three_state_cycle
{S : Type*}
(P : S → S → ℝ) (π : S → ℝ) (hπpos : ∀ s, 0 < π s)
(hDB : ∀ a b, π a * P a b = π b * P b a)
(i j k : S) :
P i j * P j k * P k i = P i k * P k j * P j i := by
have h1 := hDB i j
have h2 := hDB j k
have h3 := hDB k i
have hpos : π i * π j * π k ≠ 0 :=... | 49 | Markov chains (finite & countable) | null |
140 | stochastic_processes_birth_death_null_recurrent_boundary | Consider an irreducible birth-death chain on the nonnegative integers with ρ_i = p_i/q_{i+1} and ∏_{j<i} ρ_j = 1 for all i.
Show that the chain is recurrent but not positive-recurrent. | theorem q140_birth_death_null_recurrent_boundary
(p q : ℕ → ℝ)
(hp : ∀ i, 0 < p i) (hq0 : q 0 = 0) (hqpos : ∀ i, 0 < q (i + 1))
(hbound : ∀ i, p i + q i ≤ 1)
(ρ : ℕ → ℝ) (hρ : ∀ i, ρ i = p i / q (i + 1))
(hprod : ∀ i, ∏ j ∈ Finset.range i, ρ j = 1) :
(¬ Summable (fun n : ℕ => 1 / (p n * ∏ j ∈ Fi... | abstract | theorem q140_birth_death_null_recurrent_boundary
(p q : ℕ → ℝ)
(hp : ∀ i, 0 < p i) (hq0 : q 0 = 0) (hqpos : ∀ i, 0 < q (i + 1))
(hbound : ∀ i, p i + q i ≤ 1)
(ρ : ℕ → ℝ) (hρ : ∀ i, ρ i = p i / q (i + 1))
(hprod : ∀ i, ∏ j ∈ Finset.range i, ρ j = 1) :
(¬ Summable (fun n : ℕ => 1 / (p n * ∏ j ∈ Fi... | 131 | Markov chains (finite & countable) | null |
141 | stochastic_processes_submartingale_1 | Let (X_n)_{n ≥ 0} be a martingale, and let ϕ be a convex function.
Show that (ϕ(X_n))_{n ≥ 0} is a submartingale. | theorem q141_convex_submartingale (μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
(X : ℕ → Ω → ℝ) (hX : Martingale X ℱ μ) (φ : ℝ → ℝ) (hconv : ConvexOn ℝ Set.univ φ)
(hint : ∀ n, Integrable (fun ω => φ (X n ω)) μ) :
Submartingale (fun n ω => φ (X n ω)) ℱ μ := by sorry | literal | theorem q141_convex_submartingale (μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
(X : ℕ → Ω → ℝ) (hX : Martingale X ℱ μ) (φ : ℝ → ℝ) (hconv : ConvexOn ℝ Set.univ φ)
(hint : ∀ n, Integrable (fun ω => φ (X n ω)) μ) :
Submartingale (fun n ω => φ (X n ω)) ℱ μ := by
have hcont : Continuous φ :=... | 304 | Martingales & stopping | null |
143 | stochastic_processes_convergence_theorem_2 | Suppose that (X_n)_n is a Markov chain with transition matrix P.
Assume that P is irreducible and aperiodic.
Show that there exists r such that P^r (x, y) > 0 for all x,y ∈ Ω. | theorem q143_convergence_primitive {Ω : Type*} [Fintype Ω] [DecidableEq Ω]
(P : Matrix Ω Ω ℝ) (hP : IsStochastic P) (hirr : IsIrreducible P)
(haper : IsAperiodic P) :
IsPrimitive P := by sorry | literal | theorem q143_convergence_primitive {Ω : Type*} [Fintype Ω] [DecidableEq Ω]
(P : Matrix Ω Ω ℝ) (hP : IsStochastic P) (hirr : IsIrreducible P)
(haper : IsAperiodic P) :
IsPrimitive P := by
have hPnn := hP.1
have hpow_nonneg : ∀ (k : ℕ) (i j : Ω), 0 ≤ (P ^ k) i j := by
intro k
induction k with
... | 132 | Markov chains (finite & countable) | null |
145 | stochastic_processes_two_threshold_possible_values | Let (S_n) be a random walk with i.i.d. steps in {−1,0,1} and mean 0, stopped at the first trial J with S_n ≥ a or S_n ≤ b for integer thresholds a > 0 > b.
Show that S_J ∈ {a, b}, i.e. the stopped walk lands exactly on a threshold with no overshoot. | theorem q145_two_threshold_possible_values (μ : Measure Ω) [IsProbabilityMeasure μ]
(X : ℕ → Ω → ℝ) (hstepval : ∀ i ω, X i ω = -1 ∨ X i ω = 0 ∨ X i ω = 1)
(hindep : iIndepFun X μ) (hident : ∀ i, IdentDistrib (X i) (X 0) μ μ)
(S : ℕ → Ω → ℝ) (hS : ∀ n ω, S n ω = ∑ i ∈ Finset.range n, X i ω)
(a b : ℤ) (ha... | abstract | theorem q145_two_threshold_possible_values (μ : Measure Ω) [IsProbabilityMeasure μ]
(X : ℕ → Ω → ℝ) (hstepval : ∀ i ω, X i ω = -1 ∨ X i ω = 0 ∨ X i ω = 1)
(hindep : iIndepFun X μ) (hident : ∀ i, IdentDistrib (X i) (X 0) μ μ)
(S : ℕ → Ω → ℝ) (hS : ∀ n ω, S n ω = ∑ i ∈ Finset.range n, X i ω)
(a b : ℤ) (ha... | 53 | Random walks & large deviations | null |
147 | stochastic_processes_continuity_wp1 | Let (Z_n) be random variables with Z_n → α with probability 1, and let f be continuous at α.
Show that f(Z_n) → f(α) with probability 1. | theorem q147_continuity_wp1 (μ : Measure Ω)
(Z : ℕ → Ω → ℝ) (α : ℝ) (f : ℝ → ℝ) (hf : ContinuousAt f α)
(hZ : ∀ᵐ ω ∂μ, Tendsto (fun n => Z n ω) atTop (𝓝 α)) :
∀ᵐ ω ∂μ, Tendsto (fun n => f (Z n ω)) atTop (𝓝 (f α)) := by
sorry | literal | theorem q147_continuity_wp1 (μ : Measure Ω)
(Z : ℕ → Ω → ℝ) (α : ℝ) (f : ℝ → ℝ) (hf : ContinuousAt f α)
(hZ : ∀ᵐ ω ∂μ, Tendsto (fun n => Z n ω) atTop (𝓝 α)) :
∀ᵐ ω ∂μ, Tendsto (fun n => f (Z n ω)) atTop (𝓝 (f α)) := by
filter_upwards [hZ] with ω hω
exact (hf.tendsto).comp hω | 80 | Weak convergence & functional limits | null |
154 | stochastic_processes_column_range_monotone | Let [P] be the transition matrix of a finite-state Markov chain. For fixed j and n, let U_n = max_i P_{ij}^n and L_n = min_i P_{ij}^n.
Show that U_{n+1} ≤ U_n and L_{n+1} ≥ L_n, so the range of the jth column of [P]^n is nonincreasing in n. | theorem q154_column_range_monotone {Ω : Type*} [Fintype Ω] [DecidableEq Ω] [Nonempty Ω]
(P : Matrix Ω Ω ℝ) (hP : IsStochastic P) :
∀ (j : Ω) (n : ℕ),
(⨆ i, (P ^ (n + 1)) i j) ≤ (⨆ i, (P ^ n) i j) ∧
(⨅ i, (P ^ n) i j) ≤ (⨅ i, (P ^ (n + 1)) i j) := by
sorry | literal | theorem q154_column_range_monotone {Ω : Type*} [Fintype Ω] [DecidableEq Ω] [Nonempty Ω]
(P : Matrix Ω Ω ℝ) (hP : IsStochastic P) :
∀ (j : Ω) (n : ℕ),
(⨆ i, (P ^ (n + 1)) i j) ≤ (⨆ i, (P ^ n) i j) ∧
(⨅ i, (P ^ n) i j) ≤ (⨅ i, (P ^ (n + 1)) i j) := by
obtain ⟨hnn, hrow⟩ := hP
intro j n
have hexp... | 76 | Markov chains (finite & countable) | null |
156 | stochastic_processes_geometric_brownian_mean | Let S(t) = S0 · exp(m t + σ B(t)) be a geometric Brownian motion, where B is standard Brownian motion (B(t) ~ Normal(0, t)). Show that its mean is E[S(t)] = S0 · exp((m + σ²/2) t). | theorem q156_geometric_brownian_mean (μ : Measure Ω) [IsProbabilityMeasure μ]
(B : ℝ → Ω → ℝ) (S0 mdrift σ : ℝ)
(hlaw : ∀ t : ℝ, 0 ≤ t → HasLaw (B t) (gaussianReal 0 t.toNNReal) μ)
(S : ℝ → Ω → ℝ) (hS : ∀ t ω, S t ω = S0 * Real.exp (mdrift * t + σ * B t ω))
(hint : ∀ t, Integrable (S t) μ) :
∀ t : ℝ... | abstract | theorem q156_geometric_brownian_mean (μ : Measure Ω) [IsProbabilityMeasure μ]
(B : ℝ → Ω → ℝ) (S0 mdrift σ : ℝ)
(hlaw : ∀ t : ℝ, 0 ≤ t → HasLaw (B t) (gaussianReal 0 t.toNNReal) μ)
(S : ℝ → Ω → ℝ) (hS : ∀ t ω, S t ω = S0 * Real.exp (mdrift * t + σ * B t ω))
(hint : ∀ t, Integrable (S t) μ) :
∀ t : ℝ... | 156 | Brownian motion & stochastic calculus | null |
157 | stochastic_processes_exponential_memoryless | Let X have an exponential distribution with rate r > 0. Show the memoryless property: for all s, t ≥ 0, P(X > s + t) = P(X > s) · P(X > t). | theorem q157_exponential_memoryless (μ : Measure Ω) [IsProbabilityMeasure μ]
(X : Ω → ℝ) (r : ℝ) (hr : 0 < r) (hlaw : HasLaw X (expMeasure r) μ) :
∀ s t : ℝ, 0 ≤ s → 0 ≤ t →
(μ {ω | s + t < X ω}).toReal
= (μ {ω | s < X ω}).toReal * (μ {ω | t < X ω}).toReal := by
sorry | abstract | theorem q157_exponential_memoryless (μ : Measure Ω) [IsProbabilityMeasure μ]
(X : Ω → ℝ) (r : ℝ) (hr : 0 < r) (hlaw : HasLaw X (expMeasure r) μ) :
∀ s t : ℝ, 0 ≤ s → 0 ≤ t →
(μ {ω | s + t < X ω}).toReal
= (μ {ω | s < X ω}).toReal * (μ {ω | t < X ω}).toReal := by
haveI hp : IsProbabilityMeasure (... | 156 | Poisson processes | null |
165 | stochastic_processes_gg1_idle_time_identity | Consider a G/G/1 queue with queue-length process Q and cumulative busy time B(t).
Show that the cumulative idle time satisfies I(t) = t − B(t) = ∫_0^t 1{Q(s) = 0} ds. | theorem q165_gg1_idle_time_identity
(Q : ℝ → ℕ) (hQmeas : Measurable Q) (B I : ℝ → ℝ)
(hbusy : ∀ t : ℝ, 0 ≤ t → B t = ∫ s in (0 : ℝ)..t, (if 0 < Q s then (1 : ℝ) else 0))
(hIdef : ∀ t, I t = t - B t) :
∀ t : ℝ, 0 ≤ t → I t = ∫ s in (0 : ℝ)..t, (if Q s = 0 then (1 : ℝ) else 0) := by
sorry | abstract | theorem q165_gg1_idle_time_identity
(Q : ℝ → ℕ) (hQmeas : Measurable Q) (B I : ℝ → ℝ)
(hbusy : ∀ t : ℝ, 0 ≤ t → B t = ∫ s in (0 : ℝ)..t, (if 0 < Q s then (1 : ℝ) else 0))
(hIdef : ∀ t, I t = t - B t) :
∀ t : ℝ, 0 ≤ t → I t = ∫ s in (0 : ℝ)..t, (if Q s = 0 then (1 : ℝ) else 0) := by
have hmeas : Measur... | 54 | Continuous-time Markov & queues | null |
168 | stochastic_processes_scaled_branching_martingale | Consider a branching process (X_n) with i.i.d. offspring counts of mean Ȳ, and let Z_n = X_n / Ȳ^n.
Show that (Z_n) is a martingale. | theorem q168_branching_martingale (μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
(X : ℕ → Ω → ℝ) (hadap : Adapted ℱ X) (hint : ∀ n, Integrable (X n) μ)
(Ybar : ℝ) (hY : 0 < Ybar)
(hbranch : ∀ n, μ[X (n + 1) | ℱ n] =ᵐ[μ] fun ω => Ybar * X n ω) :
Martingale (fun n ω => X n ω / Ybar ^ n) ℱ ... | abstract | theorem q168_branching_martingale (μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
(X : ℕ → Ω → ℝ) (hadap : Adapted ℱ X) (hint : ∀ n, Integrable (X n) μ)
(Ybar : ℝ) (hY : 0 < Ybar)
(hbranch : ∀ n, μ[X (n + 1) | ℱ n] =ᵐ[μ] fun ω => Ybar * X n ω) :
Martingale (fun n ω => X n ω / Ybar ^ n) ℱ ... | 207 | Martingales & stopping | null |
169 | stochastic_processes_gamblers_ruin_2 | Let X = (X_n)_{n ≥ 0} be Gambler’s ruin with state space Ω = {0, 1, 2, ..., N}:
X_0 = k, ℙ[X_{n + 1} = X_n + 1 | X_n] = 1/2, τ = min{n: X_n = 0 or N}.
You are given the martingale Y = (Yn := X_n^2 − n)_{n ≥ 0}.
Show that Y has bounded increments. | theorem q169_gambler_bounded_increments (μ : Measure Ω) [IsProbabilityMeasure μ] (N : ℕ)
(X : ℕ → Ω → ℝ) (hXbd : ∀ n ω, 0 ≤ X n ω ∧ X n ω ≤ N)
(hstep1 : ∀ n, ∀ᵐ ω ∂μ, |X (n + 1) ω - X n ω| = 1) :
∃ M : ℝ, ∀ n, ∀ᵐ ω ∂μ,
|((X (n + 1) ω) ^ 2 - (n + 1)) - ((X n ω) ^ 2 - n)| ≤ M := by sorry | literal | theorem q169_gambler_bounded_increments (μ : Measure Ω) [IsProbabilityMeasure μ] (N : ℕ)
(X : ℕ → Ω → ℝ) (hXbd : ∀ n ω, 0 ≤ X n ω ∧ X n ω ≤ N)
(hstep1 : ∀ n, ∀ᵐ ω ∂μ, |X (n + 1) ω - X n ω| = 1) :
∃ M : ℝ, ∀ n, ∀ᵐ ω ∂μ,
|((X (n + 1) ω) ^ 2 - (n + 1)) - ((X n ω) ^ 2 - n)| ≤ M := by
refine ⟨2 * N + 1, ... | 67 | Martingales & stopping | null |
177 | stochastic_processes_supermartingale_convergence | Let X = (X_n)_{n ≥ 0} be a non-negative supermartingale.
Show that X_n converges a.s. to some a.s. finite limit. | theorem q177_super_convergence (μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
(X : ℕ → Ω → ℝ) (hX : Supermartingale X ℱ μ) (hnn : ∀ n ω, 0 ≤ X n ω) :
∃ Xinf : Ω → ℝ, ∀ᵐ ω ∂μ, Tendsto (fun n => X n ω) atTop (𝓝 (Xinf ω)) := by sorry | literal | theorem q177_super_convergence (μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
(X : ℕ → Ω → ℝ) (hX : Supermartingale X ℱ μ) (hnn : ∀ n ω, 0 ≤ X n ω) :
∃ Xinf : Ω → ℝ, ∀ᵐ ω ∂μ, Tendsto (fun n => X n ω) atTop (𝓝 (Xinf ω)) := by
have hsub : Submartingale (-X) ℱ μ := hX.neg
have hint_le : ∀ n, ∫... | 273 | Martingales & stopping | null |
185 | stochastic_processes_stopped_martingale_preserves | Let (Z_n) be a martingale and let J be a stopping trial; let Z_n* be the stopped process (frozen at value Z_J for n ≥ J).
Show that (Z_n*) is also a martingale. | theorem q185_stopped_martingale (μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
[SigmaFiniteFiltration μ ℱ] (Z : ℕ → Ω → ℝ) (hZ : Martingale Z ℱ μ) (J : Ω → ℕ)
(hJ : IsStoppingTime ℱ (natStop J)) :
Martingale (stoppedProcess Z (natStop J)) ℱ μ := by
sorry | literal | theorem q185_stopped_martingale (μ : Measure Ω) [IsProbabilityMeasure μ] (ℱ : Filtration ℕ m0)
[SigmaFiniteFiltration μ ℱ] (Z : ℕ → Ω → ℝ) (hZ : Martingale Z ℱ μ) (J : Ω → ℕ)
(hJ : IsStoppingTime ℱ (natStop J)) :
Martingale (stoppedProcess Z (natStop J)) ℱ μ := by
have hneg : stoppedProcess (-Z) (natStop ... | 89 | Martingales & stopping | null |
187 | stochastic_processes_mm1_expected_delay | Consider an M/M/1 queue in steady state with arrival rate λ, service rate μ, and ρ = λ/μ < 1.
Show that the expected time a customer spends in the system is 1/(μ − λ). | theorem q187_mm1_expected_delay
(lam mu : ℝ) (hlam : 0 < lam) (hmu : 0 < mu)
(ρ : ℝ) (hρ : ρ = lam / mu) (hρ1 : ρ < 1)
(p : ℕ → ℝ) (hp0 : ∀ i, 0 ≤ p i) (hpsum : ∑' i, p i = 1)
(hbal0 : p 0 * lam = p 1 * mu)
(hbal : ∀ n, p (n + 1) * (lam + mu) = p n * lam + p (n + 2) * mu)
(L : ℝ) (hL : L = ∑' i ... | abstract | theorem q187_mm1_expected_delay
(lam mu : ℝ) (hlam : 0 < lam) (hmu : 0 < mu)
(ρ : ℝ) (hρ : ρ = lam / mu) (hρ1 : ρ < 1)
(p : ℕ → ℝ) (hp0 : ∀ i, 0 ≤ p i) (hpsum : ∑' i, p i = 1)
(hbal0 : p 0 * lam = p 1 * mu)
(hbal : ∀ n, p (n + 1) * (lam + mu) = p n * lam + p (n + 2) * mu)
(L : ℝ) (hL : L = ∑' i ... | 242 | Continuous-time Markov & queues | null |
188 | stochastic_processes_accessibility_transitive | Let (X_n) be a finite-state Markov chain, and say i → j if j is accessible from i.
Show that accessibility is transitive: if i → j and j → k then i → k. | theorem q188_accessibility_transitive {Ω : Type*} [Fintype Ω] [DecidableEq Ω]
(P : Matrix Ω Ω ℝ) (hP : IsStochastic P) (i j k : Ω)
(hij : ∃ m : ℕ, 0 < (P ^ m) i j) (hjk : ∃ n : ℕ, 0 < (P ^ n) j k) :
∃ p : ℕ, 0 < (P ^ p) i k := by
sorry | literal | theorem q188_accessibility_transitive {Ω : Type*} [Fintype Ω] [DecidableEq Ω]
(P : Matrix Ω Ω ℝ) (hP : IsStochastic P) (i j k : Ω)
(hij : ∃ m : ℕ, 0 < (P ^ m) i j) (hjk : ∃ n : ℕ, 0 < (P ^ n) j k) :
∃ p : ℕ, 0 < (P ^ p) i k := by
obtain ⟨m, hm⟩ := hij
obtain ⟨n, hn⟩ := hjk
-- nonnegativity of powers
... | 65 | Markov chains (finite & countable) | null |
189 | stochastic_processes_transitivity | For a transitive Markov chain on finite state space Ω, the uniform measure is stationary. | theorem q189_transitivity {Ω : Type*} [Fintype Ω] [Nonempty Ω]
(P : Matrix Ω Ω ℝ) (hP : IsStochastic P)
(htrans : ∀ x y : Ω, ∃ φ : Ω ≃ Ω, φ x = y ∧ ∀ a b, P (φ a) (φ b) = P a b) :
IsStationary P (fun _ => 1 / (Fintype.card Ω : ℝ)) := by sorry | literal | theorem q189_transitivity {Ω : Type*} [Fintype Ω] [Nonempty Ω]
(P : Matrix Ω Ω ℝ) (hP : IsStochastic P)
(htrans : ∀ x y : Ω, ∃ φ : Ω ≃ Ω, φ x = y ∧ ∀ a b, P (φ a) (φ b) = P a b) :
IsStationary P (fun _ => 1 / (Fintype.card Ω : ℝ)) := by
have hN : (Fintype.card Ω : ℝ) ≠ 0 := by exact_mod_cast Fintype.card_... | 160 | Markov chains (finite & countable) | null |
191 | stochastic_processes_doob_martingale_convergence | Let (X_n) be a supermartingale with sup_n E|X_n| < ∞.
Show that X_∞ = lim_{n→∞} X_n exists almost surely and satisfies E|X_∞| < ∞. | theorem q191_doob_martingale_convergence (μ : Measure Ω) [IsProbabilityMeasure μ]
(ℱ : Filtration ℕ m0) (X : ℕ → Ω → ℝ) (hX : Supermartingale X ℱ μ)
(hbdd : ∃ C : ℝ, ∀ n, ∫ ω, |X n ω| ∂μ ≤ C) :
∃ Xinf : Ω → ℝ,
(∀ᵐ ω ∂μ, Tendsto (fun n => X n ω) atTop (𝓝 (Xinf ω))) ∧ Integrable Xinf μ := by
sorry | literal | theorem q191_doob_martingale_convergence (μ : Measure Ω) [IsProbabilityMeasure μ]
(ℱ : Filtration ℕ m0) (X : ℕ → Ω → ℝ) (hX : Supermartingale X ℱ μ)
(hbdd : ∃ C : ℝ, ∀ n, ∫ ω, |X n ω| ∂μ ≤ C) :
∃ Xinf : Ω → ℝ,
(∀ᵐ ω ∂μ, Tendsto (fun n => X n ω) atTop (𝓝 (Xinf ω))) ∧ Integrable Xinf μ := by
obtain ⟨... | 207 | Martingales & stopping | null |
192 | stochastic_processes_brownian_exponential_martingale | For standard Brownian motion B and a real parameter θ, the exponential process exp(θ B(t) − θ² t / 2) is a martingale with respect to the natural filtration. | theorem q192_brownian_exponential_martingale (μ : Measure Ω) [IsProbabilityMeasure μ]
(ℱ : Filtration ℝ m0) (B : ℝ → Ω → ℝ) (θ : ℝ)
(hadap : Adapted ℱ B)
(hint : ∀ t, Integrable (fun ω => Real.exp (θ * B t ω - θ ^ 2 * t / 2)) μ)
(hincr : ∀ s t : ℝ, 0 ≤ s → s ≤ t →
HasLaw (fun ω => B t ω - B s ω) (... | abstract | theorem q192_brownian_exponential_martingale (μ : Measure Ω) [IsProbabilityMeasure μ]
(ℱ : Filtration ℝ m0) (B : ℝ → Ω → ℝ) (θ : ℝ)
(hadap : Adapted ℱ B)
(hint : ∀ t, Integrable (fun ω => Real.exp (θ * B t ω - θ ^ 2 * t / 2)) μ)
(hincr : ∀ s t : ℝ, 0 ≤ s → s ≤ t →
HasLaw (fun ω => B t ω - B s ω) (... | 156 | Brownian motion & stochastic calculus | null |
StochBench
StochBench is a Lean 4 benchmark of 450 graduate stochastic-process problems, each paired with its natural-language statement. It evaluates proof agents on graduate stochastic processes. Topics include finite and countable Markov chains, martingales, stopping times, renewal processes, random walks, queues, Brownian motion, stochastic calculus, Poisson processes, and weak convergence.
The benchmark contains direct and abstracted formalizations, with explicit assumptions for each target. The informal-formal pairs can be used for autoformalization training, and checked proofs can provide supervision for proof generation. Shared definitions support further formalization in Lean.
The accompanying paper, StochBench: A Domain-Specific Benchmark for Stochastic Processes in Lean, reports 157 clean proofs out of 450 targets (34.9%) from an Opus 4.8-based agent under a 15-minute per-problem limit, with results reported by topic and representation.
Keywords: Formal theorem proving, Lean 4, stochastic processes, mathematical reasoning, natural language processing, large language models, autoformalization, domain-specific benchmarks
License: Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International; see LICENSE.txt.
Formalization scope
The true_to_source field distinguishes two representations:
- Direct (
literal): 114 targets, or 25.3%. These use Mathlib objects or shared definitions to express the problem. - Abstracted (
abstract): 336 targets, or 74.7%. These supply required mathematical properties as explicit hypotheses, particularly where the development environment lacks the necessary infrastructure. The properties may define an object or provide intermediate results from the source problem.
For example, a hitting-time target may assume first-step equations for an expected hitting-time function. Proving the resulting target can require substantial mathematics while leaving the connection to pathwise hitting-time random variables outside the formalized task. The paper's Q361 example illustrates this distinction: its proof develops auxiliary results about matrix powers, harmonic functions, and hitting-time inequalities from the supplied equations.
The labels describe how a target is represented. They are curator-assigned categories rather than correctness scores or rigorously defined difficulty levels. Lean checks that a completed proof establishes its conclusion under the stated hypotheses; correspondence with the informal problem requires a separate assessment.
Coverage and baseline results
The paper evaluates a multi-turn, tool-using Opus 4.8-based agent with lean4skills and the Lean LSP MCP server. Each target received one run capped at 15 minutes, with access to compiler feedback, library and shared-definition search, loogle, leansearch, and proof revision. The same model family assisted with statement construction.
A clean proof is accepted by Lean without sorry, sorryAx, or additional admitted facts, with checking performed using Lean comparator. The following results reproduce Table 1 of the paper. Only proofs with recorded proving times of at most 900 seconds are counted.
| Topic | Direct targets | Abstracted targets | Total targets | Clean proofs | Proof rate |
|---|---|---|---|---|---|
| Poisson processes | 5 | 35 | 40 | 7 | 17.5% |
| Markov chains (finite & countable) | 23 | 73 | 96 | 37 | 38.5% |
| Renewal processes | 0 | 41 | 41 | 2 | 4.9% |
| Continuous-time Markov & queues | 1 | 54 | 55 | 23 | 41.8% |
| Random walks & large deviations | 9 | 53 | 62 | 16 | 25.8% |
| Martingales & stopping | 67 | 27 | 94 | 58 | 61.7% |
| Brownian motion & stochastic calculus | 0 | 45 | 45 | 8 | 17.8% |
| Weak convergence & functional limits | 9 | 8 | 17 | 6 | 35.3% |
| Total | 114 | 336 | 450 | 157 | 34.9% |
The baseline proves 79 of 114 direct targets (69.3%) and 78 of 336 abstracted targets (23.2%). These are descriptive comparisons across different problems and levels of library support. They do not isolate the effect of abstraction. The evaluation covers one agent and one time budget, without repeated runs or a comparison between models.
The released attempted_proof.json contains 168 stored proofs, including 11 with recorded times above the baseline cutoff. Thus, 168 is the number of stored proof records, while 157 is the paper's count within the 15-minute budget. Q361 has a recorded lower bound of 1800 seconds and is discussed separately in the paper's appendix.
Dataset files and fields
There are 450 distinct problems with IDs 1-450. Join records using question_id, since the proof file covers only a subset of the problems. The files are overlapping views of the corpus; no separate training, validation, or test partition is provided.
questions.json(450 records): English problem statements, names, and topics.statements.json(450 records): The same metadata, Lean targets, and formalization labels.attempted_proof.json(168 records): Matching statement metadata, stored proof declarations, and recorded proving times.proofs/p_<question_id>.lean(168 files): Corresponding Lean proof source files.helper_funcs.lean: Shared mathematical definitions in theAutonamespace.
| Field | Type | Present in | Description |
|---|---|---|---|
question_id |
integer | All JSON files | Problem identifier shared across files |
problem_name |
string | All JSON files | Descriptive machine-readable problem name |
informal_statement |
string | All JSON files | English mathematical problem, including notation and hypotheses |
topic |
string | All JSON files | One of the eight topic labels above |
lean_statement |
string | Statements and proofs | Lean theorem target with an intentional sorry proof placeholder |
true_to_source |
string | Statements and proofs | Representation label: literal (direct) or abstract (abstracted) |
proof |
string | Proofs | Lean declaration containing the stored proof, including any auxiliary declarations |
time_seconds |
integer | Proofs | Recorded proving time in seconds |
time_seconds_is_lower_bound |
boolean, optional | Proofs | When true, the recorded time is only a lower bound; absent from other records |
For Q361, time_seconds is 1800 and time_seconds_is_lower_bound is true, reflecting a reported duration of 30+ minutes. Preserve this distinction when analyzing runtimes. Missing optional values may appear as null when loaded into a tabular dataset.
Example record
The following is a record from questions.json:
{
"question_id": 8,
"problem_name": "stochastic_processes_martingale_1",
"informal_statement": "Consider biased gambler’s ruin: at each step, the gambler gains one dollar\n with probability p and losses one dollar with probability (1 − p).\n Let X_n be the money in purse at time n.\n\n Show that if p = 1/2, then (X_n) is a martingale.",
"topic": "Martingales & stopping"
}
Loading the data
Download the JSON files from Hugging Face and read them directly with Python:
import json
from pathlib import Path
from huggingface_hub import hf_hub_download
repo_id = "IdanDavidovich/StochBench"
def read_records(filename):
path = hf_hub_download(
repo_id=repo_id, repo_type="dataset", filename=filename
)
return json.loads(Path(path).read_text(encoding="utf-8"))
questions = read_records("questions.json")
statements = read_records("statements.json")
proofs = read_records("attempted_proof.json")
statements_by_id = {row["question_id"]: row for row in statements}
proofs_by_id = {row["question_id"]: row for row in proofs}
print(statements_by_id[8]["lean_statement"])
For files already downloaded to the current directory, use json.loads(Path("statements.json").read_text(encoding="utf-8")). For reproducible experiments, pass a fixed commit hash as revision to hf_hub_download and record the Lean and Mathlib versions used.
Attribution
Idan Davidovich · Debargha Ganguly · Vikash Singh · Vipin Chaudhary
Case Western Reserve University{idan, debargha, vikash, vipin}@case.edu
Please cite the dataset repository and the revision used in your experiments. A dataset citation is:
@misc{davidovich2026stochbench,
author = {Davidovich, Idan and Ganguly, Debargha and Singh, Vikash and Chaudhary, Vipin},
title = {StochBench},
year = {2026},
howpublished = {Hugging Face dataset},
url = {https://huggingface.co/datasets/IdanDavidovich/StochBench}
}
Sources and construction
StochBench combines problems written for the benchmark with exercises, lemmas, theorems, and corollaries selected from:
- Kyle Siegrist's Probability, Mathematical Statistics, and Stochastic Processes (2022).
- Hao Wu's MIT course 18.445 Introduction to Stochastic Processes (Spring 2015).
- David Gamarnik's MIT course 15.070J Advanced Stochastic Processes (Fall 2013).
- Robert Gallager's MIT course 6.262 Discrete Stochastic Processes (Spring 2011).
Problems were selected for their relevance to stochastic processes and expressed as mathematical claims with hypotheses. As described in the paper, all benchmark-specific questions, definitions, and hypotheses are human-written. An Opus 4.8-based formalizer assisted with expressing them as Lean theorem statements, which were revised using Lean feedback until they elaborated in Lean 4.30.0 with a fixed Mathlib version.
Shared definitions give related problems a common mathematical representation. These include matrix-based descriptions of Markov chains, first-step equations for hitting and return times, and definitions connecting stochastic-process properties to Mathlib. The definitions and hypotheses were reviewed against the source problems.
- Downloads last month
- -