File: Mathlib/Data/Finset/Sym.lean

full_name: Finset.sym2_val
code: /-- `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 α) 
goal: s.sym2.val = s.val.sym2

full_name: Finset.sym2
code: /-- `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 α) 
goal: Finset (Sym2 α)

full_name: Finset.mk_mem_sym2_iff
code: theorem mk_mem_sym2_iff : s(a, b) ∈ s.sym2 ↔ a ∈ s ∧ b ∈ s 
goal: s(a, b) ∈ s.sym2 ↔ a ∈ s ∧ b ∈ s

full_name: Finset.mem_sym2_iff
code: @[simp]
theorem mem_sym2_iff {m : Sym2 α} : m ∈ s.sym2 ↔ ∀ a ∈ m, a ∈ s 
goal: m ∈ s.sym2 ↔ ∀ a ∈ m, a ∈ s

full_name: Finset.sym2_cons
code: theorem sym2_cons (a : α) (s : Finset α) (ha : a ∉ s) :
    (s.cons a ha).sym2 = ((s.cons a ha).map <| Sym2.mkEmbedding a).disjUnion s.sym2 (by
      simp [Finset.disjoint_left, ha]) 
goal: (Finset.cons a s ha).sym2 = (Finset.map (Sym2.mkEmbedding a) (Finset.cons a s ha)).disjUnion s.sym2 ⋯

full_name: Finset.sym2_insert
code: theorem sym2_insert [DecidableEq α] (a : α) (s : Finset α) :
    (insert a s).sym2 = ((insert a s).image fun b => s(a, b)) ∪ s.sym2 
goal: (insert a s).sym2 = Finset.image (fun b => s(a, b)) (insert a s) ∪ s.sym2

full_name: Finset.sym2_map
code: theorem sym2_map (f : α ↪ β) (s : Finset α) : (s.map f).sym2 = s.sym2.map (.sym2Map f) 
goal: (Finset.map f s).sym2 = Finset.map f.sym2Map s.sym2

full_name: Finset.sym2_image
code: theorem sym2_image [DecidableEq β] (f : α → β) (s : Finset α) :
    (s.image f).sym2 = s.sym2.image (Sym2.map f) 
goal: (Finset.image f s).sym2 = Finset.image (Sym2.map f) s.sym2

full_name: Sym2.instFintype
code: instance _root_.Sym2.instFintype [Fintype α] : Fintype (Sym2 α) 
goal: Fintype (Sym2 α)

full_name: Finset.sym2_univ
code: @[simp]
theorem sym2_univ [Fintype α] (inst : Fintype (Sym2 α) := Sym2.instFintype) :
    (univ : Finset α).sym2 = univ 
goal: Finset.univ.sym2 = Finset.univ

full_name: Finset.sym2_mono
code: @[simp, mono]
theorem sym2_mono (h : s ⊆ t) : s.sym2 ⊆ t.sym2 
goal: s.sym2 ⊆ t.sym2

full_name: Finset.monotone_sym2
code: theorem monotone_sym2 : Monotone (Finset.sym2 : Finset α → _) 
goal: Monotone Finset.sym2

full_name: Finset.injective_sym2
code: theorem injective_sym2 : Function.Injective (Finset.sym2 : Finset α → _) 
goal: Function.Injective Finset.sym2

full_name: Finset.strictMono_sym2
code: theorem strictMono_sym2 : StrictMono (Finset.sym2 : Finset α → _) 
goal: StrictMono Finset.sym2

full_name: Finset.sym2_toFinset
code: theorem sym2_toFinset [DecidableEq α] (m : Multiset α) :
    m.toFinset.sym2 = m.sym2.toFinset 
goal: m.toFinset.sym2 = m.sym2.toFinset

full_name: Finset.sym2_empty
code: @[simp]
theorem sym2_empty : (∅ : Finset α).sym2 = ∅ 
goal: ∅.sym2 = ∅

