The single-step updating formula
ProvedVectorSpaceOpt.estimate_updateWork in the Hilbert space of zero-mean random variables, .
Suppose an optimal estimate of a random -vector has been formed from past data generating a subspace , with error covariance
Now additional measurements arrive,
where the noise has covariance , is orthogonal to , and is uncorrelated with ; assume is invertible. Then the updated optimal estimate is
and the updated error covariance is
Precisely: is the orthogonal projection of onto the enlarged subspace generated by together with the components of .
The structure of the formula is the point. The old estimate is not recomputed; it is corrected by a gain matrix applied to the innovation , the part of the new data orthogonal to the old. This is the single step from which the Kalman recursion is built.
Formalization Note. The gain and the updated estimate are named by defining hypotheses rather than constructed. Being the projection onto the enlarged subspace is expressed as membership in it plus orthogonality of the error to it, which characterizes the projection uniquely.
import Mathlib open Matrix open scoped RealInnerProductSpace
namespace VectorSpaceOpt
theorem estimate_update {H : Type} [NormedAddCommGroup H]
[InnerProductSpace ℝ H] {n m : ℕ} (S : Submodule ℝ H)
(β βh : Fin n → H) (hβh : ∀ i, βh i ∈ S)
(hproj : ∀ i, ∀ s ∈ S, ⟪β i - βh i, s⟫ = 0)
(R : Matrix (Fin n) (Fin n) ℝ) (hR : ∀ i j, ⟪β i - βh i, β j - βh j⟫ = R i j)
(W : Matrix (Fin m) (Fin n) ℝ) (ε : Fin m → H)
(hεS : ∀ i, ∀ s ∈ S, ⟪ε i, s⟫ = 0)
(hεβ : ∀ (i : Fin m) (j : Fin n), ⟪ε i, β j⟫ = 0)
(Q : Matrix (Fin m) (Fin m) ℝ) (hQ : ∀ i j, ⟪ε i, ε j⟫ = Q i j)
(y : Fin m → H) (hy : ∀ i, y i = ∑ j, W i j • β j + ε i)
(hdet : IsUnit (W * R * Wᵀ + Q).det)
(G : Matrix (Fin n) (Fin m) ℝ) (hG : G = R * Wᵀ * (W * R * Wᵀ + Q)⁻¹)
(βt : Fin n → H)
(hβt : ∀ i, βt i = βh i + ∑ k, G i k • (y k - ∑ j, W k j • βh j)) :
(∀ i, βt i ∈ S ⊔ Submodule.span ℝ (Set.range y)) ∧
(∀ i, ∀ s ∈ S ⊔ Submodule.span ℝ (Set.range y), ⟪β i - βt i, s⟫ = 0) ∧
(∀ i j, ⟪β i - βt i, β j - βt j⟫ =
(R - R * Wᵀ * (W * R * Wᵀ + Q)⁻¹ * W * R) i j) := by sorry
end VectorSpaceOpt