The 2-asset Sharpe-ratio file (Choice/Portfolio/SharpeFOCDerivation.lean) derives the cross-product FOC r₂(Σw)₁ = r₁(Σw)₂ from d(Sh²)/dw = 0. This file extends the first-principles derivation to N assets, but for the constrained variance minimization formulation — which is the textbook Markowitz statement and gives the canonical Lagrangian FOC Σw = lam_1 · 1 + lam_2 · μ.
The problem
Minimize (1/2) · w^T Σ w (portfolio variance) subject to
1^T w = 1 (budget constraint),μ^T w = m (expected-return target).
The Lagrangian
L(w, lam_1, lam_2) := (1/2) · w^T Σ w − lam_1 · (1^T w − 1) − lam_2 · (μ^T w − m).
The FOC (textbook derivation)
∂L/∂w_i = (Σw)_i − lam_1 − lam_2 · μ_i = 0, i.e., Σw = lam_1 · 1 + lam_2 · μ.
This says the marginal variance vector lies in the 2-d span of the constraint normals — the canonical "two-fund separation" structural fact.
Variational characterisation
A portfolio w is a constrained variance critical point if for every admissible perturbation δw (orthogonal to budget and expected-return normals, i.e., 1^T δw = 0 and μ^T δw = 0),
(Σw)^T δw = 0.
For symmetric Σ this is the vanishing of d/dt [(1/2) (w + t δw)^T Σ (w + t δw)] |_{t=0}: quadratic_form_perturb_linear_coeff identifies (Σw)^T δw as the linear coefficient of that polynomial in t (no derivative statement is proved).
Main definitions
IsConstrainedVarianceCriticalPoint: w is a critical point of (1/2) wᵀ Σ w under the budget constraint 1ᵀ w = 1 and the return constraint μᵀ w = m, in the variational form: (Σw)ᵀ δw = 0 for every perturbation δw orthogonal to 1 and μ.
Main results
isCriticalPoint_of_lagrangian_FOC (forward direction): if Σw = lam_1 · 1 + lam_2 · μ componentwise, then w is a constrained-variance critical point. Proof: direct algebra — substitute the FOC, use the perturbation's orthogonality to the constraint normals.variance_objective_eq_self_dot / quadratic_form_perturb_linear_coeff: the variance objective as a self-dot, and the explicit linear coefficient (Σw) · δw of a perturbation of (1/2) wᵀΣw for symmetric Σ — the directional-derivative content underlying the FOC.portfolioVarN_le_of_lagrangian_FOC: for positive semidefinite Σ, a portfolio meeting both constraints and the Lagrangian FOC has the least variance among all portfolios meeting the same constraints — the KKT sufficiency theorem kkt_sufficient_of_eq (Choice/Portfolio/ConvexQPKKT.lean) for the QP min ½ wᵀΣw.posSemidef_covariance, variance_le_of_lagrangian_FOC: the same for the covariance matrix of square-integrable random returns, whose positive semidefiniteness is derived (covariance_kernel_psd), stated for the variance of the portfolio return itself.isTangentPortfolioN_and_portfolioVarN_le: a portfolio with Σw = λ(μ − r_f) is a tangent portfolio and has the least variance at its budget and expected return.portfolioVarN_minVarWeightTwo_le: the closed-form two-asset weight minimises portfolioVarN.- Two assets:
portfolioVarN_covTwo and portfolioVarTwo_eq_variance identify the closed form portfolioVarTwo (Choice/Portfolio/Markowitz.lean) with the quadratic form portfolioVarN and with Var[w R₁ + (1 − w) R₂]; marginalVariance_minVarWeightTwo shows that at the minimum-variance weight each asset's marginal variance equals V_min (for D ≠ 0), so (isConstrainedVarianceCriticalPoint_minVarWeightTwo) that weight satisfies the budget-only Lagrangian FOC with multiplier V_min.
What is not in this file
Necessity — "every constrained minimiser (or critical point) satisfies the Lagrangian FOC for some multipliers" — is not proved. It requires showing Σw ∈ span{1, μ}, which by the orthogonal-complement characterization is equivalent to Σw ⊥ {δw : 1·δw = 0 ∧ μ·δw = 0}; in finite dimensions this needs Submodule.orthogonalComplement machinery. The file proves the converse direction: every weight satisfying the Lagrangian equations is a critical point and, for positive semidefinite Σ, a global minimiser.
Why this is "first principles"
Choice/Portfolio/Markowitz.lean states the two-asset minimum-variance weight in closed form and Choice/Portfolio/MarkowitzNAsset.lean the n-asset variance identities. This file derives the optimality of Lagrangian-FOC weights from the constrained variance-minimization problem, for N assets with budget and target-return constraints (the standard textbook setup).
References
Tags
Markowitz, mean-variance optimization, Lagrangian, first-order condition, two-fund separation, minimum variance, constrained optimization, MSC 91G10, MSC 90C25, JEL G11
Import neighbourhood
Above: what it imports. Below: what imports it.
Corpus entries
mf-markowitz-lagrangian-sufficient · portfolio_and_performance.json · full statement
Markowitz Lagrangian First-Order Condition Is Sufficient for Minimum Variance
For a positive semidefinite covariance matrix Σ, a portfolio w with budget ∑ wᵢ = 1, target return ∑ wᵢ μᵢ = m and Lagrangian first-order condition (Σw)ᵢ = λ₁ + λ₂ μᵢ for every asset has variance wᵀΣw no larger than that of any portfolio meeting the same two constraints. Sufficiency only: that every minimum-variance portfolio satisfies the first-order condition is not proved.
mf-markowitz-variance-random-returns · portfolio_and_performance.json · full statement
Markowitz Minimum Variance for Random Returns
For square-integrable random returns R₁, …, Rₙ, a portfolio w with ∑ wᵢ = 1, ∑ wᵢ μᵢ = m and Lagrangian first-order condition ∑ⱼ cov(Rᵢ, Rⱼ) wⱼ = λ₁ + λ₂ μᵢ for every asset satisfies Var[∑ wᵢ Rᵢ] ≤ Var[∑ vᵢ Rᵢ] for every portfolio v meeting the same constraints. Positive semidefiniteness of the covariance matrix is derived, not assumed. Sufficiency only: necessity of the first-order condition is not proved.
mf-markowitz-two-asset-variance-of-returns · portfolio_and_performance.json · full statement
Two-Asset Portfolio Variance Is the Variance of the Portfolio Return
For square-integrable returns R₁, R₂ with Var[R₁] = σ₁², Var[R₂] = σ₂² and cov(R₁, R₂) = ρσ₁σ₂, the two-asset formula w²σ₁² + (1 − w)²σ₂² + 2w(1 − w)ρσ₁σ₂ equals Var[w R₁ + (1 − w) R₂] for every weight w: the closed form is derived from the covariance kernel of the returns.
mf-markowitz-gmv-equal-marginal-variance · portfolio_and_performance.json · full statement
Two-Asset Minimum-Variance Portfolio Equalises Marginal Variances
At the two-asset minimum-variance weight w* = (σ₂² − ρσ₁σ₂)/D, with D = σ₁² − 2ρσ₁σ₂ + σ₂² ≠ 0, each asset's marginal variance (Σw*)ᵢ, its covariance with the portfolio, equals the minimum variance V_min = σ₁²σ₂²(1 − ρ²)/D. So w* satisfies the budget-only Lagrangian first-order condition with multiplier V_min.