# In logics , there exists for atleast two or more elements?

Lets say, I have a set $S= \{2,3,5,6,7\}$. I am having a logic query, if atleast $2$ elements greater $5$ is found in this set, then It should return true. $\exists x: (x>5)$. This formula works even if $S= \{2,3,5,6 \}$ but I want a formula works only if $2$ or more elements greater than $5$ is found.

-

Try $$\exists x.\ x > 5 \land \exists y.\ y > x,$$ please note that the left quantifier extends its scope to the end of formula, i.e.

$$\exists x.\ \bigg((x > 5) \land \Big(\exists y.\ (y > x)\Big)\bigg).$$

Try to construct analogous expression for 3 elements $\ddot\smile$

-
It will by more convenient and readable if $\exists y$ is moved outside to same level as $\exists x$ – Trismegistos Aug 22 '13 at 8:30
@Trismegistos I wrote it that way for the benefit of Matt (however, he removed his formula). – dtldarek Aug 22 '13 at 8:41
@dtldarek Sorry, I didn't want to leave wrong things lying around. I appreciate it though! – Matthew Pressland Aug 22 '13 at 9:10

You can specify that a pair of objects should exist, e.g. $\exists\:(x,y) :(x>5\wedge y>5 \wedge x\ne y$).

-
Thanks for you help. I prefer the first one. My logic language doesnt support conjunction. – Proton Boss Aug 21 '13 at 13:42
In what language is the first well-formed? -- unless the comma is just a notational variant for $\land$? – Peter Smith Aug 21 '13 at 13:47
Also, in the second formula, the right appearance of $x$ is free (the scope of quantifier of left $x$ ends with the parenthesis). And you miss one closing parenthesis too. – dtldarek Aug 21 '13 at 13:49
Hmm - the problem here is that I'm not a logician (although I can at least answer that the comma is indeed a substitute for $\wedge$). This is my own fault for not reading the tags; I'd read this as more of a programming question, so my answer should be read as a sort of pseudocode. If the second statement is completely wrong, I can just delete it (rather than worrying about how to fix the parentheses). If the first statement is also wrong then the entire answer should probably go. – Matthew Pressland Aug 21 '13 at 13:52
Well, I would say this is a good opportunity for you to learn ;-) Could you imagine, why a compiler would complain about the right $x$ begin undefined? – dtldarek Aug 21 '13 at 14:00