import Mathlib.Tactic import Nominal.Permutations /-! # Basic Definitions This file provides basic definitions for nominal sets. -/ /-! ## (FPerm ๐”ธ)-Sets Sets equipped with a permutation operation. -/ section PermSet variable (๐”ธ : Type) [Infinite ๐”ธ] [Countable ๐”ธ] [DecidableEq ๐”ธ] /-- A set X equipped with a group action โ€ข: (FPerm ๐”ธ) ร— X โ†’ X. -/ class PermSet (X : Type) extends MulAction (FPerm ๐”ธ) X /-- The set of atoms itself forms a G-Set. -/ instance : PermSet ๐”ธ ๐”ธ where smul ฯ€ a := ฯ€ a one_smul := by aesop mul_smul := by aesop /-- 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 /-- 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 (๐”ธ : Type) {X : Type} [PermSet ๐”ธ X] 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. -/ 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. -/ def HasSupport (x : X) (S : Set ๐”ธ) : Prop := fix ๐”ธ S โІ fix' ๐”ธ x @[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 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 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] /-- 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} constructor ยท intro ฯ€ hฯ€ aesop ยท simp -- 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 {} constructor ยท intro ฯ€ hฯ€ aesop ยท simp -- TODO: Prove supp x = โˆ… /-- We consider Unit a discrete nominal set. -/ instance : NominalSet ๐”ธ Unit := NominalSet.discrete ๐”ธ Unit /-- We consider Bool a discrete nominal set. -/ instance : NominalSet ๐”ธ Bool := NominalSet.discrete ๐”ธ Bool end NominalSet