In logic and mathematics, contraposition, or transposition, refers to the inference of going from a conditional statement into its logically equivalent contrapositive, and an associated proof method known as . The contrapositive of a statement has its antecedent and consequent inverted and flipped.
P → Q
P → Q
\negQ → \negP
If P, Then Q. — If not Q, Then not P. "If it is raining, then I wear my coat" — "If I don't wear my coat, then it isn't raining."
The law of contraposition says that a conditional statement is true if, and only if, its contrapositive is true.[2]
The contrapositive (
\negQ → \negP
\negP → \negQ
Q → P
\neg(P → Q)
Note that if
P → Q
Q
\negQ
P
\negP
In the Euler diagram shown, if something is in A, it must be in B as well. So we can interpret "all of A is in B" as:
A\toB
It is also clear that anything that is not within B (the blue region) cannot be within A, either. This statement, which can be expressed as:
\negB\to\negA
is the contrapositive of the above statement. Therefore, one can say that
(A\toB)\leftrightarrow(\negB\to\negA).
In practice, this equivalence can be used to make proving a statement easier. For example, if one wishes to prove that every girl in the United States (A) has brown hair (B), one can either try to directly prove
A\toB
\negB\to\negA
\negB\to\negA
A\toB
In general, for any statement where A implies B, not B always implies not A. As a result, proving or disproving either one of these statements automatically proves or disproves the other, as they are logically equivalent to each other.
A proposition Q is implicated by a proposition P when the following relationship holds:
(P\toQ)
This states that, "if
P
Q
P
Q
(\negQ\to\negP).
That is, "If not-
Q
P
Q
Strictly speaking, a contraposition can only exist in two simple conditionals. However, a contraposition may also exist in two complex, universal conditionals, if they are similar. Thus,
\forall{x}(P{x}\toQ{x})
P
Q
\forall{x}(\negQ{x}\to\negP{x})
Q
P
The transposition rule may be expressed as a sequent:
(P\toQ)\vdash(\negQ\to\negP),
\vdash
(\negQ\to\negP)
(P\toQ)
P\toQ | |
\therefore\negQ\to\negP |
,
P\toQ
\negQ\to\negP
(P\toQ)\to(\negQ\to\negP),
P
Q
In first-order logic, the conditional is defined as:
A\toB\leftrightarrow\negA\lorB
which can be made equivalent to its contrapositive, as follows:
\begin{align} \negA\lorB&\leftrightarrowB\lor\negA\ &\leftrightarrow\negB\to\negA \end{align}
Let:
(A\toB)\land\negB
It is given that, if A is true, then B is true, and it is also given that B is not true. We can then show that A must not be true by contradiction. For if A were true, then B would have to also be true (by Modus Ponens). However, it is given that B is not true, so we have a contradiction. Therefore, A is not true (assuming that we are dealing with bivalent statements that are either true or false):
(A\toB)\to(\negB\to\negA)
We can apply the same process the other way round, starting with the assumptions that:
(\negB\to\negA)\landA
Here, we also know that B is either true or not true. If B is not true, then A is also not true. However, it is given that A is true, so the assumption that B is not true leads to a contradiction, which means that it is not the case that B is not true. Therefore, B must be true:
(\negB\to\negA)\to(A\toB)
Combining the two proved statements together, we obtain the sought-after logical equivalence between a conditional and its contrapositive:
(A\toB)\equiv(\negB\to\negA)
Logical equivalence between two propositions means that they are true together or false together. To prove that contrapositives are logically equivalent, we need to understand when material implication is true or false.
P\toQ
P
Q
P
Q
P
Q
\neg(P\land\negQ)
\neg(\negQ\landP)
R
\negQ
S
\negP
\negS
\neg\negP
P
\neg(R\land\negS)
This reads "It is not the case that (R is true and S is false)", which is the definition of a material conditional. We can then make this substitution:
R\toS
P
Q
\negQ\to\negP
In Hilbert-style deductive systems for propositional logic, only one side of the transposition is taken as an axiom, and the other is a theorem. We describe a proof of this theorem in the system of three axioms proposed by Jan Łukasiewicz:
A1.
\phi\to\left(\psi\to\phi\right)
A2.
\left(\phi\to\left(\psi → \xi\right)\right)\to\left(\left(\phi\to\psi\right)\to\left(\phi\to\xi\right)\right)
A3.
\left(lnot\phi\tolnot\psi\right)\to\left(\psi\to\phi\right)
(A3) already gives one of the directions of the transposition. The other side,
(\psi\to\phi)\to(\neg\phi\to\neg\psi)
(DN1)
\neg\negp\top
(DN2)
p\to\neg\negp
(HS1)
(q\tor)\to((p\toq)\to(p\tor))
(HS2)
(p\toq)\to((q\tor)\to(p\tor))
The proof is as follows:
q\to\neg\negq
(q\to\neg\negq)\to((p\toq)\to(p\to\neg\negq))
(p\toq)\to(p\to\neg\negq)
\neg\negp\top
(\neg\negp\top)\to((p\to\neg\negq)\to(\neg\negp\to\neg\negq))
(p\to\neg\negq)\to(\neg\negp\to\neg\negq)
(p\toq)\to(\neg\negp\to\neg\negq)
(\neg\negp\to\neg\negq)\to(\negq\to\negp)
(p\toq)\to(\negq\to\negp)
name | form | description | |
---|---|---|---|
implication | if P then Q | first statement implies truth of second | |
inverse | if not P then not Q | negation of both statements | |
converse | if Q then P | reversal of both statements | |
contrapositive | if not Q then not P | reversal and negation of both statements | |
negation | P and not Q | contradicts the implication |
Take the statement "All red objects have color." This can be equivalently expressed as "If an object is red, then it has color."
In other words, the contrapositive is logically equivalent to a given conditional statement, though not sufficient for a biconditional.
Similarly, take the statement "All quadrilaterals have four sides," or equivalently expressed "If a polygon is a quadrilateral, then it has four sides."
Since the statement and the converse are both true, it is called a biconditional, and can be expressed as "A polygon is a quadrilateral if, and only if, it has four sides." (The phrase if and only if is sometimes abbreviated as iff.) That is, having four sides is both necessary to be a quadrilateral, and alone sufficient to deem it a quadrilateral.
In traditional logic, contraposition is a form of immediate inference in which a proposition is inferred from another and where the former has for its subject the contradictory of the original logical proposition's predicate. In some cases, contraposition involves a change of the former's quality (i.e. affirmation or negation).[5] For its symbolic expression in modern logic, see the rule of transposition. Contraposition also has philosophical application distinct from the other traditional inference processes of conversion and obversion where equivocation varies with different proposition types.
In traditional logic, the process of contraposition is a schema composed of several steps of inference involving categorical propositions and classes.[6] A categorical proposition contains a subject and predicate where the existential impact of the copula implies the proposition as referring to a class with at least one member, in contrast to the conditional form of hypothetical or materially implicative propositions, which are compounds of other propositions, e.g. "If P, then Q" (P and Q are both propositions), and their existential impact is dependent upon further propositions where quantification existence is instantiated (existential instantiation), not on the hypothetical or materially implicative propositions themselves.
Full contraposition is the simultaneous interchange and negation of the subject and predicate, and is valid only for the type "A" and type "O" propositions of Aristotelian logic, while it is conditionally valid for "E" type propositions if a change in quantity from universal to particular is made (partial contraposition). Since the valid obverse is obtained for all the four types (A, E, I, and O types) of traditional propositions, yielding propositions with the contradictory of the original predicate, (full) contraposition is obtained by converting the obvert of the original proposition. For "E" statements, partial contraposition can be obtained by additionally making a change in quantity. Because nothing is said in the definition of contraposition with regard to the predicate of the inferred proposition, it can be either the original subject, or its contradictory, resulting in two contrapositives which are the obverts of one another in the "A", "O", and "E" type propositions.[7]
By example: from an original, 'A' type categorical proposition,
All residents are voters,
which presupposes that all classes have members and the existential import presumed in the form of categorical propositions, one can derive first by obversion the 'E' type proposition,
No residents are non-voters.
The contrapositive of the original proposition is then derived by conversion to another 'E' type proposition,
No non-voters are residents.The process is completed by further obversion resulting in the 'A' type proposition that is the obverted contrapositive of the original proposition,
All non-voters are non-residents.
The schema of contraposition:[8]
Original proposition | Obversion | (Full) Contraposition | Obverted (full) contraposition | ||
---|---|---|---|---|---|
(A) All S is P | (E) No S is non-P | ↔ | (E) No non-P is S | (A) All non-P is non-S | |
(E) No S is P | (A) All S is non-P | None | None | ||
(I) Some S is P | (O) Some S is not non-P | None | None | ||
(O) Some S is not P | (I) Some S is non-P | ↔ | (I) Some non-P is S | (O) Some non-P is not non-S |
Notice that contraposition is a valid form of immediate inference only when applied to "A" and "O" propositions. It is not valid for "I" propositions, where the obverse is an "O" proposition which has no valid converse. The contraposition of the "E" proposition is valid only with limitations (per accidens). This is because the obverse of the "E" proposition is an "A" proposition which cannot be validly converted except by limitation, that is, contraposition plus a change in the quantity of the proposition from universal to particular.
Also, notice that contraposition is a method of inference which may require the use of other rules of inference. The contrapositive is the product of the method of contraposition, with different outcomes depending upon whether the contraposition is full, or partial. The successive applications of conversion and obversion within the process of contraposition may be given by a variety of names.
The process of the logical equivalence of a statement and its contrapositive as defined in traditional class logic is not one of the axioms of propositional logic. In traditional logic there is more than one contrapositive inferred from each original statement. In regard to the "A" proposition this is circumvented in the symbolism of modern logic by the rule of transposition, or the law of contraposition. In its technical usage within the field of philosophic logic, the term "contraposition" may be limited by logicians (e.g. Irving Copi, Susan Stebbing) to traditional logic and categorical propositions. In this sense the use of the term "contraposition" is usually referred to by "transposition" when applied to hypothetical propositions or material implications.
In the inferred proposition, the consequent is the contradictory of the antecedent in the original proposition, and the antecedent of the inferred proposition is the contradictory of the consequent of the original proposition. The symbol for material implication signifies the proposition as a hypothetical, or the "if–then" form, e.g. "if P, then Q".
The biconditional statement of the rule of transposition (↔) refers to the relation between hypothetical (→) propositions, with each proposition including an antecedent and consequential term. As a matter of logical inference, to transpose or convert the terms of one proposition requires the conversion of the terms of the propositions on both sides of the biconditional relationship, meaning that transposing or converting to requires that the other proposition, to be transposed or converted to Otherwise, converting the terms of one proposition and not the other renders the rule invalid, violating the sufficient condition and necessary condition of the terms of the propositions, where the violation is that the changed proposition commits the fallacy of denying the antecedent or affirming the consequent by means of illicit conversion.
The truth of the rule of transposition is dependent upon the relations of sufficient condition and necessary condition in logic.
In the proposition "If P, then Q", the occurrence of P is sufficient reason for the occurrence of Q. P, as an individual or a class, materially implicates Q, but the relation of Q to P is such that the converse proposition "If Q, then P" does not necessarily have sufficient condition. The rule of inference for sufficient condition is modus ponens, which is an argument for conditional implication:
Since the converse of premise (1) is not valid, all that can be stated of the relationship of P and Q is that in the absence of Q, P does not occur, meaning that Q is the necessary condition for P. The rule of inference for necessary condition is modus tollens:
An example traditionally used by logicians contrasting sufficient and necessary conditions is the statement "If there is fire, then oxygen is present". An oxygenated environment is necessary for fire or combustion, but simply because there is an oxygenated environment does not necessarily mean that fire or combustion is occurring. While one can infer that fire stipulates the presence of oxygen, from the presence of oxygen the converse "If there is oxygen present, then fire is present" cannot be inferred. All that can be inferred from the original proposition is that "If oxygen is not present, then there cannot be fire".
The symbol for the biconditional ("↔") signifies the relationship between the propositions is both necessary and sufficient, and is verbalized as "if and only if", or, according to the example "If P, then Q 'if and only if' if not Q, then not P".
Necessary and sufficient conditions can be explained by analogy in terms of the concepts and the rules of immediate inference of traditional logic. In the categorical proposition "All S is P", the subject term S is said to be distributed, that is, all members of its class are exhausted in its expression. Conversely, the predicate term P cannot be said to be distributed, or exhausted in its expression because it is indeterminate whether every instance of a member of P as a class is also a member of S as a class. All that can be validly inferred is that "Some P are S". Thus, the type "A" proposition "All P is S" cannot be inferred by conversion from the original type "A" proposition "All S is P". All that can be inferred is the type "A" proposition "All non-P is non-S" (note that (P → Q) and (¬Q → ¬P) are both type "A" propositions). Grammatically, one cannot infer "all mortals are men" from "All men are mortal". An type "A" proposition can only be immediately inferred by conversion when both the subject and predicate are distributed, as in the inference "All bachelors are unmarried men" from "All unmarried men are bachelors".
See also: Set theory. While most authors use the terms for the same thing, some authors distinguish transposition from contraposition. In traditional logic the reasoning process of transposition as a rule of inference is applied to categorical propositions through contraposition and obversion,[9] a series of immediate inferences where the rule of obversion is first applied to the original categorical proposition "All S is P"; yielding the obverse "No S is non-P". In the obversion of the original proposition to a type "E" proposition, both terms become distributed. The obverse is then converted, resulting in "No non-P is S", maintaining distribution of both terms. The "No non-P is S" is again obverted, resulting in the [contrapositive] "All non-P is non-S". Since nothing is said in the definition of contraposition with regard to the predicate of the inferred proposition, it is permissible that it could be the original subject or its contradictory, and the predicate term of the resulting type "A" proposition is again undistributed. This results in two contrapositives, one where the predicate term is distributed, and another where the predicate term is undistributed.[10]
Contraposition is a type of immediate inference in which from a given categorical proposition another categorical proposition is inferred which has as its subject the contradictory of the original predicate. Since nothing is said in the definition of contraposition with regard to the predicate of the inferred proposition, it is permissible that it could be the original subject or its contradictory. This is in contradistinction to the form of the propositions of transposition, which may be material implication, or a hypothetical statement. The difference is that in its application to categorical propositions the result of contraposition is two contrapositives, each being the obvert of the other,[11] i.e. "No non-P is S" and "All non-P is non-S". The distinction between the two contrapositives is absorbed and eliminated in the principle of transposition, which presupposes the "mediate inferences"[12] of contraposition and is also referred to as the "law of contraposition".
Because the contrapositive of a statement always has the same truth value (truth or falsity) as the statement itself, it can be a powerful tool for proving mathematical theorems (especially if the truth of the contrapositive is easier to establish than the truth of the statement itself). A proof by contrapositive is a direct proof of the contrapositive of a statement. However, indirect methods such as proof by contradiction can also be used with contraposition, as, for example, in the proof of the irrationality of the square root of 2. By the definition of a rational number, the statement can be made that "If
\sqrt{2}
\sqrt{2}
\sqrt{2}
\sqrt{2}
The previous example employed the contrapositive of a definition to prove a theorem. One can also prove a theorem by proving the contrapositive of the theorem's statement. To prove that if a positive integer N is a non-square number, its square root is irrational, we can equivalently prove its contrapositive, that if a positive integer N has a square root that is rational, then N is a square number. This can be shown by setting equal to the rational expression a/b with a and b being positive integers with no common prime factor, and squaring to obtain N = a2/b2 and noting that since N is a positive integer b=1 so that N = a2, a square number.
In mathematics, proof by contrapositive, or proof by contraposition, is a rule of inference used in proofs, where one infers a conditional statement from its contrapositive.[13] In other words, the conclusion "if A, then B" is inferred by constructing a proof of the claim "if not B, then not A" instead. More often than not, this approach is preferred if the contrapositive is easier to prove than the original conditional statement itself.
Logically, the validity of proof by contrapositive can be demonstrated by the use of the following truth table, where it is shown that p → q and
lnot
lnot
p | q | lnot | lnot | p → q | lnot lnot | |
---|---|---|---|---|---|---|
T | T | F | F | T | T | |
T | F | F | T | F | F | |
F | T | T | F | T | T | |
F | F | T | T | T | T |
Assume (for contradiction) that
\negA
\negA
A
Proof by contrapositive: To prove
A\toB
\negB\to\negA
Let
x
To prove: If
x2
x
Although a direct proof can be given, we choose to prove this statement by contraposition. The contrapositive of the above statement is:
If
x
x2
This latter statement can be proven as follows: suppose that x is not even, then x is odd. The product of two odd numbers is odd, hence
x2=x ⋅ x
x2
Having proved the contrapositive, we can then infer that the original statement is true.[14]
In intuitionistic logic, the statement
P\toQ
lnotQ\tolnotP
P\toQ
lnotQ\tolnotP
lnotQ\tolnotP
P\toQ
Assume(initial assumption)P\toQ
Assume
Q\to\bot
From
andP\toQ
, concludeQ\to\bot
P\to\bot
Discharge assumption; conclude
(Q\to\bot)\to(P\to\bot)
Turning
into(A\to\bot)
, concludelnotA
Discharge assumption; concludelnotQ\tolnotP
.(P\toQ)\to(lnotQ\tolnotP)
Contraposition represents an instance of the subjective Bayes' theorem in subjective logic expressed as:
A | |
(\omega | |
P\tilde{| |
A | |
Q},\omega | |
P\tilde{| |
lnotQ})=
A | |
(\omega | |
Q|P |
A | |
,\omega | |
Q|lnotP |
)\widetilde{\phi}aP,
A | |
(\omega | |
Q|P |
A | |
,\omega | |
Q|lnotP |
)
A
aP
P
A | |
(\omega | |
P\tilde{| |
A | |
Q},\omega | |
P\tilde{| |
lnotQ})
A | |
\omega | |
Q|P |
P\toQ
A
A | |
\omega | |
Q\midP |
A
P\toQ
A | |
\omega | |
Q\midP |
A
P\toQ
A | |
\omega | |
Q|P |
\widetilde{\phi}
A | |
\omega | |
P\widetilde{| |
lnotQ}
A | |
\omega | |
lnotP\widetilde{| |
lnotQ}
lnotQ\tolnotP
Contraposition represents an instance of Bayes' theorem which in a specific form can be expressed as:
\Pr(lnotP\midlnotQ)=
\Pr(lnotQ\midlnotP)a(lnotP) | |
\Pr(lnotQ\midlnotP)a(lnotP)+\Pr(lnotQ\midP)a(P) |
.
\Pr(lnotQ\midP)
P\tolnotQ
a(P)
P
\Pr(lnotQ\midP)=1
P\tolnotQ
\Pr(lnotQ\midP)=0
P\tolnotQ
\Pr(lnotP\midlnotQ)=1
\Pr(Q\midP)=1
P\toQ
\Pr(lnotQ\midP)=1-\Pr(Q\midP)=0
\Pr(lnotP\midlnotQ)=1
lnotQ\tolnotP
. James Franklin (philosopher). 2011. Proof in Mathematics: An Introduction. Kew Books. Sydney. 978-0-646-54509-7 . A. Daoud . (p. 50).