The signature of an inner product space does not depend on its basis In R.W.R. Darling's "Differential Forms and Connections" an inner product is defined for a vector space $V$ as a bilinear, symmetric and nondegenerate (but not necessarily positive-definite) map from $V \times V$ to $\mathbb{R}$, denoted $\langle\ ,\ \rangle$. A basis $\{v_1,\dots,v_n\}$ of $V$ is then called an orthonormal basis if $\langle v_i,v_i \rangle = \pm 1$, $\langle v_i,v_j \rangle = 0$ for all $i,j \in \{1,\dots,n\}$ with $i \neq j$. One of the exercises is the following:

Let $\{v_1,\dots,v_n\}$ and $\{w_1,\dots,w_n\}$ be two orthonormal
  bases of an indefinite inner product space $V$, 
  arranged such that $\langle v_i,v_i \rangle=1=\langle w_j,w_j \rangle$
  for $1 \leq i \leq q,1 \leq j \leq r$, but for no
  other indices. Let $H$ denote the set $\{v \in V: \langle v,v\rangle \geq 0\}$.
  Show that $H$ is a subspace, and it has both
  $\{v_1,\dots,v_q\}$ and $\{w_1,\dots,w_r\}$ as bases. Conclude that
  $q=r$, and so the signature of an inner product space does not depend
  on the basis.

I am stuck with showing that $H$ is a subspace. It is clear that for $v \in H$, $\lambda \in \mathbb{R}$ we have $\langle \lambda v,\lambda v\rangle = \lambda^2\langle v,v\rangle \geq 0$ so that $\lambda v \in H$.
Now let $v,v' \in H$, then we need to show that $v+v' \in H$. It holds
$$\langle v+v', v+v'\rangle = \langle v,v\rangle + \langle v',v'\rangle + 2\langle v,v'\rangle.$$
At this point I do not know how to proceed. I would like to use some known inequality on inner products to show that the right expression must be non-negative, but the proof of the Cauchy-Schwarz inequality for instance uses that the inner product is positive definite, so I believe that it does not hold in our more general case.
In another attempt, I have tried expressing $v = a_1v_1 + \dots + a_nv_n$ and $v' = b_1v_1 + \dots + b_nv_n$ in terms of the given basis of $V$ and then using the bilinearity of the inner product which leads to
$$\langle v,\ v\rangle = a_1^2 + \dots + a_q^2 - (a_{q+1}^2 + \dots + a_n^2) \geq 0,$$
$$\langle v',\ v'\rangle = b_1^2 + \dots + b_q^2 - (b_{q+1}^2 + \dots + b_n^2) \geq 0,$$
$$\langle v,\ v'\rangle = a_1b_1 + \dots + a_qb_q - (a_{q+1}b_{q+1} + \dots + a_nb_n),$$
and thus we need to show that
$$\langle v,\ v\rangle + \langle v',\ v'\rangle + 2\langle v,\ v'\rangle = (a_1+b_1)^2 + \dots + (a_q+b_q)^2 - ((a_{q+1}+b_{q+1})^2 + \dots + (a_n+b_n)^2)$$
is non-negative. Again, at this point I do not get any further.
 A: I don't know what the book is trying to say, but as quoted here it seems to be completely wrong. Take for instance $V=\Bbb R^2$ with as non-definite bilinear form $\left<\binom{x_1}{y_1},\binom{x_2}{y_2}\right>=x_1x_2-y_1y_2$ (this is not actually an inner product under most people's definition, but I'll go with the book here). Then $H=\left\{\binom xy\mid x^2\geq y^2\right\}$ is not a subspace (it is a cone though, closed under scalar multiplication and addition, but not under subtraction).
(For the record, although the "orthonormal" bases plays no role in this statement, they must exist for the example to be valid. This is OK though, one can take the standard basis both for the $v_i$ and the $w_i$, with $q=r=1$.)
The result that one is trying to prove here is called Sylvester's law of inertia, but this is (for a good reason) not the way it is usually proved. One proof I know identifies both the numbers $q$ and $r$ with the largest dimension among all subspaces for which the restriction of the bilinear form is positive definite, or equivalently which admit some basis that is orthonormal in the true sense (with all self-products being positive $1$). However such a maximal-dimension subspace it not unique: in my example any vector $\binom xy$ with $|x|>|y|$ spans such a subspace of dimension$~1$.
A: I am sorry I may be completely incorrect but I feel there something wrong with above argument.
Given $v, v' \in H$, we want to show that $\text{Span}\{v,v'\} \subseteq H$. It was suggested to first find a suitable $\lambda$ so that $v$ and $v'-\lambda v$ are orthogonal. Such $\lambda$ is given by,
$$\langle v,v'-\lambda v\rangle = 0 \iff \lambda = \langle v,v' \rangle/\langle v,v\rangle.$$
Then it was suggested to replace $v'$ by $v'-\lambda v$ so that $v$ is orthogonal to new $v'$ and therefore it follows that $\text{Span}\{v,v'\} \subseteq H$.
There seem to be an issue here. Before the concluding step, I think it needs to be shown that $v'-\lambda v$ also lies in $H$. This is equivalent to showing that $\langle v'-\lambda v,v'-\lambda v\rangle \geq 0$. Expanding and substituting $\lambda$ here gives us
$$\langle v'-\lambda v,v'-\lambda v\rangle = \frac{\langle v',v'\rangle\langle v,v\rangle - \langle v,v'\rangle^2}{\langle v,v\rangle}.$$
Showing this to be at least zero takes us back to proving Cauchy-Schwarz type inequality which is was an issue for the general inner product space as pointed by OP.
In general, it is not clear to me why $H$ is really a subspace. Consider a two dimensional vector space $V$ with orthonormal basis $\{v_1, v_2\}$. Suppose $\langle v_1,v_1\rangle = 1$ and $\langle v_2,v_2\rangle = -1$. Then the exercise in the book aims to show that $H$ is a subspace and its basis is given by $\{v_1\}$ in this case. But $u = v_1-0.5v_2$ also lies in $H$ because $\langle u, u\rangle = 1 - 0.25 \geq 0$. However, $u \not\in \text{Span}\{v_1\}$. Again there may be some error here. It would be great if someone can point that out.
I must admit that the exercise is nice however after spending quite some time I couldn't figure out the solution based on direct techniques. There seem to be an error in the statement of the problem in the book. There is a subtle trick used to show the invariance of the signature under different basis as shown in this pdf http://www.math.toronto.edu/~jkamnitz/courses/mat247_2014/bilinearforms2.pdf
A: Please see the other answers for an explanation of why the statement of the problem (and the original version of this answer) is incorrect.
