# Bellman and Lagrange equation used at the same time

I just encounter a strange maximization problem in Sargent's Recursive Macroeconomic Theory book, when they have Bellman equation and Lagrange equation at the same time.

Specifically: $$P(v) = \max_{c_s, w_s} \sum_s \pi_s [\bar{y}_s - c_s) + P(w_s)] \\ s.t \sum_s \pi_s u( c_s) + \beta w_s \geq v \\ u(c_s)+ \beta w_s \geq u(\bar{y}_s) + \beta v_{aut}$$

Then, they write the lagrange function: $$L= \sum_s \pi_s [\bar{y}_s - c_s) + P(w_s)] + \mu \{\sum_s \pi_s u( c_s) + \beta w_s - v \} + \lambda_s \{u(c_s)+ \beta w_s -u(\bar{y}_s) - \beta v_{aut} \}$$

And then they apply the Envelope theorem and get: $$P'(v) = -\mu$$

I could not find any note on the internet teach something mix between Bellman equation and Lagrange like that, so I don't know what is the general rule to solve Bellman equation with constraints and derive Envelope equation.

If anyone know any material talking about it, plz kindly let me know.

Thanks a lot!