File: Mathlib/Data/Sym/Basic.lean

full_name: Sym
code: /-- The nth symmetric power is n-tuples up to permutation.  We define it
as a subtype of `Multiset` since these are well developed in the
library.  We also give a definition `Sym.sym'` in terms of vectors, and we
show these are equivalent in `Sym.symEquivSym'`.
-/
def Sym (α : Type*) (n : ℕ) 
goal: Type u_1

full_name: Sym.toMultiset
code: /-- The canonical map to `Multiset α` that forgets that `s` has length `n` -/
@[coe] def Sym.toMultiset {α : Type*} {n : ℕ} (s : Sym α n) : Multiset α 
goal: Multiset α

full_name: Sym.hasCoe
code: instance Sym.hasCoe (α : Type*) (n : ℕ) : CoeOut (Sym α n) (Multiset α) 
goal: CoeOut (Sym α n) (Multiset α)

full_name: instDecidableEqSym
code: instance {α : Type*} {n : ℕ} [DecidableEq α] : DecidableEq (Sym α n) 
goal: DecidableEq (Sym α n)

full_name: Vector.Perm.isSetoid
code: /-- This is the `List.Perm` setoid lifted to `Vector`.

See note [reducible non-instances].
-/
abbrev Vector.Perm.isSetoid (α : Type*) (n : ℕ) : Setoid (Vector α n) 
goal: Setoid (Mathlib.Vector α n)

full_name: Sym.coe_injective
code: theorem coe_injective : Injective ((↑) : Sym α n → Multiset α) 
goal: Function.Injective Sym.toMultiset

full_name: Sym.coe_inj
code: @[simp, norm_cast]
theorem coe_inj {s₁ s₂ : Sym α n} : (s₁ : Multiset α) = s₂ ↔ s₁ = s₂ 
goal: ↑s₁ = ↑s₂ ↔ s₁ = s₂

full_name: Sym.ext
code: @[ext] theorem ext {s₁ s₂ : Sym α n} (h : (s₁ : Multiset α) = ↑s₂) : s₁ = s₂ 
goal: s₁ = s₂

full_name: Sym.val_eq_coe
code: @[simp]
theorem val_eq_coe (s : Sym α n) : s.1 = ↑s 
goal: ↑s = ↑s

full_name: Sym.mk
code: /-- Construct an element of the `n`th symmetric power from a multiset of cardinality `n`.
-/
@[match_pattern] -- Porting note: removed `@[simps]`, generated bad lemma
abbrev mk (m : Multiset α) (h : Multiset.card m = n) : Sym α n 
goal: Sym α n

full_name: Sym.nil
code: /-- The unique element in `Sym α 0`. -/
@[match_pattern]
def nil : Sym α 0 
goal: Sym α 0

full_name: Sym.coe_nil
code: @[simp]
theorem coe_nil : ↑(@Sym.nil α) = (0 : Multiset α) 
goal: ↑Sym.nil = 0

full_name: Sym.cons
code: /-- Inserts an element into the term of `Sym α n`, increasing the length by one.
-/
@[match_pattern]
def cons (a : α) (s : Sym α n) : Sym α n.succ 
goal: Sym α n.succ

full_name: Sym.«_aux_Mathlib_Data_Sym_Basic___macroRules_Sym_term_::ₛ__1»
code: @[inherit_doc]
infixr:67 " ::ₛ " => cons
goal: Lean.Macro

full_name: Sym._aux_Mathlib_Data_Sym_Basic___unexpand_Sym_cons_1
code: @[inherit_doc]
infixr:67 " ::ₛ " => cons
goal: Lean.PrettyPrinter.Unexpander

