In everyday Hindi or English, "if" and "only if" mostly feel like variations of the same idea. Parents say "I will buy you a phone if you top the class" and "I will buy you a phone only if you top the class" and seem to mean the same thing. So when a textbook declares that these are different logical statements — pointing the implication arrow in opposite directions — the distinction feels artificial. It is not. It is one of the sharpest differences in all of logic, and exam answers live or die on it.
The rule, precisely
Let p and q be propositions. Then:
- "q if p" means p \Rightarrow q. The "if" introduces the hypothesis.
- "q only if p" means q \Rightarrow p. The "only if" introduces a necessary condition for q.
Read that twice. The two sentences swap which direction the implication arrow points. That is the whole difference — and it is everything.
Why "only if" points the other way: saying "q only if p" means "the only way for q to hold is if p holds." If q happens, p must have happened; otherwise you violate the "only if." That is the q \Rightarrow p direction — the truth of q forces the truth of p.
Putting both together: "if and only if"
When you see "p if and only if q" (often shortened to "iff"), you are reading two statements glued together:
- "p if q" — the if part — meaning q \Rightarrow p.
- "p only if q" — the only if part — meaning p \Rightarrow q.
Both together are (p \Rightarrow q) \land (q \Rightarrow p), which is the biconditional p \Leftrightarrow q. This is why proofs of iff statements always have two halves: you must prove each direction separately. See See 'If and Only If' (↔)? Verify Both Directions for the proof-strategy lens.
A worked translation
Take four sentences about n, an integer, and let p = "n is a multiple of 6" and q = "n is a multiple of 3":
- "n is a multiple of 3 if n is a multiple of 6" — reads as p \Rightarrow q. Every multiple of 6 is a multiple of 3. True.
- "n is a multiple of 3 only if n is a multiple of 6" — reads as q \Rightarrow p. Every multiple of 3 is a multiple of 6. False. (3 itself is a multiple of 3 but not of 6.)
- "n is a multiple of 6 if n is a multiple of 3" — reads as q \Rightarrow p. Same as (2), same truth value: False.
- "n is a multiple of 6 only if n is a multiple of 3" — reads as p \Rightarrow q. Same as (1): True.
Rows 1 and 4 are true; rows 2 and 3 are false — and they look nearly identical in English. The only things distinguishing them are the positions of "if" and "only if." This is why you cannot translate quickly by feel.
Why everyday speech feels ambiguous
When a parent says "I'll buy you a phone if you top the class", they usually mean the biconditional — and they usually mean they will not buy it if you do not top. In other words, they mean "if and only if." English frequently uses "if" to convey a stronger bidirectional promise than pure logic would assign to the word.
Mathematics cannot afford this ambiguity. A theorem that accidentally gets promoted from p \Rightarrow q to p \Leftrightarrow q asserts far more than was proved. So mathematical writing insists on the strict distinction: "if" is one-way only, "only if" is one-way the other, and "if and only if" is the two-way combination.
The necessary/sufficient dictionary
There is a second pair of vocabulary words that means exactly the same thing:
- "p is sufficient for q" means p \Rightarrow q. (Having p is enough to guarantee q.)
- "p is necessary for q" means q \Rightarrow p. (You cannot have q without p.)
Compare these with "if" and "only if":
- "q if p" = "p is sufficient for q" = p \Rightarrow q.
- "q only if p" = "p is necessary for q" = q \Rightarrow p.
And "if and only if" = "necessary and sufficient" = \Leftrightarrow. The four phrases — "if", "only if", "sufficient", "necessary" — fill out a small dictionary you will encounter in every proof course.
The memory trick
A simple mnemonic: "only if" marks the consequent. In "q only if p", the word "only" sits next to p, and p becomes the consequent of the implication (q \Rightarrow p). Another way to say the same thing: "only if" always gives you a necessary condition, and necessary conditions are what the implication's arrow points at.
If that still confuses you, use the canonical test sentence:
- "I win the lottery only if I buy a ticket."
Does winning happen without a ticket? No. So winning forces ticket-buying. The "only if" attaches to the necessary condition (buying a ticket), and the implication runs \text{win} \Rightarrow \text{buy ticket}. That matches the rule: "only if p" means the consequent is p.
A classic JEE-style trap
Question: "Consider the statement: 'n is prime only if n \ge 2'. Identify the implication."
- Lazy translation: "prime implies \ge 2." Correct — and this is n \text{ prime} \Rightarrow n \ge 2.
- Tempting wrong answer: "\ge 2 implies prime." That reads "every integer at least 2 is prime," which is wildly false (4 is at least 2 but not prime).
The right direction matches the rule: "only if" attaches to the necessary condition. Being at least 2 is necessary for being prime (you cannot be prime if you are less than 2), so \ge 2 is the consequent of the implication. Getting the direction wrong here turns a true theorem into a false one.
Checklist for translating any "if"/"only if" sentence
- Find the clause that follows "if" alone — that is the hypothesis.
- Find the clause that follows "only if" — that is the necessary condition, which becomes the consequent.
- If you see both ("if and only if"), you have a biconditional.
- Double-check: can the consequent fail while the hypothesis holds? If it can, your direction is wrong.
The rule never changes. Translate slowly, and the English ambiguity dissolves into clean \Rightarrow arrows.
Related: Logic and Propositions · If and Only If — Verify Both Directions · Converse vs Contrapositive — Why They Are Not the Same · Implication as a Promise