<!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>Towards the Structure of Mathematical Proof</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Reinhard Kahle?</string-name>
          <email>kahle@mat.uc.pt</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>CENTRIA and DM, FCT, Universidade Nova de Lisboa</institution>
          <addr-line>P-2829-516 Caparica</addr-line>
          ,
          <country country="PT">Portugal</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>a2 = 2b2 is soluble in integers a, b with (a; b) = 1. Hence a2 is even, and therefore a is even. If a = 2c, then 4c2 = 2b2; 2c2 = b2, and b is also even, contrary to the hypothesis that (a; b) = 1." This proof should be understandable for everybody with basic mathematical knowledge. However, the editor draws attention to the fact, that a simple test of correctness of this proof is out of reach for the current computer provers [Wie06, p. 3]: \Ideally, a computer should be able to take this text as input and check it for its correctness. We clearly are not yet there." Thus, he advances with the representation of proofs of this theorem given, or implemented, in the theorem provers presented in the book. The outcome is puzzling. Of course, all the theorem provers provide us with \correct proofs", but none of them would even come close to a human readable text, comparable with the proof given in the book of Hardy and Wright. This is addressed by Scott when he writes in the preface of the book, [Sco06, p. viiif]: \We can also ? Research supported by the Portuguese Science Foundation, FCT, through the projects Hilbert's Legacy in the Philosophy of Mathematics, PTDC/FIL-FCI/ 109991/2009 and The Notion of Mathematical Proof, PTDC/MHC-FIL/5363/2012. 1 The same example was chosen by Lamport in his note [Lam95] which, along with its \update" [Lam12], provides a good motivation for our work. 2 Apparently, there took no major advance place in the last 8 years with respect to the question under consideration here, although, of course, many of the provers improved a lot.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>In 2006, Wiedijk edited a book where seventeen theorem provers are presented
how they prove the irrationality of p2.1 This book gives an interesting insight
into the state of the art of theorem proving.2 In the introduction the editor
presents a six line proof of the irrationality of p2, taken from the textbook of
Hardy and Wright [HW60, p. 39f]:
\The traditional proof ascribed to Pythagoras runs as follows. If p2 is
rational, then the equation
see clearly from the examples in this collection that the notations for input and
output have to be made more human readable."</p>
      <p>Of course, there is a lot of e ort put into the challenge to generate human
readable output, receiving even more attraction in the mathematical community
since the Fields medallist Tim Gowers started to contribute to this question, cf.
[GG13].</p>
      <p>But our question is not whether or how one can produce human readable
output of one computer generated proof or proof system, but rather, how one can
capture the structure of the \abstract" mathematical proof in a representation
of a proof. With respect to the problem of checking automatically the proof of
the irrationality of p2 given above, Wiedijk writes [Wie06, p. 3]: \One of the
reasons for this is that this version of the proof does not have enough detail."
Of course, this \accusation" can easily be inverted by stating that computer
generated proofs contain too many details, as it was expressed by by Scott
[Sco06, p. ix f]: \[F]or veri cation (. . . ) checkable proofs have to be generated
and archived. Computers are so fast now that hundreds of pages of steps of
simpli cations can be recorded even for simple problems. Hence, we are faced
with the questions, `What really is a proof?' and `How much detail is needed?' ".</p>
      <p>Here, we would like to challenge the theorem prover community to provide
interfaces which allow to transfer proofs performed in one theorem prover to
another.3 Of course, many systems di er signi cantly in the underlying logic,
the internal representation of datatypes, automatic components, user de ned
extensions, etc. However, a proof|in the sense we look for|of the irrationality of
p2 should not depend on any of these particularities. Thus, if there is something
like an abstract proof of this theorem, the theorem provers should be able to
give such one, and they should be able to exchange it among each other. We
conjecture that a very lot of the disturbing details, which also depend on the
speci c implementation of a theorem prover, would be ltered out in the proof
representation suitable for computer interaction.</p>
      <p>Our own proposal is to develop an xml speci cation of mathematical proof
which should be adequate to represent proofs as given by Hardy and Wright;
in a second step, one would have to write interpreters which would, rst, translate
proof generated by theorem provers in such xml scripts and, then, such scripts
back into proofs of the di erent computer provers.
2</p>
    </sec>
    <sec id="sec-2">
      <title>An xml speci cation for Mathematical Proof</title>
      <p>In the following we like to give an ad-hoc example how a xml representation
