# How to tag both the align and individual equations within it?

I was trying to create tags for both the optimization problem and individual constraints within it. Below is an example. Is this possible in LaTex?

  \begin{align}\tag{P1}
\begin{split}
\max_{x,y} & f(x,y) \\
s.t.  & x+y \leq 5 \tag{constraint1} \\
& x+2y \geq 10 \tag{constraint2}
\end{split}
\end{align}


Another solution, with the mini! environment from the optidef package, which is dedicated to the formatting of optimisation problems:

\documentclass{article}
\usepackage[short]{optidef}

\begin{document}

\begin{mini!}
{(x, y)}{f(x, y) \tag{P1}\label{P1}}
{}{}
\end{mini!}

\end{document}


You could try with this not elegant suggestion:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{align}