For p ∈ (0, 1), the p-quantile of N(m, v) is m + √v · Φ⁻¹(p), where Φ⁻¹ is the standard normal quantile function.
↑(cdf (gaussianReal 0 1)) = Phi
The CDF of the standard normal law is Φ.
Φ⁻¹ is the quantile function of the standard normal law (PhiInv). Mathlib has no inverse of the normal CDF, so the library's Gaussian risk closed forms (Risk/Gaussian.lean) were written in a quantile parameter z with Φ(z) = α. Here the parameter becomes a function of the level.
Because Φ is continuous and strictly increasing, the generalized inverse of Probability/Laws/Quantile.lean is a two-sided inverse: Φ (Φ⁻¹ p) = p on (0, 1) and Φ⁻¹ (Φ x) = x for every x. The quantile of a general Gaussian law then follows from equivariance under the affine map z ↦ m + σ z (quantile_gaussianReal).
PhiInv: the standard normal quantile function Φ⁻¹, the generalized inverse of Φ.continuous_Phi, strictMono_Phi, Phi_mem_Ioo: Φ is continuous, strictly increasing and takes values in (0, 1). Its automation: continuous_Phi and measurable_Phi are fun_prop lemmas, Phi_lt_Phi / Phi_le_Phi are gcongr lemmas, and positivity proves 0 < Φ x (Phi_pos, evalPhi).Phi_PhiInv, PhiInv_Phi: the two inverse identities.PhiInv_one_sub: symmetry, Φ⁻¹(1 − p) = −Φ⁻¹(p).PhiInv_nonneg_iff, PhiInv_pos_iff: Φ⁻¹(p) has the sign of p − 1/2.quantile_gaussianReal: the p-quantile of N(m, σ²) is m + σ Φ⁻¹(p).inverse normal CDF, probit function, Gaussian quantile, normal percentile, value-at-risk quantile, MSC 60E05, MSC 62G30
Above: what it imports. Below: what imports it.
For p ∈ (0, 1), the p-quantile of N(m, v) is m + √v · Φ⁻¹(p), where Φ⁻¹ is the standard normal quantile function.
↑(cdf (gaussianReal 0 1)) = Phi
The CDF of the standard normal law is Φ.
Continuous Phi
Φ is continuous.
Measurable Phi
Φ is measurable.
StrictMono Phi
Φ is strictly increasing: its derivative, the normal density, is positive.
∀ (x : ℝ), Phi x ∈ Set.Ioo 0 1
Φ takes values in the open unit interval.
∀ (x : ℝ), 0 < Phi x
Φ is positive. positivity proves it (evalPhi).
∀ {x y : ℝ}, x < y → Phi x < Phi yΦ is strictly increasing, in the form gcongr uses.
∀ {x y : ℝ}, x ≤ y → Phi x ≤ Phi yΦ is increasing, in the form gcongr uses.
Phi 0 = 1 / 2
Φ(0) = 1/2, by symmetry.
ℝ → ℝ
The standard normal quantile function Φ⁻¹.
∀ {p x : ℝ}, p ∈ Set.Ioo 0 1 → (PhiInv p ≤ x ↔ p ≤ Phi x)The Galois connection for Φ⁻¹: Φ⁻¹(p) ≤ x ↔ p ≤ Φ(x).
∀ {p x : ℝ}, p ∈ Set.Ioo 0 1 → (x < PhiInv p ↔ Phi x < p)x < Φ⁻¹(p) ↔ Φ(x) < p.
∀ {p : ℝ}, p ∈ Set.Ioo 0 1 → Phi (PhiInv p) = pΦ ∘ Φ⁻¹ is the identity on (0, 1).
∀ (x : ℝ), PhiInv (Phi x) = x
Φ⁻¹ ∘ Φ is the identity.
StrictMonoOn PhiInv (Set.Ioo 0 1)
Φ⁻¹ is strictly increasing on (0, 1).
∀ {p : ℝ}, p ∈ Set.Ioo 0 1 → PhiInv (1 - p) = -PhiInv pSymmetry of the normal quantile: Φ⁻¹(1 − p) = −Φ⁻¹(p).
PhiInv (1 / 2) = 0
The median of the standard normal law is 0.
∀ {p : ℝ}, p ∈ Set.Ioo 0 1 → (0 ≤ PhiInv p ↔ 1 / 2 ≤ p)Φ⁻¹(p) ≥ 0 exactly when p ≥ 1/2.
∀ {p : ℝ}, p ∈ Set.Ioo 0 1 → (0 < PhiInv p ↔ 1 / 2 < p)Φ⁻¹(p) > 0 exactly when p > 1/2.
∀ (m : ℝ) (v : NNReal), gaussianReal m v = Measure.map (fun z => √↑v * z + m) (gaussianReal 0 1)
Every Gaussian law is an affine image of the standard one: N(m, v) = (z ↦ √v · z + m)_* N(0, 1).
∀ {p : ℝ} (m : ℝ) (v : NNReal), p ∈ Set.Ioo 0 1 → quantile (gaussianReal m v) p = m + √↑v * PhiInv pThe quantile of a Gaussian law: the p-quantile of N(m, v) is m + √v · Φ⁻¹(p).
Mathlib.Meta.Positivity.PositivityExt
Extension for the positivity tactic: the standard normal CDF Φ is positive.