Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have read this question. I am now stuck with the difference between "if and only if" and "only if". Please help me out.


share|cite|improve this question
The moon is made of lemon meringue only if $1+1=2$. – Ilmari Karonen Sep 28 '11 at 20:08
Also try to understand in terms of plain translation. AiffB means A is true 'if' B is true & A is true 'only if' B is true.The 'only if' means that A is true in no other cases.'A if B' can be written as B => A.And 'A only if B' can be written as notB => notA. It is the property of => sign that c=>d is same as notd=>notc. Thus , you can replace notB=>notA by A=>B. Thus A iff B can be written as A=>B and B=>A . Of course what I am saying is same as what others have already said . I just wanted to emphasise how we can intuitively try to understand the logic from the meaning of 'if' and 'only if'. – ameyask86 Feb 11 '14 at 11:18
@Ilmari: So moon rocks are frozen lemon meringue? – Asaf Karagila Jun 7 '15 at 12:52
The mathematician R.L. Moore used "only if" to mean "if and only if". This sounds weird to us now, because it goes against the accepted convention, but I can see what Moore was thinking. The statement "A only if B" sounds like the statement "A if B", except that you are also given an extra piece of information: not just A if B, but A only if B. – littleO Jun 25 '15 at 6:58
up vote 16 down vote accepted

Let's assume A and B are two statements. Then to say "A only if B" means that A can only ever be true when B is true. That is, B is necessary for A to be true. To say "A if and only if B" means that A is true if B is true, and B is true if A is true. That is, A is necessary and sufficient for B. Succinctly,

$A \text{ only if } B$ is the logic statement $A \Rightarrow B$.

$A \text{ iff } B$ is the statement $(A \Rightarrow B) \land (B \Rightarrow A)$

share|cite|improve this answer
@RossMillikan & Josh: Thanks for the answers. So I can conclude it as 'only if' is same as implies and 'iff' is same as equivalence? – Fahad Uddin Sep 28 '11 at 20:05
@Akito: that is correct – Ross Millikan Sep 28 '11 at 20:07
Does the statement "A if and only if B" also imply that B is necessary and sufficient for A? – Minh Tran Apr 23 at 14:31

I will find a million dollars inside this locker only if I know the combination.

But that doesn't mean I will find a million dollars there if I know the combination. After all, there might be only a half million in there.

share|cite|improve this answer

If A then B is true unless A is true and B is false and written $A \implies B$.

A only if B is true unless A is true and B is false, equivalent to if A then B.

A if B is true unless A is false and B is true, the converse of the above, and is written $B \implies A$

A iff B, also written A if and only if B, is true if A and B have the same truth value. It represents (A if B) and (A only if B) and is written $A \iff B$

share|cite|improve this answer

A real number is positive if and only if it is greater than zero.

A real number is an rational only if it has a finite decimal expansion. A real number, in general, however need not be rational.

share|cite|improve this answer
I'd be happy to improve this, if someone has some suggestions as to what's wrong. – Asaf Karagila Jun 6 '15 at 19:59
I'm not the downvoter, but it looks like you've explained the difference between 'if and only if' and 'if', while the question asked about 'if and only if' and 'only if'. – Strants Jun 6 '15 at 21:38
You're right. There, now it's all better. – Asaf Karagila Jun 7 '15 at 12:51

A "only if B"

is the same as saying "B is necessary" for A

which is the same as saying A could not have happened without B, but that does mean that other things do not also need to happen for A to be true.


$A \to B$

but it is not true that $B \to A$ because B being true does not guarantee A happened. There could also be other requirements for A to be true.

ex: You are eligible to be president only if you are at least 35 years old. let p: "You are eligible to be president" and a: "You are at least 35 years old"

Here is is the case that $p \to a$

but it is not the case that $a \to p$

In other words, a is necessary for p, but just because a is true does not mean that a is the one single requirement for p.

As far as the difference goes, (which I guess was the specific question), if and only if means just that. p if and only if q means p if q AND p only if q.

p if q


if q, then $p = q \to p$

I just (hopefully well) explained that

p only if q


$p \to q$

$q \to p$ and $p \to q$ is the same as saying $p <-> q$

So there you have. One statement is unidirectional, the other is bidirectional.

share|cite|improve this answer

$A \text{ iff } B$ is the statement

"if B then A" and "only if B then A"

$(B \Rightarrow A) \land (notB \Rightarrow notA)$

$(B \Rightarrow A) \land (A \Rightarrow B)$


share|cite|improve this answer

A number of the answers here are incorrect. I am a logic professor, so you can count on this answer.

First, "only if" is NOT the same as "if and only if."

Second, let's look at "Only if." It is difficult to grasp, because the translations into standard "if, then" structure often seem counterintuitive.

To translate into standard form, DO NOT change the positions of the independent clauses. Remove the "only if" and replace it with "then." Add an "If" to the beginning of the sentence. That will put the sentence in its proper standard form.

Example: "You may kiss him only if you are married to him." Translation: "If you may kiss him, then you are married to him."

It sounds strange, but it makes sense. On the condition that you may kiss him, it is necessarily the case that you are married to him. (Married men don't typically let non-wives kiss them.) People want to change the positions of the clauses, but if you do that, you'll change the entire meaning of the conditional statement.

Next, "if and only if" is biconditional. That means that the clauses are interchangeable. "He is a bachelor if and only if he is an unmarried man" can be translated to, "If he is a bachelor, then he is an unmarried man," or "If he is an unmarried man, then he is a bachelor." (This is because the definition of bachelor is an unmarried man.)

share|cite|improve this answer
Which answers, specificially, did you think are incorrect in your judgment as an, ahem, "logic professor"? – Zev Chonoles Jun 6 '15 at 19:42
@ZevChonoles: Dude, he's a logic professor. You can count on his answer. – anomaly Jun 25 '15 at 5:48

protected by Zev Chonoles Jun 25 '15 at 6:00

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.