# Transposition (logic)

In propositional logic, transposition is a valid rule of replacement that permits one to switch the antecedent with the consequent of a conditional statement in a logical proof if they are also both negated. It is the inference from the truth of "A implies B" to the truth of "Not-B implies not-A" and conversely. It is very closely related to the rule of inference modus tollens. It is the rule that
$(P\to Q)\Leftrightarrow (\neg Q\to \neg P),$
where "$\Leftrightarrow$" is a metalogical symbol representing "can be replaced in a proof with".

## Formal notation

The transposition rule may be expressed as a sequent:
    $(P\to Q)\vdash (\neg Q\to \neg P),$
where $\vdash$ is a metalogical symbol meaning that $(\neg Q\to \neg P)$ is a syntactic consequence of $(P\to Q)$ in some logical system; or as a rule of inference:
    ${\frac {P\to Q}{\therefore \neg Q\to \neg P}},$
where the rule is that wherever an instance of "$P\to Q$" appears on a line of a proof, it can be replaced with "$\neg Q\to \neg P$"; or as the statement of a truth-functional tautology or theorem of propositional logic. The principle was stated as a theorem of propositional logic by Russell and Whitehead in Principia Mathematica as
    $(P\to Q)\to (\neg Q\to \neg P),$
where $P$ and $Q$ are propositions expressed in some formal system.

## Traditional logic
### Form of transposition

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 (P → Q) to (Q → P) requires that the other proposition, (¬Q → ¬P), to be transposed or converted to (¬P → ¬Q). 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.

### Sufficient condition

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:
* Premise (1): If P, then Q
* Premise (2): P
* Conclusion: Therefore, Q

### Necessary condition

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:
* Premise (1): If P, then Q
* Premise (2): not Q
* Conclusion: Therefore, not P

### Necessity and sufficiency example

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".

### Relationship of propositions

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".

### Transposition and the method of contraposition

In traditional logic the reasoning process of transposition as a rule of inference is applied to categorical propositions through contraposition and obversion, 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.

### Differences between transposition and contraposition

Note that the method of transposition and contraposition should not be confused. 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, 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" of contraposition and is also referred to as the "law of contraposition".

## Proofs

| Proposition | Derivation |
| $P\to Q$ | Given |
| $\neg P\lor Q$ | Material implication |
| $Q\lor \neg P$ | Commutativity |
| $\neg \neg Q\lor \neg P$ | Double negation |
| $\neg Q\to \neg P$ | Material implication |

### In classical propositional calculus system

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 \rightarrow \xi \right)\right)\to \left(\left(\phi \to \psi \right)\to \left(\phi \to \xi \right)\right)$
    A3. $\left(\lnot \phi \to \lnot \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 )$, is proven below, using the following lemmas proven here:
    (DN1) $\neg \neg p\to p$ - Double negation (one direction)
    (DN2) $p\to \neg \neg p$ - Double negation (another direction)
    (HS1) $(q\to r)\to ((p\to q)\to (p\to r))$ - one form of Hypothetical syllogism
    (HS2) $(p\to q)\to ((q\to r)\to (p\to r))$ - another form of Hypothetical syllogism.
We also use the method of the hypothetical syllogism metatheorem as a shorthand for several proof steps.
The proof is as follows:
* $q\to \neg \neg q$   (instance of the (DN2))
* $(q\to \neg \neg q)\to ((p\to q)\to (p\to \neg \neg q))$   (instance of the (HS1)
* $(p\to q)\to (p\to \neg \neg q)$   (from (1) and (2) by modus ponens)
* $\neg \neg p\to p$   (instance of the (DN1))
* $(\neg \neg p\to p)\to ((p\to \neg \neg q)\to (\neg \neg p\to \neg \neg q))$   (instance of the (HS2))
* $(p\to \neg \neg q)\to (\neg \neg p\to \neg \neg q)$   (from (4) and (5) by modus ponens)
* $(p\to q)\to (\neg \neg p\to \neg \neg q)$   (from (3) and (6) using the hypothetical syllogism metatheorem)
* $(\neg \neg p\to \neg \neg q)\to (\neg q\to \neg p)$   (instance of (A3))
* $(p\to q)\to (\neg q\to \neg p)$   (from (7) and (8) using the hypothetical syllogism metatheorem)