<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://robertylewis.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://robertylewis.com/" rel="alternate" type="text/html" /><updated>2026-02-11T08:06:29-08:00</updated><id>https://robertylewis.com/feed.xml</id><title type="html">Robert Y. Lewis</title><subtitle>personal description</subtitle><author><name>Robert Y. Lewis</name><email>robert_lewis@brown.edu</email></author><entry><title type="html">Formalizing the Ring of Witt Vectors</title><link href="https://robertylewis.com/lean/witt-vectors/" rel="alternate" type="text/html" title="Formalizing the Ring of Witt Vectors" /><published>2020-10-07T02:30:00-07:00</published><updated>2020-10-07T02:30:00-07:00</updated><id>https://robertylewis.com/lean/witt-vectors</id><content type="html" xml:base="https://robertylewis.com/lean/witt-vectors/"><![CDATA[<p>Johan Commelin and I have released a preprint of our new paper,
<a href="http://robertylewis.com/files/witt-vectors.pdf">Formalizing the Ring of Witt Vectors</a>!
(Update, Nov 25: the paper has been accepted at <a href="https://popl21.sigplan.org/home/CPP-2021#event-overview">CPP ‘21</a> and recognized as a Distinguished Paper.)
We describe the construction of the <a href="https://en.wikipedia.org/wiki/Witt_vector">p-typical Witt vectors</a>
and their ring structure in Lean, and show that the ring of Witt vectors over the integers modulo p
is isomorphic to the ring of p-adic integers.</p>

<p>Witt vectors are a notoriously messy topic to cover informally.
The ring structure depends on a layer of definitions binding certain polynomials together.
Without caution, trying to prove things about this ring structure can lead to unfolding
horrible polynomial identities that are both intractable and unenlightening.</p>

<p>Johan and I developed a framework in Lean to vastly simplify these calculations.
The horror is minimized and neatly contained in one or two preliminary proofs;
after that, some simple Lean metaprograms are able to handle these calculations cleanly and uniformly.</p>]]></content><author><name>Robert Y. Lewis</name><email>robert_lewis@brown.edu</email></author><category term="lean" /><summary type="html"><![CDATA[Johan Commelin and I have released a preprint of our new paper, Formalizing the Ring of Witt Vectors! (Update, Nov 25: the paper has been accepted at CPP ‘21 and recognized as a Distinguished Paper.) We describe the construction of the p-typical Witt vectors and their ring structure in Lean, and show that the ring of Witt vectors over the integers modulo p is isomorphic to the ring of p-adic integers.]]></summary></entry><entry><title type="html">Metaprogramming in Lean tutorial</title><link href="https://robertylewis.com/lean/metaprogramming/" rel="alternate" type="text/html" title="Metaprogramming in Lean tutorial" /><published>2020-07-13T02:30:00-07:00</published><updated>2020-07-13T02:30:00-07:00</updated><id>https://robertylewis.com/lean/metaprogramming</id><content type="html" xml:base="https://robertylewis.com/lean/metaprogramming/"><![CDATA[<p>Johan Commelin and Patrick Massot are organizing the workshop 
<a href="https://leanprover-community.github.io/lftcm2020/">Lean for the Curious Mathematician</a>,
taking place virtually July 13-17, 2020.
The workshop aims to give working mathematicians
a hands-on introduction to formal proof.</p>

<p>As part of the “intermediate track” of this workshop,
for users who have some experience with formal proof,
I recorded a <a href="https://www.youtube.com/playlist?list=PLlF-CfQhukNnq2kDCw2P_vI5AfXN7egP2">series of videos</a>
about metaprogramming in Lean:
how do we use the system to introspect on its own syntax
and write and evaluate programs to prove theorems?</p>

<p>Since the workshop is aimed at a novice audience,
I wasn’t expecting a large live audience,
so I prerecorded the videos and put them on YouTube. 
The first two videos in the series are accessible to people 
who have had any introduction to Lean, for instance through the <a href="https://wwwf.imperial.ac.uk/~buzzard/xena/natural_number_game/">Natural Number Game</a>.
The later videos assume some more familiarity with the system 
and with functional programming.</p>

<p>Feedback on these recordings is very welcome!</p>]]></content><author><name>Robert Y. Lewis</name><email>robert_lewis@brown.edu</email></author><category term="lean" /><summary type="html"><![CDATA[Johan Commelin and Patrick Massot are organizing the workshop Lean for the Curious Mathematician, taking place virtually July 13-17, 2020. The workshop aims to give working mathematicians a hands-on introduction to formal proof.]]></summary></entry><entry><title type="html">Logic and Modeling course information</title><link href="https://robertylewis.com/teaching/logic-modeling/" rel="alternate" type="text/html" title="Logic and Modeling course information" /><published>2020-07-05T02:30:00-07:00</published><updated>2020-07-05T02:30:00-07:00</updated><id>https://robertylewis.com/teaching/logic-modeling</id><content type="html" xml:base="https://robertylewis.com/teaching/logic-modeling/"><![CDATA[<p>In Spring 2020, I taught the course Logic and Modeling at the VU.
The course was held entirely online due to the COVID-19 pandemic.</p>

<p>I have collected the course information, lecture recordings, and assignments
<a href="https://robertylewis.com/logic_and_modeling">here</a>.
(While the archive does not contain all the information that was on Canvas,
it contains most of the material fit for public consumption.)</p>

