Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Black–Scholes model: normal CDF/PDF, d±d_\pmd±​, call and put prices

Definition
BlackScholesModel_Core

by Lucas · Oct 9, 2026 · Mathlib 0df444a (Lean v4.33.1)

black-scholesmathematical-financeoption-pricing

Core definitions of the Black–Scholes model for a non-dividend-paying stock. Throughout, KKK is the strike, TTT the expiry, rrr the risk-free rate, σ\sigmaσ the volatility, SSS the spot price, ttt the current time and τ=T−t\tau=T-tτ=T−t the time to maturity.

  1. Standard normal distribution and density functions:
N(x)=12π∫−∞xe−z2/2 dz,N′(x)=12πe−x2/2.N(x)=\frac1{\sqrt{2\pi}}\int_{-\infty}^x e^{-z^2/2}\,dz,\qquad N'(x)=\frac1{\sqrt{2\pi}}e^{-x^2/2}.N(x)=2π​1​∫−∞x​e−z2/2dz,N′(x)=2π​1​e−x2/2.
  1. The Black–Scholes parameters
d+=ln⁡(S/K)+(r+σ2/2)τστ,d−=d+−στ.d_+=\frac{\ln(S/K)+(r+\sigma^2/2)\tau}{\sigma\sqrt\tau},\qquad d_-=d_+-\sigma\sqrt\tau .d+​=στ​ln(S/K)+(r+σ2/2)τ​,d−​=d+​−στ​.
  1. The call and put prices
