summaryrefslogtreecommitdiff
path: root/Nominal/Basic.lean
diff options
context:
space:
mode:
Diffstat (limited to 'Nominal/Basic.lean')
-rw-r--r--Nominal/Basic.lean202
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