data.finset.symMathlib.Data.Finset.Sym

This file has been ported!

Changes since the initial port

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.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -69,7 +69,7 @@ theorem mem_sym2_iff : m ∈ s.Sym2 ↔ ∀ a ∈ m, a ∈ s :=
       ⟨_, fun h => ⟨m.out, mem_product.2 ⟨h _ m.out_fst_mem, h _ m.out_snd_mem⟩, m.out_eq⟩⟩
   rintro ⟨⟨a, b⟩, h, rfl⟩
   rw [Sym2.ball]
-  rwa [mem_product] at h 
+  rwa [mem_product] at h
 #align finset.mem_sym2_iff Finset.mem_sym2_iff
 -/
 
@@ -178,9 +178,9 @@ theorem mem_sym_iff : m ∈ s.Sym n ↔ ∀ a ∈ m, a ∈ s :=
     exact fun a ha => ha.elim
   refine' mem_sup.trans ⟨_, fun h => _⟩
   · rintro ⟨a, ha, he⟩ b hb
-    rw [mem_image] at he 
+    rw [mem_image] at he
     obtain ⟨m, he, rfl⟩ := he
-    rw [Sym.mem_cons] at hb 
+    rw [Sym.mem_cons] at hb
     obtain rfl | hb := hb
     · exact ha
     · exact ih.1 he _ hb
Diff
@@ -36,16 +36,16 @@ namespace Finset
 
 variable {α : Type _} [DecidableEq α] {s t : Finset α} {a b : α}
 
-#print Finset.isDiag_mk'_of_mem_diag /-
-theorem isDiag_mk'_of_mem_diag {a : α × α} (h : a ∈ s.diag) : Sym2.IsDiag ⟦a⟧ :=
+#print Finset.isDiag_mk_of_mem_diag /-
+theorem isDiag_mk_of_mem_diag {a : α × α} (h : a ∈ s.diag) : Sym2.IsDiag ⟦a⟧ :=
   (Sym2.isDiag_iff_proj_eq _).2 (mem_diag.1 h).2
-#align finset.is_diag_mk_of_mem_diag Finset.isDiag_mk'_of_mem_diag
+#align finset.is_diag_mk_of_mem_diag Finset.isDiag_mk_of_mem_diag
 -/
 
-#print Finset.not_isDiag_mk'_of_mem_offDiag /-
-theorem not_isDiag_mk'_of_mem_offDiag {a : α × α} (h : a ∈ s.offDiag) : ¬Sym2.IsDiag ⟦a⟧ := by
+#print Finset.not_isDiag_mk_of_mem_offDiag /-
+theorem not_isDiag_mk_of_mem_offDiag {a : α × α} (h : a ∈ s.offDiag) : ¬Sym2.IsDiag ⟦a⟧ := by
   rw [Sym2.isDiag_iff_proj_eq]; exact (mem_off_diag.1 h).2.2
-#align finset.not_is_diag_mk_of_mem_off_diag Finset.not_isDiag_mk'_of_mem_offDiag
+#align finset.not_is_diag_mk_of_mem_off_diag Finset.not_isDiag_mk_of_mem_offDiag
 -/
 
 section Sym2
@@ -73,9 +73,9 @@ theorem mem_sym2_iff : m ∈ s.Sym2 ↔ ∀ a ∈ m, a ∈ s :=
 #align finset.mem_sym2_iff Finset.mem_sym2_iff
 -/
 
-#print Finset.mk'_mem_sym2_iff /-
-theorem mk'_mem_sym2_iff : ⟦(a, b)⟧ ∈ s.Sym2 ↔ a ∈ s ∧ b ∈ s := by rw [mem_sym2_iff, Sym2.ball]
-#align finset.mk_mem_sym2_iff Finset.mk'_mem_sym2_iff
+#print Finset.mk_mem_sym2_iff /-
+theorem mk_mem_sym2_iff : ⟦(a, b)⟧ ∈ s.Sym2 ↔ a ∈ s ∧ b ∈ s := by rw [mem_sym2_iff, Sym2.ball]
+#align finset.mk_mem_sym2_iff Finset.mk_mem_sym2_iff
 -/
 
 #print Finset.sym2_empty /-
@@ -100,7 +100,7 @@ theorem sym2_nonempty : s.Sym2.Nonempty ↔ s.Nonempty := by
 -/
 
 alias ⟨_, nonempty.sym2⟩ := sym2_nonempty
-#align finset.nonempty.sym2 Finset.nonempty.sym2
+#align finset.nonempty.sym2 Finset.Nonempty.sym2
 
 attribute [protected] nonempty.sym2
 
@@ -121,7 +121,7 @@ theorem sym2_singleton (a : α) : ({a} : Finset α).Sym2 = {Sym2.diag a} := by
 #print Finset.diag_mem_sym2_iff /-
 @[simp]
 theorem diag_mem_sym2_iff : Sym2.diag a ∈ s.Sym2 ↔ a ∈ s :=
-  mk'_mem_sym2_iff.trans <| and_self_iff _
+  mk_mem_sym2_iff.trans <| and_self_iff _
 #align finset.diag_mem_sym2_iff Finset.diag_mem_sym2_iff
 -/
 
Diff
@@ -3,10 +3,10 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 -/
-import Mathbin.Data.Finset.Lattice
-import Mathbin.Data.Fintype.Prod
-import Mathbin.Data.Fintype.Vector
-import Mathbin.Data.Sym.Sym2
+import Data.Finset.Lattice
+import Data.Fintype.Prod
+import Data.Fintype.Vector
+import Data.Sym.Sym2
 
 #align_import data.finset.sym from "leanprover-community/mathlib"@"cb3ceec8485239a61ed51d944cb9a95b68c6bafc"
 
Diff
@@ -99,7 +99,7 @@ theorem sym2_nonempty : s.Sym2.Nonempty ↔ s.Nonempty := by
 #align finset.sym2_nonempty Finset.sym2_nonempty
 -/
 
-alias sym2_nonempty ↔ _ nonempty.sym2
+alias ⟨_, nonempty.sym2⟩ := sym2_nonempty
 #align finset.nonempty.sym2 Finset.nonempty.sym2
 
 attribute [protected] nonempty.sym2
Diff
@@ -2,17 +2,14 @@
 Copyright (c) 2021 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
-
-! This file was ported from Lean 3 source module data.finset.sym
-! leanprover-community/mathlib commit cb3ceec8485239a61ed51d944cb9a95b68c6bafc
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.Finset.Lattice
 import Mathbin.Data.Fintype.Prod
 import Mathbin.Data.Fintype.Vector
 import Mathbin.Data.Sym.Sym2
 
+#align_import data.finset.sym from "leanprover-community/mathlib"@"cb3ceec8485239a61ed51d944cb9a95b68c6bafc"
+
 /-!
 # Symmetric powers of a finset
 
Diff
@@ -157,10 +157,12 @@ protected def sym (s : Finset α) : ∀ n, Finset (Sym α n)
 #align finset.sym Finset.sym
 -/
 
+#print Finset.sym_zero /-
 @[simp]
 theorem sym_zero : s.Sym 0 = {∅} :=
   rfl
 #align finset.sym_zero Finset.sym_zero
+-/
 
 #print Finset.sym_succ /-
 @[simp]
@@ -169,6 +171,7 @@ theorem sym_succ : s.Sym (n + 1) = s.sup fun a => (s.Sym n).image <| Sym.cons a
 #align finset.sym_succ Finset.sym_succ
 -/
 
+#print Finset.mem_sym_iff /-
 @[simp]
 theorem mem_sym_iff : m ∈ s.Sym n ↔ ∀ a ∈ m, a ∈ s :=
   by
@@ -189,6 +192,7 @@ theorem mem_sym_iff : m ∈ s.Sym n ↔ ∀ a ∈ m, a ∈ s :=
       ⟨a, h _ <| Sym.mem_cons_self _ _,
         mem_image_of_mem _ <| ih.2 fun b hb => h _ <| Sym.mem_cons_of_mem hb⟩
 #align finset.mem_sym_iff Finset.mem_sym_iff
+-/
 
 #print Finset.sym_empty /-
 @[simp]
@@ -227,6 +231,7 @@ theorem eq_empty_of_sym_eq_empty (h : s.Sym n = ∅) : s = ∅ :=
 #align finset.eq_empty_of_sym_eq_empty Finset.eq_empty_of_sym_eq_empty
 -/
 
+#print Finset.sym_eq_empty /-
 @[simp]
 theorem sym_eq_empty : s.Sym n = ∅ ↔ n ≠ 0 ∧ s = ∅ :=
   by
@@ -236,11 +241,14 @@ theorem sym_eq_empty : s.Sym n = ∅ ↔ n ≠ 0 ∧ s = ∅ :=
     rintro ⟨_, rfl⟩
     exact sym_empty _
 #align finset.sym_eq_empty Finset.sym_eq_empty
+-/
 
+#print Finset.sym_nonempty /-
 @[simp]
 theorem sym_nonempty : (s.Sym n).Nonempty ↔ n = 0 ∨ s.Nonempty := by
   simp_rw [nonempty_iff_ne_empty, Ne.def, sym_eq_empty, not_and_or, not_ne_iff]
 #align finset.sym_nonempty Finset.sym_nonempty
+-/
 
 #print Finset.sym_univ /-
 @[simp]
@@ -256,15 +264,19 @@ theorem sym_mono (h : s ⊆ t) (n : ℕ) : s.Sym n ⊆ t.Sym n := fun m hm =>
 #align finset.sym_mono Finset.sym_mono
 -/
 
+#print Finset.sym_inter /-
 @[simp]
 theorem sym_inter (s t : Finset α) (n : ℕ) : (s ∩ t).Sym n = s.Sym n ∩ t.Sym n := by ext m;
   simp only [mem_inter, mem_sym_iff, imp_and, forall_and]
 #align finset.sym_inter Finset.sym_inter
+-/
 
+#print Finset.sym_union /-
 @[simp]
 theorem sym_union (s t : Finset α) (n : ℕ) : s.Sym n ∪ t.Sym n ⊆ (s ∪ t).Sym n :=
   union_subset (sym_mono (subset_union_left s t) n) (sym_mono (subset_union_right s t) n)
 #align finset.sym_union Finset.sym_union
