I am struggling to understand what is the difference between an optimal policy and a greedy policy.
Let $F(r_{t+1},s_{t+1}| s_t,a_t)$ be the probability distribution accorting to which, given action $a_t$ in state $s_t$, reward $r_{t+1}$ realizes and the process transitions to a new state $s_{t+1}$. The value function for a generic policy $\pi$ then is
$$v_\pi(s_t) = E_\pi \left[ E_F \left[ r_{t+1} | s_t,a_t \right]+ \delta E_F \left[v_\pi \left(s_{t+1}\right)| s_t,a_t \right] \right],$$
and the optimal value function is
$$ v_*(s_t) = \max_\pi \, v_\pi(s_t).$$
I would like to know if the optimal value function can also be defined as $$v_*(s_t) = \max_{a \in A(s_t)} \big\{ E_F \left[ r_{t+1} | s_t,a \right]+ \delta E_F \left[v_* \left(s_{t+1}\right)| s_t,a \right] \big\},$$ and if not, why. Here, the bellman equation prescribes to behave greedily by always choosing the best action $a \in A(s)$.
To me, behaving greedily and choosing the optimal policy seem equivalent, which confuses me a bit.