group_theory.perm.list
⟷
Mathlib.GroupTheory.Perm.List
The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(no changes)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -386,7 +386,9 @@ theorem formPerm_pow_apply_nthLe (l : List α) (h : Nodup l) (n k : ℕ) (hk : k
by
induction' n with n hn
· simp [Nat.mod_eq_of_lt hk]
- · simp [pow_succ, mul_apply, hn, form_perm_apply_nth_le _ h, Nat.succ_eq_add_one, ← Nat.add_assoc]
+ ·
+ simp [pow_succ', mul_apply, hn, form_perm_apply_nth_le _ h, Nat.succ_eq_add_one, ←
+ Nat.add_assoc]
#align list.form_perm_pow_apply_nth_le List.formPerm_pow_apply_nthLe
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -91,7 +91,7 @@ theorem formPerm_apply_of_not_mem (x : α) (l : List α) (h : x ∉ l) : formPer
induction' l with z l IH generalizing x y
· simp
· specialize IH x z (mt (mem_cons_of_mem y) h)
- simp only [not_or, mem_cons_iff] at h
+ simp only [not_or, mem_cons_iff] at h
simp [IH, swap_apply_of_ne_of_ne, h]
#align list.form_perm_apply_of_not_mem List.formPerm_apply_of_not_mem
-/
@@ -125,14 +125,14 @@ theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l
induction' l with z l IH generalizing x y
· simpa using h
· by_cases hx : (z :: l).formPerm x ∈ z :: l
- · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
- split_ifs at h <;> simp [IH _ _ hx]
+ · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
+ split_ifs at h <;> simp [IH _ _ hx]
· replace hx :=
(Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
- List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
+ List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
simp only [List.mem_cons]
- obtain h | h | h := h <;> · split_ifs at h <;> cc
+ obtain h | h | h := h <;> · split_ifs at h <;> cc
#align list.mem_of_form_perm_apply_mem List.mem_of_formPerm_apply_mem
-/
@@ -214,9 +214,9 @@ theorem zipWith_swap_prod_support' (l l' : List α) :
· simp only [Finset.coe_insert, Set.mem_insert_iff, Finset.mem_coe, to_finset_cons,
mem_to_finset] at hm ⊢
simp [hm]
- · simp only [Classical.not_not, Set.mem_setOf_eq] at h
- simp only [h, Set.mem_setOf_eq] at hx
- rw [swap_apply_ne_self_iff] at hx
+ · simp only [Classical.not_not, Set.mem_setOf_eq] at h
+ simp only [h, Set.mem_setOf_eq] at hx
+ rw [swap_apply_ne_self_iff] at hx
rcases hx with ⟨hyz, rfl | rfl⟩ <;> simp
#align list.zip_with_swap_prod_support' List.zipWith_swap_prod_support'
-/
@@ -260,7 +260,7 @@ theorem formPerm_apply_lt (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n + 1 <
· specialize IH (y :: l) h.of_cons _
· simpa [Nat.succ_lt_succ_iff] using hn
simp only [swap_apply_eq_iff, coe_mul, form_perm_cons_cons, nth_le]
- generalize_proofs at IH
+ generalize_proofs at IH
rw [IH, swap_apply_of_ne_of_ne, nth_le] <;>
· rintro rfl
simpa [nth_le_mem _ _ _] using h
@@ -290,14 +290,14 @@ theorem support_formPerm_of_nodup' (l : List α) (h : Nodup l) (h' : ∀ x : α,
apply le_antisymm
· exact support_form_perm_le' l
· intro x hx
- simp only [Finset.mem_coe, mem_to_finset] at hx
+ simp only [Finset.mem_coe, mem_to_finset] at hx
obtain ⟨n, hn, rfl⟩ := nth_le_of_mem hx
rw [Set.mem_setOf_eq, form_perm_apply_nth_le _ h]
intro H
- rw [nodup_iff_nth_le_inj] at h
+ rw [nodup_iff_nth_le_inj] at h
specialize h _ _ _ _ H
cases' (Nat.succ_le_of_lt hn).eq_or_lt with hn' hn'
- · simp only [← hn', Nat.mod_self] at h
+ · simp only [← hn', Nat.mod_self] at h
refine' not_exists.mpr h' _
simpa [← h, eq_comm, length_eq_one] using hn'
· simpa [Nat.mod_eq_of_lt hn'] using h
@@ -363,7 +363,7 @@ theorem formPerm_reverse (l : List α) (h : Nodup l) : formPerm l.reverse = (for
rw [form_perm_apply_nth_le l.reverse (nodup_reverse.mpr h), nth_le_reverse',
form_perm_apply_nth_le _ h, nth_le_reverse']
· congr
- rw [length_reverse, ← Nat.succ_le_iff, Nat.succ_eq_add_one] at hk
+ rw [length_reverse, ← Nat.succ_le_iff, Nat.succ_eq_add_one] at hk
cases' hk.eq_or_lt with hk' hk'
· simp [← hk']
· rw [length_reverse, Nat.mod_eq_of_lt hk', tsub_add_eq_add_tsub (Nat.le_pred_of_lt hk'),
@@ -404,14 +404,14 @@ theorem formPerm_ext_iff {x y x' y' : α} {l l' : List α} (hd : Nodup (x :: y :
formPerm (x :: y :: l) = formPerm (x' :: y' :: l') ↔ (x :: y :: l) ~r (x' :: y' :: l') :=
by
refine' ⟨fun h => _, fun hr => form_perm_eq_of_is_rotated hd hr⟩
- rw [Equiv.Perm.ext_iff] at h
+ rw [Equiv.Perm.ext_iff] at h
have hx : x' ∈ x :: y :: l :=
by
have : x' ∈ {z | form_perm (x :: y :: l) z ≠ z} :=
by
rw [Set.mem_setOf_eq, h x', form_perm_apply_head _ _ _ hd']
- simp only [mem_cons_iff, nodup_cons] at hd'
- push_neg at hd'
+ simp only [mem_cons_iff, nodup_cons] at hd'
+ push_neg at hd'
exact hd'.left.left.symm
simpa using support_form_perm_le' _ this
obtain ⟨n, hn, hx'⟩ := nth_le_of_mem hx
@@ -449,7 +449,7 @@ theorem formPerm_apply_mem_eq_self_iff (hl : Nodup l) (x : α) (hx : x ∈ l) :
rw [form_perm_apply_nth_le _ hl, hl.nth_le_inj_iff]
cases hn : l.length
· exact absurd k.zero_le (hk.trans_le hn.le).not_le
- · rw [hn] at hk
+ · rw [hn] at hk
cases' (Nat.le_of_lt_succ hk).eq_or_lt with hk' hk'
· simp [← hk', Nat.succ_le_succ_iff, eq_comm]
·
@@ -493,7 +493,7 @@ theorem formPerm_eq_one_iff (hl : Nodup l) : formPerm l = 1 ↔ l.length ≤ 1 :
· simp (config := { contextual := true })
· intro h
simp only [(hd :: tl).formPerm_apply_mem_eq_self_iff hl hd (mem_cons_self hd tl),
- add_le_iff_nonpos_left, length, nonpos_iff_eq_zero, length_eq_zero] at h
+ add_le_iff_nonpos_left, length, nonpos_iff_eq_zero, length_eq_zero] at h
simp [h]
#align list.form_perm_eq_one_iff List.formPerm_eq_one_iff
-/
@@ -530,7 +530,7 @@ theorem form_perm_zpow_apply_mem_imp_mem (l : List α) (x : α) (hx : x ∈ l) (
by_cases h : (l.form_perm ^ n) x = x
· simpa [h] using hx
· have : x ∈ {x | (l.form_perm ^ n) x ≠ x} := h
- rw [← set_support_apply_mem] at this
+ rw [← set_support_apply_mem] at this
replace this := set_support_zpow_subset _ _ this
simpa using support_form_perm_le' _ this
#align list.form_perm_zpow_apply_mem_imp_mem List.form_perm_zpow_apply_mem_imp_mem
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,8 +3,8 @@ Copyright (c) 2021 Yakov Pechersky. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yakov Pechersky
-/
-import Mathbin.Data.List.Rotate
-import Mathbin.GroupTheory.Perm.Support
+import Data.List.Rotate
+import GroupTheory.Perm.Support
#align_import group_theory.perm.list from "leanprover-community/mathlib"@"fac369018417f980cec5fcdafc766a69f88d8cfe"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,15 +2,12 @@
Copyright (c) 2021 Yakov Pechersky. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yakov Pechersky
-
-! This file was ported from Lean 3 source module group_theory.perm.list
-! leanprover-community/mathlib commit fac369018417f980cec5fcdafc766a69f88d8cfe
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Data.List.Rotate
import Mathbin.GroupTheory.Perm.Support
+#align_import group_theory.perm.list from "leanprover-community/mathlib"@"fac369018417f980cec5fcdafc766a69f88d8cfe"
+
/-!
# Permutations from a list
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -56,21 +56,27 @@ def formPerm : Equiv.Perm α :=
#align list.form_perm List.formPerm
-/
+#print List.formPerm_nil /-
@[simp]
theorem formPerm_nil : formPerm ([] : List α) = 1 :=
rfl
#align list.form_perm_nil List.formPerm_nil
+-/
+#print List.formPerm_singleton /-
@[simp]
theorem formPerm_singleton (x : α) : formPerm [x] = 1 :=
rfl
#align list.form_perm_singleton List.formPerm_singleton
+-/
+#print List.formPerm_cons_cons /-
@[simp]
theorem formPerm_cons_cons (x y : α) (l : List α) :
formPerm (x :: y :: l) = swap x y * formPerm (y :: l) :=
prod_cons
#align list.form_perm_cons_cons List.formPerm_cons_cons
+-/
#print List.formPerm_pair /-
theorem formPerm_pair (x y : α) : formPerm [x, y] = swap x y :=
@@ -218,6 +224,7 @@ theorem zipWith_swap_prod_support' (l l' : List α) :
#align list.zip_with_swap_prod_support' List.zipWith_swap_prod_support'
-/
+#print List.zipWith_swap_prod_support /-
theorem zipWith_swap_prod_support [Fintype α] (l l' : List α) :
(zipWith swap l l').Prod.support ≤ l.toFinset ⊔ l'.toFinset :=
by
@@ -225,6 +232,7 @@ theorem zipWith_swap_prod_support [Fintype α] (l l' : List α) :
have hx' : x ∈ {x | (zip_with swap l l').Prod x ≠ x} := by simpa using hx
simpa using zip_with_swap_prod_support' _ _ hx'
#align list.zip_with_swap_prod_support List.zipWith_swap_prod_support
+-/
#print List.support_formPerm_le' /-
theorem support_formPerm_le' : {x | formPerm l x ≠ x} ≤ l.toFinset :=
@@ -342,6 +350,7 @@ theorem formPerm_eq_of_isRotated {l l' : List α} (hd : Nodup l) (h : l ~r l') :
#align list.form_perm_eq_of_is_rotated List.formPerm_eq_of_isRotated
-/
+#print List.formPerm_reverse /-
theorem formPerm_reverse (l : List α) (h : Nodup l) : formPerm l.reverse = (formPerm l)⁻¹ :=
by
-- Let's show `form_perm l` is an inverse to `form_perm l.reverse`.
@@ -371,6 +380,7 @@ theorem formPerm_reverse (l : List α) (h : Nodup l) : formPerm l.reverse = (for
refine' tsub_lt_self _ (zero_lt_one.trans_le (le_add_right le_rfl))
exact k.zero_le.trans_lt hk
#align list.form_perm_reverse List.formPerm_reverse
+-/
#print List.formPerm_pow_apply_nthLe /-
theorem formPerm_pow_apply_nthLe (l : List α) (h : Nodup l) (n k : ℕ) (hk : k < l.length) :
@@ -476,6 +486,7 @@ theorem formPerm_eq_self_of_not_mem (l : List α) (x : α) (h : x ∉ l) : formP
#align list.form_perm_eq_self_of_not_mem List.formPerm_eq_self_of_not_mem
-/
+#print List.formPerm_eq_one_iff /-
theorem formPerm_eq_one_iff (hl : Nodup l) : formPerm l = 1 ↔ l.length ≤ 1 :=
by
cases' l with hd tl
@@ -488,6 +499,7 @@ theorem formPerm_eq_one_iff (hl : Nodup l) : formPerm l = 1 ↔ l.length ≤ 1 :
add_le_iff_nonpos_left, length, nonpos_iff_eq_zero, length_eq_zero] at h
simp [h]
#align list.form_perm_eq_one_iff List.formPerm_eq_one_iff
+-/
#print List.formPerm_eq_formPerm_iff /-
theorem formPerm_eq_formPerm_iff {l l' : List α} (hl : l.Nodup) (hl' : l'.Nodup) :
@@ -527,6 +539,7 @@ theorem form_perm_zpow_apply_mem_imp_mem (l : List α) (x : α) (hx : x ∈ l) (
#align list.form_perm_zpow_apply_mem_imp_mem List.form_perm_zpow_apply_mem_imp_mem
-/
+#print List.formPerm_pow_length_eq_one_of_nodup /-
theorem formPerm_pow_length_eq_one_of_nodup (hl : Nodup l) : formPerm l ^ length l = 1 :=
by
ext x
@@ -541,6 +554,7 @@ theorem formPerm_pow_length_eq_one_of_nodup (hl : Nodup l) : formPerm l ^ length
simpa using support_form_perm_le' _ H
simpa
#align list.form_perm_pow_length_eq_one_of_nodup List.formPerm_pow_length_eq_one_of_nodup
+-/
end FormPerm
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -123,13 +123,13 @@ theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l
· simpa using h
· by_cases hx : (z :: l).formPerm x ∈ z :: l
· rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
- split_ifs at h <;> simp [IH _ _ hx]
+ split_ifs at h <;> simp [IH _ _ hx]
· replace hx :=
(Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
simp only [List.mem_cons]
- obtain h | h | h := h <;> · split_ifs at h <;> cc
+ obtain h | h | h := h <;> · split_ifs at h <;> cc
#align list.mem_of_form_perm_apply_mem List.mem_of_formPerm_apply_mem
-/
@@ -194,7 +194,7 @@ theorem formPerm_eq_head_iff_eq_getLast (x y : α) :
#print List.zipWith_swap_prod_support' /-
theorem zipWith_swap_prod_support' (l l' : List α) :
- { x | (zipWith swap l l').Prod x ≠ x } ≤ l.toFinset ⊔ l'.toFinset :=
+ {x | (zipWith swap l l').Prod x ≠ x} ≤ l.toFinset ⊔ l'.toFinset :=
by
simp only [Set.sup_eq_union, Set.le_eq_subset]
induction' l with y l hl generalizing l'
@@ -205,7 +205,7 @@ theorem zipWith_swap_prod_support' (l l' : List α) :
simp only [Set.union_subset_iff, mem_cons_iff, zip_with_cons_cons, foldr, prod_cons,
mul_apply]
intro hx
- by_cases h : x ∈ { x | (zip_with swap l l').Prod x ≠ x }
+ by_cases h : x ∈ {x | (zip_with swap l l').Prod x ≠ x}
· specialize hl l' h
refine' Set.MemUnion.elim hl (fun hm => _) fun hm => _ <;>
· simp only [Finset.coe_insert, Set.mem_insert_iff, Finset.mem_coe, to_finset_cons,
@@ -222,12 +222,12 @@ theorem zipWith_swap_prod_support [Fintype α] (l l' : List α) :
(zipWith swap l l').Prod.support ≤ l.toFinset ⊔ l'.toFinset :=
by
intro x hx
- have hx' : x ∈ { x | (zip_with swap l l').Prod x ≠ x } := by simpa using hx
+ have hx' : x ∈ {x | (zip_with swap l l').Prod x ≠ x} := by simpa using hx
simpa using zip_with_swap_prod_support' _ _ hx'
#align list.zip_with_swap_prod_support List.zipWith_swap_prod_support
#print List.support_formPerm_le' /-
-theorem support_formPerm_le' : { x | formPerm l x ≠ x } ≤ l.toFinset :=
+theorem support_formPerm_le' : {x | formPerm l x ≠ x} ≤ l.toFinset :=
by
refine' (zip_with_swap_prod_support' l l.tail).trans _
simpa [Finset.subset_iff] using tail_subset l
@@ -238,7 +238,7 @@ theorem support_formPerm_le' : { x | formPerm l x ≠ x } ≤ l.toFinset :=
theorem support_formPerm_le [Fintype α] : support (formPerm l) ≤ l.toFinset :=
by
intro x hx
- have hx' : x ∈ { x | form_perm l x ≠ x } := by simpa using hx
+ have hx' : x ∈ {x | form_perm l x ≠ x} := by simpa using hx
simpa using support_form_perm_le' _ hx'
#align list.support_form_perm_le List.support_formPerm_le
-/
@@ -255,7 +255,7 @@ theorem formPerm_apply_lt (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n + 1 <
· specialize IH (y :: l) h.of_cons _
· simpa [Nat.succ_lt_succ_iff] using hn
simp only [swap_apply_eq_iff, coe_mul, form_perm_cons_cons, nth_le]
- generalize_proofs at IH
+ generalize_proofs at IH
rw [IH, swap_apply_of_ne_of_ne, nth_le] <;>
· rintro rfl
simpa [nth_le_mem _ _ _] using h
@@ -280,7 +280,7 @@ theorem formPerm_apply_nthLe (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n < x
#print List.support_formPerm_of_nodup' /-
theorem support_formPerm_of_nodup' (l : List α) (h : Nodup l) (h' : ∀ x : α, l ≠ [x]) :
- { x | formPerm l x ≠ x } = l.toFinset :=
+ {x | formPerm l x ≠ x} = l.toFinset :=
by
apply le_antisymm
· exact support_form_perm_le' l
@@ -400,11 +400,11 @@ theorem formPerm_ext_iff {x y x' y' : α} {l l' : List α} (hd : Nodup (x :: y :
rw [Equiv.Perm.ext_iff] at h
have hx : x' ∈ x :: y :: l :=
by
- have : x' ∈ { z | form_perm (x :: y :: l) z ≠ z } :=
+ have : x' ∈ {z | form_perm (x :: y :: l) z ≠ z} :=
by
rw [Set.mem_setOf_eq, h x', form_perm_apply_head _ _ _ hd']
simp only [mem_cons_iff, nodup_cons] at hd'
- push_neg at hd'
+ push_neg at hd'
exact hd'.left.left.symm
simpa using support_form_perm_le' _ this
obtain ⟨n, hn, hx'⟩ := nth_le_of_mem hx
@@ -463,8 +463,7 @@ theorem formPerm_apply_mem_ne_self_iff (hl : Nodup l) (x : α) (hx : x ∈ l) :
#print List.mem_of_formPerm_ne_self /-
theorem mem_of_formPerm_ne_self (l : List α) (x : α) (h : formPerm l x ≠ x) : x ∈ l :=
by
- suffices x ∈ { y | form_perm l y ≠ y }
- by
+ suffices x ∈ {y | form_perm l y ≠ y} by
rw [← mem_to_finset]
exact support_form_perm_le' _ this
simpa using h
@@ -521,7 +520,7 @@ theorem form_perm_zpow_apply_mem_imp_mem (l : List α) (x : α) (hx : x ∈ l) (
(formPerm l ^ n) x ∈ l := by
by_cases h : (l.form_perm ^ n) x = x
· simpa [h] using hx
- · have : x ∈ { x | (l.form_perm ^ n) x ≠ x } := h
+ · have : x ∈ {x | (l.form_perm ^ n) x ≠ x} := h
rw [← set_support_apply_mem] at this
replace this := set_support_zpow_subset _ _ this
simpa using support_form_perm_le' _ this
@@ -534,7 +533,7 @@ theorem formPerm_pow_length_eq_one_of_nodup (hl : Nodup l) : formPerm l ^ length
by_cases hx : x ∈ l
· obtain ⟨k, hk, rfl⟩ := nth_le_of_mem hx
simp [form_perm_pow_apply_nth_le _ hl, Nat.mod_eq_of_lt hk]
- · have : x ∉ { x | (l.form_perm ^ l.length) x ≠ x } :=
+ · have : x ∉ {x | (l.form_perm ^ l.length) x ≠ x} :=
by
intro H
refine' hx _
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -88,7 +88,7 @@ theorem formPerm_apply_of_not_mem (x : α) (l : List α) (h : x ∉ l) : formPer
induction' l with z l IH generalizing x y
· simp
· specialize IH x z (mt (mem_cons_of_mem y) h)
- simp only [not_or, mem_cons_iff] at h
+ simp only [not_or, mem_cons_iff] at h
simp [IH, swap_apply_of_ne_of_ne, h]
#align list.form_perm_apply_of_not_mem List.formPerm_apply_of_not_mem
-/
@@ -122,14 +122,14 @@ theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l
induction' l with z l IH generalizing x y
· simpa using h
· by_cases hx : (z :: l).formPerm x ∈ z :: l
- · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
- split_ifs at h <;> simp [IH _ _ hx]
+ · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
+ split_ifs at h <;> simp [IH _ _ hx]
· replace hx :=
(Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
- List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
+ List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
simp only [List.mem_cons]
- obtain h | h | h := h <;> · split_ifs at h <;> cc
+ obtain h | h | h := h <;> · split_ifs at h <;> cc
#align list.mem_of_form_perm_apply_mem List.mem_of_formPerm_apply_mem
-/
@@ -209,11 +209,11 @@ theorem zipWith_swap_prod_support' (l l' : List α) :
· specialize hl l' h
refine' Set.MemUnion.elim hl (fun hm => _) fun hm => _ <;>
· simp only [Finset.coe_insert, Set.mem_insert_iff, Finset.mem_coe, to_finset_cons,
- mem_to_finset] at hm⊢
+ mem_to_finset] at hm ⊢
simp [hm]
- · simp only [Classical.not_not, Set.mem_setOf_eq] at h
- simp only [h, Set.mem_setOf_eq] at hx
- rw [swap_apply_ne_self_iff] at hx
+ · simp only [Classical.not_not, Set.mem_setOf_eq] at h
+ simp only [h, Set.mem_setOf_eq] at hx
+ rw [swap_apply_ne_self_iff] at hx
rcases hx with ⟨hyz, rfl | rfl⟩ <;> simp
#align list.zip_with_swap_prod_support' List.zipWith_swap_prod_support'
-/
@@ -255,7 +255,7 @@ theorem formPerm_apply_lt (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n + 1 <
· specialize IH (y :: l) h.of_cons _
· simpa [Nat.succ_lt_succ_iff] using hn
simp only [swap_apply_eq_iff, coe_mul, form_perm_cons_cons, nth_le]
- generalize_proofs at IH
+ generalize_proofs at IH
rw [IH, swap_apply_of_ne_of_ne, nth_le] <;>
· rintro rfl
simpa [nth_le_mem _ _ _] using h
@@ -285,14 +285,14 @@ theorem support_formPerm_of_nodup' (l : List α) (h : Nodup l) (h' : ∀ x : α,
apply le_antisymm
· exact support_form_perm_le' l
· intro x hx
- simp only [Finset.mem_coe, mem_to_finset] at hx
+ simp only [Finset.mem_coe, mem_to_finset] at hx
obtain ⟨n, hn, rfl⟩ := nth_le_of_mem hx
rw [Set.mem_setOf_eq, form_perm_apply_nth_le _ h]
intro H
- rw [nodup_iff_nth_le_inj] at h
+ rw [nodup_iff_nth_le_inj] at h
specialize h _ _ _ _ H
cases' (Nat.succ_le_of_lt hn).eq_or_lt with hn' hn'
- · simp only [← hn', Nat.mod_self] at h
+ · simp only [← hn', Nat.mod_self] at h
refine' not_exists.mpr h' _
simpa [← h, eq_comm, length_eq_one] using hn'
· simpa [Nat.mod_eq_of_lt hn'] using h
@@ -357,7 +357,7 @@ theorem formPerm_reverse (l : List α) (h : Nodup l) : formPerm l.reverse = (for
rw [form_perm_apply_nth_le l.reverse (nodup_reverse.mpr h), nth_le_reverse',
form_perm_apply_nth_le _ h, nth_le_reverse']
· congr
- rw [length_reverse, ← Nat.succ_le_iff, Nat.succ_eq_add_one] at hk
+ rw [length_reverse, ← Nat.succ_le_iff, Nat.succ_eq_add_one] at hk
cases' hk.eq_or_lt with hk' hk'
· simp [← hk']
· rw [length_reverse, Nat.mod_eq_of_lt hk', tsub_add_eq_add_tsub (Nat.le_pred_of_lt hk'),
@@ -397,14 +397,14 @@ theorem formPerm_ext_iff {x y x' y' : α} {l l' : List α} (hd : Nodup (x :: y :
formPerm (x :: y :: l) = formPerm (x' :: y' :: l') ↔ (x :: y :: l) ~r (x' :: y' :: l') :=
by
refine' ⟨fun h => _, fun hr => form_perm_eq_of_is_rotated hd hr⟩
- rw [Equiv.Perm.ext_iff] at h
+ rw [Equiv.Perm.ext_iff] at h
have hx : x' ∈ x :: y :: l :=
by
have : x' ∈ { z | form_perm (x :: y :: l) z ≠ z } :=
by
rw [Set.mem_setOf_eq, h x', form_perm_apply_head _ _ _ hd']
- simp only [mem_cons_iff, nodup_cons] at hd'
- push_neg at hd'
+ simp only [mem_cons_iff, nodup_cons] at hd'
+ push_neg at hd'
exact hd'.left.left.symm
simpa using support_form_perm_le' _ this
obtain ⟨n, hn, hx'⟩ := nth_le_of_mem hx
@@ -442,7 +442,7 @@ theorem formPerm_apply_mem_eq_self_iff (hl : Nodup l) (x : α) (hx : x ∈ l) :
rw [form_perm_apply_nth_le _ hl, hl.nth_le_inj_iff]
cases hn : l.length
· exact absurd k.zero_le (hk.trans_le hn.le).not_le
- · rw [hn] at hk
+ · rw [hn] at hk
cases' (Nat.le_of_lt_succ hk).eq_or_lt with hk' hk'
· simp [← hk', Nat.succ_le_succ_iff, eq_comm]
·
@@ -486,7 +486,7 @@ theorem formPerm_eq_one_iff (hl : Nodup l) : formPerm l = 1 ↔ l.length ≤ 1 :
· simp (config := { contextual := true })
· intro h
simp only [(hd :: tl).formPerm_apply_mem_eq_self_iff hl hd (mem_cons_self hd tl),
- add_le_iff_nonpos_left, length, nonpos_iff_eq_zero, length_eq_zero] at h
+ add_le_iff_nonpos_left, length, nonpos_iff_eq_zero, length_eq_zero] at h
simp [h]
#align list.form_perm_eq_one_iff List.formPerm_eq_one_iff
@@ -522,7 +522,7 @@ theorem form_perm_zpow_apply_mem_imp_mem (l : List α) (x : α) (hx : x ∈ l) (
by_cases h : (l.form_perm ^ n) x = x
· simpa [h] using hx
· have : x ∈ { x | (l.form_perm ^ n) x ≠ x } := h
- rw [← set_support_apply_mem] at this
+ rw [← set_support_apply_mem] at this
replace this := set_support_zpow_subset _ _ this
simpa using support_form_perm_le' _ this
#align list.form_perm_zpow_apply_mem_imp_mem List.form_perm_zpow_apply_mem_imp_mem
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -234,12 +234,14 @@ theorem support_formPerm_le' : { x | formPerm l x ≠ x } ≤ l.toFinset :=
#align list.support_form_perm_le' List.support_formPerm_le'
-/
+#print List.support_formPerm_le /-
theorem support_formPerm_le [Fintype α] : support (formPerm l) ≤ l.toFinset :=
by
intro x hx
have hx' : x ∈ { x | form_perm l x ≠ x } := by simpa using hx
simpa using support_form_perm_le' _ hx'
#align list.support_form_perm_le List.support_formPerm_le
+-/
#print List.formPerm_apply_lt /-
theorem formPerm_apply_lt (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n + 1 < xs.length) :
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -56,34 +56,16 @@ def formPerm : Equiv.Perm α :=
#align list.form_perm List.formPerm
-/
-/- warning: list.form_perm_nil -> List.formPerm_nil is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α], Eq.{succ u1} (Equiv.Perm.{succ u1} α) (List.formPerm.{u1} α (fun (a : α) (b : α) => _inst_1 a b) (List.nil.{u1} α)) (OfNat.ofNat.{u1} (Equiv.Perm.{succ u1} α) 1 (OfNat.mk.{u1} (Equiv.Perm.{succ u1} α) 1 (One.one.{u1} (Equiv.Perm.{succ u1} α) (MulOneClass.toHasOne.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))))))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α], Eq.{succ u1} (Equiv.Perm.{succ u1} α) (List.formPerm.{u1} α (fun (a : α) (b : α) => _inst_1 a b) (List.nil.{u1} α)) (OfNat.ofNat.{u1} (Equiv.Perm.{succ u1} α) 1 (One.toOfNat1.{u1} (Equiv.Perm.{succ u1} α) (InvOneClass.toOne.{u1} (Equiv.Perm.{succ u1} α) (DivInvOneMonoid.toInvOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivisionMonoid.toDivInvOneMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivisionMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α)))))))
-Case conversion may be inaccurate. Consider using '#align list.form_perm_nil List.formPerm_nilₓ'. -/
@[simp]
theorem formPerm_nil : formPerm ([] : List α) = 1 :=
rfl
#align list.form_perm_nil List.formPerm_nil
-/- warning: list.form_perm_singleton -> List.formPerm_singleton is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (x : α), Eq.{succ u1} (Equiv.Perm.{succ u1} α) (List.formPerm.{u1} α (fun (a : α) (b : α) => _inst_1 a b) (List.cons.{u1} α x (List.nil.{u1} α))) (OfNat.ofNat.{u1} (Equiv.Perm.{succ u1} α) 1 (OfNat.mk.{u1} (Equiv.Perm.{succ u1} α) 1 (One.one.{u1} (Equiv.Perm.{succ u1} α) (MulOneClass.toHasOne.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))))))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (x : α), Eq.{succ u1} (Equiv.Perm.{succ u1} α) (List.formPerm.{u1} α (fun (a : α) (b : α) => _inst_1 a b) (List.cons.{u1} α x (List.nil.{u1} α))) (OfNat.ofNat.{u1} (Equiv.Perm.{succ u1} α) 1 (One.toOfNat1.{u1} (Equiv.Perm.{succ u1} α) (InvOneClass.toOne.{u1} (Equiv.Perm.{succ u1} α) (DivInvOneMonoid.toInvOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivisionMonoid.toDivInvOneMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivisionMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α)))))))
-Case conversion may be inaccurate. Consider using '#align list.form_perm_singleton List.formPerm_singletonₓ'. -/
@[simp]
theorem formPerm_singleton (x : α) : formPerm [x] = 1 :=
rfl
#align list.form_perm_singleton List.formPerm_singleton
-/- warning: list.form_perm_cons_cons -> List.formPerm_cons_cons is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (x : α) (y : α) (l : List.{u1} α), Eq.{succ u1} (Equiv.Perm.{succ u1} α) (List.formPerm.{u1} α (fun (a : α) (b : α) => _inst_1 a b) (List.cons.{u1} α x (List.cons.{u1} α y l))) (HMul.hMul.{u1, u1, u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.{succ u1} α) (Equiv.Perm.{succ u1} α) (instHMul.{u1} (Equiv.Perm.{succ u1} α) (MulOneClass.toHasMul.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α)))))) (Equiv.swap.{succ u1} α (fun (a : α) (b : α) => _inst_1 a b) x y) (List.formPerm.{u1} α (fun (a : α) (b : α) => _inst_1 a b) (List.cons.{u1} α y l)))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (x : α) (y : α) (l : List.{u1} α), Eq.{succ u1} (Equiv.Perm.{succ u1} α) (List.formPerm.{u1} α (fun (a : α) (b : α) => _inst_1 a b) (List.cons.{u1} α x (List.cons.{u1} α y l))) (HMul.hMul.{u1, u1, u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.{succ u1} α) (Equiv.Perm.{succ u1} α) (instHMul.{u1} (Equiv.Perm.{succ u1} α) (MulOneClass.toMul.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α)))))) (Equiv.swap.{succ u1} α (fun (a : α) (b : α) => _inst_1 a b) x y) (List.formPerm.{u1} α (fun (a : α) (b : α) => _inst_1 a b) (List.cons.{u1} α y l)))
-Case conversion may be inaccurate. Consider using '#align list.form_perm_cons_cons List.formPerm_cons_consₓ'. -/
@[simp]
theorem formPerm_cons_cons (x y : α) (l : List α) :
formPerm (x :: y :: l) = swap x y * formPerm (y :: l) :=
@@ -236,12 +218,6 @@ theorem zipWith_swap_prod_support' (l l' : List α) :
#align list.zip_with_swap_prod_support' List.zipWith_swap_prod_support'
-/
-/- warning: list.zip_with_swap_prod_support -> List.zipWith_swap_prod_support is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] [_inst_2 : Fintype.{u1} α] (l : List.{u1} α) (l' : List.{u1} α), LE.le.{u1} (Finset.{u1} α) (Preorder.toHasLe.{u1} (Finset.{u1} α) (PartialOrder.toPreorder.{u1} (Finset.{u1} α) (Finset.partialOrder.{u1} α))) (Equiv.Perm.support.{u1} α (fun (a : α) (b : α) => _inst_1 a b) _inst_2 (List.prod.{u1} (Equiv.Perm.{succ u1} α) (MulOneClass.toHasMul.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (MulOneClass.toHasOne.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (List.zipWith.{u1, u1, u1} α α (Equiv.Perm.{succ u1} α) (Equiv.swap.{succ u1} α (fun (a : α) (b : α) => _inst_1 a b)) l l'))) (Sup.sup.{u1} (Finset.{u1} α) (SemilatticeSup.toHasSup.{u1} (Finset.{u1} α) (Lattice.toSemilatticeSup.{u1} (Finset.{u1} α) (Finset.lattice.{u1} α (fun (a : α) (b : α) => _inst_1 a b)))) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l'))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] [_inst_2 : Fintype.{u1} α] (l : List.{u1} α) (l' : List.{u1} α), LE.le.{u1} (Finset.{u1} α) (Preorder.toLE.{u1} (Finset.{u1} α) (PartialOrder.toPreorder.{u1} (Finset.{u1} α) (Finset.partialOrder.{u1} α))) (Equiv.Perm.support.{u1} α (fun (a : α) (b : α) => _inst_1 a b) _inst_2 (List.prod.{u1} (Equiv.Perm.{succ u1} α) (MulOneClass.toMul.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (InvOneClass.toOne.{u1} (Equiv.Perm.{succ u1} α) (DivInvOneMonoid.toInvOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivisionMonoid.toDivInvOneMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivisionMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (List.zipWith.{u1, u1, u1} α α (Equiv.Perm.{succ u1} α) (Equiv.swap.{succ u1} α (fun (a : α) (b : α) => _inst_1 a b)) l l'))) (Sup.sup.{u1} (Finset.{u1} α) (SemilatticeSup.toSup.{u1} (Finset.{u1} α) (Lattice.toSemilatticeSup.{u1} (Finset.{u1} α) (Finset.instLatticeFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b)))) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l'))
-Case conversion may be inaccurate. Consider using '#align list.zip_with_swap_prod_support List.zipWith_swap_prod_supportₓ'. -/
theorem zipWith_swap_prod_support [Fintype α] (l l' : List α) :
(zipWith swap l l').Prod.support ≤ l.toFinset ⊔ l'.toFinset :=
by
@@ -258,12 +234,6 @@ theorem support_formPerm_le' : { x | formPerm l x ≠ x } ≤ l.toFinset :=
#align list.support_form_perm_le' List.support_formPerm_le'
-/
-/- warning: list.support_form_perm_le -> List.support_formPerm_le is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (l : List.{u1} α) [_inst_2 : Fintype.{u1} α], LE.le.{u1} (Finset.{u1} α) (Preorder.toHasLe.{u1} (Finset.{u1} α) (PartialOrder.toPreorder.{u1} (Finset.{u1} α) (Finset.partialOrder.{u1} α))) (Equiv.Perm.support.{u1} α (fun (a : α) (b : α) => _inst_1 a b) _inst_2 (List.formPerm.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l)) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l)
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (l : List.{u1} α) [_inst_2 : Fintype.{u1} α], LE.le.{u1} (Finset.{u1} α) (Preorder.toLE.{u1} (Finset.{u1} α) (PartialOrder.toPreorder.{u1} (Finset.{u1} α) (Finset.partialOrder.{u1} α))) (Equiv.Perm.support.{u1} α (fun (a : α) (b : α) => _inst_1 a b) _inst_2 (List.formPerm.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l)) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l)
-Case conversion may be inaccurate. Consider using '#align list.support_form_perm_le List.support_formPerm_leₓ'. -/
theorem support_formPerm_le [Fintype α] : support (formPerm l) ≤ l.toFinset :=
by
intro x hx
@@ -370,12 +340,6 @@ theorem formPerm_eq_of_isRotated {l l' : List α} (hd : Nodup l) (h : l ~r l') :
#align list.form_perm_eq_of_is_rotated List.formPerm_eq_of_isRotated
-/
-/- warning: list.form_perm_reverse -> List.formPerm_reverse is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (l : List.{u1} α), (List.Nodup.{u1} α l) -> (Eq.{succ u1} (Equiv.Perm.{succ u1} α) (List.formPerm.{u1} α (fun (a : α) (b : α) => _inst_1 a b) (List.reverse.{u1} α l)) (Inv.inv.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toHasInv.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))) (List.formPerm.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l)))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (l : List.{u1} α), (List.Nodup.{u1} α l) -> (Eq.{succ u1} (Equiv.Perm.{succ u1} α) (List.formPerm.{u1} α (fun (a : α) (b : α) => _inst_1 a b) (List.reverse.{u1} α l)) (Inv.inv.{u1} (Equiv.Perm.{succ u1} α) (InvOneClass.toInv.{u1} (Equiv.Perm.{succ u1} α) (DivInvOneMonoid.toInvOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivisionMonoid.toDivInvOneMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivisionMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (List.formPerm.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l)))
-Case conversion may be inaccurate. Consider using '#align list.form_perm_reverse List.formPerm_reverseₓ'. -/
theorem formPerm_reverse (l : List α) (h : Nodup l) : formPerm l.reverse = (formPerm l)⁻¹ :=
by
-- Let's show `form_perm l` is an inverse to `form_perm l.reverse`.
@@ -511,12 +475,6 @@ theorem formPerm_eq_self_of_not_mem (l : List α) (x : α) (h : x ∉ l) : formP
#align list.form_perm_eq_self_of_not_mem List.formPerm_eq_self_of_not_mem
-/
-/- warning: list.form_perm_eq_one_iff -> List.formPerm_eq_one_iff is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (l : List.{u1} α), (List.Nodup.{u1} α l) -> (Iff (Eq.{succ u1} (Equiv.Perm.{succ u1} α) (List.formPerm.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l) (OfNat.ofNat.{u1} (Equiv.Perm.{succ u1} α) 1 (OfNat.mk.{u1} (Equiv.Perm.{succ u1} α) 1 (One.one.{u1} (Equiv.Perm.{succ u1} α) (MulOneClass.toHasOne.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))))))) (LE.le.{0} Nat Nat.hasLe (List.length.{u1} α l) (OfNat.ofNat.{0} Nat 1 (OfNat.mk.{0} Nat 1 (One.one.{0} Nat Nat.hasOne)))))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (l : List.{u1} α), (List.Nodup.{u1} α l) -> (Iff (Eq.{succ u1} (Equiv.Perm.{succ u1} α) (List.formPerm.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l) (OfNat.ofNat.{u1} (Equiv.Perm.{succ u1} α) 1 (One.toOfNat1.{u1} (Equiv.Perm.{succ u1} α) (InvOneClass.toOne.{u1} (Equiv.Perm.{succ u1} α) (DivInvOneMonoid.toInvOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivisionMonoid.toDivInvOneMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivisionMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α)))))))) (LE.le.{0} Nat instLENat (List.length.{u1} α l) (OfNat.ofNat.{0} Nat 1 (instOfNatNat 1))))
-Case conversion may be inaccurate. Consider using '#align list.form_perm_eq_one_iff List.formPerm_eq_one_iffₓ'. -/
theorem formPerm_eq_one_iff (hl : Nodup l) : formPerm l = 1 ↔ l.length ≤ 1 :=
by
cases' l with hd tl
@@ -568,12 +526,6 @@ theorem form_perm_zpow_apply_mem_imp_mem (l : List α) (x : α) (hx : x ∈ l) (
#align list.form_perm_zpow_apply_mem_imp_mem List.form_perm_zpow_apply_mem_imp_mem
-/
-/- warning: list.form_perm_pow_length_eq_one_of_nodup -> List.formPerm_pow_length_eq_one_of_nodup is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (l : List.{u1} α), (List.Nodup.{u1} α l) -> (Eq.{succ u1} (Equiv.Perm.{succ u1} α) (HPow.hPow.{u1, 0, u1} (Equiv.Perm.{succ u1} α) Nat (Equiv.Perm.{succ u1} α) (instHPow.{u1, 0} (Equiv.Perm.{succ u1} α) Nat (Monoid.Pow.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (List.formPerm.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l) (List.length.{u1} α l)) (OfNat.ofNat.{u1} (Equiv.Perm.{succ u1} α) 1 (OfNat.mk.{u1} (Equiv.Perm.{succ u1} α) 1 (One.one.{u1} (Equiv.Perm.{succ u1} α) (MulOneClass.toHasOne.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α)))))))))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (l : List.{u1} α), (List.Nodup.{u1} α l) -> (Eq.{succ u1} (Equiv.Perm.{succ u1} α) (HPow.hPow.{u1, 0, u1} (Equiv.Perm.{succ u1} α) Nat (Equiv.Perm.{succ u1} α) (instHPow.{u1, 0} (Equiv.Perm.{succ u1} α) Nat (Monoid.Pow.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (List.formPerm.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l) (List.length.{u1} α l)) (OfNat.ofNat.{u1} (Equiv.Perm.{succ u1} α) 1 (One.toOfNat1.{u1} (Equiv.Perm.{succ u1} α) (InvOneClass.toOne.{u1} (Equiv.Perm.{succ u1} α) (DivInvOneMonoid.toInvOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivisionMonoid.toDivInvOneMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivisionMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))))))
-Case conversion may be inaccurate. Consider using '#align list.form_perm_pow_length_eq_one_of_nodup List.formPerm_pow_length_eq_one_of_nodupₓ'. -/
theorem formPerm_pow_length_eq_one_of_nodup (hl : Nodup l) : formPerm l ^ length l = 1 :=
by
ext x
mathlib commit https://github.com/leanprover-community/mathlib/commit/0b9eaaa7686280fad8cce467f5c3c57ee6ce77f8
@@ -238,7 +238,7 @@ theorem zipWith_swap_prod_support' (l l' : List α) :
/- warning: list.zip_with_swap_prod_support -> List.zipWith_swap_prod_support is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] [_inst_2 : Fintype.{u1} α] (l : List.{u1} α) (l' : List.{u1} α), LE.le.{u1} (Finset.{u1} α) (Preorder.toLE.{u1} (Finset.{u1} α) (PartialOrder.toPreorder.{u1} (Finset.{u1} α) (Finset.partialOrder.{u1} α))) (Equiv.Perm.support.{u1} α (fun (a : α) (b : α) => _inst_1 a b) _inst_2 (List.prod.{u1} (Equiv.Perm.{succ u1} α) (MulOneClass.toHasMul.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (MulOneClass.toHasOne.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (List.zipWith.{u1, u1, u1} α α (Equiv.Perm.{succ u1} α) (Equiv.swap.{succ u1} α (fun (a : α) (b : α) => _inst_1 a b)) l l'))) (Sup.sup.{u1} (Finset.{u1} α) (SemilatticeSup.toHasSup.{u1} (Finset.{u1} α) (Lattice.toSemilatticeSup.{u1} (Finset.{u1} α) (Finset.lattice.{u1} α (fun (a : α) (b : α) => _inst_1 a b)))) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l'))
+ forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] [_inst_2 : Fintype.{u1} α] (l : List.{u1} α) (l' : List.{u1} α), LE.le.{u1} (Finset.{u1} α) (Preorder.toHasLe.{u1} (Finset.{u1} α) (PartialOrder.toPreorder.{u1} (Finset.{u1} α) (Finset.partialOrder.{u1} α))) (Equiv.Perm.support.{u1} α (fun (a : α) (b : α) => _inst_1 a b) _inst_2 (List.prod.{u1} (Equiv.Perm.{succ u1} α) (MulOneClass.toHasMul.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (MulOneClass.toHasOne.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (List.zipWith.{u1, u1, u1} α α (Equiv.Perm.{succ u1} α) (Equiv.swap.{succ u1} α (fun (a : α) (b : α) => _inst_1 a b)) l l'))) (Sup.sup.{u1} (Finset.{u1} α) (SemilatticeSup.toHasSup.{u1} (Finset.{u1} α) (Lattice.toSemilatticeSup.{u1} (Finset.{u1} α) (Finset.lattice.{u1} α (fun (a : α) (b : α) => _inst_1 a b)))) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l'))
but is expected to have type
forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] [_inst_2 : Fintype.{u1} α] (l : List.{u1} α) (l' : List.{u1} α), LE.le.{u1} (Finset.{u1} α) (Preorder.toLE.{u1} (Finset.{u1} α) (PartialOrder.toPreorder.{u1} (Finset.{u1} α) (Finset.partialOrder.{u1} α))) (Equiv.Perm.support.{u1} α (fun (a : α) (b : α) => _inst_1 a b) _inst_2 (List.prod.{u1} (Equiv.Perm.{succ u1} α) (MulOneClass.toMul.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (InvOneClass.toOne.{u1} (Equiv.Perm.{succ u1} α) (DivInvOneMonoid.toInvOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivisionMonoid.toDivInvOneMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivisionMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (List.zipWith.{u1, u1, u1} α α (Equiv.Perm.{succ u1} α) (Equiv.swap.{succ u1} α (fun (a : α) (b : α) => _inst_1 a b)) l l'))) (Sup.sup.{u1} (Finset.{u1} α) (SemilatticeSup.toSup.{u1} (Finset.{u1} α) (Lattice.toSemilatticeSup.{u1} (Finset.{u1} α) (Finset.instLatticeFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b)))) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l'))
Case conversion may be inaccurate. Consider using '#align list.zip_with_swap_prod_support List.zipWith_swap_prod_supportₓ'. -/
@@ -258,14 +258,18 @@ theorem support_formPerm_le' : { x | formPerm l x ≠ x } ≤ l.toFinset :=
#align list.support_form_perm_le' List.support_formPerm_le'
-/
-#print List.support_formPerm_le /-
+/- warning: list.support_form_perm_le -> List.support_formPerm_le is a dubious translation:
+lean 3 declaration is
+ forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (l : List.{u1} α) [_inst_2 : Fintype.{u1} α], LE.le.{u1} (Finset.{u1} α) (Preorder.toHasLe.{u1} (Finset.{u1} α) (PartialOrder.toPreorder.{u1} (Finset.{u1} α) (Finset.partialOrder.{u1} α))) (Equiv.Perm.support.{u1} α (fun (a : α) (b : α) => _inst_1 a b) _inst_2 (List.formPerm.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l)) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l)
+but is expected to have type
+ forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (l : List.{u1} α) [_inst_2 : Fintype.{u1} α], LE.le.{u1} (Finset.{u1} α) (Preorder.toLE.{u1} (Finset.{u1} α) (PartialOrder.toPreorder.{u1} (Finset.{u1} α) (Finset.partialOrder.{u1} α))) (Equiv.Perm.support.{u1} α (fun (a : α) (b : α) => _inst_1 a b) _inst_2 (List.formPerm.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l)) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l)
+Case conversion may be inaccurate. Consider using '#align list.support_form_perm_le List.support_formPerm_leₓ'. -/
theorem support_formPerm_le [Fintype α] : support (formPerm l) ≤ l.toFinset :=
by
intro x hx
have hx' : x ∈ { x | form_perm l x ≠ x } := by simpa using hx
simpa using support_form_perm_le' _ hx'
#align list.support_form_perm_le List.support_formPerm_le
--/
#print List.formPerm_apply_lt /-
theorem formPerm_apply_lt (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n + 1 < xs.length) :
mathlib commit https://github.com/leanprover-community/mathlib/commit/da3fc4a33ff6bc75f077f691dc94c217b8d41559
@@ -238,12 +238,12 @@ theorem zipWith_swap_prod_support' (l l' : List α) :
/- warning: list.zip_with_swap_prod_support -> List.zipWith_swap_prod_support is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] [_inst_2 : Fintype.{u1} α] (l : List.{u1} α) (l' : List.{u1} α), LE.le.{u1} (Finset.{u1} α) (Preorder.toLE.{u1} (Finset.{u1} α) (PartialOrder.toPreorder.{u1} (Finset.{u1} α) (Finset.partialOrder.{u1} α))) (Equiv.Perm.Support.{u1} α (fun (a : α) (b : α) => _inst_1 a b) _inst_2 (List.prod.{u1} (Equiv.Perm.{succ u1} α) (MulOneClass.toHasMul.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (MulOneClass.toHasOne.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (List.zipWith.{u1, u1, u1} α α (Equiv.Perm.{succ u1} α) (Equiv.swap.{succ u1} α (fun (a : α) (b : α) => _inst_1 a b)) l l'))) (Sup.sup.{u1} (Finset.{u1} α) (SemilatticeSup.toHasSup.{u1} (Finset.{u1} α) (Lattice.toSemilatticeSup.{u1} (Finset.{u1} α) (Finset.lattice.{u1} α (fun (a : α) (b : α) => _inst_1 a b)))) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l'))
+ forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] [_inst_2 : Fintype.{u1} α] (l : List.{u1} α) (l' : List.{u1} α), LE.le.{u1} (Finset.{u1} α) (Preorder.toLE.{u1} (Finset.{u1} α) (PartialOrder.toPreorder.{u1} (Finset.{u1} α) (Finset.partialOrder.{u1} α))) (Equiv.Perm.support.{u1} α (fun (a : α) (b : α) => _inst_1 a b) _inst_2 (List.prod.{u1} (Equiv.Perm.{succ u1} α) (MulOneClass.toHasMul.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (MulOneClass.toHasOne.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (List.zipWith.{u1, u1, u1} α α (Equiv.Perm.{succ u1} α) (Equiv.swap.{succ u1} α (fun (a : α) (b : α) => _inst_1 a b)) l l'))) (Sup.sup.{u1} (Finset.{u1} α) (SemilatticeSup.toHasSup.{u1} (Finset.{u1} α) (Lattice.toSemilatticeSup.{u1} (Finset.{u1} α) (Finset.lattice.{u1} α (fun (a : α) (b : α) => _inst_1 a b)))) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l'))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] [_inst_2 : Fintype.{u1} α] (l : List.{u1} α) (l' : List.{u1} α), LE.le.{u1} (Finset.{u1} α) (Preorder.toLE.{u1} (Finset.{u1} α) (PartialOrder.toPreorder.{u1} (Finset.{u1} α) (Finset.partialOrder.{u1} α))) (Equiv.Perm.Support.{u1} α (fun (a : α) (b : α) => _inst_1 a b) _inst_2 (List.prod.{u1} (Equiv.Perm.{succ u1} α) (MulOneClass.toMul.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (InvOneClass.toOne.{u1} (Equiv.Perm.{succ u1} α) (DivInvOneMonoid.toInvOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivisionMonoid.toDivInvOneMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivisionMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (List.zipWith.{u1, u1, u1} α α (Equiv.Perm.{succ u1} α) (Equiv.swap.{succ u1} α (fun (a : α) (b : α) => _inst_1 a b)) l l'))) (Sup.sup.{u1} (Finset.{u1} α) (SemilatticeSup.toSup.{u1} (Finset.{u1} α) (Lattice.toSemilatticeSup.{u1} (Finset.{u1} α) (Finset.instLatticeFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b)))) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l'))
+ forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] [_inst_2 : Fintype.{u1} α] (l : List.{u1} α) (l' : List.{u1} α), LE.le.{u1} (Finset.{u1} α) (Preorder.toLE.{u1} (Finset.{u1} α) (PartialOrder.toPreorder.{u1} (Finset.{u1} α) (Finset.partialOrder.{u1} α))) (Equiv.Perm.support.{u1} α (fun (a : α) (b : α) => _inst_1 a b) _inst_2 (List.prod.{u1} (Equiv.Perm.{succ u1} α) (MulOneClass.toMul.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (InvOneClass.toOne.{u1} (Equiv.Perm.{succ u1} α) (DivInvOneMonoid.toInvOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivisionMonoid.toDivInvOneMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivisionMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (List.zipWith.{u1, u1, u1} α α (Equiv.Perm.{succ u1} α) (Equiv.swap.{succ u1} α (fun (a : α) (b : α) => _inst_1 a b)) l l'))) (Sup.sup.{u1} (Finset.{u1} α) (SemilatticeSup.toSup.{u1} (Finset.{u1} α) (Lattice.toSemilatticeSup.{u1} (Finset.{u1} α) (Finset.instLatticeFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b)))) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l'))
Case conversion may be inaccurate. Consider using '#align list.zip_with_swap_prod_support List.zipWith_swap_prod_supportₓ'. -/
theorem zipWith_swap_prod_support [Fintype α] (l l' : List α) :
- (zipWith swap l l').Prod.Support ≤ l.toFinset ⊔ l'.toFinset :=
+ (zipWith swap l l').Prod.support ≤ l.toFinset ⊔ l'.toFinset :=
by
intro x hx
have hx' : x ∈ { x | (zip_with swap l l').Prod x ≠ x } := by simpa using hx
@@ -259,7 +259,7 @@ theorem support_formPerm_le' : { x | formPerm l x ≠ x } ≤ l.toFinset :=
-/
#print List.support_formPerm_le /-
-theorem support_formPerm_le [Fintype α] : Support (formPerm l) ≤ l.toFinset :=
+theorem support_formPerm_le [Fintype α] : support (formPerm l) ≤ l.toFinset :=
by
intro x hx
have hx' : x ∈ { x | form_perm l x ≠ x } := by simpa using hx
@@ -325,7 +325,7 @@ theorem support_formPerm_of_nodup' (l : List α) (h : Nodup l) (h' : ∀ x : α,
#print List.support_formPerm_of_nodup /-
theorem support_formPerm_of_nodup [Fintype α] (l : List α) (h : Nodup l) (h' : ∀ x : α, l ≠ [x]) :
- Support (formPerm l) = l.toFinset :=
+ support (formPerm l) = l.toFinset :=
by
rw [← Finset.coe_inj]
convert support_form_perm_of_nodup' _ h h'
mathlib commit https://github.com/leanprover-community/mathlib/commit/9da1b3534b65d9661eb8f42443598a92bbb49211
@@ -238,9 +238,9 @@ theorem zipWith_swap_prod_support' (l l' : List α) :
/- warning: list.zip_with_swap_prod_support -> List.zipWith_swap_prod_support is a dubious translation:
lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] [_inst_2 : Fintype.{u1} α] (l : List.{u1} α) (l' : List.{u1} α), LE.le.{u1} (Finset.{u1} α) (Preorder.toLE.{u1} (Finset.{u1} α) (PartialOrder.toPreorder.{u1} (Finset.{u1} α) (Finset.partialOrder.{u1} α))) (Equiv.Perm.Support.{u1} α (fun (a : α) (b : α) => _inst_1 a b) _inst_2 (List.prod.{u1} (Equiv.Perm.{succ u1} α) (MulOneClass.toHasMul.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (MulOneClass.toHasOne.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (List.zipWith.{u1, u1, u1} α α (Equiv.Perm.{succ u1} α) (Equiv.swap.{succ u1} α (fun (a : α) (b : α) => _inst_1 a b)) l l'))) (HasSup.sup.{u1} (Finset.{u1} α) (SemilatticeSup.toHasSup.{u1} (Finset.{u1} α) (Lattice.toSemilatticeSup.{u1} (Finset.{u1} α) (Finset.lattice.{u1} α (fun (a : α) (b : α) => _inst_1 a b)))) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l'))
+ forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] [_inst_2 : Fintype.{u1} α] (l : List.{u1} α) (l' : List.{u1} α), LE.le.{u1} (Finset.{u1} α) (Preorder.toLE.{u1} (Finset.{u1} α) (PartialOrder.toPreorder.{u1} (Finset.{u1} α) (Finset.partialOrder.{u1} α))) (Equiv.Perm.Support.{u1} α (fun (a : α) (b : α) => _inst_1 a b) _inst_2 (List.prod.{u1} (Equiv.Perm.{succ u1} α) (MulOneClass.toHasMul.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (MulOneClass.toHasOne.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (List.zipWith.{u1, u1, u1} α α (Equiv.Perm.{succ u1} α) (Equiv.swap.{succ u1} α (fun (a : α) (b : α) => _inst_1 a b)) l l'))) (Sup.sup.{u1} (Finset.{u1} α) (SemilatticeSup.toHasSup.{u1} (Finset.{u1} α) (Lattice.toSemilatticeSup.{u1} (Finset.{u1} α) (Finset.lattice.{u1} α (fun (a : α) (b : α) => _inst_1 a b)))) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l'))
but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] [_inst_2 : Fintype.{u1} α] (l : List.{u1} α) (l' : List.{u1} α), LE.le.{u1} (Finset.{u1} α) (Preorder.toLE.{u1} (Finset.{u1} α) (PartialOrder.toPreorder.{u1} (Finset.{u1} α) (Finset.partialOrder.{u1} α))) (Equiv.Perm.Support.{u1} α (fun (a : α) (b : α) => _inst_1 a b) _inst_2 (List.prod.{u1} (Equiv.Perm.{succ u1} α) (MulOneClass.toMul.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (InvOneClass.toOne.{u1} (Equiv.Perm.{succ u1} α) (DivInvOneMonoid.toInvOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivisionMonoid.toDivInvOneMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivisionMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (List.zipWith.{u1, u1, u1} α α (Equiv.Perm.{succ u1} α) (Equiv.swap.{succ u1} α (fun (a : α) (b : α) => _inst_1 a b)) l l'))) (HasSup.sup.{u1} (Finset.{u1} α) (SemilatticeSup.toHasSup.{u1} (Finset.{u1} α) (Lattice.toSemilatticeSup.{u1} (Finset.{u1} α) (Finset.instLatticeFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b)))) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l'))
+ forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] [_inst_2 : Fintype.{u1} α] (l : List.{u1} α) (l' : List.{u1} α), LE.le.{u1} (Finset.{u1} α) (Preorder.toLE.{u1} (Finset.{u1} α) (PartialOrder.toPreorder.{u1} (Finset.{u1} α) (Finset.partialOrder.{u1} α))) (Equiv.Perm.Support.{u1} α (fun (a : α) (b : α) => _inst_1 a b) _inst_2 (List.prod.{u1} (Equiv.Perm.{succ u1} α) (MulOneClass.toMul.{u1} (Equiv.Perm.{succ u1} α) (Monoid.toMulOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivInvMonoid.toMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivInvMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (InvOneClass.toOne.{u1} (Equiv.Perm.{succ u1} α) (DivInvOneMonoid.toInvOneClass.{u1} (Equiv.Perm.{succ u1} α) (DivisionMonoid.toDivInvOneMonoid.{u1} (Equiv.Perm.{succ u1} α) (Group.toDivisionMonoid.{u1} (Equiv.Perm.{succ u1} α) (Equiv.Perm.permGroup.{u1} α))))) (List.zipWith.{u1, u1, u1} α α (Equiv.Perm.{succ u1} α) (Equiv.swap.{succ u1} α (fun (a : α) (b : α) => _inst_1 a b)) l l'))) (Sup.sup.{u1} (Finset.{u1} α) (SemilatticeSup.toSup.{u1} (Finset.{u1} α) (Lattice.toSemilatticeSup.{u1} (Finset.{u1} α) (Finset.instLatticeFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b)))) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l) (List.toFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b) l'))
Case conversion may be inaccurate. Consider using '#align list.zip_with_swap_prod_support List.zipWith_swap_prod_supportₓ'. -/
theorem zipWith_swap_prod_support [Fintype α] (l l' : List α) :
(zipWith swap l l').Prod.Support ≤ l.toFinset ⊔ l'.toFinset :=
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
mem_or_mem_of_zipWith_swap_prod_ne
, a version of zipWith_swap_prod_support'
without any Finset
s; formPerm
;formPerm_reverse
doesn't need Nodup
@@ -68,23 +68,51 @@ theorem formPerm_pair (x y : α) : formPerm [x, y] = swap x y :=
rfl
#align list.form_perm_pair List.formPerm_pair
-variable {l} {x : α}
+theorem mem_or_mem_of_zipWith_swap_prod_ne : ∀ {l l' : List α} {x : α},
+ (zipWith swap l l').prod x ≠ x → x ∈ l ∨ x ∈ l'
+ | [], _, _ => by simp
+ | _, [], _ => by simp
+ | a::l, b::l', x => fun hx ↦
+ if h : (zipWith swap l l').prod x = x then
+ (eq_or_eq_of_swap_apply_ne_self (by simpa [h] using hx)).imp
+ (by rintro rfl; exact .head _) (by rintro rfl; exact .head _)
+ else
+ (mem_or_mem_of_zipWith_swap_prod_ne h).imp (.tail _) (.tail _)
-theorem formPerm_apply_of_not_mem (x : α) (l : List α) (h : x ∉ l) : formPerm l x = x := by
- cases' l with y l
- · simp
- induction' l with z l IH generalizing x y
- · simp
- · specialize IH x z (mt (mem_cons_of_mem y) h)
- simp only [not_or, mem_cons] at h
- simp [IH, swap_apply_of_ne_of_ne, h]
-#align list.form_perm_apply_of_not_mem List.formPerm_apply_of_not_mem
+theorem zipWith_swap_prod_support' (l l' : List α) :
+ { x | (zipWith swap l l').prod x ≠ x } ≤ l.toFinset ⊔ l'.toFinset := fun _ h ↦ by
+ simpa using mem_or_mem_of_zipWith_swap_prod_ne h
+#align list.zip_with_swap_prod_support' List.zipWith_swap_prod_support'
-theorem mem_of_formPerm_apply_ne (x : α) (l : List α) : l.formPerm x ≠ x → x ∈ l :=
- not_imp_comm.2 <| List.formPerm_apply_of_not_mem _ _
+theorem zipWith_swap_prod_support [Fintype α] (l l' : List α) :
+ (zipWith swap l l').prod.support ≤ l.toFinset ⊔ l'.toFinset := by
+ intro x hx
+ have hx' : x ∈ { x | (zipWith swap l l').prod x ≠ x } := by simpa using hx
+ simpa using zipWith_swap_prod_support' _ _ hx'
+#align list.zip_with_swap_prod_support List.zipWith_swap_prod_support
+
+theorem support_formPerm_le' : { x | formPerm l x ≠ x } ≤ l.toFinset := by
+ refine' (zipWith_swap_prod_support' l l.tail).trans _
+ simpa [Finset.subset_iff] using tail_subset l
+#align list.support_form_perm_le' List.support_formPerm_le'
+
+theorem support_formPerm_le [Fintype α] : support (formPerm l) ≤ l.toFinset := by
+ intro x hx
+ have hx' : x ∈ { x | formPerm l x ≠ x } := by simpa using hx
+ simpa using support_formPerm_le' _ hx'
+#align list.support_form_perm_le List.support_formPerm_le
+
+variable {l} {x : α}
+
+theorem mem_of_formPerm_apply_ne (h : l.formPerm x ≠ x) : x ∈ l := by
+ simpa [or_iff_left_of_imp mem_of_mem_tail] using mem_or_mem_of_zipWith_swap_prod_ne h
#align list.mem_of_form_perm_apply_ne List.mem_of_formPerm_apply_ne
-theorem formPerm_apply_mem_of_mem (x : α) (l : List α) (h : x ∈ l) : formPerm l x ∈ l := by
+theorem formPerm_apply_of_not_mem (h : x ∉ l) : formPerm l x = x :=
+ not_imp_comm.1 mem_of_formPerm_apply_ne h
+#align list.form_perm_apply_of_not_mem List.formPerm_apply_of_not_mem
+
+theorem formPerm_apply_mem_of_mem (h : x ∈ l) : formPerm l x ∈ l := by
cases' l with y l
· simp at h
induction' l with z l IH generalizing x y
@@ -92,31 +120,21 @@ theorem formPerm_apply_mem_of_mem (x : α) (l : List α) (h : x ∈ l) : formPer
· by_cases hx : x ∈ z :: l
· rw [formPerm_cons_cons, mul_apply, swap_apply_def]
split_ifs
- · simp [IH _ _ hx]
+ · simp [IH _ hx]
· simp
· simp [*]
· replace h : x = y := Or.resolve_right (mem_cons.1 h) hx
- simp [formPerm_apply_of_not_mem _ _ hx, ← h]
+ simp [formPerm_apply_of_not_mem hx, ← h]
#align list.form_perm_apply_mem_of_mem List.formPerm_apply_mem_of_mem
-theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
- cases' l with y l
- · simp at h
- induction' l with z l IH generalizing x y
- · simpa using h
- · by_cases hx : (z :: l).formPerm x ∈ z :: l
- · rw [List.formPerm_cons_cons, mul_apply, swap_apply_def] at h
- split_ifs at h <;> aesop
- · replace hx :=
- (Function.Injective.eq_iff (Equiv.injective _)).mp (List.formPerm_apply_of_not_mem _ _ hx)
- simp only [List.formPerm_cons_cons, hx, Equiv.Perm.coe_mul, Function.comp_apply,
- List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
- simp only [List.mem_cons]
- rcases h with h | h | h <;> split_ifs at h with h1 <;> try { aesop }
+theorem mem_of_formPerm_apply_mem (h : l.formPerm x ∈ l) : x ∈ l := by
+ contrapose h
+ rwa [formPerm_apply_of_not_mem h]
#align list.mem_of_form_perm_apply_mem List.mem_of_formPerm_apply_mem
+@[simp]
theorem formPerm_mem_iff_mem : l.formPerm x ∈ l ↔ x ∈ l :=
- ⟨l.mem_of_formPerm_apply_mem x, l.formPerm_apply_mem_of_mem x⟩
+ ⟨l.mem_of_formPerm_apply_mem, l.formPerm_apply_mem_of_mem⟩
#align list.form_perm_mem_iff_mem List.formPerm_mem_iff_mem
@[simp]
@@ -141,7 +159,7 @@ theorem formPerm_apply_nthLe_length (x : α) (xs : List α) :
#align list.form_perm_apply_nth_le_length List.formPerm_apply_nthLe_length
theorem formPerm_apply_head (x y : α) (xs : List α) (h : Nodup (x :: y :: xs)) :
- formPerm (x :: y :: xs) x = y := by simp [formPerm_apply_of_not_mem _ _ h.not_mem]
+ formPerm (x :: y :: xs) x = y := by simp [formPerm_apply_of_not_mem h.not_mem]
#align list.form_perm_apply_head List.formPerm_apply_head
set_option linter.deprecated false in
@@ -160,49 +178,6 @@ theorem formPerm_eq_head_iff_eq_getLast (x y : α) :
Iff.trans (by rw [formPerm_apply_getLast]) (formPerm (y :: l)).injective.eq_iff
#align list.form_perm_eq_head_iff_eq_last List.formPerm_eq_head_iff_eq_getLast
-theorem zipWith_swap_prod_support' (l l' : List α) :
- { x | (zipWith swap l l').prod x ≠ x } ≤ l.toFinset ⊔ l'.toFinset := by
- simp only [Set.sup_eq_union, Set.le_eq_subset]
- induction' l with y l hl generalizing l'
- · simp
- · cases' l' with z l'
- · simp
- · intro x
- simp only [Set.union_subset_iff, mem_cons, zipWith_cons_cons, foldr, prod_cons,
- mul_apply]
- intro hx
- by_cases h : x ∈ { x | (zipWith swap l l').prod x ≠ x }
- · specialize hl l' h
- simp only [ge_iff_le, Finset.le_eq_subset, Finset.sup_eq_union, Finset.coe_union,
- coe_toFinset, Set.mem_union, Set.mem_setOf_eq] at hl
- refine' Or.elim hl (fun hm => _) fun hm => _ <;>
- · simp only [Finset.coe_insert, Set.mem_insert_iff, Finset.mem_coe, toFinset_cons,
- mem_toFinset] at hm ⊢
- simp [hm]
- · simp only [not_not, Set.mem_setOf_eq] at h
- simp only [h, Set.mem_setOf_eq] at hx
- rw [swap_apply_ne_self_iff] at hx
- rcases hx with ⟨hyz, rfl | rfl⟩ <;> simp
-#align list.zip_with_swap_prod_support' List.zipWith_swap_prod_support'
-
-theorem zipWith_swap_prod_support [Fintype α] (l l' : List α) :
- (zipWith swap l l').prod.support ≤ l.toFinset ⊔ l'.toFinset := by
- intro x hx
- have hx' : x ∈ { x | (zipWith swap l l').prod x ≠ x } := by simpa using hx
- simpa using zipWith_swap_prod_support' _ _ hx'
-#align list.zip_with_swap_prod_support List.zipWith_swap_prod_support
-
-theorem support_formPerm_le' : { x | formPerm l x ≠ x } ≤ l.toFinset := by
- refine' (zipWith_swap_prod_support' l l.tail).trans _
- simpa [Finset.subset_iff] using tail_subset l
-#align list.support_form_perm_le' List.support_formPerm_le'
-
-theorem support_formPerm_le [Fintype α] : support (formPerm l) ≤ l.toFinset := by
- intro x hx
- have hx' : x ∈ { x | formPerm l x ≠ x } := by simpa using hx
- simpa using support_formPerm_le' _ hx'
-#align list.support_form_perm_le List.support_formPerm_le
-
set_option linter.deprecated false in
theorem formPerm_apply_lt (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n + 1 < xs.length) :
formPerm xs (xs.nthLe n ((Nat.lt_succ_self n).trans hn)) = xs.nthLe (n + 1) hn := by
@@ -279,7 +254,7 @@ theorem formPerm_rotate_one (l : List α) (h : Nodup l) : formPerm (l.rotate 1)
· obtain ⟨k, hk, rfl⟩ := nthLe_of_mem hx
rw [formPerm_apply_nthLe _ h', nthLe_rotate l, nthLe_rotate l, formPerm_apply_nthLe _ h]
simp
- · rw [formPerm_apply_of_not_mem _ _ hx, formPerm_apply_of_not_mem]
+ · rw [formPerm_apply_of_not_mem hx, formPerm_apply_of_not_mem]
simpa using hx
#align list.form_perm_rotate_one List.formPerm_rotate_one
@@ -298,33 +273,18 @@ theorem formPerm_eq_of_isRotated {l l' : List α} (hd : Nodup l) (h : l ~r l') :
exact (formPerm_rotate l hd n).symm
#align list.form_perm_eq_of_is_rotated List.formPerm_eq_of_isRotated
-set_option linter.deprecated false in
-theorem formPerm_reverse (l : List α) (h : Nodup l) : formPerm l.reverse = (formPerm l)⁻¹ := by
- -- Let's show `formPerm l` is an inverse to `formPerm l.reverse`.
- rw [eq_comm, inv_eq_iff_mul_eq_one]
- ext x
- -- We only have to check for `x ∈ l` that `formPerm l (formPerm l.reverse x)`
- rw [mul_apply, one_apply]
- cases' Classical.em (x ∈ l) with hx hx
- · obtain ⟨k, hk, rfl⟩ := nthLe_of_mem (mem_reverse.mpr hx)
- have h1 : l.length - 1 - k < l.length := by
- rw [Nat.sub_sub, add_comm]
- exact Nat.sub_lt_self (Nat.succ_pos _) (Nat.succ_le_of_lt (by simpa using hk))
- have h2 : length l - 1 - (k + 1) % length (reverse l) < length l := by
- rw [Nat.sub_sub, length_reverse];
- exact Nat.sub_lt_self (by rw [add_comm]; exact Nat.succ_pos _)
- (by rw [add_comm]; exact Nat.succ_le_of_lt (Nat.mod_lt _ (length_pos_of_mem hx)))
- rw [formPerm_apply_nthLe l.reverse (nodup_reverse.mpr h), nthLe_reverse' _ _ _ h1,
- nthLe_reverse' _ _ _ h2, formPerm_apply_nthLe _ h]
- congr
- rw [length_reverse] at *
- rcases lt_or_eq_of_le (Nat.succ_le_of_lt hk) with h | h
- · rw [Nat.mod_eq_of_lt h, ← Nat.sub_add_comm, Nat.succ_sub_succ_eq_sub,
- Nat.mod_eq_of_lt h1]
- exact (Nat.le_sub_iff_add_le (length_pos_of_mem hx)).2 (Nat.succ_le_of_lt h)
- · rw [← h]; simp
- · rw [formPerm_apply_of_not_mem x l.reverse, formPerm_apply_of_not_mem _ _ hx]
- simpa using hx
+theorem formPerm_append_pair : ∀ (l : List α) (a b : α),
+ formPerm (l ++ [a, b]) = formPerm (l ++ [a]) * swap a b
+ | [], _, _ => rfl
+ | [x], _, _ => rfl
+ | x::y::l, a, b => by
+ simpa [mul_assoc] using formPerm_append_pair (y::l) a b
+
+theorem formPerm_reverse : ∀ l : List α, formPerm l.reverse = (formPerm l)⁻¹
+ | [] => rfl
+ | [_] => rfl
+ | a::b::l => by
+ simp [formPerm_append_pair, swap_comm, ← formPerm_reverse (b::l)]
#align list.form_perm_reverse List.formPerm_reverse
theorem formPerm_pow_apply_get (l : List α) (h : Nodup l) (n k : ℕ) (hk : k < l.length) :
@@ -237,6 +237,13 @@ theorem formPerm_apply_nthLe (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n < x
rw [Nat.mod_eq_of_lt]; simpa [Nat.succ_eq_add_one]
#align list.form_perm_apply_nth_le List.formPerm_apply_nthLe
+-- TODO: prove these the other way around!
+theorem formPerm_apply_get (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n < xs.length) :
+ formPerm xs (xs.get ⟨n, hn⟩) =
+ xs.get ⟨((n + 1) % xs.length), (Nat.mod_lt _ (n.zero_le.trans_lt hn))⟩ :=
+ formPerm_apply_nthLe xs h n hn
+attribute [deprecated formPerm_apply_get] formPerm_apply_nthLe -- 2024-04-23
+
set_option linter.deprecated false in
theorem support_formPerm_of_nodup' (l : List α) (h : Nodup l) (h' : ∀ x : α, l ≠ [x]) :
{ x | formPerm l x ≠ x } = l.toFinset := by
@@ -320,18 +327,24 @@ theorem formPerm_reverse (l : List α) (h : Nodup l) : formPerm l.reverse = (for
simpa using hx
#align list.form_perm_reverse List.formPerm_reverse
-theorem formPerm_pow_apply_nthLe (l : List α) (h : Nodup l) (n k : ℕ) (hk : k < l.length) :
- (formPerm l ^ n) (l.nthLe k hk) =
- l.nthLe ((k + n) % l.length) (Nat.mod_lt _ (k.zero_le.trans_lt hk)) := by
+theorem formPerm_pow_apply_get (l : List α) (h : Nodup l) (n k : ℕ) (hk : k < l.length) :
+ (formPerm l ^ n) (l.get ⟨k, hk⟩) =
+ l.get ⟨((k + n) % l.length), (Nat.mod_lt _ (k.zero_le.trans_lt hk))⟩ := by
induction' n with n hn
· simp [Nat.mod_eq_of_lt hk]
- · simp [pow_succ', mul_apply, hn, formPerm_apply_nthLe _ h, Nat.succ_eq_add_one, ← Nat.add_assoc]
+ · simp [pow_succ', mul_apply, hn, formPerm_apply_get _ h, Nat.succ_eq_add_one, ← Nat.add_assoc]
+
+@[deprecated formPerm_pow_apply_get] -- 2024-04-23
+theorem formPerm_pow_apply_nthLe (l : List α) (h : Nodup l) (n k : ℕ) (hk : k < l.length) :
+ (formPerm l ^ n) (l.nthLe k hk) =
+ l.nthLe ((k + n) % l.length) (Nat.mod_lt _ (k.zero_le.trans_lt hk)) :=
+ formPerm_pow_apply_get l h n k hk
#align list.form_perm_pow_apply_nth_le List.formPerm_pow_apply_nthLe
theorem formPerm_pow_apply_head (x : α) (l : List α) (h : Nodup (x :: l)) (n : ℕ) :
(formPerm (x :: l) ^ n) x =
- (x :: l).nthLe (n % (x :: l).length) (Nat.mod_lt _ (Nat.zero_lt_succ _)) := by
- convert formPerm_pow_apply_nthLe _ h n 0 (Nat.succ_pos _)
+ (x :: l).get ⟨(n % (x :: l).length), (Nat.mod_lt _ (Nat.zero_lt_succ _))⟩ := by
+ convert formPerm_pow_apply_get _ h n 0 (Nat.succ_pos _)
simp
#align list.form_perm_pow_apply_head List.formPerm_pow_apply_head
@@ -390,7 +390,7 @@ theorem formPerm_apply_mem_eq_self_iff (hl : Nodup l) (x : α) (hx : x ∈ l) :
theorem formPerm_apply_mem_ne_self_iff (hl : Nodup l) (x : α) (hx : x ∈ l) :
formPerm l x ≠ x ↔ 2 ≤ l.length := by
- rw [Ne.def, formPerm_apply_mem_eq_self_iff _ hl x hx, not_le]
+ rw [Ne, formPerm_apply_mem_eq_self_iff _ hl x hx, not_le]
exact ⟨Nat.succ_le_of_lt, Nat.lt_of_succ_le⟩
#align list.form_perm_apply_mem_ne_self_iff List.formPerm_apply_mem_ne_self_iff
We change the following field in the definition of an additive commutative monoid:
nsmul_succ : ∀ (n : ℕ) (x : G),
- AddMonoid.nsmul (n + 1) x = x + AddMonoid.nsmul n x
+ AddMonoid.nsmul (n + 1) x = AddMonoid.nsmul n x + x
where the latter is more natural
We adjust the definitions of ^
in monoids, groups, etc.
Originally there was a warning comment about why this natural order was preferred
use
x * npowRec n x
and notnpowRec n x * x
in the definition to make sure that definitional unfolding ofnpowRec
is blocked, to avoid deep recursion issues.
but it seems to no longer apply.
Remarks on the PR :
pow_succ
and pow_succ'
have switched their meanings.Ideal.IsPrime.mul_mem_pow
which is defined in [Mathlib/RingTheory/DedekindDomain/Ideal.lean]. Changing the order of operation forced me to add the symmetric lemma Ideal.IsPrime.mem_pow_mul
.@@ -325,7 +325,7 @@ theorem formPerm_pow_apply_nthLe (l : List α) (h : Nodup l) (n k : ℕ) (hk : k
l.nthLe ((k + n) % l.length) (Nat.mod_lt _ (k.zero_le.trans_lt hk)) := by
induction' n with n hn
· simp [Nat.mod_eq_of_lt hk]
- · simp [pow_succ, mul_apply, hn, formPerm_apply_nthLe _ h, Nat.succ_eq_add_one, ← Nat.add_assoc]
+ · simp [pow_succ', mul_apply, hn, formPerm_apply_nthLe _ h, Nat.succ_eq_add_one, ← Nat.add_assoc]
#align list.form_perm_pow_apply_nth_le List.formPerm_pow_apply_nthLe
theorem formPerm_pow_apply_head (x : α) (l : List α) (h : Nodup (x :: l)) (n : ℕ) :
This is a very large PR, but it has been reviewed piecemeal already in PRs to the bump/v4.7.0
branch as we update to intermediate nightlies.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: damiano <adomani@gmail.com>
@@ -94,7 +94,7 @@ theorem formPerm_apply_mem_of_mem (x : α) (l : List α) (h : x ∈ l) : formPer
split_ifs
· simp [IH _ _ hx]
· simp
- · simpa [*] using IH _ _ hx
+ · simp [*]
· replace h : x = y := Or.resolve_right (mem_cons.1 h) hx
simp [formPerm_apply_of_not_mem _ _ hx, ← h]
#align list.form_perm_apply_mem_of_mem List.formPerm_apply_mem_of_mem
cases'
(#9171)
I literally went through and regex'd some uses of cases'
, replacing them with rcases
; this is meant to be a low effort PR as I hope that tools can do this in the future.
rcases
is an easier replacement than cases
, though with better tools we could in future do a second pass converting simple rcases
added here (and existing ones) to cases
.
@@ -249,7 +249,7 @@ theorem support_formPerm_of_nodup' (l : List α) (h : Nodup l) (h' : ∀ x : α,
intro H
rw [nodup_iff_nthLe_inj] at h
specialize h _ _ _ _ H
- cases' (Nat.succ_le_of_lt hn).eq_or_lt with hn' hn'
+ rcases (Nat.succ_le_of_lt hn).eq_or_lt with hn' | hn'
· simp only [← hn', Nat.mod_self] at h
refine' not_exists.mpr h' _
rw [← length_eq_one]
@@ -311,7 +311,7 @@ theorem formPerm_reverse (l : List α) (h : Nodup l) : formPerm l.reverse = (for
nthLe_reverse' _ _ _ h2, formPerm_apply_nthLe _ h]
congr
rw [length_reverse] at *
- cases' lt_or_eq_of_le (Nat.succ_le_of_lt hk) with h h
+ rcases lt_or_eq_of_le (Nat.succ_le_of_lt hk) with h | h
· rw [Nat.mod_eq_of_lt h, ← Nat.sub_add_comm, Nat.succ_sub_succ_eq_sub,
Nat.mod_eq_of_lt h1]
exact (Nat.le_sub_iff_add_le (length_pos_of_mem hx)).2 (Nat.succ_le_of_lt h)
@@ -382,7 +382,7 @@ theorem formPerm_apply_mem_eq_self_iff (hl : Nodup l) (x : α) (hx : x ∈ l) :
cases hn : l.length
· exact absurd k.zero_le (hk.trans_le hn.le).not_le
· rw [hn] at hk
- cases' (Nat.le_of_lt_succ hk).eq_or_lt with hk' hk'
+ rcases (Nat.le_of_lt_succ hk).eq_or_lt with hk' | hk'
· simp [← hk', Nat.succ_le_succ_iff, eq_comm]
· simpa [Nat.mod_eq_of_lt (Nat.succ_lt_succ hk'), Nat.succ_lt_succ_iff] using
k.zero_le.trans_lt hk'
imp_false
a simp-lemma (#8744)
¬ p
to p → False
, which is probably why we didn't miss this simp-lemma too badly.simp
pull out most connectives into Filter.eventually
/Filter.frequently
, but pushed negations inside. This loops together with this new simp-lemma, and the fact that there is a unification hint . So I removed some simp attributes in Filter.Basic
.@@ -113,8 +113,6 @@ theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l
List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
simp only [List.mem_cons]
rcases h with h | h | h <;> split_ifs at h with h1 <;> try { aesop }
- · simp [h1, imp_false] at h
- simp [h]
#align list.mem_of_form_perm_apply_mem List.mem_of_formPerm_apply_mem
theorem formPerm_mem_iff_mem : l.formPerm x ∈ l ↔ x ∈ l :=
Due to recent changes in core we can reduce or remove many set_option maxHeartbeats
statements.
I have tried to be careful to not leave anything too close to the line, so don't be surprised if some of these can still be reduced further.
This reduces us from 96 maxHeartbeats
statements to 44
. (There are 10 false positives in meta or testing code.)
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
@@ -99,7 +99,6 @@ theorem formPerm_apply_mem_of_mem (x : α) (l : List α) (h : x ∈ l) : formPer
simp [formPerm_apply_of_not_mem _ _ hx, ← h]
#align list.form_perm_apply_mem_of_mem List.formPerm_apply_mem_of_mem
-set_option maxHeartbeats 220000 in
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
cases' l with y l
· simp at h
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -31,7 +31,7 @@ nontrivial permutation that is noncyclic.
namespace List
-variable {α β : Type _}
+variable {α β : Type*}
section FormPerm
Various adaptations to changes when Fin
API was moved to Std. One notable change is that many lemmas are now stated in terms of i ≠ 0
(for i : Fin n
) rather then i.1 ≠ 0
, and as a consequence many Fin.vne_of_ne
applications have been added or removed, mostly removed.
Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Wojciech Nawrocki <wjnawrocki@protonmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
@@ -302,7 +302,7 @@ theorem formPerm_reverse (l : List α) (h : Nodup l) : formPerm l.reverse = (for
-- We only have to check for `x ∈ l` that `formPerm l (formPerm l.reverse x)`
rw [mul_apply, one_apply]
cases' Classical.em (x ∈ l) with hx hx
- · obtain ⟨k, hk, rfl⟩ := nthLe_of_mem ((mem_reverse _ _).mpr hx)
+ · obtain ⟨k, hk, rfl⟩ := nthLe_of_mem (mem_reverse.mpr hx)
have h1 : l.length - 1 - k < l.length := by
rw [Nat.sub_sub, add_comm]
exact Nat.sub_lt_self (Nat.succ_pos _) (Nat.succ_le_of_lt (by simpa using hk))
@@ -2,15 +2,12 @@
Copyright (c) 2021 Yakov Pechersky. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Yakov Pechersky
-
-! This file was ported from Lean 3 source module group_theory.perm.list
-! leanprover-community/mathlib commit 9003f28797c0664a49e4179487267c494477d853
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Data.List.Rotate
import Mathlib.GroupTheory.Perm.Support
+#align_import group_theory.perm.list from "leanprover-community/mathlib"@"9003f28797c0664a49e4179487267c494477d853"
+
/-!
# Permutations from a list
Co-authored-by: Komyyy <pol_tta@outlook.jp> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Mario Carneiro <di.gama@gmail.com>
@@ -102,6 +102,7 @@ theorem formPerm_apply_mem_of_mem (x : α) (l : List α) (h : x ∈ l) : formPer
simp [formPerm_apply_of_not_mem _ _ hx, ← h]
#align list.form_perm_apply_mem_of_mem List.formPerm_apply_mem_of_mem
+set_option maxHeartbeats 220000 in
theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l) : x ∈ l := by
cases' l with y l
· simp at h
This PR is the result of running
find . -type f -name "*.lean" -exec sed -i -E 's/^( +)\. /\1· /' {} \;
find . -type f -name "*.lean" -exec sed -i -E 'N;s/^( +·)\n +(.*)$/\1 \2/;P;D' {} \;
which firstly replaces .
focusing dots with ·
and secondly removes isolated instances of such dots, unifying them with the following line. A new rule is placed in the style linter to verify this.
@@ -95,9 +95,9 @@ theorem formPerm_apply_mem_of_mem (x : α) (l : List α) (h : x ∈ l) : formPer
· by_cases hx : x ∈ z :: l
· rw [formPerm_cons_cons, mul_apply, swap_apply_def]
split_ifs
- . simp [IH _ _ hx]
- . simp
- . simpa [*] using IH _ _ hx
+ · simp [IH _ _ hx]
+ · simp
+ · simpa [*] using IH _ _ hx
· replace h : x = y := Or.resolve_right (mem_cons.1 h) hx
simp [formPerm_apply_of_not_mem _ _ hx, ← h]
#align list.form_perm_apply_mem_of_mem List.formPerm_apply_mem_of_mem
@@ -116,7 +116,7 @@ theorem mem_of_formPerm_apply_mem (x : α) (l : List α) (h : l.formPerm x ∈ l
List.mem_cons, swap_apply_def, ite_eq_left_iff] at h
simp only [List.mem_cons]
rcases h with h | h | h <;> split_ifs at h with h1 <;> try { aesop }
- . simp [h1, imp_false] at h
+ · simp [h1, imp_false] at h
simp [h]
#align list.mem_of_form_perm_apply_mem List.mem_of_formPerm_apply_mem
@@ -221,7 +221,7 @@ theorem formPerm_apply_lt (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n + 1 <
simp only [swap_apply_eq_iff, coe_mul, formPerm_cons_cons, Function.comp]
simp only [nthLe, get_cons_succ] at *
rw [← IH, swap_apply_of_ne_of_ne] <;>
- . intro hx
+ · intro hx
rw [← hx, IH] at h
simp [get_mem] at h
#align list.form_perm_apply_lt List.formPerm_apply_lt
@@ -304,7 +304,7 @@ theorem formPerm_reverse (l : List α) (h : Nodup l) : formPerm l.reverse = (for
-- We only have to check for `x ∈ l` that `formPerm l (formPerm l.reverse x)`
rw [mul_apply, one_apply]
cases' Classical.em (x ∈ l) with hx hx
- . obtain ⟨k, hk, rfl⟩ := nthLe_of_mem ((mem_reverse _ _).mpr hx)
+ · obtain ⟨k, hk, rfl⟩ := nthLe_of_mem ((mem_reverse _ _).mpr hx)
have h1 : l.length - 1 - k < l.length := by
rw [Nat.sub_sub, add_comm]
exact Nat.sub_lt_self (Nat.succ_pos _) (Nat.succ_le_of_lt (by simpa using hk))
@@ -317,10 +317,10 @@ theorem formPerm_reverse (l : List α) (h : Nodup l) : formPerm l.reverse = (for
congr
rw [length_reverse] at *
cases' lt_or_eq_of_le (Nat.succ_le_of_lt hk) with h h
- . rw [Nat.mod_eq_of_lt h, ← Nat.sub_add_comm, Nat.succ_sub_succ_eq_sub,
+ · rw [Nat.mod_eq_of_lt h, ← Nat.sub_add_comm, Nat.succ_sub_succ_eq_sub,
Nat.mod_eq_of_lt h1]
exact (Nat.le_sub_iff_add_le (length_pos_of_mem hx)).2 (Nat.succ_le_of_lt h)
- . rw [← h]; simp
+ · rw [← h]; simp
· rw [formPerm_apply_of_not_mem x l.reverse, formPerm_apply_of_not_mem _ _ hx]
simpa using hx
#align list.form_perm_reverse List.formPerm_reverse
@@ -389,8 +389,7 @@ theorem formPerm_apply_mem_eq_self_iff (hl : Nodup l) (x : α) (hx : x ∈ l) :
· rw [hn] at hk
cases' (Nat.le_of_lt_succ hk).eq_or_lt with hk' hk'
· simp [← hk', Nat.succ_le_succ_iff, eq_comm]
- ·
- simpa [Nat.mod_eq_of_lt (Nat.succ_lt_succ hk'), Nat.succ_lt_succ_iff] using
+ · simpa [Nat.mod_eq_of_lt (Nat.succ_lt_succ hk'), Nat.succ_lt_succ_iff] using
k.zero_le.trans_lt hk'
#align list.form_perm_apply_mem_eq_self_iff List.formPerm_apply_mem_eq_self_iff
at
and goals (#5387)
Changes are of the form
some_tactic at h⊢
-> some_tactic at h ⊢
some_tactic at h
-> some_tactic at h
@@ -182,7 +182,7 @@ theorem zipWith_swap_prod_support' (l l' : List α) :
coe_toFinset, Set.mem_union, Set.mem_setOf_eq] at hl
refine' Or.elim hl (fun hm => _) fun hm => _ <;>
· simp only [Finset.coe_insert, Set.mem_insert_iff, Finset.mem_coe, toFinset_cons,
- mem_toFinset] at hm⊢
+ mem_toFinset] at hm ⊢
simp [hm]
· simp only [not_not, Set.mem_setOf_eq] at h
simp only [h, Set.mem_setOf_eq] at hx
@@ -350,7 +350,7 @@ theorem formPerm_ext_iff {x y x' y' : α} {l l' : List α} (hd : Nodup (x :: y :
have : x' ∈ { z | formPerm (x :: y :: l) z ≠ z } := by
rw [Set.mem_setOf_eq, h x', formPerm_apply_head _ _ _ hd']
simp only [mem_cons, nodup_cons] at hd'
- push_neg at hd'
+ push_neg at hd'
exact hd'.left.left.symm
simpa using support_formPerm_le' _ this
obtain ⟨n, hn, hx'⟩ := nthLe_of_mem hx
@@ -14,7 +14,7 @@ import Mathlib.GroupTheory.Perm.Support
/-!
# Permutations from a list
-A list `l : List α` can be interpreted as a `Equiv.Perm α` where each element in the list
+A list `l : List α` can be interpreted as an `Equiv.Perm α` where each element in the list
is permuted to the next one, defined as `formPerm`. When we have that `Nodup l`,
we prove that `Equiv.Perm.support (formPerm l) = l.toFinset`, and that
`formPerm l` is rotationally invariant, in `formPerm_rotate`.
@@ -42,7 +42,7 @@ variable [DecidableEq α] (l : List α)
open Equiv Equiv.Perm
-/-- A list `l : List α` can be interpreted as a `Equiv.Perm α` where each element in the list
+/-- A list `l : List α` can be interpreted as an `Equiv.Perm α` where each element in the list
is permuted to the next one, defined as `formPerm`. When we have that `Nodup l`,
we prove that `Equiv.Perm.support (formPerm l) = l.toFinset`, and that
`formPerm l` is rotationally invariant, in `formPerm_rotate`.
by
s! (#3825)
This PR puts, with one exception, every single remaining by
that lies all by itself on its own line to the previous line, thus matching the current behaviour of start-port.sh
. The exception is when the by
begins the second or later argument to a tuple or anonymous constructor; see https://github.com/leanprover-community/mathlib4/pull/3825#discussion_r1186702599.
Essentially this is s/\n *by$/ by/g
, but with manual editing to satisfy the linter's max-100-char-line requirement. The Python style linter is also modified to catch these "isolated by
s".
@@ -270,8 +270,7 @@ theorem support_formPerm_of_nodup [Fintype α] (l : List α) (h : Nodup l) (h' :
#align list.support_form_perm_of_nodup List.support_formPerm_of_nodup
set_option linter.deprecated false in
-theorem formPerm_rotate_one (l : List α) (h : Nodup l) : formPerm (l.rotate 1) = formPerm l :=
- by
+theorem formPerm_rotate_one (l : List α) (h : Nodup l) : formPerm (l.rotate 1) = formPerm l := by
have h' : Nodup (l.rotate 1) := by simpa using h
ext x
by_cases hx : x ∈ l.rotate 1
@@ -328,8 +327,7 @@ theorem formPerm_reverse (l : List α) (h : Nodup l) : formPerm l.reverse = (for
theorem formPerm_pow_apply_nthLe (l : List α) (h : Nodup l) (n k : ℕ) (hk : k < l.length) :
(formPerm l ^ n) (l.nthLe k hk) =
- l.nthLe ((k + n) % l.length) (Nat.mod_lt _ (k.zero_le.trans_lt hk)) :=
- by
+ l.nthLe ((k + n) % l.length) (Nat.mod_lt _ (k.zero_le.trans_lt hk)) := by
induction' n with n hn
· simp [Nat.mod_eq_of_lt hk]
· simp [pow_succ, mul_apply, hn, formPerm_apply_nthLe _ h, Nat.succ_eq_add_one, ← Nat.add_assoc]
@@ -345,22 +343,18 @@ theorem formPerm_pow_apply_head (x : α) (l : List α) (h : Nodup (x :: l)) (n :
set_option linter.deprecated false in
theorem formPerm_ext_iff {x y x' y' : α} {l l' : List α} (hd : Nodup (x :: y :: l))
(hd' : Nodup (x' :: y' :: l')) :
- formPerm (x :: y :: l) = formPerm (x' :: y' :: l') ↔ (x :: y :: l) ~r (x' :: y' :: l') :=
- by
+ formPerm (x :: y :: l) = formPerm (x' :: y' :: l') ↔ (x :: y :: l) ~r (x' :: y' :: l') := by
refine' ⟨fun h => _, fun hr => formPerm_eq_of_isRotated hd hr⟩
rw [Equiv.Perm.ext_iff] at h
- have hx : x' ∈ x :: y :: l :=
- by
- have : x' ∈ { z | formPerm (x :: y :: l) z ≠ z } :=
- by
+ have hx : x' ∈ x :: y :: l := by
+ have : x' ∈ { z | formPerm (x :: y :: l) z ≠ z } := by
rw [Set.mem_setOf_eq, h x', formPerm_apply_head _ _ _ hd']
simp only [mem_cons, nodup_cons] at hd'
push_neg at hd'
exact hd'.left.left.symm
simpa using support_formPerm_le' _ this
obtain ⟨n, hn, hx'⟩ := nthLe_of_mem hx
- have hl : (x :: y :: l).length = (x' :: y' :: l').length :=
- by
+ have hl : (x :: y :: l).length = (x' :: y' :: l').length := by
rw [← dedup_eq_self.mpr hd, ← dedup_eq_self.mpr hd', ← card_toFinset, ← card_toFinset]
refine' congr_arg Finset.card _
rw [← Finset.coe_inj, ← support_formPerm_of_nodup' _ hd (by simp), ←
@@ -387,8 +381,7 @@ theorem formPerm_ext_iff {x y x' y' : α} {l l' : List α} (hd : Nodup (x :: y :
set_option linter.deprecated false in
theorem formPerm_apply_mem_eq_self_iff (hl : Nodup l) (x : α) (hx : x ∈ l) :
- formPerm l x = x ↔ length l ≤ 1 :=
- by
+ formPerm l x = x ↔ length l ≤ 1 := by
obtain ⟨k, hk, rfl⟩ := nthLe_of_mem hx
rw [formPerm_apply_nthLe _ hl, hl.nthLe_inj_iff]
cases hn : l.length
@@ -402,16 +395,13 @@ theorem formPerm_apply_mem_eq_self_iff (hl : Nodup l) (x : α) (hx : x ∈ l) :
#align list.form_perm_apply_mem_eq_self_iff List.formPerm_apply_mem_eq_self_iff
theorem formPerm_apply_mem_ne_self_iff (hl : Nodup l) (x : α) (hx : x ∈ l) :
- formPerm l x ≠ x ↔ 2 ≤ l.length :=
- by
+ formPerm l x ≠ x ↔ 2 ≤ l.length := by
rw [Ne.def, formPerm_apply_mem_eq_self_iff _ hl x hx, not_le]
exact ⟨Nat.succ_le_of_lt, Nat.lt_of_succ_le⟩
#align list.form_perm_apply_mem_ne_self_iff List.formPerm_apply_mem_ne_self_iff
-theorem mem_of_formPerm_ne_self (l : List α) (x : α) (h : formPerm l x ≠ x) : x ∈ l :=
- by
- suffices x ∈ { y | formPerm l y ≠ y }
- by
+theorem mem_of_formPerm_ne_self (l : List α) (x : α) (h : formPerm l x ≠ x) : x ∈ l := by
+ suffices x ∈ { y | formPerm l y ≠ y } by
rw [← mem_toFinset]
exact support_formPerm_le' _ this
simpa using h
@@ -421,8 +411,7 @@ theorem formPerm_eq_self_of_not_mem (l : List α) (x : α) (h : x ∉ l) : formP
by_contra fun H => h <| mem_of_formPerm_ne_self _ _ H
#align list.form_perm_eq_self_of_not_mem List.formPerm_eq_self_of_not_mem
-theorem formPerm_eq_one_iff (hl : Nodup l) : formPerm l = 1 ↔ l.length ≤ 1 :=
- by
+theorem formPerm_eq_one_iff (hl : Nodup l) : formPerm l = 1 ↔ l.length ≤ 1 := by
cases' l with hd tl
· simp
· rw [← formPerm_apply_mem_eq_self_iff _ hl hd (mem_cons_self _ _)]
@@ -435,8 +424,7 @@ theorem formPerm_eq_one_iff (hl : Nodup l) : formPerm l = 1 ↔ l.length ≤ 1 :
#align list.form_perm_eq_one_iff List.formPerm_eq_one_iff
theorem formPerm_eq_formPerm_iff {l l' : List α} (hl : l.Nodup) (hl' : l'.Nodup) :
- l.formPerm = l'.formPerm ↔ l ~r l' ∨ l.length ≤ 1 ∧ l'.length ≤ 1 :=
- by
+ l.formPerm = l'.formPerm ↔ l ~r l' ∨ l.length ≤ 1 ∧ l'.length ≤ 1 := by
rcases l with (_ | ⟨x, _ | ⟨y, l⟩⟩)
· suffices l'.length ≤ 1 ↔ l' = nil ∨ l'.length ≤ 1 by
simpa [eq_comm, formPerm_eq_one_iff, hl, hl', length_eq_zero]
@@ -472,8 +460,7 @@ theorem formPerm_pow_length_eq_one_of_nodup (hl : Nodup l) : formPerm l ^ length
by_cases hx : x ∈ l
· obtain ⟨k, hk, rfl⟩ := nthLe_of_mem hx
simp [formPerm_pow_apply_nthLe _ hl, Nat.mod_eq_of_lt hk]
- · have : x ∉ { x | (l.formPerm ^ l.length) x ≠ x } :=
- by
+ · have : x ∉ { x | (l.formPerm ^ l.length) x ≠ x } := by
intro H
refine' hx _
replace H := set_support_zpow_subset l.formPerm l.length H
Lotsa stuff to do, please help. Also, Equiv.Perm.Support
should be named Equiv.Perm.support
, right? I carried out that renaming in here.
Co-authored-by: Moritz Firsching <firsching@google.com> Co-authored-by: Ruben Van de Velde <65514131+Ruben-VandeVelde@users.noreply.github.com> Co-authored-by: Arien Malec <arien.malec@gmail.com> Co-authored-by: Parcly Taxel <reddeloostw@gmail.com> Co-authored-by: ChrisHughes24 <chrishughes24@gmail.com>
@@ -191,7 +191,7 @@ theorem zipWith_swap_prod_support' (l l' : List α) :
#align list.zip_with_swap_prod_support' List.zipWith_swap_prod_support'
theorem zipWith_swap_prod_support [Fintype α] (l l' : List α) :
- (zipWith swap l l').prod.Support ≤ l.toFinset ⊔ l'.toFinset := by
+ (zipWith swap l l').prod.support ≤ l.toFinset ⊔ l'.toFinset := by
intro x hx
have hx' : x ∈ { x | (zipWith swap l l').prod x ≠ x } := by simpa using hx
simpa using zipWith_swap_prod_support' _ _ hx'
@@ -202,7 +202,7 @@ theorem support_formPerm_le' : { x | formPerm l x ≠ x } ≤ l.toFinset := by
simpa [Finset.subset_iff] using tail_subset l
#align list.support_form_perm_le' List.support_formPerm_le'
-theorem support_formPerm_le [Fintype α] : Support (formPerm l) ≤ l.toFinset := by
+theorem support_formPerm_le [Fintype α] : support (formPerm l) ≤ l.toFinset := by
intro x hx
have hx' : x ∈ { x | formPerm l x ≠ x } := by simpa using hx
simpa using support_formPerm_le' _ hx'
@@ -263,7 +263,7 @@ theorem support_formPerm_of_nodup' (l : List α) (h : Nodup l) (h' : ∀ x : α,
#align list.support_form_perm_of_nodup' List.support_formPerm_of_nodup'
theorem support_formPerm_of_nodup [Fintype α] (l : List α) (h : Nodup l) (h' : ∀ x : α, l ≠ [x]) :
- Support (formPerm l) = l.toFinset := by
+ support (formPerm l) = l.toFinset := by
rw [← Finset.coe_inj]
convert support_formPerm_of_nodup' _ h h'
simp [Set.ext_iff]
The unported dependencies are