I want to maximize $$F(w):=\sum_{1\le i,\:j\le2}\int\lambda^{\otimes2}({\rm d}(x,y))\left(w_i(x)f_j(x,y)\wedge w_j(y)f_i(y,x)\right)g_{ij}(x,y)$$ over the closed convex set $$S:=\left\{w\in{\mathcal L^2(\mu)}^2:w_1+w_2=1\;\mu\text{-almost surely}\right\},$$ where $(E,\mathcal E,\lambda)$ is a measure space, $\mu\ll\lambda$ is a probability measure on $(E,\mathcal E)$ and $f_i,g_{ij}:E^2\to[0,\infty)$ are $\mathcal E$-measurable.

By [Theorem 10.47](https://books.google.com/books?id=1d5HAAAAQBAJ&pg=PA221&dq=clarke+%22where,+as+before,+the+functions%22&hl=de&sa=X&ved=0ahUKEwj_jOW3keLkAhWMY1AKHVeFDD0Q6AEIKzAA#v=onepage&q=clarke%20%22where%2C%20as%20before%2C%20the%20functions%22&f=false) in the book of Clark, if $w^\ast$ is a minimizer of $F$ over $S$, then $$0\in\partial F(w^\ast)+N_S(w^\ast)\tag1,$$ where $\partial F(w^\ast)$ denotes Clarke's generalized gradient of $F$ at $w^\ast$ (see Definition 2 on page 53 in the [paper of Clarke](https://pdf.sciencedirectassets.com/272585/1-s2.0-S0001870800X02502/1-s2.0-0001870881900323/main.pdf?X-Amz-Security-Token=AgoJb3JpZ2luX2VjEMD%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJIMEYCIQDncC3kz2PE7TC8KlgxOrKGXZboogmvjd%2FWr3oL3dR8TgIhAO8c6uJpTlXb9BVyFg091nHZAVaJXBNMXIiwuBN1mXXyKuMDCIn%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEQAhoMMDU5MDAzNTQ2ODY1Igx0g%2BgnzEdovUHHPU8qtwPLOK0uSYKkcP7Epkqzua2wNo0VVHHF379AxjWXRGpFY2cM081ElPcXHr1WZQtCbSIGpdbavxbfPcTqlJuYSevJkksJT%2FlTmwcNxrSw9bpWhjw2DhX%2B3fqk1GRnZ38Lsvfcqhrlt2rNspAWIQe%2F93eD4Sii8P%2BZFbMjgkDuvISlsym0wzORJ%2B%2FTxeH5w4mdIq4gMQ1Vbgw6LV%2FBcxx5sydeS9Vyd3PFh5ZMl5H5uH71ZBRO2gLXBK2RHLGHk5oipEf%2B5EPIrNfnu2eYRQnFFmxrrD5gqAO1ZVhUh%2BrDgpHjNV6XqvSRHFOH7F6LqVJv%2FOlW5UhnrXfewMQVprtXQ8054GHH3WEgx%2FqWQML%2F957vcYRFPrVCrm8VTb7%2B3AtsY8rOcN%2F00%2F11Zg6wd1LYJR8iG714rurZzbEWqOlLEzoJaPNTLP1vwRBkb%2B91%2FLVaT9CjSqULYvMaTldbq%2FMqney8QmpTo6mUQeqYwD2b%2BNk8GXYpIPeKBLy2Mrtnub8BuznaLqv%2FVSBUtdUuqFAPjIc90dsf15KvkFpuriZN4IZb3OJh%2B5Fi%2Bgw29Oa9WF%2BA8K3OfD%2FTEhj8MOG6h%2BwFOrMB1oE6S0%2FJS%2BJ%2BPfsR2be%2F8gKCc4EDj8IVnr%2BZuSOMvbIhoxhywZqpXDvGS8MNgJv4axqZ2OL2CSBcjs7SfOazxHzmcRBqL9veYQi5e0sUL0F6X%2BoD%2FRukrdisUZMuNXF%2FDDE%2BMIcuefsmOHVTd0DR1hUuZTSZi%2B5Oqj%2BSTqhE6YrwX6Ewtx%2BgV1dJMJf91cQlT7wEZU%2FKvVYrOrDE6d4IkUniYnNnIW11n5%2B4metofUYDjhY%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20190918T084923Z&X-Amz-SignedHeaders=host&X-Amz-Expires=300&X-Amz-Credential=ASIAQ3PHCVTYZ5D4I5AJ%2F20190918%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=3794a3cd286dac45255e2a59e02bd53c8def7f8f6c193d95480e0f6d7be8fb67&hash=33ba1fda1dfb5fb50522e5f436a6cd1f37852dec06e1854e80f94e5019494ea5&host=68042c943591013ac2b2430a89b270f6af2c76d8dfd086a07176afe7c76c2c61&pii=0001870881900323&tid=spdf-d0e3327f-85c2-421d-a45c-8e6f4ab0cf5d&sid=b376c27b7e56944aa038dc543f341a6f5a61gxrqa&type=client)) and $$N_S(w^\ast):=\left\{\varphi\in\left({L^2(\mu}^2\right)':\langle\varphi,v-w^\ast\rangle\le0\text{ for all }v\in S\right\}$$ denotes the normal cone to $S$ at $w^\ast$.

Now, denoting the integrand in the definition of $F(w)$ at $(x,y)\in E^2$ by $F_{(x,\:y)}(w)$, by Theorem 1 on page 59 of [Clarke's paper](https://pdf.sciencedirectassets.com/272585/1-s2.0-S0001870800X02502/1-s2.0-0001870881900323/main.pdf?X-Amz-Security-Token=AgoJb3JpZ2luX2VjEMD%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJIMEYCIQDncC3kz2PE7TC8KlgxOrKGXZboogmvjd%2FWr3oL3dR8TgIhAO8c6uJpTlXb9BVyFg091nHZAVaJXBNMXIiwuBN1mXXyKuMDCIn%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEQAhoMMDU5MDAzNTQ2ODY1Igx0g%2BgnzEdovUHHPU8qtwPLOK0uSYKkcP7Epkqzua2wNo0VVHHF379AxjWXRGpFY2cM081ElPcXHr1WZQtCbSIGpdbavxbfPcTqlJuYSevJkksJT%2FlTmwcNxrSw9bpWhjw2DhX%2B3fqk1GRnZ38Lsvfcqhrlt2rNspAWIQe%2F93eD4Sii8P%2BZFbMjgkDuvISlsym0wzORJ%2B%2FTxeH5w4mdIq4gMQ1Vbgw6LV%2FBcxx5sydeS9Vyd3PFh5ZMl5H5uH71ZBRO2gLXBK2RHLGHk5oipEf%2B5EPIrNfnu2eYRQnFFmxrrD5gqAO1ZVhUh%2BrDgpHjNV6XqvSRHFOH7F6LqVJv%2FOlW5UhnrXfewMQVprtXQ8054GHH3WEgx%2FqWQML%2F957vcYRFPrVCrm8VTb7%2B3AtsY8rOcN%2F00%2F11Zg6wd1LYJR8iG714rurZzbEWqOlLEzoJaPNTLP1vwRBkb%2B91%2FLVaT9CjSqULYvMaTldbq%2FMqney8QmpTo6mUQeqYwD2b%2BNk8GXYpIPeKBLy2Mrtnub8BuznaLqv%2FVSBUtdUuqFAPjIc90dsf15KvkFpuriZN4IZb3OJh%2B5Fi%2Bgw29Oa9WF%2BA8K3OfD%2FTEhj8MOG6h%2BwFOrMB1oE6S0%2FJS%2BJ%2BPfsR2be%2F8gKCc4EDj8IVnr%2BZuSOMvbIhoxhywZqpXDvGS8MNgJv4axqZ2OL2CSBcjs7SfOazxHzmcRBqL9veYQi5e0sUL0F6X%2BoD%2FRukrdisUZMuNXF%2FDDE%2BMIcuefsmOHVTd0DR1hUuZTSZi%2B5Oqj%2BSTqhE6YrwX6Ewtx%2BgV1dJMJf91cQlT7wEZU%2FKvVYrOrDE6d4IkUniYnNnIW11n5%2B4metofUYDjhY%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20190918T084923Z&X-Amz-SignedHeaders=host&X-Amz-Expires=300&X-Amz-Credential=ASIAQ3PHCVTYZ5D4I5AJ%2F20190918%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=3794a3cd286dac45255e2a59e02bd53c8def7f8f6c193d95480e0f6d7be8fb67&hash=33ba1fda1dfb5fb50522e5f436a6cd1f37852dec06e1854e80f94e5019494ea5&host=68042c943591013ac2b2430a89b270f6af2c76d8dfd086a07176afe7c76c2c61&pii=0001870881900323&tid=spdf-d0e3327f-85c2-421d-a45c-8e6f4ab0cf5d&sid=b376c27b7e56944aa038dc543f341a6f5a61gxrqa&type=client), $$\partial F(w)\subseteq\int\lambda^{\otimes2}({\rm d}(x,y))\partial F_{(x,\:y)}(w)\tag2$$ for all $w\in{\mathcal L^2(\mu)}^2$.

For fixed $(x,y)\in E^2$, $\partial F_{(x,\:y)}(w)$ can be computed as in [this answer](https://mathoverflow.net/q/341912/91890). (The generalized gradient is only subadditive in general, but in the particular case, it should be additive.)

> At this point I'm stuck. What are we able to infer on the form of $w^\ast$ from what we know?

**EDIT**: Let $$G:{\mathcal L^2(\mu)}^2\to\mathcal L^2(\mu)\;,\;\;\;w\mapsto w_1+w_2-1$$ so that $S=\{G=0\}$. Since the Fréchet derivative of $G$ is given by ${\rm D}G(w)v=v_1+v_2$ for all $v,w\in{\mathcal L^2(\mu)}^2$, there should be a $\Lambda\in\mathcal L^2(\mu)$ with $$N_S(w^\ast)=\left\{\begin{pmatrix}\Lambda\\\Lambda\end{pmatrix}\right\}\tag3.$$ So, by $(1)$, there is a $\Phi\in\partial F(w^\ast)$ with $$0=\Phi+\begin{pmatrix}\Lambda\\\Lambda\end{pmatrix}\tag4.$$ Moreover, by $(2)$, there is a $\varphi:E^2\to{\mathcal L^2(\mu)}^2$ with $$\varphi(x,y)\in\partial F_{(x,\:y)}(w^\ast)\;\;\;\text{for }\lambda^{\otimes2}\text{-almost all }(x,y)\in E^2\tag5$$ and $\langle\varphi,v\rangle\in\mathcal L^1\left(\lambda^{\otimes2}\right)$ with $$\langle\Phi,v\rangle=\int\lambda^{\otimes2}({\rm d}(x,y))\langle\varphi(x,y),v\rangle\tag6$$ for all $v\in{\mathcal L^2(\mu)}^2$. Now it's possible to show that \begin{equation}\begin{split}&\int\lambda^{\otimes2}({\rm d}(x,y))\langle\varphi(x,y),v\rangle\\&\;\;\;\;=\int\left(\theta_1(x,y)f_1(x,y)v_1(x)+\left(1-\theta_1(x,y)\right)f_1(y,x)v_1(y)\right)g_{11}(x,y)\\&\;\;\;\;\;\;\;\;+\left(\theta_2(x,)f_2(x,y)v_1(x)+\left(1-\theta_2(x,y)\right)f_1(y,x)v_2(y)\right)g_{12}(x,y)\\&\;\;\;\;\;\;\;\;+\left(\theta_3(x,y)f_1(x,y)v_2(x)+\left(1-\theta_3(x,y)\right)f_2(y,x)v_1(y)\right)g_{21}(x,y)\\&\;\;\;\;\;\;\;\;+\left(\theta_4(x,y)f_2(x,y)v_2(x)+\left(1-\theta_4(x,y)\right)f_2(y,x)v_2(y)\right)g_{22}(x,y)\lambda^{\otimes2}({\rm d}(x,y))\end{split},\tag7\end{equation} where \begin{equation}\begin{split}\theta_1(x,y)&\in\begin{cases}\{1\}&\text{, if }f_1(x,y)w^\ast_1(x)<f_1(y,x)w^\ast_1(y)\\\{0\}&\text{, if }f_1(x,y)w^\ast_1(x)>f_1(y,x)w^\ast_1(y)\\ [0,1]&\text{, if }f_1(x,y)w^\ast_1(x)=f_1(y,x)w^\ast_1(y)\end{cases}\\\theta_2(x,y)&\in\begin{cases}\{1\}&\text{, if }f_2(x,y)w^\ast_1(x)<f_1(y,x)w^\ast_1(y)\\\{0\}&\text{, if }f_2(x,y)w^\ast_1(x)>f_1(y,x)w^\ast_1(y)\\ [0,1]&\text{, if }f_2(x,y)w^\ast_1(x)=f_1(y,x)w^\ast_1(y)\end{cases}\\\theta_3(x,y)&\in\begin{cases}\{1\}&\text{, if }f_1(x,y)w^\ast_1(x)<f_2(y,x)w^\ast_1(y)\\\{0\}&\text{, if }f_1(x,y)w^\ast_1(x)>f_2(y,x)w^\ast_1(y)\\ [0,1]&\text{, if }f_1(x,y)w^\ast_1(x)=f_2(y,x)w^\ast_1(y)\end{cases}\\\theta_4(x,y)&\in\begin{cases}\{1\}&\text{, if }f_2(x,y)w^\ast_1(x)<f_2(y,x)w^\ast_1(y)\\\{0\}&\text{, if }f_2(x,y)w^\ast_1(x)>f_2(y,x)w^\ast_1(y)\\ [0,1]&\text{, if }f_2(x,y)w^\ast_1(x)=f_2(y,x)w^\ast_1(y)\end{cases}\end{split}\tag8\end{equation}

> How can we proceed from here? $w^\ast$ is only implicitly involved in $(7)$ in the definitions of the $\theta_i$.