+-/
 
 #print Finset.sym_fill_mem /-
 theorem sym_fill_mem (a : α) {i : Fin (n + 1)} {m : Sym α (n - i)} (h : m ∈ s.Sym (n - i)) :
Diff
@@ -72,7 +72,7 @@ theorem mem_sym2_iff : m ∈ s.Sym2 ↔ ∀ a ∈ m, a ∈ s :=
       ⟨_, fun h => ⟨m.out, mem_product.2 ⟨h _ m.out_fst_mem, h _ m.out_snd_mem⟩, m.out_eq⟩⟩
   rintro ⟨⟨a, b⟩, h, rfl⟩
   rw [Sym2.ball]
-  rwa [mem_product] at h
+  rwa [mem_product] at h 
 #align finset.mem_sym2_iff Finset.mem_sym2_iff
 -/
 
@@ -178,9 +178,9 @@ theorem mem_sym_iff : m ∈ s.Sym n ↔ ∀ a ∈ m, a ∈ s :=
     exact fun a ha => ha.elim
   refine' mem_sup.trans ⟨_, fun h => _⟩
   · rintro ⟨a, ha, he⟩ b hb
-    rw [mem_image] at he
+    rw [mem_image] at he 
     obtain ⟨m, he, rfl⟩ := he
-    rw [Sym.mem_cons] at hb
+    rw [Sym.mem_cons] at hb 
     obtain rfl | hb := hb
     · exact ha
     · exact ih.1 he _ hb
@@ -222,7 +222,7 @@ theorem sym_singleton (a : α) (n : ℕ) : ({a} : Finset α).Sym n = {Sym.replic
 #print Finset.eq_empty_of_sym_eq_empty /-
 theorem eq_empty_of_sym_eq_empty (h : s.Sym n = ∅) : s = ∅ :=
   by
-  rw [← not_nonempty_iff_eq_empty] at h⊢
+  rw [← not_nonempty_iff_eq_empty] at h ⊢
   exact fun hs => h (hs.Sym _)
 #align finset.eq_empty_of_sym_eq_empty Finset.eq_empty_of_sym_eq_empty
 -/
@@ -287,7 +287,7 @@ theorem sym_filterNe_mem (a : α) (h : m ∈ s.Sym n) :
   in 1-1 correspondence with the disjoint union of the `n - i`th symmetric powers of `s`,
   for `0 ≤ i ≤ n`. -/
 @[simps]
-def symInsertEquiv (h : a ∉ s) : (insert a s).Sym n ≃ Σi : Fin (n + 1), s.Sym (n - i)
+def symInsertEquiv (h : a ∉ s) : (insert a s).Sym n ≃ Σ i : Fin (n + 1), s.Sym (n - i)
     where
   toFun m := ⟨_, (m.1.filter_ne a).2, by convert sym_filter_ne_mem a m.2 <;> rw [erase_insert h]⟩
   invFun m := ⟨m.2.1.fill a m.1, sym_fill_mem a m.2.2⟩
@@ -299,7 +299,7 @@ def symInsertEquiv (h : a ∉ s) : (insert a s).Sym n ≃ Σi : Fin (n + 1), s.S
     swap; · exact fun _ _ => id
     swap; · exact Subtype.coe_injective
     refine' Eq.trans _ (Sym.filter_ne_fill a _ _)
-    exacts[rfl, h ∘ mem_sym_iff.1 hm a]
+    exacts [rfl, h ∘ mem_sym_iff.1 hm a]
 #align finset.sym_insert_equiv Finset.symInsertEquiv
 -/
 
Diff
@@ -157,12 +157,6 @@ protected def sym (s : Finset α) : ∀ n, Finset (Sym α n)
 #align finset.sym Finset.sym
 -/
 
-/- warning: finset.sym_zero -> Finset.sym_zero is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {s : Finset.{u1} α}, Eq.{succ u1} (Finset.{u1} (Sym.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (Singleton.singleton.{u1, u1} (Sym.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (Finset.{u1} (Sym.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))) (Finset.hasSingleton.{u1} (Sym.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))) (EmptyCollection.emptyCollection.{u1} (Sym.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (Sym.hasEmptyc.{u1} α)))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {s : Finset.{u1} α}, Eq.{succ u1} (Finset.{u1} (Sym.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (Singleton.singleton.{u1, u1} (Sym.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (Finset.{u1} (Sym.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))) (Finset.instSingletonFinset.{u1} (Sym.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))) (EmptyCollection.emptyCollection.{u1} (Sym.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (Sym.instEmptyCollectionSymOfNatNatInstOfNatNat.{u1} α)))
-Case conversion may be inaccurate. Consider using '#align finset.sym_zero Finset.sym_zeroₓ'. -/
 @[simp]
 theorem sym_zero : s.Sym 0 = {∅} :=
   rfl
@@ -175,12 +169,6 @@ theorem sym_succ : s.Sym (n + 1) = s.sup fun a => (s.Sym n).image <| Sym.cons a
 #align finset.sym_succ Finset.sym_succ
 -/
 
-/- warning: finset.mem_sym_iff -> Finset.mem_sym_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {s : Finset.{u1} α} {n : Nat} {m : Sym.{u1} α n}, Iff (Membership.Mem.{u1, u1} (Sym.{u1} α n) (Finset.{u1} (Sym.{u1} α n)) (Finset.hasMem.{u1} (Sym.{u1} α n)) m (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s n)) (forall (a : α), (Membership.Mem.{u1, u1} α (Sym.{u1} α n) (Sym.hasMem.{u1} α n) a m) -> (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) a s))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {s : Finset.{u1} α} {n : Nat} {m : Sym.{u1} α n}, Iff (Membership.mem.{u1, u1} (Sym.{u1} α n) (Finset.{u1} (Sym.{u1} α n)) (Finset.instMembershipFinset.{u1} (Sym.{u1} α n)) m (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s n)) (forall (a : α), (Membership.mem.{u1, u1} α (Sym.{u1} α n) (Sym.instMembershipSym.{u1} α n) a m) -> (Membership.mem.{u1, u1} α (Finset.{u1} α) (Finset.instMembershipFinset.{u1} α) a s))
-Case conversion may be inaccurate. Consider using '#align finset.mem_sym_iff Finset.mem_sym_iffₓ'. -/
 @[simp]
 theorem mem_sym_iff : m ∈ s.Sym n ↔ ∀ a ∈ m, a ∈ s :=
   by
@@ -239,12 +227,6 @@ theorem eq_empty_of_sym_eq_empty (h : s.Sym n = ∅) : s = ∅ :=
 #align finset.eq_empty_of_sym_eq_empty Finset.eq_empty_of_sym_eq_empty
 -/
 
-/- warning: finset.sym_eq_empty -> Finset.sym_eq_empty is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {s : Finset.{u1} α} {n : Nat}, Iff (Eq.{succ u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s n) (EmptyCollection.emptyCollection.{u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.hasEmptyc.{u1} (Sym.{u1} α n)))) (And (Ne.{1} Nat n (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (Eq.{succ u1} (Finset.{u1} α) s (EmptyCollection.emptyCollection.{u1} (Finset.{u1} α) (Finset.hasEmptyc.{u1} α))))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {s : Finset.{u1} α} {n : Nat} {m : Sym.{u1} α n}, Iff (Eq.{succ u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s n) (EmptyCollection.emptyCollection.{u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.instEmptyCollectionFinset.{u1} (Sym.{u1} α n)))) (And (Ne.{1} Nat n (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (Eq.{succ u1} (Finset.{u1} α) s (EmptyCollection.emptyCollection.{u1} (Finset.{u1} α) (Finset.instEmptyCollectionFinset.{u1} α))))
-Case conversion may be inaccurate. Consider using '#align finset.sym_eq_empty Finset.sym_eq_emptyₓ'. -/
 @[simp]
 theorem sym_eq_empty : s.Sym n = ∅ ↔ n ≠ 0 ∧ s = ∅ :=
   by
@@ -255,12 +237,6 @@ theorem sym_eq_empty : s.Sym n = ∅ ↔ n ≠ 0 ∧ s = ∅ :=
     exact sym_empty _
 #align finset.sym_eq_empty Finset.sym_eq_empty
 
-/- warning: finset.sym_nonempty -> Finset.sym_nonempty is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {s : Finset.{u1} α} {n : Nat}, Iff (Finset.Nonempty.{u1} (Sym.{u1} α n) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s n)) (Or (Eq.{1} Nat n (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (Finset.Nonempty.{u1} α s))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {s : Finset.{u1} α} {n : Nat} {m : Sym.{u1} α n}, Iff (Finset.Nonempty.{u1} (Sym.{u1} α n) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s n)) (Or (Eq.{1} Nat n (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (Finset.Nonempty.{u1} α s))
-Case conversion may be inaccurate. Consider using '#align finset.sym_nonempty Finset.sym_nonemptyₓ'. -/
 @[simp]
 theorem sym_nonempty : (s.Sym n).Nonempty ↔ n = 0 ∨ s.Nonempty := by
   simp_rw [nonempty_iff_ne_empty, Ne.def, sym_eq_empty, not_and_or, not_ne_iff]
@@ -280,17 +256,11 @@ theorem sym_mono (h : s ⊆ t) (n : ℕ) : s.Sym n ⊆ t.Sym n := fun m hm =>
 #align finset.sym_mono Finset.sym_mono
 -/
 
-/- warning: finset.sym_inter -> Finset.sym_inter is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align finset.sym_inter Finset.sym_interₓ'. -/
 @[simp]
 theorem sym_inter (s t : Finset α) (n : ℕ) : (s ∩ t).Sym n = s.Sym n ∩ t.Sym n := by ext m;
   simp only [mem_inter, mem_sym_iff, imp_and, forall_and]
 #align finset.sym_inter Finset.sym_inter
 
-/- warning: finset.sym_union -> Finset.sym_union is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align finset.sym_union Finset.sym_unionₓ'. -/
 @[simp]
 theorem sym_union (s t : Finset α) (n : ℕ) : s.Sym n ∪ t.Sym n ⊆ (s ∪ t).Sym n :=
   union_subset (sym_mono (subset_union_left s t) n) (sym_mono (subset_union_right s t) n)
Diff
@@ -46,10 +46,8 @@ theorem isDiag_mk'_of_mem_diag {a : α × α} (h : a ∈ s.diag) : Sym2.IsDiag 
 -/
 
 #print Finset.not_isDiag_mk'_of_mem_offDiag /-
-theorem not_isDiag_mk'_of_mem_offDiag {a : α × α} (h : a ∈ s.offDiag) : ¬Sym2.IsDiag ⟦a⟧ :=
-  by
-  rw [Sym2.isDiag_iff_proj_eq]
-  exact (mem_off_diag.1 h).2.2
+theorem not_isDiag_mk'_of_mem_offDiag {a : α × α} (h : a ∈ s.offDiag) : ¬Sym2.IsDiag ⟦a⟧ := by
+  rw [Sym2.isDiag_iff_proj_eq]; exact (mem_off_diag.1 h).2.2
 #align finset.not_is_diag_mk_of_mem_off_diag Finset.not_isDiag_mk'_of_mem_offDiag
 -/
 
@@ -139,10 +137,8 @@ theorem sym2_mono (h : s ⊆ t) : s.Sym2 ⊆ t.Sym2 := fun m he =>
 
 #print Finset.image_diag_union_image_offDiag /-
 theorem image_diag_union_image_offDiag :
-    s.diag.image Quotient.mk' ∪ s.offDiag.image Quotient.mk' = s.Sym2 :=
-  by
-  rw [← image_union, diag_union_off_diag]
-  rfl
+    s.diag.image Quotient.mk' ∪ s.offDiag.image Quotient.mk' = s.Sym2 := by
+  rw [← image_union, diag_union_off_diag]; rfl
 #align finset.image_diag_union_image_off_diag Finset.image_diag_union_image_offDiag
 -/
 
@@ -288,9 +284,7 @@ theorem sym_mono (h : s ⊆ t) (n : ℕ) : s.Sym n ⊆ t.Sym n := fun m hm =>
 <too large>
 Case conversion may be inaccurate. Consider using '#align finset.sym_inter Finset.sym_interₓ'. -/
 @[simp]
-theorem sym_inter (s t : Finset α) (n : ℕ) : (s ∩ t).Sym n = s.Sym n ∩ t.Sym n :=
-  by
-  ext m
+theorem sym_inter (s t : Finset α) (n : ℕ) : (s ∩ t).Sym n = s.Sym n ∩ t.Sym n := by ext m;
   simp only [mem_inter, mem_sym_iff, imp_and, forall_and]
 #align finset.sym_inter Finset.sym_inter
 
Diff
@@ -285,10 +285,7 @@ theorem sym_mono (h : s ⊆ t) (n : ℕ) : s.Sym n ⊆ t.Sym n := fun m hm =>
 -/
 
 /- warning: finset.sym_inter -> Finset.sym_inter is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (s : Finset.{u1} α) (t : Finset.{u1} α) (n : Nat), Eq.{succ u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) (Inter.inter.{u1} (Finset.{u1} α) (Finset.hasInter.{u1} α (fun (a : α) (b : α) => _inst_1 a b)) s t) n) (Inter.inter.{u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.hasInter.{u1} (Sym.{u1} α n) (fun (a : Sym.{u1} α n) (b : Sym.{u1} α n) => Subtype.decidableEq.{u1} (Multiset.{u1} α) (fun (x : Multiset.{u1} α) => Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) x) n) (fun (a : Multiset.{u1} α) (b : Multiset.{u1} α) => Multiset.decidableEq.{u1} α (fun (a : α) (b : α) => _inst_1 a b) a b) a b)) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s n) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) t n))
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (s : Finset.{u1} α) (t : Finset.{u1} α) (n : Nat), Eq.{succ u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) (Inter.inter.{u1} (Finset.{u1} α) (Finset.instInterFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b)) s t) n) (Inter.inter.{u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.instInterFinset.{u1} (Sym.{u1} α n) (fun (a : Sym.{u1} α n) (b : Sym.{u1} α n) => Finset.instDecidableEqSym.{u1} α (fun (x : α) (b : α) => _inst_1 x b) n a b)) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s n) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) t n))
+<too large>
 Case conversion may be inaccurate. Consider using '#align finset.sym_inter Finset.sym_interₓ'. -/
 @[simp]
 theorem sym_inter (s t : Finset α) (n : ℕ) : (s ∩ t).Sym n = s.Sym n ∩ t.Sym n :=
