Equivalence between matrix equation and Riccati equation In the context of game theory/optimal control I have encountered the equation
$$M = Q + A^TM(I + (BB^T - \gamma^{-2} I)M)^{-1} A \tag{1}\label{eq1}$$ where $\gamma \in \mathbb{R}$ and the matrices $A \in \mathbb{R}^{n \times n}, B \in \mathbb{R}^{n \times m}, Q \in \mathbb{R}^{n \times n}$ are given, and $M \in \mathbb{R}^{n \times n}$ is the variable. I want to solve this equation.
Empirically, using Matlab (the command idare), it seems like the solution of the discrete time algebraic Riccati equation (DARE)
$$ M = Q + A^T M A - A^T M\pmatrix{B & I} \bigg(\pmatrix{B^T \\ I}M \pmatrix{B & I} + \pmatrix{I & 0 \\ 0 & -\gamma^2 I } \bigg)^{-1} \pmatrix{B^T \\ I} MA \tag{2}\label{eq2}$$  in fact is a solution of equation \eqref{eq1}.
To prove this, my first idea was to show that the right hand side of equation \eqref{eq1} in fact equals the right hand side of equation \eqref{eq2} for $\textit{any}$ matrix $M$. However, a quick empirical investigation showed that the two different right hand sides do not agree for a randomly chosen $M$.
Is it possible to derive what my empirical data suggests, namely that the solution of \eqref{eq2} also is a solution of equation \eqref{eq1}? Is there a "standard framework" one can use to put equation \eqref{eq1} on the standard DARE form?
Edit: When comparing the right hand sides of equation \eqref{eq1} and \eqref{eq2} I used a randomly chosen $M$. However, when I choose $M$ positive definite the right hand sides seem to agree empirically. Using this fact I might be able to prove the equivalence between the equations. I shall make a try with this approach and come back to you.
Bests,
Daniel
 A: Both equation 1 and 2 represent the same thing. I am fairly certain that by applying the Woodbury matrix inversion lemma,
$$(A+UCV)^{-1} = A^{-1} - A^{-1}U(C^{-1} + VA^{-1}U)^{-1}VA^{-1}$$
equation 1 can be expressed as 2 (https://en.wikipedia.org/wiki/Woodbury_matrix_identity)
Next, the Riccati equation doesnt work for any random $M$. This equation should be used to find a unique, positive definite $M$ that satisfies this equation. While that is could be solved by hand for lower dimensional problems, I'd recommend against it. Instead, you could use the recursive variant:
$$M_{k} = Q + A^TM_{k+1}A -A^TM_{k+1}\begin{bmatrix}B & I\end{bmatrix}\left(\begin{bmatrix}B^T \\ I\end{bmatrix}M_{k+1}\begin{bmatrix}B & I\end{bmatrix} + \begin{bmatrix}I & \\ & -\gamma^2I\end{bmatrix}\right)^{-1}\begin{bmatrix}B^T \\ I\end{bmatrix}M_{k+1}A$$
With $M_h = Q$. Iterate this equation backwards in time until $M_k$ converges (ie does not change anymore) and you have found the solution of the Riccati equation!
