Inlogic and related fields such asmathematics andphilosophy, "if and only if" (often shortened as "iff") is paraphrased by thebiconditional, alogical connective[1] between statements. The biconditional is true in two cases, where either both statements are true or both are false. The connective isbiconditional (a statement ofmaterial equivalence),[2] and can be likened to the standardmaterial conditional ("only if", equal to "if ... then") combined with its converse ("if"); hence the name. The result is that the truth of either one of the connected statements requires the truth of the other (i.e. either both statements are true, or both are false), though it is controversial whether the connective thus defined is properly rendered by the English "if and only if"—with its pre-existing meaning. For example,P if and only if Q means thatP is true wheneverQ is true, and the only case in whichP is true is ifQ is also true, whereas in the case ofP if Q, there could be other scenarios whereP is true andQ is false.
In writing, phrases commonly used as alternatives to P "if and only if" Q include:Q isnecessary and sufficient for P,for P it is necessary and sufficient that Q,P is equivalent (or materially equivalent) to Q (compare withmaterial implication),P precisely if Q,P precisely (or exactly) when Q,P exactly in case Q, andP just in case Q.[3] Some authors regard "iff" as unsuitable in formal writing;[4] others consider it a "borderline case" and tolerate its use.[5] Inlogical formulae, logical symbols, such as and,[6] are used instead of these phrases; see§ Notation below.
The corresponding logical symbols are "", "",[6] and,[10] and sometimes "iff". These are usually treated as equivalent. However, some texts ofmathematical logic (particularly those onfirst-order logic, rather thanpropositional logic) make a distinction between these, in which the first,, is used as a symbol in logic formulas, while or is used in reasoning about those logic formulas (e.g., inmetalogic). InŁukasiewicz'sPolish notation, it is the prefix symbol.[11]
In mostlogical systems, oneproves a statement of the form "P iff Q" by proving either "if P, then Q" and "if Q, then P", or "if P, then Q" and "if not-P, then not-Q". Proving these pairs of statements sometimes leads to a more natural proof, since there are no obvious conditions under which one would infer a biconditional directly. An alternative is to prove thedisjunction "(P and Q) or (not-P and not-Q)", which itself can be inferred directly from either of its disjuncts—that is, because "iff" istruth-functional, "P iff Q" follows if P and Q have been shown to be both true, or both false.
Usage of the abbreviation "iff" first appeared in print inJohn L. Kelley's 1955 bookGeneral Topology.[13] Its invention is often credited toPaul Halmos, who wrote "I invented 'iff,' for 'if and only if'—but I could never believe I was really its first inventor."[14]
It is somewhat unclear how "iff" was meant to be pronounced. In current practice, the single 'word' "iff" is almost always read as the four words "if and only if". However, in the preface ofGeneral Topology, Kelley suggests that it should be read differently: "In some cases where mathematical content requires 'if and only if' andeuphony demands something less I use Halmos' 'iff'". The authors of one discrete mathematics textbook suggest:[15] "Should you need to pronounce iff, reallyhang on to the 'ff' so that people hear the difference from 'if'", implying that "iff" could be pronounced as[ɪfː].
Conventionally,definitions are "if and only if" statements; some texts — such as Kelley'sGeneral Topology — follow this convention, and use "if and only if" oriff in definitions of new terms.[16] However, this usage of "if and only if" is relatively uncommon and overlooks the linguistic fact that the "if" of a definition is interpreted as meaning "if and only if". The majority of textbooks, research papers and articles (including English Wikipedia articles) follow the linguistic convention of interpreting "if" as "if and only if" whenever a mathematical definition is involved (as in "a topological space is compact if every open cover has a finite subcover").[17] Moreover, in the case of arecursive definition, theonly if half of the definition is interpreted as a sentence in the metalanguage stating that the sentences in the definition of a predicate are theonly sentences determining the extension of the predicate.
A is a proper subset ofB. A number is inA only if it is inB; a number is inB if it is inA.
C is a subset but not a proper subset ofB. A number is inB if and only if it is inC, and a number is inC if and only if it is inB.
Euler diagrams show logical relationships among events, properties, and so forth. "P only if Q", "if P then Q", and "P→Q" all mean that P is asubset, either proper or improper, of Q. "P if Q", "if Q then P", and Q→P all mean that Q is a proper or improper subset of P. "P if and only if Q" and "Q if and only if P" both mean that the sets P and Q are identical to each other.
Iff is used outside the field of logic as well. Wherever logic is applied, especially inmathematical discussions, it has the same meaning as above: it is an abbreviation forif and only if, indicating that one statement is bothnecessary and sufficient for the other. This is an example ofmathematical jargon (although, as noted above,if is more often used thaniff in statements of definition).
The elements ofX areall and only the elements ofY means: "For anyz in thedomain of discourse,z is inX if and only ifz is inY."
In theirArtificial Intelligence: A Modern Approach,Russell andNorvig note (page 282),[18] in effect, that it is often more natural to expressif and only if asif together with a "database (or logic programming) semantics". They give the example of the English sentence "Richard has two brothers, Geoffrey and John".
The database semantics interprets the database (or program) as containingall andonly the knowledge relevant for problem solving in a given domain. It interpretsonly if as expressing in the metalanguage that the sentences in the database represent theonly knowledge that should be considered when drawing conclusions from the database.
Infirst-order logic (FOL) with the standard semantics, the same English sentence would need to be represented, usingif and only if, withonly if interpreted in the object language, in some such form as:
X(Brother(Richard, X) iff X = Geoffrey or X = John).
Geoffrey ≠ John.
Compared with the standard semantics for FOL, the database semantics has a more efficient implementation. Instead of reasoning with sentences of the form:
The database semantics is analogous to the legal principleexpressio unius est exclusio alterius (the express mention of one thing excludes all others). Moreover, it underpins the application of logic programming to the representation of legal texts and legal reasoning.[19]
^Copi, I. M.; Cohen, C.; Flage, D. E. (2006).Essentials of Logic (Second ed.). Upper Saddle River, NJ: Pearson Education. p. 197.ISBN978-0-13-238034-8.
^If and only if, UHM Department of Mathematics,archived from the original on 5 May 2000, retrieved16 October 2016,Theorems which have the form "P if and only Q" are much prized in mathematics. They give what are called "necessary and sufficient" conditions, and give completely equivalent and hopefully interesting new ways to say exactly the same thing.