Proof of the conjecture that the kernel is of dimension 2 I already asked this question which has been answered. This question may seem very similar but the required matrix manipulations are probably very different here due to the addition of the matrix $\mathbf{P}$, which makes the problem more difficult.
"Experimentally", I found that the kernel (null space) of the following matrix is of dimension 2. I'd like to prove it, but haven't managed yet:
\begin{equation}
\text{for almost all } t>0,\quad \text{dim}\,\text{ker}\left(\mathbf{Q}_2\mathbf{Q}_1(t)-\mathbf{Q}_1(t)^{-1}\mathbf{Q}_2\right)\overbrace{=}^?\;2 
\end{equation}
where:


*

*$\mathbf{Q}_2$ is the identity matrix everywhere except in $(2n,2n)$:
\begin{equation}
\mathbf{Q}_2=\begin{bmatrix} \mathbf{I}_n & \mathbf{0}_n \\  \mathbf{0}_n & \mathbf{P}^{-1}\begin{bmatrix}1 & && \\ & \ddots && \\ & & 1& \\ &&& -1 \end{bmatrix}\mathbf{P}  \end{bmatrix}\in\mathbb{R}^{2n\times2n}
\end{equation}
where $\mathbf{P}\in\mathbb{R}^{n\times n}$ is any invertible matrix.

*$\mathbf{Q}_1(t)$ is defined by:
\begin{equation}
\forall t>0,\quad\mathbf{Q}_1(t)=\begin{bmatrix}\textbf{cos}(\boldsymbol \Omega t) & \boldsymbol \Omega^{-1}\,\textbf{sin}(\boldsymbol \Omega t) \\  -\boldsymbol \Omega\,\textbf{sin}(\boldsymbol \Omega t) & \textbf{cos}(\boldsymbol \Omega t)\end{bmatrix}\in\mathbb{R}^{2n\times2n}
\end{equation}
where (... sorry...):
\begin{equation}
\boldsymbol\Omega=\begin{bmatrix} \omega_1 & & \\  & \ddots & \\  & & \omega_n  \end{bmatrix}\in\mathbb{R}^{n\times n},\quad \forall i\in\lbrace 1,\dots, n\rbrace, \omega_i>0
\end{equation}
and the four blocks are diagonal, for example:
\begin{equation}
\mathbf{cos}(\boldsymbol\Omega t)=\begin{bmatrix} \cos(\omega_1t) & & \\  & \ddots & \\  & & \cos(\omega_n t)  \end{bmatrix}\in\mathbb{R}^{n\times n}
\end{equation}

Interesting properties of $\mathbf{Q}_1$ and $\mathbf{Q}_2$:
Obviously, $\mathbf{Q}_2$ is invertible and $\mathbf{Q}_2=\mathbf{Q}_2^{-1}$.
Also, $\det(\mathbf{Q}_1)=1$ ($\omega_i>0$ and for proper $t>0$) and:
\begin{equation}
\mathbf{Q}_1(t)^{-1}=\begin{bmatrix}\textbf{cos}(\boldsymbol \Omega t) & -\boldsymbol \Omega^{-1}\,\textbf{sin}(\boldsymbol \Omega t) \\  \boldsymbol \Omega\,\textbf{sin}(\boldsymbol \Omega t) & \textbf{cos}(\boldsymbol \Omega t)\end{bmatrix}
\end{equation}
The initial equation can therefore also be written as:
\begin{equation}
\text{ker}\left(\mathbf{Q}_2\mathbf{Q}_1(t)-\mathbf{Q}_1(t)^{-1}\mathbf{Q}_2\right)=\text{ker}\left(\mathbf{Q}_2\mathbf{Q}_1(t)\mathbf{Q}_2\mathbf{Q}_1(t)-\mathbf{1}_{2n}\right)
\end{equation}
So another way of solving the problem is to prove that 1 is an eigenvalue of $\mathbf{Q}_2\mathbf{Q}_1(t)\mathbf{Q}_2\mathbf{Q}_1(t)$ with a multiplicity of 2. But I'm not sure this helps...
Any clues would be greatly appreciated.
 A: Let $$\begin{split}A&=Q_2Q_1-{Q_1}^{-1}Q_2 \\ &=\begin{pmatrix}0&\Omega ^{-1}\sin(\Omega t)(I+P^{-1}DP)\\-(P^{-1}DP+I)\Omega\sin(\Omega t)&P^{-1}DP\cos(\Omega t)-\cos(\Omega t)P^{-1}DP\end{pmatrix}\end{split}$$ 
Then $$\begin{split}\phi(x)&=\pm\det(A-xI)\\
&=\det\bigg[-(P^{-1}DP+I)\sin(\Omega t)^2(I+P^{-1}DP) \\ &+x(P^{-1}DP\cos(\Omega t)-\cos(\Omega t)P^{-1}DP)-x^2I\bigg] \\
&=\det(-U+xV-x^2I) \end{split}$$
$\phi(0)=\det(-U)=0$ (because $I+P^{-1}DP$ is not invertible). 
Now 
$$\begin{split}\phi'(0)&=-\operatorname{tr}(\operatorname{adjoint}(U)V) \\ 
&=-\operatorname{tr}\bigg((\operatorname{adjoint}((P^{-1}DP+I)\sin(\Omega t)^2(I+P^{-1}DP)) \\ &\times (P^{-1}DP\cos(\Omega t)-\cos(\Omega t)P^{-1}DP)\bigg)
\end{split}$$ 
After a change of basis , we may assume $P^{-1}DP=\operatorname{diag}(1,\cdots,1,-1)$, $$S=\operatorname{adjoint}(\sin(\Omega t)^{2})=[s_{i,j}],C=\cos(\Omega t)=[c_{i,j}]$$ 
Then $\operatorname{adjoint}(U)=2^{2n-2}s_{n,n}E_{n,n}$ and consequently (if $V=[v_{i,j}]$), $$\operatorname{tr}(\operatorname{adjoint}(U)V)=2^{2n-2}s_{n,n}v_{n,n}.$$ Yet $v_{n,n}=-c_{n,n}+c_{n,n}=0$. Thus $\phi'(0)=0$  and $x=0$ is (at least) a double eigenvalue.
We consider the generic case (with respect to $\Omega,P,t$ and not only $t$). To see that, generically, $\dim(\ker(A))$ is exactly $2$, it suffices to give an instance, in dimension $n$, where $A$ is diagonalizable and $0$ is an eigenvalue with exactly the multiplicity $2$. It is not difficult (take $P=I_n,...$) - For a rigorous reasoning, you must use the Zariski's topology-.
