Trouble with "only if" This is from pg. 45 of Discrete Mathematics with Applications by Epp:

I'm having trouble understanding the last sentence. If we say that $p$ is John breaking the world's record and $q$ is John running the mile in under four minutes, doesn't $q \Longrightarrow p$ say that if John runs the mile under four minutes, he will break the world record? It seems like she meant to say that "His time could be over four minutes and still break the record." regarding the case where $p$ is true and $q$ is false.
 A: Perhaps John's sub four minute mile doesn't break the record because there was a tailwind, or because he tested positive for drugs, or because the actual record is in fact  3 minutes 47 seconds. He still covered the distance in four minutes but did not break the record.
The four minute finishing time is a necessary condition for breaking the record. If he was slower, then of course the record is unbroken. But it is not sufficient.
A: As counter intuitive as it may seem but "$p$ only if $q$" actually is represented as $p \rightarrow q$. Hear me out !
"$p$ only if $q$" means that $q$ is necessary for $p$ i.e. it is necessary for john to run under 4 minutes to break the world record. But it is not sufficient.
"$p$ if $q$" on the other hand means that $q$ is sufficient for $p$ to happen, in logic represented as $q \rightarrow p$, which would be true if the present world record holder had a timing of more than 4 minutes, in that case it is sufficient for john to run under 4 minutes to break the world record. But notice that it is not necessary. Because the world record could be 5 minutes.
A: *

*“$A$ if $B$” means “$B$ implies $A$”.


*On the other hand, “$A$ only if $B$” generally means “$A$ implies $B$”.
“Only if” can be considered part of mathematical jargon: in mathematics, “$A$ only if $B$” never means “$A$ if $B;$ otherwise, not $A$”.


*It is “$A$ if only if $B$” that actually means “$A$ if $B;$ otherwise, not $A$”.
Remember: in mathematics and logic, ‘only if’ →,⟹  is not a stronger form of ‘if’ ←,⟸!
A: $P=$ John will break the world's record
$Q=$ he runs the mile in under four minutes
$Q$ is only a necessary condition, it could be that the world record is $3:30$, in which case if John does not run at least a $4$-minute mile, i.e he will not break the world record. This written formally is $ \neg Q \implies \neg P$ or $P \implies Q$ where $P$ may be false while $Q$ is true. 
$Q$ is not a sufficient condition, in that if he runs $3:45$ he will satisfy $Q$, but may not satisfy $P$. So in this sense, $Q$ does not imply $P$.
A: Maybe a different example would be clearer. The statement "It's Pi day only if it's the 14th" is a true statement. However, just because it's the 14th doesn't mean it's Pi day: it could be the 14th of April, or of June, etc. So, "It's Pi day if it's the 14th" is false.
In your example, suppose that the world record mile run is actually 3 minutes. Then running a mile in under 4 minutes may still not be enough to break the world record; for example, you might run the mile in 3:30. But, if you want to break the world record, your time needs to be under 4 minutes (since it needs to be under 3 minutes!). Therefore, "John will break the world record only if his time is under 4 minutes" is a true statement.
In my opinion, this "only if" language is a bit confusing. You may prefer to think of "A only if B" as just being logically equivalent to "A implies B", or maybe "if A then B"; the latter two are generally less ambiguous sounding. In your example, it becomes "If John breaks the world record, then his time is under 4 minutes".
A: The statement ["$p$ if $q$"] is equivalent to saying that 
$q$ implies $p$.
The statement ["$p$ if $q$ is false"] is equivalent to saying that it is not the case that $q$ implies $p$.
Here, you have to distinguish between the real world interpretation, and the interpretation of a logician.
In the real world, the statement ["$p$ if $q$ is false"]
means that there is no compelling causative effect in the event $q$ which would force the event $p$ to also occur.
However, a logician sees it differently.  To a logician, the only way that the statement ["$p$ if $q$"] is false is if the following equivalent statement is false : ["$q$ implies $p$"].  Further, to a logician, the only way that this staement can be false is if both of the following events occur:

*

*$q$

*Not $p$.


The statement ["$p$ only if $q$"] is similarly ambiguous.  In the real world, this generally means that both of the following statements are true:

*

*If not $q$, then not $p$.  This is equivalent to saying that $p$ implies $q$.

*If $q$ then $p$.

Therefore, in the real world, the statment is interpreted as $p$ if and only if $q$.
However, a logician would only interpret the statement to mean that $p$ implies $q$.  The logician would not (also) interpret the statement as signifying that $q$ implies $p$.

So, look at the first sentence of the posted excerpt.  As discussed:

*

*["$p$ if $q$ is false"] may be construed to signify that $q$ does not imply $p$.

*["$p$ only if $q$"] may be construed to signify that $p$ implies $q$.

The two construances above are not contradictory.  That is, in general, you can have two statements $p$ and $q$ such that $p$ implies $q$ but $q$ does not imply $p$.
A: $$p \ \text{only if} \ q$$ is the same as $p \implies q$.
$$p \ \text{if} \ q$$ is the same as $q \implies p$.
I think your mistake was that you thought $p \ \text{only if} \ q$ meant $q \implies p$.
A: "p if q" says that "q and not p" is impossible, while "p and q", "not p and not q" and "p and not q", may be possible.
"p only if q" says that "p and not q" is impossible, while "p and q", "not p and not q" and "q and not p" may be possible.
If "q and not p" is possible, but "p and not q" is impossible, then "p only if q" is true, but "p if q" is false.
A: The current world record  (March 2022) for the mile seems to be $3$ minutes $43.13$ seconds.
Clearly if John's time is over four minutes he will not break the record. But he won't break the record automatically if he runs under four minutes - he actually has to beat the record.
Running under four minutes is (as Ethan Baker notes) a necessary condition, but it is not sufficient.
The word "only" is not equivalent to the double implication "if and only if" - it is a one-wy condition and not a two-way one.
In case any of this helps you to crystallise your thinking.
A: You will win the lottery only if you buy a ticket. This is true, but does not mean that everybody who buys a ticket will win.
A: I think the wording, while not outright wrong, is at least sub-optimal. I'd turn

Note that it is possible for "p only if q" to be true at the same time
that "p if q" is false. For instance, to say that John will break the
world's record only if he runs the mile in under four minutes does not
mean that John will break the world's record if he runs the mile in
under four minutes. His time could be under four minutes but still not
be fast enough to break the record.

into

Note that it is possible for "p only if q" to be true at the same time
that "p if q" is false. For instance, to say that John can break the
world's record only if he runs the mile in under four minutes does not
mean that John will break the world's record if he runs the mile in
under four minutes. His time could be under four minutes but still not
be fast enough to break the record.

A: Your basic confusion is because you are interpreting the statement like this: "John will break the world's record if he ONLY runs the mile in under four minutes."
First of all, you should find the use of the phrase 'only if' odd in normal use of the English language. How often do we hear things like 'I'll pass the test only if I study well'?
This should let you then look at the phrase 'only if' as a special logic operator that may not mean much in the normal English.
So what does p 'only if' q mean? It means that for it to be true, it has to be that whenever q is true, p is also true. So it basically is like this: q has happened so p must have happened. It cannot be that q happened but p did not happen. Particularly, it is false when p is false and q is true, otherwise, remains true.
In our context, if we say that John will break the world's record ONLY IF he runs the mile in under four minutes and John then does run under four minutes  then we do not know if that was enough to break the world's record. We know only that if he had broken the world record then he had run the mile under less than four minutes. Otherwise, maybe he ran under three minutes while Tracy ran under two minutes and broke the record before him. Or before he could have broken the record, he suddenly woke up from his dream.
