<?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%2FExplainers%2FLean_and_physics</id>
	<title>Lean theorem prover/Explainers/Lean and physics - 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%2FExplainers%2FLean_and_physics"/>
	<link rel="alternate" type="text/html" href="https://invarians.org/index.php?title=Lean_theorem_prover/Explainers/Lean_and_physics&amp;action=history"/>
	<updated>2026-10-21T07:32:41Z</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/Explainers/Lean_and_physics&amp;diff=6773&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/Explainers/Lean_and_physics&amp;diff=6773&amp;oldid=prev"/>
		<updated>2026-10-15T19:34:45Z</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:Lean and physics}}&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:Lean and physics}}&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;A proof checker can do one thing for physics: check that a conclusion follows from&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;A proof checker can do one thing for physics: check that a conclusion follows from&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/Explainers/Lean_and_physics&amp;diff=6566&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/Explainers/Lean_and_physics&amp;diff=6566&amp;oldid=prev"/>
		<updated>2026-10-14T18:00:56Z</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:Lean and physics}}&lt;br /&gt;
&lt;br /&gt;
A proof checker can do one thing for physics: check that a conclusion follows from&lt;br /&gt;
stated assumptions. It cannot check that the assumptions describe the world. This page says what that&lt;br /&gt;
division means in practice, how real numbers, units and approximations enter a formal statement,&lt;br /&gt;
and what has been done in Lean on physics so far. It closes with this wiki&amp;#039;s own physics.&lt;br /&gt;
&lt;br /&gt;
== A derivation, as Lean sees it ==&lt;br /&gt;
&lt;br /&gt;
A derivation in physics starts from laws and assumptions and arrives at a result. In Lean the&lt;br /&gt;
laws and assumptions become hypotheses, the result becomes the statement, and the derivation&lt;br /&gt;
becomes the proof. Here a body is assumed to move at a constant speed &amp;lt;code&amp;gt;v&amp;lt;/code&amp;gt;, and the&lt;br /&gt;
theorem says how far it moves between two times:&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 displacement (x : Int → Int) (x₀ v : Int)&lt;br /&gt;
    (law : ∀ t, x t = x₀ + v * t) (t₁ t₂ : Int) :&lt;br /&gt;
    x t₂ - x t₁ = v * (t₂ - t₁) := by&lt;br /&gt;
  rw [law t₂, law t₁]&lt;br /&gt;
  grind&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lean accepts it. What it has checked is a conditional: if the position &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; follows&lt;br /&gt;
