sum of weighted basis functions: $$\begin{aligned}
\label{eq:Qhat}
\hat{Q}_{0}&={\boldsymbol{w}}^\intercal{\boldsymbol{\phi}}\left({\boldsymbol{x}}_k, {\boldsymbol{u}}_k, {\boldsymbol{r}}_k, \dots, {\boldsymbol{r}}_{k+N}\right)={\boldsymbol{w}}^\intercal{\boldsymbol{\phi}}({\boldsymbol{z}}_k).\end{aligned}$$ Here, ${\boldsymbol{w}}\in\mathbb{R}^{{L}}$ is a weight vector and ${\boldsymbol{\phi}}:\mathbb{R}^{(N+2)n+m}\rightarrow\mathbb{R}^{{L}}$ is a vector of basis functions. Note that, in contrast to usual Q-function approximations, $\hat{Q}_{0}$ in explicitly incorporates the reference trajectory ${\boldsymbol{r}}_k, {\boldsymbol{r}}_{k+1}, \dots, {\boldsymbol{r}}_{k+N}$.

\[lemma:Qexakt\_long\] With $$\begin{aligned}
\label{eq:L}
    L=&~\frac{1}{2}\left((N+2)n+m\right)\left((N+2)n+m+1\right)\nonumber\\&~-\left(n^2(2N-1)+mn\right)
    \end{aligned}$$ quadratic basis functions ${{\boldsymbol{\phi}}={\begin{bmatrix*}[r]\phi_1 & \cdots & \phi_L
\end{bmatrix*}}^\intercal}$, there exists a weight vector ${\boldsymbol{w}}={\boldsymbol{w}}^*$ such that $\hat{Q}_{0}=Q_{0}$.

Due to the symmetry and the zeros in ${\boldsymbol{H}}_K$ (cf. ) and therefore also in ${\boldsymbol{H}}$, there are $L$ non-redundant elements in ${\boldsymbol{H}}$. Define quadratic basis functions $\phi_l$, $l=1,\dots,L$ of the form $$\begin{aligned}
    \phi_l= \begin{cases}\left\{{\boldsymbol{z}}_k\right\}_i\left\{{\boldsymbol{z}}_k\right\}_j, &\text{for } i\neq j \\ \frac{1}{2}\left\{{\boldsymbol{z}}_k\right\}_i^2, &\text{for } i=j,\end{cases}
    \end{aligned}$$ where $i, j$ indicate the corresponding non-redundant elements of ${\boldsymbol{H}}$, $\left\{{\boldsymbol{\cdot}}\right\}_i$ denotes the $i$-th element of a vector and ${\boldsymbol{z}}_k$ is defined as in . Thus, $Q_{0}$ in is equivalent to $\hat{Q}_{0}$ in if the weights $\left\{{\boldsymbol{w}}\right\}_i$, $i=1, \dots, L$, are equal to the corresponding non-redundant elements in ${\boldsymbol{H}}$ which we denote by ${\boldsymbol{w}}={\boldsymbol{w}}^*$.

Although $L$ in Lemma \[lemma:Qexakt\_long\] gives the maximum number of weights needed in order to parametrize $Q_{0}$ exactly, in the frequently occurring case of a sparse weighting matrix ${\boldsymbol{Q}}$ in the cost 