1 The gn-logic style option

Description of Version 1.4 (5/95) by Gerd Neugebauer

The gn-logic style option provides a facility to typeset logical formulas of a certain kind. This style option provides an environment like eqnarray, an extended newtheorem environment and several macros.

1.1 Mathematical Symbols

The following marcos provide better usage of the junctors and quantifiers. Especially the spacing is improved.

Symbol  Macro  Example

∧  \AND           A\AND B  A ∧ B
∨  \OR            A\OR B  A ∨ B
∨^{.}  \XOR           A\XOR B  A ∨^{.} B
→  \IMPLIES       A\IMPLIES B  A → B
→  \IMPL          A\IMPL B  A → B
←  \IF            A\IF B  A ← B
↔  \IFF           A\IFF B  A ↔ B
⟷^{def}  \IFFdef        A\IFFdef B  A ⟷^{def} B
∧. . .∧  \ANDdots       A_1\ANDdots A_n  A_{1} ∧. . .∧ A_{n}
∨. . .∨  \ORdots        A_1\ORdots A_n  A_{1} ∨. . .∨ A_{n}
\  \is            x\is y  x\y
IN  \Nat           n\in\Nat  n ∈ IN
∀  \Forall        \Forall x P(x)  ∀x P (x)
∃  \Exists        \Exists y P(x)  ∃y P (x)

The \AND Macro

This macro can be used for the logical conjunction. In addition to the \wedge macro it adds more space and the formulas tend to be better readable. Compare

x=1\AND y=x  produces x = 1 ∧ y = x
x=1\wedge y=x produces x = 1 ∧ y = x
x=1\land y=x  produces x = 1 ∧ y = x

The \OR Macro This macro can be used for the logical disjunction. In addition to the \vee macro it adds more space. Compare

x=1\OR y=x  produces x = 1 ∨ y = x
x=1\vee y=x produces x = 1 ∨ y = x
x=1\lor y=x produces x = 1 ∨ y = x

The \XOR Macro This macro can be used for the exclusive disjunction. It has no common counterpart. The spacing is like in in all junctor macros.

x=1\XOR y=x produces x = 1 ∨^{.} y = x

The \IMPL and the \IMPLIES Macros These macros can be used for the logical implication. In addition to the \rightarrow macro it adds more space. Compare

x=1\IMPL y=x  produces x = 1 → y = x
x=1\IMPLIES y=x  produces x = 1 → y = x

         x=1\rightarrow y=x produces x = 1 → y = x

The \IF Macro This macro can be used for the logical implication written in reverse order. In addition to the \leftarrow macro it adds more space. Compare

x=1\IF y=x  produces x = 1 ← y = x

         x=1\lefttarrow y=x produces x = 1 ← y = x

The \IFF Macro This macro can be used for the logical equivalence. In addition to the \leftrightarrow macro it adds more space. Compare

x=1\IFF y=x  produces x = 1 ↔ y = x

       x=1\leftrighttarrow y=x produces x = 1 ↔ y = x

The \IFFdef Macro Like above but with a small “def” above the arrow.

x=1\IFFdef y=x produces x = 1 ⟷^{def} y = x

The \is Macro This macro is for typesetting unifiers. In this case the predefined \setminus produces to much space.

    \{y\setminus x, z\setminus 4\}  produces {y \ x, z \ 4}

\{y\is x, z\is 4\}  produces {y\x, z\4}

    \{y\backslash x, z\backslash 4P} produces {y\x, z\4}

The Number Macros This are macros for those who have no access to the AMS-TEX fonts. It makes the symbols for the natural numbers, integers, rationals, reals and complex numbers. The usual magnification commands apply to it aswell.

          \tiny     ...    \normalsize     ...    \Huge   X_X

\bbB  IB IB IB IB IB IB IB IB IB IB IB_{IB}

\Complex\bbC  C C C C C C C C C C C_{C}

\bbD  ID ID ID ID ID ID ID ID ID ID ID_{ID}
\bbE  IE IE IE IE IE IE IE IE IE IE IE_{IE}
\bbF  IF IF IF IF IF IF IF IF IF IF IF_{IF}
\bbG  G G G G G G G G G G G_{G}
\bbH  IH IH IH IH IH IH IH IH IH IH IH_{IH}
\bbI II II II II II II II II II II II_{II}
\bbJ  JJ JJ JJ JJ JJ JJ JJ JJ JJ JJ JJ_{JJ}
\bbK  IK IK IK IK IK IK IK IK IK IK IK_{IK}
\bbL  IL IL IL IL IL IL IL IL IL IL IL_{IL}
\bbM  IM IM IM IM IM IM IM IM IM IM IM_{IM}
\Nat \bbN  IN IN IN IN IN IN IN IN IN IN IN_{IN}
\bbO  O O O O O O O O O O O_{O}
\bbP  IP IP IP IP IP IP IP IP IP IP IP_{IP}
\Rat \bbQ  Q Q Q Q Q Q Q Q Q Q Q_{Q}
\Real \bbR  IR IR IR IR IR IR IR IR IR IR IR_{IR}
\Int \bbZ  ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ_{ZZ}
\bbOne  1l 1l 1l 1l 1l 1l 1l 1l 1l 1l  1l_{1l}

