Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

refactor(group_theory/perm/basic): Redefine pow in terms of iterate #18077

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/dynamics/fixed_points/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ h.to_left_inverse e.left_inverse_symm

protected lemma perm_inv (h : is_fixed_pt e x) : is_fixed_pt ⇑(e⁻¹) x := h.equiv_symm

protected lemma perm_pow (h : is_fixed_pt e x) (n : ℕ) : is_fixed_pt ⇑(e ^ n) x :=
by { rw ←equiv.perm.iterate_eq_pow, exact h.iterate _ }
protected lemma perm_pow (h : is_fixed_pt e x) (n : ℕ) : is_fixed_pt ⇑(e ^ n) x := h.iterate _

protected lemma perm_zpow (h : is_fixed_pt e x) : ∀ n : ℤ, is_fixed_pt ⇑(e ^ n) x
| (int.of_nat n) := h.perm_pow _
Expand Down
21 changes: 12 additions & 9 deletions src/group_theory/perm/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ instance perm_group : group (perm α) :=
mul_assoc := λ f g h, (trans_assoc _ _ _).symm,
one_mul := trans_refl,
mul_one := refl_trans,
mul_left_inv := self_trans_symm }
mul_left_inv := self_trans_symm,
npow := λ n f, ⟨f^[n], f.symm^[n], f.left_inv.iterate _, f.right_inv.iterate _⟩,
YaelDillies marked this conversation as resolved.
Show resolved Hide resolved
npow_succ' := λ n f, coe_fn_injective $ function.iterate_succ' _ _,
zpow := λ n, match n with
| int.of_nat n := λ f, ⟨f^[n], f.symm^[n], f.left_inv.iterate _, f.right_inv.iterate _⟩
| int.neg_succ_of_nat n := λ f,
⟨f.symm^[n + 1], f^[n + 1], f.right_inv.iterate _, f.left_inv.iterate _⟩
end,
zpow_succ' := λ n f, coe_fn_injective $ function.iterate_succ' _ _ }

@[simp] lemma default_eq : (default : perm α) = 1 := rfl

Expand Down Expand Up @@ -67,9 +75,8 @@ lemma inv_def (f : perm α) : f⁻¹ = f.symm := rfl

@[simp, norm_cast] lemma coe_one : ⇑(1 : perm α) = id := rfl
@[simp, norm_cast] lemma coe_mul (f g : perm α) : ⇑(f * g) = f ∘ g := rfl

@[norm_cast] lemma coe_pow (f : perm α) (n : ℕ) : ⇑(f ^ n) = (f^[n]) :=
hom_coe_pow _ rfl (λ _ _, rfl) _ _
@[norm_cast] lemma coe_pow (f : perm α) (n : ℕ) : ⇑(f ^ n) = (f^[n]) := rfl
@[simp] lemma iterate_eq_pow (f : perm α) (n : ℕ) : (f^[n]) = ⇑(f ^ n) := rfl

lemma eq_inv_iff_eq {f : perm α} {x y : α} : x = f⁻¹ y ↔ f x = y := f.eq_symm_apply

Expand All @@ -79,10 +86,6 @@ lemma zpow_apply_comm {α : Type*} (σ : perm α) (m n : ℤ) {x : α} :
(σ ^ m) ((σ ^ n) x) = (σ ^ n) ((σ ^ m) x) :=
by rw [←equiv.perm.mul_apply, ←equiv.perm.mul_apply, zpow_mul_comm]

@[simp] lemma iterate_eq_pow (f : perm α) : ∀ n, f^[n] = ⇑(f ^ n)
| 0 := rfl
| (n + 1) := by { rw [function.iterate_succ, pow_add, iterate_eq_pow], refl }

/-! Lemmas about mixing `perm` with `equiv`. Because we have multiple ways to express
`equiv.refl`, `equiv.symm`, and `equiv.trans`, we want simp lemmas for every combination.
The assumption made here is that if you're using the group structure, you want to preserve it after
Expand Down Expand Up @@ -279,7 +282,7 @@ lemma subtype_perm_inv (f : perm α) (hf) :

private lemma pow_aux (hf : ∀ x, p x ↔ p (f x)) : ∀ {n : ℕ} x, p x ↔ p ((f ^ n) x)
| 0 x := iff.rfl
| (n + 1) x := (pow_aux _).trans (hf _)
| (n + 1) x := (hf _).trans (pow_aux _)

@[simp] lemma subtype_perm_pow (f : perm α) (n : ℕ) (hf) :
(f.subtype_perm hf : perm {x // p x}) ^ n = (f ^ n).subtype_perm (pow_aux hf) :=
Expand Down
1 change: 1 addition & 0 deletions src/group_theory/perm/cycle/basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1361,6 +1361,7 @@ begin
obtain ⟨n, rfl⟩ := hσ.exists_pow_eq (classical.some_spec hσ).1 (mem_support.1 hx),
apply eq.trans _ (congr rfl (congr rfl (congr rfl
(congr rfl (hσ.zpowers_equiv_support_symm_apply n).symm)))),
simp_rw [←mul_apply, ←pow_succ],
apply (congr rfl (congr rfl (congr rfl (hσ.zpowers_equiv_support_symm_apply (n + 1))))).trans _,
simp only [ne.def, is_cycle.zpowers_equiv_support_apply,
subtype.coe_mk, zpowers_equiv_zpowers_apply],
Expand Down
3 changes: 2 additions & 1 deletion src/group_theory/perm/cycle/type.lean
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,8 @@ begin
(λ s, by rw [hf2, add_tsub_cancel_of_le hp.out.one_lt.le, hf3])
(λ s, by rw [hf2, tsub_add_cancel_of_le hp.out.one_lt.le, hf3]),
have hσ : ∀ k v, (σ ^ k) v = f k v :=
λ k v, nat.rec (hf1 v).symm (λ k hk, eq.trans (by exact congr_arg σ hk) (hf2 k 1 v)) k,
λ k v, nat.rec (hf1 v).symm (λ k hk, by { rw [←coe_mul, ←pow_succ],
exact eq.trans (by exact congr_arg σ hk) (hf2 k 1 v)}) k,
replace hσ : σ ^ (p ^ 1) = 1 := perm.ext (λ v, by rw [pow_one, hσ, hf3, one_apply]),
let v₀ : vectors_prod_eq_one G p := ⟨vector.repeat 1 p, (list.prod_repeat 1 p).trans (one_pow p)⟩,
have hv₀ : σ v₀ = v₀ := subtype.ext (subtype.ext (list.rotate_repeat (1 : G) p 1)),
Expand Down