logoalt Hacker News

praptak12/09/20241 replyview on HN

Yes, it is a counterintuitive aspect of mathematics that "for all x in X ..." is always true if X is an empty set, just like "A implies B" is always true if A is false.

I once passed a midterm by abusing the latter. The question was to prove "there exists x such that if |a - b| < x, then something". The professor forgot to specify that x should be positive, so my response was that the implication is trivially true for x = -5 because a modulus cannot be negative.

The actual proof for positive values of x was much harder but the professor respected my math hacking skills and gave me full points for that question.


Replies

eterm12/09/2024

Here's one way to maybe make it less counter-intuitive:

We have a set of items X1, X2, X3, ... etc.

Each of X1, X2, X3 differently matches conditions A, B, C, D, etc.

Think of "All" as: A AND B AND C AND D AND...

Each term we add we further restricts the result-set.

Thus if we start with lots of conditions, as we remove conditions, we increase the matching results, until we remove all conditions, and "All([])" matches everything, i.e. is vacuously true.

Likewise, think of "Any" as: A OR B OR C OR D.

Here, as we increase the number of conditions, we increase how many things match, thus "Any" on an empty set returns nothing, i.e. is vacously false.