summaryrefslogtreecommitdiff
path: root/Nominal/Category.lean
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2025-10-23 13:52:00 +0200
committerHannes Schulze <haschu0103@outlook.de>2025-10-23 13:52:00 +0200
commit40e94df160d011c503fe8dcee39937227de44307 (patch)
tree7f4b25ae727008693b0867fc2fca908e7696e2f4 /Nominal/Category.lean
parentdc1b4ffb712bb0c411b907cf1395fa790207a8ce (diff)
add category definition
Diffstat (limited to 'Nominal/Category.lean')
-rw-r--r--Nominal/Category.lean43
1 files changed, 43 insertions, 0 deletions
diff --git a/Nominal/Category.lean b/Nominal/Category.lean
new file mode 100644
index 0000000..fc7e161
--- /dev/null
+++ b/Nominal/Category.lean
@@ -0,0 +1,43 @@
+import Mathlib
+import Nominal.Support
+import Nominal.Equivariance
+
+/-!
+# Nominal Set Category
+
+Nominal sets form a category, where the morphisms are exactly equivariant functions between them.
+This file contains formalizations for this category-theoretical view.
+-/
+
+variable (𝔸 : Type) [Infinite 𝔸] [Countable 𝔸] [DecidableEq 𝔸]
+
+/-!
+## Category Definition
+
+Definition of the Nom category instance.
+-/
+section Definition
+
+/-- An object in the category of nominal sets; i.e., a nominal set. -/
+structure Nom where
+ /-- The underlying set. -/
+ carrier : Type
+ /-- Nominal set instance. -/
+ [nom : NominalSet 𝔸 carrier]
+
+attribute [instance] Nom.nom
+
+/-- A morphism in the category of nominal sets; i.e., an equivariant function. -/
+structure Nom.Hom (X Y : Nom 𝔸) where
+ /-- The underlying function. -/
+ toFun : X.carrier → Y.carrier
+ /-- Equivariance of the function. -/
+ equivariant : Equivariant 𝔸 toFun
+
+/-- Nominal sets form a category with equivariant functions as morphisms. -/
+instance : CategoryTheory.Category (Nom 𝔸) where
+ Hom := Nom.Hom 𝔸
+ id X := ⟨id, id_equivariant 𝔸⟩
+ comp f g := ⟨g.toFun ∘ f.toFun, comp_equivariant 𝔸 f.equivariant g.equivariant⟩
+
+end Definition