If $X$ is linearly independent, prove $X^{T}X$ is positive definite I understand this question has been asked before but I couldn't really find the answer I really need. I attempted this myself but I find that there is a contradiction in my answer. 
Here is my attempt:
Let $Y=Xv$ and $Y>0$ where $X$ is a linearly independent matrix and $v$ is a vector.
Then $$Y^{T}Y = (Xv)^{T}(Xv) = v^{T}X^{T}Xv >0$$ Therefore, $X^{T}X$ is positive definite. 
That being said, here is my second thought. If $X$ is linearly independent, that implies that $Y = 0$ ie $Xv = 0$ if and only if $v=0$. Therefore, $v^{T}X^{T}Xv=0$ but in order for it to be positive definite, $Y>0$ strictly. 
What am I doing wrong? 
 A: You wrote "If $X$ is linearly independent", but the assumption you actually need is that the columns of $X$ are linearly independent. That of course means there are at least as many rows as columns.
Suppose $X\in \mathbb R^{n\times k}.$ Then $X^T X \in \mathbb R^{k\times k}.$ Then for any $v\in\mathbb R^{k\times1}$ you have
$$
v^T\Big(X^T X\Big) v = (Xv)^T (Xv) = \|Xv\|^2 \ge 0.
$$
So $X^T X$ is nonnegative-definite.
The remaining problem is to show that if $v\ne0$ then $v^T\Big( X^T X\Big) v\ne0.$ It is clear that if $Xv\ne0$ then $(Xv)^T (Xv) \ne0.$ So the problem is to show that if $v\ne0$ then $Xv\ne0.$ Observe that $Xv$ is a linear combination of the columns of $X,$ and the coefficients in the linear combination are the entries in $v.$ So this says that $Xv=0$ only if $v=0,$ i.e. a linear combination of the columns of $X$ is $0$ only if the coefficients are $0.$ That is the definition of linear independence.
A: I assume that the assertion, "X is linearly independent" means that *the columns of $X$ are linearly independent"; then if the columns of $X$ are denoted by $X_1, X_2, \ldots, X_n$, so that
$X = \begin{bmatrix} X_1, X_2, \ldots, X_n \end{bmatrix}, \tag 1$
then for any vector $v \ne 0$ we have
$y = Xv \ne 0; \tag 2$
this is easy to see; writing
$v = (v_1, v_2, \ldots, v_n)^T, \tag 3$
we have
$y = Xv = \sum_1^n v_i X_i \ne 0 \tag 4$
for any $v$ by the linear independence of the $X_i$.  Then
$v^T(X^TX)v = (v^TX^T)(Xv)= (Xv)^T(Xv) = y^Ty > 0, \tag 5$
which says that $X^TX$ is positive definite.
