/- Copyright (c) 2026 Raphael Coelho. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Raphael Coelho -/ module public import Mathlib public import MathFin.BlackScholes.JumpDiffusionCanonical public import MathFin.Foundations.ExpMartingaleIndepIncrements /-! # The jump-diffusion price process The other jump-diffusion files model only the price at maturity. Here the log-price is a process `X` on `[0, ∞)`, adapted to a filtration `𝓕`, starting at `0`, whose increment `X_t − X_s` over `[s, t]` is independent of `𝓕_s` and has the law of a jump-diffusion log-return over `t − s`: a drift `b(t − s)`, a Gaussian part of variance `σ²(t − s)` and a compound-Poisson part with `Poisson(Λ(t − s))` jumps of law `ν` (`JumpDiffusionProcess`); here `Λ` is a jump rate. The increments are those of a Lévy process with these characteristics; no path regularity is assumed. Without jumps, Brownian motion with drift is such a process (`IsFilteredPreBrownian.jumpDiffusionProcess`); with jumps its existence is not proved. The log-return over `τ` has the moment-generating function `e^{κ(θ)τ}` at every `θ` with `∫ e^{θx} dν < ∞`, where `κ(θ) = bθ + σ²θ²/2 + Λ(∫ e^{θx} dν − 1)` is the Laplace exponent (`jumpDiffusionExponent`). On the canonical model it is the Gaussian moment-generating function times the compound-Poisson one (`JumpDiffusionHyp.mgf_logReturn`, `compoundPoisson_mgf_of_indepFun` from `Actuarial/CompoundPoissonMGF.lean`), by independence; in Mathlib's terms `κ(θ)τ` is the cumulant generating function (`cgf_id_jumpDiffusionIncrementLaw`). The price `S_t = S₀e^{X_t}` discounted at the rate `r` is a martingale exactly at the compensated drift `b = r − σ²/2 − Λ(𝔼[e^J] − 1)` (`JumpDiffusionProcess.martingale_iff`). The increment's exponential moment is `e^{(b + σ²/2 + Λ(𝔼[e^J] − 1))(t − s)}` (`integral_exp_jumpDiffusionIncrementLaw`, the case `θ = 1`), so the exponential martingale of independent increments (`martingale_exp_sub_of_indep_increments`) gives the "if"; conversely a martingale has constant mean, and the mean at time `1` is `S₀e^{b + σ²/2 + Λ(𝔼[e^J] − 1) − r}`. ## Main results * `jumpDiffusionIncrementLaw`: the law of a jump-diffusion log-return over a time `τ`. * `integral_exp_const_mul_jumpDiffusionIncrementLaw`, `mgf_id_jumpDiffusionIncrementLaw`, `cgf_id_jumpDiffusionIncrementLaw`: its moment-generating function `e^{κ(θ)τ}`. * `integrableExpSet_id_subset_jumpDiffusionIncrementLaw`, `zero_mem_interior_integrableExpSet_jumpDiffusionIncrementLaw`, `cgf_id_jumpDiffusionIncrementLaw_eventuallyEq`: the jumps' exponential moments pass to the log-return, and near `0` its cumulant generating function is `κ(θ)τ`. * `hasDerivAt_jumpDiffusionExponent`: `κ'(θ) = b + σ²θ + ΛM'(θ)`, with `M` the jump law's moment-generating function. * `integral_exp_jumpDiffusionIncrementLaw_of_compensated`: at the compensated drift the forward is the mean, `∫ eʸ = e^{rτ}`. * `JumpDiffusionProcess.hasLaw`: `X_t` has the log-return law over `t`. * `JumpDiffusionProcess.martingale_iff`: the discounted price is a martingale if and only if the drift is compensated. -/ @[expose] public section namespace MathFin open MeasureTheory ProbabilityTheory Real open scoped NNReal /-! ### The increment law -/ namespace JumpDiffusionHyp variable {Ω : Type*} {mΩ : MeasurableSpace Ω} {Q : Measure Ω} {Λ : ℝ≥0} {Z : Ω → ℝ} {N : Ω → ℕ} {J : ℕ → Ω → ℝ} /-- **The moment-generating function of a jump-diffusion log-return.** For `θ` with `𝔼[e^{θJ}] < ∞`, `𝔼[e^{θ(bT + σ√T·Z + ∑_{i intro h <;> linarith /-! ### The process -/ /-- **A jump-diffusion log-price process.** `X` is adapted to the filtration `𝓕`, starts at `0`, and each increment `X_t − X_s` (`s ≤ t`) is independent of `𝓕_s` and has the law of a jump-diffusion log-return over `t − s` (`jumpDiffusionIncrementLaw`): drift `b(t − s)`, a Gaussian part of variance `σ²(t − s)`, and a compound-Poisson part with `Poisson(Λ(t − s))` jumps of law `ν`. The price is `S_t = S₀e^{X_t}`. The structure is a hypothesis: it is satisfied without jumps (`IsFilteredPreBrownian.jumpDiffusionProcess`), and its existence with jumps is not proved. -/ structure JumpDiffusionProcess {Ω : Type*} {mΩ : MeasurableSpace Ω} (P : Measure Ω) (𝓕 : Filtration ℝ≥0 mΩ) (X : ℝ≥0 → Ω → ℝ) (b σ : ℝ) (Λ : ℝ≥0) (ν : Measure ℝ) : Prop where adapted : StronglyAdapted 𝓕 X zero : ∀ᵐ ω ∂P, X 0 ω = 0 indep : ∀ s t, s ≤ t → Indep (MeasurableSpace.comap (fun ω ↦ X t ω - X s ω) inferInstance) (𝓕 s) P law : ∀ s t, s ≤ t → HasLaw (fun ω ↦ X t ω - X s ω) (jumpDiffusionIncrementLaw b σ Λ ν (t - s)) P namespace JumpDiffusionProcess variable {Ω : Type*} {mΩ : MeasurableSpace Ω} {P : Measure Ω} {𝓕 : Filtration ℝ≥0 mΩ} {X : ℝ≥0 → Ω → ℝ} {b σ : ℝ} {Λ : ℝ≥0} {ν : Measure ℝ} /-- A jump-diffusion lives on a probability space: the law of each increment is a probability measure. -/ lemma isProbabilityMeasure (h : JumpDiffusionProcess P 𝓕 X b σ Λ ν) [IsProbabilityMeasure ν] : IsProbabilityMeasure P := (h.law 0 0 le_rfl).isProbabilityMeasure /-- The increment over `[s, t]` has exponential moment `e^{(b + σ²/2 + Λ(𝔼[e^J] − 1))(t − s)}`. -/ lemma integral_exp_increment (h : JumpDiffusionProcess P 𝓕 X b σ Λ ν) [IsProbabilityMeasure ν] (hν : Integrable rexp ν) {s t : ℝ≥0} (hst : s ≤ t) : ∫ ω, rexp (X t ω - X s ω) ∂P = rexp ((b + σ ^ 2 / 2 + Λ * (∫ x, rexp x ∂ν - 1)) * (t - s : ℝ≥0)) := by rw [← integral_exp_jumpDiffusionIncrementLaw b σ Λ hν (t - s)] exact (h.law s t hst).integral_comp measurable_exp.aestronglyMeasurable /-- **The law of `X_t`** is the log-return law over `t`: `X_t = X_t − X_0` almost surely. -/ lemma hasLaw (h : JumpDiffusionProcess P 𝓕 X b σ Λ ν) (t : ℝ≥0) : HasLaw (X t) (jumpDiffusionIncrementLaw b σ Λ ν t) P := by have h0 := h.law 0 t (zero_le : (0 : ℝ≥0) ≤ t) rw [tsub_zero] at h0 refine h0.congr ?_ filter_upwards [h.zero] with ω hω rw [hω, sub_zero] /-- `𝔼[e^{X_t}] = e^{(b + σ²/2 + Λ(𝔼[e^J] − 1))t}`, the exponential moment of the law of `X_t` (`hasLaw`). -/ lemma integral_exp (h : JumpDiffusionProcess P 𝓕 X b σ Λ ν) [IsProbabilityMeasure ν] (hν : Integrable rexp ν) (t : ℝ≥0) : ∫ ω, rexp (X t ω) ∂P = rexp ((b + σ ^ 2 / 2 + Λ * (∫ x, rexp x ∂ν - 1)) * t) := by rw [← integral_exp_jumpDiffusionIncrementLaw b σ Λ hν t] exact (h.hasLaw t).integral_comp measurable_exp.aestronglyMeasurable /-- `e^{X_t}` is integrable: its integral is positive (`integral_exp`). -/ lemma integrable_exp (h : JumpDiffusionProcess P 𝓕 X b σ Λ ν) [IsProbabilityMeasure ν] (hν : Integrable rexp ν) (t : ℝ≥0) : Integrable (fun ω ↦ rexp (X t ω)) P := Integrable.of_integral_ne_zero (by rw [h.integral_exp hν t]; exact (Real.exp_pos _).ne') /-- **The discounted jump-diffusion price is a martingale exactly at the compensated drift.** For a jump law with `𝔼[e^J] < ∞` and `S₀ ≠ 0`, `t ↦ e^{−rt}S₀e^{X_t}` is an `𝓕`-martingale if and only if `b = r − σ²/2 − Λ(𝔼[e^J] − 1)`. -/ theorem martingale_iff (h : JumpDiffusionProcess P 𝓕 X b σ Λ ν) [IsProbabilityMeasure ν] (hν : Integrable rexp ν) {S_0 : ℝ} (hS_0 : S_0 ≠ 0) (r : ℝ) : Martingale (fun (t : ℝ≥0) ω ↦ rexp (-r * t) * (S_0 * rexp (X t ω))) 𝓕 P ↔ b = r - σ ^ 2 / 2 - Λ * (∫ x, rexp x ∂ν - 1) := by have := h.isProbabilityMeasure constructor · -- a martingale has constant mean; at time `1` it is `S₀e^{b + σ²/2 + Λ(𝔼[e^J] − 1) − r}` intro hM have hmean : ∫ ω, rexp (-r * ((0 : ℝ≥0) : ℝ)) * (S_0 * rexp (X 0 ω)) ∂P = ∫ ω, rexp (-r * ((1 : ℝ≥0) : ℝ)) * (S_0 * rexp (X 1 ω)) ∂P := (integral_congr_ae (hM.condExp_ae_eq zero_le_one)).symm.trans (integral_condExp (𝓕.le 0)) have h0 : ∫ ω, rexp (-r * ((0 : ℝ≥0) : ℝ)) * (S_0 * rexp (X 0 ω)) ∂P = S_0 := by have hS : (fun ω ↦ rexp (-r * ((0 : ℝ≥0) : ℝ)) * (S_0 * rexp (X 0 ω))) =ᵐ[P] fun _ ↦ S_0 := by filter_upwards [h.zero] with ω hω simp [hω] rw [integral_congr_ae hS, integral_const, probReal_univ, one_smul] have h1 : ∫ ω, rexp (-r * ((1 : ℝ≥0) : ℝ)) * (S_0 * rexp (X 1 ω)) ∂P = S_0 * rexp (b + σ ^ 2 / 2 + Λ * (∫ x, rexp x ∂ν - 1) - r) := by rw [integral_const_mul, integral_const_mul, h.integral_exp hν 1, mul_left_comm, ← Real.exp_add, NNReal.coe_one] congr 2 ring rw [h0, h1] at hmean have := (Real.exp_eq_one_iff _).1 ((mul_eq_left₀ hS_0).1 hmean.symm) linarith · -- at the compensated drift the increment exponentials have mean `e^{r(t − s)}` intro hb have hfun : (fun (t : ℝ≥0) ω ↦ rexp (-r * t) * (S_0 * rexp (X t ω))) = S_0 • fun (t : ℝ≥0) ω ↦ rexp (X t ω - r * t) := by funext t ω simp only [Pi.smul_apply, smul_eq_mul] rw [mul_left_comm, ← Real.exp_add] congr 2 ring rw [hfun] refine Martingale.smul S_0 (martingale_exp_sub_of_indep_increments (ψ := fun t : ℝ≥0 ↦ r * (t : ℝ)) h.adapted h.indep (h.integrable_exp hν) fun s t hst ↦ ?_) show ∫ ω, rexp (X t ω - X s ω) ∂P = rexp (r * t - r * s) rw [h.integral_exp_increment hν hst, NNReal.coe_sub hst, hb] congr 1 ring end JumpDiffusionProcess end MathFin