Modus tollens

Modus tollens ("mode of taking") is a logical argument, or rule of inference. (Compare with modus ponens, or "mode of putting.") It is also known as indirect proof or proof by contrapositive, and is a valid form of argument in formal logic.

As an argument
A modus tollens argument has the following form:

For example:

The contrapositive of "if X then Y" is "if not Y then not X"; if a proposition is true, then so is its contrapositive.

As a rule of inference
In propositional logic:

 $$\left\{X\rightarrow Y,\neg Y\right\} \models \neg X$$

In first-order logic:

 $$\models_{\mathfrak{A}}\forall x.\left(X(x)\rightarrow Y(x)\right) \wedge \models_{\mathfrak{A}}\exists x.\left(\neg Y(x)\right) \implies \models_{\mathfrak{A}}\exists x.\left(\neg X(x)\right)$$

Denying the antecedent
It can be contrasted with the fallacy of denying the antecedent, for instance (using the above example) "it is not raining, therefore the ground is not wet" (obviously untrue if you're standing in a lake). Denying the antecedent asserts not-X rather than not-Y.