In graph theory, given a graph $G$ with $n$ nodes and an edge set $E$, the Laplacian matrix is defined as the difference of the degree matrix and the adjacency matrix:
$$ L=D-A \tag{1} $$
As shown here, the quadratic form of $L$ is as follows: ($x$ is simply a function of vertices, therefore has $n$ elements) $$ \begin{align*} x^T L x &= x^T D x - x^T Ax\\ &= \sum_{i=1}^n \text{deg}(i)x_i^2 - \sum_{\{i,j\}\in E} 2x_i x_j \tag{2}\\ &=\sum_{i=1}^n \sum_{\{i,j\}\in E} x_i^2 - \sum_{\{i,j\}\in E} 2x_i x_j \tag{3}\\ &= \sum_{\{i,j\}\in E} (x_j^2+x_i^2-2x_ix_j)\tag{4}\\ &= \sum_{\{i,j\}\in E} (x_i-x_j)^2\tag{5} \end{align*} $$
Questions:
- I feel I am missing something obvious, but how do we go from $(3)$ to $(4)$?
- Is there a simple way to see from the quadratic form that the smallest eigenvalue ought to be $0$ and that as soon as the second smallest eigenvalue is $>0$ the corresponding graph must be connected?