What is the Lie algebra of the ``indefinite orthogonal group''? For $p,q \geq 0$ and $n=p+q\geq 1$, give $\mathbb{R}^n$ the indefinite inner product (written as a matrix)
$$ \begin{pmatrix} I_p & \\ & -I_q \end{pmatrix}, $$
where $I_m$ is the $m \times m$ identity matrix.  For example, if $\{e_i\}$ is a basis of $\mathbb{R}^n$ and $X = X^i e_i,$ then
$$ |X|^2 = (X^1)^2 + \cdots + (X^p)^2 - (X^{p+1})^2 - \cdots - (X^{p+q})^2.$$
Let $\mathrm{O}(p,q,\mathbb{R})$ be the Lie group of all linear transformations $T : \mathbb{R}^n \rightarrow \mathbb{R}^n$ that preserve this indefinite inner product.
What is the Lie algebra of $\mathrm{O}(p,q,\mathbb{R})$?  Does it admit a ``nice'' description when $p$ and $q$ are both positive?
 A: Write $$I_{p,q} = \begin{pmatrix} I_p & 0 \\ 0 & -I_q \end{pmatrix}.$$ Then the Lie algebra of $\mathrm{O}(p,q; \mathbb{R})$ is given by $$\mathfrak{so}(p,q) = \{X \in M_n(\mathbb{R}) : X^T I_{p,q} = -I_{p,q} X\}.$$
Note that if you similarly define the indefinite unitary group $\mathrm{U}(p,q)$, then its Lie algebra is $$\mathfrak{u}(p,q) = \{X \in M_n(\mathbb{C}) : X^\dagger I_{p,q} = -I_{p,q} X\}.$$
A: The $O(p,q;\mathbb{R})$ group consists of maps $A \in GL(n,\mathbb{R})$ preserving your inner product $g = \pmatrix{I_p & 0 \\ 0 &-I_q}$:
$$ \langle AX, AY \rangle_g = \langle X,Y\rangle_g  \ \ , \ \ \ \ \forall  X,Y \in \mathbb{R}^n$$ where $$ \langle X,Y \rangle_g = X^T g \ \ Y $$ In that case, $(AX)^Tg(AX) = X^TA^TgA Y = X^tgY$ and therefore:
$$ O(p,q) = \{A \in GL(n,\mathbb{R}) \ | \ A^T g \ A = g \  \}$$ The condition can be equivalently stated as $ A^{-1} = g^{-1}A^Tg \ $. In that case, if $X$ is an element of its Lie algebra, it has to satisfy the condition:
$$ (e^{X})^{-1} = e^{-X} = g^{-1}e^{\ X^T}g = e^{\ \ g^{-1}X^Tg} $$ where it was used $$g^{-1}\frac{X^n}{n!}g = \frac{1}{n!}(g^{-1}Xg)(g^{-1}Xg) \cdots (g^{-1}Xg) = \frac{1}{n!}(g^{-1}Xg)^n$$
This only happens when $X = -g^{-1}X^Tg $ and follows the lie algebra:
$$ \mathfrak{so}(p,q) = \{ X \in Mat(n,\mathbb{R}) \ | \ X^T g = -gX \} $$
