MathFin
Map / Valuation · Credit / MathFin.Models.Credit.Cox

Cox-intensity credit: survival, default density, CDS legs and fair spread

MathFin.Models.Credit.CoxMSC 91G40MSC 60G55JEL G12 source

The Cox construction of a default time, for a deterministic intensity: for h continuous and strictly positive on all of ℝ, with Λ = cumHazard h → ∞, the time obtained by inverting a unit-exponential clock through Λ satisfies, for t, T ≥ 0, the survival law P(τ > t) = e^{−Λ(t)} and the default-density identity P(τ ≤ T) = ∫₀ᵀ h(s)·e^{−Λ(s)} ds (undiscounted; nothing is priced against τ). The CDS legs are defined as the deterministic integrals c·∫₀ᵀ e^{−rs}S(s) ds (premium) and (1−R)·∫₀ᵀ e^{−rs}h(s)S(s) ds (protection), and the fair spread is the algebraic solution of c·A = (1−R)·L for A > 0. This file does not identify the legs with expectations over τ; Models/Credit/CVA.lean proves that the protection leg is (1 − R)·E[e^{−rτ}·1{τ ≤ T}] for the constructed τ (CVA.protectionLeg_eq_integral_coxDefaultTime), using the measurability of τ proved here (measurable_coxDefaultTime).

The module layers:

  • The counting/first-arrival substrate in credit variables — the constant-intensity reading of the Poisson first-arrival laws (PoissonInterarrival.survival_eq, PoissonInterarrival.map_firstArrival_eq_expMeasure).
  • Constant intensity — the two CDS legs in closed form: the risky annuity (1 − e^{−(r+λ)T})/(r+λ), the protection leg as hazard times the annuity, and the leg balance realizing cds_leg_equality at the concrete integral (fair spread λ(1−R)).
  • Deterministic time-varying intensity — the Cox default time coxDefaultTime (clock inversion through Λ), with the survival and CDF identities. The mechanism is an a.e. set equality between the survival event and the clock-tail event, so the identities need no regularity of the inverse. The default time is measurable (measurable_coxDefaultTime): Λ is a continuous injection, hence a measurable embedding, and Function.invFun Λ extends its inverse by a constant off the range.
  • The CDS legs under λ(t) — the risky annuity and default-density integrals (cdsAnnuity, cdsLosses), the explicit legs (premiumLeg, protectionLeg), the balance theorem cdsFairSpreadTV_balances, the constant-λ case cdsFairSpreadTV_const (collapsing to cdsFairSpread), and the default probability as the integral of the default density (undiscounted).
  • Restricted Cox mixing — on the product of a path space with the clock space, (μ₁ ⊗ Exp(1)){Λ_t < ξ} = ∫ e^{−Λ_t} dμ₁ for any Λ ≥ 0 with measurable time sections; a default time enters only when hypothesized (cox_mixed_survival).

Faithfulness note: cdsFairSpreadTV_balances is a direct instantiation of the cash-flow balance cdsFairSpread_TV_cash_flow_balance (Models/Credit/CDSTimeVarying.lean) at the concrete integrals, with annuity-positivity discharged by cdsAnnuity_pos; its own docstring discloses this.

Main definitions

  • riskyAnnuity: the risky annuity ∫₀ᵀ e^{−rs} e^{−lam·s} ds at constant intensity lam and discount rate r.
  • coxDefaultTime: the Cox default time, a unit-exponential clock inverted through the cumulative hazard Λ.
  • cdsAnnuity: the risky annuity ∫₀ᵀ e^{−rs} S(s) ds under deterministic intensity h.
  • cdsLosses: the default-density integral ∫₀ᵀ e^{−rs} h(s) S(s) ds under deterministic intensity h.
  • premiumLeg, protectionLeg: the CDS premium leg at spread c and protection leg at recovery R.
  • cdsFairSpreadTV: the time-varying fair spread (1−R) · losses / annuity.

