I am looking to find information on the optimality conditions on a constrained optimization of the following form (assume that all functions are either affine or suitably convex/concave where applicable):
$\max_{\mathbf{x}(\theta), \mathbf{y}} \int_{\theta} g_0(\mathbf{x}(\theta);\mathbf{y})f(\theta)d\theta \\ \textrm{s.t.} \\g_i(\mathbf{x}(\theta);\mathbf{y}) \leq 0 \quad \forall \theta, \quad i=1, ..., m \\ h_j (\mathbf{x}(\theta);\mathbf{y}) = 0 \quad \forall \theta, \quad j = 1, ..., k \\ \int_\theta f(\theta)d\theta = 1.$
I guess that this should be fairly standard, but I have been unable to find good resources to explain it. Thanks in advance!
Edit: As an example, consider the following case:
$\max_{x_1(\theta), x_2(\theta), y_1, y_2} \int_{\theta} (ax_1(\theta) - bx_1^2(\theta) - cx_2(\theta) - dy_1 - ey_2) f(\theta)d\theta \\ \textrm{s.t.} \\ 0 \leq x_2(\theta) \leq y_1 \quad \forall \theta \\ x_1(\theta) - x_2(\theta) - y_2 = 0 \quad \forall \theta \\ y_1, y_2, x_1(\theta) \geq 0 \\ \int_\theta f(\theta)d\theta = 1.$
I've looked more into stochastic optimization and have found that this can be reframed as a stochastic optimization problem with recourse:
$\max_{x_1(\theta), x_2(\theta), y_1, y_2} - dy_1 - ey_2 + \mathrm{E}_\theta[Q(x_1(\theta), x_2(\theta), y_1, y_2, \theta)] \\ \textrm{s.t.} \; y_1, y_2 \geq 0 \\ \textrm{where} \; Q(x_1(\theta), x_2(\theta), y_1, y_2, \theta) = \max_{x_1(\theta), x_2(\theta)} ax_1(\theta) - bx_1^2(\theta) - cx_2(\theta)\\ \textrm{s.t.} \\ 0 \leq x_2(\theta) \leq y_1 \\ x_1(\theta) - x_2(\theta) - y_2 = 0 \quad \\ x_1(\theta) \geq 0$
Now, can I simply plug in the Lagrangian of the "lower level" into the the original optimization to yield a single-level optimization problem again?