Repository navigation
formal-mathfin v1.9.0
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
snellagrees almost surely with the library'ssnellEnvelope(snell_ae_eq_snellEnvelope, #415). frozen at the horizon, it is a MathlibSupermartingaleunder the coin-flip measure (supermartingale_snell). the Doob decomposition of the envelope moves toFoundations/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'sIsEMM.measure_eq_of_isCompleteMarketand the Brownian market'smeasure_eq_of_pricesGainsAtZeroare 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.payAtHitpays at Mathlib'shittingAfteron the observed path.Contract.FixedDatedmarks 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 isCox.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 priceexp(−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
ItoFormulaAdaptedDriftis 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) andIsAdaptedItoDrift, which adds the versionM. this covers the stack, Gyöngy and Dupire.clm_band_energyis Pythagoras for the martingale, next toitoProcessCLM_norm_sq. the two-band split andlp_two_norm_sqare each stated once.stepSum_pow4_lehas its own module. - weak uniqueness for the constant-coefficient forward equation (#429).
IsWeakForwardFlowis the uniqueness gategyongy_mimicry_gatedconsumes, andgyongy_mimicry_constdischarges 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, for0 < rand0 ≤ 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 atr = 0asr → 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β → 1andν → 0limits 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.
DiscreteVaRtakes aConvexity.StdSimplex, built with a newStdSimplex.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, Mathlib0434c03→e91b128, BrownianMotiona7ad7af→497e5e2. a project that requiresformal-mathfinneeds the same toolchain.
snell envelope and FTAP
stoppingValue_eq_bellman→stoppingValue_eq_integral_snellEnvelopeexpected_discrete_payoff_le_bellman→expected_discrete_payoff_le_snellEnvelopegridValue_eq_bellman→gridValue_eq_integral_snellEnvelopedelayedGrid_bellman_eq→delayedGrid_snellEnvelope_ae_eqMathFin.BlackScholes.AmericanPut.Stopping.snellEnvelope_doob_decompositionand.condExp_stoppedValue_le_snellEnvelope→MathFin.snellEnvelope_doob_decompositionandMathFin.condExp_stoppedValue_le_snellEnvelope- module
MathFin.Bridges.BellmanDoobDecomposition→MathFin.Foundations.SnellDoobDecomposition hqis now explicit insnellAux_ae_eq_snellEnvelopeAux,snell_ae_eq_snellEnvelope,snellEnvelope_discounted_bermudanPrice,PathAdaptedAt.integrable,indep_flip_flipFiltration,integral_flip_indicator,condExp_flipFiltration_succandmartingale_of_oneStep.ftap_twoandisCompleteMarket_of_uniquetake[Finite Ω], not[Fintype Ω].[Nonempty Ω]is no longer a section instance inFTAPDiscrete/FTAPComplete.- it is stated on
exists_isEMM_of_pos_dual,exists_isEMM_of_noArbitrage,ftap_discrete,isCompleteMarket_of_uniqueandftap_two; - it is dropped from
mem_gains_imp_predictable,gains_disjoint_stdSimplexandIsEMM.sum_mul_eq_zero_of_mem_gainsSubspace; gains_disjoint_stdSimplexalso loses[MeasurableSingletonClass Ω].
- it is stated on
exists_pos_separating_of_cone_disjoint_simplex,exists_pos_dual_of_disjoint_stdSimplexandgains_disjoint_stdSimplexstate "no probability vector lies inC" as∀ v, (∀ i, 0 ≤ v i) → ∑ i, v i = 1 → v ∉ C.representingSet_worstCaseandworstCase_isLUBuseConvexity.StdSimplex.IsEMM.measureReal_eq_of_replicatesremoved. its replacement isMathFin.measureReal_eq_of_replicates, which takes aQ-neutral gain and no EMM or strategy.
contracts and fixed income
Contracthas a new constructorpayAtHit.Contract.integrable_pathPV_of_boundedandBinomial.integrable_pathPVtake(hc : c.FixedDated).forwardMeasureand its API move toFoundations/ForwardMeasure. the Wiener forward-measure theorems move toFoundations/WienerIntegralForwardMeasure.FixedIncome/ForwardMeasurekeepsforwardMeasure_bs_expected_terminal. the names are unchanged.
stochastic calculus
- every drift-stack, Gyöngy and Dupire lemma takes
hD : IsAdaptedItoDrift hB hBmeas T δ Dd Min place ofhδ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_*.
incrementEnergyandtrueIncr_sq_ledrophMadap.clm_band_energymoves next toitoProcessCLM_norm_sq.ItoIntegralL2.lp_two_norm_sq, the Poisson-module copy andLp_real_two_norm_sq→MathFin.lp_two_norm_sq.- removed:
integral_mul_condExp_eq.stepSum_pow4_leis public, inFoundations/ItoStepSumFourthMoment. - module
MathFin.Foundations.ItoDriftMartingaleKillremoved (its content is inItoDriftIncrementEnergy).driftBlock_tendstotakeshBmeasexplicitly, first. expectation_pathIntegral_eq_of_aeis merged intoexpectation_pathIntegral_eq, which is now stated a.e.brownianInteriorRule_ito_representationconcludes≡ᵐ, oriented the way its caller uses it.- removed in favour of Mathlib:
integral_abs_mul_le_L2L2→integral_abs_mul_le_sqrt_mul_sqrtpow3_add_le→add_pow_lesqIntegral_of_Lpandintegral_sq_add- the private
1/(n+1)null sequences →tendsto_one_div_add_atTop_nhds_zero_nat
isLocalMartingale_congr_aetakesX ≡ᵐ[P] Y.MathFin.BlackScholes.AmericanPut.Stopping.localMartingale_of_ae_path_eqis removed in its favour.eLpNorm_mul_eqneedsgmeasurable.tendstoInMeasure_of_tendsto_integral_absdropshg'.increment_integrabledropshMand𝓕.
laws and integrability (the toolchain bump)
- removed:
integrable_exp_mul_of_hasLaw→HasLaw.integrable_fun_compwithintegrable_exp_mul_gaussianRealintegrable_of_hasLaw_gaussianReal→HasLaw.integrableintegrable_of_hasLaw_studentTMeasureandmemLp_two_of_hasLaw_rademacher, replaced by the newintegrable_id_studentTMeasureandmemLp_id_rademacherisProbabilityMeasure_map_const_mul, now an upstream instance
PoissonSuperpositiondropsindepFun_map_add_poissonMeasureand its re-export ofpoissonMeasure_conv_poissonMeasure. thepp-thm-3.3.9snippet usesHasLaw.signVariationsList→List.signVariations.
risk
covariance_le_sqrt_mul_sqrtandsqrt_variance_add_lemove toFoundations/FiniteMeasureCauchySchwarz, with the same names.sqrt_portfolioVarN_add_leis removed.DiscreteVaRchanges:finiteVaR,finiteES,finiteLaw,condTailMean,oneQandjointQtake aStdSimplex ℝ ι;finiteVaR_eq_valueAtRisk,finiteES_eq_expectedShortfall,finiteLaw_real_le,nonempty_values_mass_geandfiniteVaR_eq_value_mindrophq₀ hq₁;- removed:
oneQ_mem_simplex,jointQ_mem_simplexandisProbabilityMeasure_finiteLaw(now an instance); medianShortfall_eq_valueAtRiskdropshX.
[Fintype ι]→[Finite ι]inIsCoherentRiskMeasure.mono_of_le,.convexOn_univand.continuous, the acceptance-set lemmas,positions_of_negandisCoherentRiskMeasure_neg_iff.normalizedRate_sqrt_twomoves toBoundary/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(bothreduced_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_leas one lemma per idea;- the CDS premium leg as a contract;
- the Bermudan minimality theorems stated a.e.