Let X is nxp (design) matrix and $H=X({X^\top}X)^{-1}{X^\top}$. We define $h_{ij}$ is an i-th row and j-th column entry of H and $x_i^\top$ is i-th row of $X$ , then show $$h_{ii}={x_i^\top}({X^\top}X)^{-1}x_i$$ and $$h_{ji}={x_j^\top}({X^\top}X)^{-1}x_i$$
I tried with definition of matrix multiplication of each entry, but was not straight forward. Anyone who has better idea or can solve with my approach?
Thanks in advance!