Portfolio variance scales quadratically in the weight magnitude: Var(c·w) = c²·Var(w).
{ι : Type u_1} → Finset ι → (ι → ℝ) → (ι → ι → ℝ) → ℝN-asset portfolio variance: Var(w) = ∑_{i,j} w_i · w_j · σ_{ij}.
Closed-form algebraic identities for the n-asset portfolio variance as an explicit Finset double sum:
Var(w) = ∑_{i, j ∈ s} w_i · w_j · σ_{ij}.
We avoid the matrix-algebra layer (Matrix.mulVec, Matrix.PosDef) and work directly with sums — this keeps the file lightweight while still covering the core textbook identities.
portfolioVarN: the n-asset portfolio variance ∑_{i,j ∈ s} wᵢ wⱼ σᵢⱼ, a double sum over a finite index set s against a kernel σ.portfolioVarN_smul: scaling Var(c · w) = c² · Var(w).portfolioVarN_diag: when σ is diagonal (σ_{ij} = 0 for i ≠ j), Var(w) = ∑ w_i² · σ_{ii}.portfolioVarN_equal_weights_iid: equal-weights / iid case gives Var(c · 1) = c² · n · σ² (a diversification scaling identity).portfolioVarN_nonneg_of_psd: if the kernel σ defines a non-negative quadratic form, then Var(w) ≥ 0.portfolioVarN_two_asset_compat: when the index set has cardinality 2, the double sum is the two-asset portfolioVarTwo of Markowitz.lean.Markowitz, portfolio variance, covariance matrix, n-asset portfolio, diversification, MSC 91G10, JEL G11
Above: what it imports. Below: what imports it.
Portfolio variance scales quadratically in the weight magnitude: Var(c·w) = c²·Var(w).
When σ_ij = 0 for i ≠ j (uncorrelated assets), the portfolio variance reduces to ∑ w_i²·σ_ii.
Equal weights c on an n-asset portfolio with zero cross-covariances and common variance σ² gives Var = c²·n·σ². The classical diversification scaling.
When the index set has cardinality 2 with weights (w, 1-w) and the standard ρ-parametrized covariance, the n-asset variance recovers the two-asset formula w²σ₁² + (1-w)²σ₂² + 2w(1-w)ρσ₁σ₂.
{ι : Type u_1} → Finset ι → (ι → ℝ) → (ι → ι → ℝ) → ℝN-asset portfolio variance: Var(w) = ∑_{i,j} w_i · w_j · σ_{ij}.
∀ {ι : Type u_1} (s : Finset ι) (w : ι → ℝ) (σ : ι → ι → ℝ) (c : ℝ), portfolioVarN s (fun i => c * w i) σ = c ^ 2 * portfolioVarN s w σQuadratic scaling: Var(c · w) = c² · Var(w).
∀ {ι : Type u_1} (s : Finset ι) (w : ι → ℝ) (σ : ι → ι → ℝ), (∀ i ∈ s, ∀ j ∈ s, i ≠ j → σ i j = 0) → portfolioVarN s w σ = ∑ i ∈ s, w i ^ 2 * σ i iDiagonal covariance: when σ_{ij} = 0 for i ≠ j, the portfolio variance collapses to ∑ w_i² · σ_{ii}.
∀ {ι : Type u_1} (s : Finset ι) (c σ_sq : ℝ) (kernel : ι → ι → ℝ), (∀ i ∈ s, ∀ j ∈ s, i ≠ j → kernel i j = 0) → (∀ i ∈ s, kernel i i = σ_sq) → portfolioVarN s (fun x => c) kernel = c ^ 2 * ↑s.card * σ_sqDiversification under iid assets: equal weights c across an index set s of cardinality n, with zero cross-covariances and common variance σ², gives Var(c · 1) = c² · n · σ².
∀ {ι : Type u_1} (s : Finset ι) (w : ι → ℝ) (σ : ι → ι → ℝ), (∀ (v : ι → ℝ), 0 ≤ ∑ i ∈ s, ∑ j ∈ s, v i * v j * σ i j) → 0 ≤ portfolioVarN s w σNon-negativity from PSD kernel: if σ defines a non-negative quadratic form (∀ v, ∑∑ v_i v_j σ_{ij} ≥ 0), then Var(w) ≥ 0.
∀ (w σ₁ σ₂ ρ : ℝ), (portfolioVarN Finset.univ (fun i => if i = 0 then w else 1 - w) fun i j => if i = 0 ∧ j = 0 then σ₁ ^ 2 else if i = 1 ∧ j = 1 then σ₂ ^ 2 else ρ * σ₁ * σ₂) = portfolioVarTwo σ₁ σ₂ ρ w
Two-asset compatibility: for an index set {0, 1} ⊆ Fin 2 with weights w 0 = w and w 1 = 1 − w and the covariance kernel σ 0 0 = σ₁², σ 1 1 = σ₂², σ 0 1 = σ 1 0 = ρ · σ₁ · σ₂, the n-asset variance is the two-asset portfolioVarTwo σ₁ σ₂ ρ w of Markowitz.lean.