<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Automatic Proof-Checking of Ordinary Mathematical Texts</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ste en Frerix</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Peter Koepke</string-name>
        </contrib>
      </contrib-group>
      <pub-date>
        <year>1993</year>
      </pub-date>
      <abstract>
        <p>The System for Automated Deduction (SAD) by Andrei Paskevich et. al. is an automatic proof-checker that can process fairly natural mathematical input statements and short texts. We have recently made signi cant improvements to the system: speed-ups of the checking algorithms allow handling of chapter-sized texts with an argumentative granularity comparable to textbook mathematics; extensions of the input language provide native support of basic notions like sets and functions; SAD input can now be written in a LATEX style which typesets like ordinary mathematical text. Based on experiences and examples so far we expect to be able to write natural textbook-style mathematics which can be automatically checked for proof correctness. Actually this paper is a proof-checked SAD document itself.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <sec id="sec-1-1">
        <title>The SAD proof checker is an impressive proof of concept checking some elegant mathematical \miniatures"</title>
        <p>but leaving much room for further improvements. Revising the checking algorithms we were able to cut down
some proof-checking times from minutes to seconds. This allows the handling of chapter-sized texts and libraries
of interlinked texts. The rudimentary support of sets was replaced by stronger mechanisms for sets and functions.</p>
        <sec id="sec-1-1-1">
          <title>The new SAD accepts LATEX as an input format. More information on technical aspects can be found in the</title>
        </sec>
      </sec>
      <sec id="sec-1-2">
        <title>Aussois??/Oxford??-abstracts.</title>
        <p>3</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>An SAD example text</title>
      <sec id="sec-2-1">
        <title>Actually this paper is itself a LATEX-document which is accepted by SAD. The ForTheL content of this paper</title>
        <p>is included in a forthel environment, marked by a vertical line in the margin. Only text embedded within such
environments is parsed and proof-checked by SAD. We present an actual working example from complex analysis
which proves the familiar maximum principle for holomorphic functions from other basic theorems.
4</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Ad hoc Preliminaries</title>
      <p>[number/-s][ontored on][checkontored on]</p>
      <sec id="sec-3-1">
        <title>Let the domain of f stand for Dom(f ). Let z is in M stand for z is an element of M .</title>
        <sec id="sec-3-1-1">
          <title>Let M contains z stand for z is in M . Let z 2 M stand for z is in M .</title>
        </sec>
      </sec>
      <sec id="sec-3-2">
        <title>Let f denote a function. Let M denote a set.</title>
        <p>De nition 1. A subset of M is a set N such that every element of N is an element of M .
De nition 2. Assume M is a subset of the domain of f . f [M ] = ff [x] j x 2 M g.</p>
        <p>Signature 1. A complex number is a notion. Let z; w denote complex numbers.</p>
        <p>Axiom 1. Every element of Dom(f ) is a complex number and for every element z of Dom(f ) f [z] is a complex
number.</p>
        <p>Axiom 2. Every element of M is a complex number.</p>
        <p>Signature 2. A real number is a notion. Let x; y denote real numbers.</p>
        <p>Signature 3. jzj is a real number.</p>
        <p>Signature 4. x is positive is an atom. Let ; denote positive real numbers.</p>
        <p>Signature 5. x &lt; y is an atom. Let x</p>
        <p>y stand for x = y or x &lt; y.</p>
        <p>Axiom 3. x &lt; y ! :y &lt; x.</p>
        <p>Signature 6. f is holomorphic is an atom.</p>
        <p>Signature 7. B (z) is a set that contains z.</p>
        <p>Axiom 4. jzj &lt; jwj for some element w of B (z).</p>
        <p>Axiom 5. B (z) is open.</p>
        <p>De nition 3. M is open i for every element z of M there exists
such that B (z) is a subset of M .</p>
        <p>De nition 4. A local maximal point of f is an element z of the domain of f such that there exists such that
B (z) is a subset of the domain of f and jf [w]j jf [z]j for every element w of B (z).</p>
        <p>De nition 5. Let U be a subset of the domain of f . f is constant on U i there exists z such that f [w] = z
for every element w of U . Let f is constant stand for f is constant on the domain of f .
5</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Basic Theorems about Holomorphic Functions</title>
      <sec id="sec-4-1">
        <title>We axiomatically assume some standard theorems of complex analysis.</title>
        <p>Axiom 6 (OpenMappingTheorem). Assume f is holomorphic and B (z) is a subset of the domain of f . If f
is not constant on B (z) then f [B (z)] is open.</p>
        <p>Signature 8. A region is an open set.</p>
        <p>Axiom 7 (IdentityTheorem). Assume f is holomorphic and the domain of f is a region. Assume that B (z)
