<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://invarians.org/index.php?action=history&amp;feed=atom&amp;title=Lean_theorem_prover%2FFoundations%2FThe_three_axioms</id>
	<title>Lean theorem prover/Foundations/The three axioms - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://invarians.org/index.php?action=history&amp;feed=atom&amp;title=Lean_theorem_prover%2FFoundations%2FThe_three_axioms"/>
	<link rel="alternate" type="text/html" href="https://invarians.org/index.php?title=Lean_theorem_prover/Foundations/The_three_axioms&amp;action=history"/>
	<updated>2026-10-21T07:33:53Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://invarians.org/index.php?title=Lean_theorem_prover/Foundations/The_three_axioms&amp;diff=6782&amp;oldid=prev</id>
		<title>PMA Publisher: Published from the Principia Machina source</title>
		<link rel="alternate" type="text/html" href="https://invarians.org/index.php?title=Lean_theorem_prover/Foundations/The_three_axioms&amp;diff=6782&amp;oldid=prev"/>
		<updated>2026-10-15T19:34:58Z</updated>

		<summary type="html">&lt;p&gt;Published from the Principia Machina source&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:34, 15 October 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{DISPLAYTITLE:The three axioms}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{DISPLAYTITLE:The three axioms}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Plebeian|Lean theorem prover/Explainers/What the axioms are}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Plebeian|Lean theorem prover/Explainers/What the axioms are}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{Lean theorem prover map}}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Lean&amp;#039;s type theory, with its dependent functions, universes, inductive types and quotients,&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Lean&amp;#039;s type theory, with its dependent functions, universes, inductive types and quotients,&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>PMA Publisher</name></author>
	</entry>
	<entry>
		<id>https://invarians.org/index.php?title=Lean_theorem_prover/Foundations/The_three_axioms&amp;diff=6575&amp;oldid=prev</id>
		<title>PMA Publisher: Published from the Principia Machina source</title>
		<link rel="alternate" type="text/html" href="https://invarians.org/index.php?title=Lean_theorem_prover/Foundations/The_three_axioms&amp;diff=6575&amp;oldid=prev"/>
		<updated>2026-10-14T18:01:02Z</updated>

		<summary type="html">&lt;p&gt;Published from the Principia Machina source&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{DISPLAYTITLE:The three axioms}}&lt;br /&gt;
{{Plebeian|Lean theorem prover/Explainers/What the axioms are}}&lt;br /&gt;
&lt;br /&gt;
Lean&amp;#039;s type theory, with its dependent functions, universes, inductive types and quotients,&lt;br /&gt;
is extended in the core library by three &amp;#039;&amp;#039;&amp;#039;axioms&amp;#039;&amp;#039;&amp;#039;: propositional extensionality&lt;br /&gt;
(&amp;lt;code&amp;gt;propext&amp;lt;/code&amp;gt;), the soundness of quotients (&amp;lt;code&amp;gt;Quot.sound&amp;lt;/code&amp;gt;) and global&lt;br /&gt;
choice (&amp;lt;code&amp;gt;Classical.choice&amp;lt;/code&amp;gt;). An axiom is a constant with a type and no&lt;br /&gt;
definition; it does not reduce, and the compiler cannot generate code for it.&amp;lt;ref name=&amp;quot;refman-axioms&amp;quot;&amp;gt;&amp;#039;&amp;#039;The Lean Language Reference&amp;#039;&amp;#039;, version 4.34.0, chapter 8 &amp;quot;Axioms&amp;quot;: the introduction, §8.2 &amp;quot;Consistency&amp;quot;, §8.3 &amp;quot;Reduction&amp;quot;, §8.4 &amp;quot;Standard Axioms&amp;quot; and §8.5 &amp;quot;Displaying Axiom Dependencies&amp;quot;. https://lean-lang.org/doc/reference/4.34.0/Axioms/&amp;lt;/ref&amp;gt; Lean records, for every&lt;br /&gt;
definition and theorem, which axioms it depends on, and prints the list on request. This&lt;br /&gt;
page states the three as Lean prints them, says what each makes possible, shows the&lt;br /&gt;
dependency audit on examples, and sets out the further axioms that are not mathematics at&lt;br /&gt;
all.&lt;br /&gt;
&lt;br /&gt;
== As Lean prints them ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;lean&amp;quot; style=&amp;quot;background: #f8f9fa; border: 1px solid #c8ccd1; padding: 0.6em; margin: 0.3em 0; font-size: 0.85em; line-height: 1.35; overflow-x: auto; white-space: pre;&amp;quot;&amp;gt;&lt;br /&gt;
#print propext&lt;br /&gt;
#print Quot.sound&lt;br /&gt;
#print Classical.choice&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre class=&amp;quot;lean-output&amp;quot; style=&amp;quot;background: #ffffff; border: 1px dashed #a2a9b1; padding: 0.6em; margin: 0.3em 0; font-size: 0.85em; line-height: 1.35; overflow-x: auto; white-space: pre;&amp;quot;&amp;gt;&lt;br /&gt;
axiom propext : ∀ {a b : Prop}, (a ↔ b) → a = b&lt;br /&gt;
axiom Quot.sound.{u} : ∀ {α : Sort u} {r : α → α → Prop} {a b : α}, r a b → Quot.mk r a = Quot.mk r b&lt;br /&gt;
axiom Classical.choice.{u} : {α : Sort u} → Nonempty α → α&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Lean 4.34.1 &amp;lt;code&amp;gt;propext&amp;lt;/code&amp;gt; is stated in the file &amp;lt;code&amp;gt;Init/Core.lean&amp;lt;/code&amp;gt;, and&lt;br /&gt;
the other two in &amp;lt;code&amp;gt;Init/Prelude.lean&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;src&amp;quot;&amp;gt;Lean 4 source, version 4.34.1: files &amp;lt;code&amp;gt;src/Init/Core.lean&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;propext&amp;lt;/code&amp;gt;), &amp;lt;code&amp;gt;src/Init/Prelude.lean&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;Quot.sound&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Classical.choice&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sorryAx&amp;lt;/code&amp;gt;) and &amp;lt;code&amp;gt;src/Init/Classical.lean&amp;lt;/code&amp;gt; (the proof of &amp;lt;code&amp;gt;Classical.em&amp;lt;/code&amp;gt;). Apache License 2.0. https://github.com/leanprover/lean4/tree/v4.34.1/src/Init&amp;lt;/ref&amp;gt; As rules, with&lt;br /&gt;
&amp;lt;math&amp;gt;a, b : \mathrm{Prop}&amp;lt;/math&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{\Gamma \vdash h : a \leftrightarrow b}{\Gamma \vdash \mathrm{propext}\,h : a = b} \qquad \frac{\Gamma \vdash p : r\,a\,b}{\Gamma \vdash \mathrm{Quot.sound}\,p : \mathrm{Quot.mk}\,r\,a = \mathrm{Quot.mk}\,r\,b} \qquad \frac{\Gamma \vdash h : \mathrm{Nonempty}\,\alpha}{\Gamma \vdash \mathrm{Classical.choice}\,h : \alpha}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first two conclude equations, which are propositions. The third concludes an element of&lt;br /&gt;
an arbitrary type. That difference decides how each one interacts with computation.&lt;br /&gt;
&lt;br /&gt;
== What each makes possible ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Propositional extensionality&amp;#039;&amp;#039;&amp;#039; says that logically equivalent propositions are equal,&lt;br /&gt;
so that one may be replaced by the other in any context. The reference manual notes that&lt;br /&gt;
the ordinary connectives respect logical equivalence provably, without the axiom, but that&lt;br /&gt;
it is needed for an unknown predicate &amp;lt;code&amp;gt;P : Prop → Prop&amp;lt;/code&amp;gt; applied to equivalent&lt;br /&gt;
arguments, and for equality between propositions itself.&amp;lt;ref name=&amp;quot;refman-props&amp;quot;&amp;gt;&amp;#039;&amp;#039;The Lean Language Reference&amp;#039;&amp;#039;, version 4.34.0, §4.2 &amp;quot;Propositions&amp;quot; (the axiom &amp;lt;code&amp;gt;propext&amp;lt;/code&amp;gt; and its documentation). https://lean-lang.org/doc/reference/4.34.0/The-Type-System/Propositions/&amp;lt;/ref&amp;gt; It is&lt;br /&gt;
valid intuitionistically.&amp;lt;ref name=&amp;quot;refman-props&amp;quot; /&amp;gt; &amp;#039;&amp;#039;Theorem Proving in Lean 4&amp;#039;&amp;#039; adds that&lt;br /&gt;
it agrees with set-theoretic readings in which every proposition is either empty or a&lt;br /&gt;
one-element set.&amp;lt;ref name=&amp;quot;tpil&amp;quot;&amp;gt;Jeremy Avigad, Leonardo de Moura, Soonho Kong and Sebastian Ullrich, &amp;#039;&amp;#039;Theorem Proving in Lean 4&amp;#039;&amp;#039;, chapter 12 &amp;quot;Axioms and Computation&amp;quot;. https://lean-lang.org/theorem_proving_in_lean4/Axioms-and-Computation/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Quotient soundness&amp;#039;&amp;#039;&amp;#039; identifies the classes of related elements in a&lt;br /&gt;
[[Lean theorem prover/Foundations/Quotient types|quotient type]]. It is also the only&lt;br /&gt;
axiom behind function extensionality, which Lean proves as a theorem from quotients; the&lt;br /&gt;
proof is on [[Lean theorem prover/Foundations/Propositional equality|propositional equality]]. With &amp;lt;code&amp;gt;propext&amp;lt;/code&amp;gt; it gives an extensional theory of sets represented as&lt;br /&gt;
predicates: two predicates true of the same elements are equal.&amp;lt;ref name=&amp;quot;tpil&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Global choice&amp;#039;&amp;#039;&amp;#039; turns a proof that a type is inhabited into an element of it.&lt;br /&gt;
&amp;lt;code&amp;gt;Nonempty α&amp;lt;/code&amp;gt; is a proposition, and a proof of it carries no information about&lt;br /&gt;
which element exists. &amp;lt;code&amp;gt;Classical.choice&amp;lt;/code&amp;gt; nevertheless returns one, and returns the&lt;br /&gt;
same one for any proof, since all proofs of a proposition are equal. &amp;#039;&amp;#039;Theorem Proving in&lt;br /&gt;
Lean 4&amp;#039;&amp;#039; derives from it the principle of indefinite description, and, with the other two&lt;br /&gt;
axioms, excluded middle, the decidability of every proposition and Hilbert&amp;#039;s epsilon&lt;br /&gt;
operator.&amp;lt;ref name=&amp;quot;tpil&amp;quot; /&amp;gt; That derivation is&lt;br /&gt;
[[Lean theorem prover/Foundations/Classical logic from choice|classical logic from choice]].&lt;br /&gt;
&lt;br /&gt;
The first two can block evaluation in Lean&amp;#039;s kernel, because a cast along an equation proved by&lt;br /&gt;
an axiom does not reduce, but they are compatible with compiled code, which erases proofs.&lt;br /&gt;
Choice is not: it manufactures data from a proposition, and definitions that use it for data&lt;br /&gt;
must be marked &amp;lt;code&amp;gt;noncomputable&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;tpil&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== The audit: #print axioms ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;#print axioms&amp;lt;/code&amp;gt; lists every axiom a constant depends on, directly or through the&lt;br /&gt;
definitions and theorems it uses.&amp;lt;ref name=&amp;quot;refman-axioms&amp;quot; /&amp;gt; Five small theorems show&lt;br /&gt;
the range from none to all three:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;lean&amp;quot; style=&amp;quot;background: #f8f9fa; border: 1px solid #c8ccd1; padding: 0.6em; margin: 0.3em 0; font-size: 0.85em; line-height: 1.35; overflow-x: auto; white-space: pre;&amp;quot;&amp;gt;&lt;br /&gt;
theorem two_add_two : 2 + 2 = 4 := rfl&lt;br /&gt;
&lt;br /&gt;
theorem and_swap (p q : Prop) : p ∧ q ↔ q ∧ p :=&lt;br /&gt;
  ⟨fun ⟨hp, hq⟩ =&amp;gt; ⟨hq, hp⟩, fun ⟨hq, hp⟩ =&amp;gt; ⟨hp, hq⟩⟩&lt;br /&gt;
