Let $E$ be a vector space with basis $e_1 , \dots e_n$ and let $a_1 , \dots a_k \in \mathbb{K}$. We consider the quadratic form $Q(x_1 e_1 + \dots + x_n e_n ) = a_1 x_1 ^{2} + \dots + a_k x_k ^{2}$. Show that the kernel is $vect(e_{k+1}, \dots e_{n})$.
I think I have found the bilinear form which is $B(x, y)= \sum_{i=0}^{n} x_{i}y_{i}$, but I am not totally sure. Am I suppose to have the $a_i$ in the sum ^. For the kernel, I started by using the definition : $ker(B) = \{x\in E, \forall y\in E, B(x,y)=0 \} = \{x\in E, \forall y\in E, \sum_{i=0}^{n} x_{i}y_{i} = 0\}=...$ From that point I don't know how I will be able to show that $ker(B)=vect(e_{k+1}, \dots e_{n})$.
If anyone has any idea, let me know.
First off, I think you might need the extra assumption that $a_1, \dots, a_k$ are all non-zero, otherwise if $a_i$ is zero, the corresponding basis element $e_i$ should belong in the spanning set of the kernel as well.
To show that $\ker B = \operatorname{span}\{e_{k+1}, \dots, e_n\}$ (the latter I will call $S$ from now on), you need to show that $\ker B\supset S$ and $\ker B\subset S$. The former is easy to check using the definition of $Q$. To show the latter, you just need to show that for any vector $v = x_1 e_1 +\cdots + x_n e_n\in \ker B$, its first $k$ components $x_1, \dots, x_k$ are in fact zero. To see this, observe that the kernel condition requires in particular that $B(v, e_i)$ for $i = 1, \dots, k$, so $\frac{1}{2}\left(Q(v + e_i) - Q(v) - Q(e_i)\right) = 0$. The first term $Q(v+e_i)$ comes out to be $a_1 x_1^2 + \cdots + a_i (x_i + 1)^2 + \cdots + a_k x_k^2$, the second term $Q(v)$ is identical except for the $i$-th term, which is instead $a_i x_i^2$, and the last term $Q(e_i)$ is just $a_i$. Combining all three terms and divide by $2$ we get $B(v, e_i) = a_i x_i$. Since $a_i$ is non-zero, $x_i$ must be zero.