is a subset of the domain of f . If f is constant on B (z) then f is constant.
6</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>The Maximum Principle</title>
      <sec id="sec-5-1">
        <title>The principle can be easily derived from the basic theorems.</title>
        <p>Theorem 1. Assume f is holomorphic and the domain of f is a region. If f has a local maximal point then f
is constant.</p>
        <sec id="sec-5-1-1">
          <title>Proof Let z be a local maximal point of f . Take such that B (z) is a subset of Dom(f ) and jf [w]j jf [z]j</title>
          <p>for every element w of B (z).</p>
        </sec>
      </sec>
      <sec id="sec-5-2">
        <title>Let us show that f is constant on B (z). Assume the contrary. Then f [B (z)] is open. We can take such</title>
        <p>that B (f [z]) is a subset of f [B (z)]. Therefore there exists an element w of B (z) such that jf [z]j &lt; jf [w]j.</p>
      </sec>
      <sec id="sec-5-3">
        <title>Contradiction. end.</title>
      </sec>
      <sec id="sec-5-4">
        <title>Hence f is constant. 2</title>
        <p>We make some comments which also describe important aspects of the ForTheL-language:
1. This text is typeset from a LATEX- le which is also accepted and proof-checked by the improved SAD within
a few seconds. The complete le starts out with basic de nitions and axioms for the argument and is about
three times the size of the excerpt.
2. The text is formulated in the restricted natural language ForTheL, which is immediately understandable
by mathematicians. The language is apparently translatable to rst-order logic, but it is more exible and
natural than just using logical connectives. There is, e.g., some typing and use of anonymous variables like
in the de nition: \a subset of M is a set N such that every element of N is an element of M ".
3. The language constructs of ForTheL have been carefully modelled after OLM to allow elegant formulations
of logical dependencies without (nested) brackets or other formal devices.
4. ForTheL allows to freely introduce new unde ned notions by signature commands and specify their properties
by axioms, without worrying about grounding everything in some foundational system like set theory. Other
notions may be based on previous notions by de nitions.
5. The attentive reader will have noticed that some notions and axioms are formulated just for the example and
would have to be amended if we want to capture the situation in more generality: In the text, e.g., " and
are ranging over positive real numbers. This notion has only been introduced in the ad hoc preliminaries, and
positivity has not been connected with the &lt;-relation since that is not required for the proof of the maximum
principle. A more comprehensive text would of course have to x that liberal approach.</p>
      </sec>
      <sec id="sec-5-5">
        <title>6. Notions provide soft-typing of all variables and constants. In natural language, soft-typing serves to direct the</title>
        <p>readers attention to a \small world" delineated by the types in the statements under immediate consideration.</p>
      </sec>
      <sec id="sec-5-6">
        <title>They are useful in automatic theorem proving for selecting premises from the context which contain common types with the statement to be proved.</title>
      </sec>
      <sec id="sec-5-7">
        <title>7. The proof-checking employs a reasoner which generates proof obligations along the text. This involves also</title>
        <p>ontological checks that terms belong to certain types. Ontological checking has similarities with strong type
checking for programming languages, and it helps to nd formalization errors.</p>
      </sec>
      <sec id="sec-5-8">
        <title>8. The logical context of a SAD text is that the conjunction of all premises implies the conjunction of all theorems.</title>
      </sec>
      <sec id="sec-5-9">
        <title>Such implications can be pieced together to build up mathematical theories.</title>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>Soft typings</title>
      <sec id="sec-6-1">
        <title>Notions play a central role in the ForTheL language. They provide the basic \types" that an object may have</title>
        <p>in a text. In the example above we nd notions such as \set", \complex number", \real number" and \positive
real number". A variable must be declared to belong to some notion before it can be used. Moreover, we can
not quantify unboundedly but only over notions. The translation to rst-order logic is done using type guards.</p>
      </sec>
      <sec id="sec-6-2">
        <title>Depending on the number of variables, the formulas obtained can therefore become quite large, which burdens the ATP used to discharge proof obligations. A smart processing of notions has been an essential component for increasing the power of SAD.</title>
      </sec>
      <sec id="sec-6-3">
        <title>Mathematians may use notions to guide their attention to a \small world". A theorem about graphs will</title>
        <p>usually not be considered when dealing with a problem of number theory. Being integer is then an ontological
property rather than a logical one. Within the world of integers it cannot substantially contribute to an argument.</p>
      </sec>
      <sec id="sec-6-4">
        <title>We have developed a method to detect such notions typings and subsequently reduce the proof task for the ATP.</title>
      </sec>
      <sec id="sec-6-5">
        <title>A key property that a ForTheL text may have is ontological correctness. Roughly speaking this means that</title>
        <p>every application of a predicate or function symbol is well-de ned. When introducing a symbol to the signature,