@@ -298,10 +295,7 @@ theorem sym_inter (s t : Finset α) (n : ℕ) : (s ∩ t).Sym n = s.Sym n ∩ t.
 #align finset.sym_inter Finset.sym_inter
 
 /- warning: finset.sym_union -> Finset.sym_union is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (s : Finset.{u1} α) (t : Finset.{u1} α) (n : Nat), HasSubset.Subset.{u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.hasSubset.{u1} (Sym.{u1} α n)) (Union.union.{u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.hasUnion.{u1} (Sym.{u1} α n) (fun (a : Sym.{u1} α n) (b : Sym.{u1} α n) => Subtype.decidableEq.{u1} (Multiset.{u1} α) (fun (x : Multiset.{u1} α) => Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) x) n) (fun (a : Multiset.{u1} α) (b : Multiset.{u1} α) => Multiset.decidableEq.{u1} α (fun (a : α) (b : α) => _inst_1 a b) a b) a b)) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s n) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) t n)) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) (Union.union.{u1} (Finset.{u1} α) (Finset.hasUnion.{u1} α (fun (a : α) (b : α) => _inst_1 a b)) s t) n)
-but is expected to have type
-  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (s : Finset.{u1} α) (t : Finset.{u1} α) (n : Nat), HasSubset.Subset.{u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.instHasSubsetFinset.{u1} (Sym.{u1} α n)) (Union.union.{u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.instUnionFinset.{u1} (Sym.{u1} α n) (fun (a : Sym.{u1} α n) (b : Sym.{u1} α n) => Finset.instDecidableEqSym.{u1} α (fun (x : α) (b : α) => _inst_1 x b) n a b)) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s n) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) t n)) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) (Union.union.{u1} (Finset.{u1} α) (Finset.instUnionFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b)) s t) n)
+<too large>
 Case conversion may be inaccurate. Consider using '#align finset.sym_union Finset.sym_unionₓ'. -/
 @[simp]
 theorem sym_union (s t : Finset α) (n : ℕ) : s.Sym n ∪ t.Sym n ⊆ (s ∪ t).Sym n :=
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module data.finset.sym
-! leanprover-community/mathlib commit 02ba8949f486ebecf93fe7460f1ed0564b5e442c
+! leanprover-community/mathlib commit cb3ceec8485239a61ed51d944cb9a95b68c6bafc
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -16,6 +16,9 @@ import Mathbin.Data.Sym.Sym2
 /-!
 # Symmetric powers of a finset
 
+> THIS FILE IS SYNCHRONIZED WITH MATHLIB4.
+> Any changes to this file require a corresponding PR to mathlib4.
+
 This file defines the symmetric powers of a finset as `finset (sym α n)` and `finset (sym2 α)`.
 
 ## Main declarations
Diff
@@ -36,26 +36,33 @@ namespace Finset
 
 variable {α : Type _} [DecidableEq α] {s t : Finset α} {a b : α}
 
+#print Finset.isDiag_mk'_of_mem_diag /-
 theorem isDiag_mk'_of_mem_diag {a : α × α} (h : a ∈ s.diag) : Sym2.IsDiag ⟦a⟧ :=
   (Sym2.isDiag_iff_proj_eq _).2 (mem_diag.1 h).2
 #align finset.is_diag_mk_of_mem_diag Finset.isDiag_mk'_of_mem_diag
+-/
 
+#print Finset.not_isDiag_mk'_of_mem_offDiag /-
 theorem not_isDiag_mk'_of_mem_offDiag {a : α × α} (h : a ∈ s.offDiag) : ¬Sym2.IsDiag ⟦a⟧ :=
   by
   rw [Sym2.isDiag_iff_proj_eq]
   exact (mem_off_diag.1 h).2.2
 #align finset.not_is_diag_mk_of_mem_off_diag Finset.not_isDiag_mk'_of_mem_offDiag
+-/
 
 section Sym2
 
 variable {m : Sym2 α}
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print Finset.sym2 /-
 /-- Lifts a finset to `sym2 α`. `s.sym2` is the finset of all pairs with elements in `s`. -/
 protected def sym2 (s : Finset α) : Finset (Sym2 α) :=
   (s ×ˢ s).image Quotient.mk'
 #align finset.sym2 Finset.sym2
+-/
 
+#print Finset.mem_sym2_iff /-
 @[simp]
 theorem mem_sym2_iff : m ∈ s.Sym2 ↔ ∀ a ∈ m, a ∈ s :=
   by
@@ -66,56 +73,75 @@ theorem mem_sym2_iff : m ∈ s.Sym2 ↔ ∀ a ∈ m, a ∈ s :=
   rw [Sym2.ball]
   rwa [mem_product] at h
 #align finset.mem_sym2_iff Finset.mem_sym2_iff
+-/
 
+#print Finset.mk'_mem_sym2_iff /-
 theorem mk'_mem_sym2_iff : ⟦(a, b)⟧ ∈ s.Sym2 ↔ a ∈ s ∧ b ∈ s := by rw [mem_sym2_iff, Sym2.ball]
 #align finset.mk_mem_sym2_iff Finset.mk'_mem_sym2_iff
+-/
 
+#print Finset.sym2_empty /-
 @[simp]
 theorem sym2_empty : (∅ : Finset α).Sym2 = ∅ :=
   rfl
 #align finset.sym2_empty Finset.sym2_empty
+-/
 
+#print Finset.sym2_eq_empty /-
 @[simp]
 theorem sym2_eq_empty : s.Sym2 = ∅ ↔ s = ∅ := by
   rw [Finset.sym2, image_eq_empty, product_eq_empty, or_self_iff]
 #align finset.sym2_eq_empty Finset.sym2_eq_empty
