Solution (source code)

= Solution

Interpolation means $p_n(x_i)=f(x_i)$ for every node. Define the cardinal <polynomials> $\ell_i(x)=\prod_{j\ne i}(x-x_j)/(x_i-x_j)$, which are well defined because the nodes are distinct. They have <polynomial degree>[degree] $n$ and satisfy $\ell_i(x_j)=\delta_{ij}$. Hence
$$
\boxed{p_n(x)=\sum_{i=0}^nf(x_i)\ell_i(x)}
$$
belongs to $\Pi_n$ and interpolates. If two <polynomials> in $\Pi_n$ interpolate the same data, their difference has $n+1$ distinct zeros but <polynomial degree>[degree] at most $n$, so it is zero. This proves uniqueness. The phrase “of <polynomial degree>[degree] $n$” denotes membership in $\Pi_n$ here: the actual <polynomial degree>[degree] may be smaller, for example for constant data.