PSD derived, not assumed: the Markowitz quadratic form at the genuine covariance kernel σ_ij = cov(R_i, R_j) of square-integrable returns equals Var[∑ wᵢ • Rᵢ] ≥ 0 — the self-dot variance identity, via Mathlib's variance_sum' with covariance_smul_left/right peeling the weights — discharging the PSD hypothesis of portfolioVarN_nonneg_of_psd from first principles.
∀ {Ω : Type u_1} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} [IsFiniteMeasure μ] {ι : Type u_2} (s : Finset ι) (w : ι → ℝ) (R : ι → Ω → ℝ), (∀ i ∈ s, MemLp (R i) 2 μ) → (portfolioVarN s w fun i j => covariance (R i) (R j) μ) = variance (∑ i ∈ s, w i • R i) μSelf-dot variance identity: the n-asset Markowitz quadratic form, evaluated at the genuine covariance kernel σ_{ij} = cov(R_i, R_j) of square-integrable random returns, is exactly the variance of the portfolio return ∑ wᵢ Rᵢ:
portfolioVarN s w (cov(R_·, R_·)) = Var[∑ i ∈ s, wᵢ • Rᵢ].
Mathlib's variance_sum' unfolds the portfolio variance into the double sum of covariances; the smul lemmas peel the weights. No PSD assumption appears anywhere.