Is there a generalization of the Cauchy-Schwarz inequality along the following lines? Let $V$ be an inner product space (for simplicity of notation, let us work over the real numbers). Let $v_1, \ldots, v_n$ be in $V$. Let $G$ denote the Gram matrix of the $v_i$, namely, $G$ consists of all possible $(v_i, v_j)$, as $i,j = 1, \ldots, n$, where $(-,-)$ is the inner product in $V$. The usual Cauchy-Schwarz inequality, with $n=2$, can be written as follows, to get rid of square roots: $$ \det(G) = (v_1,v_1)(v_2,v_2) - (v_1,v_2)^2 \geq 0, $$ with equality iff $v_1$ and $v_2$ both belong to some $1$-dimensional subspace of $V$. So in this case, for $n=2$, the LHS is a homogeneous polynomial in $G$ of degree $2$, and equality is achieved iff $v_1$ and $v_2$ both belong to some $1$-dimensional subspace. For the general $n$ case, is there a higher degree homogeneous polynomial in $G$ which is non-negative for any $v_1, \ldots, v_n$ in $V$, and which vanishes iff the $v_i$, for $i = 1,\ldots, n$ all lie in some $1$-dimensional subspace of $V$? (I suspect there may be such a polynomial of degree $2 \lfloor \frac{n(n+1)}{4} \rfloor$. So for instance, if $n=2$, the expected degree is $2$. If $n=3$, the expected degree is $6$, and so on.)