File: Mathlib/Data/Finset/Basic.lean

full_name: Finset.val
code: /-- `Finset α` is the type of finite sets of elements of `α`. It is implemented
  as a multiset (a list up to permutation) which has no duplicate elements. -/
structure Finset (α : Type*) where
  /-- The underlying multiset -/
  val : Multiset α
  /-- `val` contains no duplicates -/
  nodup : Nodup val
goal: Multiset α

full_name: Finset
code: /-- `Finset α` is the type of finite sets of elements of `α`. It is implemented
  as a multiset (a list up to permutation) which has no duplicate elements. -/
structure Finset (α : Type*) where
  /-- The underlying multiset -/
  val : Multiset α
  /-- `val` contains no duplicates -/
  nodup : Nodup val
goal: Type u_4

full_name: Finset.nodup
code: /-- `Finset α` is the type of finite sets of elements of `α`. It is implemented
  as a multiset (a list up to permutation) which has no duplicate elements. -/
structure Finset (α : Type*) where
  /-- The underlying multiset -/
  val : Multiset α
  /-- `val` contains no duplicates -/
  nodup : Nodup val
goal: self.val.Nodup

full_name: Multiset.canLiftFinset
code: instance Multiset.canLiftFinset {α} : CanLift (Multiset α) (Finset α) Finset.val Multiset.Nodup 
goal: CanLift (Multiset α) (Finset α) Finset.val Multiset.Nodup

full_name: Finset.eq_of_veq
code: theorem eq_of_veq : ∀ {s t : Finset α}, s.1 = t.1 → s = t
  
goal: s.val = t.val → s = t

full_name: Finset.val_injective
code: theorem val_injective : Injective (val : Finset α → Multiset α) 
goal: Function.Injective Finset.val

full_name: Finset.val_inj
code: @[simp]
theorem val_inj {s t : Finset α} : s.1 = t.1 ↔ s = t 
goal: s.val = t.val ↔ s = t

full_name: Finset.dedup_eq_self
code: @[simp]
theorem dedup_eq_self [DecidableEq α] (s : Finset α) : dedup s.1 = s.1 
goal: s.val.dedup = s.val

full_name: Finset.decidableEq
code: instance decidableEq [DecidableEq α] : DecidableEq (Finset α)
  
goal: DecidableEq (Finset α)

full_name: Finset.instMembership
code: instance : Membership α (Finset α) 
goal: Membership α (Finset α)

full_name: Finset.mem_def
code: theorem mem_def {a : α} {s : Finset α} : a ∈ s ↔ a ∈ s.1 
goal: a ∈ s ↔ a ∈ s.val

full_name: Finset.mem_val
code: @[simp]
theorem mem_val {a : α} {s : Finset α} : a ∈ s.1 ↔ a ∈ s 
goal: a ∈ s.val ↔ a ∈ s

full_name: Finset.mem_mk
code: @[simp]
theorem mem_mk {a : α} {s nd} : a ∈ @Finset.mk α s nd ↔ a ∈ s 
goal: a ∈ { val := s, nodup := nd } ↔ a ∈ s

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

full_name: Finset.forall_mem_not_eq
code: @[simp] lemma forall_mem_not_eq {s : Finset α} {a : α} : (∀ b ∈ s, ¬ a = b) ↔ a ∉ s 
goal: (∀ b ∈ s, ¬a = b) ↔ a ∉ s

full_name: Finset.forall_mem_not_eq'
code: @[simp] lemma forall_mem_not_eq' {s : Finset α} {a : α} : (∀ b ∈ s, ¬ b = a) ↔ a ∉ s 
goal: (∀ b ∈ s, ¬b = a) ↔ a ∉ s

full_name: Finset.toSet
code: /-- Convert a finset to a set in the natural way. -/
@[coe] def toSet (s : Finset α) : Set α 
goal: Set α

full_name: Finset.instCoeTCSet
code: /-- Convert a finset to a set in the natural way. -/
instance : CoeTC (Finset α) (Set α) 
goal: CoeTC (Finset α) (Set α)

full_name: Finset.mem_coe
code: @[simp, norm_cast]
theorem mem_coe {a : α} {s : Finset α} : a ∈ (s : Set α) ↔ a ∈ (s : Finset α) 
goal: a ∈ ↑s ↔ a ∈ s

full_name: Finset.setOf_mem
code: @[simp]
theorem setOf_mem {α} {s : Finset α} : { a | a ∈ s } = s 
goal: {a | a ∈ s} = ↑s

full_name: Finset.coe_mem
code: @[simp]
theorem coe_mem {s : Finset α} (x : (s : Set α)) : ↑x ∈ s 
goal: ↑x ∈ s

full_name: Finset.mk_coe
code: theorem mk_coe {s : Finset α} (x : (s : Set α)) {h} : (⟨x, h⟩ : (s : Set α)) = x 
goal: ⟨↑x, h⟩ = x

full_name: Finset.decidableMem'
code: instance decidableMem' [DecidableEq α] (a : α) (s : Finset α) : Decidable (a ∈ (s : Set α)) 
goal: Decidable (a ∈ ↑s)

full_name: Finset.ext_iff
code: theorem ext_iff {s₁ s₂ : Finset α} : s₁ = s₂ ↔ ∀ a, a ∈ s₁ ↔ a ∈ s₂ 
goal: s₁ = s₂ ↔ ∀ (a : α), a ∈ s₁ ↔ a ∈ s₂

full_name: Finset.ext
code: @[ext]
theorem ext {s₁ s₂ : Finset α} : (∀ a, a ∈ s₁ ↔ a ∈ s₂) → s₁ = s₂ 
goal: (∀ (a : α), a ∈ s₁ ↔ a ∈ s₂) → s₁ = s₂

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

full_name: Finset.coe_injective
code: theorem coe_injective {α} : Injective ((↑) : Finset α → Set α) 
goal: Function.Injective Finset.toSet

full_name: Finset.instCoeSortType
code: /-- Coercion from a finset to the corresponding subtype. -/
instance {α : Type u} : CoeSort (Finset α) (Type u) 
goal: CoeSort (Finset α) (Type u)

full_name: Finset.forall_coe
code: protected theorem forall_coe {α : Type*} (s : Finset α) (p : s → Prop) :
    (∀ x : s, p x) ↔ ∀ (x : α) (h : x ∈ s), p ⟨x, h⟩ 
