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

Commit 87c1820

Browse files
committed
feat(group_theory/perm/concrete_cycle): perms from cycle data structure (#8866)
Co-authored-by: Yakov Pechersky <pechersky@users.noreply.github.com>
1 parent f6c8aff commit 87c1820

File tree

1 file changed

+90
-2
lines changed

1 file changed

+90
-2
lines changed

src/group_theory/perm/concrete_cycle.lean

Lines changed: 90 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ import group_theory.perm.cycle_type
1111
1212
# Properties of cyclic permutations constructed from lists
1313
14-
## Main results
15-
1614
In the following, `{α : Type*} [fintype α] [decidable_eq α]`.
1715
16+
## Main definitions
17+
18+
* `cycle.form_perm`: the cyclic permutation created by looping over a `cycle α`
19+
20+
## Main results
21+
1822
* `list.is_cycle_form_perm`: a nontrivial list without duplicates, when interpreted as
1923
a permutation, is cyclic
2024
@@ -97,3 +101,87 @@ begin
97101
end
98102

99103
end list
104+
105+
namespace cycle
106+
107+
variables {α : Type*} [decidable_eq α] (s s' : cycle α)
108+
109+
/--
110+
A cycle `s : cycle α` , given `nodup s` can be interpreted as a `equiv.perm α`
111+
where each element in the list is permuted to the next one, defined as `form_perm`.
112+
-/
113+
def form_perm : Π (s : cycle α) (h : nodup s), equiv.perm α :=
114+
λ s, quot.hrec_on s (λ l h, form_perm l)
115+
(λ l₁ l₂ (h : l₁ ~r l₂),
116+
begin
117+
ext,
118+
{ exact h.nodup_iff },
119+
{ intros h₁ h₂ _,
120+
exact heq_of_eq (form_perm_eq_of_is_rotated h₁ h) }
121+
end)
122+
123+
@[simp] lemma form_perm_coe (l : list α) (hl : l.nodup) :
124+
form_perm (l : cycle α) hl = l.form_perm := rfl
125+
126+
lemma form_perm_subsingleton (s : cycle α) (h : subsingleton s) :
127+
form_perm s h.nodup = 1 :=
128+
begin
129+
induction s using quot.induction_on,
130+
simp only [form_perm_coe, mk_eq_coe],
131+
simp only [length_subsingleton_iff, length_coe, mk_eq_coe] at h,
132+
cases s with hd tl,
133+
{ simp },
134+
{ simp only [length_eq_zero, add_le_iff_nonpos_left, list.length, nonpos_iff_eq_zero] at h,
135+
simp [h] }
136+
end
137+
138+
lemma is_cycle_form_perm (s : cycle α) (h : nodup s) (hn : nontrivial s) :
139+
is_cycle (form_perm s h) :=
140+
begin
141+
induction s using quot.induction_on,
142+
exact list.is_cycle_form_perm h (length_nontrivial hn)
143+
end
144+
145+
lemma support_form_perm [fintype α] (s : cycle α) (h : nodup s) (hn : nontrivial s) :
146+
support (form_perm s h) = s.to_finset :=
147+
begin
148+
induction s using quot.induction_on,
149+
refine support_form_perm_of_nodup s h _,
150+
rintro _ rfl,
151+
simpa [nat.succ_le_succ_iff] using length_nontrivial hn
152+
end
153+
154+
lemma form_perm_eq_self_of_not_mem (s : cycle α) (h : nodup s) (x : α) (hx : x ∉ s) :
155+
form_perm s h x = x :=
156+
begin
157+
induction s using quot.induction_on,
158+
simpa using list.form_perm_eq_self_of_not_mem _ _ hx
159+
end
160+
161+
lemma form_perm_apply_mem_eq_next (s : cycle α) (h : nodup s) (x : α) (hx : x ∈ s) :
162+
form_perm s h x = next s h x hx :=
163+
begin
164+
induction s using quot.induction_on,
165+
simpa using list.form_perm_apply_mem_eq_next h _ _
166+
end
167+
168+
lemma form_perm_reverse (s : cycle α) (h : nodup s) :
169+
form_perm s.reverse (nodup_reverse_iff.mpr h) = (form_perm s h)⁻¹ :=
170+
begin
171+
induction s using quot.induction_on,
172+
simpa using form_perm_reverse _ h
173+
end
174+
175+
lemma form_perm_eq_form_perm_iff {α : Type*} [decidable_eq α]
176+
{s s' : cycle α} {hs : s.nodup} {hs' : s'.nodup} :
177+
s.form_perm hs = s'.form_perm hs' ↔ s = s' ∨ s.subsingleton ∧ s'.subsingleton :=
178+
begin
179+
rw [cycle.length_subsingleton_iff, cycle.length_subsingleton_iff],
180+
revert s s',
181+
intros s s',
182+
apply quotient.induction_on₂' s s',
183+
intros l l',
184+
simpa using form_perm_eq_form_perm_iff
185+
end
186+
187+
end cycle

0 commit comments

Comments
 (0)