Main results

  • defaultSurvival_const: if τ is the first arrival of a counting process with Poisson increments of rate rate, then P(τ > t) = e^{−rate·t} for t ≥ 0.
  • riskyAnnuity_eq, riskyAnnuity_pos: the constant-intensity risky annuity equals (1 − e^{−(r+λ)T})/(r+λ) when r + λ ≠ 0, and is positive for T > 0.
  • cdsLegs_balance_const: for T > 0, premium and protection legs at constant intensity balance if and only if c = cdsFairSpread λ R.
  • cumHazard_strictMono, cumHazard_surjOn_Ici: for h continuous and positive, the cumulative hazard is strictly increasing; if it also tends to ∞, it takes every value y ≥ 0 at some s ≥ 0.
  • cox_survival_timeVarying, cox_cdf_timeVarying: for h continuous, positive, with divergent cumulative hazard and a unit-exponential ξ, the Cox time satisfies P(τ > t) = e^{−Λ(t)} and P(τ ≤ a) = 1 − e^{−Λ(a)} for t, a ≥ 0.
  • measurable_coxDefaultTime: for h continuous and positive and ξ measurable, the Cox default time is measurable.
  • cox_defaultProb_density: under the same hypotheses, P(τ ≤ a) = ∫₀ᵃ h(s)·S(s) ds for a ≥ 0 (undiscounted).
  • cdsAnnuity_pos, cdsFairSpreadTV_balances: for h continuous and T > 0, the time-varying annuity is positive, and the premium and protection legs balance if and only if c = cdsFairSpreadTV r h R T.
  • cdsFairSpreadTV_const: for T > 0, the time-varying fair spread at constant intensity λ equals cdsFairSpread λ R; premiumLeg_const_intensity, protectionLeg_const_intensity: at constant intensity the legs are c · riskyAnnuity and (1 − R) · λ · riskyAnnuity.
  • cox_mixed_survival: on the product of a path space with an Exp(1) clock, for a measurable nonnegative Λ and a τ with t < τ ↔ Λ_t < clock, P(τ > t) = ∫ e^{−Λ_t} dμ₁.

Tags

Cox process, intensity model, default time, reduced-form credit, hazard rate, CDS fair spread, doubly stochastic, MSC 91G40, MSC 60G55, JEL G12

Import neighbourhood

Above: what it imports. Below: what imports it.

Declarations 34

