The weighted Pythagorean identity for finite conditional expectation
ProvedNarrowDNF.ConditionalExpectation.squaredError_decompositioncombinatoricsnarrow-dnf-authors-importprobabilitystoc-2027
Let be finite, , and let for every . For , let be the -weighted mean of on the fiber containing . Define . For every readout ,
No normalization of the positive weights is required. This decomposition exhibits conditional expectation as the least-squares projection onto functions that are constant on each partition atom.
Preamble
import Mathlib.Algebra.BigOperators.Ring.Finset
import Mathlib.Algebra.Order.BigOperators.Ring.Finset
import Mathlib.Data.Bool.Basic
import Mathlib.Data.Finset.Lattice.Fold
import Mathlib.Data.Fintype.BigOperators
import Mathlib.Data.Fintype.Pi
import Mathlib.Data.Real.Basic
import Mathlib.Logic.Equiv.Prod
import Mathlib.Order.Monotone.Basic
import Mathlib.Tactic.FieldSimp
import Mathlib.Tactic.Linarith
import Mathlib.Tactic.Ring
import Definitions.Def_NarrowDNF_ConditionalExpectation
import Theorems.Thm_NarrowDNF_ConditionalExpectation_residual_orthogonal
namespace NarrowDNF.ConditionalExpectation
end NarrowDNF.ConditionalExpectation
noncomputable section
open scoped BigOperators
open NarrowDNF
open NarrowDNF.ConditionalExpectation
variable {α β : Type*} [Fintype α] [Fintype β] [DecidableEq β]
Formal statement
theorem NarrowDNF.ConditionalExpectation.squaredError_decomposition (φ : α → β) (w F : α → ℝ)
(hw : ∀ a, 0 < w a) (G : β → ℝ) :
squaredError w F (fun a => G (φ a)) =
squaredError w F (conditional φ w F) +
squaredError w (conditional φ w F) (fun a => G (φ a)) := by sorrySource