Dual basis (source code)

= Dual basis
{title2=$e_i^*(e_j)=\delta_{ij}$}
{wiki}

= Dual bases
{synonym}

For a <basis> $e_1,\ldots,e_n$ of a finite-dimensional <vector space> $V$, its <dual basis> consists of <linear functionals> $e_1^*,\ldots,e_n^*$ satisfying
$$
e_i^*(e_j)=\delta_{ij}.
$$
The <Kronecker delta> means that each rule gives one on its own <basis vector> and zero on the others. These rules extract coordinates:
$$
v=\sum_{i=1}^n e_i^*(v)e_i.
$$
Applying $e_i^*$ to a <linear combination> removes every term except the $i$th. Consequently the <dual basis> is a <basis> of the <dual space>, and every <linear functional> has expansion $\varphi=\sum_i\varphi(e_i)e_i^*$. <Linear Algebra Done Right by Sheldon Axler (4th edition)>[Axler, Linear Algebra Done Right, fourth edition, §3F, definitions and results 3.112–3.116]{ref}.

Coordinate extraction works for a nonorthogonal <basis> too. With $b_1=(1,0)$ and $b_2=(1,1)$, the <dual basis> is
$$
b_1^*(x,y)=x-y,\qquad b_2^*(x,y)=y.
$$
The checks $b_1^*(b_1)=1$, $b_1^*(b_2)=0$, $b_2^*(b_1)=0$, and $b_2^*(b_2)=1$ fix the two rules. For $v=(3,1)$ they give \b[coordinates $(2,1)$], so $v=2b_1+b_2$. The usual <dot products> with $b_1,b_2$ instead give $3,4$ and do not extract these coordinates: simple projection formulas depend on an <orthonormal basis>.

\Image[/dual-basis-skew-coordinates.png]
{title=The <dual basis> extracts coefficients in a skew <basis> by two scalar-valued measurements}

The same idea explains <polynomial interpolation>. On <polynomials> of <polynomial degree> at most $n$, evaluation at distinct <interpolation nodes> $x_0,\ldots,x_n$ gives the <dual basis> to the <Lagrange cardinal polynomials>, because $\ell_i(x_j)=\delta_{ij}$. Samples are coordinates in this <basis>, so the reconstruction $p=\sum_i p(x_i)\ell_i$ is a dual-basis expansion. <Differentiation weights from nodal evaluations> and <factorial monomial basis for polynomial differentiation> apply the same principle to different measurements.