I'm trying to prove that the 2nd order polynomial kernel, $K(x_i, x_j) = (x_i^Tx_j + 1)^2$ is a valid kernel which satisfies the following conditions:
- K is symmetric, that is, $K(x_i, x_j) = K(x_j, x_i)$.
- K is positive semi-definite, that is, $\forall v \space\space v^TKv \geq 0.$
We can actually prove that second-order polynomial kernel function is a valid kernel by deriving the corresponding transformation function $\phi(x) = [1, \sqrt{2}x_1, ..., \sqrt{2}x_d, x_1x_1, x_1x_2, ..., x_1x_d, x_2x_1, ...x_dx_d]^T$ where $d$ is the number of features (dimensionality). But I do want to prove that two conditions listed above holds for the given kernel function.
My attempts:
Symmetry is rather straightforward: $$(x_i^Tx_j + 1)^2 = x_i^Tx_jx_i^Tx_j + 2x_i^Tx_j + 1 = A \in \mathbb{R}$$ $$(x_j^Tx_i + 1)^2 = x_j^Tx_ix_j^Tx_i + 2x_j^Tx_i + 1 = B \in \mathbb{R}$$ It can be observed that $A^T = B$, and since they are scalars, $A = A^T = B \implies A = B$.
For the second condition, my attempt is as follows:
$$v^TK = [\sum_{i=1}^{n}(x_i^Tx_1 + 1)^2 v_i \space\space ... \space\space \sum_{i=1}^{n}(x_i^Tx_n + 1)^2 v_i] \\ v^TKv = \sum_{j=1}^{n}\left(\sum_{i=1}^{n}(x_i^Tx_j + 1)^2 v_i\right) v_j$$$$ v^TKv = \sum_{j=1}^{n}\sum_{i=1}^{n}(x_i^Tx_j + 1)^2 v_i v_j$$ Now I proceed with expanding the term $(x_i^Tx_j + 1)^2$: $$v^TKv = \sum_{j=1}^{n}\sum_{i=1}^{n}(x_i^Tx_jx_i^Tx_j + 2x_i^Tx_j + 1) v_i v_j $$$$ = \sum_{j=1}^{n}\sum_{i=1}^{n}x_i^Tx_jx_i^Tx_jv_i v_j + 2x_i^Tx_jv_i v_j + v_i v_j$$ After this point, I don't know how to proceed. I feel like I have to use double sum property: $$\sum_{i=1}^{n}\sum_{j=1}^{n}a_ib_j = \sum_{i=1}^{n}a_i \cdot \sum_{i=1}^{n}b_i$$
But I can eliminate only the term with $v_iv_j$. $$v^TKv = (\sum_{j=1}^{n}v_i\sum_{i=1}^{n}v_i) + 2(\sum_{i=1}^{n}\sum_{j=1}x_i^Tx_jv_iv_j) + \sum_{i=1}^{n}\sum_{j=1}^{n}x_i^Tx_jx_i^Tx_jv_i v_j$$
$$ =(\sum_{i=1}^{n}v_i)^2 +2(\sum_{i=1}^{n}\sum_{j=1}x_i^Tx_jv_iv_j) + \sum_{i=1}^{n}\sum_{j=1}^{n}x_i^Tx_jx_i^Tx_jv_i v_j$$ First term is greater than or equal to zero, therefore it can be cancelled out. But, for the rest, I cannot come up with any simplification. I have two questions:
- How should I proceed further at this point?
- How can one prove that any polynomial kernel with degree $p$ is PSD using this approach?
Thank you for your time.