an author makes certain assumptions on its arguments, which we call domain conditions. These assumptions
may be hidden in a text through the use of pretyped variables. For example, in De nition 2 in the above text
we introduce the symbol [ ](f; M ) with the domain conditions aSet(M ); aFunction(f ); aSubsetOf(M; Dom(f )).</p>
      </sec>
      <sec id="sec-6-6">
        <title>If ' is a formula occuring in the rst-order image of a ForTheL text, we can determine for every variable x occuring in ' the most general domain that x is assumed to be in. These domain assumptions are then deleted from '. Let us demonstrate the reduction on a short example. [number/-s]</title>
        <p>Signature. A real number is a notion.</p>
      </sec>
      <sec id="sec-6-7">
        <title>Let x; y denote real numbers.</title>
        <p>Signature. x y is a real number.</p>
        <p>Signature. x is nonzero is an atom.</p>
        <p>Signature. Assume x is nonzero. x 1 is a real number.
Axiom. Assume x and y are nonzero. x y is nonzero.</p>
        <p>Axiom. Assume x is nonzero. x 1 is nonzero.</p>
      </sec>
      <sec id="sec-6-8">
        <title>The rst order images of the two axioms are</title>
        <p>(aRealNumber(x) ^ aRealNumber(y)) ! (isNonzero(x) ^ isNonzero(y)) ! isNonzero(x y)