goal: (∀ (x : { x // x ∈ s }), p x) ↔ ∀ (x : α) (h : x ∈ s), p ⟨x, h⟩

full_name: Finset.exists_coe
code: protected theorem exists_coe {α : Type*} (s : Finset α) (p : s → Prop) :
    (∃ x : s, p x) ↔ ∃ (x : α) (h : x ∈ s), p ⟨x, h⟩ 
goal: (∃ x, p x) ↔ ∃ x, ∃ (h : x ∈ s), p ⟨x, h⟩

full_name: Finset.PiFinsetCoe.canLift
code: instance PiFinsetCoe.canLift (ι : Type*) (α : ι → Type*) [_ne : ∀ i, Nonempty (α i)]
    (s : Finset ι) : CanLift (∀ i : s, α i) (∀ i, α i) (fun f i => f i) fun _ => True 
goal: CanLift ((i : { x // x ∈ s }) → α ↑i) ((i : ι) → α i) (fun f i => f ↑i) fun x => True

full_name: Finset.PiFinsetCoe.canLift'
code: instance PiFinsetCoe.canLift' (ι α : Type*) [_ne : Nonempty α] (s : Finset ι) :
    CanLift (s → α) (ι → α) (fun f i => f i) fun _ => True 
goal: CanLift ({ x // x ∈ s } → α) (ι → α) (fun f i => f ↑i) fun x => True

full_name: Finset.FinsetCoe.canLift
code: instance FinsetCoe.canLift (s : Finset α) : CanLift α s (↑) fun a => a ∈ s 
goal: CanLift α { x // x ∈ s } Subtype.val fun a => a ∈ s

full_name: Finset.coe_sort_coe
code: @[simp, norm_cast]
theorem coe_sort_coe (s : Finset α) : ((s : Set α) : Sort _) = s 
goal: ↑↑s = { x // x ∈ s }

full_name: Finset.instHasSubset
code: instance : HasSubset (Finset α) 
goal: HasSubset (Finset α)

full_name: Finset.instHasSSubset
code: instance : HasSSubset (Finset α) 
goal: HasSSubset (Finset α)

full_name: Finset.partialOrder
code: instance partialOrder : PartialOrder (Finset α) 
goal: PartialOrder (Finset α)

full_name: Finset.instIsReflSubset
code: instance : IsRefl (Finset α) (· ⊆ ·) 
goal: IsRefl (Finset α) fun x x_1 => x ⊆ x_1

full_name: Finset.instIsTransSubset
code: instance : IsTrans (Finset α) (· ⊆ ·) 
goal: IsTrans (Finset α) fun x x_1 => x ⊆ x_1

full_name: Finset.instIsAntisymmSubset
code: instance : IsAntisymm (Finset α) (· ⊆ ·) 
goal: IsAntisymm (Finset α) fun x x_1 => x ⊆ x_1

full_name: Finset.instIsIrreflSSubset
code: instance : IsIrrefl (Finset α) (· ⊂ ·) 
goal: IsIrrefl (Finset α) fun x x_1 => x ⊂ x_1

full_name: Finset.instIsTransSSubset
code: instance : IsTrans (Finset α) (· ⊂ ·) 
goal: IsTrans (Finset α) fun x x_1 => x ⊂ x_1

full_name: Finset.instIsAsymmSSubset
code: instance : IsAsymm (Finset α) (· ⊂ ·) 
goal: IsAsymm (Finset α) fun x x_1 => x ⊂ x_1

full_name: Finset.instIsNonstrictStrictOrderSubsetSSubset
code: instance : IsNonstrictStrictOrder (Finset α) (· ⊆ ·) (· ⊂ ·) 
goal: IsNonstrictStrictOrder (Finset α) (fun x x_1 => x ⊆ x_1) fun x x_1 => x ⊂ x_1

full_name: Finset.subset_def
code: theorem subset_def : s ⊆ t ↔ s.1 ⊆ t.1 
goal: s ⊆ t ↔ s.val ⊆ t.val

full_name: Finset.ssubset_def
code: theorem ssubset_def : s ⊂ t ↔ s ⊆ t ∧ ¬t ⊆ s 
goal: s ⊂ t ↔ s ⊆ t ∧ ¬t ⊆ s

full_name: Finset.Subset.refl
code: theorem Subset.refl (s : Finset α) : s ⊆ s 
goal: s ⊆ s

full_name: Finset.Subset.rfl
code: protected theorem Subset.rfl {s : Finset α} : s ⊆ s 
goal: s ⊆ s

full_name: Finset.subset_of_eq
code: protected theorem subset_of_eq {s t : Finset α} (h : s = t) : s ⊆ t 
goal: s ⊆ t

full_name: Finset.Subset.trans
code: theorem Subset.trans {s₁ s₂ s₃ : Finset α} : s₁ ⊆ s₂ → s₂ ⊆ s₃ → s₁ ⊆ s₃ 
goal: s₁ ⊆ s₂ → s₂ ⊆ s₃ → s₁ ⊆ s₃

full_name: Finset.Superset.trans
code: theorem Superset.trans {s₁ s₂ s₃ : Finset α} : s₁ ⊇ s₂ → s₂ ⊇ s₃ → s₁ ⊇ s₃ 
goal: s₁ ⊇ s₂ → s₂ ⊇ s₃ → s₁ ⊇ s₃

full_name: Finset.mem_of_subset
code: theorem mem_of_subset {s₁ s₂ : Finset α} {a : α} : s₁ ⊆ s₂ → a ∈ s₁ → a ∈ s₂ 
goal: s₁ ⊆ s₂ → a ∈ s₁ → a ∈ s₂

full_name: Finset.not_mem_mono
code: theorem not_mem_mono {s t : Finset α} (h : s ⊆ t) {a : α} : a ∉ t → a ∉ s 
goal: a ∉ t → a ∉ s

full_name: Finset.Subset.antisymm
code: theorem Subset.antisymm {s₁ s₂ : Finset α} (H₁ : s₁ ⊆ s₂) (H₂ : s₂ ⊆ s₁) : s₁ = s₂ 
goal: s₁ = s₂

full_name: Finset.subset_iff
code: theorem subset_iff {s₁ s₂ : Finset α} : s₁ ⊆ s₂ ↔ ∀ ⦃x⦄, x ∈ s₁ → x ∈ s₂ 
goal: s₁ ⊆ s₂ ↔ ∀ ⦃x : α⦄, x ∈ s₁ → x ∈ s₂

full_name: Finset.coe_subset
code: @[simp, norm_cast]
theorem coe_subset {s₁ s₂ : Finset α} : (s₁ : Set α) ⊆ s₂ ↔ s₁ ⊆ s₂ 
goal: ↑s₁ ⊆ ↑s₂ ↔ s₁ ⊆ s₂

full_name: Finset.val_le_iff
code: @[simp]
theorem val_le_iff {s₁ s₂ : Finset α} : s₁.1 ≤ s₂.1 ↔ s₁ ⊆ s₂ 
goal: s₁.val ≤ s₂.val ↔ s₁ ⊆ s₂

full_name: Finset.Subset.antisymm_iff
code: theorem Subset.antisymm_iff {s₁ s₂ : Finset α} : s₁ = s₂ ↔ s₁ ⊆ s₂ ∧ s₂ ⊆ s₁ 
goal: s₁ = s₂ ↔ s₁ ⊆ s₂ ∧ s₂ ⊆ s₁

full_name: Finset.not_subset
code: theorem not_subset : ¬s ⊆ t ↔ ∃ x ∈ s, x ∉ t 
goal: ¬s ⊆ t ↔ ∃ x ∈ s, x ∉ t

full_name: Finset.le_eq_subset
code: @[simp]
theorem le_eq_subset : ((· ≤ ·) : Finset α → Finset α → Prop) = (· ⊆ ·) 
goal: (fun x x_1 => x ≤ x_1) = fun x x_1 => x ⊆ x_1

full_name: Finset.lt_eq_subset
code: @[simp]
theorem lt_eq_subset : ((· < ·) : Finset α → Finset α → Prop) = (· ⊂ ·) 
goal: (fun x x_1 => x < x_1) = fun x x_1 => x ⊂ x_1

full_name: Finset.le_iff_subset
code: theorem le_iff_subset {s₁ s₂ : Finset α} : s₁ ≤ s₂ ↔ s₁ ⊆ s₂ 
goal: s₁ ≤ s₂ ↔ s₁ ⊆ s₂

full_name: Finset.lt_iff_ssubset
code: theorem lt_iff_ssubset {s₁ s₂ : Finset α} : s₁ < s₂ ↔ s₁ ⊂ s₂ 
goal: s₁ < s₂ ↔ s₁ ⊂ s₂

full_name: Finset.coe_ssubset
code: @[simp, norm_cast]
theorem coe_ssubset {s₁ s₂ : Finset α} : (s₁ : Set α) ⊂ s₂ ↔ s₁ ⊂ s₂ 
goal: ↑s₁ ⊂ ↑s₂ ↔ s₁ ⊂ s₂

full_name: Finset.val_lt_iff
code: @[simp]
theorem val_lt_iff {s₁ s₂ : Finset α} : s₁.1 < s₂.1 ↔ s₁ ⊂ s₂ 
goal: s₁.val < s₂.val ↔ s₁ ⊂ s₂

full_name: Finset.val_strictMono
code: lemma val_strictMono : StrictMono (val : Finset α → Multiset α) 
goal: StrictMono Finset.val

full_name: Finset.ssubset_iff_subset_ne
code: theorem ssubset_iff_subset_ne {s t : Finset α} : s ⊂ t ↔ s ⊆ t ∧ s ≠ t 
goal: s ⊂ t ↔ s ⊆ t ∧ s ≠ t

full_name: Finset.ssubset_iff_of_subset
code: theorem ssubset_iff_of_subset {s₁ s₂ : Finset α} (h : s₁ ⊆ s₂) : s₁ ⊂ s₂ ↔ ∃ x ∈ s₂, x ∉ s₁ 
goal: s₁ ⊂ s₂ ↔ ∃ x ∈ s₂, x ∉ s₁

full_name: Finset.ssubset_of_ssubset_of_subset
code: theorem ssubset_of_ssubset_of_subset {s₁ s₂ s₃ : Finset α} (hs₁s₂ : s₁ ⊂ s₂) (hs₂s₃ : s₂ ⊆ s₃) :
    s₁ ⊂ s₃ 
goal: s₁ ⊂ s₃

full_name: Finset.ssubset_of_subset_of_ssubset
code: theorem ssubset_of_subset_of_ssubset {s₁ s₂ s₃ : Finset α} (hs₁s₂ : s₁ ⊆ s₂) (hs₂s₃ : s₂ ⊂ s₃) :
    s₁ ⊂ s₃ 
goal: s₁ ⊂ s₃

full_name: Finset.exists_of_ssubset
code: theorem exists_of_ssubset {s₁ s₂ : Finset α} (h : s₁ ⊂ s₂) : ∃ x ∈ s₂, x ∉ s₁ 
goal: ∃ x ∈ s₂, x ∉ s₁

full_name: Finset.isWellFounded_ssubset
code: instance isWellFounded_ssubset : IsWellFounded (Finset α) (· ⊂ ·) 
goal: IsWellFounded (Finset α) fun x x_1 => x ⊂ x_1

full_name: Finset.wellFoundedLT
code: instance wellFoundedLT : WellFoundedLT (Finset α) 
goal: WellFoundedLT (Finset α)

full_name: Finset.coeEmb
code: /-- Coercion to `Set α` as an `OrderEmbedding`. -/
def coeEmb : Finset α ↪o Set α 
goal: Finset α ↪o Set α

full_name: Finset.coe_coeEmb
code: @[simp]
theorem coe_coeEmb : ⇑(coeEmb : Finset α ↪o Set α) = ((↑) : Finset α → Set α) 
goal: ⇑Finset.coeEmb = Finset.toSet

full_name: Finset.Nonempty
code: /-- The property `s.Nonempty` expresses the fact that the finset `s` is not empty. It should be used
in theorem assumptions instead of `∃ x, x ∈ s` or `s ≠ ∅` as it gives access to a nice API thanks
to the dot notation. -/
protected def Nonempty (s : Finset α) : Prop 
goal: Prop

full_name: Finset.decidableNonempty
code: instance decidableNonempty {s : Finset α} : Decidable s.Nonempty 
goal: Decidable s.Nonempty

full_name: Finset.coe_nonempty
code: @[simp, norm_cast]
theorem coe_nonempty {s : Finset α} : (s : Set α).Nonempty ↔ s.Nonempty 
goal: (↑s).Nonempty ↔ s.Nonempty

full_name: Finset.nonempty_coe_sort
code: theorem nonempty_coe_sort {s : Finset α} : Nonempty (s : Type _) ↔ s.Nonempty 
goal: Nonempty { x // x ∈ s } ↔ s.Nonempty

full_name: Finset.Nonempty.exists_mem
code: theorem Nonempty.exists_mem {s : Finset α} (h : s.Nonempty) : ∃ x : α, x ∈ s 
goal: ∃ x, x ∈ s

full_name: Finset.Nonempty.mono
code: theorem Nonempty.mono {s t : Finset α} (hst : s ⊆ t) (hs : s.Nonempty) : t.Nonempty 
goal: t.Nonempty

full_name: Finset.Nonempty.forall_const
code: theorem Nonempty.forall_const {s : Finset α} (h : s.Nonempty) {p : Prop} : (∀ x ∈ s, p) ↔ p 
goal: (∀ x ∈ s, p) ↔ p

full_name: Finset.Nonempty.to_subtype
code: theorem Nonempty.to_subtype {s : Finset α} : s.Nonempty → Nonempty s 
goal: s.Nonempty → Nonempty { x // x ∈ s }

full_name: Finset.Nonempty.to_type
code: theorem Nonempty.to_type {s : Finset α} : s.Nonempty → Nonempty α 
goal: s.Nonempty → Nonempty α

full_name: Finset.empty
code: /-- The empty finset -/
protected def empty : Finset α 
goal: Finset α

full_name: Finset.instEmptyCollection
code: instance : EmptyCollection (Finset α) 
goal: EmptyCollection (Finset α)

full_name: Finset.inhabitedFinset
code: instance inhabitedFinset : Inhabited (Finset α) 
goal: Inhabited (Finset α)

full_name: Finset.empty_val
code: @[simp]
theorem empty_val : (∅ : Finset α).1 = 0 
goal: ∅.val = 0

full_name: Finset.not_mem_empty
code: @[simp]
theorem not_mem_empty (a : α) : a ∉ (∅ : Finset α) 
goal: a ∉ ∅

full_name: Finset.not_nonempty_empty
code: @[simp]
theorem not_nonempty_empty : ¬(∅ : Finset α).Nonempty 
goal: ¬∅.Nonempty

full_name: Finset.mk_zero
code: @[simp]
theorem mk_zero : (⟨0, nodup_zero⟩ : Finset α) = ∅ 
goal: { val := 0, nodup := ⋯ } = ∅

full_name: Finset.ne_empty_of_mem
code: theorem ne_empty_of_mem {a : α} {s : Finset α} (h : a ∈ s) : s ≠ ∅ 
goal: s ≠ ∅

full_name: Finset.Nonempty.ne_empty
code: theorem Nonempty.ne_empty {s : Finset α} (h : s.Nonempty) : s ≠ ∅ 
goal: s ≠ ∅

full_name: Finset.empty_subset
code: @[simp]
theorem empty_subset (s : Finset α) : ∅ ⊆ s 
goal: ∅ ⊆ s

full_name: Finset.eq_empty_of_forall_not_mem
code: theorem eq_empty_of_forall_not_mem {s : Finset α} (H : ∀ x, x ∉ s) : s = ∅ 
goal: s = ∅

full_name: Finset.eq_empty_iff_forall_not_mem
code: theorem eq_empty_iff_forall_not_mem {s : Finset α} : s = ∅ ↔ ∀ x, x ∉ s 
goal: s = ∅ ↔ ∀ (x : α), x ∉ s

full_name: Finset.val_eq_zero
code: @[simp]
theorem val_eq_zero {s : Finset α} : s.1 = 0 ↔ s = ∅ 
goal: s.val = 0 ↔ s = ∅

full_name: Finset.subset_empty
code: theorem subset_empty {s : Finset α} : s ⊆ ∅ ↔ s = ∅ 
goal: s ⊆ ∅ ↔ s = ∅

full_name: Finset.not_ssubset_empty
code: @[simp]
theorem not_ssubset_empty (s : Finset α) : ¬s ⊂ ∅ 
goal: ¬s ⊂ ∅

full_name: Finset.nonempty_of_ne_empty
code: theorem nonempty_of_ne_empty {s : Finset α} (h : s ≠ ∅) : s.Nonempty 
goal: s.Nonempty

full_name: Finset.nonempty_iff_ne_empty
code: theorem nonempty_iff_ne_empty {s : Finset α} : s.Nonempty ↔ s ≠ ∅ 
goal: s.Nonempty ↔ s ≠ ∅

full_name: Finset.not_nonempty_iff_eq_empty
code: @[simp]
theorem not_nonempty_iff_eq_empty {s : Finset α} : ¬s.Nonempty ↔ s = ∅ 
goal: ¬s.Nonempty ↔ s = ∅

full_name: Finset.eq_empty_or_nonempty
code: theorem eq_empty_or_nonempty (s : Finset α) : s = ∅ ∨ s.Nonempty 
goal: s = ∅ ∨ s.Nonempty

full_name: Finset.coe_empty
code: @[simp, norm_cast]
theorem coe_empty : ((∅ : Finset α) : Set α) = ∅ 
goal: ↑∅ = ∅

full_name: Finset.coe_eq_empty
code: @[simp, norm_cast]
theorem coe_eq_empty {s : Finset α} : (s : Set α) = ∅ ↔ s = ∅ 
goal: ↑s = ∅ ↔ s = ∅

full_name: Finset.isEmpty_coe_sort
code: theorem isEmpty_coe_sort {s : Finset α} : IsEmpty (s : Type _) ↔ s = ∅ 
goal: IsEmpty { x // x ∈ s } ↔ s = ∅

full_name: Finset.instIsEmpty
code: instance instIsEmpty : IsEmpty (∅ : Finset α) 
goal: IsEmpty { x // x ∈ ∅ }

full_name: Finset.eq_empty_of_isEmpty
code: /-- A `Finset` for an empty type is empty. -/
theorem eq_empty_of_isEmpty [IsEmpty α] (s : Finset α) : s = ∅ 
goal: s = ∅

full_name: Finset.instOrderBot
code: instance : OrderBot (Finset α) 
goal: OrderBot (Finset α)

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

full_name: Finset.empty_ssubset
code: @[simp]
theorem empty_ssubset : ∅ ⊂ s ↔ s.Nonempty 
goal: ∅ ⊂ s ↔ s.Nonempty

full_name: Finset.instSingleton
code: /-- `{a} : Finset a` is the set `{a}` containing `a` and nothing else.

This differs from `insert a ∅` in that it does not require a `DecidableEq` instance for `α`.
-/
instance : Singleton α (Finset α) 
goal: Singleton α (Finset α)

full_name: Finset.singleton_val
code: @[simp]
theorem singleton_val (a : α) : ({a} : Finset α).1 = {a} 
goal: {a}.val = {a}

full_name: Finset.mem_singleton
code: @[simp]
theorem mem_singleton {a b : α} : b ∈ ({a} : Finset α) ↔ b = a 
goal: b ∈ {a} ↔ b = a

full_name: Finset.eq_of_mem_singleton
code: theorem eq_of_mem_singleton {x y : α} (h : x ∈ ({y} : Finset α)) : x = y 
goal: x = y

full_name: Finset.not_mem_singleton
code: theorem not_mem_singleton {a b : α} : a ∉ ({b} : Finset α) ↔ a ≠ b 
goal: a ∉ {b} ↔ a ≠ b

full_name: Finset.mem_singleton_self
code: theorem mem_singleton_self (a : α) : a ∈ ({a} : Finset α) 
goal: a ∈ {a}

full_name: Finset.val_eq_singleton_iff
code: @[simp]
theorem val_eq_singleton_iff {a : α} {s : Finset α} : s.val = {a} ↔ s = {a} 
goal: s.val = {a} ↔ s = {a}

full_name: Finset.singleton_injective
code: theorem singleton_injective : Injective (singleton : α → Finset α) 
goal: Function.Injective singleton

full_name: Finset.singleton_inj
code: @[simp]
theorem singleton_inj : ({a} : Finset α) = {b} ↔ a = b 
goal: {a} = {b} ↔ a = b

full_name: Finset.singleton_nonempty
code: @[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem singleton_nonempty (a : α) : ({a} : Finset α).Nonempty 
goal: {a}.Nonempty

full_name: Finset.singleton_ne_empty
code: @[simp]
theorem singleton_ne_empty (a : α) : ({a} : Finset α) ≠ ∅ 
goal: {a} ≠ ∅

full_name: Finset.empty_ssubset_singleton
code: theorem empty_ssubset_singleton : (∅ : Finset α) ⊂ {a} 
goal: ∅ ⊂ {a}

full_name: Finset.coe_singleton
code: @[simp, norm_cast]
theorem coe_singleton (a : α) : (({a} : Finset α) : Set α) = {a} 
goal: ↑{a} = {a}

full_name: Finset.coe_eq_singleton
code: @[simp, norm_cast]
theorem coe_eq_singleton {s : Finset α} {a : α} : (s : Set α) = {a} ↔ s = {a} 
goal: ↑s = {a} ↔ s = {a}

full_name: Finset.coe_subset_singleton
code: @[norm_cast]
lemma coe_subset_singleton : (s : Set α) ⊆ {a} ↔ s ⊆ {a} 
goal: ↑s ⊆ {a} ↔ s ⊆ {a}

full_name: Finset.singleton_subset_coe
code: @[norm_cast]
lemma singleton_subset_coe : {a} ⊆ (s : Set α) ↔ {a} ⊆ s 
goal: {a} ⊆ ↑s ↔ {a} ⊆ s

full_name: Finset.eq_singleton_iff_unique_mem
code: theorem eq_singleton_iff_unique_mem {s : Finset α} {a : α} : s = {a} ↔ a ∈ s ∧ ∀ x ∈ s, x = a 
goal: s = {a} ↔ a ∈ s ∧ ∀ x ∈ s, x = a

full_name: Finset.eq_singleton_iff_nonempty_unique_mem
code: theorem eq_singleton_iff_nonempty_unique_mem {s : Finset α} {a : α} :
    s = {a} ↔ s.Nonempty ∧ ∀ x ∈ s, x = a 
goal: s = {a} ↔ s.Nonempty ∧ ∀ x ∈ s, x = a

full_name: Finset.nonempty_iff_eq_singleton_default
code: theorem nonempty_iff_eq_singleton_default [Unique α] {s : Finset α} :
    s.Nonempty ↔ s = {default} 
goal: s.Nonempty ↔ s = {default}

full_name: Finset.singleton_iff_unique_mem
code: theorem singleton_iff_unique_mem (s : Finset α) : (∃ a, s = {a}) ↔ ∃! a, a ∈ s 
goal: (∃ a, s = {a}) ↔ ∃! a, a ∈ s

full_name: Finset.singleton_subset_set_iff
code: theorem singleton_subset_set_iff {s : Set α} {a : α} : ↑({a} : Finset α) ⊆ s ↔ a ∈ s 
goal: ↑{a} ⊆ s ↔ a ∈ s

full_name: Finset.singleton_subset_iff
code: @[simp]
theorem singleton_subset_iff {s : Finset α} {a : α} : {a} ⊆ s ↔ a ∈ s 
goal: {a} ⊆ s ↔ a ∈ s

full_name: Finset.subset_singleton_iff
code: @[simp]
theorem subset_singleton_iff {s : Finset α} {a : α} : s ⊆ {a} ↔ s = ∅ ∨ s = {a} 
goal: s ⊆ {a} ↔ s = ∅ ∨ s = {a}

full_name: Finset.singleton_subset_singleton
code: theorem singleton_subset_singleton : ({a} : Finset α) ⊆ {b} ↔ a = b 
goal: {a} ⊆ {b} ↔ a = b

full_name: Finset.Nonempty.subset_singleton_iff
code: protected theorem Nonempty.subset_singleton_iff {s : Finset α} {a : α} (h : s.Nonempty) :
    s ⊆ {a} ↔ s = {a} 
goal: s ⊆ {a} ↔ s = {a}

full_name: Finset.subset_singleton_iff'
code: theorem subset_singleton_iff' {s : Finset α} {a : α} : s ⊆ {a} ↔ ∀ b ∈ s, b = a 
goal: s ⊆ {a} ↔ ∀ b ∈ s, b = a

full_name: Finset.ssubset_singleton_iff
code: @[simp]
theorem ssubset_singleton_iff {s : Finset α} {a : α} : s ⊂ {a} ↔ s = ∅ 
goal: s ⊂ {a} ↔ s = ∅

full_name: Finset.eq_empty_of_ssubset_singleton
code: theorem eq_empty_of_ssubset_singleton {s : Finset α} {x : α} (hs : s ⊂ {x}) : s = ∅ 
goal: s = ∅

full_name: Finset.Nontrivial
code: /-- A finset is nontrivial if it has at least two elements. -/
protected abbrev Nontrivial (s : Finset α) : Prop 
goal: Prop

full_name: Finset.not_nontrivial_empty
code: @[simp]
theorem not_nontrivial_empty : ¬ (∅ : Finset α).Nontrivial 
goal: ¬∅.Nontrivial

full_name: Finset.not_nontrivial_singleton
code: @[simp]
theorem not_nontrivial_singleton : ¬ ({a} : Finset α).Nontrivial 
goal: ¬{a}.Nontrivial

full_name: Finset.Nontrivial.ne_singleton
code: theorem Nontrivial.ne_singleton (hs : s.Nontrivial) : s ≠ {a} 
goal: s ≠ {a}

full_name: Finset.Nontrivial.exists_ne
code: nonrec lemma Nontrivial.exists_ne (hs : s.Nontrivial) (a : α) : ∃ b ∈ s, b ≠ a 
goal: ∃ b ∈ s, b ≠ a

full_name: Finset.eq_singleton_or_nontrivial
code: theorem eq_singleton_or_nontrivial (ha : a ∈ s) : s = {a} ∨ s.Nontrivial 
goal: s = {a} ∨ s.Nontrivial

full_name: Finset.nontrivial_iff_ne_singleton
code: theorem nontrivial_iff_ne_singleton (ha : a ∈ s) : s.Nontrivial ↔ s ≠ {a} 
goal: s.Nontrivial ↔ s ≠ {a}

full_name: Finset.Nonempty.exists_eq_singleton_or_nontrivial
code: theorem Nonempty.exists_eq_singleton_or_nontrivial : s.Nonempty → (∃ a, s = {a}) ∨ s.Nontrivial 
goal: s.Nonempty → (∃ a, s = {a}) ∨ s.Nontrivial

full_name: Finset.instNontrivial
code: instance instNontrivial [Nonempty α] : Nontrivial (Finset α) 
goal: Nontrivial (Finset α)

full_name: Finset.instUniqueOfIsEmpty
code: instance [IsEmpty α] : Unique (Finset α) 
goal: Unique (Finset α)

full_name: Finset.instUniqueSubtypeMemSingleton
code: instance (i : α) : Unique ({i} : Finset α) 
goal: Unique { x // x ∈ {i} }

full_name: Finset.default_singleton
code: @[simp]
lemma default_singleton (i : α) : ((default : ({i} : Finset α)) : α) = i 
goal: ↑default = i

full_name: Finset.cons
code: /-- `cons a s h` is the set `{a} ∪ s` containing `a` and the elements of `s`. It is the same as
`insert a s` when it is defined, but unlike `insert a s` it does not require `DecidableEq α`,
and the union is guaranteed to be disjoint. -/
def cons (a : α) (s : Finset α) (h : a ∉ s) : Finset α 
goal: Finset α

full_name: Finset.mem_cons
code: @[simp]
theorem mem_cons {h} : b ∈ s.cons a h ↔ b = a ∨ b ∈ s 
goal: b ∈ Finset.cons a s h ↔ b = a ∨ b ∈ s

full_name: Finset.mem_cons_of_mem
code: theorem mem_cons_of_mem {a b : α} {s : Finset α} {hb : b ∉ s} (ha : a ∈ s) : a ∈ cons b s hb 
goal: a ∈ Finset.cons b s hb

full_name: Finset.mem_cons_self
code: theorem mem_cons_self (a : α) (s : Finset α) {h} : a ∈ cons a s h 
goal: a ∈ Finset.cons a s h

full_name: Finset.cons_val
code: @[simp]
theorem cons_val (h : a ∉ s) : (cons a s h).1 = a ::ₘ s.1 
goal: (Finset.cons a s h).val = a ::ₘ s.val

full_name: Finset.forall_mem_cons
code: theorem forall_mem_cons (h : a ∉ s) (p : α → Prop) :
    (∀ x, x ∈ cons a s h → p x) ↔ p a ∧ ∀ x, x ∈ s → p x 
goal: (∀ x ∈ Finset.cons a s h, p x) ↔ p a ∧ ∀ x ∈ s, p x

full_name: Finset.forall_of_forall_cons
code: /-- Useful in proofs by induction. -/
theorem forall_of_forall_cons {p : α → Prop} {h : a ∉ s} (H : ∀ x, x ∈ cons a s h → p x) (x)
    (h : x ∈ s) : p x 
goal: x ∈ s → p x

full_name: Finset.mk_cons
code: @[simp]
theorem mk_cons {s : Multiset α} (h : (a ::ₘ s).Nodup) :
    (⟨a ::ₘ s, h⟩ : Finset α) = cons a ⟨s, (nodup_cons.1 h).2⟩ (nodup_cons.1 h).1 
goal: { val := a ::ₘ s, nodup := h } = Finset.cons a { val := s, nodup := ⋯ } ⋯

full_name: Finset.cons_empty
code: @[simp]
theorem cons_empty (a : α) : cons a ∅ (not_mem_empty _) = {a} 
goal: Finset.cons a ∅ ⋯ = {a}

full_name: Finset.nonempty_cons
code: @[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem nonempty_cons (h : a ∉ s) : (cons a s h).Nonempty 
goal: (Finset.cons a s h).Nonempty

full_name: Finset.nonempty_mk
code: @[simp]
theorem nonempty_mk {m : Multiset α} {hm} : (⟨m, hm⟩ : Finset α).Nonempty ↔ m ≠ 0 
goal: { val := m, nodup := hm }.Nonempty ↔ m ≠ 0

full_name: Finset.coe_cons
code: @[simp]
theorem coe_cons {a s h} : (@cons α a s h : Set α) = insert a (s : Set α) 
goal: ↑(Finset.cons a s h) = insert a ↑s

full_name: Finset.subset_cons
code: theorem subset_cons (h : a ∉ s) : s ⊆ s.cons a h 
goal: s ⊆ Finset.cons a s h

full_name: Finset.ssubset_cons
code: theorem ssubset_cons (h : a ∉ s) : s ⊂ s.cons a h 
goal: s ⊂ Finset.cons a s h

full_name: Finset.cons_subset
code: theorem cons_subset {h : a ∉ s} : s.cons a h ⊆ t ↔ a ∈ t ∧ s ⊆ t 
goal: Finset.cons a s h ⊆ t ↔ a ∈ t ∧ s ⊆ t

full_name: Finset.cons_subset_cons
code: @[simp]
theorem cons_subset_cons {hs ht} : s.cons a hs ⊆ t.cons a ht ↔ s ⊆ t 
goal: Finset.cons a s hs ⊆ Finset.cons a t ht ↔ s ⊆ t

full_name: Finset.ssubset_iff_exists_cons_subset
code: theorem ssubset_iff_exists_cons_subset : s ⊂ t ↔ ∃ (a : _) (h : a ∉ s), s.cons a h ⊆ t 
goal: s ⊂ t ↔ ∃ a, ∃ (h : a ∉ s), Finset.cons a s h ⊆ t

full_name: Finset.disjoint_left
code: theorem disjoint_left : Disjoint s t ↔ ∀ ⦃a⦄, a ∈ s → a ∉ t 
goal: Disjoint s t ↔ ∀ ⦃a : α⦄, a ∈ s → a ∉ t

full_name: Finset.disjoint_right
code: theorem disjoint_right : Disjoint s t ↔ ∀ ⦃a⦄, a ∈ t → a ∉ s 
goal: Disjoint s t ↔ ∀ ⦃a : α⦄, a ∈ t → a ∉ s

full_name: Finset.disjoint_iff_ne
code: theorem disjoint_iff_ne : Disjoint s t ↔ ∀ a ∈ s, ∀ b ∈ t, a ≠ b 
goal: Disjoint s t ↔ ∀ a ∈ s, ∀ b ∈ t, a ≠ b

full_name: Finset.disjoint_val
code: @[simp]
theorem disjoint_val : s.1.Disjoint t.1 ↔ Disjoint s t 
goal: s.val.Disjoint t.val ↔ Disjoint s t

full_name: Disjoint.forall_ne_finset
code: theorem _root_.Disjoint.forall_ne_finset (h : Disjoint s t) (ha : a ∈ s) (hb : b ∈ t) : a ≠ b 
goal: a ≠ b

full_name: Finset.not_disjoint_iff
code: theorem not_disjoint_iff : ¬Disjoint s t ↔ ∃ a, a ∈ s ∧ a ∈ t 
goal: ¬Disjoint s t ↔ ∃ a ∈ s, a ∈ t

full_name: Finset.disjoint_of_subset_left
code: theorem disjoint_of_subset_left (h : s ⊆ u) (d : Disjoint u t) : Disjoint s t 
goal: Disjoint s t

full_name: Finset.disjoint_of_subset_right
code: theorem disjoint_of_subset_right (h : t ⊆ u) (d : Disjoint s u) : Disjoint s t 
goal: Disjoint s t

full_name: Finset.disjoint_empty_left
code: @[simp]
theorem disjoint_empty_left (s : Finset α) : Disjoint ∅ s 
goal: Disjoint ∅ s

full_name: Finset.disjoint_empty_right
code: @[simp]
theorem disjoint_empty_right (s : Finset α) : Disjoint s ∅ 
goal: Disjoint s ∅

full_name: Finset.disjoint_singleton_left
code: @[simp]
theorem disjoint_singleton_left : Disjoint (singleton a) s ↔ a ∉ s 
goal: Disjoint {a} s ↔ a ∉ s

full_name: Finset.disjoint_singleton_right
code: @[simp]
theorem disjoint_singleton_right : Disjoint s (singleton a) ↔ a ∉ s 
goal: Disjoint s {a} ↔ a ∉ s

full_name: Finset.disjoint_singleton
code: theorem disjoint_singleton : Disjoint ({a} : Finset α) {b} ↔ a ≠ b 
goal: Disjoint {a} {b} ↔ a ≠ b

full_name: Finset.disjoint_self_iff_empty
code: theorem disjoint_self_iff_empty (s : Finset α) : Disjoint s s ↔ s = ∅ 
goal: Disjoint s s ↔ s = ∅

full_name: Finset.disjoint_coe
code: @[simp, norm_cast]
theorem disjoint_coe : Disjoint (s : Set α) t ↔ Disjoint s t 
goal: Disjoint ↑s ↑t ↔ Disjoint s t

full_name: Finset.pairwiseDisjoint_coe
code: @[simp, norm_cast]
theorem pairwiseDisjoint_coe {ι : Type*} {s : Set ι} {f : ι → Finset α} :
    s.PairwiseDisjoint (fun i => f i : ι → Set α) ↔ s.PairwiseDisjoint f 
goal: (s.PairwiseDisjoint fun i => ↑(f i)) ↔ s.PairwiseDisjoint f

full_name: Finset.disjUnion
code: /-- `disjUnion s t h` is the set such that `a ∈ disjUnion s t h` iff `a ∈ s` or `a ∈ t`.
It is the same as `s ∪ t`, but it does not require decidable equality on the type. The hypothesis
ensures that the sets are disjoint. -/
def disjUnion (s t : Finset α) (h : Disjoint s t) : Finset α 
goal: Finset α

full_name: Finset.mem_disjUnion
code: @[simp]
theorem mem_disjUnion {α s t h a} : a ∈ @disjUnion α s t h ↔ a ∈ s ∨ a ∈ t 
goal: a ∈ s.disjUnion t h ↔ a ∈ s ∨ a ∈ t

full_name: Finset.coe_disjUnion
code: @[simp, norm_cast]
theorem coe_disjUnion {s t : Finset α} (h : Disjoint s t) :
    (disjUnion s t h : Set α) = (s : Set α) ∪ t 
goal: ↑(s.disjUnion t h) = ↑s ∪ ↑t

full_name: Finset.disjUnion_comm
code: theorem disjUnion_comm (s t : Finset α) (h : Disjoint s t) :
    disjUnion s t h = disjUnion t s h.symm 
goal: s.disjUnion t h = t.disjUnion s ⋯

full_name: Finset.empty_disjUnion
code: @[simp]
theorem empty_disjUnion (t : Finset α) (h : Disjoint ∅ t := disjoint_bot_left) :
    disjUnion ∅ t h = t 
goal: ∅.disjUnion t h = t

full_name: Finset.disjUnion_empty
code: @[simp]
theorem disjUnion_empty (s : Finset α) (h : Disjoint s ∅ := disjoint_bot_right) :
    disjUnion s ∅ h = s 
goal: s.disjUnion ∅ h = s

full_name: Finset.singleton_disjUnion
code: theorem singleton_disjUnion (a : α) (t : Finset α) (h : Disjoint {a} t) :
    disjUnion {a} t h = cons a t (disjoint_singleton_left.mp h) 
goal: {a}.disjUnion t h = Finset.cons a t ⋯

full_name: Finset.disjUnion_singleton
code: theorem disjUnion_singleton (s : Finset α) (a : α) (h : Disjoint s {a}) :
    disjUnion s {a} h = cons a s (disjoint_singleton_right.mp h) 
goal: s.disjUnion {a} h = Finset.cons a s ⋯

full_name: Finset.instInsert
code: /-- `insert a s` is the set `{a} ∪ s` containing `a` and the elements of `s`. -/
instance : Insert α (Finset α) 
goal: Insert α (Finset α)

full_name: Finset.insert_def
code: theorem insert_def (a : α) (s : Finset α) : insert a s = ⟨_, s.2.ndinsert a⟩ 
goal: insert a s = { val := Multiset.ndinsert a s.val, nodup := ⋯ }

full_name: Finset.insert_val
code: @[simp]
theorem insert_val (a : α) (s : Finset α) : (insert a s).1 = ndinsert a s.1 
goal: (insert a s).val = Multiset.ndinsert a s.val

full_name: Finset.insert_val'
code: theorem insert_val' (a : α) (s : Finset α) : (insert a s).1 = dedup (a ::ₘ s.1) 
goal: (insert a s).val = (a ::ₘ s.val).dedup

full_name: Finset.insert_val_of_not_mem
code: theorem insert_val_of_not_mem {a : α} {s : Finset α} (h : a ∉ s) : (insert a s).1 = a ::ₘ s.1 
goal: (insert a s).val = a ::ₘ s.val

full_name: Finset.mem_insert
code: @[simp]
theorem mem_insert : a ∈ insert b s ↔ a = b ∨ a ∈ s 
goal: a ∈ insert b s ↔ a = b ∨ a ∈ s

full_name: Finset.mem_insert_self
code: theorem mem_insert_self (a : α) (s : Finset α) : a ∈ insert a s 
goal: a ∈ insert a s

full_name: Finset.mem_insert_of_mem
code: theorem mem_insert_of_mem (h : a ∈ s) : a ∈ insert b s 
goal: a ∈ insert b s

full_name: Finset.mem_of_mem_insert_of_ne
code: theorem mem_of_mem_insert_of_ne (h : b ∈ insert a s) : b ≠ a → b ∈ s 
goal: b ≠ a → b ∈ s

full_name: Finset.eq_of_not_mem_of_mem_insert
code: theorem eq_of_not_mem_of_mem_insert (ha : b ∈ insert a s) (hb : b ∉ s) : b = a 
goal: b = a

full_name: Finset.insert_empty
code: /-- A version of `LawfulSingleton.insert_emptyc_eq` that works with `dsimp`. -/
@[simp] lemma insert_empty : insert a (∅ : Finset α) = {a} 
goal: insert a ∅ = {a}

full_name: Finset.cons_eq_insert
code: @[simp]
theorem cons_eq_insert (a s h) : @cons α a s h = insert a s 
goal: Finset.cons a s h = insert a s

full_name: Finset.coe_insert
code: @[simp, norm_cast]
theorem coe_insert (a : α) (s : Finset α) : ↑(insert a s) = (insert a s : Set α) 
goal: ↑(insert a s) = insert a ↑s

full_name: Finset.mem_insert_coe
code: theorem mem_insert_coe {s : Finset α} {x y : α} : x ∈ insert y s ↔ x ∈ insert y (s : Set α) 
goal: x ∈ insert y s ↔ x ∈ insert y ↑s

full_name: Finset.instLawfulSingleton
code: instance : LawfulSingleton α (Finset α) 
goal: LawfulSingleton α (Finset α)

full_name: Finset.insert_eq_of_mem
code: @[simp]
theorem insert_eq_of_mem (h : a ∈ s) : insert a s = s 
goal: insert a s = s

full_name: Finset.insert_eq_self
code: @[simp]
theorem insert_eq_self : insert a s = s ↔ a ∈ s 
goal: insert a s = s ↔ a ∈ s

full_name: Finset.insert_ne_self
code: theorem insert_ne_self : insert a s ≠ s ↔ a ∉ s 
goal: insert a s ≠ s ↔ a ∉ s

full_name: Finset.pair_eq_singleton
code: theorem pair_eq_singleton (a : α) : ({a, a} : Finset α) = {a} 
goal: {a, a} = {a}

full_name: Finset.Insert.comm
code: theorem Insert.comm (a b : α) (s : Finset α) : insert a (insert b s) = insert b (insert a s) 
goal: insert a (insert b s) = insert b (insert a s)

full_name: Finset.coe_pair
code: @[norm_cast]
theorem coe_pair {a b : α} : (({a, b} : Finset α) : Set α) = {a, b} 
goal: ↑{a, b} = {a, b}

full_name: Finset.coe_eq_pair
code: @[simp, norm_cast]
theorem coe_eq_pair {s : Finset α} {a b : α} : (s : Set α) = {a, b} ↔ s = {a, b} 
goal: ↑s = {a, b} ↔ s = {a, b}

full_name: Finset.pair_comm
code: theorem pair_comm (a b : α) : ({a, b} : Finset α) = {b, a} 
goal: {a, b} = {b, a}

full_name: Finset.insert_idem
code: theorem insert_idem (a : α) (s : Finset α) : insert a (insert a s) = insert a s 
goal: insert a (insert a s) = insert a s

full_name: Finset.insert_nonempty
code: @[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem insert_nonempty (a : α) (s : Finset α) : (insert a s).Nonempty 
goal: (insert a s).Nonempty

full_name: Finset.insert_ne_empty
code: @[simp]
theorem insert_ne_empty (a : α) (s : Finset α) : insert a s ≠ ∅ 
goal: insert a s ≠ ∅

full_name: Finset.instNonemptyElemToSetInsert
code: instance (i : α) (s : Finset α) : Nonempty ((insert i s : Finset α) : Set α) 
goal: Nonempty ↑↑(insert i s)

full_name: Finset.ne_insert_of_not_mem
code: theorem ne_insert_of_not_mem (s t : Finset α) {a : α} (h : a ∉ s) : s ≠ insert a t 
goal: s ≠ insert a t

full_name: Finset.insert_subset_iff
code: theorem insert_subset_iff : insert a s ⊆ t ↔ a ∈ t ∧ s ⊆ t 
goal: insert a s ⊆ t ↔ a ∈ t ∧ s ⊆ t

full_name: Finset.insert_subset
code: theorem insert_subset (ha : a ∈ t) (hs : s ⊆ t) : insert a s ⊆ t 
goal: insert a s ⊆ t

full_name: Finset.subset_insert
code: @[simp] theorem subset_insert (a : α) (s : Finset α) : s ⊆ insert a s 
goal: s ⊆ insert a s

full_name: Finset.insert_subset_insert
code: @[gcongr]
theorem insert_subset_insert (a : α) {s t : Finset α} (h : s ⊆ t) : insert a s ⊆ insert a t 
goal: insert a s ⊆ insert a t

full_name: Finset.insert_subset_insert_iff
code: @[simp] lemma insert_subset_insert_iff (ha : a ∉ s) : insert a s ⊆ insert a t ↔ s ⊆ t 
goal: insert a s ⊆ insert a t ↔ s ⊆ t

full_name: Finset.insert_inj
code: theorem insert_inj (ha : a ∉ s) : insert a s = insert b s ↔ a = b 
goal: insert a s = insert b s ↔ a = b

full_name: Finset.insert_inj_on
code: theorem insert_inj_on (s : Finset α) : Set.InjOn (fun a => insert a s) sᶜ 
goal: Set.InjOn (fun a => insert a s) (↑s)ᶜ

full_name: Finset.ssubset_iff
code: theorem ssubset_iff : s ⊂ t ↔ ∃ a ∉ s, insert a s ⊆ t 
goal: s ⊂ t ↔ ∃ a ∉ s, insert a s ⊆ t

full_name: Finset.ssubset_insert
code: theorem ssubset_insert (h : a ∉ s) : s ⊂ insert a s 
goal: s ⊂ insert a s

full_name: Finset.cons_induction
code: @[elab_as_elim]
theorem cons_induction {α : Type*} {p : Finset α → Prop} (empty : p ∅)
    (cons : ∀ (a : α) (s : Finset α) (h : a ∉ s), p s → p (cons a s h)) : ∀ s, p s
  
goal: p s

full_name: Finset.cons_induction_on
code: @[elab_as_elim]
theorem cons_induction_on {α : Type*} {p : Finset α → Prop} (s : Finset α) (h₁ : p ∅)
    (h₂ : ∀ ⦃a : α⦄ {s : Finset α} (h : a ∉ s), p s → p (cons a s h)) : p s 
goal: p s

full_name: Finset.induction
code: @[elab_as_elim]
protected theorem induction {α : Type*} {p : Finset α → Prop} [DecidableEq α] (empty : p ∅)
    (insert : ∀ ⦃a : α⦄ {s : Finset α}, a ∉ s → p s → p (insert a s)) : ∀ s, p s 
goal: p s

full_name: Finset.induction_on
code: /-- To prove a proposition about an arbitrary `Finset α`,
it suffices to prove it for the empty `Finset`,
and to show that if it holds for some `Finset α`,
then it holds for the `Finset` obtained by inserting a new element.
-/
@[elab_as_elim]
protected theorem induction_on {α : Type*} {p : Finset α → Prop} [DecidableEq α] (s : Finset α)
    (empty : p ∅) (insert : ∀ ⦃a : α⦄ {s : Finset α}, a ∉ s → p s → p (insert a s)) : p s 
goal: p s

full_name: Finset.induction_on'
code: /-- To prove a proposition about `S : Finset α`,
it suffices to prove it for the empty `Finset`,
and to show that if it holds for some `Finset α ⊆ S`,
then it holds for the `Finset` obtained by inserting a new element of `S`.
-/
@[elab_as_elim]
theorem induction_on' {α : Type*} {p : Finset α → Prop} [DecidableEq α] (S : Finset α) (h₁ : p ∅)
    (h₂ : ∀ {a s}, a ∈ S → s ⊆ S → a ∉ s → p s → p (insert a s)) : p S 
goal: p S

full_name: Finset.Nonempty.cons_induction
code: /-- To prove a proposition about a nonempty `s : Finset α`, it suffices to show it holds for all
singletons and that if it holds for nonempty `t : Finset α`, then it also holds for the `Finset`
obtained by inserting an element in `t`. -/
@[elab_as_elim]
theorem Nonempty.cons_induction {α : Type*} {p : ∀ s : Finset α, s.Nonempty → Prop}
    (singleton : ∀ a, p {a} (singleton_nonempty _))
    (cons : ∀ a s (h : a ∉ s) (hs), p s hs → p (Finset.cons a s h) (nonempty_cons h))
    {s : Finset α} (hs : s.Nonempty) : p s hs 
goal: p s hs

full_name: Finset.Nonempty.exists_cons_eq
code: lemma Nonempty.exists_cons_eq {α} {s : Finset α} (hs : s.Nonempty) : ∃ t a ha, cons a t ha = s 
goal: ∃ t a, ∃ (ha : a ∉ t), Finset.cons a t ha = s

full_name: Finset.subtypeInsertEquivOption
code: /-- Inserting an element to a finite set is equivalent to the option type. -/
def subtypeInsertEquivOption {t : Finset α} {x : α} (h : x ∉ t) :
    { i // i ∈ insert x t } ≃ Option { i // i ∈ t } 
goal: { i // i ∈ insert x t } ≃ Option { i // i ∈ t }

full_name: Finset.disjoint_insert_left
code: @[simp]
theorem disjoint_insert_left : Disjoint (insert a s) t ↔ a ∉ t ∧ Disjoint s t 
goal: Disjoint (insert a s) t ↔ a ∉ t ∧ Disjoint s t

full_name: Finset.disjoint_insert_right
code: @[simp]
theorem disjoint_insert_right : Disjoint s (insert a t) ↔ a ∉ s ∧ Disjoint s t 
goal: Disjoint s (insert a t) ↔ a ∉ s ∧ Disjoint s t

full_name: Finset.instUnion
code: /-- `s ∪ t` is the set such that `a ∈ s ∪ t` iff `a ∈ s` or `a ∈ t`. -/
instance : Union (Finset α) 
goal: Union (Finset α)

full_name: Finset.instInter
code: /-- `s ∩ t` is the set such that `a ∈ s ∩ t` iff `a ∈ s` and `a ∈ t`. -/
instance : Inter (Finset α) 
goal: Inter (Finset α)

full_name: Finset.instLattice
code: instance : Lattice (Finset α) 
goal: Lattice (Finset α)

full_name: Finset.sup_eq_union
code: @[simp]
theorem sup_eq_union : (Sup.sup : Finset α → Finset α → Finset α) = Union.union 
goal: Sup.sup = Union.union

full_name: Finset.inf_eq_inter
code: @[simp]
theorem inf_eq_inter : (Inf.inf : Finset α → Finset α → Finset α) = Inter.inter 
goal: Inf.inf = Inter.inter

full_name: Finset.disjoint_iff_inter_eq_empty
code: theorem disjoint_iff_inter_eq_empty : Disjoint s t ↔ s ∩ t = ∅ 
goal: Disjoint s t ↔ s ∩ t = ∅

full_name: Finset.decidableDisjoint
code: instance decidableDisjoint (U V : Finset α) : Decidable (Disjoint U V) 
goal: Decidable (Disjoint U V)

full_name: Finset.union_val_nd
code: theorem union_val_nd (s t : Finset α) : (s ∪ t).1 = ndunion s.1 t.1 
goal: (s ∪ t).val = s.val.ndunion t.val

full_name: Finset.union_val
code: @[simp]
theorem union_val (s t : Finset α) : (s ∪ t).1 = s.1 ∪ t.1 
goal: (s ∪ t).val = s.val ∪ t.val

full_name: Finset.mem_union
code: @[simp]
theorem mem_union : a ∈ s ∪ t ↔ a ∈ s ∨ a ∈ t 
goal: a ∈ s ∪ t ↔ a ∈ s ∨ a ∈ t

full_name: Finset.disjUnion_eq_union
code: @[simp]
theorem disjUnion_eq_union (s t h) : @disjUnion α s t h = s ∪ t 
goal: s.disjUnion t h = s ∪ t

full_name: Finset.mem_union_left
code: theorem mem_union_left (t : Finset α) (h : a ∈ s) : a ∈ s ∪ t 
goal: a ∈ s ∪ t

full_name: Finset.mem_union_right
code: theorem mem_union_right (s : Finset α) (h : a ∈ t) : a ∈ s ∪ t 
goal: a ∈ s ∪ t

full_name: Finset.forall_mem_union
code: theorem forall_mem_union {p : α → Prop} : (∀ a ∈ s ∪ t, p a) ↔ (∀ a ∈ s, p a) ∧ ∀ a ∈ t, p a 
goal: (∀ a ∈ s ∪ t, p a) ↔ (∀ a ∈ s, p a) ∧ ∀ a ∈ t, p a

full_name: Finset.not_mem_union
code: theorem not_mem_union : a ∉ s ∪ t ↔ a ∉ s ∧ a ∉ t 
goal: a ∉ s ∪ t ↔ a ∉ s ∧ a ∉ t

full_name: Finset.coe_union
code: @[simp, norm_cast]
theorem coe_union (s₁ s₂ : Finset α) : ↑(s₁ ∪ s₂) = (s₁ ∪ s₂ : Set α) 
goal: ↑(s₁ ∪ s₂) = ↑s₁ ∪ ↑s₂

full_name: Finset.union_subset
code: theorem union_subset (hs : s ⊆ u) : t ⊆ u → s ∪ t ⊆ u 
goal: t ⊆ u → s ∪ t ⊆ u

full_name: Finset.subset_union_left
code: theorem subset_union_left {s₁ s₂ : Finset α} : s₁ ⊆ s₁ ∪ s₂ 
goal: s₁ ⊆ s₁ ∪ s₂

full_name: Finset.subset_union_right
code: theorem subset_union_right {s₁ s₂ : Finset α} : s₂ ⊆ s₁ ∪ s₂ 
goal: s₂ ⊆ s₁ ∪ s₂

full_name: Finset.union_subset_union
code: @[gcongr]
theorem union_subset_union (hsu : s ⊆ u) (htv : t ⊆ v) : s ∪ t ⊆ u ∪ v 
goal: s ∪ t ⊆ u ∪ v

full_name: Finset.union_subset_union_left
code: @[gcongr]
theorem union_subset_union_left (h : s₁ ⊆ s₂) : s₁ ∪ t ⊆ s₂ ∪ t 
goal: s₁ ∪ t ⊆ s₂ ∪ t

full_name: Finset.union_subset_union_right
code: @[gcongr]
theorem union_subset_union_right (h : t₁ ⊆ t₂) : s ∪ t₁ ⊆ s ∪ t₂ 
goal: s ∪ t₁ ⊆ s ∪ t₂

full_name: Finset.union_comm
code: theorem union_comm (s₁ s₂ : Finset α) : s₁ ∪ s₂ = s₂ ∪ s₁ 
goal: s₁ ∪ s₂ = s₂ ∪ s₁

full_name: Finset.instCommutativeUnion
code: instance : Std.Commutative (α := Finset α) (· ∪ ·) 
goal: Std.Commutative fun x x_1 => x ∪ x_1

full_name: Finset.union_assoc
code: @[simp]
theorem union_assoc (s₁ s₂ s₃ : Finset α) : s₁ ∪ s₂ ∪ s₃ = s₁ ∪ (s₂ ∪ s₃) 
goal: s₁ ∪ s₂ ∪ s₃ = s₁ ∪ (s₂ ∪ s₃)

full_name: Finset.instAssociativeUnion
code: instance : Std.Associative (α := Finset α) (· ∪ ·) 
goal: Std.Associative fun x x_1 => x ∪ x_1

full_name: Finset.union_idempotent
code: @[simp]
theorem union_idempotent (s : Finset α) : s ∪ s = s 
goal: s ∪ s = s

full_name: Finset.instIdempotentOpUnion
code: instance : Std.IdempotentOp (α := Finset α) (· ∪ ·) 
goal: Std.IdempotentOp fun x x_1 => x ∪ x_1

full_name: Finset.union_subset_left
code: theorem union_subset_left (h : s ∪ t ⊆ u) : s ⊆ u 
goal: s ⊆ u

full_name: Finset.union_subset_right
code: theorem union_subset_right {s t u : Finset α} (h : s ∪ t ⊆ u) : t ⊆ u 
goal: t ⊆ u

full_name: Finset.union_left_comm
code: theorem union_left_comm (s t u : Finset α) : s ∪ (t ∪ u) = t ∪ (s ∪ u) 
goal: s ∪ (t ∪ u) = t ∪ (s ∪ u)

full_name: Finset.union_right_comm
code: theorem union_right_comm (s t u : Finset α) : s ∪ t ∪ u = s ∪ u ∪ t 
goal: s ∪ t ∪ u = s ∪ u ∪ t

full_name: Finset.union_self
code: theorem union_self (s : Finset α) : s ∪ s = s 
goal: s ∪ s = s

full_name: Finset.union_empty
code: @[simp]
theorem union_empty (s : Finset α) : s ∪ ∅ = s 
goal: s ∪ ∅ = s

full_name: Finset.empty_union
code: @[simp]
theorem empty_union (s : Finset α) : ∅ ∪ s = s 
goal: ∅ ∪ s = s

full_name: Finset.Nonempty.inl
code: @[aesop unsafe apply (rule_sets := [finsetNonempty])]
theorem Nonempty.inl {s t : Finset α} (h : s.Nonempty) : (s ∪ t).Nonempty 
goal: (s ∪ t).Nonempty

full_name: Finset.Nonempty.inr
code: @[aesop unsafe apply (rule_sets := [finsetNonempty])]
theorem Nonempty.inr {s t : Finset α} (h : t.Nonempty) : (s ∪ t).Nonempty 
goal: (s ∪ t).Nonempty

full_name: Finset.insert_eq
code: theorem insert_eq (a : α) (s : Finset α) : insert a s = {a} ∪ s 
goal: insert a s = {a} ∪ s

full_name: Finset.insert_union
code: @[simp]
theorem insert_union (a : α) (s t : Finset α) : insert a s ∪ t = insert a (s ∪ t) 
goal: insert a s ∪ t = insert a (s ∪ t)

full_name: Finset.union_insert
code: @[simp]
theorem union_insert (a : α) (s t : Finset α) : s ∪ insert a t = insert a (s ∪ t) 
goal: s ∪ insert a t = insert a (s ∪ t)

full_name: Finset.insert_union_distrib
code: theorem insert_union_distrib (a : α) (s t : Finset α) :
    insert a (s ∪ t) = insert a s ∪ insert a t 
goal: insert a (s ∪ t) = insert a s ∪ insert a t

full_name: Finset.union_eq_left
code: @[simp] lemma union_eq_left : s ∪ t = s ↔ t ⊆ s 
goal: s ∪ t = s ↔ t ⊆ s

full_name: Finset.left_eq_union
code: @[simp] lemma left_eq_union : s = s ∪ t ↔ t ⊆ s 
goal: s = s ∪ t ↔ t ⊆ s

full_name: Finset.union_eq_right
code: @[simp] lemma union_eq_right : s ∪ t = t ↔ s ⊆ t 
goal: s ∪ t = t ↔ s ⊆ t

full_name: Finset.right_eq_union
code: @[simp] lemma right_eq_union : s = t ∪ s ↔ t ⊆ s 
goal: s = t ∪ s ↔ t ⊆ s

full_name: Finset.union_congr_left
code: theorem union_congr_left (ht : t ⊆ s ∪ u) (hu : u ⊆ s ∪ t) : s ∪ t = s ∪ u 
goal: s ∪ t = s ∪ u

full_name: Finset.union_congr_right
code: theorem union_congr_right (hs : s ⊆ t ∪ u) (ht : t ⊆ s ∪ u) : s ∪ u = t ∪ u 
goal: s ∪ u = t ∪ u

full_name: Finset.union_eq_union_iff_left
code: theorem union_eq_union_iff_left : s ∪ t = s ∪ u ↔ t ⊆ s ∪ u ∧ u ⊆ s ∪ t 
goal: s ∪ t = s ∪ u ↔ t ⊆ s ∪ u ∧ u ⊆ s ∪ t

full_name: Finset.union_eq_union_iff_right
code: theorem union_eq_union_iff_right : s ∪ u = t ∪ u ↔ s ⊆ t ∪ u ∧ t ⊆ s ∪ u 
goal: s ∪ u = t ∪ u ↔ s ⊆ t ∪ u ∧ t ⊆ s ∪ u

full_name: Finset.disjoint_union_left
code: @[simp]
theorem disjoint_union_left : Disjoint (s ∪ t) u ↔ Disjoint s u ∧ Disjoint t u 
goal: Disjoint (s ∪ t) u ↔ Disjoint s u ∧ Disjoint t u

full_name: Finset.disjoint_union_right
code: @[simp]
theorem disjoint_union_right : Disjoint s (t ∪ u) ↔ Disjoint s t ∧ Disjoint s u 
goal: Disjoint s (t ∪ u) ↔ Disjoint s t ∧ Disjoint s u

full_name: Finset.induction_on_union
code: /-- To prove a relation on pairs of `Finset X`, it suffices to show that it is
  * symmetric,
  * it holds when one of the `Finset`s is empty,
  * it holds for pairs of singletons,
  * if it holds for `[a, c]` and for `[b, c]`, then it holds for `[a ∪ b, c]`.
-/
theorem induction_on_union (P : Finset α → Finset α → Prop) (symm : ∀ {a b}, P a b → P b a)
    (empty_right : ∀ {a}, P a ∅) (singletons : ∀ {a b}, P {a} {b})
    (union_of : ∀ {a b c}, P a c → P b c → P (a ∪ b) c) : ∀ a b, P a b 
goal: P a b

full_name: Finset.inter_val_nd
code: theorem inter_val_nd (s₁ s₂ : Finset α) : (s₁ ∩ s₂).1 = ndinter s₁.1 s₂.1 
goal: (s₁ ∩ s₂).val = s₁.val.ndinter s₂.val

full_name: Finset.inter_val
code: @[simp]
theorem inter_val (s₁ s₂ : Finset α) : (s₁ ∩ s₂).1 = s₁.1 ∩ s₂.1 
goal: (s₁ ∩ s₂).val = s₁.val ∩ s₂.val

full_name: Finset.mem_inter
code: @[simp]
theorem mem_inter {a : α} {s₁ s₂ : Finset α} : a ∈ s₁ ∩ s₂ ↔ a ∈ s₁ ∧ a ∈ s₂ 
goal: a ∈ s₁ ∩ s₂ ↔ a ∈ s₁ ∧ a ∈ s₂

full_name: Finset.mem_of_mem_inter_left
code: theorem mem_of_mem_inter_left {a : α} {s₁ s₂ : Finset α} (h : a ∈ s₁ ∩ s₂) : a ∈ s₁ 
goal: a ∈ s₁

full_name: Finset.mem_of_mem_inter_right
code: theorem mem_of_mem_inter_right {a : α} {s₁ s₂ : Finset α} (h : a ∈ s₁ ∩ s₂) : a ∈ s₂ 
goal: a ∈ s₂

full_name: Finset.mem_inter_of_mem
code: theorem mem_inter_of_mem {a : α} {s₁ s₂ : Finset α} : a ∈ s₁ → a ∈ s₂ → a ∈ s₁ ∩ s₂ 
goal: a ∈ s₁ → a ∈ s₂ → a ∈ s₁ ∩ s₂

full_name: Finset.inter_subset_left
code: theorem inter_subset_left {s₁ s₂ : Finset α} : s₁ ∩ s₂ ⊆ s₁ 
goal: s₁ ∩ s₂ ⊆ s₁

full_name: Finset.inter_subset_right
code: theorem inter_subset_right {s₁ s₂ : Finset α} : s₁ ∩ s₂ ⊆ s₂ 
goal: s₁ ∩ s₂ ⊆ s₂

full_name: Finset.subset_inter
code: theorem subset_inter {s₁ s₂ u : Finset α} : s₁ ⊆ s₂ → s₁ ⊆ u → s₁ ⊆ s₂ ∩ u 
goal: s₁ ⊆ s₂ → s₁ ⊆ u → s₁ ⊆ s₂ ∩ u

full_name: Finset.coe_inter
code: @[simp, norm_cast]
theorem coe_inter (s₁ s₂ : Finset α) : ↑(s₁ ∩ s₂) = (s₁ ∩ s₂ : Set α) 
goal: ↑(s₁ ∩ s₂) = ↑s₁ ∩ ↑s₂

full_name: Finset.union_inter_cancel_left
code: @[simp]
theorem union_inter_cancel_left {s t : Finset α} : (s ∪ t) ∩ s = s 
goal: (s ∪ t) ∩ s = s

full_name: Finset.union_inter_cancel_right
code: @[simp]
theorem union_inter_cancel_right {s t : Finset α} : (s ∪ t) ∩ t = t 
goal: (s ∪ t) ∩ t = t

full_name: Finset.inter_comm
code: theorem inter_comm (s₁ s₂ : Finset α) : s₁ ∩ s₂ = s₂ ∩ s₁ 
goal: s₁ ∩ s₂ = s₂ ∩ s₁

full_name: Finset.inter_assoc
code: @[simp]
theorem inter_assoc (s₁ s₂ s₃ : Finset α) : s₁ ∩ s₂ ∩ s₃ = s₁ ∩ (s₂ ∩ s₃) 
goal: s₁ ∩ s₂ ∩ s₃ = s₁ ∩ (s₂ ∩ s₃)

full_name: Finset.inter_left_comm
code: theorem inter_left_comm (s₁ s₂ s₃ : Finset α) : s₁ ∩ (s₂ ∩ s₃) = s₂ ∩ (s₁ ∩ s₃) 
goal: s₁ ∩ (s₂ ∩ s₃) = s₂ ∩ (s₁ ∩ s₃)

full_name: Finset.inter_right_comm
code: theorem inter_right_comm (s₁ s₂ s₃ : Finset α) : s₁ ∩ s₂ ∩ s₃ = s₁ ∩ s₃ ∩ s₂ 
goal: s₁ ∩ s₂ ∩ s₃ = s₁ ∩ s₃ ∩ s₂

full_name: Finset.inter_self
code: @[simp]
theorem inter_self (s : Finset α) : s ∩ s = s 
goal: s ∩ s = s

full_name: Finset.inter_empty
code: @[simp]
theorem inter_empty (s : Finset α) : s ∩ ∅ = ∅ 
goal: s ∩ ∅ = ∅

full_name: Finset.empty_inter
code: @[simp]
theorem empty_inter (s : Finset α) : ∅ ∩ s = ∅ 
goal: ∅ ∩ s = ∅

full_name: Finset.inter_union_self
code: @[simp]
theorem inter_union_self (s t : Finset α) : s ∩ (t ∪ s) = s 
goal: s ∩ (t ∪ s) = s

full_name: Finset.insert_inter_of_mem
code: @[simp]
theorem insert_inter_of_mem {s₁ s₂ : Finset α} {a : α} (h : a ∈ s₂) :
    insert a s₁ ∩ s₂ = insert a (s₁ ∩ s₂) 
goal: insert a s₁ ∩ s₂ = insert a (s₁ ∩ s₂)

full_name: Finset.inter_insert_of_mem
code: @[simp]
theorem inter_insert_of_mem {s₁ s₂ : Finset α} {a : α} (h : a ∈ s₁) :
    s₁ ∩ insert a s₂ = insert a (s₁ ∩ s₂) 
goal: s₁ ∩ insert a s₂ = insert a (s₁ ∩ s₂)

full_name: Finset.insert_inter_of_not_mem
code: @[simp]
theorem insert_inter_of_not_mem {s₁ s₂ : Finset α} {a : α} (h : a ∉ s₂) :
    insert a s₁ ∩ s₂ = s₁ ∩ s₂ 
goal: insert a s₁ ∩ s₂ = s₁ ∩ s₂

full_name: Finset.inter_insert_of_not_mem
code: @[simp]
theorem inter_insert_of_not_mem {s₁ s₂ : Finset α} {a : α} (h : a ∉ s₁) :
    s₁ ∩ insert a s₂ = s₁ ∩ s₂ 
goal: s₁ ∩ insert a s₂ = s₁ ∩ s₂

full_name: Finset.singleton_inter_of_mem
code: @[simp]
theorem singleton_inter_of_mem {a : α} {s : Finset α} (H : a ∈ s) : {a} ∩ s = {a} 
goal: {a} ∩ s = {a}

full_name: Finset.singleton_inter_of_not_mem
code: @[simp]
theorem singleton_inter_of_not_mem {a : α} {s : Finset α} (H : a ∉ s) : {a} ∩ s = ∅ 
goal: {a} ∩ s = ∅

full_name: Finset.inter_singleton_of_mem
code: @[simp]
theorem inter_singleton_of_mem {a : α} {s : Finset α} (h : a ∈ s) : s ∩ {a} = {a} 
goal: s ∩ {a} = {a}

full_name: Finset.inter_singleton_of_not_mem
code: @[simp]
theorem inter_singleton_of_not_mem {a : α} {s : Finset α} (h : a ∉ s) : s ∩ {a} = ∅ 
goal: s ∩ {a} = ∅

full_name: Finset.inter_subset_inter
code: @[mono, gcongr]
theorem inter_subset_inter {x y s t : Finset α} (h : x ⊆ y) (h' : s ⊆ t) : x ∩ s ⊆ y ∩ t 
goal: x ∩ s ⊆ y ∩ t

full_name: Finset.inter_subset_inter_left
code: @[gcongr]
theorem inter_subset_inter_left (h : t ⊆ u) : s ∩ t ⊆ s ∩ u 
goal: s ∩ t ⊆ s ∩ u

full_name: Finset.inter_subset_inter_right
code: @[gcongr]
theorem inter_subset_inter_right (h : s ⊆ t) : s ∩ u ⊆ t ∩ u 
goal: s ∩ u ⊆ t ∩ u

full_name: Finset.inter_subset_union
code: theorem inter_subset_union : s ∩ t ⊆ s ∪ t 
goal: s ∩ t ⊆ s ∪ t

full_name: Finset.instDistribLattice
code: instance : DistribLattice (Finset α) 
goal: DistribLattice (Finset α)

full_name: Finset.union_left_idem
code: @[simp]
theorem union_left_idem (s t : Finset α) : s ∪ (s ∪ t) = s ∪ t 
goal: s ∪ (s ∪ t) = s ∪ t

full_name: Finset.union_right_idem
code: theorem union_right_idem (s t : Finset α) : s ∪ t ∪ t = s ∪ t 
goal: s ∪ t ∪ t = s ∪ t

full_name: Finset.inter_left_idem
code: @[simp]
theorem inter_left_idem (s t : Finset α) : s ∩ (s ∩ t) = s ∩ t 
goal: s ∩ (s ∩ t) = s ∩ t

full_name: Finset.inter_right_idem
code: theorem inter_right_idem (s t : Finset α) : s ∩ t ∩ t = s ∩ t 
goal: s ∩ t ∩ t = s ∩ t

full_name: Finset.inter_union_distrib_left
code: theorem inter_union_distrib_left (s t u : Finset α) : s ∩ (t ∪ u) = s ∩ t ∪ s ∩ u 
goal: s ∩ (t ∪ u) = s ∩ t ∪ s ∩ u

full_name: Finset.union_inter_distrib_right
code: theorem union_inter_distrib_right (s t u : Finset α) : (s ∪ t) ∩ u = s ∩ u ∪ t ∩ u 
goal: (s ∪ t) ∩ u = s ∩ u ∪ t ∩ u

full_name: Finset.union_inter_distrib_left
code: theorem union_inter_distrib_left (s t u : Finset α) : s ∪ t ∩ u = (s ∪ t) ∩ (s ∪ u) 
goal: s ∪ t ∩ u = (s ∪ t) ∩ (s ∪ u)

full_name: Finset.inter_union_distrib_right
code: theorem inter_union_distrib_right (s t u : Finset α) : s ∩ t ∪ u = (s ∪ u) ∩ (t ∪ u) 
goal: s ∩ t ∪ u = (s ∪ u) ∩ (t ∪ u)

full_name: Finset.union_union_distrib_left
code: theorem union_union_distrib_left (s t u : Finset α) : s ∪ (t ∪ u) = s ∪ t ∪ (s ∪ u) 
goal: s ∪ (t ∪ u) = s ∪ t ∪ (s ∪ u)

full_name: Finset.union_union_distrib_right
code: theorem union_union_distrib_right (s t u : Finset α) : s ∪ t ∪ u = s ∪ u ∪ (t ∪ u) 
goal: s ∪ t ∪ u = s ∪ u ∪ (t ∪ u)

full_name: Finset.inter_inter_distrib_left
code: theorem inter_inter_distrib_left (s t u : Finset α) : s ∩ (t ∩ u) = s ∩ t ∩ (s ∩ u) 
goal: s ∩ (t ∩ u) = s ∩ t ∩ (s ∩ u)

full_name: Finset.inter_inter_distrib_right
code: theorem inter_inter_distrib_right (s t u : Finset α) : s ∩ t ∩ u = s ∩ u ∩ (t ∩ u) 
goal: s ∩ t ∩ u = s ∩ u ∩ (t ∩ u)

full_name: Finset.union_union_union_comm
code: theorem union_union_union_comm (s t u v : Finset α) : s ∪ t ∪ (u ∪ v) = s ∪ u ∪ (t ∪ v) 
goal: s ∪ t ∪ (u ∪ v) = s ∪ u ∪ (t ∪ v)

full_name: Finset.inter_inter_inter_comm
code: theorem inter_inter_inter_comm (s t u v : Finset α) : s ∩ t ∩ (u ∩ v) = s ∩ u ∩ (t ∩ v) 
goal: s ∩ t ∩ (u ∩ v) = s ∩ u ∩ (t ∩ v)

full_name: Finset.union_eq_empty
code: lemma union_eq_empty : s ∪ t = ∅ ↔ s = ∅ ∧ t = ∅ 
goal: s ∪ t = ∅ ↔ s = ∅ ∧ t = ∅

full_name: Finset.union_subset_iff
code: theorem union_subset_iff : s ∪ t ⊆ u ↔ s ⊆ u ∧ t ⊆ u 
goal: s ∪ t ⊆ u ↔ s ⊆ u ∧ t ⊆ u

full_name: Finset.subset_inter_iff
code: theorem subset_inter_iff : s ⊆ t ∩ u ↔ s ⊆ t ∧ s ⊆ u 
goal: s ⊆ t ∩ u ↔ s ⊆ t ∧ s ⊆ u

full_name: Finset.inter_eq_left
code: @[simp] lemma inter_eq_left : s ∩ t = s ↔ s ⊆ t 
goal: s ∩ t = s ↔ s ⊆ t

full_name: Finset.inter_eq_right
code: @[simp] lemma inter_eq_right : t ∩ s = s ↔ s ⊆ t 
goal: t ∩ s = s ↔ s ⊆ t

full_name: Finset.inter_congr_left
code: theorem inter_congr_left (ht : s ∩ u ⊆ t) (hu : s ∩ t ⊆ u) : s ∩ t = s ∩ u 
goal: s ∩ t = s ∩ u

full_name: Finset.inter_congr_right
code: theorem inter_congr_right (hs : t ∩ u ⊆ s) (ht : s ∩ u ⊆ t) : s ∩ u = t ∩ u 
goal: s ∩ u = t ∩ u

full_name: Finset.inter_eq_inter_iff_left
code: theorem inter_eq_inter_iff_left : s ∩ t = s ∩ u ↔ s ∩ u ⊆ t ∧ s ∩ t ⊆ u 
goal: s ∩ t = s ∩ u ↔ s ∩ u ⊆ t ∧ s ∩ t ⊆ u

full_name: Finset.inter_eq_inter_iff_right
code: theorem inter_eq_inter_iff_right : s ∩ u = t ∩ u ↔ t ∩ u ⊆ s ∧ s ∩ u ⊆ t 
goal: s ∩ u = t ∩ u ↔ t ∩ u ⊆ s ∧ s ∩ u ⊆ t

full_name: Finset.ite_subset_union
code: theorem ite_subset_union (s s' : Finset α) (P : Prop) [Decidable P] : ite P s s' ⊆ s ∪ s' 
goal: (if P then s else s') ⊆ s ∪ s'

full_name: Finset.inter_subset_ite
code: theorem inter_subset_ite (s s' : Finset α) (P : Prop) [Decidable P] : s ∩ s' ⊆ ite P s s' 
goal: s ∩ s' ⊆ if P then s else s'

full_name: Finset.not_disjoint_iff_nonempty_inter
code: theorem not_disjoint_iff_nonempty_inter : ¬Disjoint s t ↔ (s ∩ t).Nonempty 
goal: ¬Disjoint s t ↔ (s ∩ t).Nonempty

full_name: Finset.disjoint_or_nonempty_inter
code: theorem disjoint_or_nonempty_inter (s t : Finset α) : Disjoint s t ∨ (s ∩ t).Nonempty 
goal: Disjoint s t ∨ (s ∩ t).Nonempty

full_name: Finset.isDirected_le
code: instance isDirected_le : IsDirected (Finset α) (· ≤ ·) 
goal: IsDirected (Finset α) fun x x_1 => x ≤ x_1

full_name: Finset.isDirected_subset
code: instance isDirected_subset : IsDirected (Finset α) (· ⊆ ·) 
goal: IsDirected (Finset α) fun x x_1 => x ⊆ x_1

full_name: Finset.erase
code: /-- `erase s a` is the set `s - {a}`, that is, the elements of `s` which are
  not equal to `a`. -/
def erase (s : Finset α) (a : α) : Finset α 
goal: Finset α

full_name: Finset.erase_val
code: @[simp]
theorem erase_val (s : Finset α) (a : α) : (erase s a).1 = s.1.erase a 
goal: (s.erase a).val = s.val.erase a

full_name: Finset.mem_erase
code: @[simp]
theorem mem_erase {a b : α} {s : Finset α} : a ∈ erase s b ↔ a ≠ b ∧ a ∈ s 
goal: a ∈ s.erase b ↔ a ≠ b ∧ a ∈ s

full_name: Finset.not_mem_erase
code: theorem not_mem_erase (a : α) (s : Finset α) : a ∉ erase s a 
goal: a ∉ s.erase a

full_name: Finset.erase_empty
code: @[simp]
theorem erase_empty (a : α) : erase ∅ a = ∅ 
goal: ∅.erase a = ∅

full_name: Finset.Nontrivial.erase_nonempty
code: protected lemma Nontrivial.erase_nonempty (hs : s.Nontrivial) : (s.erase a).Nonempty 
goal: (s.erase a).Nonempty

full_name: Finset.erase_nonempty
code: @[simp] lemma erase_nonempty (ha : a ∈ s) : (s.erase a).Nonempty ↔ s.Nontrivial 
goal: (s.erase a).Nonempty ↔ s.Nontrivial

full_name: Finset.erase_singleton
code: @[simp]
theorem erase_singleton (a : α) : ({a} : Finset α).erase a = ∅ 
goal: {a}.erase a = ∅

full_name: Finset.ne_of_mem_erase
code: theorem ne_of_mem_erase : b ∈ erase s a → b ≠ a 
goal: b ∈ s.erase a → b ≠ a

full_name: Finset.mem_of_mem_erase
code: theorem mem_of_mem_erase : b ∈ erase s a → b ∈ s 
goal: b ∈ s.erase a → b ∈ s

full_name: Finset.mem_erase_of_ne_of_mem
code: theorem mem_erase_of_ne_of_mem : a ≠ b → a ∈ s → a ∈ erase s b 
goal: a ≠ b → a ∈ s → a ∈ s.erase b

full_name: Finset.eq_of_mem_of_not_mem_erase
code: /-- An element of `s` that is not an element of `erase s a` must be`a`. -/
theorem eq_of_mem_of_not_mem_erase (hs : b ∈ s) (hsa : b ∉ s.erase a) : b = a 
goal: b = a

full_name: Finset.erase_eq_of_not_mem
code: @[simp]
theorem erase_eq_of_not_mem {a : α} {s : Finset α} (h : a ∉ s) : erase s a = s 
goal: s.erase a = s

full_name: Finset.erase_eq_self
code: @[simp]
theorem erase_eq_self : s.erase a = s ↔ a ∉ s 
goal: s.erase a = s ↔ a ∉ s

full_name: Finset.erase_insert_eq_erase
code: @[simp]
theorem erase_insert_eq_erase (s : Finset α) (a : α) : (insert a s).erase a = s.erase a 
goal: (insert a s).erase a = s.erase a

full_name: Finset.erase_insert
code: theorem erase_insert {a : α} {s : Finset α} (h : a ∉ s) : erase (insert a s) a = s 
goal: (insert a s).erase a = s

full_name: Finset.erase_insert_of_ne
code: theorem erase_insert_of_ne {a b : α} {s : Finset α} (h : a ≠ b) :
    erase (insert a s) b = insert a (erase s b) 
goal: (insert a s).erase b = insert a (s.erase b)

full_name: Finset.erase_cons_of_ne
code: theorem erase_cons_of_ne {a b : α} {s : Finset α} (ha : a ∉ s) (hb : a ≠ b) :
    erase (cons a s ha) b = cons a (erase s b) fun h => ha <| erase_subset _ _ h 
goal: (Finset.cons a s ha).erase b = Finset.cons a (s.erase b) ⋯

full_name: Finset.insert_erase
code: @[simp] theorem insert_erase (h : a ∈ s) : insert a (erase s a) = s 
goal: insert a (s.erase a) = s

full_name: Finset.erase_eq_iff_eq_insert
code: lemma erase_eq_iff_eq_insert (hs : a ∈ s) (ht : a ∉ t) : erase s a = t ↔ s = insert a t 
goal: s.erase a = t ↔ s = insert a t

full_name: Finset.insert_erase_invOn
code: lemma insert_erase_invOn :
    Set.InvOn (insert a) (fun s ↦ erase s a) {s : Finset α | a ∈ s} {s : Finset α | a ∉ s} 
goal: Set.InvOn (insert a) (fun s => s.erase a) {s | a ∈ s} {s | a ∉ s}

full_name: Finset.erase_subset_erase
code: theorem erase_subset_erase (a : α) {s t : Finset α} (h : s ⊆ t) : erase s a ⊆ erase t a 
goal: s.erase a ⊆ t.erase a

full_name: Finset.erase_subset
code: theorem erase_subset (a : α) (s : Finset α) : erase s a ⊆ s 
goal: s.erase a ⊆ s

full_name: Finset.subset_erase
code: theorem subset_erase {a : α} {s t : Finset α} : s ⊆ t.erase a ↔ s ⊆ t ∧ a ∉ s 
goal: s ⊆ t.erase a ↔ s ⊆ t ∧ a ∉ s

full_name: Finset.coe_erase
code: @[simp, norm_cast]
theorem coe_erase (a : α) (s : Finset α) : ↑(erase s a) = (s \ {a} : Set α) 
goal: ↑(s.erase a) = ↑s \ {a}

full_name: Finset.erase_ssubset
code: theorem erase_ssubset {a : α} {s : Finset α} (h : a ∈ s) : s.erase a ⊂ s 
goal: s.erase a ⊂ s

full_name: Finset.ssubset_iff_exists_subset_erase
code: theorem ssubset_iff_exists_subset_erase {s t : Finset α} : s ⊂ t ↔ ∃ a ∈ t, s ⊆ t.erase a 
goal: s ⊂ t ↔ ∃ a ∈ t, s ⊆ t.erase a

full_name: Finset.erase_ssubset_insert
code: theorem erase_ssubset_insert (s : Finset α) (a : α) : s.erase a ⊂ insert a s 
goal: s.erase a ⊂ insert a s

full_name: Finset.erase_ne_self
code: theorem erase_ne_self : s.erase a ≠ s ↔ a ∈ s 
goal: s.erase a ≠ s ↔ a ∈ s

full_name: Finset.erase_cons
code: theorem erase_cons {s : Finset α} {a : α} (h : a ∉ s) : (s.cons a h).erase a = s 
goal: (Finset.cons a s h).erase a = s

full_name: Finset.erase_idem
code: theorem erase_idem {a : α} {s : Finset α} : erase (erase s a) a = erase s a 
goal: (s.erase a).erase a = s.erase a

full_name: Finset.erase_right_comm
code: theorem erase_right_comm {a b : α} {s : Finset α} : erase (erase s a) b = erase (erase s b) a 
goal: (s.erase a).erase b = (s.erase b).erase a

full_name: Finset.subset_insert_iff
code: theorem subset_insert_iff {a : α} {s t : Finset α} : s ⊆ insert a t ↔ erase s a ⊆ t 
goal: s ⊆ insert a t ↔ s.erase a ⊆ t

full_name: Finset.erase_insert_subset
code: theorem erase_insert_subset (a : α) (s : Finset α) : erase (insert a s) a ⊆ s 
goal: (insert a s).erase a ⊆ s

full_name: Finset.insert_erase_subset
code: theorem insert_erase_subset (a : α) (s : Finset α) : s ⊆ insert a (erase s a) 
goal: s ⊆ insert a (s.erase a)

full_name: Finset.subset_insert_iff_of_not_mem
code: theorem subset_insert_iff_of_not_mem (h : a ∉ s) : s ⊆ insert a t ↔ s ⊆ t 
goal: s ⊆ insert a t ↔ s ⊆ t

full_name: Finset.erase_subset_iff_of_mem
code: theorem erase_subset_iff_of_mem (h : a ∈ t) : s.erase a ⊆ t ↔ s ⊆ t 
goal: s.erase a ⊆ t ↔ s ⊆ t

full_name: Finset.erase_inj
code: theorem erase_inj {x y : α} (s : Finset α) (hx : x ∈ s) : s.erase x = s.erase y ↔ x = y 
goal: s.erase x = s.erase y ↔ x = y

full_name: Finset.erase_injOn
code: theorem erase_injOn (s : Finset α) : Set.InjOn s.erase s 
goal: Set.InjOn s.erase ↑s

full_name: Finset.erase_injOn'
code: theorem erase_injOn' (a : α) : { s : Finset α | a ∈ s }.InjOn fun s => erase s a 
goal: Set.InjOn (fun s => s.erase a) {s | a ∈ s}

full_name: Finset.Nontrivial.exists_cons_eq
code: lemma Nontrivial.exists_cons_eq {s : Finset α} (hs : s.Nontrivial) :
    ∃ t a ha b hb hab, (cons b t hb).cons a (mem_cons.not.2 <| not_or_intro hab ha) = s 
goal: ∃ t a, ∃ (ha : a ∉ t), ∃ b, ∃ (hb : b ∉ t) (hab : ¬a = b), Finset.cons a (Finset.cons b t hb) ⋯ = s

full_name: Finset.instSDiff
code: /-- `s \ t` is the set consisting of the elements of `s` that are not in `t`. -/
instance : SDiff (Finset α) 
goal: SDiff (Finset α)

full_name: Finset.sdiff_val
code: @[simp]
theorem sdiff_val (s₁ s₂ : Finset α) : (s₁ \ s₂).val = s₁.val - s₂.val 
goal: (s₁ \ s₂).val = s₁.val - s₂.val

full_name: Finset.mem_sdiff
code: @[simp]
theorem mem_sdiff : a ∈ s \ t ↔ a ∈ s ∧ a ∉ t 
goal: a ∈ s \ t ↔ a ∈ s ∧ a ∉ t

full_name: Finset.inter_sdiff_self
code: @[simp]
theorem inter_sdiff_self (s₁ s₂ : Finset α) : s₁ ∩ (s₂ \ s₁) = ∅ 
goal: s₁ ∩ (s₂ \ s₁) = ∅

full_name: Finset.instGeneralizedBooleanAlgebra
code: instance : GeneralizedBooleanAlgebra (Finset α) 
goal: GeneralizedBooleanAlgebra (Finset α)

full_name: Finset.not_mem_sdiff_of_mem_right
code: theorem not_mem_sdiff_of_mem_right (h : a ∈ t) : a ∉ s \ t 
goal: a ∉ s \ t

full_name: Finset.not_mem_sdiff_of_not_mem_left
code: theorem not_mem_sdiff_of_not_mem_left (h : a ∉ s) : a ∉ s \ t 
goal: a ∉ s \ t

full_name: Finset.union_sdiff_of_subset
code: theorem union_sdiff_of_subset (h : s ⊆ t) : s ∪ t \ s = t 
goal: s ∪ t \ s = t

full_name: Finset.sdiff_union_of_subset
code: theorem sdiff_union_of_subset {s₁ s₂ : Finset α} (h : s₁ ⊆ s₂) : s₂ \ s₁ ∪ s₁ = s₂ 
goal: s₂ \ s₁ ∪ s₁ = s₂

full_name: Finset.inter_sdiff_assoc
code: lemma inter_sdiff_assoc (s t u : Finset α) : (s ∩ t) \ u = s ∩ (t \ u) 
goal: (s ∩ t) \ u = s ∩ (t \ u)

full_name: Finset.inter_sdiff
code: @[deprecated inter_sdiff_assoc (since := "2024-05-01")]
theorem inter_sdiff (s t u : Finset α) : s ∩ (t \ u) = (s ∩ t) \ u 
goal: s ∩ (t \ u) = (s ∩ t) \ u

full_name: Finset.sdiff_inter_self
code: @[simp]
theorem sdiff_inter_self (s₁ s₂ : Finset α) : s₂ \ s₁ ∩ s₁ = ∅ 
goal: s₂ \ s₁ ∩ s₁ = ∅

full_name: Finset.sdiff_self
code: protected theorem sdiff_self (s₁ : Finset α) : s₁ \ s₁ = ∅ 
goal: s₁ \ s₁ = ∅

full_name: Finset.sdiff_inter_distrib_right
code: theorem sdiff_inter_distrib_right (s t u : Finset α) : s \ (t ∩ u) = s \ t ∪ s \ u 
goal: s \ (t ∩ u) = s \ t ∪ s \ u

full_name: Finset.sdiff_inter_self_left
code: @[simp]
theorem sdiff_inter_self_left (s t : Finset α) : s \ (s ∩ t) = s \ t 
goal: s \ (s ∩ t) = s \ t

full_name: Finset.sdiff_inter_self_right
code: @[simp]
theorem sdiff_inter_self_right (s t : Finset α) : s \ (t ∩ s) = s \ t 
goal: s \ (t ∩ s) = s \ t

full_name: Finset.sdiff_empty
code: @[simp]
theorem sdiff_empty : s \ ∅ = s 
goal: s \ ∅ = s

full_name: Finset.sdiff_subset_sdiff
code: @[mono, gcongr]
theorem sdiff_subset_sdiff (hst : s ⊆ t) (hvu : v ⊆ u) : s \ u ⊆ t \ v 
goal: s \ u ⊆ t \ v

full_name: Finset.coe_sdiff
code: @[simp, norm_cast]
theorem coe_sdiff (s₁ s₂ : Finset α) : ↑(s₁ \ s₂) = (s₁ \ s₂ : Set α) 
goal: ↑(s₁ \ s₂) = ↑s₁ \ ↑s₂

full_name: Finset.union_sdiff_self_eq_union
code: @[simp]
theorem union_sdiff_self_eq_union : s ∪ t \ s = s ∪ t 
goal: s ∪ t \ s = s ∪ t

full_name: Finset.sdiff_union_self_eq_union
code: @[simp]
theorem sdiff_union_self_eq_union : s \ t ∪ t = s ∪ t 
goal: s \ t ∪ t = s ∪ t

full_name: Finset.union_sdiff_left
code: theorem union_sdiff_left (s t : Finset α) : (s ∪ t) \ s = t \ s 
goal: (s ∪ t) \ s = t \ s

full_name: Finset.union_sdiff_right
code: theorem union_sdiff_right (s t : Finset α) : (s ∪ t) \ t = s \ t 
goal: (s ∪ t) \ t = s \ t

full_name: Finset.union_sdiff_cancel_left
code: theorem union_sdiff_cancel_left (h : Disjoint s t) : (s ∪ t) \ s = t 
goal: (s ∪ t) \ s = t

full_name: Finset.union_sdiff_cancel_right
code: theorem union_sdiff_cancel_right (h : Disjoint s t) : (s ∪ t) \ t = s 
goal: (s ∪ t) \ t = s

full_name: Finset.union_sdiff_symm
code: theorem union_sdiff_symm : s ∪ t \ s = t ∪ s \ t 
goal: s ∪ t \ s = t ∪ s \ t

full_name: Finset.sdiff_union_inter
code: theorem sdiff_union_inter (s t : Finset α) : s \ t ∪ s ∩ t = s 
goal: s \ t ∪ s ∩ t = s

full_name: Finset.sdiff_idem
code: theorem sdiff_idem (s t : Finset α) : (s \ t) \ t = s \ t 
goal: (s \ t) \ t = s \ t

full_name: Finset.subset_sdiff
code: theorem subset_sdiff : s ⊆ t \ u ↔ s ⊆ t ∧ Disjoint s u 
goal: s ⊆ t \ u ↔ s ⊆ t ∧ Disjoint s u

full_name: Finset.sdiff_eq_empty_iff_subset
code: @[simp]
theorem sdiff_eq_empty_iff_subset : s \ t = ∅ ↔ s ⊆ t 
goal: s \ t = ∅ ↔ s ⊆ t

full_name: Finset.sdiff_nonempty
code: theorem sdiff_nonempty : (s \ t).Nonempty ↔ ¬s ⊆ t 
goal: (s \ t).Nonempty ↔ ¬s ⊆ t

full_name: Finset.empty_sdiff
code: @[simp]
theorem empty_sdiff (s : Finset α) : ∅ \ s = ∅ 
goal: ∅ \ s = ∅

full_name: Finset.insert_sdiff_of_not_mem
code: theorem insert_sdiff_of_not_mem (s : Finset α) {t : Finset α} {x : α} (h : x ∉ t) :
    insert x s \ t = insert x (s \ t) 
goal: insert x s \ t = insert x (s \ t)

full_name: Finset.insert_sdiff_of_mem
code: theorem insert_sdiff_of_mem (s : Finset α) {x : α} (h : x ∈ t) : insert x s \ t = s \ t 
goal: insert x s \ t = s \ t

full_name: Finset.insert_sdiff_cancel
code: @[simp] lemma insert_sdiff_cancel (ha : a ∉ s) : insert a s \ s = {a} 
goal: insert a s \ s = {a}

full_name: Finset.insert_sdiff_insert
code: @[simp]
theorem insert_sdiff_insert (s t : Finset α) (x : α) : insert x s \ insert x t = s \ insert x t 
goal: insert x s \ insert x t = s \ insert x t

full_name: Finset.insert_sdiff_insert'
code: lemma insert_sdiff_insert' (hab : a ≠ b) (ha : a ∉ s) : insert a s \ insert b s = {a} 
goal: insert a s \ insert b s = {a}

full_name: Finset.erase_sdiff_erase
code: lemma erase_sdiff_erase (hab : a ≠ b) (hb : b ∈ s) : s.erase a \ s.erase b = {b} 
goal: s.erase a \ s.erase b = {b}

full_name: Finset.cons_sdiff_cons
code: lemma cons_sdiff_cons (hab : a ≠ b) (ha hb) : s.cons a ha \ s.cons b hb = {a} 
goal: Finset.cons a s ha \ Finset.cons b s hb = {a}

full_name: Finset.sdiff_insert_of_not_mem
code: theorem sdiff_insert_of_not_mem {x : α} (h : x ∉ s) (t : Finset α) : s \ insert x t = s \ t 
goal: s \ insert x t = s \ t

full_name: Finset.sdiff_subset
code: @[simp] theorem sdiff_subset {s t : Finset α} : s \ t ⊆ s 
goal: s \ t ⊆ s

full_name: Finset.sdiff_ssubset
code: theorem sdiff_ssubset (h : t ⊆ s) (ht : t.Nonempty) : s \ t ⊂ s 
goal: s \ t ⊂ s

full_name: Finset.union_sdiff_distrib
code: theorem union_sdiff_distrib (s₁ s₂ t : Finset α) : (s₁ ∪ s₂) \ t = s₁ \ t ∪ s₂ \ t 
goal: (s₁ ∪ s₂) \ t = s₁ \ t ∪ s₂ \ t

full_name: Finset.sdiff_union_distrib
code: theorem sdiff_union_distrib (s t₁ t₂ : Finset α) : s \ (t₁ ∪ t₂) = s \ t₁ ∩ (s \ t₂) 
goal: s \ (t₁ ∪ t₂) = s \ t₁ ∩ (s \ t₂)

full_name: Finset.union_sdiff_self
code: theorem union_sdiff_self (s t : Finset α) : (s ∪ t) \ t = s \ t 
goal: (s ∪ t) \ t = s \ t

full_name: Finset.sdiff_singleton_eq_erase
code: theorem sdiff_singleton_eq_erase (a : α) (s : Finset α) : s \ singleton a = erase s a 
goal: s \ {a} = s.erase a

full_name: Finset.erase_eq
code: theorem erase_eq (s : Finset α) (a : α) : s.erase a = s \ {a} 
goal: s.erase a = s \ {a}

full_name: Finset.disjoint_erase_comm
code: theorem disjoint_erase_comm : Disjoint (s.erase a) t ↔ Disjoint s (t.erase a) 
goal: Disjoint (s.erase a) t ↔ Disjoint s (t.erase a)

full_name: Finset.disjoint_insert_erase
code: lemma disjoint_insert_erase (ha : a ∉ t) : Disjoint (s.erase a) (insert a t) ↔ Disjoint s t 
goal: Disjoint (s.erase a) (insert a t) ↔ Disjoint s t

full_name: Finset.disjoint_erase_insert
code: lemma disjoint_erase_insert (ha : a ∉ s) : Disjoint (insert a s) (t.erase a) ↔ Disjoint s t 
goal: Disjoint (insert a s) (t.erase a) ↔ Disjoint s t

full_name: Finset.disjoint_of_erase_left
code: theorem disjoint_of_erase_left (ha : a ∉ t) (hst : Disjoint (s.erase a) t) : Disjoint s t 
goal: Disjoint s t

full_name: Finset.disjoint_of_erase_right
code: theorem disjoint_of_erase_right (ha : a ∉ s) (hst : Disjoint s (t.erase a)) : Disjoint s t 
goal: Disjoint s t

full_name: Finset.inter_erase
code: theorem inter_erase (a : α) (s t : Finset α) : s ∩ t.erase a = (s ∩ t).erase a 
goal: s ∩ t.erase a = (s ∩ t).erase a

full_name: Finset.erase_inter
code: @[simp]
theorem erase_inter (a : α) (s t : Finset α) : s.erase a ∩ t = (s ∩ t).erase a 
goal: s.erase a ∩ t = (s ∩ t).erase a

full_name: Finset.erase_sdiff_comm
code: theorem erase_sdiff_comm (s t : Finset α) (a : α) : s.erase a \ t = (s \ t).erase a 
goal: s.erase a \ t = (s \ t).erase a

full_name: Finset.insert_union_comm
code: theorem insert_union_comm (s t : Finset α) (a : α) : insert a s ∪ t = s ∪ insert a t 
goal: insert a s ∪ t = s ∪ insert a t

full_name: Finset.erase_inter_comm
code: theorem erase_inter_comm (s t : Finset α) (a : α) : s.erase a ∩ t = s ∩ t.erase a 
goal: s.erase a ∩ t = s ∩ t.erase a

full_name: Finset.erase_union_distrib
code: theorem erase_union_distrib (s t : Finset α) (a : α) : (s ∪ t).erase a = s.erase a ∪ t.erase a 
goal: (s ∪ t).erase a = s.erase a ∪ t.erase a

full_name: Finset.insert_inter_distrib
code: theorem insert_inter_distrib (s t : Finset α) (a : α) :
    insert a (s ∩ t) = insert a s ∩ insert a t 
goal: insert a (s ∩ t) = insert a s ∩ insert a t

full_name: Finset.erase_sdiff_distrib
code: theorem erase_sdiff_distrib (s t : Finset α) (a : α) : (s \ t).erase a = s.erase a \ t.erase a 
goal: (s \ t).erase a = s.erase a \ t.erase a

full_name: Finset.erase_union_of_mem
code: theorem erase_union_of_mem (ha : a ∈ t) (s : Finset α) : s.erase a ∪ t = s ∪ t 
goal: s.erase a ∪ t = s ∪ t

full_name: Finset.union_erase_of_mem
code: theorem union_erase_of_mem (ha : a ∈ s) (t : Finset α) : s ∪ t.erase a = s ∪ t 
goal: s ∪ t.erase a = s ∪ t

full_name: Finset.sdiff_singleton_eq_self
code: @[simp]
theorem sdiff_singleton_eq_self (ha : a ∉ s) : s \ {a} = s 
goal: s \ {a} = s

full_name: Finset.Nontrivial.sdiff_singleton_nonempty
code: theorem Nontrivial.sdiff_singleton_nonempty {c : α} {s : Finset α} (hS : s.Nontrivial) :
    (s \ {c}).Nonempty 
goal: (s \ {c}).Nonempty

full_name: Finset.sdiff_sdiff_left'
code: theorem sdiff_sdiff_left' (s t u : Finset α) : (s \ t) \ u = s \ t ∩ (s \ u) 
goal: (s \ t) \ u = s \ t ∩ (s \ u)

full_name: Finset.sdiff_union_sdiff_cancel
code: theorem sdiff_union_sdiff_cancel (hts : t ⊆ s) (hut : u ⊆ t) : s \ t ∪ t \ u = s \ u 
goal: s \ t ∪ t \ u = s \ u

full_name: Finset.sdiff_union_erase_cancel
code: theorem sdiff_union_erase_cancel (hts : t ⊆ s) (ha : a ∈ t) : s \ t ∪ t.erase a = s.erase a 
goal: s \ t ∪ t.erase a = s.erase a

full_name: Finset.sdiff_sdiff_eq_sdiff_union
code: theorem sdiff_sdiff_eq_sdiff_union (h : u ⊆ s) : s \ (t \ u) = s \ t ∪ u 
goal: s \ (t \ u) = s \ t ∪ u

full_name: Finset.sdiff_insert
code: theorem sdiff_insert (s t : Finset α) (x : α) : s \ insert x t = (s \ t).erase x 
goal: s \ insert x t = (s \ t).erase x

full_name: Finset.sdiff_insert_insert_of_mem_of_not_mem
code: theorem sdiff_insert_insert_of_mem_of_not_mem {s t : Finset α} {x : α} (hxs : x ∈ s) (hxt : x ∉ t) :
    insert x (s \ insert x t) = s \ t 
goal: insert x (s \ insert x t) = s \ t

full_name: Finset.sdiff_erase
code: theorem sdiff_erase (h : a ∈ s) : s \ t.erase a = insert a (s \ t) 
goal: s \ t.erase a = insert a (s \ t)

full_name: Finset.sdiff_erase_self
code: theorem sdiff_erase_self (ha : a ∈ s) : s \ s.erase a = {a} 
goal: s \ s.erase a = {a}

full_name: Finset.sdiff_sdiff_self_left
code: theorem sdiff_sdiff_self_left (s t : Finset α) : s \ (s \ t) = s ∩ t 
goal: s \ (s \ t) = s ∩ t

full_name: Finset.sdiff_sdiff_eq_self
code: theorem sdiff_sdiff_eq_self (h : t ⊆ s) : s \ (s \ t) = t 
goal: s \ (s \ t) = t

full_name: Finset.sdiff_eq_sdiff_iff_inter_eq_inter
code: theorem sdiff_eq_sdiff_iff_inter_eq_inter {s t₁ t₂ : Finset α} :
    s \ t₁ = s \ t₂ ↔ s ∩ t₁ = s ∩ t₂ 
goal: s \ t₁ = s \ t₂ ↔ s ∩ t₁ = s ∩ t₂

full_name: Finset.union_eq_sdiff_union_sdiff_union_inter
code: theorem union_eq_sdiff_union_sdiff_union_inter (s t : Finset α) : s ∪ t = s \ t ∪ t \ s ∪ s ∩ t 
goal: s ∪ t = s \ t ∪ t \ s ∪ s ∩ t

full_name: Finset.erase_eq_empty_iff
code: theorem erase_eq_empty_iff (s : Finset α) (a : α) : s.erase a = ∅ ↔ s = ∅ ∨ s = {a} 
goal: s.erase a = ∅ ↔ s = ∅ ∨ s = {a}

full_name: Finset.sdiff_disjoint
code: theorem sdiff_disjoint : Disjoint (t \ s) s 
goal: Disjoint (t \ s) s

full_name: Finset.disjoint_sdiff
code: theorem disjoint_sdiff : Disjoint s (t \ s) 
goal: Disjoint s (t \ s)

full_name: Finset.disjoint_sdiff_inter
code: theorem disjoint_sdiff_inter (s t : Finset α) : Disjoint (s \ t) (s ∩ t) 
goal: Disjoint (s \ t) (s ∩ t)

full_name: Finset.sdiff_eq_self_iff_disjoint
code: theorem sdiff_eq_self_iff_disjoint : s \ t = s ↔ Disjoint s t 
goal: s \ t = s ↔ Disjoint s t

full_name: Finset.sdiff_eq_self_of_disjoint
code: theorem sdiff_eq_self_of_disjoint (h : Disjoint s t) : s \ t = s 
goal: s \ t = s

full_name: Finset.mem_symmDiff
code: theorem mem_symmDiff : a ∈ s ∆ t ↔ a ∈ s ∧ a ∉ t ∨ a ∈ t ∧ a ∉ s 
goal: a ∈ symmDiff s t ↔ a ∈ s ∧ a ∉ t ∨ a ∈ t ∧ a ∉ s

full_name: Finset.coe_symmDiff
code: @[simp, norm_cast]
theorem coe_symmDiff : (↑(s ∆ t) : Set α) = (s : Set α) ∆ t 
goal: ↑(symmDiff s t) = symmDiff ↑s ↑t

full_name: Finset.symmDiff_eq_empty
code: @[simp] lemma symmDiff_eq_empty : s ∆ t = ∅ ↔ s = t 
goal: symmDiff s t = ∅ ↔ s = t

full_name: Finset.symmDiff_nonempty
code: @[simp] lemma symmDiff_nonempty : (s ∆ t).Nonempty ↔ s ≠ t 
goal: (symmDiff s t).Nonempty ↔ s ≠ t

full_name: Finset.attach
code: /-- `attach s` takes the elements of `s` and forms a new set of elements of the subtype
`{x // x ∈ s}`. -/
def attach (s : Finset α) : Finset { x // x ∈ s } 
goal: Finset { x // x ∈ s }

full_name: Finset.sizeOf_lt_sizeOf_of_mem
code: theorem sizeOf_lt_sizeOf_of_mem [SizeOf α] {x : α} {s : Finset α} (hx : x ∈ s) :
    SizeOf.sizeOf x < SizeOf.sizeOf s 
goal: sizeOf x < sizeOf s

full_name: Finset.attach_val
code: @[simp]
theorem attach_val (s : Finset α) : s.attach.1 = s.1.attach 
goal: s.attach.val = s.val.attach

full_name: Finset.mem_attach
code: @[simp]
theorem mem_attach (s : Finset α) : ∀ x, x ∈ s.attach 
goal: x ∈ s.attach

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

full_name: Finset.attach_nonempty_iff
code: @[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem attach_nonempty_iff {s : Finset α} : s.attach.Nonempty ↔ s.Nonempty 
goal: s.attach.Nonempty ↔ s.Nonempty

full_name: Finset.attach_eq_empty_iff
code: @[simp]
theorem attach_eq_empty_iff {s : Finset α} : s.attach = ∅ ↔ s = ∅ 
goal: s.attach = ∅ ↔ s = ∅

full_name: Finset.decidableDforallFinset
code: instance decidableDforallFinset {p : ∀ a ∈ s, Prop} [_hp : ∀ (a) (h : a ∈ s), Decidable (p a h)] :
    Decidable (∀ (a) (h : a ∈ s), p a h) 
goal: Decidable (∀ (a : α) (h : a ∈ s), p a h)

full_name: Finset.instDecidableRelSubset
code: instance instDecidableRelSubset [DecidableEq α] : @DecidableRel (Finset α) (· ⊆ ·) 
goal: DecidableRel fun x x_1 => x ⊆ x_1

full_name: Finset.instDecidableRelSSubset
code: instance instDecidableRelSSubset [DecidableEq α] : @DecidableRel (Finset α) (· ⊂ ·) 
goal: DecidableRel fun x x_1 => x ⊂ x_1

full_name: Finset.instDecidableLE
code: instance instDecidableLE [DecidableEq α] : @DecidableRel (Finset α) (· ≤ ·) 
goal: DecidableRel fun x x_1 => x ≤ x_1

full_name: Finset.instDecidableLT
code: instance instDecidableLT [DecidableEq α] : @DecidableRel (Finset α) (· < ·) 
goal: DecidableRel fun x x_1 => x < x_1

full_name: Finset.decidableDExistsFinset
code: instance decidableDExistsFinset {p : ∀ a ∈ s, Prop} [_hp : ∀ (a) (h : a ∈ s), Decidable (p a h)] :
    Decidable (∃ (a : _) (h : a ∈ s), p a h) 
goal: Decidable (∃ a, ∃ (h : a ∈ s), p a h)

full_name: Finset.decidableExistsAndFinset
code: instance decidableExistsAndFinset {p : α → Prop} [_hp : ∀ (a), Decidable (p a)] :
    Decidable (∃ a ∈ s, p a) 
goal: Decidable (∃ a ∈ s, p a)

full_name: Finset.decidableExistsAndFinsetCoe
code: instance decidableExistsAndFinsetCoe {p : α → Prop} [DecidablePred p] :
    Decidable (∃ a ∈ (s : Set α), p a) 
goal: Decidable (∃ a ∈ ↑s, p a)

full_name: Finset.decidableEqPiFinset
code: /-- decidable equality for functions whose domain is bounded by finsets -/
instance decidableEqPiFinset {β : α → Type*} [_h : ∀ a, DecidableEq (β a)] :
    DecidableEq (∀ a ∈ s, β a) 
goal: DecidableEq ((a : α) → a ∈ s → β a)

full_name: Finset.filter
code: /-- `Finset.filter p s` is the set of elements of `s` that satisfy `p`.

For example, one can use `s.filter (· ∈ t)` to get the intersection of `s` with `t : Set α`
as a `Finset α` (when a `DecidablePred (· ∈ t)` instance is available). -/
def filter (s : Finset α) : Finset α 
goal: Finset α

full_name: Finset.filter_val
code: @[simp]
theorem filter_val (s : Finset α) : (filter p s).1 = s.1.filter p 
goal: (Finset.filter p s).val = Multiset.filter p s.val

full_name: Finset.filter_subset
code: @[simp]
theorem filter_subset (s : Finset α) : s.filter p ⊆ s 
goal: Finset.filter p s ⊆ s

full_name: Finset.mem_filter
code: @[simp]
theorem mem_filter {s : Finset α} {a : α} : a ∈ s.filter p ↔ a ∈ s ∧ p a 
goal: a ∈ Finset.filter p s ↔ a ∈ s ∧ p a

full_name: Finset.mem_of_mem_filter
code: theorem mem_of_mem_filter {s : Finset α} (x : α) (h : x ∈ s.filter p) : x ∈ s 
goal: x ∈ s

full_name: Finset.filter_ssubset
code: theorem filter_ssubset {s : Finset α} : s.filter p ⊂ s ↔ ∃ x ∈ s, ¬p x 
goal: Finset.filter p s ⊂ s ↔ ∃ x ∈ s, ¬p x

full_name: Finset.filter_filter
code: theorem filter_filter (s : Finset α) : (s.filter p).filter q = s.filter fun a => p a ∧ q a 
goal: Finset.filter q (Finset.filter p s) = Finset.filter (fun a => p a ∧ q a) s

full_name: Finset.filter_comm
code: theorem filter_comm (s : Finset α) : (s.filter p).filter q = (s.filter q).filter p 
goal: Finset.filter q (Finset.filter p s) = Finset.filter p (Finset.filter q s)

full_name: Finset.filter_congr_decidable
code: theorem filter_congr_decidable (s : Finset α) (p : α → Prop) (h : DecidablePred p)
    [DecidablePred p] : @filter α p h s = s.filter p 
goal: Finset.filter p s = Finset.filter p s

full_name: Finset.filter_True
code: @[simp]
theorem filter_True {h} (s : Finset α) : @filter _ (fun _ => True) h s = s 
goal: Finset.filter (fun x => True) s = s

full_name: Finset.filter_False
code: @[simp]
theorem filter_False {h} (s : Finset α) : @filter _ (fun _ => False) h s = ∅ 
goal: Finset.filter (fun x => False) s = ∅

full_name: Finset.filter_eq_self
code: lemma filter_eq_self : s.filter p = s ↔ ∀ x ∈ s, p x 
goal: Finset.filter p s = s ↔ ∀ x ∈ s, p x

full_name: Finset.filter_eq_empty_iff
code: theorem filter_eq_empty_iff : s.filter p = ∅ ↔ ∀ ⦃x⦄, x ∈ s → ¬p x 
goal: Finset.filter p s = ∅ ↔ ∀ ⦃x : α⦄, x ∈ s → ¬p x

full_name: Finset.filter_nonempty_iff
code: theorem filter_nonempty_iff : (s.filter p).Nonempty ↔ ∃ a ∈ s, p a 
goal: (Finset.filter p s).Nonempty ↔ ∃ a ∈ s, p a

full_name: Finset.filter_true_of_mem
code: /-- If all elements of a `Finset` satisfy the predicate `p`, `s.filter p` is `s`. -/
theorem filter_true_of_mem (h : ∀ x ∈ s, p x) : s.filter p = s 
goal: Finset.filter p s = s

full_name: Finset.filter_false_of_mem
code: /-- If all elements of a `Finset` fail to satisfy the predicate `p`, `s.filter p` is `∅`. -/
theorem filter_false_of_mem (h : ∀ x ∈ s, ¬p x) : s.filter p = ∅ 
goal: Finset.filter p s = ∅

full_name: Finset.filter_const
code: @[simp]
theorem filter_const (p : Prop) [Decidable p] (s : Finset α) :
    (s.filter fun _a => p) = if p then s else ∅ 
goal: Finset.filter (fun _a => p) s = if p then s else ∅

full_name: Finset.filter_congr
code: theorem filter_congr {s : Finset α} (H : ∀ x ∈ s, p x ↔ q x) : filter p s = filter q s 
goal: Finset.filter p s = Finset.filter q s

full_name: Finset.filter_empty
code: @[simp]
theorem filter_empty : filter p ∅ = ∅ 
goal: Finset.filter p ∅ = ∅

full_name: Finset.filter_subset_filter
code: @[gcongr]
theorem filter_subset_filter {s t : Finset α} (h : s ⊆ t) : s.filter p ⊆ t.filter p 
goal: Finset.filter p s ⊆ Finset.filter p t

full_name: Finset.monotone_filter_left
code: theorem monotone_filter_left : Monotone (filter p) 
goal: Monotone (Finset.filter p)

full_name: Finset.monotone_filter_right
code: theorem monotone_filter_right (s : Finset α) ⦃p q : α → Prop⦄ [DecidablePred p] [DecidablePred q]
    (h : p ≤ q) : s.filter p ⊆ s.filter q 
goal: Finset.filter p s ⊆ Finset.filter q s

full_name: Finset.coe_filter
code: @[simp, norm_cast]
theorem coe_filter (s : Finset α) : ↑(s.filter p) = ({ x ∈ ↑s | p x } : Set α) 
goal: ↑(Finset.filter p s) = {x | x ∈ s ∧ p x}

full_name: Finset.subset_coe_filter_of_subset_forall
code: theorem subset_coe_filter_of_subset_forall (s : Finset α) {t : Set α} (h₁ : t ⊆ s)
    (h₂ : ∀ x ∈ t, p x) : t ⊆ s.filter p 
goal: t ⊆ ↑(Finset.filter p s)

full_name: Finset.filter_singleton
code: theorem filter_singleton (a : α) : filter p {a} = if p a then {a} else ∅ 
goal: Finset.filter p {a} = if p a then {a} else ∅

full_name: Finset.filter_cons_of_pos
code: theorem filter_cons_of_pos (a : α) (s : Finset α) (ha : a ∉ s) (hp : p a) :
    filter p (cons a s ha) = cons a (filter p s) (mem_filter.not.mpr <| mt And.left ha) 
goal: Finset.filter p (Finset.cons a s ha) = Finset.cons a (Finset.filter p s) ⋯

full_name: Finset.filter_cons_of_neg
code: theorem filter_cons_of_neg (a : α) (s : Finset α) (ha : a ∉ s) (hp : ¬p a) :
    filter p (cons a s ha) = filter p s 
goal: Finset.filter p (Finset.cons a s ha) = Finset.filter p s

full_name: Finset.disjoint_filter
code: theorem disjoint_filter {s : Finset α} {p q : α → Prop} [DecidablePred p] [DecidablePred q] :
    Disjoint (s.filter p) (s.filter q) ↔ ∀ x ∈ s, p x → ¬q x 
goal: Disjoint (Finset.filter p s) (Finset.filter q s) ↔ ∀ x ∈ s, p x → ¬q x

full_name: Finset.disjoint_filter_filter
code: theorem disjoint_filter_filter {s t : Finset α}
    {p q : α → Prop} [DecidablePred p] [DecidablePred q] :
    Disjoint s t → Disjoint (s.filter p) (t.filter q) 
goal: Disjoint s t → Disjoint (Finset.filter p s) (Finset.filter q t)

full_name: Finset.disjoint_filter_filter'
code: theorem disjoint_filter_filter' (s t : Finset α)
    {p q : α → Prop} [DecidablePred p] [DecidablePred q] (h : Disjoint p q) :
    Disjoint (s.filter p) (t.filter q) 
goal: Disjoint (Finset.filter p s) (Finset.filter q t)

full_name: Finset.disjoint_filter_filter_neg
code: theorem disjoint_filter_filter_neg (s t : Finset α) (p : α → Prop)
    [DecidablePred p] [∀ x, Decidable (¬p x)] :
    Disjoint (s.filter p) (t.filter fun a => ¬p a) 
goal: Disjoint (Finset.filter p s) (Finset.filter (fun a => ¬p a) t)

full_name: Finset.filter_disj_union
code: theorem filter_disj_union (s : Finset α) (t : Finset α) (h : Disjoint s t) :
    filter p (disjUnion s t h) = (filter p s).disjUnion (filter p t) (disjoint_filter_filter h) 
goal: Finset.filter p (s.disjUnion t h) = (Finset.filter p s).disjUnion (Finset.filter p t) ⋯

full_name: Set.pairwiseDisjoint_filter
code: lemma _root_.Set.pairwiseDisjoint_filter [DecidableEq β] (f : α → β) (s : Set β) (t : Finset α) :
    s.PairwiseDisjoint fun x ↦ t.filter (f · = x) 
goal: s.PairwiseDisjoint fun x => Finset.filter (fun x_1 => f x_1 = x) t

full_name: Finset.filter_cons
code: theorem filter_cons {a : α} (s : Finset α) (ha : a ∉ s) :
    filter p (cons a s ha) =
      (if p a then {a} else ∅ : Finset α).disjUnion (filter p s)
        (by
          split_ifs
          · rw [disjoint_singleton_left]
            exact mem_filter.not.mpr <| mt And.left ha
          · exact disjoint_empty_left _) 
goal: Finset.filter p (Finset.cons a s ha) = (if p a then {a} else ∅).disjUnion (Finset.filter p s) ⋯

full_name: Finset.filter_union
code: theorem filter_union (s₁ s₂ : Finset α) : (s₁ ∪ s₂).filter p = s₁.filter p ∪ s₂.filter p 
goal: Finset.filter p (s₁ ∪ s₂) = Finset.filter p s₁ ∪ Finset.filter p s₂

full_name: Finset.filter_union_right
code: theorem filter_union_right (s : Finset α) : s.filter p ∪ s.filter q = s.filter fun x => p x ∨ q x 
goal: Finset.filter p s ∪ Finset.filter q s = Finset.filter (fun x => p x ∨ q x) s

full_name: Finset.filter_mem_eq_inter
code: theorem filter_mem_eq_inter {s t : Finset α} [∀ i, Decidable (i ∈ t)] :
    (s.filter fun i => i ∈ t) = s ∩ t 
goal: Finset.filter (fun i => i ∈ t) s = s ∩ t

full_name: Finset.filter_inter_distrib
code: theorem filter_inter_distrib (s t : Finset α) : (s ∩ t).filter p = s.filter p ∩ t.filter p 
goal: Finset.filter p (s ∩ t) = Finset.filter p s ∩ Finset.filter p t

full_name: Finset.filter_inter
code: theorem filter_inter (s t : Finset α) : filter p s ∩ t = filter p (s ∩ t) 
goal: Finset.filter p s ∩ t = Finset.filter p (s ∩ t)

full_name: Finset.inter_filter
code: theorem inter_filter (s t : Finset α) : s ∩ filter p t = filter p (s ∩ t) 
goal: s ∩ Finset.filter p t = Finset.filter p (s ∩ t)

full_name: Finset.filter_insert
code: theorem filter_insert (a : α) (s : Finset α) :
    filter p (insert a s) = if p a then insert a (filter p s) else filter p s 
goal: Finset.filter p (insert a s) = if p a then insert a (Finset.filter p s) else Finset.filter p s

full_name: Finset.filter_erase
code: theorem filter_erase (a : α) (s : Finset α) : filter p (erase s a) = erase (filter p s) a 
goal: Finset.filter p (s.erase a) = (Finset.filter p s).erase a

full_name: Finset.filter_or
code: theorem filter_or (s : Finset α) : (s.filter fun a => p a ∨ q a) = s.filter p ∪ s.filter q 
goal: Finset.filter (fun a => p a ∨ q a) s = Finset.filter p s ∪ Finset.filter q s

full_name: Finset.filter_and
code: theorem filter_and (s : Finset α) : (s.filter fun a => p a ∧ q a) = s.filter p ∩ s.filter q 
goal: Finset.filter (fun a => p a ∧ q a) s = Finset.filter p s ∩ Finset.filter q s

full_name: Finset.filter_not
code: theorem filter_not (s : Finset α) : (s.filter fun a => ¬p a) = s \ s.filter p 
goal: Finset.filter (fun a => ¬p a) s = s \ Finset.filter p s

full_name: Finset.filter_and_not
code: lemma filter_and_not (s : Finset α) (p q : α → Prop) [DecidablePred p] [DecidablePred q] :
    s.filter (fun a ↦ p a ∧ ¬ q a) = s.filter p \ s.filter q 
goal: Finset.filter (fun a => p a ∧ ¬q a) s = Finset.filter p s \ Finset.filter q s

full_name: Finset.sdiff_eq_filter
code: theorem sdiff_eq_filter (s₁ s₂ : Finset α) : s₁ \ s₂ = filter (· ∉ s₂) s₁ 
goal: s₁ \ s₂ = Finset.filter (fun x => x ∉ s₂) s₁

full_name: Finset.sdiff_eq_self
code: theorem sdiff_eq_self (s₁ s₂ : Finset α) : s₁ \ s₂ = s₁ ↔ s₁ ∩ s₂ ⊆ ∅ 
goal: s₁ \ s₂ = s₁ ↔ s₁ ∩ s₂ ⊆ ∅

full_name: Finset.subset_union_elim
code: theorem subset_union_elim {s : Finset α} {t₁ t₂ : Set α} (h : ↑s ⊆ t₁ ∪ t₂) :
    ∃ s₁ s₂ : Finset α, s₁ ∪ s₂ = s ∧ ↑s₁ ⊆ t₁ ∧ ↑s₂ ⊆ t₂ \ t₁ 
goal: ∃ s₁ s₂, s₁ ∪ s₂ = s ∧ ↑s₁ ⊆ t₁ ∧ ↑s₂ ⊆ t₂ \ t₁

full_name: Finset.filter_eq
code: /-- After filtering out everything that does not equal a given value, at most that value remains.

  This is equivalent to `filter_eq'` with the equality the other way.
-/
theorem filter_eq [DecidableEq β] (s : Finset β) (b : β) :
    s.filter (Eq b) = ite (b ∈ s) {b} ∅ 
goal: Finset.filter (Eq b) s = if b ∈ s then {b} else ∅

full_name: Finset.filter_eq'
code: /-- After filtering out everything that does not equal a given value, at most that value remains.

  This is equivalent to `filter_eq` with the equality the other way.
-/
theorem filter_eq' [DecidableEq β] (s : Finset β) (b : β) :
    (s.filter fun a => a = b) = ite (b ∈ s) {b} ∅ 
goal: Finset.filter (fun a => a = b) s = if b ∈ s then {b} else ∅

full_name: Finset.filter_ne
code: theorem filter_ne [DecidableEq β] (s : Finset β) (b : β) :
    (s.filter fun a => b ≠ a) = s.erase b 
goal: Finset.filter (fun a => b ≠ a) s = s.erase b

full_name: Finset.filter_ne'
code: theorem filter_ne' [DecidableEq β] (s : Finset β) (b : β) : (s.filter fun a => a ≠ b) = s.erase b 
goal: Finset.filter (fun a => a ≠ b) s = s.erase b

full_name: Finset.filter_inter_filter_neg_eq
code: theorem filter_inter_filter_neg_eq (s t : Finset α) :
    (s.filter p ∩ t.filter fun a => ¬p a) = ∅ 
goal: Finset.filter p s ∩ Finset.filter (fun a => ¬p a) t = ∅

full_name: Finset.filter_union_filter_of_codisjoint
code: theorem filter_union_filter_of_codisjoint (s : Finset α) (h : Codisjoint p q) :
    s.filter p ∪ s.filter q = s 
goal: Finset.filter p s ∪ Finset.filter q s = s

full_name: Finset.filter_union_filter_neg_eq
code: theorem filter_union_filter_neg_eq [∀ x, Decidable (¬p x)] (s : Finset α) :
    (s.filter p ∪ s.filter fun a => ¬p a) = s 
goal: Finset.filter p s ∪ Finset.filter (fun a => ¬p a) s = s

full_name: Finset.filter_inj
code: lemma filter_inj : s.filter p = t.filter p ↔ ∀ ⦃a⦄, p a → (a ∈ s ↔ a ∈ t) 
goal: Finset.filter p s = Finset.filter p t ↔ ∀ ⦃a : α⦄, p a → (a ∈ s ↔ a ∈ t)

full_name: Finset.filter_inj'
code: lemma filter_inj' : s.filter p = s.filter q ↔ ∀ ⦃a⦄, a ∈ s → (p a ↔ q a) 
goal: Finset.filter p s = Finset.filter q s ↔ ∀ ⦃a : α⦄, a ∈ s → (p a ↔ q a)

full_name: Finset.range
code: /-- `range n` is the set of natural numbers less than `n`. -/
def range (n : ℕ) : Finset ℕ 
goal: Finset ℕ

full_name: Finset.range_val
code: @[simp]
theorem range_val (n : ℕ) : (range n).1 = Multiset.range n 
goal: (Finset.range n).val = Multiset.range n

full_name: Finset.mem_range
code: @[simp]
theorem mem_range : m ∈ range n ↔ m < n 
goal: m ∈ Finset.range n ↔ m < n

full_name: Finset.coe_range
code: @[simp, norm_cast]
theorem coe_range (n : ℕ) : (range n : Set ℕ) = Set.Iio n 
goal: ↑(Finset.range n) = Set.Iio n

full_name: Finset.range_zero
code: @[simp]
theorem range_zero : range 0 = ∅ 
goal: Finset.range 0 = ∅

full_name: Finset.range_one
code: @[simp]
theorem range_one : range 1 = {0} 
goal: Finset.range 1 = {0}

full_name: Finset.range_succ
code: theorem range_succ : range (succ n) = insert n (range n) 
goal: Finset.range n.succ = insert n (Finset.range n)

full_name: Finset.range_add_one
code: theorem range_add_one : range (n + 1) = insert n (range n) 
goal: Finset.range (n + 1) = insert n (Finset.range n)

full_name: Finset.not_mem_range_self
code: theorem not_mem_range_self : n ∉ range n 
goal: n ∉ Finset.range n

full_name: Finset.self_mem_range_succ
code: theorem self_mem_range_succ (n : ℕ) : n ∈ range (n + 1) 
goal: n ∈ Finset.range (n + 1)

full_name: Finset.range_subset
code: @[simp]
theorem range_subset {n m} : range n ⊆ range m ↔ n ≤ m 
goal: Finset.range n ⊆ Finset.range m ↔ n ≤ m

full_name: Finset.range_mono
code: theorem range_mono : Monotone range 
goal: Monotone Finset.range

full_name: Finset.mem_range_succ_iff
code: theorem mem_range_succ_iff {a b : ℕ} : a ∈ Finset.range b.succ ↔ a ≤ b 
goal: a ∈ Finset.range b.succ ↔ a ≤ b

full_name: Finset.mem_range_le
code: theorem mem_range_le {n x : ℕ} (hx : x ∈ range n) : x ≤ n 
goal: x ≤ n

full_name: Finset.mem_range_sub_ne_zero
code: theorem mem_range_sub_ne_zero {n x : ℕ} (hx : x ∈ range n) : n - x ≠ 0 
goal: n - x ≠ 0

full_name: Finset.nonempty_range_iff
code: @[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem nonempty_range_iff : (range n).Nonempty ↔ n ≠ 0 
goal: (Finset.range n).Nonempty ↔ n ≠ 0

full_name: Finset.range_eq_empty_iff
code: @[simp]
theorem range_eq_empty_iff : range n = ∅ ↔ n = 0 
goal: Finset.range n = ∅ ↔ n = 0

full_name: Finset.nonempty_range_succ
code: theorem nonempty_range_succ : (range <| n + 1).Nonempty 
goal: (Finset.range (n + 1)).Nonempty

full_name: Finset.range_filter_eq
code: @[simp]
theorem range_filter_eq {n m : ℕ} : (range n).filter (· = m) = if m < n then {m} else ∅ 
goal: Finset.filter (fun x => x = m) (Finset.range n) = if m < n then {m} else ∅

full_name: Finset.range_nontrivial
code: lemma range_nontrivial {n : ℕ} (hn : 1 < n) : (Finset.range n).Nontrivial 
goal: (Finset.range n).Nontrivial

full_name: Finset.exists_mem_empty_iff
code: theorem exists_mem_empty_iff (p : α → Prop) : (∃ x, x ∈ (∅ : Finset α) ∧ p x) ↔ False 
goal: (∃ x ∈ ∅, p x) ↔ False

full_name: Finset.exists_mem_insert
code: theorem exists_mem_insert [DecidableEq α] (a : α) (s : Finset α) (p : α → Prop) :
    (∃ x, x ∈ insert a s ∧ p x) ↔ p a ∨ ∃ x, x ∈ s ∧ p x 
goal: (∃ x ∈ insert a s, p x) ↔ p a ∨ ∃ x ∈ s, p x

full_name: Finset.forall_mem_empty_iff
code: theorem forall_mem_empty_iff (p : α → Prop) : (∀ x, x ∈ (∅ : Finset α) → p x) ↔ True 
goal: (∀ x ∈ ∅, p x) ↔ True

full_name: Finset.forall_mem_insert
code: theorem forall_mem_insert [DecidableEq α] (a : α) (s : Finset α) (p : α → Prop) :
    (∀ x, x ∈ insert a s → p x) ↔ p a ∧ ∀ x, x ∈ s → p x 
goal: (∀ x ∈ insert a s, p x) ↔ p a ∧ ∀ x ∈ s, p x

full_name: Finset.forall_of_forall_insert
code: /-- Useful in proofs by induction. -/
theorem forall_of_forall_insert [DecidableEq α] {p : α → Prop} {a : α} {s : Finset α}
    (H : ∀ x, x ∈ insert a s → p x) (x) (h : x ∈ s) : p x 
goal: p x

full_name: notMemRangeEquiv
code: /-- Equivalence between the set of natural numbers which are `≥ k` and `ℕ`, given by `n → n - k`. -/
def notMemRangeEquiv (k : ℕ) : { n // n ∉ range k } ≃ ℕ 
goal: { n // n ∉ Multiset.range k } ≃ ℕ

full_name: coe_notMemRangeEquiv
code: @[simp]
theorem coe_notMemRangeEquiv (k : ℕ) :
    (notMemRangeEquiv k : { n // n ∉ range k } → ℕ) = fun (i : { n // n ∉ range k }) => i - k 
goal: ⇑(notMemRangeEquiv k) = fun i => ↑i - k

full_name: coe_notMemRangeEquiv_symm
code: @[simp]
theorem coe_notMemRangeEquiv_symm (k : ℕ) :
    ((notMemRangeEquiv k).symm : ℕ → { n // n ∉ range k }) = fun j => ⟨j + k, by simp⟩ 
goal: ⇑(notMemRangeEquiv k).symm = fun j => ⟨j + k, ⋯⟩

full_name: Multiset.toFinset
code: /-- `toFinset s` removes duplicates from the multiset `s` to produce a finset. -/
def toFinset (s : Multiset α) : Finset α 
goal: Finset α

full_name: Multiset.toFinset_val
code: @[simp]
theorem toFinset_val (s : Multiset α) : s.toFinset.1 = s.dedup 
goal: s.toFinset.val = s.dedup

full_name: Multiset.toFinset_eq
code: theorem toFinset_eq {s : Multiset α} (n : Nodup s) : Finset.mk s n = s.toFinset 
goal: { val := s, nodup := n } = s.toFinset

full_name: Multiset.Nodup.toFinset_inj
code: theorem Nodup.toFinset_inj {l l' : Multiset α} (hl : Nodup l) (hl' : Nodup l')
    (h : l.toFinset = l'.toFinset) : l = l' 
goal: l = l'

full_name: Multiset.mem_toFinset
code: @[simp]
theorem mem_toFinset {a : α} {s : Multiset α} : a ∈ s.toFinset ↔ a ∈ s 
goal: a ∈ s.toFinset ↔ a ∈ s

full_name: Multiset.toFinset_zero
code: @[simp]
theorem toFinset_zero : toFinset (0 : Multiset α) = ∅ 
goal: Multiset.toFinset 0 = ∅

full_name: Multiset.toFinset_cons
code: @[simp]
theorem toFinset_cons (a : α) (s : Multiset α) : toFinset (a ::ₘ s) = insert a (toFinset s) 
goal: (a ::ₘ s).toFinset = insert a s.toFinset

full_name: Multiset.toFinset_singleton
code: @[simp]
theorem toFinset_singleton (a : α) : toFinset ({a} : Multiset α) = {a} 
goal: {a}.toFinset = {a}

full_name: Multiset.toFinset_add
code: @[simp]
theorem toFinset_add (s t : Multiset α) : toFinset (s + t) = toFinset s ∪ toFinset t 
goal: (s + t).toFinset = s.toFinset ∪ t.toFinset

full_name: Multiset.toFinset_nsmul
code: @[simp]
theorem toFinset_nsmul (s : Multiset α) : ∀ n ≠ 0, (n • s).toFinset = s.toFinset
  
goal: n ≠ 0 → (n • s).toFinset = s.toFinset

full_name: Multiset.toFinset_eq_singleton_iff
code: theorem toFinset_eq_singleton_iff (s : Multiset α) (a : α) :
    s.toFinset = {a} ↔ card s ≠ 0 ∧ s = card s • {a} 
goal: s.toFinset = {a} ↔ Multiset.card s ≠ 0 ∧ s = Multiset.card s • {a}

full_name: Multiset.toFinset_inter
code: @[simp]
theorem toFinset_inter (s t : Multiset α) : toFinset (s ∩ t) = toFinset s ∩ toFinset t 
goal: (s ∩ t).toFinset = s.toFinset ∩ t.toFinset

full_name: Multiset.toFinset_union
code: @[simp]
theorem toFinset_union (s t : Multiset α) : (s ∪ t).toFinset = s.toFinset ∪ t.toFinset 
goal: (s ∪ t).toFinset = s.toFinset ∪ t.toFinset

full_name: Multiset.toFinset_eq_empty
code: @[simp]
theorem toFinset_eq_empty {m : Multiset α} : m.toFinset = ∅ ↔ m = 0 
goal: m.toFinset = ∅ ↔ m = 0

full_name: Multiset.toFinset_nonempty
code: @[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem toFinset_nonempty : s.toFinset.Nonempty ↔ s ≠ 0 
goal: s.toFinset.Nonempty ↔ s ≠ 0

full_name: Multiset.toFinset_subset
code: @[simp]
theorem toFinset_subset : s.toFinset ⊆ t.toFinset ↔ s ⊆ t 
goal: s.toFinset ⊆ t.toFinset ↔ s ⊆ t

full_name: Multiset.toFinset_ssubset
code: @[simp]
theorem toFinset_ssubset : s.toFinset ⊂ t.toFinset ↔ s ⊂ t 
goal: s.toFinset ⊂ t.toFinset ↔ s ⊂ t

full_name: Multiset.toFinset_dedup
code: @[simp]
theorem toFinset_dedup (m : Multiset α) : m.dedup.toFinset = m.toFinset 
goal: m.dedup.toFinset = m.toFinset

full_name: Multiset.toFinset_filter
code: @[simp]
theorem toFinset_filter (s : Multiset α) (p : α → Prop) [DecidablePred p] :
    Multiset.toFinset (s.filter p) = s.toFinset.filter p 
goal: (Multiset.filter p s).toFinset = Finset.filter p s.toFinset

full_name: Multiset.isWellFounded_ssubset
code: instance isWellFounded_ssubset : IsWellFounded (Multiset β) (· ⊂ ·) 
goal: IsWellFounded (Multiset β) fun x x_1 => x ⊂ x_1

full_name: Finset.val_toFinset
code: @[simp]
theorem val_toFinset [DecidableEq α] (s : Finset α) : s.val.toFinset = s 
goal: s.val.toFinset = s

full_name: Finset.val_le_iff_val_subset
code: theorem val_le_iff_val_subset {a : Finset α} {b : Multiset α} : a.val ≤ b ↔ a.val ⊆ b 
goal: a.val ≤ b ↔ a.val ⊆ b

full_name: List.toFinset
code: /-- `toFinset l` removes duplicates from the list `l` to produce a finset. -/
def toFinset (l : List α) : Finset α 
goal: Finset α

full_name: List.toFinset_val
code: @[simp]
theorem toFinset_val (l : List α) : l.toFinset.1 = (l.dedup : Multiset α) 
goal: l.toFinset.val = ↑l.dedup

full_name: List.toFinset_coe
code: @[simp]
theorem toFinset_coe (l : List α) : (l : Multiset α).toFinset = l.toFinset 
goal: (↑l).toFinset = l.toFinset

full_name: List.toFinset_eq
code: theorem toFinset_eq (n : Nodup l) : @Finset.mk α l n = l.toFinset 
goal: { val := ↑l, nodup := n } = l.toFinset

full_name: List.mem_toFinset
code: @[simp]
theorem mem_toFinset : a ∈ l.toFinset ↔ a ∈ l 
goal: a ∈ l.toFinset ↔ a ∈ l

full_name: List.coe_toFinset
code: @[simp, norm_cast]
theorem coe_toFinset (l : List α) : (l.toFinset : Set α) = { a | a ∈ l } 
goal: ↑l.toFinset = {a | a ∈ l}

full_name: List.toFinset_nil
code: @[simp]
theorem toFinset_nil : toFinset (@nil α) = ∅ 
goal: [].toFinset = ∅

full_name: List.toFinset_cons
code: @[simp]
theorem toFinset_cons : toFinset (a :: l) = insert a (toFinset l) 
goal: (a :: l).toFinset = insert a l.toFinset

full_name: List.toFinset_surj_on
code: theorem toFinset_surj_on : Set.SurjOn toFinset { l : List α | l.Nodup } Set.univ 
goal: Set.SurjOn List.toFinset {l | l.Nodup} Set.univ

full_name: List.toFinset_surjective
code: theorem toFinset_surjective : Surjective (toFinset : List α → Finset α) 
goal: Function.Surjective List.toFinset

full_name: List.toFinset_eq_iff_perm_dedup
code: theorem toFinset_eq_iff_perm_dedup : l.toFinset = l'.toFinset ↔ l.dedup ~ l'.dedup 
goal: l.toFinset = l'.toFinset ↔ l.dedup.Perm l'.dedup

full_name: List.toFinset.ext_iff
code: theorem toFinset.ext_iff {a b : List α} : a.toFinset = b.toFinset ↔ ∀ x, x ∈ a ↔ x ∈ b 
goal: a.toFinset = b.toFinset ↔ ∀ (x : α), x ∈ a ↔ x ∈ b

full_name: List.toFinset.ext
code: theorem toFinset.ext : (∀ x, x ∈ l ↔ x ∈ l') → l.toFinset = l'.toFinset 
goal: (∀ (x : α), x ∈ l ↔ x ∈ l') → l.toFinset = l'.toFinset

full_name: List.toFinset_eq_of_perm
code: theorem toFinset_eq_of_perm (l l' : List α) (h : l ~ l') : l.toFinset = l'.toFinset 
goal: l.toFinset = l'.toFinset

full_name: List.perm_of_nodup_nodup_toFinset_eq
code: theorem perm_of_nodup_nodup_toFinset_eq (hl : Nodup l) (hl' : Nodup l')
    (h : l.toFinset = l'.toFinset) : l ~ l' 
goal: l.Perm l'

full_name: List.toFinset_append
code: @[simp]
theorem toFinset_append : toFinset (l ++ l') = l.toFinset ∪ l'.toFinset 
goal: (l ++ l').toFinset = l.toFinset ∪ l'.toFinset

full_name: List.toFinset_reverse
code: @[simp]
theorem toFinset_reverse {l : List α} : toFinset l.reverse = l.toFinset 
goal: l.reverse.toFinset = l.toFinset

full_name: List.toFinset_replicate_of_ne_zero
code: theorem toFinset_replicate_of_ne_zero {n : ℕ} (hn : n ≠ 0) :
    (List.replicate n a).toFinset = {a} 
goal: (List.replicate n a).toFinset = {a}

full_name: List.toFinset_union
code: @[simp]
theorem toFinset_union (l l' : List α) : (l ∪ l').toFinset = l.toFinset ∪ l'.toFinset 
goal: (l ∪ l').toFinset = l.toFinset ∪ l'.toFinset

full_name: List.toFinset_inter
code: @[simp]
theorem toFinset_inter (l l' : List α) : (l ∩ l').toFinset = l.toFinset ∩ l'.toFinset 
goal: (l ∩ l').toFinset = l.toFinset ∩ l'.toFinset

full_name: List.toFinset_eq_empty_iff
code: @[simp]
theorem toFinset_eq_empty_iff (l : List α) : l.toFinset = ∅ ↔ l = nil 
goal: l.toFinset = ∅ ↔ l = []

full_name: List.toFinset_nonempty_iff
code: @[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem toFinset_nonempty_iff (l : List α) : l.toFinset.Nonempty ↔ l ≠ [] 
goal: l.toFinset.Nonempty ↔ l ≠ []

full_name: List.toFinset_filter
code: @[simp]
theorem toFinset_filter (s : List α) (p : α → Bool) :
    (s.filter p).toFinset = s.toFinset.filter (p ·) 
goal: (List.filter p s).toFinset = Finset.filter (fun x => p x = true) s.toFinset

full_name: Finset.toList
code: /-- Produce a list of the elements in the finite set using choice. -/
noncomputable def toList (s : Finset α) : List α 
goal: List α

full_name: Finset.nodup_toList
code: theorem nodup_toList (s : Finset α) : s.toList.Nodup 
goal: s.toList.Nodup

full_name: Finset.mem_toList
code: @[simp]
theorem mem_toList {a : α} {s : Finset α} : a ∈ s.toList ↔ a ∈ s 
goal: a ∈ s.toList ↔ a ∈ s

full_name: Finset.toList_eq_nil
code: @[simp]
theorem toList_eq_nil {s : Finset α} : s.toList = [] ↔ s = ∅ 
goal: s.toList = [] ↔ s = ∅

full_name: Finset.empty_toList
code: @[simp]
theorem empty_toList {s : Finset α} : s.toList.isEmpty ↔ s = ∅ 
goal: s.toList.isEmpty = true ↔ s = ∅

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

full_name: Finset.Nonempty.toList_ne_nil
code: theorem Nonempty.toList_ne_nil {s : Finset α} (hs : s.Nonempty) : s.toList ≠ [] 
goal: s.toList ≠ []

full_name: Finset.Nonempty.not_empty_toList
code: theorem Nonempty.not_empty_toList {s : Finset α} (hs : s.Nonempty) : ¬s.toList.isEmpty 
goal: ¬s.toList.isEmpty = true

full_name: Finset.coe_toList
code: @[simp, norm_cast]
theorem coe_toList (s : Finset α) : (s.toList : Multiset α) = s.val 
goal: ↑s.toList = s.val

full_name: Finset.toList_toFinset
code: @[simp]
theorem toList_toFinset [DecidableEq α] (s : Finset α) : s.toList.toFinset = s 
goal: s.toList.toFinset = s

full_name: Finset.toList_eq_singleton_iff
code: @[simp]
theorem toList_eq_singleton_iff {a : α} {s : Finset α} : s.toList = [a] ↔ s = {a} 
goal: s.toList = [a] ↔ s = {a}

full_name: Finset.toList_singleton
code: @[simp]
theorem toList_singleton : ∀ a, ({a} : Finset α).toList = [a] 
goal: {a}.toList = [a]

full_name: Finset.exists_list_nodup_eq
code: theorem exists_list_nodup_eq [DecidableEq α] (s : Finset α) :
    ∃ l : List α, l.Nodup ∧ l.toFinset = s 
goal: ∃ l, l.Nodup ∧ l.toFinset = s

full_name: Finset.toList_cons
code: theorem toList_cons {a : α} {s : Finset α} (h : a ∉ s) : (cons a s h).toList ~ a :: s.toList 
goal: (Finset.cons a s h).toList.Perm (a :: s.toList)

full_name: Finset.toList_insert
code: theorem toList_insert [DecidableEq α] {a : α} {s : Finset α} (h : a ∉ s) :
    (insert a s).toList ~ a :: s.toList 
goal: (insert a s).toList.Perm (a :: s.toList)

full_name: Finset.chooseX
code: /-- Given a finset `l` and a predicate `p`, associate to a proof that there is a unique element of
`l` satisfying `p` this unique element, as an element of the corresponding subtype. -/
def chooseX (hp : ∃! a, a ∈ l ∧ p a) : { a // a ∈ l ∧ p a } 
goal: { a // a ∈ l ∧ p a }

full_name: Finset.choose
code: /-- Given a finset `l` and a predicate `p`, associate to a proof that there is a unique element of
`l` satisfying `p` this unique element, as an element of the ambient type. -/
def choose (hp : ∃! a, a ∈ l ∧ p a) : α 
goal: α

full_name: Finset.choose_spec
code: theorem choose_spec (hp : ∃! a, a ∈ l ∧ p a) : choose p l hp ∈ l ∧ p (choose p l hp) 
goal: Finset.choose p l hp ∈ l ∧ p (Finset.choose p l hp)

full_name: Finset.choose_mem
code: theorem choose_mem (hp : ∃! a, a ∈ l ∧ p a) : choose p l hp ∈ l 
goal: Finset.choose p l hp ∈ l

full_name: Finset.choose_property
code: theorem choose_property (hp : ∃! a, a ∈ l ∧ p a) : p (choose p l hp) 
goal: p (Finset.choose p l hp)

full_name: Finset.pairwise_subtype_iff_pairwise_finset'
code: theorem pairwise_subtype_iff_pairwise_finset' (r : β → β → Prop) (f : α → β) :
    Pairwise (r on fun x : s => f x) ↔ (s : Set α).Pairwise (r on f) 
goal: Pairwise (r on fun x => f ↑x) ↔ (↑s).Pairwise (r on f)

full_name: Finset.pairwise_subtype_iff_pairwise_finset
code: theorem pairwise_subtype_iff_pairwise_finset (r : α → α → Prop) :
    Pairwise (r on fun x : s => x) ↔ (s : Set α).Pairwise r 
goal: Pairwise (r on fun x => ↑x) ↔ (↑s).Pairwise r

full_name: Finset.pairwise_cons'
code: theorem pairwise_cons' {a : α} (ha : a ∉ s) (r : β → β → Prop) (f : α → β) :
    Pairwise (r on fun a : s.cons a ha => f a) ↔
    Pairwise (r on fun a : s => f a) ∧ ∀ b ∈ s, r (f a) (f b) ∧ r (f b) (f a) 
goal: Pairwise (r on fun a_1 => f ↑a_1) ↔ Pairwise (r on fun a => f ↑a) ∧ ∀ b ∈ s, r (f a) (f b) ∧ r (f b) (f a)

full_name: Finset.pairwise_cons
code: theorem pairwise_cons {a : α} (ha : a ∉ s) (r : α → α → Prop) :
    Pairwise (r on fun a : s.cons a ha => a) ↔
      Pairwise (r on fun a : s => a) ∧ ∀ b ∈ s, r a b ∧ r b a 
goal: Pairwise (r on fun a_1 => ↑a_1) ↔ Pairwise (r on fun a => ↑a) ∧ ∀ b ∈ s, r a b ∧ r b a

full_name: Equiv.Finset.union
code: /-- The disjoint union of finsets is a sum -/
def Finset.union (s t : Finset α) (h : Disjoint s t) :
    s ⊕ t ≃ (s ∪ t : Finset α) 
goal: { x // x ∈ s } ⊕ { x // x ∈ t } ≃ { x // x ∈ s ∪ t }

full_name: Equiv.Finset.union_symm_inl
code: @[simp]
theorem Finset.union_symm_inl (h : Disjoint s t) (x : s) :
    Equiv.Finset.union s t h (Sum.inl x) = ⟨x, Finset.mem_union.mpr <| Or.inl x.2⟩ 
goal: (Equiv.Finset.union s t h) (Sum.inl x) = ⟨↑x, ⋯⟩

full_name: Equiv.Finset.union_symm_inr
code: @[simp]
theorem Finset.union_symm_inr (h : Disjoint s t) (y : t) :
    Equiv.Finset.union s t h (Sum.inr y) = ⟨y, Finset.mem_union.mpr <| Or.inr y.2⟩ 
goal: (Equiv.Finset.union s t h) (Sum.inr y) = ⟨↑y, ⋯⟩

full_name: Equiv.piFinsetUnion
code: /-- The type of dependent functions on the disjoint union of finsets `s ∪ t` is equivalent to the
  type of pairs of functions on `s` and on `t`. This is similar to `Equiv.sumPiEquivProdPi`. -/
def piFinsetUnion {ι} [DecidableEq ι] (α : ι → Type*) {s t : Finset ι} (h : Disjoint s t) :
    ((∀ i : s, α i) × ∀ i : t, α i) ≃ ∀ i : (s ∪ t : Finset ι), α i 
goal: ((i : { x // x ∈ s }) → α ↑i) × ((i : { x // x ∈ t }) → α ↑i) ≃ ((i : { x // x ∈ s ∪ t }) → α ↑i)

full_name: Multiset.disjoint_toFinset
code: theorem disjoint_toFinset {m1 m2 : Multiset α} :
    _root_.Disjoint m1.toFinset m2.toFinset ↔ m1.Disjoint m2 
goal: Disjoint m1.toFinset m2.toFinset ↔ m1.Disjoint m2

full_name: List.disjoint_toFinset_iff_disjoint
code: theorem disjoint_toFinset_iff_disjoint : _root_.Disjoint l.toFinset l'.toFinset ↔ l.Disjoint l' 
goal: Disjoint l.toFinset l'.toFinset ↔ l.Disjoint l'

full_name: Mathlib.Meta.proveFinsetNonempty
code: /-- Attempt to prove that a finset is nonempty using the `finsetNonempty` aesop rule-set.

You can add lemmas to the rule-set by tagging them with either:
* `aesop safe apply (rule_sets := [finsetNonempty])` if they are always a good idea to follow or
* `aesop unsafe apply (rule_sets := [finsetNonempty])` if they risk directing the search to a blind
  alley.
-/
def proveFinsetNonempty {u : Level} {α : Q(Type u)} (s : Q(Finset $α)) :
    MetaM (Option Q(Finset.Nonempty $s)) 
goal: Lean.MetaM (Option Q(«$s».Nonempty))