<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Agda on emsenn.net</title>
    <link>https://emsenn.net/tags/agda/</link>
    <description>Recent content in Agda on emsenn.net</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Sun, 01 Mar 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://emsenn.net/tags/agda/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Dependent Types in Agda</title>
      <link>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/formal-math/domains/agda/texts/dependent-types-in-agda/</link>
      <pubDate>Sun, 01 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/formal-math/domains/agda/texts/dependent-types-in-agda/</guid>
      <description>&lt;h2 id=&#34;dependent-function-types-pi-types&#34;&gt;&lt;a href=&#34;#dependent-function-types-pi-types&#34; class=&#34;heading-anchor&#34; aria-label=&#34;Link to this section&#34;&gt;¶&lt;/a&gt;Dependent function types (Pi-types)&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;In Agda, every function type can be dependent. The syntax:&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;&#34;&gt;&lt;code class=&#34;language-agda&#34; data-lang=&#34;agda&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;f&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;(&lt;/span&gt;x &lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; A&lt;span style=&#34;color:#f92672&#34;&gt;)&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;→&lt;/span&gt; B x&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;declares a function where the return type &lt;code&gt;B x&lt;/code&gt; depends on the input value &lt;code&gt;x&lt;/code&gt;. When the&#xA;return type does not depend on the input, this reduces to the ordinary function type&#xA;&lt;code&gt;A → B&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;&lt;strong&gt;Example.&lt;/strong&gt; A function that returns a type based on a boolean:&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;&#34;&gt;&lt;code class=&#34;language-agda&#34; data-lang=&#34;agda&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;T&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; Bool &lt;span style=&#34;color:#f92672&#34;&gt;→&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;Set&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;T true  &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; Nat&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;T false &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; String&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A function using this:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Introduction to Agda</title>
      <link>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/formal-math/domains/agda/texts/introduction-to-agda/</link>
      <pubDate>Sun, 01 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/formal-math/domains/agda/texts/introduction-to-agda/</guid>
      <description>&lt;h2 id=&#34;what-agda-is&#34;&gt;&lt;a href=&#34;#what-agda-is&#34; class=&#34;heading-anchor&#34; aria-label=&#34;Link to this section&#34;&gt;¶&lt;/a&gt;What Agda is&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Agda is a dependently typed functional programming language based on Martin-Löf type&#xA;theory. It is simultaneously a programming language and a proof assistant: every&#xA;well-typed program is a proof, and every proof is a program.&lt;/p&gt;&#xA;&lt;p&gt;Unlike &lt;a href=&#34;../../lean/index.md&#34; class=&#34;link-internal&#34;&gt;Lean&lt;/a&gt;, which provides a tactic language for constructing&#xA;proofs interactively, Agda proofs are written as ordinary function definitions using&#xA;&lt;a href=&#34;../terms/pattern-matching.md&#34; class=&#34;link-internal&#34;&gt;pattern matching&lt;/a&gt;. There is no tactic layer — the proof&#xA;IS the code. This design choice makes proofs explicit and readable at the cost of less&#xA;automation.&lt;/p&gt;</description>
    </item>
    <item>
      <title>pattern matching</title>
      <link>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/formal-math/domains/agda/terms/pattern-matching/</link>
      <pubDate>Sun, 01 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/formal-math/domains/agda/terms/pattern-matching/</guid>
      <description>&lt;p&gt;Pattern matching in Agda is dependent: when you match on a constructor, the type checker refines the types of all other variables in scope to reflect the information gained.&lt;/p&gt;&#xA;&lt;p&gt;For example, matching a value of type &lt;code&gt;Vec A (suc n)&lt;/code&gt; against the constructor &lt;code&gt;x ∷ xs&lt;/code&gt; tells the checker that the length is &lt;code&gt;suc n&lt;/code&gt;, and &lt;code&gt;xs&lt;/code&gt; has type &lt;code&gt;Vec A n&lt;/code&gt;. This refinement happens automatically and is checked for completeness — you must handle every constructor.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Proving in Agda</title>
      <link>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/formal-math/domains/agda/texts/proving-in-agda/</link>
      <pubDate>Sun, 01 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/formal-math/domains/agda/texts/proving-in-agda/</guid>
      <description>&lt;h2 id=&#34;propositions-as-types&#34;&gt;&lt;a href=&#34;#propositions-as-types&#34; class=&#34;heading-anchor&#34; aria-label=&#34;Link to this section&#34;&gt;¶&lt;/a&gt;Propositions as types&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;In Agda, there is no separate &lt;code&gt;Prop&lt;/code&gt; sort — propositions are ordinary types in &lt;code&gt;Set&lt;/code&gt;.&#xA;A proof of proposition &lt;code&gt;P&lt;/code&gt; is a term of type &lt;code&gt;P&lt;/code&gt;. The logical connectives are defined as&#xA;data types:&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;&#34;&gt;&lt;code class=&#34;language-agda&#34; data-lang=&#34;agda&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;-- Conjunction&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;record&lt;/span&gt; _×_ &lt;span style=&#34;color:#f92672&#34;&gt;(&lt;/span&gt;A B &lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;Set&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;)&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;Set&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;where&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;constructor&lt;/span&gt; _,_&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#66d9ef&#34;&gt;field&lt;/span&gt; fst &lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; A ; snd &lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; B&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;-- Disjunction&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;data&lt;/span&gt; _⊎_ &lt;span style=&#34;color:#f92672&#34;&gt;(&lt;/span&gt;A B &lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;Set&lt;/span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;)&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;Set&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;where&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;inj₁&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; A &lt;span style=&#34;color:#f92672&#34;&gt;→&lt;/span&gt; A ⊎ B&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;  &lt;span style=&#34;color:#a6e22e&#34;&gt;inj₂&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; B &lt;span style=&#34;color:#f92672&#34;&gt;→&lt;/span&gt; A ⊎ B&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;-- Negation&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#a6e22e&#34;&gt;¬_&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;:&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;Set&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;→&lt;/span&gt; &lt;span style=&#34;color:#66d9ef&#34;&gt;Set&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;¬ A &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; A &lt;span style=&#34;color:#f92672&#34;&gt;→&lt;/span&gt; ⊥    &lt;span style=&#34;color:#75715e&#34;&gt;-- where ⊥ is the empty type&lt;/span&gt;&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;-- Existential&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;-- Σ type (see previous lesson)&lt;/span&gt;&#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;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#75715e&#34;&gt;-- Universal: dependent function type (x : A) → P x&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Because Agda is &lt;a href=&#34;../../../../../../mathematics/disciplines/logic/curricula/intuitionistic-logic.md&#34; class=&#34;link-internal&#34;&gt;intuitionistic&lt;/a&gt;, &lt;a href=&#34;../../../../../../../../humanities/domains/philosophy/terms/law-of-excluded-middle.md&#34; class=&#34;link-internal&#34;&gt;excluded middle&lt;/a&gt; is not available by default. A proof of &lt;code&gt;A ⊎ B&lt;/code&gt; must supply a proof of &lt;code&gt;A&lt;/code&gt; or a proof of &lt;code&gt;B&lt;/code&gt; — you cannot argue &amp;ldquo;suppose neither, derive a contradiction.&amp;rdquo;&lt;/p&gt;</description>
    </item>
    <item>
      <title>standard library</title>
      <link>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/formal-math/domains/agda/terms/standard-library/</link>
      <pubDate>Sun, 01 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/formal-math/domains/agda/terms/standard-library/</guid>
      <description>&lt;p&gt;The Agda standard library (&lt;code&gt;agda-stdlib&lt;/code&gt;) provides formalized definitions and proofs for common mathematical and computational structures. It covers:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;strong&gt;Data types&lt;/strong&gt;: natural numbers, integers, lists, vectors, finite sets, strings.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Relations&lt;/strong&gt;: binary relations, equivalence relations, &lt;a href=&#34;../../../../../../mathematics/objects/posets/terms/partial-order.md&#34; class=&#34;link-internal&#34;&gt;partial orders&lt;/a&gt;, total orders, decidability.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Algebra&lt;/strong&gt;: monoids, groups, rings, &lt;a href=&#34;../../../../../../mathematics/objects/posets/terms/lattice.md&#34; class=&#34;link-internal&#34;&gt;lattices&lt;/a&gt;, with an algebraic hierarchy using record types.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Logic&lt;/strong&gt;: propositional logic, predicate logic, decidability, classical axioms (importable but not default).&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Category theory&lt;/strong&gt;: basic definitions of categories, &lt;a href=&#34;../../../../../../mathematics/objects/categories/ordinary-categories/terms/functor.md&#34; class=&#34;link-internal&#34;&gt;functors&lt;/a&gt;, &lt;a href=&#34;../../../../../../mathematics/objects/categories/ordinary-categories/terms/natural-transformation.md&#34; class=&#34;link-internal&#34;&gt;natural transformations&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The standard library is smaller and more manually curated than Lean&amp;rsquo;s &lt;a href=&#34;../../lean/terms/Mathlib.md&#34; class=&#34;link-internal&#34;&gt;Mathlib&lt;/a&gt;. Where Mathlib aims for broad coverage with automation, agda-stdlib emphasizes explicit, readable definitions that stay close to the underlying type theory.&lt;/p&gt;</description>
    </item>
    <item>
      <title>universe level</title>
      <link>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/formal-math/domains/agda/terms/universe-level/</link>
      <pubDate>Sun, 01 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/formal-math/domains/agda/terms/universe-level/</guid>
      <description>&lt;p&gt;In Agda, types are organized into a hierarchy of universes to avoid paradoxes. The base universe is &lt;code&gt;Set&lt;/code&gt; (also written &lt;code&gt;Set₀&lt;/code&gt;), which contains ordinary types like &lt;code&gt;Nat&lt;/code&gt;, &lt;code&gt;Bool&lt;/code&gt;, and &lt;code&gt;List Nat&lt;/code&gt;. The type &lt;code&gt;Set&lt;/code&gt; itself belongs to &lt;code&gt;Set₁&lt;/code&gt;, which belongs to &lt;code&gt;Set₂&lt;/code&gt;, and so on:&lt;/p&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;Nat : Set&#xA;Set : Set₁&#xA;Set₁ : Set₂&#xA;...&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This stratification prevents Russell&amp;rsquo;s paradox: no universe contains itself.&lt;/p&gt;&#xA;&lt;p&gt;Agda supports &lt;strong&gt;universe polymorphism&lt;/strong&gt; — definitions can be parameterized over a universe level variable &lt;code&gt;ℓ&lt;/code&gt;, allowing them to work at any level:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Write Agda Proof</title>
      <link>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/formal-math/domains/agda/texts/write-agda-proof/</link>
      <pubDate>Sun, 01 Mar 2026 00:00:00 +0000</pubDate>
      <guid>https://emsenn.net/library/domains/engineering/domains/tech/domains/computing/domains/formal-math/domains/agda/texts/write-agda-proof/</guid>
      <description>&lt;h2 id=&#34;prerequisites&#34;&gt;&lt;a href=&#34;#prerequisites&#34; class=&#34;heading-anchor&#34; aria-label=&#34;Link to this section&#34;&gt;¶&lt;/a&gt;Prerequisites&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Read the &lt;a href=&#34;https://emsenn.net/mathematics/concepts/proof/skills/write-formal-proof/SKILL.md&#34; class=&#34;link-internal&#34;&gt;write-formal-proof&lt;/a&gt; skill first. It contains the anti-slop checklist that must pass before any proof is considered complete.&lt;/p&gt;&#xA;&lt;h2 id=&#34;agda-specific-workflow&#34;&gt;&lt;a href=&#34;#agda-specific-workflow&#34; class=&#34;heading-anchor&#34; aria-label=&#34;Link to this section&#34;&gt;¶&lt;/a&gt;Agda-specific workflow&#xA;&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;strong&gt;State the proposition&lt;/strong&gt; as an Agda type signature with explicit&#xA;universe levels and parameters.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;strong&gt;Identify standard library imports.&lt;/strong&gt; Common ones:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;Relation.Binary.PropositionalEquality&lt;/code&gt; — &lt;code&gt;_≡_&lt;/code&gt;, &lt;code&gt;refl&lt;/code&gt;, &lt;code&gt;cong&lt;/code&gt;,&#xA;&lt;code&gt;sym&lt;/code&gt;, &lt;code&gt;trans&lt;/code&gt;, &lt;code&gt;subst&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Data.Nat&lt;/code&gt;, &lt;code&gt;Data.List&lt;/code&gt; — basic data types&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Data.Product&lt;/code&gt; — &lt;code&gt;_×_&lt;/code&gt;, &lt;code&gt;_,_&lt;/code&gt;, &lt;code&gt;proj₁&lt;/code&gt;, &lt;code&gt;proj₂&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Data.Sum&lt;/code&gt; — &lt;code&gt;_⊎_&lt;/code&gt;, &lt;code&gt;inj₁&lt;/code&gt;, &lt;code&gt;inj₂&lt;/code&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Level&lt;/code&gt; — universe level management&lt;/li&gt;&#xA;&lt;li&gt;&lt;code&gt;Function&lt;/code&gt; — &lt;code&gt;id&lt;/code&gt;, &lt;code&gt;_∘_&lt;/code&gt;, &lt;code&gt;case_of_&lt;/code&gt;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;&lt;strong&gt;Write the proof as a function definition.&lt;/strong&gt; Agda has no tactic&#xA;mode — proofs are terms. Use:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
