data.fintype.perm
⟷
Mathlib.Data.Fintype.Perm
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)
(last sync)
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -64,8 +64,8 @@ theorem mem_permsOfList_of_mem {l : List α} {f : Perm α} (h : ∀ x, f x ≠ x
intro x hx
have hxa : x ≠ a := by rintro rfl; apply hx; simp only [mul_apply, swap_apply_right]
refine' List.mem_of_ne_of_mem hxa (h x fun h => _)
- simp only [h, mul_apply, swap_apply_def, mul_apply, Ne.def, apply_eq_iff_eq] at hx <;>
- split_ifs at hx
+ simp only [h, mul_apply, swap_apply_def, mul_apply, Ne.def, apply_eq_iff_eq] at hx <;>
+ split_ifs at hx
exacts [hxa (h.symm.trans h_1), hx h]
suffices f ∈ permsOfList l ∨ ∃ b ∈ l, ∃ g ∈ permsOfList l, swap a b * g = f by
simpa only [permsOfList, exists_prop, List.mem_map, mem_append, List.mem_bind]
mathlib commit https://github.com/leanprover-community/mathlib/commit/65a1391a0106c9204fe45bc73a039f056558cb83
@@ -69,7 +69,7 @@ theorem mem_permsOfList_of_mem {l : List α} {f : Perm α} (h : ∀ x, f x ≠ x
exacts [hxa (h.symm.trans h_1), hx h]
suffices f ∈ permsOfList l ∨ ∃ b ∈ l, ∃ g ∈ permsOfList l, swap a b * g = f by
simpa only [permsOfList, exists_prop, List.mem_map, mem_append, List.mem_bind]
- refine' or_iff_not_imp_left.2 fun hfl => ⟨f a, _, swap a (f a) * f, IH this, _⟩
+ refine' Classical.or_iff_not_imp_left.2 fun hfl => ⟨f a, _, swap a (f a) * f, IH this, _⟩
· exact mem_of_ne_of_mem hfa (h _ hfa')
· rw [← mul_assoc, mul_def (swap a (f a)) (swap a (f a)), swap_swap, ← perm.one_def, one_mul]
#align mem_perms_of_list_of_mem mem_permsOfList_of_mem
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce64cd319bb6b3e82f31c2d38e79080d377be451
@@ -3,8 +3,8 @@ Copyright (c) 2017 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-/
-import Mathbin.Data.Fintype.Card
-import Mathbin.GroupTheory.Perm.Basic
+import Data.Fintype.Card
+import GroupTheory.Perm.Basic
#align_import data.fintype.perm from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977"
mathlib commit https://github.com/leanprover-community/mathlib/commit/8ea5598db6caeddde6cb734aa179cc2408dbd345
@@ -2,15 +2,12 @@
Copyright (c) 2017 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-
-! This file was ported from Lean 3 source module data.fintype.perm
-! leanprover-community/mathlib commit 0a0ec35061ed9960bf0e7ffb0335f44447b58977
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathbin.Data.Fintype.Card
import Mathbin.GroupTheory.Perm.Basic
+#align_import data.fintype.perm from "leanprover-community/mathlib"@"0a0ec35061ed9960bf0e7ffb0335f44447b58977"
+
/-!
# fintype instances for `equiv` and `perm`
mathlib commit https://github.com/leanprover-community/mathlib/commit/9fb8964792b4237dac6200193a0d533f1b3f7423
@@ -177,12 +177,16 @@ instance [Fintype α] [Fintype β] : Fintype (α ≃ β) :=
(equivCongr (Equiv.refl α) (eα.trans (Eq.recOn h eβ.symm)) : α ≃ α ≃ (α ≃ β))
else ⟨∅, fun x => False.elim (h (Fintype.card_eq.2 ⟨x.symm⟩))⟩
+#print Fintype.card_perm /-
theorem Fintype.card_perm [Fintype α] : Fintype.card (Perm α) = (Fintype.card α)! :=
Subsingleton.elim (@fintypePerm α _ _) (@Equiv.fintype α α _ _ _ _) ▸ card_perms_of_finset _
#align fintype.card_perm Fintype.card_perm
+-/
+#print Fintype.card_equiv /-
theorem Fintype.card_equiv [Fintype α] [Fintype β] (e : α ≃ β) :
Fintype.card (α ≃ β) = (Fintype.card α)! :=
Fintype.card_congr (equivCongr (Equiv.refl α) e) ▸ Fintype.card_perm
#align fintype.card_equiv Fintype.card_equiv
+-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/5f25c089cb34db4db112556f23c50d12da81b297
@@ -68,7 +68,7 @@ theorem mem_permsOfList_of_mem {l : List α} {f : Perm α} (h : ∀ x, f x ≠ x
have hxa : x ≠ a := by rintro rfl; apply hx; simp only [mul_apply, swap_apply_right]
refine' List.mem_of_ne_of_mem hxa (h x fun h => _)
simp only [h, mul_apply, swap_apply_def, mul_apply, Ne.def, apply_eq_iff_eq] at hx <;>
- split_ifs at hx
+ split_ifs at hx
exacts [hxa (h.symm.trans h_1), hx h]
suffices f ∈ permsOfList l ∨ ∃ b ∈ l, ∃ g ∈ permsOfList l, swap a b * g = f by
simpa only [permsOfList, exists_prop, List.mem_map, mem_append, List.mem_bind]
mathlib commit https://github.com/leanprover-community/mathlib/commit/cca40788df1b8755d5baf17ab2f27dacc2e17acb
@@ -67,9 +67,9 @@ theorem mem_permsOfList_of_mem {l : List α} {f : Perm α} (h : ∀ x, f x ≠ x
intro x hx
have hxa : x ≠ a := by rintro rfl; apply hx; simp only [mul_apply, swap_apply_right]
refine' List.mem_of_ne_of_mem hxa (h x fun h => _)
- simp only [h, mul_apply, swap_apply_def, mul_apply, Ne.def, apply_eq_iff_eq] at hx <;>
- split_ifs at hx
- exacts[hxa (h.symm.trans h_1), hx h]
+ simp only [h, mul_apply, swap_apply_def, mul_apply, Ne.def, apply_eq_iff_eq] at hx <;>
+ split_ifs at hx
+ exacts [hxa (h.symm.trans h_1), hx h]
suffices f ∈ permsOfList l ∨ ∃ b ∈ l, ∃ g ∈ permsOfList l, swap a b * g = f by
simpa only [permsOfList, exists_prop, List.mem_map, mem_append, List.mem_bind]
refine' or_iff_not_imp_left.2 fun hfl => ⟨f a, _, swap a (f a) * f, IH this, _⟩
@@ -97,7 +97,7 @@ theorem mem_of_mem_permsOfList :
mem_of_mem_permsOfList hg₁ <| by
rw [eq_inv_mul_iff_mul_eq.2 hg₂, mul_apply, swap_inv, swap_apply_def] <;>
split_ifs <;>
- [exact Ne.symm hxy;exact Ne.symm hxa;exact hx]
+ [exact Ne.symm hxy; exact Ne.symm hxa; exact hx]
#align mem_of_mem_perms_of_list mem_of_mem_permsOfList
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -25,7 +25,7 @@ Main declarations:
open Function
-open Nat
+open scoped Nat
universe u v
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -177,22 +177,10 @@ instance [Fintype α] [Fintype β] : Fintype (α ≃ β) :=
(equivCongr (Equiv.refl α) (eα.trans (Eq.recOn h eβ.symm)) : α ≃ α ≃ (α ≃ β))
else ⟨∅, fun x => False.elim (h (Fintype.card_eq.2 ⟨x.symm⟩))⟩
-/- warning: fintype.card_perm -> Fintype.card_perm is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] [_inst_3 : Fintype.{u1} α], Eq.{1} Nat (Fintype.card.{u1} (Equiv.Perm.{succ u1} α) (Equiv.fintype.{u1, u1} α α (fun (a : α) (b : α) => _inst_1 a b) (fun (a : α) (b : α) => _inst_1 a b) _inst_3 _inst_3)) (Nat.factorial (Fintype.card.{u1} α _inst_3))
-but is expected to have type
- forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] [_inst_3 : Fintype.{u1} α], Eq.{1} Nat (Fintype.card.{u1} (Equiv.Perm.{succ u1} α) (equivFintype.{u1, u1} α α (fun (a : α) (b : α) => _inst_1 a b) (fun (a : α) (b : α) => _inst_1 a b) _inst_3 _inst_3)) (Nat.factorial (Fintype.card.{u1} α _inst_3))
-Case conversion may be inaccurate. Consider using '#align fintype.card_perm Fintype.card_permₓ'. -/
theorem Fintype.card_perm [Fintype α] : Fintype.card (Perm α) = (Fintype.card α)! :=
Subsingleton.elim (@fintypePerm α _ _) (@Equiv.fintype α α _ _ _ _) ▸ card_perms_of_finset _
#align fintype.card_perm Fintype.card_perm
-/- warning: fintype.card_equiv -> Fintype.card_equiv is a dubious translation:
-lean 3 declaration is
- forall {α : Type.{u1}} {β : Type.{u2}} [_inst_1 : DecidableEq.{succ u1} α] [_inst_2 : DecidableEq.{succ u2} β] [_inst_3 : Fintype.{u1} α] [_inst_4 : Fintype.{u2} β], (Equiv.{succ u1, succ u2} α β) -> (Eq.{1} Nat (Fintype.card.{max (max u1 u2) u2 u1} (Equiv.{succ u1, succ u2} α β) (Equiv.fintype.{u1, u2} α β (fun (a : α) (b : α) => _inst_1 a b) (fun (a : β) (b : β) => _inst_2 a b) _inst_3 _inst_4)) (Nat.factorial (Fintype.card.{u1} α _inst_3)))
-but is expected to have type
- forall {α : Type.{u2}} {β : Type.{u1}} [_inst_1 : DecidableEq.{succ u2} α] [_inst_2 : DecidableEq.{succ u1} β] [_inst_3 : Fintype.{u2} α] [_inst_4 : Fintype.{u1} β], (Equiv.{succ u2, succ u1} α β) -> (Eq.{1} Nat (Fintype.card.{max u2 u1} (Equiv.{succ u2, succ u1} α β) (equivFintype.{u2, u1} α β (fun (a : α) (b : α) => _inst_1 a b) (fun (a : β) (b : β) => _inst_2 a b) _inst_3 _inst_4)) (Nat.factorial (Fintype.card.{u2} α _inst_3)))
-Case conversion may be inaccurate. Consider using '#align fintype.card_equiv Fintype.card_equivₓ'. -/
theorem Fintype.card_equiv [Fintype α] [Fintype β] (e : α ≃ β) :
Fintype.card (α ≃ β) = (Fintype.card α)! :=
Fintype.card_congr (equivCongr (Equiv.refl α) e) ▸ Fintype.card_perm
mathlib commit https://github.com/leanprover-community/mathlib/commit/917c3c072e487b3cccdbfeff17e75b40e45f66cb
@@ -60,16 +60,12 @@ theorem mem_permsOfList_of_mem {l : List α} {f : Perm α} (h : ∀ x, f x ≠ x
· exact List.mem_singleton.2 (Equiv.ext fun x => Decidable.by_contradiction <| h _)
by_cases hfa : f a = a
· refine' mem_append_left _ (IH fun x hx => mem_of_ne_of_mem _ (h x hx))
- rintro rfl
- exact hx hfa
+ rintro rfl; exact hx hfa
have hfa' : f (f a) ≠ f a := mt (fun h => f.injective h) hfa
have : ∀ x : α, (swap a (f a) * f) x ≠ x → x ∈ l :=
by
intro x hx
- have hxa : x ≠ a := by
- rintro rfl
- apply hx
- simp only [mul_apply, swap_apply_right]
+ have hxa : x ≠ a := by rintro rfl; apply hx; simp only [mul_apply, swap_apply_right]
refine' List.mem_of_ne_of_mem hxa (h x fun h => _)
simp only [h, mul_apply, swap_apply_def, mul_apply, Ne.def, apply_eq_iff_eq] at hx <;>
split_ifs at hx
mathlib commit https://github.com/leanprover-community/mathlib/commit/8d33f09cd7089ecf074b4791907588245aec5d1b
@@ -101,7 +101,7 @@ theorem mem_of_mem_permsOfList :
mem_of_mem_permsOfList hg₁ <| by
rw [eq_inv_mul_iff_mul_eq.2 hg₂, mul_apply, swap_inv, swap_apply_def] <;>
split_ifs <;>
- [exact Ne.symm hxy, exact Ne.symm hxa, exact hx]
+ [exact Ne.symm hxy;exact Ne.symm hxa;exact hx]
#align mem_of_mem_perms_of_list mem_of_mem_permsOfList
-/
mathlib commit https://github.com/leanprover-community/mathlib/commit/ce86f4e05e9a9b8da5e316b22c76ce76440c56a1
@@ -75,7 +75,7 @@ theorem mem_permsOfList_of_mem {l : List α} {f : Perm α} (h : ∀ x, f x ≠ x
split_ifs at hx
exacts[hxa (h.symm.trans h_1), hx h]
suffices f ∈ permsOfList l ∨ ∃ b ∈ l, ∃ g ∈ permsOfList l, swap a b * g = f by
- simpa only [permsOfList, exists_prop, List.mem_map', mem_append, List.mem_bind]
+ simpa only [permsOfList, exists_prop, List.mem_map, mem_append, List.mem_bind]
refine' or_iff_not_imp_left.2 fun hfl => ⟨f a, _, swap a (f a) * f, IH this, _⟩
· exact mem_of_ne_of_mem hfa (h _ hfa')
· rw [← mul_assoc, mul_def (swap a (f a)) (swap a (f a)), swap_swap, ← perm.one_def, one_mul]
@@ -92,7 +92,7 @@ theorem mem_of_mem_permsOfList :
(mem_append.1 h).elim (fun h x hx => mem_cons_of_mem _ (mem_of_mem_permsOfList h hx))
fun h x hx =>
let ⟨y, hy, hy'⟩ := List.mem_bind.1 h
- let ⟨g, hg₁, hg₂⟩ := List.mem_map'.1 hy'
+ let ⟨g, hg₁, hg₂⟩ := List.mem_map.1 hy'
if hxa : x = a then by simp [hxa]
else
if hxy : x = y then mem_cons_of_mem _ <| by rwa [hxy]
@@ -124,8 +124,8 @@ theorem nodup_permsOfList : ∀ {l : List α} (hl : l.Nodup), (permsOfList l).No
exact
⟨hln',
⟨fun _ _ => hln'.map fun _ _ => mul_left_cancel, fun i j hj hij x hx₁ hx₂ =>
- let ⟨f, hf⟩ := List.mem_map'.1 hx₁
- let ⟨g, hg⟩ := List.mem_map'.1 hx₂
+ let ⟨f, hf⟩ := List.mem_map.1 hx₁
+ let ⟨g, hg⟩ := List.mem_map.1 hx₂
have hix : x a = nth_le l i (lt_trans hij hj) := by
rw [← hf.2, mul_apply, hmeml hf.1, swap_apply_left]
have hiy : x a = nth_le l j hj := by rw [← hg.2, mul_apply, hmeml hg.1, swap_apply_left]
@@ -134,7 +134,7 @@ theorem nodup_permsOfList : ∀ {l : List α} (hl : l.Nodup), (permsOfList l).No
nodup_iff_nth_le_inj.1 hl' i j (lt_trans hij hj) hj <| by rw [← hix, hiy]⟩,
fun f hf₁ hf₂ =>
let ⟨x, hx, hx'⟩ := List.mem_bind.1 hf₂
- let ⟨g, hg⟩ := List.mem_map'.1 hx'
+ let ⟨g, hg⟩ := List.mem_map.1 hx'
have hgxa : g⁻¹ x = a := f.Injective <| by rw [hmeml hf₁, ← hg.2] <;> simp
have hxa : x ≠ a := fun h => (List.nodup_cons.1 hl).1 (h ▸ hx)
(List.nodup_cons.1 hl).1 <|
mathlib commit https://github.com/leanprover-community/mathlib/commit/bd9851ca476957ea4549eb19b40e7b5ade9428cc
@@ -64,7 +64,7 @@ theorem mem_permsOfList_of_mem {l : List α} {f : Perm α} (h : ∀ x, f x ≠ x
apply hx
simp only [mul_apply, swap_apply_right]
refine' List.mem_of_ne_of_mem hxa (h x fun h => _)
- simp only [mul_apply, swap_apply_def, mul_apply, Ne.def, apply_eq_iff_eq] at hx
+ simp only [mul_apply, swap_apply_def, mul_apply, Ne, apply_eq_iff_eq] at hx
split_ifs at hx with h_1
exacts [hxa (h.symm.trans h_1), hx h]
suffices f ∈ permsOfList l ∨ ∃ b ∈ l, ∃ g ∈ permsOfList l, Equiv.swap a b * g = f by
@@ -75,7 +75,7 @@ theorem mem_permsOfList_of_mem {l : List α} {f : Perm α} (h : ∀ x, f x ≠ x
#align mem_perms_of_list_of_mem mem_permsOfList_of_mem
theorem mem_of_mem_permsOfList :
- -- porting notes: was `∀ {x}` but need to capture the `x`
+ -- Porting note: was `∀ {x}` but need to capture the `x`
∀ {l : List α} {f : Perm α}, f ∈ permsOfList l → (x :α ) → f x ≠ x → x ∈ l
| [], f, h, heq_iff_eq => by
have : f = 1 := by simpa [permsOfList] using h
@@ -99,7 +99,7 @@ theorem mem_permsOfList_iff {l : List α} {f : Perm α} :
⟨mem_of_mem_permsOfList, mem_permsOfList_of_mem⟩
#align mem_perms_of_list_iff mem_permsOfList_iff
-theorem nodup_permsOfList : ∀ {l : List α} (_ : l.Nodup), (permsOfList l).Nodup
+theorem nodup_permsOfList : ∀ {l : List α}, l.Nodup → (permsOfList l).Nodup
| [], _ => by simp [permsOfList]
| a :: l, hl => by
have hl' : l.Nodup := hl.of_cons
Type _
and Sort _
(#6499)
We remove all possible occurences of Type _
and Sort _
in favor of Type*
and Sort*
.
This has nice performance benefits.
@@ -23,7 +23,7 @@ open Nat
universe u v
-variable {α β γ : Type _}
+variable {α β γ : Type*}
open Finset Function List Equiv Equiv.Perm
@@ -2,16 +2,13 @@
Copyright (c) 2017 Mario Carneiro. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Mario Carneiro
-
-! This file was ported from Lean 3 source module data.fintype.perm
-! leanprover-community/mathlib commit 509de852e1de55e1efa8eacfa11df0823f26f226
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-/
import Mathlib.Data.Fintype.Card
import Mathlib.GroupTheory.Perm.Basic
import Mathlib.Tactic.Ring
+#align_import data.fintype.perm from "leanprover-community/mathlib"@"509de852e1de55e1efa8eacfa11df0823f26f226"
+
/-!
# `Fintype` instances for `Equiv` and `Perm`
@@ -127,7 +127,7 @@ theorem nodup_permsOfList : ∀ {l : List α} (_ : l.Nodup), (permsOfList l).Nod
let ⟨g, hg⟩ := List.mem_map.1 hx'
have hgxa : g⁻¹ x = a := f.injective <| by rw [hmeml hf₁, ← hg.2]; simp
have hxa : x ≠ a := fun h => (List.nodup_cons.1 hl).1 (h ▸ hx)
- exact (List.nodup_cons.1 hl).1 <|
+ exact (List.nodup_cons.1 hl).1 <|
hgxa ▸ mem_of_mem_permsOfList hg.1 _ (by rwa [apply_inv_self, hgxa])
#align nodup_perms_of_list nodup_permsOfList
This is the second half of the changes originally in #5699, removing all occurrences of ;
after a space and implementing a linter rule to enforce it.
In most cases this 2-character substring has a space after it, so the following command was run first:
find . -type f -name "*.lean" -exec sed -i -E 's/ ; /; /g' {} \;
The remaining cases were few enough in number that they were done manually.
@@ -142,11 +142,11 @@ def permsOfFinset (s : Finset α) : Finset (Perm α) :=
theorem mem_perms_of_finset_iff :
∀ {s : Finset α} {f : Perm α}, f ∈ permsOfFinset s ↔ ∀ {x}, f x ≠ x → x ∈ s := by
- rintro ⟨⟨l⟩, hs⟩ f ; exact mem_permsOfList_iff
+ rintro ⟨⟨l⟩, hs⟩ f; exact mem_permsOfList_iff
#align mem_perms_of_finset_iff mem_perms_of_finset_iff
theorem card_perms_of_finset : ∀ s : Finset α, (permsOfFinset s).card = s.card ! := by
- rintro ⟨⟨l⟩, hs⟩ ; exact length_permsOfList l
+ rintro ⟨⟨l⟩, hs⟩; exact length_permsOfList l
#align card_perms_of_finset card_perms_of_finset
/-- The collection of permutations of a fintype is a fintype. -/
@@ -69,7 +69,7 @@ theorem mem_permsOfList_of_mem {l : List α} {f : Perm α} (h : ∀ x, f x ≠ x
refine' List.mem_of_ne_of_mem hxa (h x fun h => _)
simp only [mul_apply, swap_apply_def, mul_apply, Ne.def, apply_eq_iff_eq] at hx
split_ifs at hx with h_1
- exacts[hxa (h.symm.trans h_1), hx h]
+ exacts [hxa (h.symm.trans h_1), hx h]
suffices f ∈ permsOfList l ∨ ∃ b ∈ l, ∃ g ∈ permsOfList l, Equiv.swap a b * g = f by
simpa only [permsOfList, exists_prop, List.mem_map, mem_append, List.mem_bind]
refine' or_iff_not_imp_left.2 fun _hfl => ⟨f a, _, Equiv.swap a (f a) * f, IH this, _⟩
The main breaking change is that tac <;> [t1, t2]
is now written tac <;> [t1; t2]
, to avoid clashing with tactics like cases
and use
that take comma-separated lists.
@@ -94,7 +94,7 @@ theorem mem_of_mem_permsOfList :
if hxy : x = y then mem_cons_of_mem _ <| by rwa [hxy]
else mem_cons_of_mem a <| mem_of_mem_permsOfList hg₁ _ <| by
rw [eq_inv_mul_iff_mul_eq.2 hg₂, mul_apply, swap_inv, swap_apply_def]
- split_ifs <;> [exact Ne.symm hxy, exact Ne.symm hxa, exact hx]
+ split_ifs <;> [exact Ne.symm hxy; exact Ne.symm hxa; exact hx]
#align mem_of_mem_perms_of_list mem_of_mem_permsOfList
theorem mem_permsOfList_iff {l : List α} {f : Perm α} :
@@ -49,17 +49,12 @@ theorem length_permsOfList : ∀ l : List α, length (permsOfList l) = l.length
theorem mem_permsOfList_of_mem {l : List α} {f : Perm α} (h : ∀ x, f x ≠ x → x ∈ l) :
f ∈ permsOfList l := by
- induction l generalizing f
- -- with a l IH
- case nil =>
- -- Porting note: Previous code was:
- -- exact List.mem_singleton.2 (Equiv.ext fun x => Decidable.by_contradiction <| h x)
- --
- -- `h x` does not work as expected.
- -- This is because `x ∈ []` is not `False` before `simp`.
- exact List.mem_singleton.2 (Equiv.ext fun x => Decidable.by_contradiction <| by
- intro h'; simp at h; apply h x; intro h''; apply h'; simp; exact h'')
- case cons a l IH =>
+ induction l generalizing f with
+ | nil =>
+ -- Porting note: applied `not_mem_nil` because it is no longer true definitionally.
+ simp only [not_mem_nil] at h
+ exact List.mem_singleton.2 (Equiv.ext fun x => Decidable.by_contradiction <| h x)
+ | cons a l IH =>
by_cases hfa : f a = a
· refine' mem_append_left _ (IH fun x hx => mem_of_ne_of_mem _ (h x hx))
rintro rfl
Notably incorporates https://github.com/leanprover/std4/pull/98 and https://github.com/leanprover/std4/pull/109.
https://github.com/leanprover/std4/pull/98 moves a number of lemmas from Mathlib to Std, so the bump requires deleting them in Mathlib. I did check on each lemma whether its attributes were kept in the move (and gave attribute markings in Mathlib if they were not present in Std), but a reviewer may wish to re-check.
List.mem_map
changed statement from b ∈ l.map f ↔ ∃ a, a ∈ l ∧ b = f a
to b ∈ l.map f ↔ ∃ a, a ∈ l ∧ f a = b
. Similarly for List.exists_of_mem_map
. This was a deliberate change, so I have simply adjusted proofs (many become simpler, which supports the change). I also deleted List.mem_map'
, List.exists_of_mem_map'
, which were temporary versions in Mathlib while waiting for this change (replacing their uses with the unprimed versions).
Also, the lemma sublist_nil_iff_eq_nil
seems to have been renamed to sublist_nil
during the move, so I added an alias for the old name.
(another issue fixed during review by @digama0) List.Sublist.filter
had an argument change from explicit to implicit. This appears to have been an oversight (cc @JamesGallicchio). I have temporarily introduced List.Sublist.filter'
with the argument explicit, and replaced Mathlib uses of Sublist.filter
with Sublist.filter'
. Later we can fix the argument in Std, and then delete List.Sublist.filter'
.
@@ -76,7 +76,7 @@ theorem mem_permsOfList_of_mem {l : List α} {f : Perm α} (h : ∀ x, f x ≠ x
split_ifs at hx with h_1
exacts[hxa (h.symm.trans h_1), hx h]
suffices f ∈ permsOfList l ∨ ∃ b ∈ l, ∃ g ∈ permsOfList l, Equiv.swap a b * g = f by
- simpa only [permsOfList, exists_prop, List.mem_map', mem_append, List.mem_bind]
+ simpa only [permsOfList, exists_prop, List.mem_map, mem_append, List.mem_bind]
refine' or_iff_not_imp_left.2 fun _hfl => ⟨f a, _, Equiv.swap a (f a) * f, IH this, _⟩
· exact mem_of_ne_of_mem hfa (h _ hfa')
· rw [← mul_assoc, mul_def (swap a (f a)) (swap a (f a)), swap_swap, ← Perm.one_def, one_mul]
@@ -92,7 +92,7 @@ theorem mem_of_mem_permsOfList :
(mem_append.1 h).elim (fun h hx => mem_cons_of_mem _ (mem_of_mem_permsOfList h x hx))
fun h hx =>
let ⟨y, hy, hy'⟩ := List.mem_bind.1 h
- let ⟨g, hg₁, hg₂⟩ := List.mem_map'.1 hy'
+ let ⟨g, hg₁, hg₂⟩ := List.mem_map.1 hy'
-- Porting note: Seems like the implicit variable `x` of type `α` is needed.
if hxa : x = a then by simp [hxa]
else
@@ -119,8 +119,8 @@ theorem nodup_permsOfList : ∀ {l : List α} (_ : l.Nodup), (permsOfList l).Nod
· exact hln'
· exact fun _ _ => hln'.map fun _ _ => mul_left_cancel
· intros i j hij x hx₁ hx₂
- let ⟨f, hf⟩ := List.mem_map'.1 hx₁
- let ⟨g, hg⟩ := List.mem_map'.1 hx₂
+ let ⟨f, hf⟩ := List.mem_map.1 hx₁
+ let ⟨g, hg⟩ := List.mem_map.1 hx₂
have hix : x a = List.get l i := by
rw [← hf.2, mul_apply, hmeml hf.1, swap_apply_left]
have hiy : x a = List.get l j := by
@@ -129,7 +129,7 @@ theorem nodup_permsOfList : ∀ {l : List α} (_ : l.Nodup), (permsOfList l).Nod
exact absurd hieqj (_root_.ne_of_lt hij)
· intros f hf₁ hf₂
let ⟨x, hx, hx'⟩ := List.mem_bind.1 hf₂
- let ⟨g, hg⟩ := List.mem_map'.1 hx'
+ let ⟨g, hg⟩ := List.mem_map.1 hx'
have hgxa : g⁻¹ x = a := f.injective <| by rw [hmeml hf₁, ← hg.2]; simp
have hxa : x ≠ a := fun h => (List.nodup_cons.1 hl).1 (h ▸ hx)
exact (List.nodup_cons.1 hl).1 <|
Port of data.fintype.perm
Co-authored-by: qawbecrdtey <qawbecrdtey@naver.com> Co-authored-by: Joachim Breitner <mail@joachim-breitner.de>
The unported dependencies are