full_name: Sym.cons_inj_right
code: @[simp]
theorem cons_inj_right (a : α) (s s' : Sym α n) : a ::ₛ s = a ::ₛ s' ↔ s = s' 
goal: a ::ₛ s = a ::ₛ s' ↔ s = s'

full_name: Sym.cons_inj_left
code: @[simp]
theorem cons_inj_left (a a' : α) (s : Sym α n) : a ::ₛ s = a' ::ₛ s ↔ a = a' 
goal: a ::ₛ s = a' ::ₛ s ↔ a = a'

full_name: Sym.cons_swap
code: theorem cons_swap (a b : α) (s : Sym α n) : a ::ₛ b ::ₛ s = b ::ₛ a ::ₛ s 
goal: a ::ₛ b ::ₛ s = b ::ₛ a ::ₛ s

full_name: Sym.coe_cons
code: theorem coe_cons (s : Sym α n) (a : α) : (a ::ₛ s : Multiset α) = a ::ₘ s 
goal: ↑(a ::ₛ s) = a ::ₘ ↑s

full_name: Sym.ofVector
code: /-- This is the quotient map that takes a list of n elements as an n-tuple and produces an nth
symmetric power.
-/
def ofVector : Vector α n → Sym α n 
goal: Mathlib.Vector α n → Sym α n

full_name: Sym.instCoeVector
code: /-- This is the quotient map that takes a list of n elements as an n-tuple and produces an nth
symmetric power.
-/
instance : Coe (Vector α n) (Sym α n) 
goal: Coe (Mathlib.Vector α n) (Sym α n)

full_name: Sym.ofVector_nil
code: @[simp]
theorem ofVector_nil : ↑(Vector.nil : Vector α 0) = (Sym.nil : Sym α 0) 
goal: Sym.ofVector Mathlib.Vector.nil = Sym.nil

full_name: Sym.ofVector_cons
code: @[simp]
theorem ofVector_cons (a : α) (v : Vector α n) : ↑(Vector.cons a v) = a ::ₛ (↑v : Sym α n) 
goal: Sym.ofVector (a ::ᵥ v) = a ::ₛ Sym.ofVector v

full_name: Sym.card_coe
code: @[simp]
theorem card_coe : Multiset.card (s : Multiset α) = n 
goal: Multiset.card ↑s = n

full_name: Sym.instMembership
code: /-- `α ∈ s` means that `a` appears as one of the factors in `s`.
-/
instance : Membership α (Sym α n) 
goal: Membership α (Sym α n)

full_name: Sym.decidableMem
code: instance decidableMem [DecidableEq α] (a : α) (s : Sym α n) : Decidable (a ∈ s) 
goal: Decidable (a ∈ s)

full_name: Sym.coe_mk
code: @[simp, norm_cast] lemma coe_mk (s : Multiset α) (h : Multiset.card s = n) : mk s h = s 
goal: ↑(Sym.mk s h) = s

full_name: Sym.mem_mk
code: @[simp]
theorem mem_mk (a : α) (s : Multiset α) (h : Multiset.card s = n) : a ∈ mk s h ↔ a ∈ s 
goal: a ∈ Sym.mk s h ↔ a ∈ s

full_name: Sym.forall
code: lemma «forall» {p : Sym α n → Prop} :
    (∀ s : Sym α n, p s) ↔ ∀ (s : Multiset α) (hs : Multiset.card s = n), p (Sym.mk s hs) 
goal: (∀ (s : Sym α n), p s) ↔ ∀ (s : Multiset α) (hs : Multiset.card s = n), p (Sym.mk s hs)

full_name: Sym.exists
code: lemma «exists» {p : Sym α n → Prop} :
    (∃ s : Sym α n, p s) ↔ ∃ (s : Multiset α) (hs : Multiset.card s = n), p (Sym.mk s hs) 
goal: (∃ s, p s) ↔ ∃ s, ∃ (hs : Multiset.card s = n), p (Sym.mk s hs)

full_name: Sym.not_mem_nil
code: @[simp]
theorem not_mem_nil (a : α) : ¬ a ∈ (nil : Sym α 0) 
goal: a ∉ Sym.nil

full_name: Sym.mem_cons
code: @[simp]
theorem mem_cons : a ∈ b ::ₛ s ↔ a = b ∨ a ∈ s 
goal: a ∈ b ::ₛ s ↔ a = b ∨ a ∈ s

full_name: Sym.mem_coe
code: @[simp]
theorem mem_coe : a ∈ (s : Multiset α) ↔ a ∈ s 
goal: a ∈ ↑s ↔ a ∈ s

full_name: Sym.mem_cons_of_mem
code: theorem mem_cons_of_mem (h : a ∈ s) : a ∈ b ::ₛ s 
goal: a ∈ b ::ₛ s

full_name: Sym.mem_cons_self
code: theorem mem_cons_self (a : α) (s : Sym α n) : a ∈ a ::ₛ s 
goal: a ∈ a ::ₛ s

full_name: Sym.cons_of_coe_eq
code: theorem cons_of_coe_eq (a : α) (v : Vector α n) : a ::ₛ (↑v : Sym α n) = ↑(a ::ᵥ v) 
goal: a ::ₛ Sym.ofVector v = Sym.ofVector (a ::ᵥ v)

full_name: Sym.sound
code: theorem sound {a b : Vector α n} (h : a.val ~ b.val) : (↑a : Sym α n) = ↑b 
goal: Sym.ofVector a = Sym.ofVector b

full_name: Sym.erase
code: /-- `erase s a h` is the sym that subtracts 1 from the
  multiplicity of `a` if a is present in the sym. -/
def erase [DecidableEq α] (s : Sym α (n + 1)) (a : α) (h : a ∈ s) : Sym α n 
goal: Sym α n

full_name: Sym.erase_mk
code: @[simp]
theorem erase_mk [DecidableEq α] (m : Multiset α)
    (hc : Multiset.card m = n + 1) (a : α) (h : a ∈ m) :
    (mk m hc).erase a h =mk (m.erase a)
        (by rw [Multiset.card_erase_of_mem h, hc, Nat.add_one, Nat.pred_succ]) 
goal: (Sym.mk m hc).erase a h = Sym.mk (m.erase a) ⋯

full_name: Sym.coe_erase
code: @[simp]
theorem coe_erase [DecidableEq α] {s : Sym α n.succ} {a : α} (h : a ∈ s) :
    (s.erase a h : Multiset α) = Multiset.erase s a 
goal: ↑(s.erase a h) = (↑s).erase a

full_name: Sym.cons_erase
code: @[simp]
theorem cons_erase [DecidableEq α] {s : Sym α n.succ} {a : α} (h : a ∈ s) : a ::ₛ s.erase a h = s 
goal: a ::ₛ s.erase a h = s

full_name: Sym.erase_cons_head
code: @[simp]
theorem erase_cons_head [DecidableEq α] (s : Sym α n) (a : α)
    (h : a ∈ a ::ₛ s := mem_cons_self a s) : (a ::ₛ s).erase a h = s 
goal: (a ::ₛ s).erase a h = s

full_name: Sym.Sym'
code: /-- Another definition of the nth symmetric power, using vectors modulo permutations. (See `Sym`.)
-/
def Sym' (α : Type*) (n : ℕ) 
goal: Type u_3

full_name: Sym.cons'
code: /-- This is `cons` but for the alternative `Sym'` definition.
-/
def cons' {α : Type*} {n : ℕ} : α → Sym' α n → Sym' α (Nat.succ n) 
goal: α → Sym.Sym' α n → Sym.Sym' α n.succ

full_name: Sym.«_aux_Mathlib_Data_Sym_Basic___macroRules_Sym_term_::__1»
code: @[inherit_doc]
scoped notation a " :: " b => cons' a b
goal: Lean.Macro

full_name: Sym._aux_Mathlib_Data_Sym_Basic___unexpand_Sym_cons'_1
code: @[inherit_doc]
scoped notation a " :: " b => cons' a b
goal: Lean.PrettyPrinter.Unexpander

full_name: Sym.symEquivSym'
code: /-- Multisets of cardinality n are equivalent to length-n vectors up to permutations.
-/
def symEquivSym' {α : Type*} {n : ℕ} : Sym α n ≃ Sym' α n 
goal: Sym α n ≃ Sym.Sym' α n

full_name: Sym.cons_equiv_eq_equiv_cons
code: theorem cons_equiv_eq_equiv_cons (α : Type*) (n : ℕ) (a : α) (s : Sym α n) :
    (a::symEquivSym' s) = symEquivSym' (a ::ₛ s) 
goal: Sym.cons' a (Sym.symEquivSym' s) = Sym.symEquivSym' (a ::ₛ s)

full_name: Sym.instZeroSym
code: instance instZeroSym : Zero (Sym α 0) 
goal: Zero (Sym α 0)

full_name: Sym.toMultiset_zero
code: @[simp] theorem toMultiset_zero : toMultiset (0 : Sym α 0) = 0 
goal: ↑0 = 0

full_name: Sym.instEmptyCollectionOfNatNat
code: instance : EmptyCollection (Sym α 0) 
goal: EmptyCollection (Sym α 0)

full_name: Sym.eq_nil_of_card_zero
code: theorem eq_nil_of_card_zero (s : Sym α 0) : s = nil 
goal: s = Sym.nil

full_name: Sym.uniqueZero
code: instance uniqueZero : Unique (Sym α 0) 
goal: Unique (Sym α 0)

full_name: Sym.replicate
code: /-- `replicate n a` is the sym containing only `a` with multiplicity `n`. -/
def replicate (n : ℕ) (a : α) : Sym α n 
goal: Sym α n

full_name: Sym.replicate_succ
code: theorem replicate_succ {a : α} {n : ℕ} : replicate n.succ a = a ::ₛ replicate n a 
goal: Sym.replicate n.succ a = a ::ₛ Sym.replicate n a

full_name: Sym.coe_replicate
code: theorem coe_replicate : (replicate n a : Multiset α) = Multiset.replicate n a 
goal: ↑(Sym.replicate n a) = Multiset.replicate n a

full_name: Sym.mem_replicate
code: @[simp]
theorem mem_replicate : b ∈ replicate n a ↔ n ≠ 0 ∧ b = a 
goal: b ∈ Sym.replicate n a ↔ n ≠ 0 ∧ b = a

full_name: Sym.eq_replicate_iff
code: theorem eq_replicate_iff : s = replicate n a ↔ ∀ b ∈ s, b = a 
goal: s = Sym.replicate n a ↔ ∀ b ∈ s, b = a

full_name: Sym.exists_mem
code: theorem exists_mem (s : Sym α n.succ) : ∃ a, a ∈ s 
goal: ∃ a, a ∈ s

full_name: Sym.exists_cons_of_mem
code: theorem exists_cons_of_mem {s : Sym α (n + 1)} {a : α} (h : a ∈ s) : ∃ t, s = a ::ₛ t 
goal: ∃ t, s = a ::ₛ t

full_name: Sym.exists_eq_cons_of_succ
code: theorem exists_eq_cons_of_succ (s : Sym α n.succ) : ∃ (a : α) (s' : Sym α n), s = a ::ₛ s' 
goal: ∃ a s', s = a ::ₛ s'

full_name: Sym.eq_replicate
code: theorem eq_replicate {a : α} {n : ℕ} {s : Sym α n} : s = replicate n a ↔ ∀ b ∈ s, b = a 
goal: s = Sym.replicate n a ↔ ∀ b ∈ s, b = a

full_name: Sym.eq_replicate_of_subsingleton
code: theorem eq_replicate_of_subsingleton [Subsingleton α] (a : α) {n : ℕ} (s : Sym α n) :
    s = replicate n a 
goal: s = Sym.replicate n a

full_name: Sym.instSubsingleton
code: instance [Subsingleton α] (n : ℕ) : Subsingleton (Sym α n) 
goal: Subsingleton (Sym α n)

full_name: Sym.inhabitedSym
code: instance inhabitedSym [Inhabited α] (n : ℕ) : Inhabited (Sym α n) 
goal: Inhabited (Sym α n)

full_name: Sym.inhabitedSym'
code: instance inhabitedSym' [Inhabited α] (n : ℕ) : Inhabited (Sym' α n) 
goal: Inhabited (Sym.Sym' α n)

full_name: Sym.instIsEmptySucc
code: instance (n : ℕ) [IsEmpty α] : IsEmpty (Sym α n.succ) 
goal: IsEmpty (Sym α n.succ)

full_name: Sym.instUnique
code: instance (n : ℕ) [Unique α] : Unique (Sym α n) 
goal: Unique (Sym α n)

full_name: Sym.replicate_right_inj
code: theorem replicate_right_inj {a b : α} {n : ℕ} (h : n ≠ 0) : replicate n a = replicate n b ↔ a = b 
goal: Sym.replicate n a = Sym.replicate n b ↔ a = b

full_name: Sym.replicate_right_injective
code: theorem replicate_right_injective {n : ℕ} (h : n ≠ 0) :
    Function.Injective (replicate n : α → Sym α n) 
goal: Function.Injective (Sym.replicate n)

full_name: Sym.instNontrivialHAddNatOfNat
code: instance (n : ℕ) [Nontrivial α] : Nontrivial (Sym α (n + 1)) 
goal: Nontrivial (Sym α (n + 1))

full_name: Sym.map
code: /-- A function `α → β` induces a function `Sym α n → Sym β n` by applying it to every element of
the underlying `n`-tuple. -/
def map {n : ℕ} (f : α → β) (x : Sym α n) : Sym β n 
goal: Sym β n

full_name: Sym.mem_map
code: @[simp]
theorem mem_map {n : ℕ} {f : α → β} {b : β} {l : Sym α n} :
    b ∈ Sym.map f l ↔ ∃ a, a ∈ l ∧ f a = b 
goal: b ∈ Sym.map f l ↔ ∃ a ∈ l, f a = b

full_name: Sym.map_id'
code: /-- Note: `Sym.map_id` is not simp-normal, as simp ends up unfolding `id` with `Sym.map_congr` -/
@[simp]
theorem map_id' {α : Type*} {n : ℕ} (s : Sym α n) : Sym.map (fun x : α => x) s = s 
goal: Sym.map (fun x => x) s = s

full_name: Sym.map_id
code: theorem map_id {α : Type*} {n : ℕ} (s : Sym α n) : Sym.map id s = s 
goal: Sym.map id s = s

full_name: Sym.map_map
code: @[simp]
theorem map_map {α β γ : Type*} {n : ℕ} (g : β → γ) (f : α → β) (s : Sym α n) :
    Sym.map g (Sym.map f s) = Sym.map (g ∘ f) s 
goal: Sym.map g (Sym.map f s) = Sym.map (g ∘ f) s

full_name: Sym.map_zero
code: @[simp]
theorem map_zero (f : α → β) : Sym.map f (0 : Sym α 0) = (0 : Sym β 0) 
goal: Sym.map f 0 = 0

full_name: Sym.map_cons
code: @[simp]
theorem map_cons {n : ℕ} (f : α → β) (a : α) (s : Sym α n) : (a ::ₛ s).map f = f a ::ₛ s.map f 
goal: Sym.map f (a ::ₛ s) = f a ::ₛ Sym.map f s

full_name: Sym.map_congr
code: @[congr]
theorem map_congr {f g : α → β} {s : Sym α n} (h : ∀ x ∈ s, f x = g x) : map f s = map g s 
goal: Sym.map f s = Sym.map g s

full_name: Sym.map_mk
code: @[simp]
theorem map_mk {f : α → β} {m : Multiset α} {hc : Multiset.card m = n} :
    map f (mk m hc) = mk (m.map f) (by simp [hc]) 
goal: Sym.map f (Sym.mk m hc) = Sym.mk (Multiset.map f m) ⋯

full_name: Sym.coe_map
code: @[simp]
theorem coe_map (s : Sym α n) (f : α → β) : ↑(s.map f) = Multiset.map f s 
goal: ↑(Sym.map f s) = Multiset.map f ↑s

full_name: Sym.map_injective
code: theorem map_injective {f : α → β} (hf : Injective f) (n : ℕ) :
    Injective (map f : Sym α n → Sym β n) 
goal: Function.Injective (Sym.map f)

full_name: Sym.equivCongr_symm_apply
code: /-- Mapping an equivalence `α ≃ β` using `Sym.map` gives an equivalence between `Sym α n` and
`Sym β n`. -/
@[simps]
def equivCongr (e : α ≃ β) : Sym α n ≃ Sym β n 
goal: (Sym.equivCongr e).symm x = Sym.map (⇑e.symm) x

full_name: Sym.equivCongr_apply
code: /-- Mapping an equivalence `α ≃ β` using `Sym.map` gives an equivalence between `Sym α n` and
`Sym β n`. -/
@[simps]
def equivCongr (e : α ≃ β) : Sym α n ≃ Sym β n 
goal: (Sym.equivCongr e) x = Sym.map (⇑e) x

full_name: Sym.equivCongr
code: /-- Mapping an equivalence `α ≃ β` using `Sym.map` gives an equivalence between `Sym α n` and
`Sym β n`. -/
@[simps]
def equivCongr (e : α ≃ β) : Sym α n ≃ Sym β n 
goal: Sym α n ≃ Sym β n

full_name: Sym.attach
code: /-- "Attach" a proof that `a ∈ s` to each element `a` in `s` to produce
an element of the symmetric power on `{x // x ∈ s}`. -/
def attach (s : Sym α n) : Sym { x // x ∈ s } n 
goal: Sym { x // x ∈ s } n

full_name: Sym.attach_mk
code: @[simp]
theorem attach_mk {m : Multiset α} {hc : Multiset.card m = n} :
    attach (mk m hc) = mk m.attach (Multiset.card_attach.trans hc) 
goal: (Sym.mk m hc).attach = Sym.mk m.attach ⋯

full_name: Sym.coe_attach
code: @[simp]
theorem coe_attach (s : Sym α n) : (s.attach : Multiset { a // a ∈ s }) =
    Multiset.attach (s : Multiset α) 
goal: ↑s.attach = (↑s).attach

full_name: Sym.attach_map_coe
code: theorem attach_map_coe (s : Sym α n) : s.attach.map (↑) = s 
goal: Sym.map Subtype.val s.attach = s

full_name: Sym.mem_attach
code: @[simp]
theorem mem_attach (s : Sym α n) (x : { x // x ∈ s }) : x ∈ s.attach 
goal: x ∈ s.attach

full_name: Sym.attach_nil
code: @[simp]
theorem attach_nil : (nil : Sym α 0).attach = nil 
goal: Sym.nil.attach = Sym.nil

full_name: Sym.attach_cons
code: @[simp]
theorem attach_cons (x : α) (s : Sym α n) :
    (cons x s).attach =
      cons ⟨x, mem_cons_self _ _⟩ (s.attach.map fun x => ⟨x, mem_cons_of_mem x.prop⟩) 
goal: (x ::ₛ s).attach = ⟨x, ⋯⟩ ::ₛ Sym.map (fun x_1 => ⟨↑x_1, ⋯⟩) s.attach

full_name: Sym.cast
code: /-- Change the length of a `Sym` using an equality.
The simp-normal form is for the `cast` to be pushed outward. -/
protected def cast {n m : ℕ} (h : n = m) : Sym α n ≃ Sym α m 
goal: Sym α n ≃ Sym α m

full_name: Sym.cast_rfl
code: @[simp]
theorem cast_rfl : Sym.cast rfl s = s 
goal: (Sym.cast ⋯) s = s

full_name: Sym.cast_cast
code: @[simp]
theorem cast_cast {n'' : ℕ} (h : n = n') (h' : n' = n'') :
    Sym.cast h' (Sym.cast h s) = Sym.cast (h.trans h') s 
goal: (Sym.cast h') ((Sym.cast h) s) = (Sym.cast ⋯) s

full_name: Sym.coe_cast
code: @[simp]
theorem coe_cast (h : n = m) : (Sym.cast h s : Multiset α) = s 
goal: ↑((Sym.cast h) s) = ↑s

full_name: Sym.mem_cast
code: @[simp]
theorem mem_cast (h : n = m) : a ∈ Sym.cast h s ↔ a ∈ s 
goal: a ∈ (Sym.cast h) s ↔ a ∈ s

full_name: Sym.append
code: /-- Append a pair of `Sym` terms. -/
def append (s : Sym α n) (s' : Sym α n') : Sym α (n + n') 
goal: Sym α (n + n')

full_name: Sym.append_inj_right
code: @[simp]
theorem append_inj_right (s : Sym α n) {t t' : Sym α n'} : s.append t = s.append t' ↔ t = t' 
goal: s.append t = s.append t' ↔ t = t'

full_name: Sym.append_inj_left
code: @[simp]
theorem append_inj_left {s s' : Sym α n} (t : Sym α n') : s.append t = s'.append t ↔ s = s' 
goal: s.append t = s'.append t ↔ s = s'

full_name: Sym.append_comm
code: theorem append_comm (s : Sym α n') (s' : Sym α n') :
    s.append s' = Sym.cast (add_comm _ _) (s'.append s) 
goal: s.append s' = (Sym.cast ⋯) (s'.append s)

full_name: Sym.coe_append
code: @[simp, norm_cast]
theorem coe_append (s : Sym α n) (s' : Sym α n') : (s.append s' : Multiset α) = s + s' 
goal: ↑(s.append s') = ↑s + ↑s'

full_name: Sym.mem_append_iff
code: theorem mem_append_iff {s' : Sym α m} : a ∈ s.append s' ↔ a ∈ s ∨ a ∈ s' 
goal: a ∈ s.append s' ↔ a ∈ s ∨ a ∈ s'

full_name: Sym.oneEquiv
code: /-- `a ↦ {a}` as an equivalence between `α` and `Sym α 1`. -/
@[simps apply]
def oneEquiv : α ≃ Sym α 1 
goal: α ≃ Sym α 1

full_name: Sym.oneEquiv_apply
code: /-- `a ↦ {a}` as an equivalence between `α` and `Sym α 1`. -/
@[simps apply]
def oneEquiv : α ≃ Sym α 1 
goal: Sym.oneEquiv a = ⟨{a}, ⋯⟩

full_name: Sym.fill
code: /-- Fill a term `m : Sym α (n - i)` with `i` copies of `a` to obtain a term of `Sym α n`.
This is a convenience wrapper for `m.append (replicate i a)` that adjusts the term using
`Sym.cast`. -/
def fill (a : α) (i : Fin (n + 1)) (m : Sym α (n - i)) : Sym α n 
goal: Sym α n

full_name: Sym.coe_fill
code: theorem coe_fill {a : α} {i : Fin (n + 1)} {m : Sym α (n - i)} :
    (fill a i m : Multiset α) = m + replicate i a 
goal: ↑(Sym.fill a i m) = ↑m + ↑(Sym.replicate (↑i) a)

full_name: Sym.mem_fill_iff
code: theorem mem_fill_iff {a b : α} {i : Fin (n + 1)} {s : Sym α (n - i)} :
    a ∈ Sym.fill b i s ↔ (i : ℕ) ≠ 0 ∧ a = b ∨ a ∈ s 
goal: a ∈ Sym.fill b i s ↔ ↑i ≠ 0 ∧ a = b ∨ a ∈ s

full_name: Sym.filterNe
code: /-- Remove every `a` from a given `Sym α n`.
Yields the number of copies `i` and a term of `Sym α (n - i)`. -/
def filterNe [DecidableEq α] (a : α) (m : Sym α n) : Σi : Fin (n + 1), Sym α (n - i) 
goal: (i : Fin (n + 1)) × Sym α (n - ↑i)

full_name: Sym.sigma_sub_ext
code: theorem sigma_sub_ext {m₁ m₂ : Σi : Fin (n + 1), Sym α (n - i)} (h : (m₁.2 : Multiset α) = m₂.2) :
    m₁ = m₂ 
goal: m₁ = m₂

full_name: Sym.fill_filterNe
code: theorem fill_filterNe [DecidableEq α] (a : α) (m : Sym α n) :
    (m.filterNe a).2.fill a (m.filterNe a).1 = m 
goal: Sym.fill a (Sym.filterNe a m).fst (Sym.filterNe a m).snd = m

full_name: Sym.filter_ne_fill
code: theorem filter_ne_fill [DecidableEq α] (a : α) (m : Σi : Fin (n + 1), Sym α (n - i)) (h : a ∉ m.2) :
    (m.2.fill a m.1).filterNe a = m 
goal: Sym.filterNe a (Sym.fill a m.fst m.snd) = m

full_name: Sym.count_coe_fill_self_of_not_mem
code: theorem count_coe_fill_self_of_not_mem [DecidableEq α] {a : α} {i : Fin (n + 1)} {s : Sym α (n - i)}
    (hx : a ∉ s) :
    count a (fill a i s : Multiset α) = i 
goal: Multiset.count a ↑(Sym.fill a i s) = ↑i

full_name: Sym.count_coe_fill_of_ne
code: theorem count_coe_fill_of_ne [DecidableEq α] {a x : α} {i : Fin (n + 1)} {s : Sym α (n - i)}
    (hx : x ≠ a) :
    count x (fill a i s : Multiset α) = count x s 
goal: Multiset.count x ↑(Sym.fill a i s) = Multiset.count x ↑s

full_name: SymOptionSuccEquiv.encode
code: /-- Function from the symmetric product over `Option` splitting on whether or not
it contains a `none`. -/
def encode [DecidableEq α] (s : Sym (Option α) n.succ) : Sym (Option α) n ⊕ Sym α n.succ 
goal: Sym (Option α) n ⊕ Sym α n.succ

full_name: SymOptionSuccEquiv.encode_of_none_mem
code: @[simp]
theorem encode_of_none_mem [DecidableEq α] (s : Sym (Option α) n.succ) (h : none ∈ s) :
    encode s = Sum.inl (s.erase none h) 
goal: SymOptionSuccEquiv.encode s = Sum.inl (s.erase none h)

full_name: SymOptionSuccEquiv.encode_of_not_none_mem
code: @[simp]
theorem encode_of_not_none_mem [DecidableEq α] (s : Sym (Option α) n.succ) (h : ¬none ∈ s) :
    encode s =
      Sum.inr
        (s.attach.map fun o =>
          o.1.get <| Option.ne_none_iff_isSome.1 <| ne_of_mem_of_not_mem o.2 h) 
goal: SymOptionSuccEquiv.encode s = Sum.inr (Sym.map (fun o => (↑o).get ⋯) s.attach)

full_name: SymOptionSuccEquiv.decode
code: /-- Inverse of `Sym_option_succ_equiv.decode`. -/
-- @[simp] Porting note: not a nice simp lemma, applies too often in Lean4
def decode : Sym (Option α) n ⊕ Sym α n.succ → Sym (Option α) n.succ
  
goal: Sym (Option α) n ⊕ Sym α n.succ → Sym (Option α) n.succ

full_name: SymOptionSuccEquiv.decode_inl
code: @[simp]
theorem decode_inl (s : Sym (Option α) n) : decode (Sum.inl s) = none ::ₛ s 
goal: SymOptionSuccEquiv.decode (Sum.inl s) = none ::ₛ s

full_name: SymOptionSuccEquiv.decode_inr
code: @[simp]
theorem decode_inr (s : Sym α n.succ) : decode (Sum.inr s) = s.map Embedding.some 
goal: SymOptionSuccEquiv.decode (Sum.inr s) = Sym.map (⇑Function.Embedding.some) s

full_name: SymOptionSuccEquiv.decode_encode
code: @[simp]
theorem decode_encode [DecidableEq α] (s : Sym (Option α) n.succ) : decode (encode s) = s 
goal: SymOptionSuccEquiv.decode (SymOptionSuccEquiv.encode s) = s

full_name: SymOptionSuccEquiv.encode_decode
code: @[simp]
theorem encode_decode [DecidableEq α] (s : Sym (Option α) n ⊕ Sym α n.succ) :
    encode (decode s) = s 
goal: SymOptionSuccEquiv.encode (SymOptionSuccEquiv.decode s) = s

full_name: symOptionSuccEquiv
code: /-- The symmetric product over `Option` is a disjoint union over simpler symmetric products. -/
--@[simps]
def symOptionSuccEquiv [DecidableEq α] :
    Sym (Option α) n.succ ≃ Sym (Option α) n ⊕ Sym α n.succ 
goal: Sym (Option α) n.succ ≃ Sym (Option α) n ⊕ Sym α n.succ