aRealNumber(x) ! isNonzero(x) ! isNonzero(x 1):</p>
      </sec>
      <sec id="sec-6-9">
        <title>Being a real number is a domain condition for all the other symbols involved while being nonzero is only a</title>
        <p>condition for () 1. Therefore for the rst formula, the most general domain condition is (aRealNumber(x) ^
aRealNumber(y) and for the second formula it is aRealNumber(x) ^ isNonzero(x). We can thus reduce these
formulas to
isNonzero(x) ^ isNonzero(y) ! isNonzero(x y)
isNonzero(x 1):</p>
        <sec id="sec-6-9-1">
          <title>This reduction corresponds to usual mathematical thinking. The term x 1 will always be nonzero when it is</title>
          <p>well-de ned. We call the procedure ontological reduction.</p>
        </sec>
      </sec>
      <sec id="sec-6-10">
        <title>Such a deletion of disjuncts from a rst-order problem is clearly complete. One can moreover show the following theorem.</title>
        <p>Theorem 2. Let T be an ontologically correct ForTheL text. Assume that the rst-order image of T has a model
in which all domain conditions are non-empty. Then its ontological reduction also has a model.</p>
      </sec>
      <sec id="sec-6-11">
        <title>In the proof of the theorem, a model for the ontological reduction is constructed by suitably changing the</title>
        <p>interpretation of symbols outside of their domain, so that domain guards become super uous. Ontological
correctness ensures that after those changes we still have a model of the original text.</p>
      </sec>
      <sec id="sec-6-12">
        <title>The assumption on the non-emptyness of all domain conditions corresponds to non-emptyness of sorts in</title>
        <p>many-sorted rst-order logic. It will in general not be a problem, since usual mathematical symbols are de ned
for non-empty domains. In case where a text uses hypotheticals to nally show emptyness of a certain class,
possibly problematic domain conditions can be excluded from the reduction process to ensure soundness.</p>
      </sec>
      <sec id="sec-6-13">
        <title>Dealing with typings in a rst-order setting is not a new problem. In [BBPS13], multiple encodings of (mono</title>
        <p>and polymorphic) many-sorted FOL to pure FOL are developed for Sledgehammer in order to encode Isabelle's
type system. Encoding by type guards, the approach formerly used by SAD, was among the worst performing.</p>
      </sec>
      <sec id="sec-6-14">
        <title>If one applies ontological reduction to a ForTheL text that describes some problem in (monomorphic) many</title>
        <p>sorted FOL, then the result is very close to that obtained by the \featherweigth guards" encoding described
in [BBPS13]. However, our approach is more exible and therefore better suited for our soft type system. For
example we can possibly delete predicates of arity higher than one and negated predicates. Furthermore, we can
more adequately deal with the complex relations between ForTheL notions.
8</p>
      </sec>
    </sec>
    <sec id="sec-7">
      <title>Further plans</title>
      <sec id="sec-7-1">
        <title>We are pursuing a comprehensive project for transforming the original SAD system into a productive formal</title>
        <p>ization workbench. We shall use the Isabelle editor as an IDE for formalizing mathematics and for giving more
feedback to the user. The compact Haskell source code of SAD is being systematized and documented to ensure
the sustainability of the project. We shall try to better separate the parsing from the proof-checking process so
that the language module could be used with other formal mathematics systems.</p>
      </sec>
      <sec id="sec-7-2">
        <title>We are collaborating with linguists for the de nition and implementation of a proper natural language gram</title>
        <p>mar. Natural language words should not be arbitrary letter combinations, as is possible now, but taken from an</p>
      </sec>
      <sec id="sec-7-3">
        <title>English dictionary. We shall increase linguistic exibility by new grammatical constructs without compromising unique readability.</title>
      </sec>
      <sec id="sec-7-4">
        <title>The ForTheL language will be enriched by further constructs for proof structuring and for algebraic structures</title>
        <p>and inductive data types. Standard domains like number systems will be formalized in a basic library of texts
useful for many purposes. Some aspects like the handling of natural numbers could be taken over into the
software, to provide some computational power. Also our term rewriting system will be improved.</p>
      </sec>
      <sec id="sec-7-5">
        <title>We shall undertake the formalization of comprehensive texts at the level of undergraduate mathematics. We</title>
        <p>shall also examine research articles whether a partial formulation in ForTheL is pro table. To evaluate usability,
students of mathematics will be asked to prepare homework solutions in the system.</p>
        <p>Texts about various domains can be arranged in interlinked libraries. The above example could be linked
to an introductory text about holomorphic functions, which again could be linked to some development of
complex numbers etc. Texts could be linked by a simple reading-in of other texts, or by more sophisticated,
truth-preserving operations like uni cations of notations, or they might require some logical bridging between
conclusions of one text and premisses of the other. In our example text, the notion of a region is introduced to
allow standard formulations of the Identity Theorem and the Maximum Principle. We only require regions to
be open, whereas in a comprehensive foundation regions also have to be connected and non-empty. To connect
our example to such a foundational text requires the implication that a region is open. A systematic study of
such relations is required for building larger libraries.
9</p>
      </sec>
    </sec>
    <sec id="sec-8">
      <title>Discussion</title>
      <sec id="sec-8-1">
        <title>We have come to a peculiar situation where a formal language is able to cover broad areas of a subject area and</title>
        <p>becomes nearly indistinguishable from the natural language of a domain. The convergence of the formal and
the natural leads to a host of serious questions, ranging from practical to philosophical issues. In any case our
research demonstrates that the formal approach in mathematics is not restricted to foundations but that it can
be used all the way up to sophisticated theories provided that the formalism is set up prudently in a hierarchical
fashion.</p>
        <p>We conjecture that in a few years time it will be routinely possible to formulate substantial textbook
mathematics and some advanced mathematics in a ForTheL-like controlled and proof-checked natural language. Other
proof assistants could similarly be equipped with natural language input. Formal mathematics could be carried
out naturally in a text-orientated way, using collections of interlinked texts which are readable and
understandable by men and machines.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [BBPS13]
          <string-name>
            <given-names>Jasmin</given-names>
            <surname>Christian</surname>
          </string-name>
          <string-name>
            <surname>Blanchette</surname>
          </string-name>
          , Sascha Bohme, Andrei Popescu, and Nicholas Smallbone.
          <article-title>Encoding monomorphic and polymorphic types</article-title>
          .
          <source>In International Conference on Tools and Algorithms for the Construction and Analysis of Systems</source>
          , pages
          <fpage>493</fpage>
          {
          <fpage>507</fpage>
          . Springer,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <given-names>Mohan</given-names>
            <surname>Ganesalingam</surname>
          </string-name>
          .
          <article-title>The language of mathematics</article-title>
          .
          <source>PhD thesis</source>
          , Springer,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <string-name>
            <given-names>V Mo</given-names>
            <surname>Glushkov</surname>
          </string-name>
          .
          <article-title>Some problems in the theories of automata and arti cial intelligence</article-title>
          .
          <source>Cybernetics</source>
          ,
          <volume>6</volume>
          (
          <issue>2</issue>
          ):
          <volume>17</volume>
          {
          <fpage>27</fpage>
          ,
          <year>1970</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [KCKS09] Daniel Kuhlwein, Marcos Cramer,
          <string-name>
            <given-names>Peter</given-names>
            <surname>Koepke</surname>
          </string-name>
          , and
          <article-title>Bernhard Schroder. The naproche system</article-title>
          .
          <source>Intelligent Computer Mathematics</source>
          , Springer LNCS, ISBN,
          <volume>978</volume>
          :3{
          <fpage>642</fpage>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>