From 992aa8fdd40521d2cc7ed4759bce92c912cbeb80 Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Mon, 20 Oct 2025 13:13:33 +0200 Subject: further work --- Nominal/Basic.lean | 204 ++++++++++++++++++++++++++--------------------------- 1 file changed, 100 insertions(+), 104 deletions(-) (limited to 'Nominal/Basic.lean') diff --git a/Nominal/Basic.lean b/Nominal/Basic.lean index 534759d..eb10b44 100644 --- a/Nominal/Basic.lean +++ b/Nominal/Basic.lean @@ -1,123 +1,125 @@ import Mathlib.Tactic +import Nominal.Permutations +/-! +# Basic Definitions -section Permutations +This file provides basic definitions for nominal sets. +-/ -variable {X : Type} +/-! +## (FPerm ๐”ธ)-Sets -notation "โธจ" a "," b "โธฉ" => Equiv.swap a b - --- The support of a permutation; i.e., the set of elements where the permutation actually maps the element to a different one. -def Equiv.Perm.supp (ฯ€ : Equiv.Perm X) : Set X := - {x | ฯ€ x โ‰  x} - -@[simp] -theorem mem_support (ฯ€ : Equiv.Perm X) (x : X) : x โˆˆ ฯ€.supp โ†” ฯ€ x โ‰  x := by - simp [Equiv.Perm.supp] - --- The support of the identity function is the empty set. -lemma supp_one : (1 : Equiv.Perm X).supp = โˆ… := by - rw [Set.eq_empty_iff_forall_notMem] - intro x hx - contradiction - --- The support of the inverse function is the same as the function's support. -lemma supp_inv (ฯ€ : Equiv.Perm X) : ฯ€โปยน.supp = ฯ€.supp := by - simp [Equiv.Perm.supp, Equiv.Perm.set_support_inv_eq] - --- The support of two concatenated permutations is a subset of the individual supports as a union. -lemma supp_mul_subset (ฯ€ ฯ„ : Equiv.Perm X) : (ฯ€ * ฯ„).supp โІ ฯ€.supp โˆช ฯ„.supp := by - simp [Equiv.Perm.supp] - apply Equiv.Perm.set_support_mul_subset - -lemma supp_swap [DecidableEq X] {x y : X} (h : x โ‰  y) : โธจx, yโธฉ.supp = {x, y} := by - ext z - by_cases hx : z = x - ยท simpa [hx] using h.symm - ยท by_cases hy : z = y - ยท simpa [Equiv.swap_apply_of_ne_of_ne, hx, hy] using h - ยท simp [Equiv.swap_apply_of_ne_of_ne, hx, hy] - --- The group of (finitely supported) permutations. -def FPerm (X: Type) : Subgroup (Equiv.Perm X) where - carrier := {ฯ€ | ฯ€.supp.Finite} - mul_mem' {ฯ€ ฯ„} hฯ€ hฯ„ := by - apply (hฯ€.union hฯ„).subset - exact supp_mul_subset ฯ€ ฯ„ - one_mem' := by - simp [supp_one] - inv_mem' {x} hx := by - simp [supp_inv] - exact hx - -lemma supp_swap_finite [DecidableEq X] (x y : X) : โธจx, yโธฉ โˆˆ FPerm X := by - by_cases hx : x = y - ยท rw [<-Equiv.swap_eq_one_iff] at hx - simp [hx] - ยท simp [FPerm, supp_swap hx] - -lemma supp_mul_finite {ฯ€ ฯ„ : Equiv.Perm X} (hฯ€ : ฯ€ โˆˆ FPerm X) (hฯ„ : ฯ„ โˆˆ FPerm X) : (ฯ€ * ฯ„) โˆˆ FPerm X := - (FPerm X).mul_mem hฯ€ hฯ„ - -lemma supp_inv_finite {ฯ€ : Equiv.Perm X} (hฯ€ : ฯ€ โˆˆ FPerm X) : ฯ€โปยน โˆˆ FPerm X := - (FPerm X).inv_mem hฯ€ - --- Since FPerm is a subgroup of Perm, it is also a group. -instance (X : Type) : Group (FPerm X) := - Subgroup.toGroup (FPerm X) - --- Since FPerm is a subset of Perm, we can coerce it into a function. -instance (X : Type) : CoeFun (FPerm X) (fun _ => X โ†’ X) where - coe ฯ€ := (โ†‘ฯ€ : Equiv.Perm X) - -example : FPerm โ„• := โŸจโธจ1, 2โธฉ * โธจ3, 4โธฉ * โธจ2, 3โธฉ, by simp [supp_swap_finite, supp_mul_finite]โŸฉ - -end Permutations - -section GSets +Sets equipped with a permutation operation. +-/ +section PermSet variable (๐”ธ : Type) [Infinite ๐”ธ] [Countable ๐”ธ] [DecidableEq ๐”ธ] --- A G-set is a set X equipped with a group action โ€ข: (FPerm ๐”ธ) ร— X โ†’ X. -class GSet (X : Type) extends MulAction (FPerm ๐”ธ) X +/-- A set X equipped with a group action โ€ข: (FPerm ๐”ธ) ร— X โ†’ X. -/ +class PermSet (X : Type) extends MulAction (FPerm ๐”ธ) X -instance : GSet ๐”ธ ๐”ธ where +/-- The set of atoms itself forms a G-Set. -/ +instance : PermSet ๐”ธ ๐”ธ where smul ฯ€ a := ฯ€ a one_smul := by aesop mul_smul := by aesop -instance discreteGSet (X : Type) : GSet ๐”ธ X where +/-- The set of finite permutations forms a G-Set. -/ +instance : PermSet ๐”ธ (FPerm ๐”ธ) where + smul ฯ€ ฯ„ := ฯ€ * ฯ„ + one_smul := by aesop + mul_smul := by aesop + +/-- A discrete (FPerm ๐”ธ)-Set where permutations do not change anything. -/ +instance PermSet.discrete (X : Type) : PermSet ๐”ธ X where smul ฯ€ x := x one_smul := by aesop mul_smul := by aesop -instance : GSet ๐”ธ Unit := discreteGSet ๐”ธ Unit -instance : GSet ๐”ธ Bool := discreteGSet ๐”ธ Bool +/-- We consider Unit a discrete (FPerm ๐”ธ)-Set. -/ +instance : PermSet ๐”ธ Unit := PermSet.discrete ๐”ธ Unit + +/-- We consider Bool a discrete (FPerm ๐”ธ)-Set. -/ +instance : PermSet ๐”ธ Bool := PermSet.discrete ๐”ธ Bool + +end PermSet + +/-! +## Support Definitions + +We can define the notion of "supports" on elements of (FPerm ๐”ธ)-Sets as the atoms which need to be left unchanged to also fix the element. +-/ +section Support -variable {X : Type} [GSet ๐”ธ X] +variable (๐”ธ : Type) {X : Type} [PermSet ๐”ธ X] --- The permutations that leave an element x unchanged. +namespace PermSet + +/-- The permutations that leave an element x unchanged. -/ def fix' (x : X) : Set (FPerm ๐”ธ) := { ฯ€ : FPerm ๐”ธ | ฯ€ โ€ข x = x } --- The permutations that leave all elements in A unchanged. +/-- The permutations that leave all elements in A unchanged. -/ def fix (A : Set X) : Set (FPerm ๐”ธ) := { ฯ€ : FPerm ๐”ธ | โˆ€ x โˆˆ A, ฯ€ โ€ข x = x } --- A set S โІ ๐”ธ is a support for x if every permutation that fixes S also leaves x unchanged. +/-- A set S โІ ๐”ธ is a support for x if every permutation that fixes S also leaves x unchanged. -/ def HasSupport (x : X) (S : Set ๐”ธ) : Prop := fix ๐”ธ S โІ fix' ๐”ธ x -end GSets +@[simp] +lemma support_iff {x : X} {S : Set ๐”ธ} : HasSupport ๐”ธ x S โ†” fix ๐”ธ S โІ fix' ๐”ธ x := by + rfl + +lemma support_subset {x : X} {S T : Set ๐”ธ} : HasSupport ๐”ธ x S โ†’ S โІ T โ†’ HasSupport ๐”ธ x T := by + intro hS hsub ฯ€ hฯ€ + apply hS + intro a + aesop + +lemma support_inter {x : X} {S T : Set ๐”ธ} : HasSupport ๐”ธ x S โ†’ S.Finite โ†’ HasSupport ๐”ธ x T โ†’ T.Finite โ†’ HasSupport ๐”ธ x (S โˆฉ T) := by + sorry + +end PermSet -section NominalSets +end Support + +/-! +## Basic Nominal Set Definition + +Nominal sets are then just G-Sets where all elements are finitely supported. +-/ +section NominalSet variable (๐”ธ : Type) --- A G-Set X is nominal if every x โˆˆ X is finitely supported. -class Nominal (X : Type) extends GSet ๐”ธ X where - finsupp : โˆ€ (x : X), โˆƒ (S : Set ๐”ธ), HasSupport ๐”ธ x S โˆง S.Finite +/-- A G-Set X is nominal if every x โˆˆ X is finitely supported. -/ +class NominalSet (X : Type) extends PermSet ๐”ธ X where + finsupp : โˆ€ (x : X), โˆƒ (S : Set ๐”ธ), PermSet.HasSupport ๐”ธ x S โˆง S.Finite + +namespace NominalSet + +variable {X : Type} [nom : NominalSet ๐”ธ X] -instance : Nominal ๐”ธ ๐”ธ where +/-- For every element x of a nominal set, there exists a least finite support, denoted "supp x". --/ +noncomputable def supp (x : X) : Set ๐”ธ := + โ‹‚โ‚€ { S : Set ๐”ธ | PermSet.HasSupport ๐”ธ x S } + +/-- The least finite support in a nominal set is always finite. -/ +lemma supp_finite {x : X} : (supp ๐”ธ x).Finite := by + unfold supp + obtain โŸจS, โŸจhsuppS, hfinSโŸฉโŸฉ := nom.finsupp x + apply Set.Finite.subset + ยท exact hfinS + ยท grind + +/-- The least finite support is itself a support. -/ +lemma supp_is_support {x : X} : PermSet.HasSupport ๐”ธ x (supp ๐”ธ x) := sorry + +end NominalSet + +/-- The set of atoms is a nominal set, where supp a = {a}. -/ +instance : NominalSet ๐”ธ ๐”ธ where finsupp := by intro a use {a} @@ -126,7 +128,10 @@ instance : Nominal ๐”ธ ๐”ธ where aesop ยท simp -instance discreteNominal (X : Type) : Nominal ๐”ธ X where +-- TODO: Prove supp a = {a} + +/-- Every set can be made into a discrete nominal set where every element has empty support. -/ +instance NominalSet.discrete (X : Type) : NominalSet ๐”ธ X where finsupp := by intro x use {} @@ -135,21 +140,12 @@ instance discreteNominal (X : Type) : Nominal ๐”ธ X where aesop ยท simp -instance : Nominal ๐”ธ Unit := discreteNominal ๐”ธ Unit -instance : Nominal ๐”ธ Bool := discreteNominal ๐”ธ Bool +-- TODO: Prove supp x = โˆ… -variable {X : Type} [nom : Nominal ๐”ธ X] +/-- We consider Unit a discrete nominal set. -/ +instance : NominalSet ๐”ธ Unit := NominalSet.discrete ๐”ธ Unit --- For every element x of a nominal set, there exists a least finite support, denoted "supp x". -noncomputable def supp (x : X) : Set ๐”ธ := - โ‹‚โ‚€ { S : Set ๐”ธ | HasSupport ๐”ธ x S } - --- The least finite support in a nominal set is always finite. -theorem supp_finite (x : X) : (supp ๐”ธ x).Finite := by - unfold supp - obtain โŸจS, โŸจhsuppS, hfinSโŸฉโŸฉ := nom.finsupp x - apply Set.Finite.subset - ยท exact hfinS - ยท grind +/-- We consider Bool a discrete nominal set. -/ +instance : NominalSet ๐”ธ Bool := NominalSet.discrete ๐”ธ Bool -end NominalSets +end NominalSet -- cgit v1.3.1