full_name: Finset.sym2_eq_empty
code: @[simp]
theorem sym2_eq_empty : s.sym2 = ∅ ↔ s = ∅ 
goal: s.sym2 = ∅ ↔ s = ∅

full_name: Finset.sym2_nonempty
code: @[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem sym2_nonempty : s.sym2.Nonempty ↔ s.Nonempty 
goal: s.sym2.Nonempty ↔ s.Nonempty

full_name: Finset.sym2_singleton
code: @[simp]
theorem sym2_singleton (a : α) : ({a} : Finset α).sym2 = {Sym2.diag a} 
goal: {a}.sym2 = {Sym2.diag a}

full_name: Finset.card_sym2
code: /-- Finset **stars and bars** for the case `n = 2`. -/
theorem card_sym2 (s : Finset α) : s.sym2.card = Nat.choose (s.card + 1) 2 
goal: s.sym2.card = (s.card + 1).choose 2

full_name: Finset.sym2_eq_image
code: theorem sym2_eq_image : s.sym2 = (s ×ˢ s).image Sym2.mk 
goal: s.sym2 = Finset.image Sym2.mk (s ×ˢ s)

full_name: Finset.isDiag_mk_of_mem_diag
code: theorem isDiag_mk_of_mem_diag {a : α × α} (h : a ∈ s.diag) : (Sym2.mk a).IsDiag 
goal: (Sym2.mk a).IsDiag

full_name: Finset.not_isDiag_mk_of_mem_offDiag
code: theorem not_isDiag_mk_of_mem_offDiag {a : α × α} (h : a ∈ s.offDiag) :
    ¬ (Sym2.mk a).IsDiag 
goal: ¬(Sym2.mk a).IsDiag

full_name: Finset.diag_mem_sym2_mem_iff
code: @[simp]
theorem diag_mem_sym2_mem_iff : (∀ b, b ∈ Sym2.diag a → b ∈ s) ↔ a ∈ s 
goal: (∀ b ∈ Sym2.diag a, b ∈ s) ↔ a ∈ s

full_name: Finset.diag_mem_sym2_iff
code: theorem diag_mem_sym2_iff : Sym2.diag a ∈ s.sym2 ↔ a ∈ s 
goal: Sym2.diag a ∈ s.sym2 ↔ a ∈ s

full_name: Finset.image_diag_union_image_offDiag
code: theorem image_diag_union_image_offDiag :
    s.diag.image Sym2.mk ∪ s.offDiag.image Sym2.mk = s.sym2 
goal: Finset.image Sym2.mk s.diag ∪ Finset.image Sym2.mk s.offDiag = s.sym2

full_name: Finset.instDecidableEqSym
code: instance : DecidableEq (Sym α n) 
goal: DecidableEq (Sym α n)

full_name: Finset.sym
code: /-- 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)
  
goal: Finset (Sym α n)

full_name: Finset.sym_zero
code: @[simp]
theorem sym_zero : s.sym 0 = {∅} 
goal: s.sym 0 = {∅}

full_name: Finset.sym_succ
code: @[simp]
theorem sym_succ : s.sym (n + 1) = s.sup fun a ↦ (s.sym n).image <| Sym.cons a 
goal: s.sym (n + 1) = s.sup fun a => Finset.image (Sym.cons a) (s.sym n)

full_name: Finset.mem_sym_iff
code: @[simp]
theorem mem_sym_iff {m : Sym α n} : m ∈ s.sym n ↔ ∀ a ∈ m, a ∈ s 
goal: m ∈ s.sym n ↔ ∀ a ∈ m, a ∈ s

full_name: Finset.sym_empty
code: @[simp]
theorem sym_empty (n : ℕ) : (∅ : Finset α).sym (n + 1) = ∅ 
goal: ∅.sym (n + 1) = ∅

full_name: Finset.replicate_mem_sym
code: theorem replicate_mem_sym (ha : a ∈ s) (n : ℕ) : Sym.replicate n a ∈ s.sym n 
goal: Sym.replicate n a ∈ s.sym n

