From 05cbf6f56bce1d45876630fe29b694dc57942e9c Mon Sep 17 00:00:00 2001 From: Jacques Comeaux Date: Thu, 13 Nov 2025 13:24:21 -0600 Subject: Add adjunction between free monoid and forget --- NaturalTransformation/Instance/EmptyList.agda | 32 ++++++++++++++++++--------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'NaturalTransformation/Instance/EmptyList.agda') diff --git a/NaturalTransformation/Instance/EmptyList.agda b/NaturalTransformation/Instance/EmptyList.agda index 9a558a2..0e069d2 100644 --- a/NaturalTransformation/Instance/EmptyList.agda +++ b/NaturalTransformation/Instance/EmptyList.agda @@ -1,23 +1,35 @@ {-# OPTIONS --without-K --safe #-} -open import Level using (Level) +open import Level using (Level; _⊔_) module NaturalTransformation.Instance.EmptyList {c ℓ : Level} where -import Function.Construct.Constant as Const - -open import Categories.NaturalTransformation using (NaturalTransformation; ntHelper) +open import Categories.Category.Instance.SingletonSet using () renaming (SingletonSetoid to ⊤ₛ) open import Categories.Functor using (Functor) -open import Categories.Category.Instance.SingletonSet using (SingletonSetoid) open import Categories.Functor.Construction.Constant using (const) -open import Data.List using ([]) +open import Categories.NaturalTransformation using (NaturalTransformation; ntHelper) +open import Data.Opaque.List using (Listₛ; []ₛ; mapₛ) +open import Data.Setoid using (_⇒ₛ_) +open import Function using (_⟶ₛ_) +open import Function.Construct.Constant using () renaming (function to Const) +open import Function.Construct.Setoid using (_∙_) open import Functor.Instance.List {c} {ℓ} using (List) open import Relation.Binary using (Setoid) -module List = Functor List +opaque + + unfolding []ₛ + + map-[]ₛ : {A B : Setoid c ℓ} + → (f : A ⟶ₛ B) + → (open Setoid (⊤ₛ ⇒ₛ Listₛ B)) + → []ₛ ≈ mapₛ f ∙ []ₛ + map-[]ₛ {_} {B} f = refl + where + open Setoid (List.₀ B) -⊤⇒[] : NaturalTransformation (const SingletonSetoid) List +⊤⇒[] : NaturalTransformation (const ⊤ₛ) List ⊤⇒[] = ntHelper record - { η = λ X → Const.function SingletonSetoid (List.₀ X) [] - ; commute = λ {_} {B} f → Setoid.refl (List.₀ B) + { η = λ X → []ₛ + ; commute = map-[]ₛ } -- cgit v1.2.3