theoremMathFin.Cox.defaultSurvival_constsource
∀ {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {rate : NNReal} {N : ℝ → Ω → ℕ}, (∀ (t : ℝ), Measurable (N t)) → (∀ (ω : Ω), N 0 ω = 0) → (∀ ⦃s t : ℝ⦄, 0 ≤ s → ∀ (hst : s ≤ t), Measure.map (fun ω => N t ω - N s ω) μ = poissonMeasure (rate * ⟨t - s, ⋯⟩)) → ∀ {τ : Ω → ℝ}, (∀ ⦃t : ℝ⦄, 0 ≤ t → {ω | t < τ ω} = {ω | N t ω = 0}) → ∀ {t : ℝ}, 0 ≤ t → μ {ω | t < τ ω} = ENNReal.ofReal (Real.exp (-(↑rate * t)))

Survival of the default time under constant intensity — the credit reading of the first-arrival survival law: under a rate-rate Poisson counting process, a default time τ characterized by τ > t ↔ N_t = 0 has P(τ > t) = e^{−rate·t}. Consumes PoissonInterarrival.survival_eq.

defMathFin.Cox.riskyAnnuitysource
ℝ → ℝ → ℝ → ℝ

The risky annuity at constant intensity lam and discount rate r: ∫₀ᵀ e^{−rs} e^{−lam·s} ds.

theoremMathFin.Cox.riskyAnnuity_eqsource
∀ (r lam T : ℝ), r + lam ≠ 0 → riskyAnnuity r lam T = (1 - Real.exp (-((r + lam) * T))) / (r + lam)

Closed form: ∫₀ᵀ e^{−(r+lam)s} ds = (1 − e^{−(r+lam)T}) / (r+lam).

theoremMathFin.Cox.riskyAnnuity_possource
∀ (r lam T : ℝ), 0 < T → 0 < riskyAnnuity r lam T

The risky annuity is positive for positive maturity (the integrand is strictly positive everywhere).

theoremMathFin.Cox.protectionLeg_constsource
∀ (r lam R T : ℝ), (1 - R) * ∫ (s : ℝ) in 0..T, Real.exp (-(r * s)) * (lam * Real.exp (-(lam * s))) = (1 - R) * lam * riskyAnnuity r lam T

Protection leg in closed form at constant intensity: (1−R) · ∫₀ᵀ e^{−rs} · (lam e^{−lam·s}) ds = (1−R) · lam · riskyAnnuity — the default density lam·e^{−lam·s} is the hazard times the survival, and it shares the annuity's kernel.

theoremMathFin.Cox.cdsLegs_balance_constsource
∀ (r lam R T c : ℝ), 0 < T → (c * riskyAnnuity r lam T = (1 - R) * lam * riskyAnnuity r lam T ↔ c = cdsFairSpread lam R)

Leg balance at constant intensity — the abstract annuity-factor characterization MathFin.cds_leg_equality realized at the concrete integral: the premium leg c · riskyAnnuity equals the protection leg (1−R) · lam · riskyAnnuity iff the spread is cdsFairSpread lam R = lam(1−R).

theoremMathFin.Cox.cdsFairSpread_const_balancessource
∀ (r lam R T : ℝ), 0 < T → cdsFairSpread lam R * riskyAnnuity r lam T = (1 - R) * lam * riskyAnnuity r lam T

The fair spread balances the legs (the "if" direction of the balance, checked against cdsFairSpread).

theoremMathFin.Cox.cumHazard_strictMonosource
∀ {h : ℝ → ℝ}, Continuous h → (∀ (s : ℝ), 0 < h s) → StrictMono (cumHazard h)

Under a continuous hazard intensity, strictly positive for all calendar time, the cumulative hazard is strictly increasing.

theoremMathFin.Cox.cumHazard_surjOn_Icisource
∀ {h : ℝ → ℝ}, Continuous h → (∀ (s : ℝ), 0 < h s) → Filter.Tendsto (cumHazard h) Filter.atTop Filter.atTop → ∀ (y : ℝ), 0 ≤ y → ∃ s, 0 ≤ s ∧ cumHazard h s = y

Under a continuous, strictly positive intensity with divergent cumulative hazard, Λ maps the half-line onto the half-line (IVT from Λ 0 = 0 and Λ → ∞).

theoremMathFin.Cox.expClock_Iicsource
∀ {x : ℝ}, 0 ≤ x → (expMeasure 1) (Set.Iic x) = ENNReal.ofReal (1 - Real.exp (-x))

CDF of the unit exponential clock: for ν = Exp(1) and x ≥ 0, ν(−∞, x] = 1 − e^{−x}.

theoremMathFin.Cox.expClock_Ioisource
∀ {x : ℝ}, 0 ≤ x → (expMeasure 1) (Set.Ioi x) = ENNReal.ofReal (Real.exp (-x))

Tail of the unit exponential clock: for ν = Exp(1) and x ≥ 0, ν(x, ∞) = e^{−x}.

theoremMathFin.Cox.expClock_null_negsource
∀ {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {ξ : Ω → ℝ}, Measurable ξ → Measure.map ξ μ = expMeasure 1 → μ {ω | ξ ω < 0} = 0

The unit exponential clock is almost surely nonnegative.

theoremMathFin.Cox.expClock_nonneg_aesource
∀ {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {ξ : Ω → ℝ}, Measurable ξ → Measure.map ξ μ = expMeasure 1 → ∀ᵐ (ω : Ω) ∂μ, 0 ≤ ξ ω

Almost-sure nonnegativity of the clock.

defMathFin.Cox.coxDefaultTimesource
{Ω : Type u_1} → (ℝ → ℝ) → (Ω → ℝ) → Ω → ℝ

The Cox default time (deterministic-intensity layer): invert a unit-exponential clock through the cumulative hazard Λ.

theoremMathFin.Cox.measurable_coxDefaultTimesource
∀ {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {h : ℝ → ℝ}, Continuous h → (∀ (s : ℝ), 0 < h s) → ∀ {ξ : Ω → ℝ}, Measurable ξ → Measurable (coxDefaultTime h ξ)

The Cox default time is measurable. Λ = cumHazard h is a continuous injection of ℝ, hence a measurable embedding (Continuous.measurableEmbedding), and Function.invFun Λ is Function.extend Λ id with a constant off the range of Λ, measurable by MeasurableEmbedding.measurable_extend. Divergence of Λ is not needed.

theoremMathFin.Cox.cox_survival_timeVaryingsource
∀ {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {h : ℝ → ℝ}, Continuous h → (∀ (s : ℝ), 0 < h s) → Filter.Tendsto (cumHazard h) Filter.atTop Filter.atTop → ∀ {ξ : Ω → ℝ}, Measurable ξ → Measure.map ξ μ = expMeasure 1 → ∀ {t : ℝ}, 0 ≤ t → μ {ω | coxDefaultTime h ξ ω > t} = ENNReal.ofReal (hazardSurvival h t)

The Cox survival identity, deterministic-intensity layer. With h continuous, strictly positive, and ∫₀ᵗ h → ∞, the default time built by inverting a unit-exponential clock through Λ = cumHazard h satisfies, for t ≥ 0, P(τ > t) = e^{−Λ(t)} = hazardSurvival h t — the first-arrival survival law at a deterministic time-varying intensity.

theoremMathFin.Cox.cox_cdf_timeVaryingsource
∀ {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {h : ℝ → ℝ}, Continuous h → (∀ (s : ℝ), 0 < h s) → Filter.Tendsto (cumHazard h) Filter.atTop Filter.atTop → ∀ {ξ : Ω → ℝ}, Measurable ξ → Measure.map ξ μ = expMeasure 1 → ∀ {a : ℝ}, 0 ≤ a → μ {ω | coxDefaultTime h ξ ω ≤ a} = 1 - ENNReal.ofReal (hazardSurvival h a)

The Cox CDF identity, deterministic-intensity layer: the same model satisfies P(τ ≤ a) = 1 − e^{−Λ(a)} for a ≥ 0.

defMathFin.Cox.cdsAnnuitysource
ℝ → (ℝ → ℝ) → ℝ → ℝ

The risky annuity (premium-leg kernel) under deterministic intensity h: ∫₀ᵀ e^{−rs} S(s) ds with S = hazardSurvival h.

defMathFin.Cox.cdsLossessource
ℝ → (ℝ → ℝ) → ℝ → ℝ

The default-density integral (protection-leg kernel) under deterministic intensity h: ∫₀ᵀ e^{−rs} h(s) S(s) ds.

defMathFin.Cox.premiumLegsource
ℝ → ℝ → (ℝ → ℝ) → ℝ → ℝ

The premium leg at spread c.

defMathFin.Cox.protectionLegsource
ℝ → ℝ → (ℝ → ℝ) → ℝ → ℝ

The protection leg at recovery R.

defMathFin.Cox.cdsFairSpreadTVsource
ℝ → (ℝ → ℝ) → ℝ → ℝ → ℝ

The time-varying fair spread: (1−R) · losses / annuity.

theoremMathFin.Cox.cdsAnnuity_possource
∀ {r : ℝ} {h : ℝ → ℝ}, Continuous h → ∀ {T : ℝ}, 0 < T → 0 < cdsAnnuity r h T

For continuous h, the risky annuity is positive for T > 0 (discount × survival is strictly positive; S > 0 unconditionally by hazardSurvival_pos).

theoremMathFin.Cox.defaultDensity_antiderivsource
∀ {h : ℝ → ℝ}, Continuous h → ∀ (a : ℝ), ∫ (s : ℝ) in 0..a, h s * Real.exp (-cumHazard h s) = 1 - Real.exp (-cumHazard h a)

The default density integrates to the default probability (pure calculus): ∫₀^a h·S = 1 − S(a) — the antiderivative of h·S is −S.

theoremMathFin.Cox.clockTail_eq_defaultDensitysource
∀ {h : ℝ → ℝ}, Continuous h → ∀ (a : ℝ), ∫ (y : ℝ) in 0..MathFin.cumHazard h a, Real.exp (-y) = ∫ (s : ℝ) in 0..a, h s * Real.exp (-cumHazard h s)

The clock-change identity: ∫₀^{Λ(a)} e^{−y} dy = ∫₀^a h(s) e^{−Λ(s)} ds — the exponential-clock integral equals the default-density integral. FTC on the shared antiderivative −e^{−Λ}; no change-of-variables lemma needed.

theoremMathFin.Cox.cdsFairSpreadTV_balancessource
∀ {r : ℝ} {h : ℝ → ℝ}, Continuous h → ∀ {T : ℝ}, 0 < T → ∀ (c R : ℝ), premiumLeg c r h T = protectionLeg R r h T ↔ c = cdsFairSpreadTV r h R T

Balance of the CDS legs under a time-varying intensity (the headline): the premium leg equals the protection leg iff the spread is the time-varying fair spread (1−R) · losses / annuity — a direct instantiation of the cash-flow balance cdsFairSpread_TV_cash_flow_balance at the concrete integrals, with annuity-positivity discharged via cdsAnnuity_pos.

theoremMathFin.Cox.cdsAnnuity_eq_riskyAnnuitysource
∀ (r lam T : ℝ), cdsAnnuity r (fun x => lam) T = riskyAnnuity r lam T

At constant intensity the time-varying annuity is the constant-intensity risky annuity (the survival curve specializes via hazardSurvival_eq_const_survival).

theoremMathFin.Cox.cdsLosses_eq_riskyAnnuity_mulsource
∀ (r lam T : ℝ), cdsLosses r (fun x => lam) T = lam * riskyAnnuity r lam T

At constant intensity the default-density integral is the hazard times the annuity — the constant-intensity protection-leg closed form.

theoremMathFin.Cox.cdsFairSpreadTV_constsource
∀ (r lam R T : ℝ), 0 < T → cdsFairSpreadTV r (fun x => lam) R T = cdsFairSpread lam R

The constant-λ case: the time-varying fair spread at a constant intensity collapses to the constant-hazard fair spread cdsFairSpread lam R = lam(1−R).

theoremMathFin.Cox.premiumLeg_const_intensitysource
∀ (c r lam T : ℝ), premiumLeg c r (fun x => lam) T = c * riskyAnnuity r lam T

The premium leg at constant intensity is the spread times the risky annuity: premiumLeg c r λ T = c · riskyAnnuity r λ T. The constant-intensity formulas of the first section are the legs of the time-varying CDS at a constant intensity.

theoremMathFin.Cox.protectionLeg_const_intensitysource
∀ (R r lam T : ℝ), protectionLeg R r (fun x => lam) T = (1 - R) * lam * riskyAnnuity r lam T

The protection leg at constant intensity is the loss rate times the risky annuity: protectionLeg R r λ T = (1 − R) · λ · riskyAnnuity r λ T.

theoremMathFin.Cox.cox_defaultProb_densitysource
∀ {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {h : ℝ → ℝ}, Continuous h → (∀ (s : ℝ), 0 < h s) → Filter.Tendsto (cumHazard h) Filter.atTop Filter.atTop → ∀ {ξ : Ω → ℝ}, Measurable ξ → Measure.map ξ μ = expMeasure 1 → ∀ {a : ℝ}, 0 ≤ a → μ {ω | coxDefaultTime h ξ ω ≤ a} = ENNReal.ofReal (∫ (s : ℝ) in 0..a, h s * hazardSurvival h s)

Default probability as the integral of the default density (deterministic-intensity Cox): for a ≥ 0 the constructed default time satisfies P(τ ≤ a) = ∫₀^a h·S. The discounted identity E[e^{−rτ}·1{τ ≤ a}] = ∫₀^a e^{−rs}h(s)S(s) ds is CVA.protectionLeg_eq_integral_coxDefaultTime (Models/Credit/CVA.lean).

theoremMathFin.Cox.cox_mixing_survivalsource
∀ {Ω₁ : Type u_1} {m₁ : MeasurableSpace Ω₁} {μ₁ : Measure Ω₁} {Λ : ℝ → Ω₁ → ℝ}, (∀ (t : ℝ), Measurable fun ω => Λ t ω) → (∀ (t : ℝ) (ω : Ω₁), 0 ≤ Λ t ω) → ∀ (t : ℝ), (μ₁.prod (expMeasure 1)) {p | Λ t p.1 < p.2} = ∫⁻ (ω : Ω₁), ENNReal.ofReal (Real.exp (-Λ t ω)) ∂μ₁

The restricted-Cox mixing identity — Fubini on the product of a path space with the unit-exponential-clock space: (μ₁ ⊗ Exp(1)){(ω, ξ) : Λ_t(ω) < ξ} = ∫ e^{−Λ_t} dμ₁ (by Measure.prod_apply), for any Λ ≥ 0 with measurable time sections. No default time, intensity or path regularity is involved; with τ hypothesized as the clock's crossing of Λ, it is the mixed survival P(τ > t) = E[e^{−Λ_t}] (cox_mixed_survival).

theoremMathFin.Cox.cox_mixed_survivalsource
∀ {Ω₁ : Type u_1} {m₁ : MeasurableSpace Ω₁} {μ₁ : Measure Ω₁} {τ : Ω₁ × ℝ → ℝ} {Λ : ℝ → Ω₁ → ℝ}, (∀ (t : ℝ), Measurable fun ω => Λ t ω) → (∀ (t : ℝ) (ω : Ω₁), 0 ≤ Λ t ω) → ∀ {t : ℝ}, (∀ (p : Ω₁ × ℝ), t < τ p ↔ Λ t p.1 < p.2) → (μ₁.prod (expMeasure 1)) {p | t < τ p} = ∫⁻ (ω : Ω₁), ENNReal.ofReal (Real.exp (-Λ t ω)) ∂μ₁

Mixed survival of a restricted-Cox default time: a τ on the product space whose survival event at the single time t is the clock beating Λ_t (hypothesis hτ) has survival P(τ > t) = E[e^{−Λ_t}] — cox_mixing_survival rewritten by hτ. Constructing such a τ would need paths of Λ that are continuous, strictly increasing and divergent with Λ(0) = 0; those are not assumed, and the construction is not done here.