<p>Instructors interested in teaching with the <a href="http://avigad.github.io/logic_and_proof/">Logic and Proof</a> text
may find the recorded lectures of some use!</p>]]></content><author><name>Robert Y. Lewis</name><email>robert_lewis@brown.edu</email></author><category term="teaching" /><summary type="html"><![CDATA[In Spring 2020, I taught the course Logic and Modeling at the VU. The course was held entirely online due to the COVID-19 pandemic.]]></summary></entry><entry><title type="html">The Lean mathematical library</title><link href="https://robertylewis.com/lean/mathlib-paper/" rel="alternate" type="text/html" title="The Lean mathematical library" /><published>2019-10-21T05:30:00-07:00</published><updated>2019-10-21T05:30:00-07:00</updated><id>https://robertylewis.com/lean/mathlib-paper</id><content type="html" xml:base="https://robertylewis.com/lean/mathlib-paper/"><![CDATA[<p>Along with a number of other contributors, I have written <a href="https://leanprover-community.github.io/papers/mathlib-paper.pdf">a paper</a> about the Lean mathematical library. The paper describes a large-scale, open project to which 68 people (and counting) have contributed. Rather than attribute the paper to some subset of this group, we decided to release it as a community effort. (Update, Nov 28: our paper has been accepted at <a href="https://popl20.sigplan.org/home/CPP-2020">CPP</a>!)</p>

<p>A huge amount of work has gone into building <a href="https://github.com/leanprover-community/mathlib">mathlib</a> and it’s great to see it documented. One aspect of the project that we emphasize in the paper is the collaboration between people with different academic backgrounds and interests. Using mathlib is pleasant because it’s designed to support many people doing different things. Mathematics is a heterogeneous field, and many practicing mathematicians (let alone computer scientists) see only a small fragment of it. If our aim is to develop a system, library, and environment to accommodate mathematics, broadly speaking, we need participants from all corners.</p>]]></content><author><name>Robert Y. Lewis</name><email>robert_lewis@brown.edu</email></author><category term="lean" /><summary type="html"><![CDATA[Along with a number of other contributors, I have written a paper about the Lean mathematical library. The paper describes a large-scale, open project to which 68 people (and counting) have contributed. Rather than attribute the paper to some subset of this group, we decided to release it as a community effort. (Update, Nov 28: our paper has been accepted at CPP!)]]></summary></entry><entry><title type="html">Formalizing the solution to the cap set problem</title><link href="https://robertylewis.com/lean/cap-set/" rel="alternate" type="text/html" title="Formalizing the solution to the cap set problem" /><published>2019-06-09T05:30:00-07:00</published><updated>2019-06-09T05:30:00-07:00</updated><id>https://robertylewis.com/lean/cap-set</id><content type="html" xml:base="https://robertylewis.com/lean/cap-set/"><![CDATA[<p><a href="http://www.few.vu.nl/~sdn249/">Sander Dahmen</a>, <a href="https://www.cs.vu.nl/~jhl890/">Johannes Hölzl</a>, and
I have formalized <a href="https://arxiv.org/abs/1605.09223">Ellenberg and Gijswijt’s solution to the cap set
problem</a> in Lean. <a href="https://lean-forward.github.io/e-g/">Our paper about this
project</a> will appear at ITP 2019. <a href="https://robertylewis.com/files/capset_long_slides.pdf">Here are some
slides</a> from a talk I gave about this formalization.</p>

<p>The cap set problem is a combinatorial question, easy to ask but difficult to answer. Briefly, it
asks about the growth rate of the cardinality of <em>cap sets</em>, subsets of a group that contain no
three-term arithmetic progression, as the dimension of the underlying space increases. Ellenberg and
Gijswijt discovered a solution in 2016; their celebrated proof appeared in the <em>Annals of
Mathematics</em> in 2017. The approach that Ellenberg and Gijswijt take is an extremely clever
application of elementary methods, which makes it a good candidate to formalize.</p>

<p>Very little cutting-edge mathematics is formalized in proof assistants. Reasons for this are
well-documented throughout the literature: the costs are too high; the tools and infrastructure are
not ready; the general expertise isn’t there. The <a href="https://lean-forward.github.io">Lean Forward
project</a> aims to change this, by spurring collaboration between tool
developers, formalizers, and mathematicians. Our project is a step toward these goals. Admittedly,
our choice of a formalization target is uniquely accessible. But this gives us a first data point
for Lean Forward: at least one modern, noteworthy paper in mathematics can be formalized with a
reasonable amount of time and effort.</p>