+-/
 
+#print Finset.sym2_nonempty /-
 @[simp]
 theorem sym2_nonempty : s.Sym2.Nonempty ↔ s.Nonempty := by
   rw [Finset.sym2, nonempty.image_iff, nonempty_product, and_self_iff]
 #align finset.sym2_nonempty Finset.sym2_nonempty
+-/
 
 alias sym2_nonempty ↔ _ nonempty.sym2
-#align finset.nonempty.sym2 Finset.Nonempty.sym2
+#align finset.nonempty.sym2 Finset.nonempty.sym2
 
 attribute [protected] nonempty.sym2
 
+#print Finset.sym2_univ /-
 @[simp]
 theorem sym2_univ [Fintype α] : (univ : Finset α).Sym2 = univ :=
   rfl
 #align finset.sym2_univ Finset.sym2_univ
+-/
 
+#print Finset.sym2_singleton /-
 @[simp]
 theorem sym2_singleton (a : α) : ({a} : Finset α).Sym2 = {Sym2.diag a} := by
   rw [Finset.sym2, singleton_product_singleton, image_singleton, Sym2.diag]
 #align finset.sym2_singleton Finset.sym2_singleton
+-/
 
+#print Finset.diag_mem_sym2_iff /-
 @[simp]
 theorem diag_mem_sym2_iff : Sym2.diag a ∈ s.Sym2 ↔ a ∈ s :=
   mk'_mem_sym2_iff.trans <| and_self_iff _
 #align finset.diag_mem_sym2_iff Finset.diag_mem_sym2_iff
+-/
 
+#print Finset.sym2_mono /-
 @[simp]
 theorem sym2_mono (h : s ⊆ t) : s.Sym2 ⊆ t.Sym2 := fun m he =>
   mem_sym2_iff.2 fun a ha => h <| mem_sym2_iff.1 he _ ha
 #align finset.sym2_mono Finset.sym2_mono
+-/
 
+#print Finset.image_diag_union_image_offDiag /-
 theorem image_diag_union_image_offDiag :
     s.diag.image Quotient.mk' ∪ s.offDiag.image Quotient.mk' = s.Sym2 :=
   by
   rw [← image_union, diag_union_off_diag]
   rfl
 #align finset.image_diag_union_image_off_diag Finset.image_diag_union_image_offDiag
+-/
 
 end Sym2
 
@@ -123,23 +149,39 @@ section Sym
 
 variable {n : ℕ} {m : Sym α n}
 
+#print Finset.sym /-
 /-- Lifts a finset to `sym α n`. `s.sym n` is the finset of all unordered tuples of cardinality `n`
 with elements in `s`. -/
 protected def sym (s : Finset α) : ∀ n, Finset (Sym α n)
   | 0 => {∅}
   | n + 1 => s.sup fun a => (Sym n).image <| Sym.cons a
 #align finset.sym Finset.sym
+-/
 
+/- warning: finset.sym_zero -> Finset.sym_zero is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {s : Finset.{u1} α}, Eq.{succ u1} (Finset.{u1} (Sym.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (Singleton.singleton.{u1, u1} (Sym.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (Finset.{u1} (Sym.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))) (Finset.hasSingleton.{u1} (Sym.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero))))) (EmptyCollection.emptyCollection.{u1} (Sym.{u1} α (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (Sym.hasEmptyc.{u1} α)))
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {s : Finset.{u1} α}, Eq.{succ u1} (Finset.{u1} (Sym.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (Singleton.singleton.{u1, u1} (Sym.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (Finset.{u1} (Sym.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))) (Finset.instSingletonFinset.{u1} (Sym.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0)))) (EmptyCollection.emptyCollection.{u1} (Sym.{u1} α (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (Sym.instEmptyCollectionSymOfNatNatInstOfNatNat.{u1} α)))
+Case conversion may be inaccurate. Consider using '#align finset.sym_zero Finset.sym_zeroₓ'. -/
 @[simp]
 theorem sym_zero : s.Sym 0 = {∅} :=
   rfl
 #align finset.sym_zero Finset.sym_zero
 
+#print Finset.sym_succ /-
 @[simp]
 theorem sym_succ : s.Sym (n + 1) = s.sup fun a => (s.Sym n).image <| Sym.cons a :=
   rfl
 #align finset.sym_succ Finset.sym_succ
+-/
 
+/- warning: finset.mem_sym_iff -> Finset.mem_sym_iff is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {s : Finset.{u1} α} {n : Nat} {m : Sym.{u1} α n}, Iff (Membership.Mem.{u1, u1} (Sym.{u1} α n) (Finset.{u1} (Sym.{u1} α n)) (Finset.hasMem.{u1} (Sym.{u1} α n)) m (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s n)) (forall (a : α), (Membership.Mem.{u1, u1} α (Sym.{u1} α n) (Sym.hasMem.{u1} α n) a m) -> (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) a s))
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {s : Finset.{u1} α} {n : Nat} {m : Sym.{u1} α n}, Iff (Membership.mem.{u1, u1} (Sym.{u1} α n) (Finset.{u1} (Sym.{u1} α n)) (Finset.instMembershipFinset.{u1} (Sym.{u1} α n)) m (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s n)) (forall (a : α), (Membership.mem.{u1, u1} α (Sym.{u1} α n) (Sym.instMembershipSym.{u1} α n) a m) -> (Membership.mem.{u1, u1} α (Finset.{u1} α) (Finset.instMembershipFinset.{u1} α) a s))
+Case conversion may be inaccurate. Consider using '#align finset.mem_sym_iff Finset.mem_sym_iffₓ'. -/
 @[simp]
 theorem mem_sym_iff : m ∈ s.Sym n ↔ ∀ a ∈ m, a ∈ s :=
   by
@@ -161,33 +203,49 @@ theorem mem_sym_iff : m ∈ s.Sym n ↔ ∀ a ∈ m, a ∈ s :=
         mem_image_of_mem _ <| ih.2 fun b hb => h _ <| Sym.mem_cons_of_mem hb⟩
 #align finset.mem_sym_iff Finset.mem_sym_iff
 
+#print Finset.sym_empty /-
 @[simp]
 theorem sym_empty (n : ℕ) : (∅ : Finset α).Sym (n + 1) = ∅ :=
   rfl
 #align finset.sym_empty Finset.sym_empty
+-/
 
+#print Finset.replicate_mem_sym /-
 theorem replicate_mem_sym (ha : a ∈ s) (n : ℕ) : Sym.replicate n a ∈ s.Sym n :=
   mem_sym_iff.2 fun b hb => by rwa [(Sym.mem_replicate.1 hb).2]
 #align finset.replicate_mem_sym Finset.replicate_mem_sym
+-/
 
+#print Finset.Nonempty.sym /-
 protected theorem Nonempty.sym (h : s.Nonempty) (n : ℕ) : (s.Sym n).Nonempty :=
   let ⟨a, ha⟩ := h
   ⟨_, replicate_mem_sym ha n⟩
 #align finset.nonempty.sym Finset.Nonempty.sym
+-/
 
+#print Finset.sym_singleton /-
 @[simp]
 theorem sym_singleton (a : α) (n : ℕ) : ({a} : Finset α).Sym n = {Sym.replicate n a} :=
   eq_singleton_iff_unique_mem.2
     ⟨replicate_mem_sym (mem_singleton.2 rfl) _, fun s hs =>
       Sym.eq_replicate_iff.2 fun b hb => eq_of_mem_singleton <| mem_sym_iff.1 hs _ hb⟩
 #align finset.sym_singleton Finset.sym_singleton
+-/
 
+#print Finset.eq_empty_of_sym_eq_empty /-
 theorem eq_empty_of_sym_eq_empty (h : s.Sym n = ∅) : s = ∅ :=
   by
   rw [← not_nonempty_iff_eq_empty] at h⊢
   exact fun hs => h (hs.Sym _)
 #align finset.eq_empty_of_sym_eq_empty Finset.eq_empty_of_sym_eq_empty
+-/
 
+/- warning: finset.sym_eq_empty -> Finset.sym_eq_empty is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {s : Finset.{u1} α} {n : Nat}, Iff (Eq.{succ u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s n) (EmptyCollection.emptyCollection.{u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.hasEmptyc.{u1} (Sym.{u1} α n)))) (And (Ne.{1} Nat n (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (Eq.{succ u1} (Finset.{u1} α) s (EmptyCollection.emptyCollection.{u1} (Finset.{u1} α) (Finset.hasEmptyc.{u1} α))))
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {s : Finset.{u1} α} {n : Nat} {m : Sym.{u1} α n}, Iff (Eq.{succ u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s n) (EmptyCollection.emptyCollection.{u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.instEmptyCollectionFinset.{u1} (Sym.{u1} α n)))) (And (Ne.{1} Nat n (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (Eq.{succ u1} (Finset.{u1} α) s (EmptyCollection.emptyCollection.{u1} (Finset.{u1} α) (Finset.instEmptyCollectionFinset.{u1} α))))
+Case conversion may be inaccurate. Consider using '#align finset.sym_eq_empty Finset.sym_eq_emptyₓ'. -/
 @[simp]
 theorem sym_eq_empty : s.Sym n = ∅ ↔ n ≠ 0 ∧ s = ∅ :=
   by
@@ -198,21 +256,37 @@ theorem sym_eq_empty : s.Sym n = ∅ ↔ n ≠ 0 ∧ s = ∅ :=
     exact sym_empty _
 #align finset.sym_eq_empty Finset.sym_eq_empty
 
+/- warning: finset.sym_nonempty -> Finset.sym_nonempty is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {s : Finset.{u1} α} {n : Nat}, Iff (Finset.Nonempty.{u1} (Sym.{u1} α n) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s n)) (Or (Eq.{1} Nat n (OfNat.ofNat.{0} Nat 0 (OfNat.mk.{0} Nat 0 (Zero.zero.{0} Nat Nat.hasZero)))) (Finset.Nonempty.{u1} α s))
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] {s : Finset.{u1} α} {n : Nat} {m : Sym.{u1} α n}, Iff (Finset.Nonempty.{u1} (Sym.{u1} α n) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s n)) (Or (Eq.{1} Nat n (OfNat.ofNat.{0} Nat 0 (instOfNatNat 0))) (Finset.Nonempty.{u1} α s))
+Case conversion may be inaccurate. Consider using '#align finset.sym_nonempty Finset.sym_nonemptyₓ'. -/
 @[simp]
 theorem sym_nonempty : (s.Sym n).Nonempty ↔ n = 0 ∨ s.Nonempty := by
   simp_rw [nonempty_iff_ne_empty, Ne.def, sym_eq_empty, not_and_or, not_ne_iff]
 #align finset.sym_nonempty Finset.sym_nonempty
 
+#print Finset.sym_univ /-
 @[simp]
 theorem sym_univ [Fintype α] (n : ℕ) : (univ : Finset α).Sym n = univ :=
   eq_univ_iff_forall.2 fun s => mem_sym_iff.2 fun a _ => mem_univ _
 #align finset.sym_univ Finset.sym_univ
+-/
 
+#print Finset.sym_mono /-
 @[simp]
 theorem sym_mono (h : s ⊆ t) (n : ℕ) : s.Sym n ⊆ t.Sym n := fun m hm =>
   mem_sym_iff.2 fun a ha => h <| mem_sym_iff.1 hm _ ha
 #align finset.sym_mono Finset.sym_mono
+-/
 
+/- warning: finset.sym_inter -> Finset.sym_inter is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (s : Finset.{u1} α) (t : Finset.{u1} α) (n : Nat), Eq.{succ u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) (Inter.inter.{u1} (Finset.{u1} α) (Finset.hasInter.{u1} α (fun (a : α) (b : α) => _inst_1 a b)) s t) n) (Inter.inter.{u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.hasInter.{u1} (Sym.{u1} α n) (fun (a : Sym.{u1} α n) (b : Sym.{u1} α n) => Subtype.decidableEq.{u1} (Multiset.{u1} α) (fun (x : Multiset.{u1} α) => Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) x) n) (fun (a : Multiset.{u1} α) (b : Multiset.{u1} α) => Multiset.decidableEq.{u1} α (fun (a : α) (b : α) => _inst_1 a b) a b) a b)) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s n) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) t n))
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (s : Finset.{u1} α) (t : Finset.{u1} α) (n : Nat), Eq.{succ u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) (Inter.inter.{u1} (Finset.{u1} α) (Finset.instInterFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b)) s t) n) (Inter.inter.{u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.instInterFinset.{u1} (Sym.{u1} α n) (fun (a : Sym.{u1} α n) (b : Sym.{u1} α n) => Finset.instDecidableEqSym.{u1} α (fun (x : α) (b : α) => _inst_1 x b) n a b)) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s n) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) t n))
+Case conversion may be inaccurate. Consider using '#align finset.sym_inter Finset.sym_interₓ'. -/
 @[simp]
 theorem sym_inter (s t : Finset α) (n : ℕ) : (s ∩ t).Sym n = s.Sym n ∩ t.Sym n :=
   by
