Universal Affirmative and Universal Negative are Contrary iff First Predicate is not Vacuous

Theorem
Consider the categorical statements:

Then:
 * $\mathbf A$ and $\mathbf E$ are contrary


 * $\exists x: \map S x$
 * $\exists x: \map S x$

Using the symbology of predicate logic:
 * $\exists x: \map S x \iff \neg \paren {\paren {\forall x: \map S x \implies \map P x} \land \paren {\forall x: \map S x \implies \neg \map P x} }$

Sufficient Condition
Let $\exists x: \map S x$.

Suppose $\mathbf A$ and $\mathbf E$ are both true.

As $\mathbf A$ is true, then by Modus Ponendo Ponens:
 * $\map P x$

As $\mathbf E$ is true, then by Modus Ponendo Ponens:
 * $\neg \map P x$

It follows by Proof by Contradiction that $\mathbf A$ and $\mathbf E$ are not both true.

Thus, by definition, $\mathbf A$ and $\mathbf E$ are contrary statements.

Necessary Condition
Let $\mathbf A$ and $\mathbf E$ be contrary statements.

Suppose:
 * $\neg \exists x: \map S x$

that is, $\map S x$ is vacuous.

From Denial of Existence:
 * $\forall x: \neg \map S x \dashv \vdash \neg \exists x: \map S x$

it follows that $\forall x: \map S x$ is false.

From False Statement implies Every Statement:
 * $\forall x: \map S x \implies \map P x$

is true, and:
 * $\forall x: \map S x \implies \neg \map P x$

is also true.

Thus, by definition, $\mathbf A$ and $\mathbf E$ are not contrary statements.

It follows by Proof by Contradiction that $\exists x: \map S x$.

Also defined as
Some sources gloss over the possibility of $\map S x$ being vacuous and merely report that the universal affirmative and universal negative are contrary.