<p>Lean Forward emphasizes that collaboration between people from different areas is needed to bring
formalized mathematics to the mainstream. Our project is an example of exactly this kind of
collaboration. We need mathematicians, computer scientists, engineers, and people in between to come
together to make
<a href="http://www.cse.chalmers.se/research/group/logic/TypesSS05/Extra/wiedijk_2.pdf">lofty</a>,
<a href="https://formalabstracts.github.io/">ambitious</a> formalization projects into reality.</p>]]></content><author><name>Robert Y. Lewis</name><email>robert_lewis@brown.edu</email></author><category term="lean" /><summary type="html"><![CDATA[Sander Dahmen, Johannes Hölzl, and I have formalized Ellenberg and Gijswijt’s solution to the cap set problem in Lean. Our paper about this project will appear at ITP 2019. Here are some slides from a talk I gave about this formalization.]]></summary></entry><entry><title type="html">Lean Together 2019</title><link href="https://robertylewis.com/lean/conference/lean-together/" rel="alternate" type="text/html" title="Lean Together 2019" /><published>2019-01-25T13:05:33-08:00</published><updated>2019-01-25T13:05:33-08:00</updated><id>https://robertylewis.com/lean/conference/lean-together</id><content type="html" xml:base="https://robertylewis.com/lean/conference/lean-together/"><![CDATA[<p>From the 7th to the 11th of January, 2019, we hosted a workshop <a href="https://lean-forward.github.io/lean-together/">Lean
Together</a> in Amsterdam. This workshop was meant to
serve a few purposes. First, it was a meeting for Lean developers and users who have been working
remotely on the system and <a href="https://leanprover-community.github.io/">mathematics libraries</a>. Second,
it was a kickoff party for Jasmin Blanchette’s <a href="https://lean-forward.github.io/">Lean Forward</a> NWO
project. A key part of this project is “mathematical outreach”; we want to put proof assistants in
the hands of mathematicians, and through collaboration with computer scientists, advance the world
of formal mathematics.</p>

<p>The workshop was an incredible success on both fronts. When we started planning in July, we expected
to have around 30 participants; we ended up with 68 people registered. Amazingly, 29 self-identified
their primary discipline as mathematics, and 29 as computer science. (Nine chose the
“multidisciplinary” option and one wrote in “logic.”) It was great to meet more of the Lean crowd in
person, and equally great to see the crowd eager novice formalizers.</p>

<p>We’re still feeling the momentum from this meeting and we hope to keep things rolling. Watch out for
an announcement about Lean Together 2020: this time, it’s in Pittsburgh.</p>]]></content><author><name>Robert Y. Lewis</name><email>robert_lewis@brown.edu</email></author><category term="lean" /><category term="conference" /><summary type="html"><![CDATA[From the 7th to the 11th of January, 2019, we hosted a workshop Lean Together in Amsterdam. This workshop was meant to serve a few purposes. First, it was a meeting for Lean developers and users who have been working remotely on the system and mathematics libraries. Second, it was a kickoff party for Jasmin Blanchette’s Lean Forward NWO project. A key part of this project is “mathematical outreach”; we want to put proof assistants in the hands of mathematicians, and through collaboration with computer scientists, advance the world of formal mathematics.]]></summary></entry><entry><title type="html">A formal proof of Hensel’s lemma over the p-adic integers</title><link href="https://robertylewis.com/padics/index.html" rel="alternate" type="text/html" title="A formal proof of Hensel’s lemma over the p-adic integers" /><published>2018-10-18T02:00:00-07:00</published><updated>2018-10-18T02:00:00-07:00</updated><id>https://robertylewis.com/padics/hensels-lemma</id><content type="html" xml:base="https://robertylewis.com/padics/index.html"><![CDATA[<p>Here you will find the supplementary materials to <a href="padics.pdf">my paper</a> <em>A formal proof of Hensel’s
lemma over the p-adic integers</em>. This paper was published at CPP 2019. For more information, contact
<a href="mailto:r.y.lewis@vu.nl">Robert Y. Lewis</a>.</p>

<h3 id="the-formal-development">The Formal Development</h3>

<p>The project described in the linked paper has been incorporated into the Lean
<a href="https://github.com/leanprover/mathlib/">mathlib</a> repository. The current state of the p-adic number
development can be found in the directory
<a href="https://github.com/leanprover/mathlib/tree/master/src/data/padics">/data/padics/</a>. See also the pull
requests <a href="https://github.com/leanprover/mathlib/pull/337">here</a> and
<a href="https://github.com/leanprover/mathlib/pull/262">here</a>.</p>

<p>Since mathlib is regularly updated, we preserve a branch
<a href="https://github.com/robertylewis/mathlib/tree/padics_paper">here</a> that shows its state when this
paper was written.</p>]]></content><author><name>Robert Y. Lewis</name><email>robert_lewis@brown.edu</email></author><category term="paper" /><summary type="html"><![CDATA[Here you will find the supplementary materials to my paper A formal proof of Hensel’s lemma over the p-adic integers. This paper was published at CPP 2019. For more information, contact Robert Y. Lewis. The Formal Development The project described in the linked paper has been incorporated into the Lean mathlib repository. The current state of the p-adic number development can be found in the directory /data/padics/. See also the pull requests here and here. Since mathlib is regularly updated, we preserve a branch here that shows its state when this paper was written.]]></summary></entry><entry><title type="html">A bi-directional extensible interface between Lean and Mathematica</title><link href="https://robertylewis.com/leanmm/index.html" rel="alternate" type="text/html" title="A bi-directional extensible interface between Lean and Mathematica" /><published>2018-02-06T01:00:00-08:00</published><updated>2018-02-06T01:00:00-08:00</updated><id>https://robertylewis.com/leanmm/mathematica</id><content type="html" xml:base="https://robertylewis.com/leanmm/index.html"><![CDATA[<p>Minchao Wu and I have been working on a project that connects the computer algebra system
Mathematica to the Lean theorem prover. Here you will find the supplementary materials corresponding
to <a href="lean_mm.pdf">our paper draft</a>.</p>