the law named &amp;lt;code&amp;gt;law&amp;lt;/code&amp;gt;, then the displacement is speed times elapsed time. It has not&lt;br /&gt;
checked that any body moves that way. Whether one does is a question for measurement, and no&lt;br /&gt;
proof can answer it. (The example uses whole numbers so that it runs in Lean without any library;&lt;br /&gt;
the same statement over the real numbers needs Mathlib.)&lt;br /&gt;
&lt;br /&gt;
The project this wiki records puts the point in one line: Lean proves the model, not the world&lt;br /&gt;
(see [[Principia Machina/Lean transition|the move to Lean]]).&lt;br /&gt;
&lt;br /&gt;
== What Lean can and cannot check ==&lt;br /&gt;
&lt;br /&gt;
Lean can check that every step of a derivation is valid, that no case is skipped, and that the&lt;br /&gt;
assumptions used are exactly the ones stated. An assumption that a written derivation uses without&lt;br /&gt;
saying so becomes, in Lean, a hypothesis that must be written down, or else the proof fails.&lt;br /&gt;
&lt;br /&gt;
Lean cannot check three things. It cannot check that the assumptions are true of nature; that is&lt;br /&gt;
what experiments are for. It cannot check that the symbols stand for the things they are meant to,&lt;br /&gt;
that &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; really is a position measured from a chosen point; that link between the&lt;br /&gt;
mathematics and the world is made by people. And it cannot check that the statement proved is the&lt;br /&gt;
one that was wanted (see [[Lean theorem prover/Explainers/Stating the right thing|stating the right thing]]).&lt;br /&gt;
&lt;br /&gt;
== Real numbers ==&lt;br /&gt;
&lt;br /&gt;
Physics is written over the real numbers, and core Lean has none (see&lt;br /&gt;
[[Lean theorem prover/Explainers/A library of mathematics|a library of mathematics]]). Mathlib&lt;br /&gt;
defines them as classes of Cauchy sequences of rational numbers, sequences whose terms get and&lt;br /&gt;
stay arbitrarily close to one another.&amp;lt;ref name=&amp;quot;real&amp;quot;&amp;gt;Mathlib, source file &amp;lt;code&amp;gt;Mathlib/Basic/Real/Basic.lean&amp;lt;/code&amp;gt;, module documentation &amp;quot;Real numbers from Cauchy sequences&amp;quot;. [https://github.com/leanprover-community/mathlib4/blob/master/Mathlib/Basic/Real/Basic.lean github.com/leanprover-community/mathlib4], consulted 14 October 2026.&amp;lt;/ref&amp;gt;&lt;br /&gt;
These are the exact real numbers of mathematics, not the rounded numbers a computer calculates&lt;br /&gt;
with. A theorem about real numbers therefore says nothing by itself about the rounding errors of a&lt;br /&gt;
numerical simulation. Connecting the two takes a further statement, one that bounds the error.&lt;br /&gt;
&lt;br /&gt;
== Units ==&lt;br /&gt;
&lt;br /&gt;
On paper, units are checked by hand. In Lean they can be made part of the types, so that adding a&lt;br /&gt;
length to a time is refused before any proof begins. A small version:&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;
structure Metres where&lt;br /&gt;
  val : Int&lt;br /&gt;
&lt;br /&gt;
structure Seconds where&lt;br /&gt;
  val : Int&lt;br /&gt;
&lt;br /&gt;
instance : Add Metres := ⟨fun a b =&amp;gt; ⟨a.val + b.val⟩⟩&lt;br /&gt;
&lt;br /&gt;
def d : Metres := ⟨3⟩&lt;br /&gt;
def t : Seconds := ⟨2⟩&lt;br /&gt;
&lt;br /&gt;
#eval (d + d).val&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lean prints &amp;lt;code&amp;gt;6&amp;lt;/code&amp;gt;: two lengths add. A length and a time do not:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;lean lean-cont lean-fails&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;
#eval (d + t).val&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Lean answers: failed to synthesize instance of type class, naming the missing addition of&lt;br /&gt;
&amp;lt;code&amp;gt;Metres&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Seconds&amp;lt;/code&amp;gt;. A fuller treatment exists. A 2025 preprint formalised&lt;br /&gt;
dimensional analysis in Lean: a dimension is a map from base dimensions to their exponents, dimensions&lt;br /&gt;
form a group under multiplication, physical quantities pair a value with a dimension, and the&lt;br /&gt;
framework covers SI units, fundamental constants and the Buckingham Pi theorem, with the&lt;br /&gt;
Lennard-Jones potential as a worked case.&amp;lt;ref name=&amp;quot;dims&amp;quot;&amp;gt;Maxwell P. Bobbin, Colin Jones, John Velkey and Tyler R. Josephson, &amp;quot;Formalizing dimensional analysis using the Lean theorem prover&amp;quot;, arXiv:2509.13142, 16 September 2025. [https://arxiv.org/abs/2509.13142 arxiv.org/abs/2509.13142]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Approximations ==&lt;br /&gt;
&lt;br /&gt;
Physics leans on approximations: small angles, weak fields, slow speeds. The sign &amp;quot;≈&amp;quot; means&lt;br /&gt;
nothing to Lean. An approximation has to be stated as an exact claim, usually an inequality with an&lt;br /&gt;
explicit bound on the error, or a statement about a limit. Writing it out that way shows what the&lt;br /&gt;
approximation actually assumes: how small the angle must be, and how large the error can then get.&lt;br /&gt;
That can be harder than the derivation it serves, and it is part of what formal proof adds.&lt;br /&gt;
&lt;br /&gt;
== Physics in Lean so far ==&lt;br /&gt;
&lt;br /&gt;
In 2024 Joseph Tooby-Smith introduced &amp;#039;&amp;#039;&amp;#039;HepLean&amp;#039;&amp;#039;&amp;#039;, a project to formalise high energy physics in&lt;br /&gt;
Lean 4, with first examples from flavour physics (CKM matrices), local anomaly cancellation and&lt;br /&gt;
Higgs physics. Its stated aims include making results easier to find, helping new results to be&lt;br /&gt;
found by artificial intelligence and automated methods, making the mathematical checking of papers easier, and new ways of&lt;br /&gt;
teaching.&amp;lt;ref name=&amp;quot;heplean&amp;quot;&amp;gt;Joseph Tooby-Smith, &amp;quot;HepLean: Digitalising high energy physics&amp;quot;, &amp;#039;&amp;#039;Computer Physics Communications&amp;#039;&amp;#039; 308 (2025), article 109457. [https://doi.org/10.1016/j.cpc.2024.109457 doi:10.1016/j.cpc.2024.109457]; preprint arXiv:2405.08863.&amp;lt;/ref&amp;gt;&lt;br /&gt;
HepLean was renamed PhysLean and later merged with Lean-QuantumInfo, a library for quantum&lt;br /&gt;
information, to form &amp;#039;&amp;#039;&amp;#039;Physlib&amp;#039;&amp;#039;&amp;#039;, an open-source community project under the Apache 2.0 licence&lt;br /&gt;
that depends on Mathlib. Its core library holds reviewed formalisations; a separate area with&lt;br /&gt;
lighter review accepts larger and faster contributions, including some generated by AI.&amp;lt;ref name=&amp;quot;physlib&amp;quot;&amp;gt;&amp;#039;&amp;#039;Physlib&amp;#039;&amp;#039; (README). [https://github.com/leanprover-community/physlib github.com/leanprover-community/physlib], consulted 14 October 2026; also [https://physlib.io physlib.io].&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Formalisation has also found a mistake. In 2026 Tooby-Smith formalised a widely cited paper of 2006,&lt;br /&gt;
by Maniatis, von Manteuffel, Nachtmann and Nagel, on the stability of the two-Higgs-doublet&lt;br /&gt;
potential, and found an error in its arguments that invalidates its main theorem on stability. He&lt;br /&gt;
suggests that this may be the first non-trivial error in a physics paper found through&lt;br /&gt;
formalisation.&amp;lt;ref name=&amp;quot;2hdm&amp;quot;&amp;gt;Joseph Tooby-Smith, &amp;quot;Formalizing the stability of the two Higgs doublet model potential into Lean: identifying an error in the literature&amp;quot;, arXiv:2603.08139, version 2, 20 April 2026. [https://arxiv.org/abs/2603.08139 arxiv.org/abs/2603.08139]&amp;lt;/ref&amp;gt;&lt;br /&gt;
[[Lean theorem prover/Applications/Physics in Lean|Physics in Lean]] describes this work further.&lt;br /&gt;
&lt;br /&gt;
== This wiki&amp;#039;s physics ==&lt;br /&gt;
&lt;br /&gt;
The physics editions on this wiki, [[Hamilton&amp;#039;s principle]], [[Noether&amp;#039;s theorems]] and&lt;br /&gt;
[[On Physical Lines of Force]], are written in ordinary mathematics and prose, not in Lean.&lt;br /&gt;
The framework this wiki records is moving to Lean (see&lt;br /&gt;
[[Lean theorem prover/Applications/Principia Machina|Principia Machina]]). Its own account notes&lt;br /&gt;
that physics over the real numbers needs Mathlib, which it has not yet chosen to adopt&lt;br /&gt;
(see [[Principia Machina/Lean transition|the move to Lean]]).&lt;br /&gt;
&lt;br /&gt;
== Next ==&lt;br /&gt;
&lt;br /&gt;
[[Lean theorem prover/Foundations/Terms, types and judgments|Terms, types and judgments]]&lt;br /&gt;
begins the technical pages, on the type theory that Lean checks.&lt;br /&gt;
[[Lean theorem prover/Applications/Physics in Lean|Physics in Lean]] describes the formal physics&lt;br /&gt;
done in Lean so far.&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>