Skip to content

formal-mathfin v1.9.0

Choose a tag to compare

@github-actions github-actions released this 05 Nov 04:46

This release closes the backlog the v1.8.0 audit left open, and moves the library to Lean v4.35.0, Mathlib e91b128 and BrownianMotion 497e5e2. three steps:

  • the backlog wave (#431), merged with leafyoung's last three PRs (#427, #428, #429);
  • the toolchain bump (#430);
  • the rest of #418 and the CDS half of #367, landed directly on main.

leafyoung's #325 and #423 are in too. thanks, Yang, for all five.

The corpus goes from 754 to 779 theorems, 744 of them full, 762 delivery-ready. there are still no sorries, and only the three standard axioms are used.

As in v1.8.0, nothing removed or renamed left an alias, so read the breaking changes if you import from MathFin.

what changed in the mathematics

no-arbitrage and the binomial tree

  • one Snell envelope. the tree's pathwise snell agrees almost surely with the library's snellEnvelope (snell_ae_eq_snellEnvelope, #415). frozen at the horizon, it is a Mathlib Supermartingale under the coin-flip measure (supermartingale_snell). the Doob decomposition of the envelope moves to Foundations/SnellDoobDecomposition.
  • FTAP II for the finite market and the tree (#415): with 𝓕 T = ⊤, under no arbitrage, the market is complete iff the EMM is unique (ftap_two, mf-ftap-two-discrete).
  • one replication argument (ReplicationPricing.measure_eq_of_replicates): two gains-neutral measures agree on every event whose indicator is replicated. the finite market's IsEMM.measure_eq_of_isCompleteMarket and the Brownian market's measure_eq_of_pricesGainsAtZero are its instances.
  • in the complete tree, the capital of the replication of a European contract is its Contract.value (exists_hedge_eq_value). this is for a single payment on the horizon step, and the strategy stays existential.

contracts, fixed income and credit

  • a payment at a random time. Contract.payAtHit pays at Mathlib's hittingAfter on the observed path. Contract.FixedDated marks the contracts whose integrability the bounded-model lemmas prove.
  • CDS protection as a contract paying at default (cdsProtectionAtDefault), for any default time and discount curve. its value is (1 − R)·𝔼[D(τ)·1{τ ≤ T}] as an identity of Bochner integrals. under the Cox default time at a flat rate it is Cox.protectionLeg, and the grid protection legs converge to it. the premium leg is not a contract: the tower has no continuous payment stream.
  • the Gaussian bond put is proved once, valueDisc_bondPut_wiener, for any integrated short rate in Wiener representation (#367). the Hull–White and GSR puts are its instances. the GSR put with σ₁ = σ₂ is the Vasicek put (valueDisc_bondPut_gsr_self). the Hull–White and GSR caplets get corpus entries.
  • the forward measure and the Wiener forward-measure law live in Foundations (Foundations/ForwardMeasure, Foundations/WienerIntegralForwardMeasure).
  • the Vasicek bond price as κ → 0⁺ tends to the driftless Gaussian bond price exp(−r₀T + σ²T³/6), with a cross-check through the Wiener bond-price lemma (#423).

stochastic calculus

  • the Itô stack is at C² (#416). the 4000-line ItoFormulaAdaptedDrift is split by stage, and the isometry files run on one kernel.
  • the drift stack's five threaded hypotheses are two structures: IsAdaptedIntegrand (δ adapted, continuous, bounded) and IsAdaptedItoDrift, which adds the version M. this covers the stack, Gyöngy and Dupire. clm_band_energy is Pythagoras for the martingale, next to itoProcessCLM_norm_sq. the two-band split and lp_two_norm_sq are each stated once. stepSum_pow4_le has its own module.
  • weak uniqueness for the constant-coefficient forward equation (#429). IsWeakForwardFlow is the uniqueness gate gyongy_mimicry_gated consumes, and gyongy_mimicry_const discharges it.

american put

  • the grid and sampling layer is one sampled filtration (#414), and the attained-value ⇔ martingale duality is one theorem.
  • the exercise boundary tends to the strike as time-to-expiry goes to 0, for 0 < r and 0 ≤ q ≤ r. the QD+ integrand's endpoint limit holds under differentiability of the boundary, and continuity alone is not enough (a 1/2-Hölder counterexample). the Ju–Zhong price has a limit-stable form that agrees with the direct one at every nonzero rate (as Lean transcriptions of the printed formulas), and, under the two nondegeneracy conditions the entry states, the direct form tends to the stable price at r = 0 as r → 0⁺ (#427).

black–scholes family, exotics

  • removable singularities: the Heston transform tends to the Black–Scholes MGF as vol-of-vol ξ → 0, and the Le Floc'h–Kennedy SABR terms have their β → 1 and ν → 0 limits at the transform as printed (#428).
  • Haug's partial-time barrier and Rubinstein–Reiner's binary barriers (#325), both reduced_core: they are transcribed closed forms with their in/out parities. the binary entry proves that the library's digital call contract is priced by the closed form.

risk

  • covariance Cauchy–Schwarz comes from the library's Hölder lemma, in Foundations. Gaussian VaR subadditivity is a corollary of it.
  • DiscreteVaR takes a Convexity.StdSimplex, built with a new StdSimplex.prod (not in Mathlib at the pin).

the toolchain bump (#430) consumes the new upstream API in place of the library's own copies:

  • HasLaw.integrable / .memLp / .integrable_fun_comp;
  • isLocalMartingale_congr_ae;
  • memLp_of_memLp_trim;
  • List.signVariations;
  • Convexity.StdSimplex.

breaking changes

no alias, deprecated or otherwise, was left for any removal or rename below. every caller in the library, the corpus, the README, the manual, MathFinTest/ and MathFinExamples/ moved.

toolchain

  • Lean v4.33.0-rc1 → v4.35.0, Mathlib 0434c03 → e91b128, BrownianMotion a7ad7af → 497e5e2. a project that requires formal-mathfin needs the same toolchain.

snell envelope and FTAP

  • stoppingValue_eq_bellman → stoppingValue_eq_integral_snellEnvelope
  • expected_discrete_payoff_le_bellman → expected_discrete_payoff_le_snellEnvelope
  • gridValue_eq_bellman → gridValue_eq_integral_snellEnvelope
  • delayedGrid_bellman_eq → delayedGrid_snellEnvelope_ae_eq
  • MathFin.BlackScholes.AmericanPut.Stopping.snellEnvelope_doob_decomposition and .condExp_stoppedValue_le_snellEnvelope → MathFin.snellEnvelope_doob_decomposition and MathFin.condExp_stoppedValue_le_snellEnvelope
  • module MathFin.Bridges.BellmanDoobDecomposition → MathFin.Foundations.SnellDoobDecomposition
  • hq is now explicit in snellAux_ae_eq_snellEnvelopeAux, snell_ae_eq_snellEnvelope, snellEnvelope_discounted_bermudanPrice, PathAdaptedAt.integrable, indep_flip_flipFiltration, integral_flip_indicator, condExp_flipFiltration_succ and martingale_of_oneStep.
  • ftap_two and isCompleteMarket_of_unique take [Finite Ω], not [Fintype Ω].
  • [Nonempty Ω] is no longer a section instance in FTAPDiscrete / FTAPComplete.
    • it is stated on exists_isEMM_of_pos_dual, exists_isEMM_of_noArbitrage, ftap_discrete, isCompleteMarket_of_unique and ftap_two;
    • it is dropped from mem_gains_imp_predictable, gains_disjoint_stdSimplex and IsEMM.sum_mul_eq_zero_of_mem_gainsSubspace;
    • gains_disjoint_stdSimplex also loses [MeasurableSingletonClass Ω].
  • exists_pos_separating_of_cone_disjoint_simplex, exists_pos_dual_of_disjoint_stdSimplex and gains_disjoint_stdSimplex state "no probability vector lies in C" as ∀ v, (∀ i, 0 ≤ v i) → ∑ i, v i = 1 → v ∉ C. representingSet_worstCase and worstCase_isLUB use Convexity.StdSimplex.
  • IsEMM.measureReal_eq_of_replicates removed. its replacement is MathFin.measureReal_eq_of_replicates, which takes a Q-neutral gain and no EMM or strategy.

contracts and fixed income

  • Contract has a new constructor payAtHit. Contract.integrable_pathPV_of_bounded and Binomial.integrable_pathPV take (hc : c.FixedDated).
  • forwardMeasure and its API move to Foundations/ForwardMeasure. the Wiener forward-measure theorems move to Foundations/WienerIntegralForwardMeasure. FixedIncome/ForwardMeasure keeps forwardMeasure_bs_expected_terminal. the names are unchanged.

stochastic calculus

  • every drift-stack, Gyöngy and Dupire lemma takes hD : IsAdaptedItoDrift hB hBmeas T δ Dd M in place of hδadap hδcont hδbdd hMadap hMeq. this covers:
    • martingale_M, memLp_M;
    • mul_trueIncr_expect_eq_zero;
    • quadraticSqSum_tendsto;
    • trueIncr_pow4_integrable, trueIncr_pow4_le, trueIncr_pow3_le;
    • taylorRemainderSum_tendsto, quadCrossSum_tendsto;
    • itoDrift_expectation_identity_adapted;
    • Dupire.dupire_*, Dupire.forward_eq_weak_zeroRate;
    • GyongyMimicry.gyongy_mimicry_*, marginal_flow_weak_equation_*, hitoid_constructed_*.
  • incrementEnergy and trueIncr_sq_le drop hMadap. clm_band_energy moves next to itoProcessCLM_norm_sq.
  • ItoIntegralL2.lp_two_norm_sq, the Poisson-module copy and Lp_real_two_norm_sq → MathFin.lp_two_norm_sq.
  • removed: integral_mul_condExp_eq. stepSum_pow4_le is public, in Foundations/ItoStepSumFourthMoment.
  • module MathFin.Foundations.ItoDriftMartingaleKill removed (its content is in ItoDriftIncrementEnergy). driftBlock_tendsto takes hBmeas explicitly, first.
  • expectation_pathIntegral_eq_of_ae is merged into expectation_pathIntegral_eq, which is now stated a.e.
  • brownianInteriorRule_ito_representation concludes ≡ᵐ, oriented the way its caller uses it.
  • removed in favour of Mathlib:
    • integral_abs_mul_le_L2L2 → integral_abs_mul_le_sqrt_mul_sqrt
    • pow3_add_le → add_pow_le
    • sqIntegral_of_Lp and integral_sq_add
    • the private 1/(n+1) null sequences → tendsto_one_div_add_atTop_nhds_zero_nat
  • isLocalMartingale_congr_ae takes X ≡ᵐ[P] Y. MathFin.BlackScholes.AmericanPut.Stopping.localMartingale_of_ae_path_eq is removed in its favour.
  • eLpNorm_mul_eq needs g measurable. tendstoInMeasure_of_tendsto_integral_abs drops hg'. increment_integrable drops hM and 𝓕.

laws and integrability (the toolchain bump)

  • removed:
    • integrable_exp_mul_of_hasLaw → HasLaw.integrable_fun_comp with integrable_exp_mul_gaussianReal
    • integrable_of_hasLaw_gaussianReal → HasLaw.integrable
    • integrable_of_hasLaw_studentTMeasure and memLp_two_of_hasLaw_rademacher, replaced by the new integrable_id_studentTMeasure and memLp_id_rademacher
    • isProbabilityMeasure_map_const_mul, now an upstream instance
  • PoissonSuperposition drops indepFun_map_add_poissonMeasure and its re-export of poissonMeasure_conv_poissonMeasure. the pp-thm-3.3.9 snippet uses HasLaw.
  • signVariationsList → List.signVariations.

risk

  • covariance_le_sqrt_mul_sqrt and sqrt_variance_add_le move to Foundations/FiniteMeasureCauchySchwarz, with the same names. sqrt_portfolioVarN_add_le is removed.
  • DiscreteVaR changes:
    • finiteVaR, finiteES, finiteLaw, condTailMean, oneQ and jointQ take a StdSimplex ℝ ι;
    • finiteVaR_eq_valueAtRisk, finiteES_eq_expectedShortfall, finiteLaw_real_le, nonempty_values_mass_ge and finiteVaR_eq_value_min drop hq₀ hq₁;
    • removed: oneQ_mem_simplex, jointQ_mem_simplex and isProbabilityMeasure_finiteLaw (now an instance);
    • medianShortfall_eq_valueAtRisk drops hX.
  • [Fintype ι] → [Finite ι] in IsCoherentRiskMeasure.mono_of_le, .convexOn_univ and .continuous, the acceptance-set lemmas, positions_of_neg and isCoherentRiskMeasure_neg_iff.
  • normalizedRate_sqrt_two moves to Boundary/Problem.

corpus

779 theorems: 744 full, 18 library_wrapper, 17 reduced_core, no placeholders, 762 delivery-ready (v1.8.0: 754). 25 new entries, none removed:

  • no-arbitrage and binomial:
    • mf-ftap-two-discrete, mf-replication-determines-pricing-measure;
    • mf-binomial-multi-period-complete, mf-binomial-complete-hedge-capital-is-value;
    • mf-binomial-snell-is-snell-envelope, mf-binomial-snell-supermartingale.
  • contracts:
    • mf-contract-bond-put-gsr, mf-contract-bond-put-gsr-vasicek;
    • mf-contract-caplet-hullwhite, mf-contract-caplet-gsr;
    • mf-contract-cds-protection-at-default, mf-contract-cds-protection-grid-limit.
  • rates: mf-vasicek-zero-meanreversion-limit, mf-vasicek-zero-meanreversion-crosscheck.
  • american put: mf-american-put-boundary-expiry-limit, mf-qdplus-k12-endpoint-differentiable, mf-qdplus-k12-endpoint-differentiability-tight, mf-ju-zhong-raw-eq-stable, mf-ju-zhong-zero-rate-limit.
  • black–scholes family: mf-heston-small-vol-of-vol-blackscholes-limit, mf-sabr-fk-y-beta-one-limit, mf-sabr-fk-omega0-nu-zero-limit.
  • exotics: mf-partial-time-barrier-down-add-up, mf-binary-barrier-inout-parity (both reduced_core).
  • stochastic calculus: mf-weak-forward-uniqueness-const.

the ledger sweep now sizes its shard matrix to the number of stale entries. lint now reads private lemmas too.

left for later, recorded in docs/values-review.md (2026-11-05):

  • stepSum_pow4_le as one lemma per idea;
  • the CDS premium leg as a contract;
  • the Bermudan minimality theorems stated a.e.