<!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>Automating Formalization of Mathematics with Machine Learning and Data Mining: A PhD Progress Report</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Qingxiang</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Czech Technical University in Prague</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>University of Innsbruck</institution>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2019</year>
      </pub-date>
      <abstract>
        <p>The progress in foundations of mathematics since the turn of the 20th century has enabled the creation of a precise and unified formal language for mathematics to be based on. Although never written down in full, it is a consensus among mathematicians that ultimate certitude of their mathematics can be achieved by using the language of set theory or any alternatives. It is a vision set out by the QED Manifesto [1] that all the existing mathematics can be formalized and their proofs formally verified. Since 1960s various interactive proof assistants have been developed. Each has its own formal library covering a portion of mathematics. Because of difference in mathematical foundations and idiosyncratic design features, those libraries are not compatible with each other. As a result the formalization community has been segregated into different groups based on proof assistant. Meanwhile, formalization is still a task that requires considerable amount of intellectual effort: to be a qualified formalizer, one needs to be an expert in the proof assistant being used, its underlying mathematical foundations as well as the mathematical theorems being formalized. This makes the mainstream mathematics community shunning formalization of mathematics. As mathematics has become unmanageably vast, it is now a pressing issue for the speed of formalization of mathematics to catch up with the speed of mathematics development. However, due to the reasons above formalization of mathematics is still largely done manually, requiring dedicated skill sets and without the participation of the mainstream mathematics community. To realize the dream of the QED Manifesto, it is inevitable that some form of automation should be involved in the process of formalization. In recent years deep learning has gained a lot of attention in both industry and academia. With large highquality datasets, deep learning models are able to generate translators that show competitive results comparing to human translators. As formalization can be considered as a process of translating from one language (the informal natural language used in mathematics) to another (the formal language used by a proof assistant), it is tempting to think that machine learning could be useful to automate formalization of mathematics. It is under this line of thought that the author started this 4-year PhD program 18 months ago. Till now we have conducted several experiments along this direction: 1. Supervised neural machine translation on synthetic LaTeX-Mizar dataset. Using Luong et al's sequence-tosequence model [2] we were able to quickly test out its efficacy on translating from informal LaTeX sentences to formal sentences. To cope with the lack of aligned dataset, we adopted a deterministic back-translation tool [3] to generate readable LaTeX sentences from corresponding Mizar sentences. We have thoroughly experimented with different network parameters. The results have been published in last year's CICM [4].</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Copyright © by the paper’s authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
the training data we provide contains aligned Mizar-TPTP sentence pairs. A type-checking utility 1 takes
the translated TPTP sentences and conducts an “elaboration" process which tries to fill in the missing
Mizar type information. A completely elaborated TPTP sentence can be translated deterministically back
to Mizar sentence. We divide our training phase into iterations. Each iteration generates multiple TPTP
translations from each of Mizar sentences. The elaborated and back-translated new sentence pairs will be
added to the training dataset for the next iteration. In this experiment we found that translation quality
can be improved in initial three iterations, but performance stabilizes in later iterations.</p>
      <p>In summary, the first supervised learning experiment is by far the most successful experiments we have
conducted. It proves that given sufficient amount of informal-formal sentence pairs as training data, a neural
network is able to generate nearly accurate formal translations from informal natural language statements,
thereby having the potential to speed up the process of formalization. The unsupervised model also shows
promising results, though further experiments and customizations need to be done to evaluate its overall potential.
The initial gains of data augmentation using type-checking is noticeable and there is also potential to incorporate
this mechanism into the LaTeX to Mizar translation. In addition to those we have collected abundant informal
mathematics statements from ArXiv and will seek further ways to eventually bootstrap a formalizer that has
the potential to extract a significant amount of logical information out of informal mathematical literature.</p>
      <p>Future works will be focused on the following directions:
1. Apply natural language processing on the ArXiv corpus to iteratively normalize the informal mathematics
data. Use techniques from descriptive and inferential statistics to extract inherit logic information from
syntactically parsed natural language sentences.</p>
      <p>2. Further explore the unsupervised model and enrich the informal corpus with the ArXiv data.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <article-title>[1] The qed manifesto</article-title>
          .
          <source>In Proceedings of the 12th International Conference on Automated Deduction, CADE-12</source>
          , pages
          <fpage>238</fpage>
          -
          <lpage>251</lpage>
          , London, UK, UK,
          <year>1994</year>
          . Springer-Verlag.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Minh-Thang</surname>
            <given-names>Luong</given-names>
          </string-name>
          , Eugene Brevdo, and
          <string-name>
            <surname>Rui Zhao.</surname>
          </string-name>
          <article-title>Neural machine translation (seq2seq) tutorial</article-title>
          . https://github.com/tensorflow/nmt,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Grzegorz</given-names>
            <surname>Bancerek</surname>
          </string-name>
          .
          <article-title>Automatic translation in formalized mathematics</article-title>
          .
          <source>Mechanized Mathematics and Its Applications</source>
          ,
          <volume>5</volume>
          (
          <issue>2</issue>
          ):
          <fpage>19</fpage>
          -
          <lpage>31</lpage>
          ,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Qingxiang</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <surname>Cezary Kaliszyk</surname>
            , and
            <given-names>Josef</given-names>
          </string-name>
          <string-name>
            <surname>Urban</surname>
          </string-name>
          .
          <article-title>First experiments with neural translation of informal to formal mathematics</article-title>
          . In Florian Rabe, William M. Farmer,
          <string-name>
            <surname>Grant O. Passmore</surname>
          </string-name>
          , and Abdou Youssef, editors,
          <source>11th International Conference on Intelligent Computer Mathematics (CICM</source>
          <year>2018</year>
          ), volume
          <volume>11006</volume>
          <source>of LNCS</source>
          , pages
          <fpage>255</fpage>
          -
          <lpage>270</lpage>
          . Springer,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Guillaume</given-names>
            <surname>Lample</surname>
          </string-name>
          , Myle Ott, Alexis Conneau, Ludovic Denoyer, and
          <string-name>
            <surname>Marc'Aurelio Ranzato</surname>
          </string-name>
          .
          <article-title>Phrase-based &amp; neural unsupervised machine translation</article-title>
          .
          <source>In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing (EMNLP)</source>
          ,
          <year>2018</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>