MathFin
Map / Choice · Portfolio choice / MathFin.Choice.Portfolio.SharpeFOCDerivation

Markowitz cross-product FOC derived from Sharpe-ratio maximization

MathFin.Choice.Portfolio.SharpeFOCDerivationMSC 91G10JEL G11 source

The pre-existing tangentTwo_satisfies_FOC in Choice.Portfolio.TangentPortfolio verifies that the closed-form weight tangentWeightTwo satisfies the cross-product FOC r₂ · (Σw)₁ = r₁ · (Σw)₂ by direct algebra (ring). It does not derive that FOC from a maximization problem.

This file closes that gap. It

1. defines the two-asset Sharpe-ratio-squared Sh²(w) = E(w)² / V(w) where E(w) = w r₁ + (1 − w) r₂, V(w) = w² σ₁² + (1 − w)² σ₂² + 2 w (1 − w) ρ σ₁ σ₂ (the library's portfolioVarTwo σ₁ σ₂ ρ w, Choice/Portfolio/Markowitz.lean); 2. proves HasDerivAt of Sh² with the textbook formula Sh²'(w) = (2 E E' V − E² V') / V²; 3. shows the numerator factors as 2 E E' V − E² V' = 2 E · (r₁ · (Σw)₂ − r₂ · (Σw)₁); 4. concludes that the critical points of Sh² (where E ≠ 0, V ≠ 0) are precisely the points where the cross-product FOC holds.

Why this is "first principles"

The existing infrastructure stops at "the closed form satisfies the FOC". This file derives the FOC itself from a maximization problem — closing the loop between the optimization-theoretic and algebraic perspectives.

Main definitions

  • expectedReturnTwo: the two-asset expected return w r₁ + (1 − w) r₂.
  • marginalVarOne, marginalVarTwo: the components (Σw)₁, (Σw)₂ of the marginal variance.
  • sharpeSqTwo: the squared Sharpe ratio E(w)² / V(w) as a function of w.

Main results

  • sharpeSqTwo_eq_sharpeRatio_sq: for V(w) ≥ 0, Sh²(w) is the squared sharpeRatio of the portfolio return (zero risk-free rate) at volatility √V(w).
  • portfolioVarTwo_eq_sum_mul_marginalVar: V = w · (Σw)₁ + (1 − w) · (Σw)₂.
  • hasDerivAt_portfolioVarTwo: V'(w) = 2 · ((Σw)₁ − (Σw)₂).
  • sharpeSqTwo_deriv_numerator_factored: the derivative numerator factors through r₁ (Σw)₂ − r₂ (Σw)₁.
  • sharpeSqTwo_critical_iff_crossProduct_FOC: critical-point characterisation (E ≠ 0, V ≠ 0 regime).

References

Tags

Sharpe ratio maximization, tangent portfolio, first-order condition, Markowitz, maximum Sharpe portfolio, MSC 91G10, JEL G11

Import neighbourhood

Above: what it imports. Below: what imports it.

Corpus entries

mf-tangent-portfolio-foc · portfolio_and_performance.json · full statement
Sharpe-ratio FOC via calculus (two-asset)

The squared Sharpe ratio Sh²(w) has a critical point (HasDerivAt = 0) at weight w iff the cross-product condition r₂·(Σw)₁ = r₁·(Σw)₂ holds — the genuine first-order condition derived from HasDerivAt of Sh² (not an algebraic identity). Non-degeneracy: variance ≠ 0, expected excess return ≠ 0.

Declarations 12

defMathFin.expectedReturnTwosource
ℝ → ℝ → ℝ → ℝ

Two-asset expected excess return parameterised by weight w on asset 1 (with 1 − w on asset 2).

defMathFin.marginalVarOnesource
ℝ → ℝ → ℝ → ℝ → ℝ

Marginal variance contribution of asset 1: (Σw)₁ = w σ₁² + (1−w) ρ σ₁ σ₂.

defMathFin.marginalVarTwosource
ℝ → ℝ → ℝ → ℝ → ℝ

Marginal variance contribution of asset 2: (Σw)₂ = w ρ σ₁ σ₂ + (1−w) σ₂².

defMathFin.sharpeSqTwosource
ℝ → ℝ → ℝ → ℝ → ℝ → ℝ → ℝ

Two-asset Sharpe-ratio squared as a function of weight w.

theoremMathFin.sharpeSqTwo_eq_sharpeRatio_sqsource
∀ (w r₁ r₂ σ₁ σ₂ ρ : ℝ), 0 ≤ portfolioVarTwo σ₁ σ₂ ρ w → sharpeSqTwo w r₁ r₂ σ₁ σ₂ ρ = sharpeRatio (expectedReturnTwo w r₁ r₂) 0 √(portfolioVarTwo σ₁ σ₂ ρ w) ^ 2

The two-asset Sharpe ratio squared is the squared Sharpe ratio of the portfolio return with zero risk-free rate (returns are excess returns): Sh²(w) = sharpeRatio E(w) 0 σ(w) ^ 2, with σ(w) = √V(w) the portfolio volatility. V(w) is the variance of w R₁ + (1 − w) R₂ (portfolioVarTwo_eq_variance, Choice/Portfolio/MarkowitzLagrangian.lean).

theoremMathFin.portfolioVarTwo_eq_sum_mul_marginalVarsource
∀ (σ₁ σ₂ ρ w : ℝ), portfolioVarTwo σ₁ σ₂ ρ w = w * marginalVarOne w σ₁ σ₂ ρ + (1 - w) * marginalVarTwo w σ₁ σ₂ ρ

V is the weight-weighted sum of the marginal variances: V(w) = w · (Σw)₁ + (1 − w) · (Σw)₂ (for N assets, compare portfolioVarN_eq_sum_mul_marginalVariance, Choice/Portfolio/CAPMEquilibrium.lean).

theoremMathFin.hasDerivAt_expectedReturnTwosource
∀ (w r₁ r₂ : ℝ), HasDerivAt (fun w' => expectedReturnTwo w' r₁ r₂) (r₁ - r₂) w

Derivative of E(w) = w r₁ + (1 − w) r₂ is r₁ − r₂.

theoremMathFin.hasDerivAt_portfolioVarTwosource
∀ (σ₁ σ₂ ρ w : ℝ), HasDerivAt (portfolioVarTwo σ₁ σ₂ ρ) (2 * (marginalVarOne w σ₁ σ₂ ρ - marginalVarTwo w σ₁ σ₂ ρ)) w

Derivative of V(w) = w² σ₁² + (1−w)² σ₂² + 2 w (1−w) ρ σ₁ σ₂ is V'(w) = 2 · ((Σw)₁ − (Σw)₂). Proof: polynomial rewrite of V in the form A w² + B w + C, then (A w² + B w + C)' = 2 A w + B.

theoremMathFin.hasDerivAt_expectedReturnTwo_sqsource
∀ (w r₁ r₂ : ℝ), HasDerivAt (fun w' => expectedReturnTwo w' r₁ r₂ ^ 2) (2 * expectedReturnTwo w r₁ r₂ * (r₁ - r₂)) w

Derivative of E²(w) is 2 E (r₁ − r₂).

theoremMathFin.hasDerivAt_sharpeSqTwosource
∀ (w r₁ r₂ σ₁ σ₂ ρ : ℝ), portfolioVarTwo σ₁ σ₂ ρ w ≠ 0 → HasDerivAt (fun w' => sharpeSqTwo w' r₁ r₂ σ₁ σ₂ ρ) ((2 * expectedReturnTwo w r₁ r₂ * (r₁ - r₂) * portfolioVarTwo σ₁ σ₂ ρ w - expectedReturnTwo w r₁ r₂ ^ 2 * (2 * (marginalVarOne w σ₁ σ₂ ρ - marginalVarTwo w σ₁ σ₂ ρ))) / portfolioVarTwo σ₁ σ₂ ρ w ^ 2) w

Derivative of Sh²(w) = E²/V: textbook formula Sh²'(w) = (2EE'V − E²V')/V².

theoremMathFin.sharpeSqTwo_deriv_numerator_factoredsource
∀ (w r₁ r₂ σ₁ σ₂ ρ : ℝ), 2 * expectedReturnTwo w r₁ r₂ * (r₁ - r₂) * portfolioVarTwo σ₁ σ₂ ρ w - expectedReturnTwo w r₁ r₂ ^ 2 * (2 * (marginalVarOne w σ₁ σ₂ ρ - marginalVarTwo w σ₁ σ₂ ρ)) = 2 * expectedReturnTwo w r₁ r₂ * (r₁ * marginalVarTwo w σ₁ σ₂ ρ - r₂ * marginalVarOne w σ₁ σ₂ ρ)

Algebraic factorization of the Sh² derivative numerator:

2 E E' V − E² V' = 2 E · (r₁ (Σw)₂ − r₂ (Σw)₁).

This factorization is the algebraic content of the cross-product FOC: setting the numerator to zero (with E ≠ 0) reduces to r₁ (Σw)₂ = r₂ (Σw)₁.

The identity is proved by ring after unfolding all definitions; the non-trivial cancellation is that (r₁ − r₂) V − E ((Σw)₁ − (Σw)₂) simplifies exactly to r₁ (Σw)₂ − r₂ (Σw)₁.

theoremMathFin.sharpeSqTwo_critical_iff_crossProduct_FOCsource
∀ (w r₁ r₂ σ₁ σ₂ ρ : ℝ), portfolioVarTwo σ₁ σ₂ ρ w ≠ 0 → expectedReturnTwo w r₁ r₂ ≠ 0 → (HasDerivAt (fun w' => sharpeSqTwo w' r₁ r₂ σ₁ σ₂ ρ) 0 w ↔ r₂ * marginalVarOne w σ₁ σ₂ ρ = r₁ * marginalVarTwo w σ₁ σ₂ ρ)

Critical-point characterisation: in the E ≠ 0, V ≠ 0 regime, the Sharpe-ratio squared has a critical point at w (i.e., HasDerivAt Sh² 0 w) if and only if the cross-product FOC r₂ (Σw)₁ = r₁ (Σw)₂ holds.

This is the first-principles derivation: the FOC arises as the critical-point condition of a real maximization problem, not as a stated algebraic identity.