File: Mathlib/Data/Finset/Option.lean

full_name: Option.toFinset
code: /-- Construct an empty or singleton finset from an `Option` -/
def toFinset (o : Option α) : Finset α 
goal: Finset α

full_name: Option.toFinset_none
code: @[simp]
theorem toFinset_none : none.toFinset = (∅ : Finset α) 
goal: none.toFinset = ∅

full_name: Option.toFinset_some
code: @[simp]
theorem toFinset_some {a : α} : (some a).toFinset = {a} 
goal: (some a).toFinset = {a}

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

full_name: Option.card_toFinset
code: theorem card_toFinset (o : Option α) : o.toFinset.card = o.elim 0 1 
goal: o.toFinset.card = o.elim 0 1

full_name: Finset.insertNone
code: /-- Given a finset on `α`, lift it to being a finset on `Option α`
using `Option.some` and then insert `Option.none`. -/
def insertNone : Finset α ↪o Finset (Option α) 
goal: Finset α ↪o Finset (Option α)

full_name: Finset.mem_insertNone
code: @[simp]
theorem mem_insertNone {s : Finset α} : ∀ {o : Option α}, o ∈ insertNone s ↔ ∀ a ∈ o, a ∈ s
  
goal: o ∈ Finset.insertNone s ↔ ∀ a ∈ o, a ∈ s

full_name: Finset.forall_mem_insertNone
code: lemma forall_mem_insertNone {s : Finset α} {p : Option α → Prop} :
    (∀ a ∈ insertNone s, p a) ↔ p none ∧ ∀ a ∈ s, p a 
goal: (∀ a ∈ Finset.insertNone s, p a) ↔ p none ∧ ∀ a ∈ s, p (some a)

full_name: Finset.some_mem_insertNone
code: theorem some_mem_insertNone {s : Finset α} {a : α} : some a ∈ insertNone s ↔ a ∈ s 
goal: some a ∈ Finset.insertNone s ↔ a ∈ s

full_name: Finset.none_mem_insertNone
code: lemma none_mem_insertNone {s : Finset α} : none ∈ insertNone s 
goal: none ∈ Finset.insertNone s

full_name: Finset.insertNone_nonempty
code: @[aesop safe apply (rule_sets := [finsetNonempty])]
lemma insertNone_nonempty {s : Finset α} : insertNone s |>.Nonempty 
goal: (Finset.insertNone s).Nonempty

full_name: Finset.card_insertNone
code: @[simp]
theorem card_insertNone (s : Finset α) : s.insertNone.card = s.card + 1 
goal: (Finset.insertNone s).card = s.card + 1

full_name: Finset.eraseNone
code: /-- Given `s : Finset (Option α)`, `eraseNone s : Finset α` is the set of `x : α` such that
`some x ∈ s`. -/
def eraseNone : Finset (Option α) →o Finset α 
goal: Finset (Option α) →o Finset α

full_name: Finset.mem_eraseNone
code: @[simp]
theorem mem_eraseNone {s : Finset (Option α)} {x : α} : x ∈ eraseNone s ↔ some x ∈ s 
goal: x ∈ Finset.eraseNone s ↔ some x ∈ s

full_name: Finset.forall_mem_eraseNone
code: lemma forall_mem_eraseNone {s : Finset (Option α)} {p : Option α → Prop} :
    (∀ a ∈ eraseNone s, p a) ↔ ∀ a : α, (a : Option α) ∈ s → p a 
goal: (∀ a ∈ Finset.eraseNone s, p (some a)) ↔ ∀ (a : α), some a ∈ s → p (some a)

full_name: Finset.eraseNone_eq_biUnion
code: theorem eraseNone_eq_biUnion [DecidableEq α] (s : Finset (Option α)) :
    eraseNone s = s.biUnion Option.toFinset 
goal: Finset.eraseNone s = s.biUnion Option.toFinset

full_name: Finset.eraseNone_map_some
code: @[simp]
theorem eraseNone_map_some (s : Finset α) : eraseNone (s.map Embedding.some) = s 
goal: Finset.eraseNone (Finset.map Function.Embedding.some s) = s

full_name: Finset.eraseNone_image_some
code: @[simp]
theorem eraseNone_image_some [DecidableEq (Option α)] (s : Finset α) :
    eraseNone (s.image some) = s 
goal: Finset.eraseNone (Finset.image some s) = s

full_name: Finset.coe_eraseNone
code: @[simp]
theorem coe_eraseNone (s : Finset (Option α)) : (eraseNone s : Set α) = some ⁻¹' s 
goal: ↑(Finset.eraseNone s) = some ⁻¹' ↑s

full_name: Finset.eraseNone_union
code: @[simp]
theorem eraseNone_union [DecidableEq (Option α)] [DecidableEq α] (s t : Finset (Option α)) :
    eraseNone (s ∪ t) = eraseNone s ∪ eraseNone t 
goal: Finset.eraseNone (s ∪ t) = Finset.eraseNone s ∪ Finset.eraseNone t

full_name: Finset.eraseNone_inter
code: @[simp]
theorem eraseNone_inter [DecidableEq (Option α)] [DecidableEq α] (s t : Finset (Option α)) :
    eraseNone (s ∩ t) = eraseNone s ∩ eraseNone t 
goal: Finset.eraseNone (s ∩ t) = Finset.eraseNone s ∩ Finset.eraseNone t

full_name: Finset.eraseNone_empty
code: @[simp]
theorem eraseNone_empty : eraseNone (∅ : Finset (Option α)) = ∅ 
goal: Finset.eraseNone ∅ = ∅

full_name: Finset.eraseNone_none
code: @[simp]
theorem eraseNone_none : eraseNone ({none} : Finset (Option α)) = ∅ 
goal: Finset.eraseNone {none} = ∅

full_name: Finset.image_some_eraseNone
code: @[simp]
theorem image_some_eraseNone [DecidableEq (Option α)] (s : Finset (Option α)) :
    (eraseNone s).image some = s.erase none 
goal: Finset.image some (Finset.eraseNone s) = s.erase none

full_name: Finset.map_some_eraseNone
code: @[simp]
theorem map_some_eraseNone [DecidableEq (Option α)] (s : Finset (Option α)) :
    (eraseNone s).map Embedding.some = s.erase none 
goal: Finset.map Function.Embedding.some (Finset.eraseNone s) = s.erase none

full_name: Finset.insertNone_eraseNone
code: @[simp]
theorem insertNone_eraseNone [DecidableEq (Option α)] (s : Finset (Option α)) :
    insertNone (eraseNone s) = insert none s 
goal: Finset.insertNone (Finset.eraseNone s) = insert none s

full_name: Finset.eraseNone_insertNone
code: @[simp]
theorem eraseNone_insertNone (s : Finset α) : eraseNone (insertNone s) = s 
goal: Finset.eraseNone (Finset.insertNone s) = s