full_name: Finset.Nonempty.sym
code: protected theorem Nonempty.sym (h : s.Nonempty) (n : ℕ) : (s.sym n).Nonempty 
goal: (s.sym n).Nonempty

full_name: Finset.sym_singleton
code: @[simp]
theorem sym_singleton (a : α) (n : ℕ) : ({a} : Finset α).sym n = {Sym.replicate n a} 
goal: {a}.sym n = {Sym.replicate n a}

full_name: Finset.eq_empty_of_sym_eq_empty
code: theorem eq_empty_of_sym_eq_empty (h : s.sym n = ∅) : s = ∅ 
goal: s = ∅

full_name: Finset.sym_eq_empty
code: @[simp]
theorem sym_eq_empty : s.sym n = ∅ ↔ n ≠ 0 ∧ s = ∅ 
goal: s.sym n = ∅ ↔ n ≠ 0 ∧ s = ∅

full_name: Finset.sym_nonempty
code: @[simp]
theorem sym_nonempty : (s.sym n).Nonempty ↔ n = 0 ∨ s.Nonempty 
goal: (s.sym n).Nonempty ↔ n = 0 ∨ s.Nonempty

full_name: Finset.sym_univ
code: @[simp]
theorem sym_univ [Fintype α] (n : ℕ) : (univ : Finset α).sym n = univ 
goal: Finset.univ.sym n = Finset.univ

full_name: Finset.sym_mono
code: @[simp]
theorem sym_mono (h : s ⊆ t) (n : ℕ) : s.sym n ⊆ t.sym n 
goal: s.sym n ⊆ t.sym n

full_name: Finset.sym_inter
code: @[simp]
theorem sym_inter (s t : Finset α) (n : ℕ) : (s ∩ t).sym n = s.sym n ∩ t.sym n 
goal: (s ∩ t).sym n = s.sym n ∩ t.sym n

full_name: Finset.sym_union
code: @[simp]
theorem sym_union (s t : Finset α) (n : ℕ) : s.sym n ∪ t.sym n ⊆ (s ∪ t).sym n 
goal: s.sym n ∪ t.sym n ⊆ (s ∪ t).sym n

full_name: Finset.sym_fill_mem
code: 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 
goal: Sym.fill a i m ∈ (insert a s).sym n

full_name: Finset.sym_filterNe_mem
code: 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) 
goal: (Sym.filterNe a m).snd ∈ (s.erase a).sym (n - ↑(Sym.filterNe a m).fst)

full_name: Finset.symInsertEquiv
code: /-- 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`. -/
@[simps]
def symInsertEquiv (h : a ∉ s) : (insert a s).sym n ≃ Σi : Fin (n + 1), s.sym (n - i) 
goal: { x // x ∈ (insert a s).sym n } ≃ (i : Fin (n + 1)) × { x // x ∈ s.sym (n - ↑i) }

full_name: Finset.symInsertEquiv_symm_apply_coe
code: /-- 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`. -/
@[simps]
def symInsertEquiv (h : a ∉ s) : (insert a s).sym n ≃ Σi : Fin (n + 1), s.sym (n - i) 
goal: ↑((Finset.symInsertEquiv h).symm m) = Sym.fill a m.fst ↑m.snd

full_name: Finset.symInsertEquiv_apply_fst
code: /-- 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`. -/
@[simps]
def symInsertEquiv (h : a ∉ s) : (insert a s).sym n ≃ Σi : Fin (n + 1), s.sym (n - i) 
goal: ((Finset.symInsertEquiv h) m).fst = (Sym.filterNe a ↑m).fst

full_name: Finset.symInsertEquiv_apply_snd_coe
code: /-- 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`. -/
@[simps]
def symInsertEquiv (h : a ∉ s) : (insert a s).sym n ≃ Σi : Fin (n + 1), s.sym (n - i) 
goal: ↑((Finset.symInsertEquiv h) m).snd = (Sym.filterNe a ↑m).snd