# Difference between “only if” and “if and only if”

$$1.\quad p\quad if\quad q\\ \equiv if\quad q\quad then\quad p\\ \equiv q\rightarrow p\\ \\$$$$2.\quad p\quad only\quad if\quad q\\ \equiv if\quad p\quad then\quad q\\ \equiv p\rightarrow q\\ \\$$$$3.\quad p\quad only\quad if\quad q\\ \equiv if\quad q\quad then\quad p\\ \equiv q\rightarrow p\\ \\$$$$4.\quad p\quad iff\quad q\\ \equiv (p\rightarrow q)\wedge (q\rightarrow p)$$

I think #3 is wrong but I'm not sure why.

"$p$, only if $q$" means "if $p$, then $q$." It's infrequently used except as a component of the phrase "if and only if."

• Why can't it mean "if q then p"? That is the case for #1. The only difference between #1 and #3 is the word "only". – user1251385 Jan 8 '14 at 17:18
• What do you think of "$x$ is divisible by 4 only if $x$ is even"? What about "$x$ is even only if $x$ is divisible by 4"? – user119908 Jan 8 '14 at 17:26
• Thanks. I accepted this answer because of the simple counter-example to why #3 is wrong. – user1251385 Jan 8 '14 at 17:38

Yes, the third statement is incorrect. It should start "$q$ only if $p$".

The "only" makes all the difference! "$p$ if $q$" means that whenever $q$ is true, $p$ is necessarily true as well. This is the same as "if $q$ then $p$" or "$q\rightarrow p$.

On the other hand, "$p$ only if $q$" means that, unless $q$ is true, $p$ cannot be true; equivalently "if $q$ is false, then $p$ must be false as well, which is written $\neg q \rightarrow \neg p$, which is the same (by contrapositive) as $p \rightarrow q$.

Thus, we have demonstrated that "$p$ if $q$" and "$p$ only if $q$" are logical converses of each other.

• How can #3 be wrong when #1 is right? All I added was "only." – user1251385 Jan 8 '14 at 17:17
• @OP Fun example of why it's different: If I am hungry, I eat. But I eat other times too, for example when I have some nice candy. So I don't eat only if I am hungry. A more serious example: If a function is continuous at $x_0$, its limit at $x_0$ exists. However, there exists plenty of discontinuous functions which have limits at their point of discontinuity, so "A function has a limit only if it's continuous" does not hold. – Steve Pap Jan 8 '14 at 17:23
• @user1251385 I've edited in some more discussion – BaronVT Jan 8 '14 at 17:27
• Doesn't "p only if q" also (in addition to definition you provided which I agree with) mean that if q is true, p is necessarily true as well? – user1251385 Jan 8 '14 at 17:33
• Nope! You're maybe thinking of "$p$ if and only $q$" (if either one is true, the other must be true as well). For instance, if I say "I answer stackexchange questions only if I have free time" that doesn't mean I spend all of my free time on stackexchange, it just means that if I don't have any free time, I won't be answering any questions here. – BaronVT Jan 8 '14 at 17:37

From a just published book by Jan von Plato, Elements of Logical Reasoning (Cambridge UP, 2013), pag 11:

The two sentences if A, then B and B if A seem to express the same thing. Natural language seems to have a host of ways of expressing a conditional sentence that is written $A \rightarrow B$ in the logical notation. Consider the following list :

From A, B follows; A is a sufficient condition for B; A entails B; A implies B; B provided thet A; B is a necessary condition for A; A only if B.

The last two require some thought. The equivalence of $A$ and $B$, $A \leftrightarrow B$ in logical notation, can be read as A if and only if B, also A is a necessary and sufficient condition for B. Sufficiency of a condition as well as the 'if' direction being clear, the remaining direction is the opposite one. So A only if B means $A \rightarrow B$ and so does B is a necessary condition for A.

It sound a bit strange to say that B is a necessary condition for A means $A \rightarrow B$. When one thinks of conditions as in $A \rightarrow B$, usually $A$ would be a cause of $B$ in some sense or other, and causes must precede their effects. A necessary condition is instead something that necessary follows, therefore not a condition in the causal sense.

Consider outcome sets $P \subseteq Q$, then if an outcome in $P$ occurs, that outcome will also be in $Q$ i.e. $Q$ if $P$.
Now consider $Q \subseteq P$, in this case the outcome is in $Q$ only if it is also in $P$ (note here it is not correct to say the outcome is in $Q$ if it is in $P$).
Hence $Q$ if $P$ is like saying $P \subseteq Q$ and $Q$ only if $P$ is like saying $Q \subseteq P$.