<p>An <a href="https://arxiv.org/abs/1712.09288">early version of this work</a> was presented at PxTP.
For more information, contact <a href="https://robertylewis.com">Robert Y.
Lewis</a> and <a href="mailto:logic.mcwu@gmail.com">Minchao Wu</a>.</p>

<h2 id="versioning">Versioning</h2>

<p>These tools and examples are compatible with various versions of Lean.
In any of the GitHub repositories, look for the <code class="language-plaintext highlighter-rouge">lean-x.y.z</code> branch
for a version of the project compatible with Lean x.y.z.
The core tool will automatically be updated to new versions of Lean
as long as compatibility is maintained.
Unfortunately this automatic upgrading is not possible for the example repositories
due to licensing issues,
but we will do it manually;
please contact the authors if you need a fresh update on short notice,
or try running <code class="language-plaintext highlighter-rouge">leanproject up</code> yourself.</p>

<p>The link is known to work with Mathematica versions 11 and 12,
and perhaps with earlier versions.</p>

<p>The <code class="language-plaintext highlighter-rouge">lean-3.17.1</code> branches, and any below, are frozen as of August 19, 2020.
All claims in our paper draft have been tested to be true of this version,
and we have not intentionally falsified any in later versions.</p>

<h2 id="installing-the-link">Installing the link</h2>

<p>The link requires you to have Python installed with <code class="language-plaintext highlighter-rouge">python3</code> in the system path.</p>

<p>We strongly recommend installing Lean with the <code class="language-plaintext highlighter-rouge">elan</code> version manager
and <code class="language-plaintext highlighter-rouge">leanproject</code> supporting tool,
following <a href="https://leanprover-community.github.io/get_started.html#regular-install">the “regular install” instructions</a>.</p>

<p>The core tool for using Mathematica from Lean is available on
<a href="https://github.com/rlewis1988/mathematica">GitHub</a>. This project can be added as a dependency to
any Lean project using the <code class="language-plaintext highlighter-rouge">leanpkg</code> package manager.
Note that, if you install the project as a dependency using <code class="language-plaintext highlighter-rouge">leanpkg</code>,
you do not need to download it separately.
It will be downloaded automatically to the <code class="language-plaintext highlighter-rouge">_target/deps/mathematica</code> directory of your project.</p>

<p>To use the link in this direction, you must start the Mathematica server. Do this either by</p>

<ul>
  <li>running <code class="language-plaintext highlighter-rouge">math --noprompt -run '&lt;&lt;"server2.m"</code>
in the <code class="language-plaintext highlighter-rouge">_target/deps/mathematica/src</code> directory of your project, or</li>
  <li>opening the Mathematica frontend and evaluating <code class="language-plaintext highlighter-rouge">&lt;&lt;"/path/to/_target/deps/mathematica/src/server2.m"</code>
(with the correct path).</li>
</ul>

<p>The code for using Lean from Mathematica is also available on
<a href="https://github.com/minchaowu/mm_lean">GitHub</a>. This project uses the above as a dependency.
See directions below for using it.</p>

<h2 id="examples-of-calling-mathematica-from-lean">Examples of calling Mathematica from Lean</h2>

<p>A project containing examples of the Mathematica-from-Lean link in action is available
<a href="https://github.com/rlewis1988/mathematica_examples">here</a>.</p>

<p>The easiest way to try this out is to download the project using <code class="language-plaintext highlighter-rouge">leanproject</code>:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>leanproject get robertylewis/mathematica_examples
cd mathematica_examples/_target/deps/mathematica/src
math --noprompt -run '&lt;&lt;"server2.m"'
</code></pre></div></div>

<p>This will download the core link, the examples,
Lean’s mathematical library mathlib (on which the examples depend),
and precompiled binaries for mathlib.
If you use an alternate installation method, you may have to compile mathlib yourself,
which can take a long time.</p>

<p>You can then see the link in action in any file in <code class="language-plaintext highlighter-rouge">mathematica_examples/src</code>.
<strong>Note</strong>: if you use the VSCode editor,
you must use the “Open Folder” feature to open the <code class="language-plaintext highlighter-rouge">mathematica_examples</code> directory.
Opening individual files will not work.
An easy way to do this from the command line,
starting in the same directory you started in above, is</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>code mathematica_examples
</code></pre></div></div>

<h2 id="examples-of-calling-lean-from-mathematica">Examples of calling Lean from Mathematica</h2>

<p>These examples and the code to make them work are on <a href="https://github.com/minchaowu/mm_lean">GitHub</a>.</p>

<p>As above, it is easiest to install using <code class="language-plaintext highlighter-rouge">leanproject</code>:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>leanproject get minchaowu/mm_lean
</code></pre></div></div>

<p>The file <code class="language-plaintext highlighter-rouge">LeanProof.nb</code> in the <code class="language-plaintext highlighter-rouge">mm_lean</code> directory contains examples of the
Lean-from-Mathematica link.
You will need to evaluate the first few configuration lines
to start a Lean server;
after that, the examples below can be tried in any order.</p>

<h2 id="possible-issues">Possible issues</h2>

