# How can I solve $y \in (N_X + \nabla f)(x)$ via projection?

I a aware that if I'm trying to solve for $x$ the problem

$y \in [\lambda I + N_X](x)$

where $y$ is a known vector, and $N_X$ is the normal cone given by

$N_X(x) = \{u : \langle u, x - y\rangle \geq 0 \forall y \in X\}$

then the solution is given in terms of the projection of $y$ onto $X$. Also if $A$ is an inversible matrix, there's a trick that makes it possible to compute the solution of $y \in [\lambda A + N_X](x)$ as well. But what about if you replace the linear operator by something like the gradient of a convex differentiable function? Namely, consider the problem of finding the solution of

$y \in [\lambda \nabla f + N_X](x)$

Is there a way to solve this for $x$, giving the solution in terms of the projection of a vector onto the set $X$?

I suppose that $X$ is convex. Then the inclusion is the necessary optimality condition of $$\min_{x\in X} \lambda f(x) - x^Ty.$$ If $x^*$ is a solution, then it satisfies $$(\lambda \nabla f (x^*) - y)^T(x-x^*)\ge0\quad \forall x\in X,$$ which is equivalent to $$y-\lambda \nabla f (x^*) \in N_X(x^*),$$ which is the inclusion you are after.

The case of the projection of $y$ onto $X$ is the special case $f(x)=\frac12\|x\|^2$.
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://math.stackexchange.com/questions/1198610/how-can-i-solve-y-in-n-x-nabla-fx-via-projection", "fetch_time": 1582044299000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2020-10/segments/1581875143784.14/warc/CC-MAIN-20200218150621-20200218180621-00502.warc.gz", "warc_record_offset": 484894496, "warc_record_length": 30644, "token_count": 397, "char_count": 1255, "score": 3.5, "int_score": 4, "crawl": "CC-MAIN-2020-10", "snapshot_type": "latest", "language": "en", "language_score": 0.857805073261261, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00051-of-00064.parquet"}