C(S,t)=N(d+)S−N(d−)Ke−r(T−t),P(S,t)=N(−d−)Ke−r(T−t)−N(−d+)S.C(S,t)=N(d_+)S-N(d_-)Ke^{-r(T-t)},\qquad P(S,t)=N(-d_-)Ke^{-r(T-t)}-N(-d_+)S .C(S,t)=N(d+​)S−N(d−​)Ke−r(T−t),P(S,t)=N(−d−​)Ke−r(T−t)−N(−d+​)S.
  1. The alternative (Black '76) formulation with discount factor DDD and forward price FFF:
d±=ln⁡(F/K)±σ2τ/2στ,C(F,τ)=D [N(d+)F−N(d−)K],P(F,τ)=D [N(−d−)K−N(−d+)F].d_\pm=\frac{\ln(F/K)\pm\sigma^2\tau/2}{\sigma\sqrt\tau},\qquad C(F,\tau)=D\,[N(d_+)F-N(d_-)K],\qquad P(F,\tau)=D\,[N(-d_-)K-N(-d_+)F].d±​=στ​ln(F/K)±σ2τ/2​,C(F,τ)=D[N(d+​)F−N(d−​)K],P(F,τ)=D[N(−d−​)K−N(−d+​)F].
  1. The risk-neutral terminal stock price driven by a standard normal sample zzz:
ST(z)=Sexp⁡((r−σ22)τ+στ z).S_T(z)=S\exp\Big(\big(r-\tfrac{\sigma^2}2\big)\tau+\sigma\sqrt\tau\,z\Big).ST​(z)=Sexp((r−2σ2​)τ+στ​z).

These definitions are shared by every theorem of the mission.

Formalization Note The functions are total: outside the model's domain (S≤0S\le0S≤0, K≤0K\le0K≤0, σ≤0\sigma\le0σ≤0 or τ≤0\tau\le0τ≤0) the logarithm, square root and division take Lean's default values, so statements about them always carry the hypotheses K>0K>0K>0, σ>0\sigma>0σ>0, S>0S>0S>0, t<Tt<Tt<T where needed.

Definition code
import Mathlib

namespace BlackScholesModel

open Real MeasureTheory

/-- The standard normal cumulative distribution function
`N(x) = (1/√(2π)) ∫_{-∞}^x e^{-z²/2} dz`. -/
noncomputable def stdNormalCDF (x : ℝ) : ℝ :=
  (1 / Real.sqrt (2 * Real.pi)) * ∫ z in Set.Iic x, Real.exp (-z ^ 2 / 2)

/-- The standard normal probability density function `N'(x) = (1/√(2π)) e^{-x²/2}`. -/
noncomputable def stdNormalPDF (x : ℝ) : ℝ :=
  (1 / Real.sqrt (2 * Real.pi)) * Real.exp (-x ^ 2 / 2)

/-- `d₊ = (ln(S/K) + (r + σ²/2) τ) / (σ √τ)`, where `τ = T - t` is the time to maturity. -/
noncomputable def dPlus (S K r σ τ : ℝ) : ℝ :=
  (Real.log (S / K) + (r + σ ^ 2 / 2) * τ) / (σ * Real.sqrt τ)

/-- `d₋ = d₊ - σ √τ`. -/
noncomputable def dMinus (S K r σ τ : ℝ) : ℝ :=
  dPlus S K r σ τ - σ * Real.sqrt τ

/-- Black–Scholes price at time `t` of a European call with strike `K`, expiry `T`,
risk-free rate `r` and volatility `σ`, on a non-dividend-paying stock with spot price `S`:
`C(S, t) = N(d₊) S - N(d₋) K e^{-r(T-t)}`. -/
noncomputable def callPrice (K r σ T : ℝ) (S t : ℝ) : ℝ :=
  stdNormalCDF (dPlus S K r σ (T - t)) * S
    - stdNormalCDF (dMinus S K r σ (T - t)) * K * Real.exp (-r * (T - t))

/-- Black–Scholes price at time `t` of the corresponding European put:
`P(S, t) = N(-d₋) K e^{-r(T-t)} - N(-d₊) S`. -/
noncomputable def putPrice (K r σ T : ℝ) (S t : ℝ) : ℝ :=
  stdNormalCDF (-dMinus S K r σ (T - t)) * K * Real.exp (-r * (T - t))
    - stdNormalCDF (-dPlus S K r σ (T - t)) * S

/-- Forward-form `d₊ = (ln(F/K) + σ² τ / 2) / (σ √τ)` (Black '76 parameters). -/
noncomputable def dPlusFwd (F K σ τ : ℝ) : ℝ :=
  (Real.log (F / K) + σ ^ 2 * τ / 2) / (σ * Real.sqrt τ)

/-- Forward-form `d₋ = d₊ - σ √τ`. -/
noncomputable def dMinusFwd (F K σ τ : ℝ) : ℝ :=
  dPlusFwd F K σ τ - σ * Real.sqrt τ

/-- Call value in the alternative (Black '76) formulation:
`C(F, τ) = D [N(d₊) F - N(d₋) K]`, with discount factor `D` and forward price `F`. -/
noncomputable def callPriceFwd (D F K σ τ : ℝ) : ℝ :=
  D * (stdNormalCDF (dPlusFwd F K σ τ) * F - stdNormalCDF (dMinusFwd F K σ τ) * K)

/-- Put value in the alternative (Black '76) formulation:
`P(F, τ) = D [N(-d₋) K - N(-d₊) F]`. -/
noncomputable def putPriceFwd (D F K σ τ : ℝ) : ℝ :=
  D * (stdNormalCDF (-dMinusFwd F K σ τ) * K - stdNormalCDF (-dPlusFwd F K σ τ) * F)

/-- Risk-neutral terminal stock price, as a function of a standard normal sample `z`:
`S_T = S exp((r - σ²/2) τ + σ √τ z)`. -/
noncomputable def terminalPrice (S r σ τ : ℝ) (z : ℝ) : ℝ :=
  S * Real.exp ((r - σ ^ 2 / 2) * τ + σ * Real.sqrt τ * z)

end BlackScholesModel
Source
Wikipedia, "Black–Scholes model" (snapshot supplied as Black–Scholes_model.pdf, 22 pp.), https://en.wikipedia.org/wiki/Black%E2%80%93Scholes_model; p. 3 (Notation), pp. 3–5 (Black–Scholes formula, Alternative formulation), p. 6 (risk-neutral stock price)
Read-back

What the Lean code literally says, in plain math · Aristotle (Harmonic)

Non-blind read-back. This read-back was written by the same agent that drafted the Lean statement (at the explicit instruction of the proposal owner), not by an independent blind auditor. It is not independent testimony; reviewers should compare it against the Lean code themselves.

The file defines, inside the namespace BlackScholesModel, the following real-valued functions of real arguments.

  1. Normal distribution function. For real xxx,
N(x)=12π∫(−∞,x]e−z2/2 dz,N(x)=\frac{1}{\sqrt{2\pi}}\int_{(-\infty,x]} e^{-z^2/2}\,dz,N(x)=2π​1​∫(−∞,x]​e−z2/2dz,

the integral being the Lebesgue (Bochner) integral over the closed half-line (−∞,x](-\infty,x](−∞,x]. (The integrand is integrable, so this is the usual improper integral.)

  1. Normal density. N′(x)=12πe−x2/2N'(x)=\frac{1}{\sqrt{2\pi}}e^{-x^2/2}N′(x)=2π​1​e−x2/2; this is a separate closed-form definition, not defined as a derivative.

  2. d+d_+d+​. For real S,K,r,σ,τS,K,r,\sigma,\tauS,K,r,σ,τ:

d+(S,K,r,σ,τ)=ln⁡(S/K)+(r+σ2/2)τστ.d_+(S,K,r,\sigma,\tau)=\frac{\ln(S/K)+(r+\sigma^2/2)\tau}{\sigma\sqrt{\tau}}.d+​(S,K,r,σ,τ)=στ​ln(S/K)+(r+σ2/2)τ​.

Conventions of the formal system apply on degenerate inputs: S/K=0S/K=0S/K=0 when K=0K=0K=0; ln⁡\lnln is extended by ln⁡0=0\ln 0=0ln0=0 and ln⁡x=ln⁡∣x∣\ln x=\ln|x|lnx=ln∣x∣ for x<0x<0x<0; τ=0\sqrt{\tau}=0τ​=0 for τ≤0\tau\le0τ≤0; and division by 000 returns 000, so d+=0d_+=0d+​=0 whenever στ=0\sigma\sqrt\tau=0στ​=0.

  1. d−d_-d−​. d−(S,K,r,σ,τ)=d+(S,K,r,σ,τ)−στd_-(S,K,r,\sigma,\tau)=d_+(S,K,r,\sigma,\tau)-\sigma\sqrt{\tau}d−​(S,K,r,σ,τ)=d+​(S,K,r,σ,τ)−στ​.

  2. Call price. With arguments (K,r,σ,T)(K,r,\sigma,T)(K,r,σ,T) followed by (S,t)(S,t)(S,t) and writing d±d_\pmd±​ for d±(S,K,r,σ,T−t)d_\pm(S,K,r,\sigma,T-t)d±​(S,K,r,σ,T−t):

C(S,t)=N(d+) S−N(d−) K e−r(T−t).C(S,t)=N(d_+)\,S-N(d_-)\,K\,e^{-r(T-t)}.C(S,t)=N(d+​)S−N(d−​)Ke−r(T−t).
  1. Put price. Same arguments:
P(S,t)=N(−d−) K e−r(T−t)−N(−d+) S.P(S,t)=N(-d_-)\,K\,e^{-r(T-t)}-N(-d_+)\,S.P(S,t)=N(−d−​)Ke−r(T−t)−N(−d+​)S.
  1. Forward-form d±d_\pmd±​. For real F,K,σ,τF,K,\sigma,\tauF,K,σ,τ:
d~+(F,K,σ,τ)=ln⁡(F/K)+σ2τ/2στ,d~−=d~+−στ,\tilde d_+(F,K,\sigma,\tau)=\frac{\ln(F/K)+\sigma^2\tau/2}{\sigma\sqrt\tau},\qquad \tilde d_-=\tilde d_+-\sigma\sqrt\tau,d~+​(F,K,σ,τ)=στ​ln(F/K)+σ2τ/2​,d~−​=d~+​−στ​,

with the same degenerate-input conventions.

  1. Forward-form prices. For real D,F,K,σ,τD,F,K,\sigma,\tauD,F,K,σ,τ:
C~(D,F,K,σ,τ)=D(N(d~+)F−N(d~−)K),P~(D,F,K,σ,τ)=D(N(−d~−)K−N(−d~+)F).\tilde C(D,F,K,\sigma,\tau)=D\big(N(\tilde d_+)F-N(\tilde d_-)K\big),\qquad \tilde P(D,F,K,\sigma,\tau)=D\big(N(-\tilde d_-)K-N(-\tilde d_+)F\big).C~(D,F,K,σ,τ)=D(N(d~+​)F−N(d~−​)K),P~(D,F,K,σ,τ)=D(N(−d~−​)K−N(−d~+​)F).
  1. Terminal price. For real S,r,σ,τ,zS,r,\sigma,\tau,zS,r,σ,τ,z:
ST(S,r,σ,τ;z)=Sexp⁡((r−σ2/2)τ+στ z).S_T(S,r,\sigma,\tau;z)=S\exp\big((r-\sigma^2/2)\tau+\sigma\sqrt\tau\,z\big).ST​(S,r,σ,τ;z)=Sexp((r−σ2/2)τ+στ​z).

No hypotheses are attached to any definition; all of them are defined for every real input.

Human review
  • Endorsed by Shuze Chen · Oct 10, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Lucas · Oct 10, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me