Unfortunately the macros \bbC, \bbG, \bbO, and \bbQ do not scale properly when used in subscripts or superscripts of formulae. The following examples shows how the sizing can be achieved manually

   \bbQ_{\mbox{\scriptsize \bbQ}} produces Q_{Q}

The \Forall and the \Exists Macros

The general problem with quantifies is that after the quantified variable the following formula is not automatically seperated with a small space. This can be overcome by the following macros.

The \Forall and the \Exists macros take one argument. They typeset the respective quantifier followed by the argument (i.e. the variable) and finally a small space. As usual the argument has to be enclosed in braces if it consists of more than one character. Otherwise the braces can be omitted. This allows a elegant notation of short quantified formulas.

\Forall x P(x)  produces ∀x P (x)

\Forall{x_1,\ldots,x_n}P(x_1,\ldots,x_n) produces ∀x_{1}, . . . , x_{n} P (x_{1}, . . . , x_{n})

\Exists x P(x)  produces ∃x P (x)

\Exists{x_1,\ldots,x_n}P(x_1,\ldots,x_n) produces ∃x_{1}, . . . , x_{n} P (x_{1}, . . . , x_{n})

1.2 The Formula Environment

This environment allows to typeset logical formulas. The main problem with the eqnarray environment was the numbering. In multiline formulas my intention was to have the number in the middle of the formula. Inside this environment several macros are valid.

\begin{Formula}[label] \end{Formula}

Start the list of formulas. Optionally a label can be given. This label is used to reference the first formula.

\=

Start a new line.

\>level Start a new line and indent to the given level. This indentation is done in quantities of \FormulaIndent which can be set with the \setlength command. The default value is 3em.

\Form[label]

Start a new formula. Optionally a label can be given. This label can be used to reference to the formula (see \ref).

Now lets have a look at some examples. First, we see a single two-line formula. Note that the number at the right side is centered between the two lines.

\begin{Formula}
    P(X) \IMPL
\=  Q(X) \IFF R_1(X) \OR R_2(X)
\end{Formula}

\begin{matrix}P (X) → \\ Q(X) ↔ R_{1}(X) ∨ R_{2}(X) \end{matrix} ; (1)

Next we will see an example of several formulas. The first formula is split to three lines and the third line is indented to level 1. Remark: \= is in reality an abbrevation for \>0.

\begin{Formula}[form:1]
    P(X) \IMPL
\=  Q(X) \IFF R_1(X)
\>1 \OR R_2(X)
\Form[form:2]
    S(X) \IMPL
\=  \neg Q(X) \IFF R_1(X) \OR R_2(X)
\end{Formula}

\begin{matrix}P (X) → \\ Q(X) ↔ R_{1}(X) \\ ∨ R_{2}(X) \end{matrix} (2) \begin{matrix}S(X) → \\ ¬Q(X) ↔ R_{1}(X) ∨ R_{2}(X) \end{matrix} ; (3)

1.3 The NewTheorem Environment

My experience with the newtheorem environment was that I had a certain scheme to use it. First, every theorem got a label. Thus, every theorem was followed by a label command. Optionally a theorem may have a name. This name is typeset right after the number. The body of the theorem allways started in the next line. This let to the definition of an extended NewTheorem environment. The arguments are the same as those of the newtheorem environment. But the environment defined by this extended command take two optional arguments. The first optional argument is a label to be assigned to the theorem. This argument has to be enclosed in parentheses. The second type of optional argument has to be enclosed in brakets. It is typeset in \small after the title text. The third optional argument is enclosed in <>. It is typeset in \small\bf and surrounded by parentheses.

\NewTheorem{guess}{Conjecture}
\begin{guess}[Fermat](thm:fermat)
 There do not exist integers $n>2$,
 $x$, $y$, and $z$ such that
 $x^n+y^n=z^n$.
\end{guess}

Conjecture 1 Fermat

There do not exist integers n > 2, x, y, and z such that x^{n} + y^{n} = z^{n}.

The commands used to typeset some of the optional argument can be customized in the following way. The macros \TheoremTitle and \TheoremName are used to typeset their argument in \small and \small\bf and enclosed in parentheses respectively. This macros can be redefined using \renewcommand as shown in the following example:

\NewTheorem{theorem}{Theorem}
\renewcommand{\TheoremTitle}[1]{{\sf [#1]}}
\renewcommand{\TheoremName}[1]{{\small(#1)}}
\begin{theorem}[Fermat]<conjecture>(thm:f2)
 There do not exist integers ...
\end{theorem}

Theorem 1 Fermat (conjecture)

There do not exist integers n > 2, x, y, and z such that x^{n} + y^{n} = z^{n}.