&lt;br /&gt;
theorem and_swap_eq (p q : Prop) : (p ∧ q) = (q ∧ p) :=&lt;br /&gt;
  propext (and_swap p q)&lt;br /&gt;
&lt;br /&gt;
theorem add_zero_fun : (fun n : Nat =&amp;gt; n + 0) = (fun n =&amp;gt; n) :=&lt;br /&gt;
  funext fun _ =&amp;gt; rfl&lt;br /&gt;
&lt;br /&gt;
theorem em&amp;#039; (p : Prop) : p ∨ ¬p := Classical.em p&lt;br /&gt;
&lt;br /&gt;
#print axioms two_add_two&lt;br /&gt;
#print axioms and_swap&lt;br /&gt;
#print axioms and_swap_eq&lt;br /&gt;
#print axioms add_zero_fun&lt;br /&gt;
#print axioms em&amp;#039;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre class=&amp;quot;lean-output&amp;quot; style=&amp;quot;background: #ffffff; border: 1px dashed #a2a9b1; padding: 0.6em; margin: 0.3em 0; font-size: 0.85em; line-height: 1.35; overflow-x: auto; white-space: pre;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;#039;two_add_two&amp;#039; does not depend on any axioms&lt;br /&gt;
&amp;#039;and_swap&amp;#039; does not depend on any axioms&lt;br /&gt;
&amp;#039;and_swap_eq&amp;#039; depends on axioms: [propext]&lt;br /&gt;
&amp;#039;add_zero_fun&amp;#039; depends on axioms: [Quot.sound]&lt;br /&gt;
&amp;#039;em&amp;#039;&amp;#039; depends on axioms: [propext, Classical.choice, Quot.sound]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the computation checked by &amp;lt;code&amp;gt;rfl&amp;lt;/code&amp;gt; and the logical equivalence need nothing, the&lt;br /&gt;
equation between propositions needs &amp;lt;code&amp;gt;propext&amp;lt;/code&amp;gt;, and the equation between functions&lt;br /&gt;
needs &amp;lt;code&amp;gt;Quot.sound&amp;lt;/code&amp;gt;, through &amp;lt;code&amp;gt;funext&amp;lt;/code&amp;gt;. Excluded middle needs all three,&lt;br /&gt;
because the proof of &amp;lt;code&amp;gt;Classical.em&amp;lt;/code&amp;gt; in the core library uses choice,&lt;br /&gt;
&amp;lt;code&amp;gt;propext&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;funext&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;src&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== sorry and sorryAx ==&lt;br /&gt;
&lt;br /&gt;
The term &amp;lt;code&amp;gt;sorry&amp;lt;/code&amp;gt; closes any goal. It elaborates to the axiom&lt;br /&gt;
&amp;lt;code&amp;gt;sorryAx&amp;lt;/code&amp;gt;, which inhabits every type, and so it is used for unfinished work and&lt;br /&gt;
never belongs in a finished proof.&amp;lt;ref name=&amp;quot;refman-axioms&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;lean&amp;quot; style=&amp;quot;background: #f8f9fa; border: 1px solid #c8ccd1; padding: 0.6em; margin: 0.3em 0; font-size: 0.85em; line-height: 1.35; overflow-x: auto; white-space: pre;&amp;quot;&amp;gt;&lt;br /&gt;
#print sorryAx&lt;br /&gt;
&lt;br /&gt;
theorem unfinished : 1 = 2 := sorry&lt;br /&gt;
&lt;br /&gt;
theorem uses_unfinished : 2 = 3 := congrArg (· + 1) unfinished&lt;br /&gt;
&lt;br /&gt;
#print axioms uses_unfinished&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;pre class=&amp;quot;lean-output&amp;quot; style=&amp;quot;background: #ffffff; border: 1px dashed #a2a9b1; padding: 0.6em; margin: 0.3em 0; font-size: 0.85em; line-height: 1.35; overflow-x: auto; white-space: pre;&amp;quot;&amp;gt;&lt;br /&gt;
axiom sorryAx.{u} : (α : Sort u) → Bool → α&lt;br /&gt;
&amp;#039;uses_unfinished&amp;#039; depends on axioms: [sorryAx]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lean warns once, with &amp;lt;code&amp;gt;declaration uses `sorry`&amp;lt;/code&amp;gt;, at &amp;lt;code&amp;gt;unfinished&amp;lt;/code&amp;gt;,&lt;br /&gt;
where &amp;lt;code&amp;gt;sorry&amp;lt;/code&amp;gt; is written. The&lt;br /&gt;
theorem &amp;lt;code&amp;gt;uses_unfinished&amp;lt;/code&amp;gt; raises no warning of its own, yet it proves a falsehood,&lt;br /&gt;
and only the axiom list shows why. The reference manual makes the same point about the&lt;br /&gt;
editor&amp;#039;s check marks: they appear even when a dependency uses &amp;lt;code&amp;gt;sorry&amp;lt;/code&amp;gt;, and&lt;br /&gt;
printing the axioms is what detects it.&amp;lt;ref name=&amp;quot;refman-validating&amp;quot;&amp;gt;&amp;#039;&amp;#039;The Lean Language Reference&amp;#039;&amp;#039;, version 4.34.0, &amp;quot;Validating a Lean Proof&amp;quot;, sections &amp;quot;The Blue Double Check Marks&amp;quot;, &amp;quot;Printing Axioms&amp;quot; and &amp;quot;On Lean.trustCompiler (up to Lean 4.28.0)&amp;quot;. https://lean-lang.org/doc/reference/4.34.0/ValidatingProofs/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Axioms that are not mathematics ==&lt;br /&gt;
&lt;br /&gt;
Any user can write an axiom, and Lean accepts it. Lean cannot check that a&lt;br /&gt;
new axiom is consistent with the others.&amp;lt;ref name=&amp;quot;refman-axioms&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;lean&amp;quot; style=&amp;quot;background: #f8f9fa; border: 1px solid #c8ccd1; padding: 0.6em; margin: 0.3em 0; font-size: 0.85em; line-height: 1.35; overflow-x: auto; white-space: pre;&amp;quot;&amp;gt;&lt;br /&gt;
axiom everything_is_equal : ∀ (a b : Nat), a = b&lt;br /&gt;
&lt;br /&gt;
theorem one_eq_two : 1 = 2 := everything_is_equal 1 2&lt;br /&gt;
&lt;br /&gt;
#print axioms one_eq_two&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The last line prints &amp;lt;code&amp;gt;&amp;#039;one_eq_two&amp;#039; depends on axioms: [everything_is_equal]&amp;lt;/code&amp;gt;.&lt;br /&gt;
The theorem is checked and accepted; the audit is what exposes its premise.&lt;br /&gt;
&lt;br /&gt;
An axiom can also be harmless on its own and inconsistent with the standard three. The&lt;br /&gt;
reference manual&amp;#039;s example is a &amp;quot;free theorem&amp;quot; of parametricity, which says that a function&lt;br /&gt;
polymorphic in the element type of a list commutes with mapping over the list. With excluded&lt;br /&gt;
middle every proposition is decidable, so a function can test whether its type argument is&lt;br /&gt;
&amp;lt;code&amp;gt;Nat&amp;lt;/code&amp;gt; and behave differently when it is. That function is not parametric, and&lt;br /&gt;
together with the free theorem it proves &amp;lt;code&amp;gt;False&amp;lt;/code&amp;gt;.&amp;lt;ref name=&amp;quot;refman-axioms&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The core library itself states three further axioms, &amp;lt;code&amp;gt;Lean.trustCompiler&amp;lt;/code&amp;gt;,&lt;br /&gt;
&amp;lt;code&amp;gt;Lean.ofReduceBool&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Lean.ofReduceNat&amp;lt;/code&amp;gt;. The reference manual&lt;br /&gt;
describes them as mathematically trivial: they mark proofs that depend on the correctness of&lt;br /&gt;
the whole compiler rather than only on Lean&amp;#039;s small kernel.&amp;lt;ref name=&amp;quot;refman-axioms&amp;quot; /&amp;gt; The&lt;br /&gt;
tactic &amp;lt;code&amp;gt;native_decide&amp;lt;/code&amp;gt;, which settles a decidable statement by running compiled&lt;br /&gt;
code, creates a dedicated axiom for each use, stating exactly the fact the compiled code&lt;br /&gt;
asserted:&amp;lt;ref name=&amp;quot;refman-axioms&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;lean&amp;quot; style=&amp;quot;background: #f8f9fa; border: 1px solid #c8ccd1; padding: 0.6em; margin: 0.3em 0; font-size: 0.85em; line-height: 1.35; overflow-x: auto; white-space: pre;&amp;quot;&amp;gt;&lt;br /&gt;
theorem big : 123456 * 654321 = 80779853376 := by native_decide&lt;br /&gt;
&lt;br /&gt;
#print axioms big&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lean 4.34.1 prints &amp;lt;code&amp;gt;&amp;#039;big&amp;#039; depends on axioms: [big._native.native_decide.ax_1_1]&amp;lt;/code&amp;gt;.&lt;br /&gt;
Such a theorem rests on the correctness of the whole compiler, not only on Lean&amp;#039;s kernel and&lt;br /&gt;
the three axioms: each use of the tactic widens what has to be trusted.&amp;lt;ref name=&amp;quot;refman-validating&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Why audit per theorem ==&lt;br /&gt;
&lt;br /&gt;
The three standard axioms are, in the reference manual&amp;#039;s words, &amp;quot;known to be&lt;br /&gt;
consistent&amp;quot;.&amp;lt;ref name=&amp;quot;refman-axioms&amp;quot; /&amp;gt; Carneiro&amp;#039;s model of Lean&amp;#039;s type theory in set&lt;br /&gt;
theory, published in 2019, covers all three axioms together;&amp;lt;ref name=&amp;quot;carneiro&amp;quot;&amp;gt;Mario Carneiro, &amp;#039;&amp;#039;The Type Theory of Lean&amp;#039;&amp;#039;, Master&amp;#039;s thesis, Carnegie Mellon University, 2019; abstract, §2.7 (pp. 12–13) and Corollary 6.8 (p. 41). https://github.com/digama0/lean-type-theory/releases/tag/v1.0&amp;lt;/ref&amp;gt; it is described, with its limits, in&lt;br /&gt;
[[Lean theorem prover/Foundations/Consistency and the metatheory|consistency and the metatheory]].&lt;br /&gt;
Every other axiom is a premise the reader has to accept separately. The manual&amp;#039;s guide to&lt;br /&gt;
validating a proof therefore asks that &amp;lt;code&amp;gt;#print axioms&amp;lt;/code&amp;gt; report only&lt;br /&gt;
&amp;lt;code&amp;gt;propext&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Classical.choice&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Quot.sound&amp;lt;/code&amp;gt;: a&lt;br /&gt;
&amp;lt;code&amp;gt;sorryAx&amp;lt;/code&amp;gt; means an incomplete proof, &amp;lt;code&amp;gt;Lean.trustCompiler&amp;lt;/code&amp;gt; means trust in&lt;br /&gt;
native evaluation, and anything else means a custom axiom on which the result is&lt;br /&gt;
conditional.&amp;lt;ref name=&amp;quot;refman-validating&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A list of axioms also says what kind of result a theorem is. A theorem whose list omits&lt;br /&gt;
&amp;lt;code&amp;gt;Classical.choice&amp;lt;/code&amp;gt; uses no classical reasoning obtained from it, and one with an&lt;br /&gt;
empty list holds in the type theory alone. The check can be made permanent. The manual suggests pairing &amp;lt;code&amp;gt;#print axioms&amp;lt;/code&amp;gt; with&lt;br /&gt;
&amp;lt;code&amp;gt;#guard_msgs&amp;lt;/code&amp;gt;, so that a change in a library one depends on cannot silently add&lt;br /&gt;
an axiom:&amp;lt;ref name=&amp;quot;refman-axioms&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;lean lean-cont&amp;quot; style=&amp;quot;background: #f8f9fa; border: 1px solid #c8ccd1; padding: 0.6em; margin: 0.3em 0; font-size: 0.85em; line-height: 1.35; overflow-x: auto; white-space: pre;&amp;quot;&amp;gt;&lt;br /&gt;
/-- info: &amp;#039;two_add_two&amp;#039; does not depend on any axioms -/&lt;br /&gt;
#guard_msgs in&lt;br /&gt;
#print axioms two_add_two&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the proof of &amp;lt;code&amp;gt;two_add_two&amp;lt;/code&amp;gt; ever came to depend on an axiom, the message would&lt;br /&gt;
change, and this command would fail.&lt;br /&gt;
&lt;br /&gt;
== Next ==&lt;br /&gt;
&lt;br /&gt;
[[Lean theorem prover/Foundations/Classical logic from choice|Classical logic from choice]]&lt;br /&gt;
follows the third axiom into excluded middle.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>PMA Publisher</name></author>
	</entry>
</feed>