summaryrefslogtreecommitdiff
path: root/Nominal
diff options
context:
space:
mode:
Diffstat (limited to 'Nominal')
-rw-r--r--Nominal/Basic.lean75
1 files changed, 67 insertions, 8 deletions
diff --git a/Nominal/Basic.lean b/Nominal/Basic.lean
index eb10b44..2858516 100644
--- a/Nominal/Basic.lean
+++ b/Nominal/Basic.lean
@@ -1,5 +1,6 @@
import Mathlib.Tactic
import Nominal.Permutations
+import Nominal.Helpers.Finset
/-!
# Basic Definitions
@@ -18,20 +19,20 @@ 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. -/
+/-- The set of atoms itself forms a (FPerm ๐”ธ)-Set. -/
instance : PermSet ๐”ธ ๐”ธ where
smul ฯ€ a := ฯ€ a
one_smul := by aesop
mul_smul := by aesop
-/-- The set of finite permutations forms a G-Set. -/
+/-- The set of finite permutations forms a (FPerm ๐”ธ)-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
+def PermSet.discrete (X : Type) : PermSet ๐”ธ X where
smul ฯ€ x := x
one_smul := by aesop
mul_smul := by aesop
@@ -68,8 +69,12 @@ 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_iff {x : X} {S : Set ๐”ธ} : HasSupport ๐”ธ x S โ†” โˆ€ (ฯ€ : FPerm ๐”ธ), (โˆ€ x โˆˆ S, ฯ€ x = x) โ†’ ฯ€ โˆˆ fix' ๐”ธ x := by
+ constructor
+ ยท intro hsupp ฯ€ hฯ€
+ aesop
+ ยท intro hsupp ฯ€ hฯ€
+ aesop
lemma support_subset {x : X} {S T : Set ๐”ธ} : HasSupport ๐”ธ x S โ†’ S โІ T โ†’ HasSupport ๐”ธ x T := by
intro hS hsub ฯ€ hฯ€
@@ -80,6 +85,31 @@ lemma support_subset {x : X} {S T : Set ๐”ธ} : HasSupport ๐”ธ x S โ†’ S โІ T
lemma support_inter {x : X} {S T : Set ๐”ธ} : HasSupport ๐”ธ x S โ†’ S.Finite โ†’ HasSupport ๐”ธ x T โ†’ T.Finite โ†’ HasSupport ๐”ธ x (S โˆฉ T) := by
sorry
+lemma support_sInter {x : X} {C : Set (Set ๐”ธ)}: C.Finite โ†’ C.Nonempty โ†’ (โˆ€ S โˆˆ C, HasSupport ๐”ธ x S โˆง S.Finite) โ†’ HasSupport ๐”ธ x (โ‹‚โ‚€ C) := by
+ suffices (C : Finset (Set ๐”ธ)) : C.Nonempty โ†’ (โˆ€ S โˆˆ C, HasSupport ๐”ธ x S โˆง S.Finite) โ†’ HasSupport ๐”ธ x (โ‹‚โ‚€ C.toSet) โˆง (โ‹‚โ‚€ C.toSet).Finite
+ ยท intro hfin
+ rw [show C = hfin.toFinset.toSet by simp]
+ intro hne h
+ exact (this hfin.toFinset hne h).left
+ ยท have : DecidableEq (Set ๐”ธ) := Classical.typeDecidableEq (Set ๐”ธ)
+ apply Finset.Nonempty.induction
+ ยท intro S hS
+ rw [show โ‹‚โ‚€ ({S} : Finset (Set ๐”ธ)).toSet = S by simp]
+ apply hS
+ simp
+ ยท intro S C' hS hC' hsing
+ rw [show (โ‹‚โ‚€ (insert S C' : Finset (Set ๐”ธ))) = S โˆฉ (โ‹‚โ‚€ C') by aesop]
+ have hother : (โˆ€ S โˆˆ C', HasSupport ๐”ธ x S โˆง S.Finite) := by
+ intro S' hS'
+ apply hsing
+ exact Finset.mem_insert_of_mem hS'
+ specialize hC' hother
+ specialize hsing S (by simp)
+ constructor
+ ยท apply support_inter ๐”ธ hsing.left hsing.right hC'.left hC'.right
+ ยท apply Set.Finite.inter_of_left
+ exact hsing.right
+
end PermSet
end Support
@@ -103,7 +133,7 @@ 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 }
+ โ‹‚โ‚€ { S : Set ๐”ธ | PermSet.HasSupport ๐”ธ x S โˆง S.Finite }
/-- The least finite support in a nominal set is always finite. -/
lemma supp_finite {x : X} : (supp ๐”ธ x).Finite := by
@@ -114,7 +144,34 @@ lemma supp_finite {x : X} : (supp ๐”ธ x).Finite := by
ยท grind
/-- The least finite support is itself a support. -/
-lemma supp_is_support {x : X} : PermSet.HasSupport ๐”ธ x (supp ๐”ธ x) := sorry
+lemma supp_is_support {x : X} : PermSet.HasSupport ๐”ธ x (supp ๐”ธ x) := by
+ obtain โŸจS, โŸจhsuppS, hfinSโŸฉโŸฉ := nom.finsupp x
+ have suppf : (supp ๐”ธ x = โ‹‚โ‚€ { T : Set ๐”ธ | T โІ S โˆง PermSet.HasSupport ๐”ธ x T โˆง T.Finite }) := by
+ unfold supp; ext a
+ constructor
+ ยท intro h T hT
+ apply h
+ exact hT.out.right
+ ยท intro h T hT
+ suffices : a โˆˆ S โˆฉ T
+ ยท apply Set.mem_of_mem_inter_right; assumption
+ ยท apply h
+ constructor
+ ยท exact Set.inter_subset_left
+ ยท constructor
+ ยท exact PermSet.support_inter ๐”ธ hsuppS hfinS hT.out.left hT.out.right
+ ยท apply Set.Finite.inter_of_left; assumption
+ rw [suppf]
+ apply PermSet.support_sInter
+ ยท apply Set.Finite.subset
+ ยท apply Set.Finite.powerset
+ exact hfinS
+ ยท intro T hT
+ exact hT.out.left
+ ยท use S
+ exact โŸจby rfl, โŸจhsuppS, hfinSโŸฉโŸฉ
+ ยท intro T hT
+ exact hT.right
end NominalSet
@@ -131,7 +188,8 @@ instance : NominalSet ๐”ธ ๐”ธ 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
+def NominalSet.discrete (X : Type) : NominalSet ๐”ธ X :=
+{ PermSet.discrete ๐”ธ X with
finsupp := by
intro x
use {}
@@ -139,6 +197,7 @@ instance NominalSet.discrete (X : Type) : NominalSet ๐”ธ X where
ยท intro ฯ€ hฯ€
aesop
ยท simp
+}
-- TODO: Prove supp x = โˆ