Find a matrix equation equivalent to $A^TPA+P=I$

Question was

Let $$A= \left[\begin{matrix}
a_1 & a_2\\
$$P= \left[\begin{matrix}
p_1 & p_2\\

Find the matrix $Q$ such that

$$ Q\left[
\right] = \left[
\right]$$ is equivalent to the equation $A^TPA+P=I$

In this question I approached to make $Q$ to $2\times 2$ matrix. but I couldn’t get any idea.. I need you genius to help.

Solutions Collecting From Web of "Find a matrix equation equivalent to $A^TPA+P=I$"

Hint. $Q$ is a $4\times 4$ matrix. Try to understand what happens when $p_1=1$, and $p_2=p_3=p_4=0$. Then you will be able to find the first column of $Q$.
Can you take it from here?

P.S. Finally you will find that
a_1^2+a_1 &a_1a_3+a_1&a_1a_3+a_1&a_3^2+a_1
\\a_1a_2+a_2 &a_1a_4+a_2&a_2a_3+a_2&a_3a_4+a_2
\\a_1a_2+a_3 &a_2a_3+a_3&a_1a_4+a_3&a_3a_4+a_3
\\a_2^2+a_4 &a_2a_4+a_4&a_2a_4+a_4&a_4^2+a_4

Using the vec operation we get

$$\operatorname{vec}(A^TPA + P) = \operatorname{vec} (I) = \begin{pmatrix} 1 \\ 0 \\ 0 \\ 1 \end{pmatrix}$$
Then, using linearity and the properties given on wikipedia:
$$(A^T \otimes A^T)\operatorname{vec}(P) + \operatorname{vec}(P) = \operatorname{vec} (I)$$
Rearranging gives
$$(A^T \otimes A^T + I_4)\operatorname{vec} (P) = \operatorname{vec}(I)$$
Which is what you require.