1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
|
import Mathlib.Tactic
import Nominal.Permutations
import Nominal.Helpers.Finset
/-!
# 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 (FPerm ๐ธ)-Set. -/
instance : PermSet ๐ธ ๐ธ where
smul ฯ a := ฯ a
one_smul := by intro; rfl
mul_smul := by intro _ _ _; rfl
/-- The set of finite permutations forms a (FPerm ๐ธ)-Set. -/
instance : PermSet ๐ธ (FPerm ๐ธ) where
smul ฯ ฯ := ฯ * ฯ
one_smul := by intro; rfl
mul_smul := by intro _ _ _; rfl
/-- A discrete (FPerm ๐ธ)-Set where permutations do not change anything. -/
def PermSet.discrete (X : Type) : PermSet ๐ธ X where
smul ฯ x := x
one_smul := by intro; rfl
mul_smul := by intro _ _ _; rfl
/-- 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 โ โ (ฯ : 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ฯ
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
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
/-!
## 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 โง S.Finite }
/-- 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) := 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
/-- 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. -/
def NominalSet.discrete (X : Type) : NominalSet ๐ธ X :=
{ PermSet.discrete ๐ธ X with
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
|