# How to generate a large number of constraints for all indices ($\forall i$)

Is it possible to generate a set of constraints in the form "$$\forall$$". For example:

\begin{align} \min\ & f\left(\sum x_i\right)\\ s.t.\ & \\ & x_i\geq 17 && \forall i=1,...,n. \end{align} What would be the best way to create this set of constraints in the code? Possibly when using FindMin or NMinimize.

• n=5; vars=Array[x,n]; NMinimize[{f[Total[vars]], And @@ (# >= 17 & /@ vars)}, vars] Jul 26 '20 at 2:30
• ForAll is for different things in Mathematica's Logic & Boolean Algebra features when used with Resolve,Reduce, and FindInstance and not relevant to numerical minimization here. Jul 26 '20 at 2:42
• NMinimize[Join[{f[Total[vars]]}, Thread[vars >= 17]], vars] should also do... When the first argument of NMinimize is a list, the first entry is interpreted as objective function and the remaining ones are interpreted as constraints. Jul 26 '20 at 8:49