@@ -16,30 +16,30 @@ public import Mathlib.GroupTheory.GroupAction.Basic
1616Combinations in a type are finite subsets of given cardinality.
1717This file provides some API for handling them, especially in the context of a group action.
1818
19- * `Nat.Combination α n` is the set of all `Finset α` with cardinality `n`.
19+ * `Set.powersetCard α n` is the set of all `Finset α` with cardinality `n`.
2020
21- * `Nat.Combination .card` proves that the `Nat.card`-cardinality
21+ * `Set.powersetCard .card` proves that the `Nat.card`-cardinality
2222 of this set is equal to `(Nat.card α).choose n`.
2323
24- * `Nat.Combination .subMulAction`:
25- When a group `G` acts on `α`, the `SubMulAction` of `G` on `n.Combination α `.
24+ * `Set.powersetCard .subMulAction`:
25+ When a group `G` acts on `α`, the `SubMulAction` of `G` on `Set.powersetCard α n `.
2626
27- This induces a `MulAction G (n.Combination α )` instance. Then:
27+ This induces a `MulAction G (Set.powersetCard α n )` instance. Then:
2828
29- * `EmbeddingToCombination.map`: the equivariant map from `Fin n ↪ α` to `n.Combination α `.
29+ * `EmbeddingToCombination.map`: the equivariant map from `Fin n ↪ α` to `Set.powersetCard α n `.
3030
31- * `Nat.Combination .isPretransitive_of_isMultiplyPretransitive`
31+ * `Set.powersetCard .isPretransitive_of_isMultiplyPretransitive`
3232 shows the pretransitivity of that action if the action of `G` on `α` is `n`-pretransitive.
3333
34- * `Nat.Combination .isPretransitive` shows that `Equiv.Perm α`
35- acts pretransitively on `n.Combination α `, for all `n`.
34+ * `Set.powersetCard .isPretransitive` shows that `Equiv.Perm α`
35+ acts pretransitively on `Set.powersetCard α n `, for all `n`.
3636
37- * `Nat.Combination .compl`: Given an equality `m + n = Fintype.card α`,
37+ * `Set.powersetCard .compl`: Given an equality `m + n = Fintype.card α`,
3838 the complement of an `n`-combination, as an `m`-combination.
3939This map is an equivariant map with respect to a group action on `α`.
4040
4141* `Nat.toCombination_one_equivariant`:
42- The obvious map from `α` to `1.Combination α `, as an equivariant map.
42+ The obvious map from `α` to `Set.powersetCard α 1 `, as an equivariant map.
4343
4444-/
4545
@@ -48,34 +48,34 @@ The obvious map from `α` to `1.Combination α`, as an equivariant map.
4848variable (G : Type *) [Group G] (α : Type *) [MulAction G α]
4949
5050/-- The type of combinations of `n` elements of a type `α` -/
51- def Nat.Combination (n : ℕ) := {s : Finset α | s.card = n}
51+ def Set.powersetCard (n : ℕ) := {s : Finset α | s.card = n}
5252
53- variable {α} {n : ℕ} {s t : n.Combination α }
53+ variable {α} {n : ℕ} {s t : Set.powersetCard α n }
5454
55- namespace Nat.Combination
55+ namespace Set.powersetCard
5656
5757open scoped Pointwise
5858
59- open MulAction Finset
59+ open MulAction Finset Set
6060
6161@[simp]
6262theorem mem_iff {s : Finset α} :
63- s ∈ n.Combination α ↔ s.card = n := by
64- rw [Combination , Set.mem_setOf_eq]
63+ s ∈ Set.powersetCard α n ↔ s.card = n := by
64+ rw [Set.powersetCard , Set.mem_setOf_eq]
6565
66- instance : SetLike (n.Combination α ) α := SetLike.instSubtype
66+ instance : SetLike (Set.powersetCard α n ) α := SetLike.instSubtype
6767
6868@[simp]
69- theorem coe_coe {s : n.Combination α } :
69+ theorem coe_coe {s : Set.powersetCard α n } :
7070 ((s : Finset α) : Set α) = s := rfl
7171
72- theorem mem_coe_iff {s : Nat.Combination α n} {a : α} : a ∈ (s : Finset α) ↔ a ∈ s := .rfl
72+ theorem mem_coe_iff {s : Set.powersetCard α n} {a : α} : a ∈ (s : Finset α) ↔ a ∈ s := .rfl
7373
7474theorem eq_iff_subset : s = t ↔ (s : Finset α) ⊆ (t : Finset α) := by
7575 rw [Finset.subset_iff_eq_of_card_le (t.prop.trans_le s.prop.ge), Subtype.ext_iff]
7676
7777theorem exists_mem_notMem (hn : 1 ≤ n) (hα : n < ENat.card α) {a b : α} (hab : a ≠ b) :
78- ∃ s : n.Combination α , a ∈ s ∧ b ∉ s := by
78+ ∃ s : Set.powersetCard α n , a ∈ s ∧ b ∉ s := by
7979 have ha' : n ≤ Set.encard {b}ᶜ := by
8080 rwa [← (Set.encard_add_encard_compl {b}).trans (Set.encard_univ α), Set.encard_singleton,
8181 add_comm, ENat.lt_add_one_iff' (ENat.coe_ne_top n)] at hα
@@ -87,26 +87,26 @@ theorem exists_mem_notMem (hn : 1 ≤ n) (hα : n < ENat.card α) {a b : α} (ha
8787 by simpa using has, by simpa using has'⟩
8888
8989variable (α n) in
90- /-- `Nat.Combination α n` as a `SubMulAction` of `Finset α`. -/
91- @ [to_additive /--`Nat.Combination α n` as a `SubAddAction` of `Finsetα`.-/ ]
90+ /-- `Set.powersetCard α n` as a `SubMulAction` of `Finset α`. -/
91+ @ [to_additive /--`Set.powersetCard α n` as a `SubAddAction` of `Finsetα`.-/ ]
9292def subMulAction [DecidableEq α] : SubMulAction G (Finset α) where
93- carrier := n.Combination α
93+ carrier := Set.powersetCard α n
9494 smul_mem' g s := (Finset.card_smul_finset g s).trans
9595
9696@[to_additive]
97- instance [DecidableEq α] : MulAction G (n.Combination α ) :=
97+ instance [DecidableEq α] : MulAction G (Set.powersetCard α n ) :=
9898 (subMulAction G α n).mulAction
9999
100100variable {G}
101101
102102@ [to_additive (attr := simp)]
103- theorem coe_smul [DecidableEq α] {n : ℕ} {g : G} {s : n.Combination α } :
104- ((g • s : n.Combination α ) : Finset α) = g • s :=
103+ theorem coe_smul [DecidableEq α] {n : ℕ} {g : G} {s : Set.powersetCard α n } :
104+ ((g • s : Set.powersetCard α n ) : Finset α) = g • s :=
105105 SubMulAction.val_smul (p := subMulAction G α n) g s
106106
107107theorem addAction_faithful {G : Type *} [AddGroup G] {α : Type *} [AddAction G α] {n : ℕ}
108108 [DecidableEq α] (hn : 1 ≤ n) (hα : n < ENat.card α) {g : G} :
109- AddAction.toPerm g = (1 : Equiv.Perm (n.Combination α ))
109+ AddAction.toPerm g = (1 : Equiv.Perm (Set.powersetCard α n ))
110110 ↔ AddAction.toPerm g = (1 : Equiv.Perm α) := by
111111 refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
112112 · contrapose h with h
@@ -123,11 +123,11 @@ theorem addAction_faithful {G : Type*} [AddGroup G] {α : Type*} [AddAction G α
123123 simp [Subtype.ext_iff, Finset.ext_iff, mem_vadd_finset, h]
124124
125125/-- If an additive group `G` acts faithfully on `α`,
126- then it acts faithfully on `n.Combination α `,
126+ then it acts faithfully on `Set.powersetCard α n `,
127127provided `1 ≤ n < ENat.card α`. -/
128128theorem faithfulVAdd {G : Type *} [AddGroup G] {α : Type *} [AddAction G α] {n : ℕ}
129129 [DecidableEq α] (hn : 1 ≤ n) (hα : n < ENat.card α) [FaithfulVAdd G α] :
130- FaithfulVAdd G (n.Combination α ) := by
130+ FaithfulVAdd G (Set.powersetCard α n ) := by
131131 rw [faithfulVAdd_iff]
132132 intro g hg
133133 apply AddAction.toPerm_injective (α := G) (β := α)
@@ -136,7 +136,7 @@ theorem faithfulVAdd {G : Type*} [AddGroup G] {α : Type*} [AddAction G α] {n :
136136
137137theorem mulAction_faithful {G : Type *} [Group G] {α : Type *} [MulAction G α] {n : ℕ}
138138 [DecidableEq α] (hn : 1 ≤ n) (hα : n < ENat.card α) {g : G} :
139- MulAction.toPerm g = (1 : Equiv.Perm (n.Combination α ))
139+ MulAction.toPerm g = (1 : Equiv.Perm (Set.powersetCard α n ))
140140 ↔ MulAction.toPerm g = (1 : Equiv.Perm α) := by
141141 refine ⟨fun h ↦ ?_, fun h ↦ ?_⟩
142142 · contrapose h with h
@@ -153,10 +153,10 @@ theorem mulAction_faithful {G : Type*} [Group G] {α : Type*} [MulAction G α] {
153153 simp [Subtype.ext_iff, Finset.ext_iff, mem_smul_finset, h]
154154
155155/-- If a group `G` acts faithfully on `α`,
156- then it acts faithfull on `n.Combination α `,
156+ then it acts faithfull on `Set.powersetCard α n `,
157157provided `1 ≤ n < ENat.card α`. -/
158158theorem faithfulSMul [DecidableEq α] (hn : 1 ≤ n) (hα : n < ENat.card α) [FaithfulSMul G α] :
159- FaithfulSMul G (n.Combination α ) := by
159+ FaithfulSMul G (Set.powersetCard α n ) := by
160160 rw [faithfulSMul_iff]
161161 intro g hg
162162 apply MulAction.toPerm_injective (α := G) (β := α)
@@ -172,7 +172,7 @@ variable (n) in
172172@ [to_additive /-- The equivariant map from embeddings of `Fin n`
173173 (aka arrangements) to combinations. -/ ]
174174def mulActionHom_of_embedding [DecidableEq α] :
175- (Fin n ↪ α) →[G] n.Combination α where
175+ (Fin n ↪ α) →[G] Set.powersetCard α n where
176176 toFun f := ⟨Finset.univ.map f, by rw [mem_iff, Finset.card_map, Finset.card_fin]⟩
177177 map_smul' g f := by
178178 rw [← Subtype.coe_inj, Subtype.coe_mk, coe_smul,
@@ -194,39 +194,39 @@ theorem mulActionHom_of_embedding_surjective [DecidableEq α] :
194194 exact ⟨f, Subtype.ext hf⟩
195195
196196protected theorem card :
197- Nat.card (n.Combination α ) = (Nat.card α).choose n := by
197+ Nat.card (powersetCard α n ) = (Nat.card α).choose n := by
198198 classical
199199 cases fintypeOrInfinite α
200- · suffices n.Combination α = Finset.powersetCard n (Finset.univ : Finset α) by
200+ · suffices powersetCard α n = Finset.powersetCard n (Finset.univ : Finset α) by
201201 simp [this]
202202 ext; simp
203203 · rcases n with _ | n
204- · simp [Combination ]
205- · rcases finite_or_infinite (Combination α (n + 1 )) with hc | hc
206- · refine (Infinite.false (α := (Combination α (n + 1 ) → Combination α (n + 1 ))) ?_).elim
207- have : FaithfulSMul (Equiv.Perm α) (Combination α (n + 1 )) :=
208- Nat.Combination. faithfulSMul (le_add_left 1 n) (by simp)
209- exact (Infinite.false (α := (Combination α (n + 1 ) → Combination α (n + 1 )))
204+ · simp [powersetCard ]
205+ · rcases finite_or_infinite (powersetCard α (n + 1 )) with hc | hc
206+ · refine (Infinite.false (α := (powersetCard α (n + 1 ) → powersetCard α (n + 1 ))) ?_).elim
207+ have : FaithfulSMul (Equiv.Perm α) (powersetCard α (n + 1 )) :=
208+ faithfulSMul (Nat. le_add_left 1 n) (by simp)
209+ exact (Infinite.false (α := (powersetCard α (n + 1 ) → powersetCard α (n + 1 )))
210210 (Infinite.of_injective _ (smul_left_injective' (M := Equiv.Perm α)))).elim
211211 · simp
212212
213213variable {α} in
214- /-- If `0 < n < ENat.card α`, then `n.Combination α ` is nontrivial. -/
214+ /-- If `0 < n < ENat.card α`, then `Set.powersetCard α n ` is nontrivial. -/
215215theorem nontrivial (h1 : 0 < n) (h2 : n < ENat.card α) :
216- Nontrivial (n.Combination α ) := by
216+ Nontrivial (Set.powersetCard α n ) := by
217217 classical
218218 have h : Nontrivial α :=
219- (ENat.one_lt_card_iff_nontrivial α).mp (lt_of_le_of_lt (one_le_cast.mpr h1) h2)
220- have : FaithfulSMul (Equiv.Perm α) (Combination α n) := Nat.Combination. faithfulSMul h1 h2
221- have h := (smul_left_injective' (M := Equiv.Perm α) (α := Combination α n)).nontrivial
219+ (ENat.one_lt_card_iff_nontrivial α).mp (lt_of_le_of_lt (Nat. one_le_cast.mpr h1) h2)
220+ have : FaithfulSMul (Equiv.Perm α) (powersetCard α n) := faithfulSMul h1 h2
221+ have h := (smul_left_injective' (M := Equiv.Perm α) (α := Set.powersetCard α n)).nontrivial
222222 contrapose! h
223223 infer_instance
224224
225225variable {α} in
226- /-- A variant of `Nat.Combination .nontrivial` that uses `Nat.card`. -/
226+ /-- A variant of `Set.powersetCard .nontrivial` that uses `Nat.card`. -/
227227theorem nontrivial' (h1 : 0 < n) (h2 : n < Nat.card α) :
228- Nontrivial (n.Combination α ) := by
229- have : Finite α := finite_of_card_ne_zero (ne_zero_of_lt h2)
228+ Nontrivial (Set.powersetCard α n ) := by
229+ have : Finite α := Nat. finite_of_card_ne_zero (ne_zero_of_lt h2)
230230 apply nontrivial h1
231231 simp [ENat.card_eq_coe_natCard α, h2]
232232
@@ -236,10 +236,10 @@ variable [DecidableEq α]
236236
237237@ [to_additive isPretransitive_of_isMultiplyPretransitive']
238238theorem isPretransitive_of_isMultiplyPretransitive (h : IsMultiplyPretransitive G α n) :
239- IsPretransitive G (n.Combination α ) :=
239+ IsPretransitive G (Set.powersetCard α n ) :=
240240 IsPretransitive.of_surjective_map (mulActionHom_of_embedding_surjective G α) h
241241
242- theorem isPretransitive : IsPretransitive (Equiv.Perm α) (n.Combination α ) :=
242+ theorem isPretransitive : IsPretransitive (Equiv.Perm α) (Set.powersetCard α n ) :=
243243 isPretransitive_of_isMultiplyPretransitive _ _
244244 (Equiv.Perm.isMultiplyPretransitive α n)
245245
@@ -251,20 +251,20 @@ variable [DecidableEq α] [Fintype α] {m : ℕ} (hm : m + n = Fintype.card α)
251251include hm
252252
253253/-- The complement of a combination, as an equivariant map. -/
254- def compl : n.Combination α →[G] m.Combination α where
254+ def compl : Set.powersetCard α n →[G] Set.powersetCard α m where
255255 toFun s := ⟨(sᶜ : Finset α), by
256256 rw [mem_iff, Finset.card_compl]
257257 have := mem_iff.mp s.2
258258 omega⟩
259259 map_smul' g s := by ext; simp [← Finset.inv_smul_mem_iff]
260260
261261variable {hm} in
262- theorem coe_compl {s : n.Combination α } :
262+ theorem coe_compl {s : Set.powersetCard α n } :
263263 (compl G α hm s : Finset α) = (s : Finset α)ᶜ :=
264264 rfl
265265
266266variable {hm} in
267- theorem mem_compl {s : n.Combination α } {a : α} :
267+ theorem mem_compl {s : Set.powersetCard α n } {a : α} :
268268 a ∈ compl G α hm s ↔ a ∉ s :=
269269 Finset.mem_compl
270270
284284/-- The obvious map from a type to its 1-combinations, as an equivariant map. -/
285285@ [to_additive /-- The obvious map from a type to its 1-combinations, as an equivariant map. -/ ]
286286def mulActionHom_singleton [DecidableEq α] :
287- α →[G] Nat.Combination α 1 where
287+ α →[G] Set.powersetCard α 1 where
288288 toFun x := ⟨{x}, Finset.card_singleton x⟩
289289 map_smul' _ _ := rfl
290290
@@ -295,4 +295,4 @@ theorem mulActionHom_singleton_bijective [DecidableEq α] :
295295 obtain ⟨a, rfl⟩ := Finset.card_eq_one.mp hs
296296 exact ⟨a, rfl⟩
297297
298- end Nat.Combination
298+ end Set.powersetCard
0 commit comments