{
  "id": "contraposition",
  "title": "Contraposition",
  "lang": "en",
  "source_lang": "en",
  "summary": "Contraposition replaces an implication with one that reverses and negates its antecedent and consequent; the two are equivalent in classical logic.",
  "category": "mathematics",
  "subcategory": "discrete-logic",
  "type": "concept",
  "aliases": [
    "Transposition",
    "Law of contraposition"
  ],
  "generated_at": "2026-11-05",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/contraposition/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/contraposition/",
      "json": "https://aiwiki.page/zh/contraposition.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "Contraposition is a logical transformation that takes an implication “if \\(P\\), then \\(Q\\)” to “if not \\(Q\\), then not \\(P\\).” The resulting statement is called the contrapositive. In classical logic, an implication and its contrapositive are logically equivalent:\n\n\\[(P\\to Q)\\;\\leftrightarrow\\;(\\neg Q\\to\\neg P).\\]\n\nThis equivalence underlies proof by contraposition, a standard method of mathematical proof. Its unrestricted use depends on the underlying logic: in intuitionistic logic, the original implication entails its contrapositive, but the reverse direction is not generally valid."
    },
    {
      "heading": "Logical form and meaning",
      "text": "For an implication \\(P\\to Q\\), the proposition \\(P\\) is the antecedent and \\(Q\\) is the consequent. Contraposition performs two operations together:\n\n- It reverses the order of the antecedent and consequent.\n- It negates both.\n\nFor example:\n\nIf an integer is divisible by \\(4\\), then it is even.\n\nIts contrapositive is:\n\nIf an integer is not even, then it is not divisible by \\(4\\).\n\nThese statements exclude exactly the same possibility: an integer that is divisible by \\(4\\) but not even. More generally, both \\(P\\to Q\\) and \\(\\neg Q\\to\\neg P\\) exclude the case in which \\(P\\) is true and \\(Q\\) is false.\n\nIn classical propositional logic, the arrow is ordinarily interpreted as material implication. The equivalence can be checked by a truth table:\n\n\\(P\\) | \\(Q\\) | \\(P\\to Q\\) | \\(\\neg Q\\to\\neg P\\)\nTrue | True | True | True\nTrue | False | False | False\nFalse | True | True | True\nFalse | False | True | True\n\nIt can also be derived algebraically:\n\n\\[P\\to Q \\;\\equiv\\; \\neg P\\lor Q \\;\\equiv\\; Q\\lor\\neg P \\;\\equiv\\; \\neg Q\\to\\neg P.\\]\n\nHere \\(\\equiv\\) denotes logical equivalence. The last step uses the classical equivalence between \\(Q\\) and \\(\\neg\\neg Q\\)."
    },
    {
      "heading": "Contrapositive, converse, and inverse",
      "text": "Several transformations of an implication have similar names but different logical properties.\n\nStatement | Form\nOriginal implication | \\(P\\to Q\\)\nConverse | \\(Q\\to P\\)\nInverse | \\(\\neg P\\to\\neg Q\\)\nContrapositive | \\(\\neg Q\\to\\neg P\\)\n\nClassically, the original implication is equivalent to its contrapositive, while the converse is equivalent to the inverse. The original implication does not, in general, imply either its converse or its inverse.\n\nFor example, “if an integer is divisible by \\(4\\), then it is even” is true. Its converse, “if an integer is even, then it is divisible by \\(4\\),” is false, as the integer \\(6\\) shows. Its inverse, “if an integer is not divisible by \\(4\\), then it is not even,” is also false.\n\nThe distinction can be expressed through necessary and sufficient conditions. Saying \\(P\\to Q\\) makes \\(P\\) sufficient for \\(Q\\), and \\(Q\\) necessary for \\(P\\). Contraposition states that failure of the necessary condition rules out the sufficient condition."
    },
    {
      "heading": "Proof by contraposition",
      "text": "To prove \\(P\\to Q\\) by contraposition, one proves \\(\\neg Q\\to\\neg P\\). In classical mathematics, their equivalence establishes the desired implication.\n\nFor example, consider the statement:\n\nFor every integer \\(n\\), if \\(n^2\\) is even, then \\(n\\) is even.\n\nIts contrapositive is:\n\nIf \\(n\\) is odd, then \\(n^2\\) is odd.\n\nIf \\(n\\) is odd, there is an integer \\(k\\) such that \\(n=2k+1\\). Consequently,\n\n\\[n^2=(2k+1)^2 =4k^2+4k+1 =2(2k^2+2k)+1,\\]\n\nso \\(n^2\\) is odd. The contrapositive is proved, and therefore so is the original statement. The familiar dichotomy between even and odd integers justifies the wording of the negations in this example.\n\nContraposition is especially useful when the negation of the conclusion supplies a concrete form, witness, or useful restriction that is difficult to obtain from the original hypothesis.\n\nRelation to proof by contradiction\n\nContraposition and proof by contradiction are closely related but are not identical proof structures.\n\n- A proof by contraposition establishes \\(\\neg Q\\to\\neg P\\), typically by assuming \\(\\neg Q\\) and deriving \\(\\neg P\\).\n- A proof by contradiction of \\(P\\to Q\\) may assume both \\(P\\) and \\(\\neg Q\\), then derive a contradiction.\n\nA proof of the contrapositive can itself use contradiction: under the assumption \\(\\neg Q\\), an additional assumption \\(P\\) may yield an impossibility, establishing \\(\\neg P\\). Thus the methods can overlap rather than forming mutually exclusive categories."
    },
    {
      "heading": "Relation to modus tollens",
      "text": "Modus tollens is the rule of inference\n\n\\[P\\to Q,\\qquad \\neg Q \\quad\\vdash\\quad \\neg P.\\]\n\nThe symbol \\(\\vdash\\) indicates derivability from the premises.\n\nContraposition transforms one conditional into another; modus tollens draws a conclusion from a conditional together with the negation of its consequent. In a system permitting contraposition, modus tollens can be presented as first obtaining \\(\\neg Q\\to\\neg P\\), then applying modus ponens to \\(\\neg Q\\).\n\nIn natural deduction, modus tollens also has a direct derivation: assume \\(P\\); the premise \\(P\\to Q\\) gives \\(Q\\), contradicting \\(\\neg Q\\). Discharging the assumption \\(P\\) establishes \\(\\neg P\\)."
    },
    {
      "heading": "Quantified statements and compound conditions",
      "text": "In first-order logic, contraposition applies to implications within quantified formulas. For example,\n\n\\[\\forall x\\,\\bigl(P(x)\\to Q(x)\\bigr)\\]\n\nis classically equivalent to\n\n\\[\\forall x\\,\\bigl(\\neg Q(x)\\to\\neg P(x)\\bigr).\\]\n\nThe domain of quantification and any background assumptions remain unchanged.\n\nFor compound antecedents and consequents, the whole expression must be negated before simplifying. For instance, the contrapositive of\n\n\\[(P\\land R)\\to Q\\]\n\nis\n\n\\[\\neg Q\\to\\neg(P\\land R),\\]\n\nwhich, by classical De Morgan’s laws, is equivalent to\n\n\\[\\neg Q\\to(\\neg P\\lor\\neg R).\\]\n\nIt is not generally equivalent to \\(\\neg Q\\to(\\neg P\\land\\neg R)\\).\n\nLikewise, when quantified expressions are negated, the quantifiers must be handled correctly. Classically,\n\n\\[\\neg\\forall x\\,P(x)\\equiv\\exists x\\,\\neg P(x), \\qquad \\neg\\exists x\\,P(x)\\equiv\\forall x\\,\\neg P(x).\\]\n\nThese transformations can make the contrapositive substantially different in form from the original statement."
    },
    {
      "heading": "Constructive validity and limitations",
      "text": "In intuitionistic logic, the implication\n\n\\[(P\\to Q)\\to(\\neg Q\\to\\neg P)\\]\n\nis valid. Given \\(P\\to Q\\) and \\(\\neg Q\\), any assumption of \\(P\\) produces a contradiction, proving \\(\\neg P\\).\n\nThe reverse implication,\n\n\\[(\\neg Q\\to\\neg P)\\to(P\\to Q),\\]\n\nis not generally intuitionistically valid. From \\(\\neg Q\\to\\neg P\\) and \\(P\\), one can derive \\(\\neg\\neg Q\\), but obtaining \\(Q\\) requires double-negation elimination or some additional property of \\(Q\\). Consequently, proving a contrapositive does not automatically establish the original implication constructively. It does suffice when \\(Q\\) is stable, meaning that \\(\\neg\\neg Q\\to Q\\) is available.\n\nContraposition also requires care outside formal deductive settings. Ordinary-language conditionals may express causation, temporal order, hypothetical dependence, or exceptions rather than material implication. In particular, a statement such as “if \\(P\\), then usually \\(Q\\)” does not license the deduction “if not \\(Q\\), then not \\(P\\).” Contraposition preserves a strict logical implication; it does not by itself reverse causal explanations or turn a probabilistic tendency into a deductive guarantee."
    }
  ],
  "links": [
    "classical-logic",
    "mathematical-proof",
    "propositional-logic",
    "material-implication",
    "truth-table",
    "integer",
    "proof-by-contradiction",
    "inference-rule",
    "modus-ponens",
    "natural-deduction",
    "first-order-logic",
    "de-morgans-laws",
    "intuitionistic-logic",
    "double-negation-elimination"
  ],
  "sources": [],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}