<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Lean on emsenn.net</title>
    <link>https://emsenn.net/tags/lean/</link>
    <description>Recent content in Lean on emsenn.net</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Sun, 01 Mar 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://emsenn.net/tags/lean/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Introduction to Lean</title>
      <link>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/software/domains/lean/texts/introduction-to-lean/</link>
      <pubDate>Sun, 01 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/software/domains/lean/texts/introduction-to-lean/</guid>
      <description>&lt;h2 id=&#34;what-lean-is&#34;&gt;What Lean is&lt;/h2&gt;&#xA;&lt;p&gt;Lean 4 is a dependently typed functional programming language and interactive theorem&#xA;prover. It serves two purposes at once: you can write executable programs in it, and you&#xA;can state and prove mathematical theorems in it. These are the same activity — a proof is&#xA;a program whose type is the proposition it proves.&lt;/p&gt;&#xA;&lt;p&gt;Lean&amp;rsquo;s architecture has two layers:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;The &lt;strong&gt;kernel&lt;/strong&gt;: a small, trusted type checker that verifies proof terms. The kernel&#xA;implements the Calculus of Inductive Constructions. If the kernel accepts a term, the&#xA;proof is correct — there is no appeal to external authority.&lt;/li&gt;&#xA;&lt;li&gt;The &lt;strong&gt;elaborator&lt;/strong&gt;: a front-end that translates human-readable Lean code into the&#xA;kernel&amp;rsquo;s internal language. Tactics, implicit arguments, type inference, and&#xA;metaprogramming all live in the elaborator. They make proofs easier to write without&#xA;enlarging the trusted base.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;installation&#34;&gt;Installation&lt;/h2&gt;&#xA;&lt;p&gt;Lean 4 is installed through &lt;code&gt;elan&lt;/code&gt;, a toolchain manager (analogous to &lt;code&gt;rustup&lt;/code&gt; for Rust):&lt;/p&gt;</description>
    </item>
    <item>
      <title>Mathlib</title>
      <link>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/software/domains/lean/terms/mathlib/</link>
      <pubDate>Sun, 01 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/software/domains/lean/terms/mathlib/</guid>
      <description>&lt;p&gt;&lt;em&gt;&lt;strong&gt;Mathlib&lt;/strong&gt;&lt;/em&gt; is &lt;a href=&#34;../index.md&#34; class=&#34;link-internal&#34;&gt;Lean&lt;/a&gt;&amp;rsquo;s primary library of formalized mathematics. It contains Lean definitions for objects, theorems, and proofs in algebra, analysis, &lt;a href=&#34;../../../../../../mathematics/objects/categories/index.md&#34; class=&#34;link-internal&#34;&gt;category theory&lt;/a&gt;, combinatorics, number theory, order theory, and topology. Mathlib serves as both a reference library for working mathematicians and a testbed for proof automation techniques. The library is community-maintained and grows through a structured contribution process that enforces style, documentation, and proof conventions. In the context of this vault, Mathlib is relevant for formalizing the &lt;a href=&#34;../../../../../../mathematics/concepts/heyting-algebra/index.md&#34; class=&#34;link-internal&#34;&gt;Heyting algebra&lt;/a&gt; and &lt;a href=&#34;../../../../../../mathematics/concepts/closure-operator/index.md&#34; class=&#34;link-internal&#34;&gt;closure operator&lt;/a&gt; structures that underlie the &lt;a href=&#34;../../../../../../mathematics/objects/universes/semiotic-universe/index.md&#34; class=&#34;link-internal&#34;&gt;semiotic universe&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>tactic</title>
      <link>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/software/domains/lean/terms/tactic/</link>
      <pubDate>Sun, 01 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/software/domains/lean/terms/tactic/</guid>
      <description>&lt;p&gt;A tactic is a command that transforms a proof goal into simpler subgoals. Tactics build proof terms incrementally: each tactic takes the current goal state (a type to be inhabited) and produces zero or more new goals, constructing the proof term behind the scenes.&lt;/p&gt;&#xA;&lt;p&gt;In Lean 4, tactic mode is entered with the &lt;code&gt;by&lt;/code&gt; keyword. Common tactics include &lt;code&gt;intro&lt;/code&gt; (introduce a hypothesis), &lt;code&gt;apply&lt;/code&gt; (apply a lemma), &lt;code&gt;exact&lt;/code&gt; (supply the exact proof term), &lt;code&gt;simp&lt;/code&gt; (simplify using lemmas), &lt;code&gt;rw&lt;/code&gt; (rewrite using an equation), and &lt;code&gt;cases&lt;/code&gt;/&lt;code&gt;induction&lt;/code&gt; (case-split or induct on a value).&lt;/p&gt;</description>
    </item>
    <item>
      <title>Tactics in Lean</title>
      <link>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/software/domains/lean/texts/tactics-in-lean/</link>
      <pubDate>Sun, 01 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/software/domains/lean/texts/tactics-in-lean/</guid>
      <description>&lt;h2 id=&#34;what-tactics-do&#34;&gt;What tactics do&lt;/h2&gt;&#xA;&lt;p&gt;A &lt;a href=&#34;../terms/tactic.md&#34; class=&#34;link-internal&#34;&gt;tactic&lt;/a&gt; transforms a proof goal into simpler subgoals. The proof&#xA;state consists of:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Context&lt;/strong&gt;: named hypotheses and local definitions.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Goal&lt;/strong&gt;: the type (proposition) that remains to be proved.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Each tactic inspects the goal and context, then either closes the goal (producing a proof&#xA;term) or splits it into subgoals. When all goals are closed, the proof is complete and&#xA;Lean&amp;rsquo;s kernel checks the assembled proof term.&lt;/p&gt;&#xA;&lt;h2 id=&#34;core-tactics&#34;&gt;Core tactics&lt;/h2&gt;&#xA;&lt;h3 id=&#34;introducing-hypotheses&#34;&gt;Introducing hypotheses&lt;/h3&gt;&#xA;&lt;p&gt;&lt;code&gt;intro&lt;/code&gt; moves a universally quantified variable or implication antecedent from the goal&#xA;into the context:&lt;/p&gt;</description>
    </item>
    <item>
      <title>theorem</title>
      <link>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/software/domains/lean/terms/theorem/</link>
      <pubDate>Sun, 01 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/software/domains/lean/terms/theorem/</guid>
      <description>&lt;p&gt;A theorem in Lean is a named declaration consisting of a type (the proposition) and a term (the proof). The syntax is:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-lean&#34; data-lang=&#34;lean&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;theorem&lt;/span&gt; name &lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; proposition &lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt;= proof_term&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;or equivalently in tactic mode:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-lean&#34; data-lang=&#34;lean&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;theorem&lt;/span&gt; name &lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; proposition &lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt;= &lt;span style=&#34;color:#66d9ef&#34;&gt;by&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  tactic₁&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  tactic₂&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  ...&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The kernel checks that the proof term has the declared type. If it does, the theorem is accepted; if not, Lean reports an error. A theorem declaration differs from a &lt;code&gt;def&lt;/code&gt; only in that theorems are marked as irrelevant to computation — they contribute type information but are erased at runtime.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Types and Propositions in Lean</title>
      <link>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/software/domains/lean/texts/types-and-propositions-in-lean/</link>
      <pubDate>Sun, 01 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/software/domains/lean/texts/types-and-propositions-in-lean/</guid>
      <description>&lt;h2 id=&#34;prop-and-type&#34;&gt;Prop and Type&lt;/h2&gt;&#xA;&lt;p&gt;Lean distinguishes two sorts:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;Type&lt;/code&gt; (actually &lt;code&gt;Type u&lt;/code&gt; for universe level &lt;code&gt;u&lt;/code&gt;) — the sort of computational types.&#xA;&lt;code&gt;Nat : Type&lt;/code&gt;, &lt;code&gt;String : Type&lt;/code&gt;, &lt;code&gt;List Nat : Type&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Prop&lt;/code&gt; — the sort of propositions. &lt;code&gt;2 + 2 = 4 : Prop&lt;/code&gt;, &lt;code&gt;∀ n, n + 0 = n : Prop&lt;/code&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The distinction matters for erasure: values of type &lt;code&gt;Prop&lt;/code&gt; are erased at runtime because&#xA;they carry no computational content — a proof that &lt;code&gt;2 + 2 = 4&lt;/code&gt; does not affect program&#xA;execution. This separation lets Lean be both a programming language and a proof assistant&#xA;without proofs slowing down compiled code.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