of Hardy and Wright could look like. We are far from presenting here a
3 There is some work going on in this direction: Hybrid systems try to combine
components of di erent proof systems to work together; cf. for instance for HOL/Mizar
[Har96], or for Elan/Coq [AN00]. These approaches, however, are usually bilateral
and depend on the syntax of the speci c systems which are combined. For OMDoc see
below.
substantial proposal for an xml speci cation, but like to give the example to
indicate some of the possible features such a speci cation should show.</p>
      <p>We hope that the reader agrees that this is a rather faithful representation
of the proof given above. The only explicit addition is line 18, as c \falls from
heaven" in the proof above, but we would like to avoid to have \free" variables
hanging around in our representation.</p>
      <p>Two remarks are in order. First, we gave the mathematical statements in the
lines of the proof in the usual mathematical notation; of course, they could|
and probably should|also be speci ed in an xml representation. However, they
are secondary for the structure of the proof. They will be, of course, absolutely
essential for the correctness of the proof|but that's not our issue (at least, not
at this stage).</p>
      <p>Second, the main tag is obviously &lt;hence/&gt;, which should represent a \step"
in the proof. We model it here \line-by-line" such that the reconstruction looks
like \Hilbert-style"; if one would incorporate premises and conclusion in one tag
which, in this case, would become nested, one would be closer to a \natural
deduction-style" representation. But we think that such a nesting is not really
present in the proof above, and that it would only be the result of a ( rst) meta
analysis of the proof.</p>
      <p>Two more minor remarks: rst, the number labels of the &lt;line/&gt; tag are
ad-hoc, just to have the possibility to refer to them; in the concrete case we
use it line 32 for the contradiction. Already here one may notice that Hardy
and Wright suppress a last step of the proof: it is not said explicitly that the
contradiction obtained results in the negation of the assumption made at the
beginning|and only this gives you the statement of the theorem. It is obvious
that this last step is expected to be recognized by any mathematical reader.</p>
      <p>Second, in the given example we are not sure whether our treatment of
quanti ers is appropriate, in particular, because we do not indicate the scope of the
quanti cations (which, however, are also not indicated explicitly in the proof).
3</p>
      <p>&lt;hence/&gt;
As said, the &lt;hence/&gt; tag is the main ingredient of our xml example. It should
represent a \step" as it can be identi ed in the proof above. One may note rst,
that we do not follow a literal translation which would represent the second
sentence of the proof \If p2 is rational, then . . . " as an implication; in fact,
it is not treated as an implication in the proof, as the premise of it is never
assumed separately. Thus, if the reader agrees, that this tag gives a faithful
representation of Hardy and Wright's steps, we can ask how these steps are
related to reasoning implemented in automatic or interactive theorem provers.
Wiedijk's question. Wiedijk has asked for an automatic veri cation of Hardy
and Wright's proof, admitting that we are not yet there. Would it be possible
to verify our \xml proof" by a computer assisted theorem prover? We think that
this might be possible. Of course, at this stage the mathematical formulae would
need to be expressed in a syntax understandable for the theorem prover, which
should not be a big deal. The main question is whether a prover would/could
be able to \ ll" the missing logical arguments to justify the hence steps. This
would require a \small" automatic theorem prover device which would have to
search for a justi cation of the conclusion by browsing through the lines before.
To go from the line with label 4 to the line with label 5, a small lemma would
be needed saying that x2 is even implies x is even. It is to expect that such
statements are available in appropriate libraries. Of course, it would be easy to
add a &lt;justification/&gt; tag within the &lt;hence/&gt; tag which could represent
information like \By line x and lemma y:z". Even if these information are not
given explicitly in the mathematical proof (as in the case of our proof above),
one could ask for it, if the xml proof is generated interactively. Thus, for a given
\xml proof" we would expect that it can be translated to (and then veri ed by)
a theorem prover which has an appropriate automatic/interactive search tool for
the mathematical and logical steps still hidden in a &lt;hence/&gt; step.
Our question. Our question is whether it might be possible to go the other
way around: given a proof generated by a theorem prover, could we extract a xml
proof which hides su ciently many information such that this proof is digestible
for a Mathematician? This is an open question. But to discuss it, we like point
out that our xml speci cation should be kept su ciently slim that the logical
particularities of the di erent provers|as their logical framework, their internal
representation of datatypes, their calculus, etc.|are not necessarily directly
expressible. It is our aim to abstract from these particularities, and if we are able
to do so, we might reach the mathematical core of a proof.
4</p>
    </sec>
    <sec id="sec-3">
      <title>Discussion</title>
      <p>We report here on work in progress for an xml speci cation to represent
