Eq. (47), p. 554 — the tilted density maximises the Lagrangian; closed form of θ(λ₀, λ)
ProvedWorstCaseVaR.Entropy.dual_function_closed_formLet with , let , and , and write with indicator . Call a measure on admissible if it is finite, , and is -integrable (a density of finite relative entropy). For admissible define the Lagrangian
Let be the measure with density (Eq. 47), and
Then:
- is admissible and ;
- for every admissible ;
- .
So the dual function of the worst-case probability problem (46) is attained at the exponentially tilted density (47) and has the stated closed form.
Formalization Note The paper writes densities ; here is a finite measure and is Mathlib's log-likelihood ratio llr Q P₀. The paper's second line splits the integral over and , which overlap on a hyperplane; the Lean statement uses and its complement directly, so no null-set argument is needed.
import Mathlib import Definitions.Def_WorstCaseVaR_Entropy_Basic open MeasureTheory
namespace WorstCaseVaR.Entropy
/-- Eq. (47) and the closed form of the dual function, p. 554. Fix `λ > 0` and `λ₀ ∈ ℝ`, and
let `𝒮 = {x | γ ≤ -xᵀw}`. Over finite measures `Q ≪ P₀` with `P₀`-log-likelihood ratio
integrable against `Q` (densities `p` of finite relative entropy), the Lagrangian
`L(Q) = Q(𝒮) + λ₀(1 - Q(ℝⁿ)) + λ(d - ∫ log(dQ/dP₀) dQ)` is maximised by the tilted measure
`dQ*/dP₀ = exp((χ_𝒮 - λ₀)/λ - 1)`, and its maximum is
`λ₀ + λd + λ∫ exp((χ_𝒮 - λ₀)/λ - 1) dP₀ = λ₀ + λd + λe^{-λ₀/λ-1}((e^{1/λ} - 1)P₀(𝒮) + 1)`. -/
theorem dual_function_closed_form {n : ℕ} (xhat w : Returns n) (Γ : Matrix (Fin n) (Fin n) ℝ)
(hΓ : Γ.PosDef) (d γ lam0 lam : ℝ) (hlam : 0 < lam) :
let P₀ := refGaussian xhat Γ
let S := lossSet w γ
let L : Measure (Returns n) → ℝ := fun Q =>
Q.real S + lam0 * (1 - Q.real Set.univ) + lam * (d - ∫ x, llr Q P₀ x ∂Q)
let Admissible : Measure (Returns n) → Prop := fun Q =>
IsFiniteMeasure Q ∧ Q ≪ P₀ ∧ Integrable (llr Q P₀) Q
let Qstar : Measure (Returns n) :=
P₀.withDensity fun x => ENNReal.ofReal (Real.exp ((S.indicator 1 x - lam0) / lam - 1))
let θ : ℝ := lam0 + lam * d +
lam * Real.exp (-(lam0 / lam) - 1) * ((Real.exp (1 / lam) - 1) * P₀.real S + 1)
Admissible Qstar ∧ L Qstar = θ ∧ (∀ Q, Admissible Q → L Q ≤ θ) ∧
lam0 + lam * d + lam * ∫ x, Real.exp ((S.indicator 1 x - lam0) / lam - 1) ∂P₀ = θ := by sorry
end WorstCaseVaR.Entropy
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. Let and let . Let be a positive definite real matrix. Let be real numbers with . No condition is placed on , , or . Set:
- : the library's multivariate Gaussian with mean and covariance ;
- ;
- : the log-likelihood ratio. The Radon–Nikodym derivative is converted to a real number, with , and .
For a measure on define
The measures are taken as real numbers. The integral is the Lebesgue/Bochner integral, which is for non-integrable integrands.
Call admissible if all three of these hold:
- is a finite measure;
- ;
- is -integrable.
Let be the measure with density with respect to , and let
Conclusion. All four of the following hold:
- is admissible.
- .
- Every admissible satisfies .
- The integral form agrees with :
Degenerate cases.
- Zero measure. is admissible and has , so claim 3 includes .
- . This is allowed. is all of if and empty if , and the same holds for any when .
- . is one point, and is the empty matrix, which is positive definite.
- Integral convention. The integral in claim 4 uses the convention that a non-integrable integrand has integral .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.