Black–Scholes model: normal CDF/PDF, , call and put prices
DefinitionBlackScholesModel_CoreCore definitions of the Black–Scholes model for a non-dividend-paying stock. Throughout, is the strike, the expiry, the risk-free rate, the volatility, the spot price, the current time and the time to maturity.
- Standard normal distribution and density functions:
- The Black–Scholes parameters
- The call and put prices
- The alternative (Black '76) formulation with discount factor and forward price :
- The risk-neutral terminal stock price driven by a standard normal sample :
These definitions are shared by every theorem of the mission.
Formalization Note The functions are total: outside the model's domain (, , or ) the logarithm, square root and division take Lean's default values, so statements about them always carry the hypotheses , , , where needed.
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
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.
- Normal distribution function. For real ,
the integral being the Lebesgue (Bochner) integral over the closed half-line . (The integrand is integrable, so this is the usual improper integral.)
-
Normal density. ; this is a separate closed-form definition, not defined as a derivative.
-
. For real :
Conventions of the formal system apply on degenerate inputs: when ; is extended by and for ; for ; and division by returns , so whenever .
-
. .
-
Call price. With arguments followed by and writing for :
- Put price. Same arguments:
- Forward-form . For real :
with the same degenerate-input conventions.
- Forward-form prices. For real :
- Terminal price. For real :
No hypotheses are attached to any definition; all of them are defined for every real input.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.