diff options
Diffstat (limited to 'Nominal/Basic.lean')
| -rw-r--r-- | Nominal/Basic.lean | 202 |
1 files changed, 99 insertions, 103 deletions
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 +Sets equipped with a permutation operation. +-/ +section PermSet --- 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} +variable (๐ธ : Type) [Infinite ๐ธ] [Countable ๐ธ] [DecidableEq ๐ธ] -@[simp] -theorem mem_support (ฯ : Equiv.Perm X) (x : X) : x โ ฯ.supp โ ฯ x โ x := by - simp [Equiv.Perm.supp] +/-- A set X equipped with a group action โข: (FPerm ๐ธ) ร X โ X. -/ +class PermSet (X : Type) extends MulAction (FPerm ๐ธ) X --- 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 set of atoms itself forms a G-Set. -/ +instance : PermSet ๐ธ ๐ธ where + smul ฯ a := ฯ a + one_smul := by aesop + mul_smul := by aesop --- 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 set of finite permutations forms a G-Set. -/ +instance : PermSet ๐ธ (FPerm ๐ธ) where + smul ฯ ฯ := ฯ * ฯ + one_smul := by aesop + mul_smul := by aesop --- 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 +/-- 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 -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] +/-- We consider Unit a discrete (FPerm ๐ธ)-Set. -/ +instance : PermSet ๐ธ Unit := PermSet.discrete ๐ธ Unit --- 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 +/-- We consider Bool a discrete (FPerm ๐ธ)-Set. -/ +instance : PermSet ๐ธ Bool := PermSet.discrete ๐ธ Bool -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] +end PermSet -lemma supp_mul_finite {ฯ ฯ : Equiv.Perm X} (hฯ : ฯ โ FPerm X) (hฯ : ฯ โ FPerm X) : (ฯ * ฯ) โ FPerm X := - (FPerm X).mul_mem hฯ hฯ +/-! +## Support Definitions -lemma supp_inv_finite {ฯ : Equiv.Perm X} (hฯ : ฯ โ FPerm X) : ฯโปยน โ FPerm X := - (FPerm X).inv_mem hฯ +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 --- Since FPerm is a subgroup of Perm, it is also a group. -instance (X : Type) : Group (FPerm X) := - Subgroup.toGroup (FPerm X) +variable (๐ธ : Type) {X : Type} [PermSet ๐ธ 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) +namespace PermSet -example : FPerm โ := โจโธจ1, 2โธฉ * โธจ3, 4โธฉ * โธจ2, 3โธฉ, by simp [supp_swap_finite, supp_mul_finite]โฉ +/-- The permutations that leave an element x unchanged. -/ +def fix' (x : X) : Set (FPerm ๐ธ) := + { ฯ : FPerm ๐ธ | ฯ โข x = x } -end Permutations +/-- The permutations that leave all elements in A unchanged. -/ +def fix (A : Set X) : Set (FPerm ๐ธ) := + { ฯ : FPerm ๐ธ | โ x โ A, ฯ โข x = x } -section GSets +/-- 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 -variable (๐ธ : Type) [Infinite ๐ธ] [Countable ๐ธ] [DecidableEq ๐ธ] +@[simp] +lemma support_iff {x : X} {S : Set ๐ธ} : HasSupport ๐ธ x S โ fix ๐ธ S โ fix' ๐ธ x := by + rfl --- A G-set is a set X equipped with a group action โข: (FPerm ๐ธ) ร X โ X. -class GSet (X : Type) extends MulAction (FPerm ๐ธ) X +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 -instance : GSet ๐ธ ๐ธ where - smul ฯ a := ฯ a - one_smul := by aesop - mul_smul := by 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 -instance discreteGSet (X : Type) : GSet ๐ธ X where - smul ฯ x := x - one_smul := by aesop - mul_smul := by aesop +end PermSet -instance : GSet ๐ธ Unit := discreteGSet ๐ธ Unit -instance : GSet ๐ธ Bool := discreteGSet ๐ธ Bool +end Support -variable {X : Type} [GSet ๐ธ X] +/-! +## Basic Nominal Set Definition --- The permutations that leave an element x unchanged. -def fix' (x : X) : Set (FPerm ๐ธ) := - { ฯ : FPerm ๐ธ | ฯ โข x = x } +Nominal sets are then just G-Sets where all elements are finitely supported. +-/ +section NominalSet --- The permutations that leave all elements in A unchanged. -def fix (A : Set X) : Set (FPerm ๐ธ) := - { ฯ : FPerm ๐ธ | โ x โ A, ฯ โข x = x } +variable (๐ธ : Type) --- 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 +/-- 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 -end GSets +namespace NominalSet -section NominalSets +variable {X : Type} [nom : NominalSet ๐ธ X] -variable (๐ธ : Type) +/-- 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 --- 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 +/-- The least finite support is itself a support. -/ +lemma supp_is_support {x : X} : PermSet.HasSupport ๐ธ x (supp ๐ธ x) := sorry -instance : Nominal ๐ธ ๐ธ where +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 - -variable {X : Type} [nom : Nominal ๐ธ X] +-- TODO: Prove supp x = โ
--- 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 } +/-- We consider Unit a discrete nominal set. -/ +instance : NominalSet ๐ธ Unit := NominalSet.discrete ๐ธ Unit --- 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 |
