Assume the following linear discrete system:
$x_k = Fx_{k-1} + w_{k-1}$ where $w_{k} \sim N(0, Q)$
$y_k = Hx_k + v_{k}$ where $v_{k} \sim N(0, R)$
One way to prove that the Kalman filter is optimal is to show that it minimises the following cost function:
$J_m = \frac{1}{2}(y_k - Hx_k)^TR^{-1}(y_k - Hx_k) + \frac{1}{2}(x_k - Fx_{k-1})^TP_{k|k-1}^{-1}(x_k - Fx_{k-1})$
Why do we use $P_{k|k-1}$ instead of Q as the covariance in the second part of $J_m$? By the way, $P_{k|k-1}$ is the covariance of estimation