In a textbook (on economics, not "pure" mathematics), one definition requires that some condition holds for any $x,\ x' \in X$, and right afterwards another one requires that some other condition holds for all $x,\ x' \in X$.

My question: is there a difference between the two (for any, for all)?

Though searching for previous questions returns thousands of results for the query "for any" "for all", I couldn't find this specific one. Sorry if I missed it.

  • 9
    $\begingroup$ This seems to depend on the context: "For all $x \in X$ $P(x)$" is the same as "For any $x \in X$ $P(x)$" On the other hand "If for any $x\in X$ $P(x)$, then $Q$" means that the existence of at least one $x \in X$ with $P(x)$ implies $Q$, so $P(x)$ doesn't need to hold for all $x \in X$ to imply $Q$. $\endgroup$
    – user79202
    Jun 27 '13 at 9:01
  • 2
    $\begingroup$ I think it is, most often, a matter of choice. The symbol $\forall$ sometimes is read "for every", sometimes "for each", sometimes "for any". $\endgroup$
    – Siminore
    Jun 27 '13 at 9:02
  • 2
    $\begingroup$ @user79202 I understand your distinction, but wouldn't one, in the latter case (where you write "If for any $x\in X\ P(x)$, then $Q$") rather say "If $\exists x\in X$...")? So that would mean that in those cases where $\exists$ is not applicable, "for any" and "for all" are equivalent? $\endgroup$
    – Bernd
    Jun 27 '13 at 9:05
  • 1
    $\begingroup$ @Siminore So "a matter of choice" means that they are actually equivalent? Sorry... $\endgroup$
    – Bernd
    Jun 27 '13 at 9:06
  • 1
    $\begingroup$ In the context of your question they are equivalent. user79202's example is fine. In the first example "for any" and "for all" mean the same. In the second example "for any" and "there exists" mean the same, you could just as well use $\exists$ there. $\endgroup$
    – m_l
    Jun 27 '13 at 9:13

This seems to depend on the context: "For all $x \in X \ P(x)$" is the same as "For any $x∈X \ P(x)$" On the other hand "If for any $x∈X \ P(x)$, then $Q$" means that the existence of at least one $x\in X$ with $P(x)$ implies $Q$, so $P(x)$ doesn't need to hold for all $x \in X$ to imply $Q$.

  • $\begingroup$ what about " if $x \not \in E_a$ for any $a$ hence $x \in E^c_a $ for any $a$"? $\endgroup$ Jan 25 '18 at 16:13
  • 1
    $\begingroup$ I think $P(x)$ does still need to hold for al $x\in X$ though. $\endgroup$
    – asn32
    Feb 13 '18 at 16:56

"Any" is ambiguous and it depends on the context. It can refer to "there exists", "for all", or to a third case which I will talk about in the end.


Oxford Dictionary:

  1. [usually with negative or in questions] Used to refer to one or some of a thing or number of things, no matter how much or how many.
    [as determiner] ‘I don't have any choice’
    which means there does not exist a choice
  2. Whichever of a specified class might be chosen.
    [as determiner] ‘these constellations are visible at any hour of the night’
    which means for all hours

Also in Oracle database I remember a query to return the employees where employee.salary > any(10,20,30,40) which means the salary of the returned employee must be bigger than 10 or 20 or 30 or 40 which means "there exist" one salary in that tuple such that the employee.salary is bigger than it.

Same ambiguity is in math, since math did not come from nothing, rather it a notation system for the language.


Some times "any" is used for the meaning of "any" and not "exist" or "all". For example, in the definition of the little o asymptotic notation we have:

$o(g(n))$ = { $f(n)$: for any positive constant c>0, there exists a constant $n_0>0$ such that $0 \leq f(n) < c g(n)$ for all $n \geq n_0$ }

Here "any" means "any" which is two things "there exists" and "for all" how??

  1. If you take any as "for all c" then the meaning is wrong because $n_0$>0 is attached to some choice of c and for each c there may be a different $n_0$>0. And you can not find a fixed $n_0$ for all c that satisfies the remaining because c can go very close to zero like c=0.000....00001

  2. If you take any as "there exist c" then the meaning is wrong also because for some c the remaining may apply but for another c the remaining may not apply.
    Example: let $f(n)=n$ and $g(n)=2n$:
    If $c=1$ then $n < 1 \times (2n)$ for $n \geq n0>0$
    But if $c=0.1$ then $n > 0.1 \times (2n)$ for all $n\geq n0>0$

So here "any" means "any" which is for all but one at a time , so in the little o asymptotic notation "any" means for all c>0 pick one at a time and the remaining should be satisfied.

Conclusion: Either do not use "any" in Math or explain to the reader what it means in your context.

  • 1
    $\begingroup$ Another common example for why to avoid "any" in mathematics is "pick any woman you want to be your wife". This doesn't mean you can choose every woman. $\endgroup$
    – DanielV
    May 7 '19 at 10:59
  • $\begingroup$ @DanielV correct "any" is confusing $\endgroup$ May 7 '19 at 11:07
  • 1
    $\begingroup$ I think your example for the third meaning is wrong. There, "for any" simply does indeed mean "for all". You can state that statement with existential quantifiers, and you would use $\forall c$, and with no confusion involved. I believe a third meaning does not exist. $\endgroup$ Dec 24 '19 at 10:34
  • $\begingroup$ indeed the third meaning is nonsense. "for all c there is an n_0" means, because of the order of these statements, that the n_0 may depend on c. $\endgroup$
    – peter
    Feb 7 at 13:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.