Optimisation using value function I have the following optimisation problem:

max $E_{0}\sum_{t=0}^{\infty}[log(c_{t}) + log(m_{t})]$ subject to $y + \frac{M_{t-1}}{p_{t}} + R_{t-1}\frac{B_{t-1}}{p_{t}} = c_{t} + m_{t}+b_{t}+\tau_{t}$

Where lower case letters indicate real variables and $R$ is the gross nominal interest rate.

I am trying to solve this using the value function approach but I am having a difficult time understanding what the state variable should be in this case. I tried using wealth as the state and formulated the following value function:

$V(a_{t}) = \max_{c_{t}, m_{t},b_{t}} [u(c_{t},m_{t}) + \beta V(a_{t+1})]$

where $a_{t} = y+ \frac{M_{t-1}}{p_{t}} + R_{t-1}\frac{B_{t-1}}{p_{t}} $ and initial values are assumed to be given. My problem now is that I don't know what to substitute for $a_{t+1}$. I have tried forwarding the left-hand side of the budget constraint (i.e $a_{t+1} =  y + \frac{m_{t}}{\pi_{t+1}} + R_{t} \frac{b_{t}}{\pi_{t+1}})$ and then differentiating w.r.t c,m and b but my results are very strange. Furthermore, if I have understood correctly, I also have to find $V_{a}(a_{t})$ which I cannot do with this substitution.

I am trying to learn this using Walsh's book and in his example, the budget constraint has capital which appears on both sides of the budget constraint, this allows him to re-write capital as a function of $a_{t}$. I tried to do the same but with real balances;

From the budget constraint I can write $m_{t} = a_{t}-c_t-b_t-\tau_t$

So, $V(a_{t}) = [u(c_{t},m_{t}) + \beta V(y + \frac{a_{t}-c_t-b_t-\tau_t}{\pi_{t+1}}) + R_{t} \frac{b_{t}}{\pi_{t+1}} ]$

Again I differentiate w.r.t c,m and b and this time my results are looking less crazy but still not correct. I get:

(c) $u_{c} - \beta V_{a}(a_{t+1})[\frac{1}{\pi_{t+1}}] = 0$

(m) $u_m + \beta V_{a}(a_{t+1})[\frac{1}{\pi_{t+1}}] = 0$

(b) $\beta V_{a}(a_{t+1})[\frac{R_{t}}{\pi_{t+1}} - \frac{1}{\pi_{t+1}}] = 0$

And lastly, $V_{a}(a_{t}) = \beta V_{a}(a_{t+1})[\frac{1}{\pi_{t+1}}] $

The final condition implies that $u_{c} = V_{a}(a_{t})$ which is similar to Walsh's answer but I can't seem to obtain a form of the Fisher equation and money demand function from my workings. 

There is also the equilibrium condition $c_{t} = y-g$ but I have no idea when to impose it. 

Any thoughts on what I have done incorrectly?
Starting with your original equation:

$max_{c_t, m_t, b_t} E_0\sum_{t=0}^\infty U(c_t, m_t)$

s.t.

(1) $y+\frac{m_{t-1}}{1+\pi_t}+\frac{1+i_{t-1}}{1+\pi_t}b_{t-1}=c_t+m_t+b_t+\tau_t$

Here: $R_{t-1} =1+i_{t-1}$ and $1+\pi_t=\frac{P_t}{P_{t-1}}$

Note that in this problem, you have have two state variables, $m_{t-1}$ and $b_{t-1}$, and your main issue have been that you have bunched these together. your Bellman should be:

$V(m_{t-1},b_{t-1})=max_{c_t, m_t, b_t} U(c_t,m_t)+E_t\beta V(m_t,b_t)$

s.t. (1)

You can here use your contstraint to get rid of one control, or you can solve it using the lagrangian. If you use your constraint to substitute for $c_t$, your updated problem becomes:

$V(m_{t-1},b_{t-1})=max_{m_t, b_t} U(c_t(y, m_{t-1}, b_{t-1},m_t, b_t, \tau _t),m_t)+E_t\beta V(m_t,b_t)$

For clarification:

$c_t(y, m_{t-1}, b_{t-1},m_t, b_t, \tau _t)=y+\frac{m_{t-1}}{1+\pi_t}+\frac{1+i_{t-1}}{1+\pi_t}b_{t-1}-m_t-b_t-\tau _t$

FOCs:

$[b_t$]: $-U_{c_t}+\beta E_tV_{b_t}=0 $

$[m_t]$: $-U_{c_t}+U_{m_t}+\beta E_tV_{m_t}=0$

Envelopes:

$[b_{t-1}]$: $U_{c_t}\frac{1+i_{t-1}}{1+\pi _t}\implies V_{b_t}=U_{c_{t+1}}\frac{1+i_t}{1+\pi _{t+1}}$

$[m_{t-1}]$: $U_{c_t}\frac{1}{1+\pi _t}\implies V_{m_t}=U_{c_{t+1}}\frac{1}{1+\pi _{t+1}}$

You should be able to combine these equations such that you find the demand for money. To me, your equilibrium condition (along with the fact that no capital is present in the set-up) impies that there is no saving in real variables, and hence you have nothing that can pin down the real interest rate, and you therefore lack information to find the fisher equation.