mathematical proofs. While the technical aspect of this work is still on its very initial
stage, we have already identify a couple of important aspects which we would
like to summarize here:
{ It seems to be useful to separate the structure of the proof from its
mathematical content (somehow as it is done in our xml proof by leaving the
mathematical content in the usual mathematical notation). Also, we do not
aim for a formal logical representation of the argument; to the contrary, the
surface structure of a mathematical proof seems to need rather restricted
logical reasoning.4 This should be re ected in the speci cation.
{ The example of Hardy and Wright's proof suggests that the mathematical
argument is essentially independent of the underlying calculus one could
choose to formalize it.5 Thus, the structural aspects of logical calculi seem
to be inessential from the mathematical point of view. We would like to
put this in a positive way: the mathematical content of a formalized proof is
probably invariant under the change of the calculus; in other words: we could
probably get a good part of the mathematical content of a formalized proof
4 Our example, in fact, seems to use just Modus Ponens steps, after some de nitional
rewriting, and one \contradiction"; of course, this is due to the fact that many
mathematical steps are hidden in lemmata (as the one mentioned: x2 is even implies
x is even). What is clearly missing in our example are instances of case distinction
and induction.
5 This should come, of course, to no surprise; Mathematicians were doing proofs for
millenniums without use any logical calculus in the modern sense.</p>
      <p>by abstracting from the structural aspects fundamental in any formalized
version.
{ The idea to abstract from the mathematical content of a proof was even taken
further by Baaz, Kraj cek, and Pudlak who removed the content
completely, obtaining what they called the skeleton of a proof,6 [KP88,BP93,Baa99].
{ With respect to the missing details in mathematical proofs, about which
Wiedijk complained, it is obvious that mathematician ll them with their
background knowledge. What we expect, might be called intelligent proof
reading.7 And, it doesn't seem to be impossible that the missing information
taken from background knowledge should be recoverable by theorem provers,
at least with some interactive help.
{ There is, of course, a lot of existing work related to our approach. As
examples let us mention the xml-representation of Mizar proof [Urb06]; the OMDoc
initiative (http://www.omdoc.org/) headed by Michael Kohlhase; the
MathLang project of Fairouz Kamareddine and J. B. Wells; and
Ganesalingham's work backed by Gowers.</p>
      <p>In the case of Mizar, of course, the internal representation of Mizar
proofs make part of the xml speci cation, while we, explicitly, want to
abstract from these kind of representation.</p>
      <p>We share the objective of OMDoc to provide a speci cation which makes it
possible to exchange proofs between di erent theorem provers. But while
OMDoc starts from an in-depth analysis of all kinds of mathematical texts,
we restrict ourselves to the analysis of (the structure of) mathematical
proof.</p>
      <p>In this respect, MathLang [KW08] is probably the approach which comes
closest to ours; it has, however, a broader aim, including the linguistic
analysis of mathematical texts. It might be appropriate to characterize
our proposal as a \subtask" which could be found in MathLang, i.e., the
task which uncovers the mathematical structure of a proof.</p>
      <p>Ganesalingham's work [Gan13], also together with Gowers [GG13],
is also concerned with linguistic aspects which are not in our focus; but
it seems to rather mature with respect to the conceptional analysis of the
mathematical concepts used in a proof and is, therefore, highly relevant
for our project.</p>
      <p>Our work will de nitely pro t from all these experiences. But let us note,
that we approach the question of proof representation from a di erent
perspective, which is, in general, more conceptional rather than technical (see
also [Kah1x]).
6 As S.S. Wainer commented [Baaz personal communication]: the skeleton of a proof
is what remains when a proof is dead.
7 This term was coined by Jesse Alama.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [AN00]
          <article-title>Cuihtlauac Alvarado and Quang-Huy Nguyen</article-title>
          .
          <article-title>ELAN for equational reasoning in Coq</article-title>
          . In J. Despeyroux, editor,
          <source>2nd Workshop on Logical Frameworks and Metalanguage - LFM'00</source>
          ,
          <string-name>
            <surname>Santa</surname>
            <given-names>Barbara</given-names>
          </string-name>
          , USA. INRIA,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <source>[Baa99] Matthias Baaz. Note on the generalization of calculations. Theoretical Computer Science</source>
          ,
          <volume>224</volume>
          (
          <issue>1</issue>
          {2):3{
          <fpage>11</fpage>
          ,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [BP93]
          <article-title>Matthias Baaz and Pavel Pudlak. Kreisel's conjecture for l91</article-title>
          . In P. Clote and J. Kraj cek, editors,
          <source>Arithmetic Proof Theory and Computational Complexity</source>
          , pages
          <volume>30</volume>
          {
          <fpage>49</fpage>
          . Oxford University Press,
          <year>1993</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [Gan13]
          <string-name>
            <given-names>Mohan</given-names>
            <surname>Ganesalingam</surname>
          </string-name>
          .
          <source>The Language of Mathematics</source>
          , volume
          <volume>7805</volume>
          of Lecture Notes in Computer Science. Springer,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [GG13]
          <string-name>
            <given-names>M.</given-names>
            <surname>Ganesalingam</surname>
          </string-name>
          and
          <string-name>
            <given-names>W. T.</given-names>
            <surname>Gowers</surname>
          </string-name>
          .
          <article-title>A fully automatic problem solver with human-style output</article-title>
          .
          <source>CoRR, abs/1309.4501</source>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [Har96
          <string-name>
            <given-names>] John</given-names>
            <surname>Harrison</surname>
          </string-name>
          .
          <article-title>A mizar mode for HOL</article-title>
          .
          <source>In Joakim von Wright</source>
          , Jim Grundy, and John Harrison, editors,
          <source>TPHOLs'96</source>
          , volume
          <volume>1125</volume>
          of Lecture Notes in Computer Science, pages
          <volume>203</volume>
          {
          <fpage>220</fpage>
          . Springer,
          <year>1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [HW60]
          <string-name>
            <given-names>G. H.</given-names>
            <surname>Hardy</surname>
          </string-name>
          and
          <string-name>
            <given-names>E. M.</given-names>
            <surname>Wright</surname>
          </string-name>
          . An Introduction to the
          <source>Theory of Numbers. Oxford, 4th edition</source>
          ,
          <year>1960</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [Kah1x]
          <string-name>
            <given-names>Reinhard</given-names>
            <surname>Kahle</surname>
          </string-name>
          .
          <article-title>What is a proof? 201x</article-title>
          . Submitted.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [KP88]
          <article-title>Jan Kraj cek and Pavel Pudlak. The number of proof lines and the size of proofs in rst order logic</article-title>
          .
          <source>Archive for Mathematical Logic</source>
          ,
          <volume>27</volume>
          :
          <fpage>69</fpage>
          {
          <fpage>84</fpage>
          ,
          <year>1988</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [KW08]
          <string-name>
            <given-names>Fairouz</given-names>
            <surname>Kamareddine</surname>
          </string-name>
          and
          <string-name>
            <given-names>J. B.</given-names>
            <surname>Wells</surname>
          </string-name>
          .
          <source>Computerizing Mathematical Text with MathLang. Electronic Notes in Theoretical Computer Science</source>
          ,
          <volume>205</volume>
          :5{
          <fpage>30</fpage>
          ,
          <year>2008</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [Lam95]
          <string-name>
            <given-names>Leslie</given-names>
            <surname>Lamport</surname>
          </string-name>
          .
          <article-title>How to write a proof</article-title>
          .
          <source>American Mathematical Monthly</source>
          ,
          <volume>102</volume>
          (
          <issue>7</issue>
          ):
          <volume>600</volume>
          {
          <fpage>608</fpage>
          ,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [Lam12]
          <string-name>
            <given-names>Leslie</given-names>
            <surname>Lamport</surname>
          </string-name>
          .
          <article-title>How to write a 21st century proof</article-title>
          .
          <source>Journal of Fixed Point Theory and Applications</source>
          ,
          <volume>11</volume>
          :
          <fpage>43</fpage>
          {
          <fpage>63</fpage>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [Sco06]
          <string-name>
            <given-names>Dana</given-names>
            <surname>Scott</surname>
          </string-name>
          . Foreword. In Freek Wiedijk, editor,
          <source>The Seventeen Provers of the World, volume 3600 of Lecture Notes in Computer Science</source>
          , pages vii{xii. Springer,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [Urb06]
          <article-title>Josef Urban. XML-izing Mizar: Making Semantic Processing and Presentation of MML Easy</article-title>
          . In Michael Kohlhase, editor,
          <source>Mathematical Knowledge Management</source>
          , volume
          <volume>3863</volume>
          of Lecture Notes in Computer Science, pages
          <volume>346</volume>
          {
          <fpage>360</fpage>
          . Springer,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [Wie06] Freek Wiedijk, editor.
          <source>The Seventeen Provers of the World, volume 3600 of Lecture Notes in Computer Science</source>
          . Springer,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>