# Is this a linear constraint?

I'm wondering, is the following a linear constraint

$$x + ry \geq 12 , \quad r \in [2, 3]$$

$$x,y \in {\rm I\!R}$$

I don't think it is, because it's not defined everywhere where x and y are. If that condition for r was not there, then it would be linear.

• What are the variables? – Rodrigo de Azevedo Oct 28 '19 at 22:38
• @RodrigodeAzevedo real numbers. – AlfroJang80 Oct 28 '19 at 22:58
• A linear constraint cannot contain a product of variables. – Rob Pratt Oct 28 '19 at 23:10
• @RobPratt My apologies. The variables here x and y. r is just a constant that could be anything from the set [2, 3] – AlfroJang80 Oct 28 '19 at 23:35
• Then the constraint is linear for each fixed $r$. – Rob Pratt Oct 28 '19 at 23:45

Yes, it is a linear constraint. $$x+ry\geq 12$$ is linear for any constant coefficient $$r$$. The fact that you know additional information about $$r$$ (namely, that it happens to lie in the set $$[2,3]$$) does not change the linearity of the constraint.
For example, $$px+y\geq 2$$ is also linear for a coefficient $$p$$, even when you know that in particular $$p=4$$. The key thing is that the coefficient is a constant and not a variable.
You mentioned that the constraint is "not defined everywhere where x and y are". Perhaps a misconception. The constraint is defined using the constant $$r$$, (which we know lies in $$[2,3]$$), but that doesn't mean the constraint only holds for $$x,y\in[2,3]$$ or anything like that. Instead, the constraint is defined for all real $$x$$ and $$y$$.