# Homotopy between $O(p,q)$ and $O(p)\times O(q)$

Suppose that $p,q$ are two positive integers. Let $O(p,q)$ be the set of all the $(p+q)\times(p+q)$ real matrices $A$ satisfying $A^Tdiag(I_p,-I_q)A=diag(I_p,-I_q)$. Let $O(n)$ be the set of all the $n\times n$ real orthogonal matrices. Show that $O(p,q)$ is homotopic to $O(p)\times O(q)$.

Consider the embedding $j:O(p)\times O(q)\to O(p,q)$ $(P,Q)\mapsto diag(P,Q)$. I need to find a continuous map(The topology is the topology of $\mathbb{R}^{(p+q)^2}$) $p:O(p,q)\to O(p)\times O(q)$ such that $p\circ j=id$ and $j\circ p$ is homotopic to $id$