2

I’m working through Example 2.3 in a logic text 1, which presents the formula

$$ \forall x.\;p\bigl(f(x), x\bigr)\;\to\;\Bigl(\exists y.\;p\bigl(f\bigl(g(x,y)\bigr), g(x,y)\bigr)\;\land\;q\bigl(x, f(x)\bigr)\Bigr). $$

The book reads this as:

“For all $x$, if $p(f(x), x)$ then there exists a $y$ such that $p\bigl(f(g(x,y)), g(x,y)\bigr)$ and $q\bigl(x, f(x)\bigr)$.”

However, I first thought it might mean:

“If for all $x$, $p(f(x), x)$, then there exists a $y$ such that $p\bigl(f(g(x,y)), g(x,y)\bigr)\;\land\;q\bigl(x, f(x)\bigr)$.”

My question has two connected parts. Why does the universal quantifier $x$, not become a part of the antecedent of the $\to$? How does one ascertain where a quantifier begins and ends? For instance, in the formula given above, it seems like the quantifier even controls $q$.

Reference

1 Aaron R. Bradley, Zohar Manna, The calculus of computation. Decision procedures with applications to verification, Berlin: Springer (ISBN 978-3-540-74112-1/hbk). xv, 366 p. (2007), MR2723322, Zbl 1126.03001.

ryang
  • 44,428
  • In my course, the priority of the quantifiers was lower than that of connectives. Compare how $c + a \cdot b$ reduces to $c + (a \cdot b)$ in number arithmetic. This means that the first one to "bind" the immediate symbols to the left and right is the connective: Replacing $+$ and $\cdot$ with $\forall$ and $\wedge$ means that $\forall x A(x) \wedge B(x)$ reduces to $\forall x (A(x) \wedge B(x))$. – Primož Jun 13 '25 at 14:07
  • 3
    The modern convention is that binders ($\forall$, $\exists$, $\lambda$, ...) extend as far as possible to the right. – Naïm Camille Favier Jun 13 '25 at 14:19
  • @ryang Thank you for improving the question. The book expands quantifiers throughout the formula, whereas the accepted answer in the addedum said "apply as little as possible" – desert_ranger Jun 17 '25 at 02:53
  • 1
    @desert_ranger Well, as pointed out by elliot's and my answers below, your book appears to be using the lambda calculus convention, which doesn't govern posts on a mathematics site. Not to belabour the obvous, but what's important is that whatever convention is in use is clearly communicated to the reader, and that conventions aren't unsystematically mixed and matched. – ryang Jun 17 '25 at 03:26

3 Answers3

4

The issue with your reading is that the occurrences of variable $x$ in the consequent are free, and this changes the meaning of the formula.

But your concern is correct. The best suggestion is: in order to avoid ambiguities, use enough parentheses:

$∀x[p(f(x),x) → (∃yp(f(g(x,y)),g(x,y)) ∧ q(x,f(x)))]$.

I think that the authors use dots as punctuation, but "dotting" is not so easy to be read and has been largely abandoned.

4

$$ \forall x.\;p\bigl(f(x), x\bigr)\;\to\;\Bigl(\exists y.\;p\bigl(f\bigl(g(x,y)\bigr), g(x,y)\bigr)\;\land\;q\bigl(x, f(x)\bigr)\Bigr). $$

The book reads this as:

“For all $x$, if $p(f(x), x)$ then there exists a $y$ such that $\color{cyan}{\Bigr(}p\bigl(f(g(x,y)), g(x,y)\bigr)$ and $q\bigl(x, f(x)\bigr)\color{cyan}{\Bigr)}$.”

Your book appears to be using the convention that a period immediately following a quantification signals that the quantification scopes as far rightwards as possible, and presenting the formula $$\forall x\color\red{\biggl(}p\bigl(f(x), x\bigr)\;\to\;\exists y\color{cyan}{\Bigl(}p\bigl(f\bigl(g(x,y)\bigr), g(x,y)\bigr)\;\land\;q\bigl(x, f(x)\bigr)\color{cyan}{\Bigr)}\color\red{\biggr)}.\tag1$$

Not everyone understands the period that way, in which case the alternative reading—following the (more sensible) convention that quantifiers bind more strongly than conjunctions—is $$\color\red{\Bigl(}\forall x \;p\bigl(f(x), x\bigr)\color\red{\Bigr)}\;\to\;\color{cyan}{\Bigl(}\exists y\; p\bigl(f\bigl(g(x,y)\bigr), g(x,y)\bigr)\color{cyan}{\Bigr)}\;\land\;q\bigl(x, f(x)\bigr).\tag2$$

Formula 1 is closed, whereas Formula 2 contains four free occurrences of $x$ (to clarify this, Formula 2's bound occurrences of $x$ can simply be renamed $z).$

However, I first thought it might mean:

“If $\color\red{\Bigl(}$for all $x$, $p(f(x), x)\color\red{\Bigr)},$ then there exists a $y$ such that $\color{cyan}{\Bigr(}p\bigl(f(g(x,y)), g(x,y)\bigr)\;\land\;q\bigl(x, f(x)\bigr)\color{cyan}{\Bigr)}\quad.\text”\tag3$

Your reading conflates the above conventions while being compatible with neither: you are reading that universal quantification's scope according to Convention 2 but reading that existential quantification's scope according to Convention 1! (Formulae 2 and 3 turn out to be logically equivalent, but only because predicate $q$ doesn't contain $y.)$

P.S. Regarding my "the more sensible convention" remark: using periods as scope delimiters is poor practice in mathematics and contemporary formal logic—as opposed to computer science and lambda calculus, where the convention may be more entrenched—because it is a recipe for miscommunication, given that, unfortunately, it isn't uncommon for instructors and students to insert periods/commas/colons in logic formulae ornamentally rather than as syntactic markers.

P.P.S. To sidestep potential misunderstanding, we can alternatively just use parentheses more liberally.

ryang
  • 44,428
1

While the other answers describe the differing conventions, I think it's important to mention that there is a strong clue here about which convention is in use: the title of your book sounds like it comes from computer science, where it is almost unheard of not to take symbols like $\sum$, $\prod$, $\forall$, $\exists$, and even $\lambda$ as scoping over the rest of an expression unless delimited. Although ryang describes the alternative as "more sensible," and that alternative is more common in general math, we computer scientists, along with mathematicians in some other fields like type theory, do not see it that way because of the kind of math we typically do. (Whereas someone like a statistician would find our convention quite painful, I'm sure.)

People working strictly in computing (perhaps Bradley and Manna?) may never be exposed to the opposite convention and take expansive scoping as a given, whereas mathematicians not working near such fields may find the suggestion that it is standard rather baffling. But if you are going to be working in a computing-adjacent area without losing contact with the broader mathematical world, this difference in notation is something everyone is kind of expected to know about, so I want to emphasize that it will come up in more than just this text.

elliot
  • 21
  • 1
  • 1
    In response to Naim's comment above, I'd wanted to add a footnote to my Answer to the effect of what you said, but decided against it; thanks for mentioning it here!ㅤㅤAnyhow, to clarify, I've just added a postscript to my Answer. – ryang Jun 14 '25 at 03:49
  • 2
    @ryang Yes, that makes sense. I fully believe that there wouldn't be this schism if the expressions we in the minority fields often write wouldn't have to pay such a high parentheses tax to make the switch. – elliot Jun 14 '25 at 04:06