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

120 Views Asked by At

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.

Please help me.

2

There are 2 best solutions below

8
On

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

3
On

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$