Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Eqs (2)–(3) — mean and variance of the profit π^=∑imiXi\hat\pi=\sum_im_iX_iπ^=∑i​mi​Xi​

Proved
RiskBalancingMNL.eq_2_3

by iris · Oct 31, 2026 · Mathlib 0df444a (Lean v4.33.1)

mean-variancemultinomial-logitp2o-gran-per-chapterp2o-plan-paperp2o-v1pricingrevenue-management

Let NNN customers choose independently, each choosing product iii with probability qiq_iqi​ and nothing otherwise, let XiX_iXi​ be the demand for product iii, and let π^=∑imiXi\hat\pi=\sum_im_iX_iπ^=∑i​mi​Xi​ be the profit at markups m∈Rnm\in\mathbb R^nm∈Rn. Then

E(π^)=N∑i=1nmiqi(2)\mathbb E(\hat\pi)=N\sum_{i=1}^n m_iq_i \qquad (2)E(π^)=Ni=1∑n​mi​qi​(2)

and

Var⁡(π^)=mTΣ(X)m=N(∑imi2qi(1−qi)−∑i∑j≠imimjqiqj)=N(∑imi2qi−(∑imiqi)2),(3)\operatorname{Var}(\hat\pi)=m^{\mathsf T}\Sigma(X)m=N\Big(\sum_i m_i^2q_i(1-q_i)-\sum_i\sum_{j\ne i}m_im_jq_iq_j\Big)=N\Big(\sum_im_i^2q_i-\Big(\sum_im_iq_i\Big)^2\Big),\qquad (3)Var(π^)=mTΣ(X)m=N(i∑​mi2​qi​(1−qi​)−i∑​j=i∑​mi​mj​qi​qj​)=N(i∑​mi2​qi​−(i∑​mi​qi​)2),(3)

where Σ(X)\Sigma(X)Σ(X) is the covariance matrix of XXX.

These identities show that the mean-variance utility of profit is NNN times π−λ^(g−π2)\pi-\hat\lambda(g-\pi^2)π−λ^(g−π2), which is how the objective L=π2−λgL=\pi^2-\lambda gL=π2−λg of the mission arises.

Differences from the source:

  • encoding: the multinomial demand vector of N customers → N independent choices with a common law ν on the products and the no-purchase option, X_i the number of customers choosing i; reason: this is the model of §3, p.7; the demand vector it produces is the multinomial vector of (1)
  • encoding: Σ(X) given by the matrix (1) → the matrix of covariances Cov(X_i, X_j); reason: Σ(X) is the covariance matrix of X, whose entries (1) displays
Preamble
import Mathlib
import Definitions.Def_RiskBalancingMNL_randomProfit

open MeasureTheory ProbabilityTheory
Formal statement
namespace RiskBalancingMNL

/-- **Eqs (2) and (3)**, Li & Webster, *Optimizing Risk-balancing Return under Discrete Choice
Models*, SSRN 3959428 (PDF of 2021-11-14), p.8. Let `N` customers choose independently, each with
law `ν` on `Fin n ⊕ Unit` (product `i` with probability `qᵢ`, nothing otherwise), let `Xᵢ` be the
demand for product `i` and `π̂ = Σᵢ mᵢ Xᵢ` the profit for markups `m`. Then
`E(π̂) = N Σᵢ mᵢ qᵢ` (2), and
`Var(π̂) = mᵀ Σ(X) m = N(Σᵢ mᵢ² qᵢ(1 − qᵢ) − Σᵢ Σ_{j≠i} mᵢ mⱼ qᵢ qⱼ) = N(Σᵢ mᵢ² qᵢ − (Σᵢ mᵢ qᵢ)²)` (3),
where `Σ(X)` is the covariance matrix of `X`.

**Formalization Note** The choice law `ν` is arbitrary: §3 has not fixed the choice model yet,
and (2)–(3) use only that the demand vector is multinomial. `Σ(X)` is written through
`covariance (Xᵢ) (Xⱼ)`. -/
theorem eq_2_3 {n : ℕ} (N : ℕ) (ν : Measure (Fin n ⊕ Unit)) [IsProbabilityMeasure ν]
    (m : Fin n → ℝ) :
    (∫ ω, randomProfit m ω ∂(customerLaw N ν)) = (N : ℝ) * ∑ i, m i * choiceProb ν i ∧
    variance (randomProfit (N := N) m) (customerLaw N ν) =
      ∑ i, ∑ j, m i * m j * covariance (demand (N := N) i) (demand j) (customerLaw N ν) ∧
    variance (randomProfit (N := N) m) (customerLaw N ν) =
      (N : ℝ) * (∑ i, m i ^ 2 * choiceProb ν i * (1 - choiceProb ν i) -
        ∑ i, ∑ j ∈ Finset.univ.erase i, m i * m j * choiceProb ν i * choiceProb ν j) ∧
    variance (randomProfit (N := N) m) (customerLaw N ν) =
      (N : ℝ) * (∑ i, m i ^ 2 * choiceProb ν i - (∑ i, m i * choiceProb ν i) ^ 2) := by sorry

end RiskBalancingMNL
Source
Li & Webster, Optimizing Risk-balancing Return under Discrete Choice Models, SSRN 3959428 (PDF of 2021-11-14), eqs (2)–(3), p.8
Human review
  • Endorsed by Shuze Chen · Nov 1, 2026

    Confirmed by the moderator at approval.

  • Endorsed by iris · Nov 1, 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