@@ -220,23 +294,34 @@ theorem sym_inter (s t : Finset α) (n : ℕ) : (s ∩ t).Sym n = s.Sym n ∩ t.
   simp only [mem_inter, mem_sym_iff, imp_and, forall_and]
 #align finset.sym_inter Finset.sym_inter
 
+/- warning: finset.sym_union -> Finset.sym_union is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (s : Finset.{u1} α) (t : Finset.{u1} α) (n : Nat), HasSubset.Subset.{u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.hasSubset.{u1} (Sym.{u1} α n)) (Union.union.{u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.hasUnion.{u1} (Sym.{u1} α n) (fun (a : Sym.{u1} α n) (b : Sym.{u1} α n) => Subtype.decidableEq.{u1} (Multiset.{u1} α) (fun (x : Multiset.{u1} α) => Eq.{1} Nat (coeFn.{succ u1, succ u1} (AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (fun (_x : AddMonoidHom.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) => (Multiset.{u1} α) -> Nat) (AddMonoidHom.hasCoeToFun.{u1, 0} (Multiset.{u1} α) Nat (AddMonoid.toAddZeroClass.{u1} (Multiset.{u1} α) (AddRightCancelMonoid.toAddMonoid.{u1} (Multiset.{u1} α) (AddCancelMonoid.toAddRightCancelMonoid.{u1} (Multiset.{u1} α) (AddCancelCommMonoid.toAddCancelMonoid.{u1} (Multiset.{u1} α) (OrderedCancelAddCommMonoid.toCancelAddCommMonoid.{u1} (Multiset.{u1} α) (Multiset.orderedCancelAddCommMonoid.{u1} α)))))) (AddMonoid.toAddZeroClass.{0} Nat Nat.addMonoid)) (Multiset.card.{u1} α) x) n) (fun (a : Multiset.{u1} α) (b : Multiset.{u1} α) => Multiset.decidableEq.{u1} α (fun (a : α) (b : α) => _inst_1 a b) a b) a b)) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s n) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) t n)) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) (Union.union.{u1} (Finset.{u1} α) (Finset.hasUnion.{u1} α (fun (a : α) (b : α) => _inst_1 a b)) s t) n)
+but is expected to have type
+  forall {α : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} α] (s : Finset.{u1} α) (t : Finset.{u1} α) (n : Nat), HasSubset.Subset.{u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.instHasSubsetFinset.{u1} (Sym.{u1} α n)) (Union.union.{u1} (Finset.{u1} (Sym.{u1} α n)) (Finset.instUnionFinset.{u1} (Sym.{u1} α n) (fun (a : Sym.{u1} α n) (b : Sym.{u1} α n) => Finset.instDecidableEqSym.{u1} α (fun (x : α) (b : α) => _inst_1 x b) n a b)) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) s n) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) t n)) (Finset.sym.{u1} α (fun (a : α) (b : α) => _inst_1 a b) (Union.union.{u1} (Finset.{u1} α) (Finset.instUnionFinset.{u1} α (fun (a : α) (b : α) => _inst_1 a b)) s t) n)
+Case conversion may be inaccurate. Consider using '#align finset.sym_union Finset.sym_unionₓ'. -/
 @[simp]
 theorem sym_union (s t : Finset α) (n : ℕ) : s.Sym n ∪ t.Sym n ⊆ (s ∪ t).Sym n :=
   union_subset (sym_mono (subset_union_left s t) n) (sym_mono (subset_union_right s t) n)
 #align finset.sym_union Finset.sym_union
 
+#print Finset.sym_fill_mem /-
 theorem sym_fill_mem (a : α) {i : Fin (n + 1)} {m : Sym α (n - i)} (h : m ∈ s.Sym (n - i)) :
     m.fill a i ∈ (insert a s).Sym n :=
   mem_sym_iff.2 fun b hb =>
     mem_insert.2 <| (Sym.mem_fill_iff.1 hb).imp And.right <| mem_sym_iff.1 h b
 #align finset.sym_fill_mem Finset.sym_fill_mem
+-/
 
+#print Finset.sym_filterNe_mem /-
 theorem sym_filterNe_mem (a : α) (h : m ∈ s.Sym n) :
     (m.filter_ne a).2 ∈ (s.eraseₓ a).Sym (n - (m.filter_ne a).1) :=
   mem_sym_iff.2 fun b H =>
     mem_erase.2 <| (Multiset.mem_filter.1 H).symm.imp Ne.symm <| mem_sym_iff.1 h b
 #align finset.sym_filter_ne_mem Finset.sym_filterNe_mem
+-/
 
+#print Finset.symInsertEquiv /-
 /-- If `a` does not belong to the finset `s`, then the `n`th symmetric power of `{a} ∪ s` is
   in 1-1 correspondence with the disjoint union of the `n - i`th symmetric powers of `s`,
   for `0 ≤ i ≤ n`. -/
@@ -255,6 +340,7 @@ def symInsertEquiv (h : a ∉ s) : (insert a s).Sym n ≃ Σi : Fin (n + 1), s.S
     refine' Eq.trans _ (Sym.filter_ne_fill a _ _)
     exacts[rfl, h ∘ mem_sym_iff.1 hm a]
 #align finset.sym_insert_equiv Finset.symInsertEquiv
+-/
 
 end Sym
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module data.finset.sym
-! leanprover-community/mathlib commit 99624c1a1c3d353ed60e0a13e03246ce4807b56d
+! leanprover-community/mathlib commit 02ba8949f486ebecf93fe7460f1ed0564b5e442c
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -203,11 +203,6 @@ theorem sym_nonempty : (s.Sym n).Nonempty ↔ n = 0 ∨ s.Nonempty := by
   simp_rw [nonempty_iff_ne_empty, Ne.def, sym_eq_empty, not_and_or, not_ne_iff]
 #align finset.sym_nonempty Finset.sym_nonempty
 
-alias sym_nonempty ↔ _ nonempty.sym
-#align finset.nonempty.sym Finset.Nonempty.sym
-
-attribute [protected] nonempty.sym
-
 @[simp]
 theorem sym_univ [Fintype α] (n : ℕ) : (univ : Finset α).Sym n = univ :=
   eq_univ_iff_forall.2 fun s => mem_sym_iff.2 fun a _ => mem_univ _

Changes in mathlib4

