2
$\begingroup$

You can add lots of things together using summation notation $$\sum_{n=1}^5 n = 15$$

Is there a similar operator for logical "and" and "or"?

I considered $\exists$/$\forall$, but that doesn't allow me to easily specify how to determine the answer in some cases.

$\endgroup$
  • 1
    $\begingroup$ Please edit the question to show us several sample usages for the notation you are looking for. What are the operands (the things being andored)? $\endgroup$ – Ethan Bolker Nov 20 '20 at 21:29
  • $\begingroup$ $\bigwedge f_i$ is the conjunction of the formulas $f_i$, $\bigvee f_i$ is the disjunction. $\endgroup$ – symplectomorphic Nov 20 '20 at 21:29
  • $\begingroup$ What's a case where quantifiers don't work? $\endgroup$ – Acccumulation Nov 21 '20 at 5:49
  • $\begingroup$ @Acccumulation Might not be what the OP was thinking of, but quantifiers don't exist in propositional logic and yet you might still want to take an extended conjunction or disjunction. $\endgroup$ – dbmag9 Nov 21 '20 at 9:55
  • $\begingroup$ @Acccumulation I was expressing an algorithm in which one of many recursive calls had to return true. I could have used $\exists$ and written out the fact that you should use a for loop, but it felt cleaner to just use the notation suggested in the accepted answer and have the implementation implied. $\endgroup$ – jpear1 Nov 23 '20 at 7:57
9
$\begingroup$

Use \bigvee and \bigwedge , $$ \bigvee_{i=1}^{100} X_i $$ and $$ \bigwedge_{i \in I} X_i \text{,} $$ respectively.

See also What is the meaning of $\bigvee$ (bigvee) operator

Be aware that these are also used for meets and joins (lattice theory). Depending on your context, it could be a good idea to explicitly introduce this notation.

$\endgroup$
2
$\begingroup$

Interestingly, you can quite easily use a statement like $$(\forall i\in I)(\exists a_i\in A_i)$$ to get repeated "there exist" statements and similarly you could use $$(\forall i\in I)(\forall a_i \in A_i)$$ to get repeated "for all" statements. You would just need to define the set $I$ and the sets $A_i$. Note that each $a_i$ is not necessarily unique, and in the second statement, $a_i$ is unique only when $|A_i|=1$.

$\endgroup$
  • 1
    $\begingroup$ The parentheses around the quantifiers look weird, as if their scope would be empty. Is this common notation in some subfield of math? $\endgroup$ – ComFreek Nov 21 '20 at 8:40
  • $\begingroup$ @ComFreek Oh, sorry, I haven't read too many papers so am not sure what the standard is. I was taught to use parenthesis around the quantifiers for clarity/neatness. I'm sure there is a better notation than what I use; however if $X(a_i)$ was a proposition dependent on $a_i$ I would write the first expression as $(\forall i\in I)(\exists a_i\in A_i) X(a_i)$. What form is typical/what form would you use? $\endgroup$ – RyanK Nov 21 '20 at 17:53
  • $\begingroup$ Just for reference, this is the notation used in the textbook for the foundations of math class (proof writing class) that I took, "A Transition To Advanced Mathematics" by Smith, Eggen and Andre (seventh edition). They even use parenthesis around the property itself, for instance on page 22, "'For every rational number there is a larger integer' may be symbolzed by ... $(\forall x\in \mathbb{Q})(\exists z\in \mathbb{Z})(z>x)$." $\endgroup$ – RyanK Nov 21 '20 at 18:04
  • $\begingroup$ Interesting, never saw that notation at length. In TCS, I usually encounter $\forall x \in \mathbb{Q}.\;\ldots$ or $\forall x \colon \mathbb{Q}.\;\ldots$. This also resembles the notation $\lambda x\colon\mathbb{Q}.\;\ldots$ from lambda calculus. The convention is that the quantifier's body extends as far to the right as possible. A similar convention must be present in your notation, too: $(\forall \in \mathbb{Q})(\exists z\in\mathbb{Z}(z > x)$ only makes sense if the second and third parenthesized terms bind together first. $\endgroup$ – ComFreek Nov 22 '20 at 8:34
0
$\begingroup$

You mentioned in a comment that this came up in an algorithmic context. In programming terms, the general expression for this is reduce(operation, iterable) (of course, this implies that you're dealing with an associative binary operator; reduce(mean, iterable) isn't going to get the mean of the iterable), e.g. reduce(or, (f(_) for _ in range(k))). There's also any(f(_) for _ in range(k)). Those are the Python syntax, but if you're doing psuedo code, this should be clear even to CS people who aren't familiar with Python. In mathematical logic terms, it would be $\exists n:f(n)$.

$\endgroup$

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.