Source: https://web.stanford.edu/class/math61cm/innerproducts.pdf