<p>The Mathematica-from-Lean link expects a <code class="language-plaintext highlighter-rouge">python3</code> executable in the path. Create an alias if you do
not have this.</p>

<p>The link communicates over port 10000. If this is taken, change the port numbers in <code class="language-plaintext highlighter-rouge">client2.py</code> and
<code class="language-plaintext highlighter-rouge">server2.m</code>.</p>

<p>There are known issues with Mathematica’s socket server functionality on certain versions of Linux.
This may cause the server to use excess CPU.</p>

<h2 id="additional-information">Additional information</h2>
<p>The full, unabbreviated form of the expression <code class="language-plaintext highlighter-rouge">x^2-2*x+1</code> in Lean is</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>app (app (app (app (const (name.mk_string add (name.anonymous)) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_has_add (name.mk_string distrib (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_distrib (name.mk_string ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_ring (name.mk_string division_ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_division_ring (name.mk_string field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_field (name.mk_string linear_ordered_field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (const (name.mk_string h (name.anonymous)) (level_list.nil)))))))) (app (app (app (app (const (name.mk_string sub (name.anonymous)) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string add_group_has_sub (name.anonymous)) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_add_group (name.mk_string add_comm_group (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_add_comm_group (name.mk_string ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_ring (name.mk_string division_ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_division_ring (name.mk_string field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_field (name.mk_string linear_ordered_field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (const (name.mk_string h (name.anonymous)) (level_list.nil))))))))) (app (app (app (app (const (name.mk_string mul (name.anonymous)) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_has_mul (name.mk_string mul_zero_class (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_mul_zero_class (name.mk_string semiring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_semiring (name.mk_string ordered_semiring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_ordered_semiring (name.mk_string ordered_ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_ordered_ring (name.mk_string linear_ordered_ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_linear_ordered_ring (name.mk_string linear_ordered_field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (const (name.mk_string h (name.anonymous)) (level_list.nil))))))))) (local_const (name.mk_numeral 1 (name.mk_numeral 18 (name.anonymous))) (name.mk_string x (name.anonymous)) (binder_info.default) (const (name.mk_string real (name.anonymous)) (level_list.nil)))) (local_const (name.mk_numeral 1 (name.mk_numeral 18 (name.anonymous))) (name.mk_string x (name.anonymous)) (binder_info.default) (const (name.mk_string real (name.anonymous)) (level_list.nil))))) (app (app (app (app (const (name.mk_string mul (name.anonymous)) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_has_mul (name.mk_string mul_zero_class (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_mul_zero_class (name.mk_string semiring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_semiring (name.mk_string ordered_semiring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_ordered_semiring (name.mk_string ordered_ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_ordered_ring (name.mk_string linear_ordered_ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_linear_ordered_ring (name.mk_string linear_ordered_field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (const (name.mk_string h (name.anonymous)) (level_list.nil))))))))) (app (app (app (const (name.mk_string bit0 (name.anonymous)) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_has_add (name.mk_string distrib (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_distrib (name.mk_string ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_ring (name.mk_string division_ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_division_ring (name.mk_string field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_field (name.mk_string linear_ordered_field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (const (name.mk_string h (name.anonymous)) (level_list.nil)))))))) (app (app (const (name.mk_string one (name.anonymous)) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_has_one (name.mk_string zero_ne_one_class (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_zero_ne_one_class (name.mk_string division_ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_division_ring (name.mk_string field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_field (name.mk_string linear_ordered_field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (const (name.mk_string h (name.anonymous)) (level_list.nil))))))))) (local_const (name.mk_numeral 1 (name.mk_numeral 18 (name.anonymous))) (name.mk_string x (name.anonymous)) (binder_info.default) (const (name.mk_string real (name.anonymous)) (level_list.nil)))))) (app (app (const (name.mk_string one (name.anonymous)) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_has_one (name.mk_string zero_ne_one_class (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_zero_ne_one_class (name.mk_string division_ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_division_ring (name.mk_string field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_field (name.mk_string linear_ordered_field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (const (name.mk_string h (name.anonymous)) (level_list.nil)))))))
</code></pre></div></div>

<p>The Mathematica version of this same expression is:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>"LeanApp[LeanApp[LeanApp[LeanApp[LeanConst[LeanNameMkString["add", LeanNameAnonymous], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_has_add", LeanNameMkString["distrib", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_distrib", LeanNameMkString["ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_ring", LeanNameMkString["division_ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_division_ring", LeanNameMkString["field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_field", LeanNameMkString["linear_ordered_field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanConst[LeanNameMkString["h", LeanNameAnonymous], LeanLevelListNil]]]]]]], LeanApp[LeanApp[LeanApp[LeanApp[LeanConst[LeanNameMkString["sub", LeanNameAnonymous], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["add_group_has_sub", LeanNameAnonymous], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_add_group", LeanNameMkString["add_comm_group", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_add_comm_group", LeanNameMkString["ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_ring", LeanNameMkString["division_ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_division_ring", LeanNameMkString["field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_field", LeanNameMkString["linear_ordered_field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanConst[LeanNameMkString["h", LeanNameAnonymous], LeanLevelListNil]]]]]]]], LeanApp[LeanApp[LeanApp[LeanApp[LeanConst[LeanNameMkString["mul", LeanNameAnonymous], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_has_mul", LeanNameMkString["mul_zero_class", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_mul_zero_class", LeanNameMkString["semiring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_semiring", LeanNameMkString["ordered_semiring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_ordered_semiring", LeanNameMkString["ordered_ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_ordered_ring", LeanNameMkString["linear_ordered_ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_linear_ordered_ring", LeanNameMkString["linear_ordered_field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanConst[LeanNameMkString["h", LeanNameAnonymous], LeanLevelListNil]]]]]]]], LeanLocal[LeanNameMkNum[1843, LeanNameMkNum[17, LeanNameAnonymous]], LeanNameMkString["x", LeanNameAnonymous], BinderInfoDefault, LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]]], LeanLocal[LeanNameMkNum[1843, LeanNameMkNum[17, LeanNameAnonymous]], LeanNameMkString["x", LeanNameAnonymous], BinderInfoDefault, LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]]]], LeanApp[LeanApp[LeanApp[LeanApp[LeanConst[LeanNameMkString["mul", LeanNameAnonymous], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_has_mul", LeanNameMkString["mul_zero_class", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_mul_zero_class", LeanNameMkString["semiring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_semiring", LeanNameMkString["ordered_semiring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_ordered_semiring", LeanNameMkString["ordered_ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_ordered_ring", LeanNameMkString["linear_ordered_ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_linear_ordered_ring", LeanNameMkString["linear_ordered_field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanConst[LeanNameMkString["h", LeanNameAnonymous], LeanLevelListNil]]]]]]]], LeanApp[LeanApp[LeanApp[LeanConst[LeanNameMkString["bit0", LeanNameAnonymous], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_has_add", LeanNameMkString["distrib", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_distrib", LeanNameMkString["ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_ring", LeanNameMkString["division_ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_division_ring", LeanNameMkString["field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_field", LeanNameMkString["linear_ordered_field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanConst[LeanNameMkString["h", LeanNameAnonymous], LeanLevelListNil]]]]]]], LeanApp[LeanApp[LeanConst[LeanNameMkString["one", LeanNameAnonymous], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_has_one", LeanNameMkString["zero_ne_one_class", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_zero_ne_one_class", LeanNameMkString["division_ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_division_ring", LeanNameMkString["field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_field", LeanNameMkString["linear_ordered_field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanConst[LeanNameMkString["h", LeanNameAnonymous], LeanLevelListNil]]]]]]]], LeanLocal[LeanNameMkNum[1843, LeanNameMkNum[17, LeanNameAnonymous]], LeanNameMkString["x", LeanNameAnonymous], BinderInfoDefault, LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]]]]], LeanApp[LeanApp[LeanConst[LeanNameMkString["one", LeanNameAnonymous], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_has_one", LeanNameMkString["zero_ne_one_class", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_zero_ne_one_class", LeanNameMkString["division_ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_division_ring", LeanNameMkString["field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_field", LeanNameMkString["linear_ordered_field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanConst[LeanNameMkString["h", LeanNameAnonymous], LeanLevelListNil]]]]]]]
</code></pre></div></div>]]></content><author><name>Robert Y. Lewis</name><email>robert_lewis@brown.edu</email></author><category term="paper" /><summary type="html"><![CDATA[Minchao Wu and I have been working on a project that connects the computer algebra system Mathematica to the Lean theorem prover. Here you will find the supplementary materials corresponding to our paper draft. An early version of this work was presented at PxTP. For more information, contact Robert Y. Lewis and Minchao Wu. Versioning These tools and examples are compatible with various versions of Lean. In any of the GitHub repositories, look for the lean-x.y.z branch for a version of the project compatible with Lean x.y.z. The core tool will automatically be updated to new versions of Lean as long as compatibility is maintained. Unfortunately this automatic upgrading is not possible for the example repositories due to licensing issues, but we will do it manually; please contact the authors if you need a fresh update on short notice, or try running leanproject up yourself. The link is known to work with Mathematica versions 11 and 12, and perhaps with earlier versions. The lean-3.17.1 branches, and any below, are frozen as of August 19, 2020. All claims in our paper draft have been tested to be true of this version, and we have not intentionally falsified any in later versions. Installing the link The link requires you to have Python installed with python3 in the system path. We strongly recommend installing Lean with the elan version manager and leanproject supporting tool, following the “regular install” instructions. The core tool for using Mathematica from Lean is available on GitHub. This project can be added as a dependency to any Lean project using the leanpkg package manager. Note that, if you install the project as a dependency using leanpkg, you do not need to download it separately. It will be downloaded automatically to the _target/deps/mathematica directory of your project. To use the link in this direction, you must start the Mathematica server. Do this either by running math --noprompt -run '&lt;&lt;"server2.m" in the _target/deps/mathematica/src directory of your project, or opening the Mathematica frontend and evaluating &lt;&lt;"/path/to/_target/deps/mathematica/src/server2.m" (with the correct path). The code for using Lean from Mathematica is also available on GitHub. This project uses the above as a dependency. See directions below for using it. Examples of calling Mathematica from Lean A project containing examples of the Mathematica-from-Lean link in action is available here. The easiest way to try this out is to download the project using leanproject: leanproject get robertylewis/mathematica_examples cd mathematica_examples/_target/deps/mathematica/src math --noprompt -run '&lt;&lt;"server2.m"' This will download the core link, the examples, Lean’s mathematical library mathlib (on which the examples depend), and precompiled binaries for mathlib. If you use an alternate installation method, you may have to compile mathlib yourself, which can take a long time. You can then see the link in action in any file in mathematica_examples/src. Note: if you use the VSCode editor, you must use the “Open Folder” feature to open the mathematica_examples directory. Opening individual files will not work. An easy way to do this from the command line, starting in the same directory you started in above, is code mathematica_examples Examples of calling Lean from Mathematica These examples and the code to make them work are on GitHub. As above, it is easiest to install using leanproject: leanproject get minchaowu/mm_lean The file LeanProof.nb in the mm_lean directory contains examples of the Lean-from-Mathematica link. You will need to evaluate the first few configuration lines to start a Lean server; after that, the examples below can be tried in any order. Possible issues The Mathematica-from-Lean link expects a python3 executable in the path. Create an alias if you do not have this. The link communicates over port 10000. If this is taken, change the port numbers in client2.py and server2.m. There are known issues with Mathematica’s socket server functionality on certain versions of Linux. This may cause the server to use excess CPU. Additional information The full, unabbreviated form of the expression x^2-2*x+1 in Lean is app (app (app (app (const (name.mk_string add (name.anonymous)) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_has_add (name.mk_string distrib (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_distrib (name.mk_string ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_ring (name.mk_string division_ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_division_ring (name.mk_string field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_field (name.mk_string linear_ordered_field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (const (name.mk_string h (name.anonymous)) (level_list.nil)))))))) (app (app (app (app (const (name.mk_string sub (name.anonymous)) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string add_group_has_sub (name.anonymous)) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_add_group (name.mk_string add_comm_group (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_add_comm_group (name.mk_string ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_ring (name.mk_string division_ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_division_ring (name.mk_string field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_field (name.mk_string linear_ordered_field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (const (name.mk_string h (name.anonymous)) (level_list.nil))))))))) (app (app (app (app (const (name.mk_string mul (name.anonymous)) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_has_mul (name.mk_string mul_zero_class (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_mul_zero_class (name.mk_string semiring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_semiring (name.mk_string ordered_semiring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_ordered_semiring (name.mk_string ordered_ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_ordered_ring (name.mk_string linear_ordered_ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_linear_ordered_ring (name.mk_string linear_ordered_field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (const (name.mk_string h (name.anonymous)) (level_list.nil))))))))) (local_const (name.mk_numeral 1 (name.mk_numeral 18 (name.anonymous))) (name.mk_string x (name.anonymous)) (binder_info.default) (const (name.mk_string real (name.anonymous)) (level_list.nil)))) (local_const (name.mk_numeral 1 (name.mk_numeral 18 (name.anonymous))) (name.mk_string x (name.anonymous)) (binder_info.default) (const (name.mk_string real (name.anonymous)) (level_list.nil))))) (app (app (app (app (const (name.mk_string mul (name.anonymous)) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_has_mul (name.mk_string mul_zero_class (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_mul_zero_class (name.mk_string semiring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_semiring (name.mk_string ordered_semiring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_ordered_semiring (name.mk_string ordered_ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_ordered_ring (name.mk_string linear_ordered_ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_linear_ordered_ring (name.mk_string linear_ordered_field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (const (name.mk_string h (name.anonymous)) (level_list.nil))))))))) (app (app (app (const (name.mk_string bit0 (name.anonymous)) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_has_add (name.mk_string distrib (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_distrib (name.mk_string ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_ring (name.mk_string division_ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_division_ring (name.mk_string field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_field (name.mk_string linear_ordered_field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (const (name.mk_string h (name.anonymous)) (level_list.nil)))))))) (app (app (const (name.mk_string one (name.anonymous)) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_has_one (name.mk_string zero_ne_one_class (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_zero_ne_one_class (name.mk_string division_ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_division_ring (name.mk_string field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_field (name.mk_string linear_ordered_field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (const (name.mk_string h (name.anonymous)) (level_list.nil))))))))) (local_const (name.mk_numeral 1 (name.mk_numeral 18 (name.anonymous))) (name.mk_string x (name.anonymous)) (binder_info.default) (const (name.mk_string real (name.anonymous)) (level_list.nil)))))) (app (app (const (name.mk_string one (name.anonymous)) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_has_one (name.mk_string zero_ne_one_class (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_zero_ne_one_class (name.mk_string division_ring (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_division_ring (name.mk_string field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (app (app (const (name.mk_string to_field (name.mk_string linear_ordered_field (name.anonymous))) (level_list.cons (level.zero) (level_list.nil))) (const (name.mk_string real (name.anonymous)) (level_list.nil))) (const (name.mk_string h (name.anonymous)) (level_list.nil))))))) The Mathematica version of this same expression is: "LeanApp[LeanApp[LeanApp[LeanApp[LeanConst[LeanNameMkString["add", LeanNameAnonymous], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_has_add", LeanNameMkString["distrib", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_distrib", LeanNameMkString["ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_ring", LeanNameMkString["division_ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_division_ring", LeanNameMkString["field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_field", LeanNameMkString["linear_ordered_field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanConst[LeanNameMkString["h", LeanNameAnonymous], LeanLevelListNil]]]]]]], LeanApp[LeanApp[LeanApp[LeanApp[LeanConst[LeanNameMkString["sub", LeanNameAnonymous], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["add_group_has_sub", LeanNameAnonymous], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_add_group", LeanNameMkString["add_comm_group", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_add_comm_group", LeanNameMkString["ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_ring", LeanNameMkString["division_ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_division_ring", LeanNameMkString["field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_field", LeanNameMkString["linear_ordered_field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanConst[LeanNameMkString["h", LeanNameAnonymous], LeanLevelListNil]]]]]]]], LeanApp[LeanApp[LeanApp[LeanApp[LeanConst[LeanNameMkString["mul", LeanNameAnonymous], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_has_mul", LeanNameMkString["mul_zero_class", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_mul_zero_class", LeanNameMkString["semiring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_semiring", LeanNameMkString["ordered_semiring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_ordered_semiring", LeanNameMkString["ordered_ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_ordered_ring", LeanNameMkString["linear_ordered_ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_linear_ordered_ring", LeanNameMkString["linear_ordered_field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanConst[LeanNameMkString["h", LeanNameAnonymous], LeanLevelListNil]]]]]]]], LeanLocal[LeanNameMkNum[1843, LeanNameMkNum[17, LeanNameAnonymous]], LeanNameMkString["x", LeanNameAnonymous], BinderInfoDefault, LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]]], LeanLocal[LeanNameMkNum[1843, LeanNameMkNum[17, LeanNameAnonymous]], LeanNameMkString["x", LeanNameAnonymous], BinderInfoDefault, LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]]]], LeanApp[LeanApp[LeanApp[LeanApp[LeanConst[LeanNameMkString["mul", LeanNameAnonymous], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_has_mul", LeanNameMkString["mul_zero_class", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_mul_zero_class", LeanNameMkString["semiring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_semiring", LeanNameMkString["ordered_semiring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_ordered_semiring", LeanNameMkString["ordered_ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_ordered_ring", LeanNameMkString["linear_ordered_ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_linear_ordered_ring", LeanNameMkString["linear_ordered_field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanConst[LeanNameMkString["h", LeanNameAnonymous], LeanLevelListNil]]]]]]]], LeanApp[LeanApp[LeanApp[LeanConst[LeanNameMkString["bit0", LeanNameAnonymous], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_has_add", LeanNameMkString["distrib", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_distrib", LeanNameMkString["ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_ring", LeanNameMkString["division_ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_division_ring", LeanNameMkString["field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_field", LeanNameMkString["linear_ordered_field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanConst[LeanNameMkString["h", LeanNameAnonymous], LeanLevelListNil]]]]]]], LeanApp[LeanApp[LeanConst[LeanNameMkString["one", LeanNameAnonymous], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_has_one", LeanNameMkString["zero_ne_one_class", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_zero_ne_one_class", LeanNameMkString["division_ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_division_ring", LeanNameMkString["field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_field", LeanNameMkString["linear_ordered_field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanConst[LeanNameMkString["h", LeanNameAnonymous], LeanLevelListNil]]]]]]]], LeanLocal[LeanNameMkNum[1843, LeanNameMkNum[17, LeanNameAnonymous]], LeanNameMkString["x", LeanNameAnonymous], BinderInfoDefault, LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]]]]], LeanApp[LeanApp[LeanConst[LeanNameMkString["one", LeanNameAnonymous], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_has_one", LeanNameMkString["zero_ne_one_class", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_zero_ne_one_class", LeanNameMkString["division_ring", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_division_ring", LeanNameMkString["field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanApp[LeanApp[LeanConst[LeanNameMkString["to_field", LeanNameMkString["linear_ordered_field", LeanNameAnonymous]], LeanLevelListCons[LeanZeroLevel, LeanLevelListNil]], LeanConst[LeanNameMkString["real", LeanNameAnonymous], LeanLevelListNil]], LeanConst[LeanNameMkString["h", LeanNameAnonymous], LeanLevelListNil]]]]]]]]]></summary></entry><entry><title type="html">The Nature of Mathematical Reasoning</title><link href="https://robertylewis.com/teaching/nomr/" rel="alternate" type="text/html" title="The Nature of Mathematical Reasoning" /><published>2015-05-30T02:00:00-07:00</published><updated>2015-05-30T02:00:00-07:00</updated><id>https://robertylewis.com/teaching/nomr</id><content type="html" xml:base="https://robertylewis.com/teaching/nomr/"><![CDATA[<p>In 2015 I tought a course at Carnegie Mellon titled <em>The Nature of Mathematical Reasoning.</em> This
course, aimed at non-mathematicians, took a philosophical look at the historical and modern practice
of mathematics. The course materials can be found <a href="https://robertylewis.com/80110">here</a>.</p>

<p>I haven’t transferred the course materials to my new website design yet. This page is to preserve a
link from the main site to the materials.</p>]]></content><author><name>Robert Y. Lewis</name><email>robert_lewis@brown.edu</email></author><category term="teaching" /><summary type="html"><![CDATA[In 2015 I tought a course at Carnegie Mellon titled The Nature of Mathematical Reasoning. This course, aimed at non-mathematicians, took a philosophical look at the historical and modern practice of mathematics. The course materials can be found here. I haven’t transferred the course materials to my new website design yet. This page is to preserve a link from the main site to the materials.]]></summary></entry></feed>