Convoluted overkill proof for the vertex degree sum formula
Take the adjacency matrix $A$ of a simple undirected graph $G=(V,E)$: $$A := \big[ 1_E (\{v,w\}) \big]_{v,w=1}^n.$$ Let $x$, $y\in\mathbb R^n$. Then, compute $$y^{\rm T}\!Ax = \sum_{v\in V} \, \sum_{w\in V} y_v A_{v,w} x_w \tag{1}$$ and note that $$y^{\rm T}\!Ax = \sum_{v\in V} y_v \Big( \sum_{w\in V} 1_E (\{v,w\}) \, x_w \Big). \tag{2}$$ But also note that, since $A$ is symmetric and has as much as $2|E|$ non-zero entries, $(1)$ can be rearranged as $$y^{\rm T}\!Ax = \sum_{\{v,w\}\in E} (y_v x_w + y_w x_v). \tag{3}$$ Plugging $y = x = \vec 1$ into $(1)$ has the effect of counting how many non-zero entries $A$ does have: substituting at $(2)$ and $(3)$ and equating them gives $$\sum_{v\in V} \color{blue}{\Big( \sum_{w\in V} 1_E (\{v,w\}) \Big)} = \color{red}{\sum_{\{v,w\}\in E} (\color{green}{1+1})}.$$ Or equivalently, $$\sum_{v\in V} \color{blue}{\deg(v)} = \color{green}{2} \color{red}{|E|}. \tag*{$\square$}$$
Alternative phrasing that doesn’t require the adjacency matrix
Let $f:V\times V\to\mathbb R$, then the double sum over the vertices can be split as $$\sum_{v\in V} \sum_{w\in V} f(v,w) = \sum_{v\in V} \sum_{w\in V,\\ w<v} \big(f(v,w)+f(w,v)\big) +\sum_{v\in V} f(v,v).$$ Then, note that a sum over the edges can be seen as $$\sum_{\{v,w\}\in E} g(v,w) = \sum_{v\in V} \sum_{w\in V,\\ w<v} 1_{\Gamma(v)} (w) \cdot g(v,w)$$ for a suitable $g:V\times V\to\mathbb R$. Here, $\Gamma(v) \subsetneq V$ denotes the set of vertices that are neighbours of $v$, but $1_{\Gamma(v)} (w)$ may as well be thought as $1_E (\{v,w\})$. Now, choosing $f(v,w) := 1_{\Gamma(v)} (w)$ (so that $1_{\Gamma(v)} (w) = 1_{\Gamma(w)} (v)$ and $f(v,v) = 0$) leads to the choice of $g(v,w) = 2$ to relate all three sums: \begin{align} \sum_{v\in V} \color{blue}{ \sum_{w\in V} 1_{\Gamma(v)} (w) } &= \sum_{v\in V} \sum_{w\in V,\\ w<v} \big(1_{\Gamma(v)} (w) + 1_{\Gamma(w)} (v)\big) \\
&= \sum_{v\in V} \sum_{w\in V,\\ w<v} 1_{\Gamma(v)} (w) \cdot 2 \\
&= \color{red}{\sum_{\{v,w\}\in E} } \color{green}{2}.\end{align} Or equivalently, $$\sum_{v\in V} \color{blue}{\deg(v)} = \color{green}{2} \color{red}{|E|}. \tag*{$\square$}$$
Edit: yo, I remembered another one
Let $D := \big[ \delta_{v,w} \cdot \deg(v) \big]^n_{v,w=1}$ be the degree matrix and $A := \big[ 1_E (\{v,w\}) \big]^n_{v,w=1}$ the adjacency matrix for a simple, undirected graph $G=(V,E)$, so that $L:=D-A$ is its Laplacian matrix. Then $$x^{\rm T}\!Lx = \sum_{\{v,w\}\in E} (x_v-x_w)^2.$$
Proof using indicator functions
Note that the $v$th entry of $Lx$ is \begin{align} (Lx)_v &= \deg(v) \, x_v - \sum_{w\in\Gamma(v)} x_w \\ &= \sum_{w\in\Gamma(v)} (x_v-x_w) \\ &= \sum_{w\in V} 1_{\Gamma(v)} (w) \cdot (x_v-x_w). \end{align} Then, \begin{align} y^{\rm T}\!Lx &= \sum_{v\in V} y_v (Lx)_v \\ &= \sum_{v\in V} \sum_{w\in V} 1_{\Gamma(v)} (w) \cdot y_v(x_v-x_w). \end{align} Pick $f(v,w) := 1_{\Gamma(v)} (w) \cdot y_v(x_v-x_w)$ so that $1_{\Gamma(v)} (w) = 1_{\Gamma(w)} (v) = 1_E (\{v,w\})$ and $f(v,v)=0$, then spread the sum over half the indexes: \begin{align} y^{\rm T}\!Lx &= \sum_{v\in V} \sum_{w\in V, \\ w<v} \big( 1_{\Gamma(v)} (w) \cdot y_v(x_v-x_w) + 1_{\Gamma(w)} (v) \cdot y_w(x_w-x_v) \big) \\ &= \sum_{v\in V} \sum_{w\in V, \\ w<v} 1_E (\{v,w\}) \cdot \big( y_v(x_v-x_w) + y_w(x_w-x_v) \big). \end{align} Pick $g(v,w) = y_v(x_v-x_w) + y_w(x_w-x_v) = (y_v-y_w)(x_v-x_w)$ to relate the halved double sum with a single sum over the edges: $$y^{\rm T}\!Lx = \sum_{\{v,w\}\in E} (y_v-y_w)(x_v-x_w).$$ Letting $y=x$ yields the result. $\ \square$