Aether Catalog definitions — Evergreen_Prediction_MartingalePrediction
DefinitionEvergreen_Prediction_MartingalePredictionaether-catalogevergreen
Definition bundle for the Aether Catalog module Evergreen.Prediction.MartingalePrediction, transplanted by skeleton subtraction; supplies the types and constants the catalog's theorems import.
Definition code
-- Def bundle generated from Evergreen/Prediction/MartingalePrediction.lean by skeleton subtraction import Mathlib /- # Martingale Theory of Prediction -/ open Finset BigOperators Filter namespace MartingalePrediction /-! ## Section 1: Discrete Martingales -/ def isSupermartingale (X : ℕ → ℝ) : Prop := ∀ n, X (n + 1) ≤ X n def isSubmartingale (X : ℕ → ℝ) : Prop := ∀ n, X n ≤ X (n + 1) def isMartingale (X : ℕ → ℝ) : Prop := ∀ n, X (n + 1) = X n /-! ## Section 2: Prediction Markets -/ structure PredictionMarket where price : ℝ price_nonneg : 0 ≤ price price_le_one : price ≤ 1 def MarketHistory := ℕ → PredictionMarket def isEfficient (history : MarketHistory) : Prop := isMartingale (fun n => (history n).price) /-! ## Section 3: The Doob Decomposition -/ /-! ## Section 4: Bounded Differences -/ def hasBoundedIncrements (X : ℕ → ℝ) (c : ℝ) : Prop := ∀ n, |X (n + 1) - X n| ≤ c /- PROVIDED SOLUTION By induction on n. Base: |X 0 - X 0| = 0 ≤ 0 = 0 * c. Step: |X (n+1) - X 0| = |(X(n+1) - X n) + (X n - X 0)| ≤ |X(n+1) - X n| + |X n - X 0| ≤ c + n*c = (n+1)*c by triangle inequality, hX n, and IH. Use abs_add (or abs_add_le) for triangle inequality, then add_le_add, then show c + n*c = (n+1)*c via ring or push_cast. -/ /-! ## Section 5: Prediction Convergence -/ /-- Exponential smoothing predictor -/ noncomputable def exponentialSmoothing (seq : ℕ → ℝ) (α_param : ℝ) : ℕ → ℝ | 0 => seq 0 | n + 1 => α_param * seq (n + 1) + (1 - α_param) * exponentialSmoothing seq α_param n end MartingalePrediction