Suppose $X$ is a $n\times m$ matrix. And also define $x_i$ to be (part of) the $i$-th column of $X$:
$$ X = \begin{bmatrix} 1 & 1 & ... & 1 \\ x_1 & x_2 & ... & x_n \\ \end{bmatrix} $$
Is it true that: $$ x_i (X^TX)^{-1} x_i^T = \frac{1}{n} + \frac{(x_i - \bar{x})(x_i - \bar{x})^T}{\sum_{j=1}^n(x_j - \bar{x})(x_j - \bar{x})^T} $$
In a sense it all makes sense, since $X^TX$ should act like normalization to the whole thing and trying the special cases it works. Although I don't find a way to prove it for general case. One big difficulty is that I don't know how to model the matrix inverse $(X^TX)^{-1}$. Any ideas?
Update: another form of this is implied in this work (equation 3.1), where it defines: $$H = X (X^TX)^{-1} X^T$$
where $h_{ii}$ is the $i$-th diagonal element of this matrix.