Skip to content

Commit

Permalink
feat(group_theory/perm/sign): induced permutation on a subtype that i…
Browse files Browse the repository at this point in the history
…s a fintype (#5706)

If a permutation on a type maps a subtype into itself and the subtype is a fintype, then we get a permutation on the subtype. Similar to the subtype_perm definition in the same file.

Co-authored-by: paulvanwamelen <30371019+paulvanwamelen@users.noreply.github.com>
  • Loading branch information
paulvanwamelen and paulvanwamelen committed Feb 9, 2021
1 parent 342bccf commit 17448c6
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/group_theory/perm/basic.lean
Expand Up @@ -8,6 +8,7 @@ import algebra.group.basic
import algebra.group.hom
import algebra.group.pi
import algebra.group.prod

/-!
# The group of permutations (self-equivalences) of a type `α`
Expand Down Expand Up @@ -183,6 +184,9 @@ def subtype_perm (f : perm α) {p : α → Prop} (h : ∀ x, p x ↔ p (f x)) :
λ _, by simp only [perm.inv_apply_self, subtype.coe_eta, subtype.coe_mk],
λ _, by simp only [perm.apply_inv_self, subtype.coe_eta, subtype.coe_mk]⟩

@[simp] lemma subtype_perm_apply (f : perm α) {p : α → Prop} (h : ∀ x, p x ↔ p (f x))
(x : {x // p x}) : subtype_perm f h x = ⟨f x, (h _).1 x.2⟩ := rfl

@[simp] lemma subtype_perm_one (p : α → Prop) (h : ∀ x, p x ↔ p ((1 : perm α) x)) :
@subtype_perm α 1 p h = 1 :=
equiv.ext $ λ ⟨_, _⟩, rfl
Expand Down
44 changes: 44 additions & 0 deletions src/group_theory/perm/sign.lean
Expand Up @@ -41,6 +41,50 @@ def mod_swap [decidable_eq α] (i j : α) : setoid (perm α) :=
instance {α : Type*} [fintype α] [decidable_eq α] (i j : α) : decidable_rel (mod_swap i j).r :=
λ σ τ, or.decidable

lemma perm_inv_on_of_perm_on_finset {s : finset α} {f : perm α}
(h : ∀ x ∈ s, f x ∈ s) {y : α} (hy : y ∈ s) : f⁻¹ y ∈ s :=
begin
have h0 : ∀ y ∈ s, ∃ x (hx : x ∈ s), y = (λ i (hi : i ∈ s), f i) x hx :=
finset.surj_on_of_inj_on_of_card_le (λ x hx, (λ i hi, f i) x hx)
(λ a ha, h a ha) (λ a₁ a₂ ha₁ ha₂ heq, (equiv.apply_eq_iff_eq f).mp heq) rfl.ge,
obtain ⟨y2, hy2, heq⟩ := h0 y hy,
convert hy2,
rw heq,
simp only [inv_apply_self]
end

lemma perm_inv_maps_to_of_maps_to (f : perm α) {s : set α} [fintype s]
(h : set.maps_to f s s) : set.maps_to (f⁻¹ : _) s s :=
λ x hx, set.mem_to_finset.mp $
perm_inv_on_of_perm_on_finset
(λ a ha, set.mem_to_finset.mpr (h (set.mem_to_finset.mp ha)))
(set.mem_to_finset.mpr hx)

@[simp] lemma perm_inv_maps_to_iff_maps_to {f : perm α} {s : set α} [fintype s] :
set.maps_to (f⁻¹ : _) s s ↔ set.maps_to f s s :=
⟨perm_inv_maps_to_of_maps_to f⁻¹, perm_inv_maps_to_of_maps_to f⟩

lemma perm_inv_on_of_perm_on_fintype {f : perm α} {p : α → Prop} [fintype {x // p x}]
(h : ∀ x, p x → p (f x)) {x : α} (hx : p x) : p (f⁻¹ x) :=
begin
letI : fintype ↥(show set α, from p) := ‹fintype {x // p x}›,
exact perm_inv_maps_to_of_maps_to f h hx
end

/-- If the permutation `f` maps `{x // p x}` into itself, then this returns the permutation
on `{x // p x}` induced by `f`. Note that the `h` hypothesis is weaker than for
`equiv.perm.subtype_perm`. -/
abbreviation subtype_perm_of_fintype (f : perm α) {p : α → Prop} [fintype {x // p x}]
(h : ∀ x, p x → p (f x)) : perm {x // p x} :=
f.subtype_perm (λ x, ⟨h x, λ h₂, f.inv_apply_self x ▸ perm_inv_on_of_perm_on_fintype h h₂⟩)

@[simp] lemma subtype_perm_of_fintype_apply (f : perm α) {p : α → Prop} [fintype {x // p x}]
(h : ∀ x, p x → p (f x)) (x : {x // p x}) : subtype_perm_of_fintype f h x = ⟨f x, h x x.2⟩ := rfl

@[simp] lemma subtype_perm_of_fintype_one (p : α → Prop) [fintype {x // p x}]
(h : ∀ x, p x → p ((1 : perm α) x)) : @subtype_perm_of_fintype α 1 p _ h = 1 :=
equiv.ext $ λ ⟨_, _⟩, rfl

/-- Two permutations `f` and `g` are `disjoint` if their supports are disjoint, i.e.,
every element is fixed either by `f`, or by `g`. -/
def disjoint (f g : perm α) := ∀ x, f x = x ∨ g x = x
Expand Down

0 comments on commit 17448c6

Please sign in to comment.