mathlib3
mathlib4
chore: adapt to multiple goal linter 1 (#12338)

A PR accompanying #12339.

Zulip discussion

Diff
@@ -289,8 +289,9 @@ def symInsertEquiv (h : a ∉ s) : (insert a s).sym n ≃ Σi : Fin (n + 1), s.s
   left_inv m := Subtype.ext <| m.1.fill_filterNe a
   right_inv := fun ⟨i, m, hm⟩ ↦ by
     refine' Function.Injective.sigma_map (Function.injective_id) (fun i ↦ _) _
-    exact fun i ↦ Sym α (n - i)
-    swap; exact Subtype.coe_injective
+    · exact fun i ↦ Sym α (n - i)
+    swap
+    · exact Subtype.coe_injective
     refine Eq.trans ?_ (Sym.filter_ne_fill a _ ?_)
     exacts [rfl, h ∘ mem_sym_iff.1 hm a]
 #align finset.sym_insert_equiv Finset.symInsertEquiv
chore: avoid automatically generated instance names (#12270)
Diff
@@ -168,7 +168,8 @@ section Sym
 variable {n : ℕ}
 
 -- Porting note: instance needed
-instance : DecidableEq (Sym α n) := Subtype.instDecidableEqSubtype
+instance : DecidableEq (Sym α n) :=
+  inferInstanceAs <| DecidableEq <| Subtype _
 
 /-- Lifts a finset to `Sym α n`. `s.sym n` is the finset of all unordered tuples of cardinality `n`
 with elements in `s`. -/
chore: bump aesop; update syntax (#10955)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -97,7 +97,7 @@ theorem sym2_eq_empty : s.sym2 = ∅ ↔ s = ∅ := by
   rw [← val_eq_zero, sym2_val, Multiset.sym2_eq_zero_iff, val_eq_zero]
 #align finset.sym2_eq_empty Finset.sym2_eq_empty
 
-@[simp, aesop safe apply (rule_sets [finsetNonempty])]
+@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
 theorem sym2_nonempty : s.sym2.Nonempty ↔ s.Nonempty := by
   rw [← not_iff_not]
   simp_rw [not_nonempty_iff_eq_empty, sym2_eq_empty]
feat: Positivity extension for Finset.sum (#10538)

Also define a new aesop rule-set and an auxiliary metaprogram proveFinsetNonempty for dealing with Finset.Nonempty conditions.

From LeanAPAP

Co-authored-by: Alex J. Best <alex.j.best@gmail.com>

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Alex J Best <alex.j.best@gmail.com>

Diff
@@ -97,7 +97,7 @@ theorem sym2_eq_empty : s.sym2 = ∅ ↔ s = ∅ := by
   rw [← val_eq_zero, sym2_val, Multiset.sym2_eq_zero_iff, val_eq_zero]
 #align finset.sym2_eq_empty Finset.sym2_eq_empty
 
-@[simp]
+@[simp, aesop safe apply (rule_sets [finsetNonempty])]
 theorem sym2_nonempty : s.sym2.Nonempty ↔ s.Nonempty := by
   rw [← not_iff_not]
   simp_rw [not_nonempty_iff_eq_empty, sym2_eq_empty]
bug (Mathlib.Data.Finset.Sym) : suppress global variable (m : Sym alpha n) (#10637)

A global variable {m : Sym α n} was present in Mathlib.Data.Finset.Sym with the very unfortunate effect that docs#Finset.sym_eq_empty was using it :

theorem Finset.sym_eq_empty {α : Type u_1} [DecidableEq α] {s : Finset α} {n : ℕ} 
    {m : Sym α n} :
    Finset.sym s n = ∅ ↔ n ≠ 0 ∧ s = ∅

thus making it impossible to use to prove its goal. The line is modified, added in a few functions when needed.

Co-authored-by: Antoine Chambert-Loir <antoine.chambert-loir@math.univ-paris-diderot.fr>

Diff
@@ -165,7 +165,7 @@ end Sym2
 
 section Sym
 
-variable {n : ℕ} {m : Sym α n}
+variable {n : ℕ}
 
 -- Porting note: instance needed
 instance : DecidableEq (Sym α n) := Subtype.instDecidableEqSubtype
@@ -186,7 +186,7 @@ theorem sym_succ : s.sym (n + 1) = s.sup fun a ↦ (s.sym n).image <| Sym.cons a
 #align finset.sym_succ Finset.sym_succ
 
 @[simp]
-theorem mem_sym_iff : m ∈ s.sym n ↔ ∀ a ∈ m, a ∈ s := by
+theorem mem_sym_iff {m : Sym α n} : m ∈ s.sym n ↔ ∀ a ∈ m, a ∈ s := by
   induction' n with n ih
   · refine' mem_singleton.trans ⟨_, fun _ ↦ Sym.eq_nil_of_card_zero _⟩
     rintro rfl
@@ -241,9 +241,7 @@ theorem sym_eq_empty : s.sym n = ∅ ↔ n ≠ 0 ∧ s = ∅ := by
 
 @[simp]
 theorem sym_nonempty : (s.sym n).Nonempty ↔ n = 0 ∨ s.Nonempty := by
-  simp_rw [nonempty_iff_ne_empty, Ne.def]
--- Porting note: using simp_rw does not work here, it does nothing...
-  rwa [sym_eq_empty, not_and_or, not_ne_iff]
+  simp only [nonempty_iff_ne_empty, ne_eq, sym_eq_empty, not_and_or, not_ne_iff]
 #align finset.sym_nonempty Finset.sym_nonempty
 
 @[simp]
@@ -273,7 +271,7 @@ theorem sym_fill_mem (a : α) {i : Fin (n + 1)} {m : Sym α (n - i)} (h : m ∈
     mem_insert.2 <| (Sym.mem_fill_iff.1 hb).imp And.right <| mem_sym_iff.1 h b
 #align finset.sym_fill_mem Finset.sym_fill_mem
 
-theorem sym_filterNe_mem (a : α) (h : m ∈ s.sym n) :
+theorem sym_filterNe_mem {m : Sym α n} (a : α) (h : m ∈ s.sym n) :
     (m.filterNe a).2 ∈ (Finset.erase s a).sym (n - (m.filterNe a).1) :=
   mem_sym_iff.2 fun b H ↦
     mem_erase.2 <| (Multiset.mem_filter.1 H).symm.imp Ne.symm <| mem_sym_iff.1 h b
chore: reduce imports (#9830)

This uses the improved shake script from #9772 to reduce imports across mathlib. The corresponding noshake.json file has been added to #9772.

Co-authored-by: Mario Carneiro <di.gama@gmail.com>

Diff
@@ -6,7 +6,6 @@ Authors: Yaël Dillies
 [`data.finset.sym`@`98e83c3d541c77cdb7da20d79611a780ff8e7d90`..`02ba8949f486ebecf93fe7460f1ed0564b5e442c`](https://leanprover-community.github.io/mathlib-port-status/file/data/finset/sym?range=98e83c3d541c77cdb7da20d79611a780ff8e7d90..02ba8949f486ebecf93fe7460f1ed0564b5e442c)
 -/
 import Mathlib.Data.Finset.Lattice
-import Mathlib.Data.Fintype.Prod
 import Mathlib.Data.Fintype.Vector
 import Mathlib.Data.Multiset.Sym
 
refactor: remove Sym2's global Prod setoid instance, use s(x, y) notation for unordered pairs (#8729)

The Sym2 type used a global setoid instance on α × α so that ⟦(x, y)⟧ could stand for an unordered pair using standard Quotient syntax. This commit refactors Sym2 to not use Quotient and instead use its own s(x, y) notation. One benefit to this is that this notation produces a term with type Sym2 rather than Quotient.

The Fintype instance for Sym2 is in Mathlib.Data.Finset.Sym. We switch from using the one for Quotient because it does not require DecidableEq.

Diff
@@ -44,7 +44,7 @@ protected def sym2 (s : Finset α) : Finset (Sym2 α) := ⟨s.1.sym2, s.2.sym2
 section
 variable {s t : Finset α} {a b : α}
 
-theorem mk_mem_sym2_iff : ⟦(a, b)⟧ ∈ s.sym2 ↔ a ∈ s ∧ b ∈ s := by
+theorem mk_mem_sym2_iff : s(a, b) ∈ s.sym2 ↔ a ∈ s ∧ b ∈ s := by
   rw [mem_mk, sym2_val, Multiset.mk_mem_sym2_iff, mem_mk, mem_mk]
 #align finset.mk_mem_sym2_iff Finset.mk_mem_sym2_iff
 
@@ -78,7 +78,7 @@ theorem monotone_sym2 : Monotone (Finset.sym2 : Finset α → _) := fun _ _ => s
 theorem injective_sym2 : Function.Injective (Finset.sym2 : Finset α → _) := by
   intro s t h
   ext x
-  simpa using congr(⟦(x, x)⟧ ∈ $h)
+  simpa using congr(s(x, x) ∈ $h)
 
 theorem strictMono_sym2 : StrictMono (Finset.sym2 : Finset α → _) :=
   monotone_sym2.strictMono_of_injective injective_sym2
@@ -120,7 +120,7 @@ end
 
 variable [DecidableEq α] {s t : Finset α} {a b : α}
 
-theorem sym2_eq_image : s.sym2 = (s ×ˢ s).image (Quotient.mk _) := by
+theorem sym2_eq_image : s.sym2 = (s ×ˢ s).image Sym2.mk := by
   ext z
   refine z.ind fun x y ↦ ?_
   rw [mk_mem_sym2_iff, mem_image]
@@ -133,11 +133,12 @@ theorem sym2_eq_image : s.sym2 = (s ×ˢ s).image (Quotient.mk _) := by
     obtain ⟨h, (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩)⟩ := h
       <;> simp [h]
 
-theorem isDiag_mk_of_mem_diag {a : α × α} (h : a ∈ s.diag) : Sym2.IsDiag ⟦a⟧ :=
+theorem isDiag_mk_of_mem_diag {a : α × α} (h : a ∈ s.diag) : (Sym2.mk a).IsDiag :=
   (Sym2.isDiag_iff_proj_eq _).2 (mem_diag.1 h).2
 #align finset.is_diag_mk_of_mem_diag Finset.isDiag_mk_of_mem_diag
 
-theorem not_isDiag_mk_of_mem_offDiag {a : α × α} (h : a ∈ s.offDiag) : ¬Sym2.IsDiag ⟦a⟧ := by
+theorem not_isDiag_mk_of_mem_offDiag {a : α × α} (h : a ∈ s.offDiag) :
+    ¬ (Sym2.mk a).IsDiag := by
   rw [Sym2.isDiag_iff_proj_eq]
   exact (mem_offDiag.1 h).2.2
 #align finset.not_is_diag_mk_of_mem_off_diag Finset.not_isDiag_mk_of_mem_offDiag
@@ -157,7 +158,7 @@ theorem diag_mem_sym2_iff : Sym2.diag a ∈ s.sym2 ↔ a ∈ s := by simp [diag_
 #align finset.diag_mem_sym2_iff Finset.diag_mem_sym2_iff
 
 theorem image_diag_union_image_offDiag :
-    s.diag.image (Quotient.mk _) ∪ s.offDiag.image (Quotient.mk _) = s.sym2 := by
+    s.diag.image Sym2.mk ∪ s.offDiag.image Sym2.mk = s.sym2 := by
   rw [← image_union, diag_union_offDiag, sym2_eq_image]
 #align finset.image_diag_union_image_off_diag Finset.image_diag_union_image_offDiag
 
feat: remove DecidableEq argument from Finset.sym2 (#8211)
Diff
@@ -8,7 +8,7 @@ Authors: Yaël Dillies
 import Mathlib.Data.Finset.Lattice
 import Mathlib.Data.Fintype.Prod
 import Mathlib.Data.Fintype.Vector
-import Mathlib.Data.Sym.Sym2
+import Mathlib.Data.Multiset.Sym
 
 #align_import data.finset.sym from "leanprover-community/mathlib"@"02ba8949f486ebecf93fe7460f1ed0564b5e442c"
 
@@ -23,6 +23,7 @@ This file defines the symmetric powers of a finset as `Finset (Sym α n)` and `F
   whose elements are in `s`.
 * `Finset.sym2`: The symmetric square of a finset. `s.sym2` is all the pairs whose elements are in
   `s`.
+* A `Fintype (Sym2 α)` instance that does not require `DecidableEq α`.
 
 ## TODO
 
@@ -32,37 +33,61 @@ This file defines the symmetric powers of a finset as `Finset (Sym α n)` and `F
 
 namespace Finset
 
-variable {α : Type*} [DecidableEq α] {s t : Finset α} {a b : α}
+variable {α : Type*}
 
-theorem isDiag_mk'_of_mem_diag {a : α × α} (h : a ∈ s.diag) : Sym2.IsDiag ⟦a⟧ :=
-  (Sym2.isDiag_iff_proj_eq _).2 (mem_diag.1 h).2
-#align finset.is_diag_mk_of_mem_diag Finset.isDiag_mk'_of_mem_diag
+/-- `s.sym2` is the finset of all unordered pairs of elements from `s`.
+It is the image of `s ×ˢ s` under the quotient `α × α → Sym2 α`. -/
+@[simps]
+protected def sym2 (s : Finset α) : Finset (Sym2 α) := ⟨s.1.sym2, s.2.sym2⟩
+#align finset.sym2 Finset.sym2
 
-theorem not_isDiag_mk'_of_mem_offDiag {a : α × α} (h : a ∈ s.offDiag) : ¬Sym2.IsDiag ⟦a⟧ := by
-  rw [Sym2.isDiag_iff_proj_eq]
-  exact (mem_offDiag.1 h).2.2
-#align finset.not_is_diag_mk_of_mem_off_diag Finset.not_isDiag_mk'_of_mem_offDiag
+section
+variable {s t : Finset α} {a b : α}
 
-section Sym2
+theorem mk_mem_sym2_iff : ⟦(a, b)⟧ ∈ s.sym2 ↔ a ∈ s ∧ b ∈ s := by
+  rw [mem_mk, sym2_val, Multiset.mk_mem_sym2_iff, mem_mk, mem_mk]
+#align finset.mk_mem_sym2_iff Finset.mk_mem_sym2_iff
 
-variable {m : Sym2 α}
+@[simp]
+theorem mem_sym2_iff {m : Sym2 α} : m ∈ s.sym2 ↔ ∀ a ∈ m, a ∈ s := by
+  rw [mem_mk, sym2_val, Multiset.mem_sym2_iff]
+  simp only [mem_val]
+#align finset.mem_sym2_iff Finset.mem_sym2_iff
 
-/-- Lifts a finset to `Sym2 α`. `s.sym2` is the finset of all pairs with elements in `s`. -/
-protected def sym2 (s : Finset α) : Finset (Sym2 α) := (s ×ˢ s).image Quotient.mk'
-#align finset.sym2 Finset.sym2
+instance _root_.Sym2.instFintype [Fintype α] : Fintype (Sym2 α) where
+  elems := Finset.univ.sym2
+  complete := fun x ↦ by rw [mem_sym2_iff]; exact (fun a _ ↦ mem_univ a)
 
+-- Note(kmill): Using a default argument to make this simp lemma more general.
 @[simp]
-theorem mem_sym2_iff : m ∈ s.sym2 ↔ ∀ a ∈ m, a ∈ s := by
-  refine
-    mem_image.trans
-      ⟨?_, fun h ↦ ⟨m.out, mem_product.2 ⟨h _ m.out_fst_mem, h _ m.out_snd_mem⟩, m.out_eq⟩⟩
-  rintro ⟨⟨a, b⟩, h, rfl⟩
-  rw [Quotient.mk', @Sym2.ball _ (fun x ↦ x ∈ s)]
-  rwa [mem_product] at h
-#align finset.mem_sym2_iff Finset.mem_sym2_iff
+theorem sym2_univ [Fintype α] (inst : Fintype (Sym2 α) := Sym2.instFintype) :
+    (univ : Finset α).sym2 = univ := by
+  ext
+  simp only [mem_sym2_iff, mem_univ, implies_true]
+#align finset.sym2_univ Finset.sym2_univ
+
+@[simp, mono]
+theorem sym2_mono (h : s ⊆ t) : s.sym2 ⊆ t.sym2 := by
+  rw [← val_le_iff, sym2_val, sym2_val]
+  apply Multiset.sym2_mono
+  rwa [val_le_iff]
+#align finset.sym2_mono Finset.sym2_mono
+
+theorem monotone_sym2 : Monotone (Finset.sym2 : Finset α → _) := fun _ _ => sym2_mono
+
+theorem injective_sym2 : Function.Injective (Finset.sym2 : Finset α → _) := by
+  intro s t h
+  ext x
+  simpa using congr(⟦(x, x)⟧ ∈ $h)
+
+theorem strictMono_sym2 : StrictMono (Finset.sym2 : Finset α → _) :=
+  monotone_sym2.strictMono_of_injective injective_sym2
 
-theorem mk'_mem_sym2_iff : ⟦(a, b)⟧ ∈ s.sym2 ↔ a ∈ s ∧ b ∈ s := by rw [mem_sym2_iff, Sym2.ball]
-#align finset.mk_mem_sym2_iff Finset.mk'_mem_sym2_iff
+theorem sym2_toFinset [DecidableEq α] (m : Multiset α) :
+    m.toFinset.sym2 = m.sym2.toFinset := by
+  ext z
+  refine z.ind fun x y ↦ ?_
+  simp only [mk_mem_sym2_iff, Multiset.mem_toFinset, Multiset.mk_mem_sym2_iff]
 
 @[simp]
 theorem sym2_empty : (∅ : Finset α).sym2 = ∅ := rfl
@@ -70,50 +95,70 @@ theorem sym2_empty : (∅ : Finset α).sym2 = ∅ := rfl
 
 @[simp]
 theorem sym2_eq_empty : s.sym2 = ∅ ↔ s = ∅ := by
-  rw [Finset.sym2, image_eq_empty, product_eq_empty, or_self_iff]
+  rw [← val_eq_zero, sym2_val, Multiset.sym2_eq_zero_iff, val_eq_zero]
 #align finset.sym2_eq_empty Finset.sym2_eq_empty
 
 @[simp]
 theorem sym2_nonempty : s.sym2.Nonempty ↔ s.Nonempty := by
-  rw [Finset.sym2, Nonempty.image_iff, nonempty_product, and_self_iff]
+  rw [← not_iff_not]
+  simp_rw [not_nonempty_iff_eq_empty, sym2_eq_empty]
 #align finset.sym2_nonempty Finset.sym2_nonempty
 
-alias ⟨_, nonempty.sym2⟩ := sym2_nonempty
-#align finset.nonempty.sym2 Finset.nonempty.sym2
-
--- Porting note: attribute does not exist
--- attribute [protected] nonempty.sym2
+protected alias ⟨_, Nonempty.sym2⟩ := sym2_nonempty
+#align finset.nonempty.sym2 Finset.Nonempty.sym2
 
 @[simp]
-theorem sym2_univ [Fintype α] : (univ : Finset α).sym2 = univ := by
-  ext
-  simp only [mem_sym2_iff, mem_univ, implies_true]
-#align finset.sym2_univ Finset.sym2_univ
-
-@[simp]
-theorem sym2_singleton (a : α) : ({a} : Finset α).sym2 = {Sym2.diag a} := by
-  rw [Finset.sym2, singleton_product_singleton, image_singleton, Sym2.diag, Quotient.mk']
+theorem sym2_singleton (a : α) : ({a} : Finset α).sym2 = {Sym2.diag a} := rfl
 #align finset.sym2_singleton Finset.sym2_singleton
 
+/-- Finset **stars and bars** for the case `n = 2`. -/
+theorem card_sym2 (s : Finset α) : s.sym2.card = Nat.choose (s.card + 1) 2 := by
+  rw [card_def, sym2_val, Multiset.card_sym2, ← card_def]
+#align finset.card_sym2 Finset.card_sym2
+
+end
+
+variable [DecidableEq α] {s t : Finset α} {a b : α}
+
+theorem sym2_eq_image : s.sym2 = (s ×ˢ s).image (Quotient.mk _) := by
+  ext z
+  refine z.ind fun x y ↦ ?_
+  rw [mk_mem_sym2_iff, mem_image]
+  constructor
+  · intro h
+    use (x, y)
+    simp only [mem_product, h, and_self, true_and]
+  · rintro ⟨⟨a, b⟩, h⟩
+    simp only [mem_product, Sym2.eq_iff] at h
+    obtain ⟨h, (⟨rfl, rfl⟩ | ⟨rfl, rfl⟩)⟩ := h
+      <;> simp [h]
+
+theorem isDiag_mk_of_mem_diag {a : α × α} (h : a ∈ s.diag) : Sym2.IsDiag ⟦a⟧ :=
+  (Sym2.isDiag_iff_proj_eq _).2 (mem_diag.1 h).2
+#align finset.is_diag_mk_of_mem_diag Finset.isDiag_mk_of_mem_diag
+
+theorem not_isDiag_mk_of_mem_offDiag {a : α × α} (h : a ∈ s.offDiag) : ¬Sym2.IsDiag ⟦a⟧ := by
+  rw [Sym2.isDiag_iff_proj_eq]
+  exact (mem_offDiag.1 h).2.2
+#align finset.not_is_diag_mk_of_mem_off_diag Finset.not_isDiag_mk_of_mem_offDiag
+
+section Sym2
+
+variable {m : Sym2 α}
+
 -- Porting note: add this lemma and remove simp in the next lemma since simpNF lint
 -- warns that its LHS is not in normal form
 @[simp]
 theorem diag_mem_sym2_mem_iff : (∀ b, b ∈ Sym2.diag a → b ∈ s) ↔ a ∈ s := by
   rw [← mem_sym2_iff]
-  exact mk'_mem_sym2_iff.trans <| and_self_iff
+  exact mk_mem_sym2_iff.trans <| and_self_iff
 
 theorem diag_mem_sym2_iff : Sym2.diag a ∈ s.sym2 ↔ a ∈ s := by simp [diag_mem_sym2_mem_iff]
 #align finset.diag_mem_sym2_iff Finset.diag_mem_sym2_iff
 
-@[simp]
-theorem sym2_mono (h : s ⊆ t) : s.sym2 ⊆ t.sym2 := fun _m he ↦
-  mem_sym2_iff.2 fun _a ha ↦ h <| mem_sym2_iff.1 he _ ha
-#align finset.sym2_mono Finset.sym2_mono
-
 theorem image_diag_union_image_offDiag :
-    s.diag.image Quotient.mk' ∪ s.offDiag.image Quotient.mk' = s.sym2 := by
-  rw [← image_union, diag_union_offDiag]
-  rfl
+    s.diag.image (Quotient.mk _) ∪ s.offDiag.image (Quotient.mk _) = s.sym2 := by
+  rw [← image_union, diag_union_offDiag, sym2_eq_image]
 #align finset.image_diag_union_image_off_diag Finset.image_diag_union_image_offDiag
 
 end Sym2
chore: bump Std to Std#340 (#8104)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -100,7 +100,7 @@ theorem sym2_singleton (a : α) : ({a} : Finset α).sym2 = {Sym2.diag a} := by
 @[simp]
 theorem diag_mem_sym2_mem_iff : (∀ b, b ∈ Sym2.diag a → b ∈ s) ↔ a ∈ s := by
   rw [← mem_sym2_iff]
-  exact mk'_mem_sym2_iff.trans <| and_self_iff _
+  exact mk'_mem_sym2_iff.trans <| and_self_iff
 
 theorem diag_mem_sym2_iff : Sym2.diag a ∈ s.sym2 ↔ a ∈ s := by simp [diag_mem_sym2_mem_iff]
 #align finset.diag_mem_sym2_iff Finset.diag_mem_sym2_iff
feat: patch for new alias command (#6172)
Diff
@@ -78,7 +78,7 @@ theorem sym2_nonempty : s.sym2.Nonempty ↔ s.Nonempty := by
   rw [Finset.sym2, Nonempty.image_iff, nonempty_product, and_self_iff]
 #align finset.sym2_nonempty Finset.sym2_nonempty
 
-alias sym2_nonempty ↔ _ nonempty.sym2
+alias ⟨_, nonempty.sym2⟩ := sym2_nonempty
 #align finset.nonempty.sym2 Finset.nonempty.sym2
 
 -- Porting note: attribute does not exist
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -32,7 +32,7 @@ This file defines the symmetric powers of a finset as `Finset (Sym α n)` and `F
 
 namespace Finset
 
-variable {α : Type _} [DecidableEq α] {s t : Finset α} {a b : α}
+variable {α : Type*} [DecidableEq α] {s t : Finset α} {a b : α}
 
 theorem isDiag_mk'_of_mem_diag {a : α × α} (h : a ∈ s.diag) : Sym2.IsDiag ⟦a⟧ :=
   (Sym2.isDiag_iff_proj_eq _).2 (mem_diag.1 h).2
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -3,11 +3,6 @@ Copyright (c) 2021 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
-! This file was ported from Lean 3 source module data.finset.sym
-! leanprover-community/mathlib commit 02ba8949f486ebecf93fe7460f1ed0564b5e442c
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
-
 [`data.finset.sym`@`98e83c3d541c77cdb7da20d79611a780ff8e7d90`..`02ba8949f486ebecf93fe7460f1ed0564b5e442c`](https://leanprover-community.github.io/mathlib-port-status/file/data/finset/sym?range=98e83c3d541c77cdb7da20d79611a780ff8e7d90..02ba8949f486ebecf93fe7460f1ed0564b5e442c)
 -/
 import Mathlib.Data.Finset.Lattice
@@ -15,6 +10,8 @@ import Mathlib.Data.Fintype.Prod
 import Mathlib.Data.Fintype.Vector
 import Mathlib.Data.Sym.Sym2
 
+#align_import data.finset.sym from "leanprover-community/mathlib"@"02ba8949f486ebecf93fe7460f1ed0564b5e442c"
+
 /-!
 # Symmetric powers of a finset
 
chore: clean up spacing around 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
Diff
@@ -184,7 +184,7 @@ theorem sym_singleton (a : α) (n : ℕ) : ({a} : Finset α).sym n = {Sym.replic
 #align finset.sym_singleton Finset.sym_singleton
 
 theorem eq_empty_of_sym_eq_empty (h : s.sym n = ∅) : s = ∅ := by
-  rw [← not_nonempty_iff_eq_empty] at h⊢
+  rw [← not_nonempty_iff_eq_empty] at h ⊢
   exact fun hs ↦ h (hs.sym _)
 #align finset.eq_empty_of_sym_eq_empty Finset.eq_empty_of_sym_eq_empty
 
refactor: use the typeclass SProd to implement overloaded notation · ×ˢ · (#4200)

Currently, the following notations are changed from · ×ˢ · because Lean 4 can't deal with ambiguous notations. | Definition | Notation | | :

Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: Chris Hughes <chrishughes24@gmail.com>

Diff
@@ -51,8 +51,7 @@ section Sym2
 variable {m : Sym2 α}
 
 /-- Lifts a finset to `Sym2 α`. `s.sym2` is the finset of all pairs with elements in `s`. -/
--- Porting note: changed ×ˢ to xᶠ
-protected def sym2 (s : Finset α) : Finset (Sym2 α) := (s ×ᶠ s).image Quotient.mk'
+protected def sym2 (s : Finset α) : Finset (Sym2 α) := (s ×ˢ s).image Quotient.mk'
 #align finset.sym2 Finset.sym2
 
 @[simp]
chore: bye-bye, solo bys! (#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 bys".

Diff
@@ -247,13 +247,12 @@ def symInsertEquiv (h : a ∉ s) : (insert a s).sym n ≃ Σi : Fin (n + 1), s.s
   toFun m := ⟨_, (m.1.filterNe a).2, by convert sym_filterNe_mem a m.2; rw [erase_insert h]⟩
   invFun m := ⟨m.2.1.fill a m.1, sym_fill_mem a m.2.2⟩
   left_inv m := Subtype.ext <| m.1.fill_filterNe a
-  right_inv := fun ⟨i, m, hm⟩ ↦
-    by
-      refine' Function.Injective.sigma_map (Function.injective_id) (fun i ↦ _) _
-      exact fun i ↦ Sym α (n - i)
-      swap; exact Subtype.coe_injective
-      refine Eq.trans ?_ (Sym.filter_ne_fill a _ ?_)
-      exacts[rfl, h ∘ mem_sym_iff.1 hm a]
+  right_inv := fun ⟨i, m, hm⟩ ↦ by
+    refine' Function.Injective.sigma_map (Function.injective_id) (fun i ↦ _) _
+    exact fun i ↦ Sym α (n - i)
+    swap; exact Subtype.coe_injective
+    refine Eq.trans ?_ (Sym.filter_ne_fill a _ ?_)
+    exacts [rfl, h ∘ mem_sym_iff.1 hm a]
 #align finset.sym_insert_equiv Finset.symInsertEquiv
 
 end Sym
chore: no newline before aligns (#3735)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -254,7 +254,7 @@ def symInsertEquiv (h : a ∉ s) : (insert a s).sym n ≃ Σi : Fin (n + 1), s.s
       swap; exact Subtype.coe_injective
       refine Eq.trans ?_ (Sym.filter_ne_fill a _ ?_)
       exacts[rfl, h ∘ mem_sym_iff.1 hm a]
- #align finset.sym_insert_equiv Finset.symInsertEquiv
+#align finset.sym_insert_equiv Finset.symInsertEquiv
 
 end Sym
 
chore: fix #align lines (#3640)

This PR fixes two things:

  • Most align statements for definitions and theorems and instances that are separated by two newlines from the relevant declaration (s/\n\n#align/\n#align). This is often seen in the mathport output after ending calc blocks.
  • All remaining more-than-one-line #align statements. (This was needed for a script I wrote for #3630.)
Diff
@@ -53,8 +53,6 @@ variable {m : Sym2 α}
 /-- Lifts a finset to `Sym2 α`. `s.sym2` is the finset of all pairs with elements in `s`. -/
 -- Porting note: changed ×ˢ to xᶠ
 protected def sym2 (s : Finset α) : Finset (Sym2 α) := (s ×ᶠ s).image Quotient.mk'
-
-
 #align finset.sym2 Finset.sym2
 
 @[simp]
feat: port Data.Finset.Sym (#2168)

Some instances that were not synthezised automatically are added to the files Data.Sym.Basic and Data.Sym.Sym2

See https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Classical

Dependencies 6 + 196

197 files ported (97.0%)
89045 lines ported (97.6%)
Show graph

The unported dependencies are