File: Mathlib/Data/Finset/Image.lean

full_name: Finset.map
code: /-- When `f` is an embedding of `α` in `β` and `s` is a finset in `α`, then `s.map f` is the image
finset in `β`. The embedding condition guarantees that there are no duplicates in the image. -/
def map (f : α ↪ β) (s : Finset α) : Finset β 
goal: Finset β

full_name: Finset.map_val
code: @[simp]
theorem map_val (f : α ↪ β) (s : Finset α) : (map f s).1 = s.1.map f 
goal: (Finset.map f s).val = Multiset.map (⇑f) s.val

full_name: Finset.map_empty
code: @[simp]
theorem map_empty (f : α ↪ β) : (∅ : Finset α).map f = ∅ 
goal: Finset.map f ∅ = ∅

full_name: Finset.mem_map
code: @[simp]
theorem mem_map {b : β} : b ∈ s.map f ↔ ∃ a ∈ s, f a = b 
goal: b ∈ Finset.map f s ↔ ∃ a ∈ s, f a = b

full_name: Finset.mem_map_equiv
code: @[simp 1100]
theorem mem_map_equiv {f : α ≃ β} {b : β} : b ∈ s.map f.toEmbedding ↔ f.symm b ∈ s 
goal: b ∈ Finset.map f.toEmbedding s ↔ f.symm b ∈ s

full_name: Finset.mem_map'
code: @[simp 1100]
theorem mem_map' (f : α ↪ β) {a} {s : Finset α} : f a ∈ s.map f ↔ a ∈ s 
goal: f a ∈ Finset.map f s ↔ a ∈ s

full_name: Finset.mem_map_of_mem
code: theorem mem_map_of_mem (f : α ↪ β) {a} {s : Finset α} : a ∈ s → f a ∈ s.map f 
goal: a ∈ s → f a ∈ Finset.map f s

full_name: Finset.forall_mem_map
code: theorem forall_mem_map {f : α ↪ β} {s : Finset α} {p : ∀ a, a ∈ s.map f → Prop} :
    (∀ y (H : y ∈ s.map f), p y H) ↔ ∀ x (H : x ∈ s), p (f x) (mem_map_of_mem _ H) 
goal: (∀ (y : β) (H : y ∈ Finset.map f s), p y H) ↔ ∀ (x : α) (H : x ∈ s), p (f x) ⋯

full_name: Finset.apply_coe_mem_map
code: theorem apply_coe_mem_map (f : α ↪ β) (s : Finset α) (x : s) : f x ∈ s.map f 
goal: f ↑x ∈ Finset.map f s

full_name: Finset.coe_map
code: @[simp, norm_cast]
theorem coe_map (f : α ↪ β) (s : Finset α) : (s.map f : Set β) = f '' s 
goal: ↑(Finset.map f s) = ⇑f '' ↑s

full_name: Finset.coe_map_subset_range
code: theorem coe_map_subset_range (f : α ↪ β) (s : Finset α) : (s.map f : Set β) ⊆ Set.range f 
goal: ↑(Finset.map f s) ⊆ Set.range ⇑f

full_name: Finset.map_perm
code: /-- If the only elements outside `s` are those left fixed by `σ`, then mapping by `σ` has no effect.
-/
theorem map_perm {σ : Equiv.Perm α} (hs : { a | σ a ≠ a } ⊆ s) : s.map (σ : α ↪ α) = s 
goal: Finset.map (Equiv.toEmbedding σ) s = s

full_name: Finset.map_toFinset
code: theorem map_toFinset [DecidableEq α] [DecidableEq β] {s : Multiset α} :
    s.toFinset.map f = (s.map f).toFinset 
goal: Finset.map f s.toFinset = (Multiset.map (⇑f) s).toFinset

full_name: Finset.map_refl
code: @[simp]
theorem map_refl : s.map (Embedding.refl _) = s 
goal: Finset.map (Function.Embedding.refl α) s = s

full_name: Finset.map_cast_heq
code: @[simp]
theorem map_cast_heq {α β} (h : α = β) (s : Finset α) :
    HEq (s.map (Equiv.cast h).toEmbedding) s 
goal: HEq (Finset.map (Equiv.cast h).toEmbedding s) s

full_name: Finset.map_map
code: theorem map_map (f : α ↪ β) (g : β ↪ γ) (s : Finset α) : (s.map f).map g = s.map (f.trans g) 
goal: Finset.map g (Finset.map f s) = Finset.map (f.trans g) s

full_name: Finset.map_comm
code: theorem map_comm {β'} {f : β ↪ γ} {g : α ↪ β} {f' : α ↪ β'} {g' : β' ↪ γ}
    (h_comm : ∀ a, f (g a) = g' (f' a)) : (s.map g).map f = (s.map f').map g' 
goal: Finset.map f (Finset.map g s) = Finset.map g' (Finset.map f' s)

full_name: Function.Semiconj.finset_map
code: theorem _root_.Function.Semiconj.finset_map {f : α ↪ β} {ga : α ↪ α} {gb : β ↪ β}
    (h : Function.Semiconj f ga gb) : Function.Semiconj (map f) (map ga) (map gb) 
goal: Function.Semiconj (Finset.map f) (Finset.map ga) (Finset.map gb)

full_name: Function.Commute.finset_map
code: theorem _root_.Function.Commute.finset_map {f g : α ↪ α} (h : Function.Commute f g) :
    Function.Commute (map f) (map g) 
goal: Function.Commute (Finset.map f) (Finset.map g)

full_name: Finset.map_subset_map
code: @[simp]
theorem map_subset_map {s₁ s₂ : Finset α} : s₁.map f ⊆ s₂.map f ↔ s₁ ⊆ s₂ 
goal: Finset.map f s₁ ⊆ Finset.map f s₂ ↔ s₁ ⊆ s₂

full_name: Finset.subset_map_symm
code: /-- The `Finset` version of `Equiv.subset_symm_image`. -/
theorem subset_map_symm {t : Finset β} {f : α ≃ β} : s ⊆ t.map f.symm ↔ s.map f ⊆ t 
goal: s ⊆ Finset.map f.symm.toEmbedding t ↔ Finset.map f.toEmbedding s ⊆ t

full_name: Finset.map_symm_subset
code: /-- The `Finset` version of `Equiv.symm_image_subset`. -/
theorem map_symm_subset {t : Finset β} {f : α ≃ β} : t.map f.symm ⊆ s ↔ t ⊆ s.map f 
goal: Finset.map f.symm.toEmbedding t ⊆ s ↔ t ⊆ Finset.map f.toEmbedding s

full_name: Finset.mapEmbedding
code: /-- Associate to an embedding `f` from `α` to `β` the order embedding that maps a finset to its
image under `f`. -/
def mapEmbedding (f : α ↪ β) : Finset α ↪o Finset β 
goal: Finset α ↪o Finset β

full_name: Finset.map_inj
code: @[simp]
theorem map_inj {s₁ s₂ : Finset α} : s₁.map f = s₂.map f ↔ s₁ = s₂ 
goal: Finset.map f s₁ = Finset.map f s₂ ↔ s₁ = s₂

full_name: Finset.map_injective
code: theorem map_injective (f : α ↪ β) : Injective (map f) 
goal: Function.Injective (Finset.map f)

full_name: Finset.map_ssubset_map
code: @[simp]
theorem map_ssubset_map {s t : Finset α} : s.map f ⊂ t.map f ↔ s ⊂ t 
goal: Finset.map f s ⊂ Finset.map f t ↔ s ⊂ t

full_name: Finset.mapEmbedding_apply
code: @[simp]
theorem mapEmbedding_apply : mapEmbedding f s = map f s 
goal: (Finset.mapEmbedding f) s = Finset.map f s

full_name: Finset.filter_map
code: theorem filter_map {p : β → Prop} [DecidablePred p] :
    (s.map f).filter p = (s.filter (p ∘ f)).map f 
goal: Finset.filter p (Finset.map f s) = Finset.map f (Finset.filter (p ∘ ⇑f) s)

full_name: Finset.map_filter'
code: lemma map_filter' (p : α → Prop) [DecidablePred p] (f : α ↪ β) (s : Finset α)
    [DecidablePred (∃ a, p a ∧ f a = ·)] :
    (s.filter p).map f = (s.map f).filter fun b => ∃ a, p a ∧ f a = b 
goal: Finset.map f (Finset.filter p s) = Finset.filter (fun b => ∃ a, p a ∧ f a = b) (Finset.map f s)

full_name: Finset.filter_attach'
code: lemma filter_attach' [DecidableEq α] (s : Finset α) (p : s → Prop) [DecidablePred p] :
    s.attach.filter p =
      (s.filter fun x => ∃ h, p ⟨x, h⟩).attach.map
        ⟨Subtype.map id <| filter_subset _ _, Subtype.map_injective _ injective_id⟩ 
goal: Finset.filter p s.attach =
  Finset.map { toFun := Subtype.map id ⋯, inj' := ⋯ } (Finset.filter (fun x => ∃ (h : x ∈ s), p ⟨x, h⟩) s).attach

full_name: Finset.filter_attach
code: lemma filter_attach (p : α → Prop) [DecidablePred p] (s : Finset α) :
    s.attach.filter (fun a : s ↦ p a) =
      (s.filter p).attach.map ((Embedding.refl _).subtypeMap mem_of_mem_filter) 
goal: Finset.filter (fun a => p ↑a) s.attach =
  Finset.map ((Function.Embedding.refl α).subtypeMap ⋯) (Finset.filter p s).attach

full_name: Finset.map_filter
code: theorem map_filter {f : α ≃ β} {p : α → Prop} [DecidablePred p] :
    (s.filter p).map f.toEmbedding = (s.map f.toEmbedding).filter (p ∘ f.symm) 
goal: Finset.map f.toEmbedding (Finset.filter p s) = Finset.filter (p ∘ ⇑f.symm) (Finset.map f.toEmbedding s)

full_name: Finset.disjoint_map
code: @[simp]
theorem disjoint_map {s t : Finset α} (f : α ↪ β) :
    Disjoint (s.map f) (t.map f) ↔ Disjoint s t 
goal: Disjoint (Finset.map f s) (Finset.map f t) ↔ Disjoint s t

full_name: Finset.map_disjUnion
code: theorem map_disjUnion {f : α ↪ β} (s₁ s₂ : Finset α) (h) (h' := (disjoint_map _).mpr h) :
    (s₁.disjUnion s₂ h).map f = (s₁.map f).disjUnion (s₂.map f) h' 
goal: Finset.map f (s₁.disjUnion s₂ h) = (Finset.map f s₁).disjUnion (Finset.map f s₂) h'

full_name: Finset.map_disjUnion'
code: /-- A version of `Finset.map_disjUnion` for writing in the other direction. -/
theorem map_disjUnion' {f : α ↪ β} (s₁ s₂ : Finset α) (h') (h := (disjoint_map _).mp h') :
    (s₁.disjUnion s₂ h).map f = (s₁.map f).disjUnion (s₂.map f) h' 
goal: Finset.map f (s₁.disjUnion s₂ h) = (Finset.map f s₁).disjUnion (Finset.map f s₂) h'

full_name: Finset.map_union
code: theorem map_union [DecidableEq α] [DecidableEq β] {f : α ↪ β} (s₁ s₂ : Finset α) :
    (s₁ ∪ s₂).map f = s₁.map f ∪ s₂.map f 
goal: Finset.map f (s₁ ∪ s₂) = Finset.map f s₁ ∪ Finset.map f s₂

full_name: Finset.map_inter
code: theorem map_inter [DecidableEq α] [DecidableEq β] {f : α ↪ β} (s₁ s₂ : Finset α) :
    (s₁ ∩ s₂).map f = s₁.map f ∩ s₂.map f 
goal: Finset.map f (s₁ ∩ s₂) = Finset.map f s₁ ∩ Finset.map f s₂

full_name: Finset.map_singleton
code: @[simp]
theorem map_singleton (f : α ↪ β) (a : α) : map f {a} = {f a} 
goal: Finset.map f {a} = {f a}

full_name: Finset.map_insert
code: @[simp]
theorem map_insert [DecidableEq α] [DecidableEq β] (f : α ↪ β) (a : α) (s : Finset α) :
    (insert a s).map f = insert (f a) (s.map f) 
goal: Finset.map f (insert a s) = insert (f a) (Finset.map f s)

full_name: Finset.map_cons
code: @[simp]
theorem map_cons (f : α ↪ β) (a : α) (s : Finset α) (ha : a ∉ s) :
    (cons a s ha).map f = cons (f a) (s.map f) (by simpa using ha) 
goal: Finset.map f (Finset.cons a s ha) = Finset.cons (f a) (Finset.map f s) ⋯

full_name: Finset.map_eq_empty
code: @[simp]
theorem map_eq_empty : s.map f = ∅ ↔ s = ∅ 
goal: Finset.map f s = ∅ ↔ s = ∅

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

full_name: Finset.map_nontrivial
code: @[simp]
theorem map_nontrivial : (s.map f).Nontrivial ↔ s.Nontrivial 
goal: (Finset.map f s).Nontrivial ↔ s.Nontrivial

full_name: Finset.attach_map_val
code: theorem attach_map_val {s : Finset α} : s.attach.map (Embedding.subtype _) = s 
goal: Finset.map (Function.Embedding.subtype fun x => x ∈ s) s.attach = s

full_name: Finset.disjoint_range_addLeftEmbedding
code: theorem disjoint_range_addLeftEmbedding (a b : ℕ) :
    Disjoint (range a) (map (addLeftEmbedding a) (range b)) 
goal: Disjoint (Finset.range a) (Finset.map (addLeftEmbedding a) (Finset.range b))

full_name: Finset.disjoint_range_addRightEmbedding
code: theorem disjoint_range_addRightEmbedding (a b : ℕ) :
    Disjoint (range a) (map (addRightEmbedding a) (range b)) 
goal: Disjoint (Finset.range a) (Finset.map (addRightEmbedding a) (Finset.range b))

full_name: Finset.map_disjiUnion
code: theorem map_disjiUnion {f : α ↪ β} {s : Finset α} {t : β → Finset γ} {h} :
    (s.map f).disjiUnion t h =
      s.disjiUnion (fun a => t (f a)) fun _ ha _ hb hab =>
        h (mem_map_of_mem _ ha) (mem_map_of_mem _ hb) (f.injective.ne hab) 
goal: (Finset.map f s).disjiUnion t h = s.disjiUnion (fun a => t (f a)) ⋯

full_name: Finset.disjiUnion_map
code: theorem disjiUnion_map {s : Finset α} {t : α → Finset β} {f : β ↪ γ} {h} :
    (s.disjiUnion t h).map f =
      s.disjiUnion (fun a => (t a).map f) (h.mono' fun _ _ ↦ (disjoint_map _).2) 
goal: Finset.map f (s.disjiUnion t h) = s.disjiUnion (fun a => Finset.map f (t a)) ⋯

full_name: Finset.range_add_one'
code: theorem range_add_one' (n : ℕ) :
    range (n + 1) = insert 0 ((range n).map ⟨fun i => i + 1, fun i j => by simp⟩) 
goal: Finset.range (n + 1) = insert 0 (Finset.map { toFun := fun i => i + 1, inj' := ⋯ } (Finset.range n))

full_name: Finset.image
code: /-- `image f s` is the forward image of `s` under `f`. -/
def image (f : α → β) (s : Finset α) : Finset β 
goal: Finset β

full_name: Finset.image_val
code: @[simp]
theorem image_val (f : α → β) (s : Finset α) : (image f s).1 = (s.1.map f).dedup 
goal: (Finset.image f s).val = (Multiset.map f s.val).dedup

full_name: Finset.image_empty
code: @[simp]
theorem image_empty (f : α → β) : (∅ : Finset α).image f = ∅ 
goal: Finset.image f ∅ = ∅

full_name: Finset.mem_image
code: @[simp]
theorem mem_image : b ∈ s.image f ↔ ∃ a ∈ s, f a = b 
goal: b ∈ Finset.image f s ↔ ∃ a ∈ s, f a = b

full_name: Finset.mem_image_of_mem
code: theorem mem_image_of_mem (f : α → β) {a} (h : a ∈ s) : f a ∈ s.image f 
goal: f a ∈ Finset.image f s

full_name: Finset.forall_image
code: theorem forall_image {p : β → Prop} : (∀ b ∈ s.image f, p b) ↔ ∀ a ∈ s, p (f a) 
goal: (∀ b ∈ Finset.image f s, p b) ↔ ∀ a ∈ s, p (f a)

full_name: Finset.map_eq_image
code: theorem map_eq_image (f : α ↪ β) (s : Finset α) : s.map f = s.image f 
goal: Finset.map f s = Finset.image (⇑f) s

full_name: Finset.mem_image_const
code: theorem mem_image_const : c ∈ s.image (const α b) ↔ s.Nonempty ∧ b = c 
goal: c ∈ Finset.image (Function.const α b) s ↔ s.Nonempty ∧ b = c

full_name: Finset.mem_image_const_self
code: theorem mem_image_const_self : b ∈ s.image (const α b) ↔ s.Nonempty 
goal: b ∈ Finset.image (Function.const α b) s ↔ s.Nonempty

full_name: Finset.canLift
code: instance canLift (c) (p) [CanLift β α c p] :
    CanLift (Finset β) (Finset α) (image c) fun s => ∀ x ∈ s, p x 
goal: CanLift (Finset β) (Finset α) (Finset.image c) fun s => ∀ x ∈ s, p x

full_name: Finset.image_congr
code: theorem image_congr (h : (s : Set α).EqOn f g) : Finset.image f s = Finset.image g s 
goal: Finset.image f s = Finset.image g s

full_name: Function.Injective.mem_finset_image
code: theorem _root_.Function.Injective.mem_finset_image (hf : Injective f) :
    f a ∈ s.image f ↔ a ∈ s 
goal: f a ∈ Finset.image f s ↔ a ∈ s

full_name: Finset.filter_mem_image_eq_image
code: theorem filter_mem_image_eq_image (f : α → β) (s : Finset α) (t : Finset β) (h : ∀ x ∈ s, f x ∈ t) :
    (t.filter fun y => y ∈ s.image f) = s.image f 
goal: Finset.filter (fun y => y ∈ Finset.image f s) t = Finset.image f s

full_name: Finset.fiber_nonempty_iff_mem_image
code: theorem fiber_nonempty_iff_mem_image (f : α → β) (s : Finset α) (y : β) :
    (s.filter fun x => f x = y).Nonempty ↔ y ∈ s.image f 
goal: (Finset.filter (fun x => f x = y) s).Nonempty ↔ y ∈ Finset.image f s

full_name: Finset.coe_image
code: @[simp, norm_cast]
theorem coe_image : ↑(s.image f) = f '' ↑s 
goal: ↑(Finset.image f s) = f '' ↑s

full_name: Finset.image_nonempty
code: @[simp, aesop safe apply (rule_sets := [finsetNonempty])]
lemma image_nonempty : (s.image f).Nonempty ↔ s.Nonempty 
goal: (Finset.image f s).Nonempty ↔ s.Nonempty

full_name: Finset.Nonempty.image
code: protected theorem Nonempty.image (h : s.Nonempty) (f : α → β) : (s.image f).Nonempty 
goal: (Finset.image f s).Nonempty

full_name: Finset.Nonempty.image_iff
code: @[deprecated image_nonempty (since := "2023-12-29")]
theorem Nonempty.image_iff (f : α → β) : (s.image f).Nonempty ↔ s.Nonempty 
goal: (Finset.image f s).Nonempty ↔ s.Nonempty

full_name: Finset.image_toFinset
code: theorem image_toFinset [DecidableEq α] {s : Multiset α} :
    s.toFinset.image f = (s.map f).toFinset 
goal: Finset.image f s.toFinset = (Multiset.map f s).toFinset

full_name: Finset.image_val_of_injOn
code: theorem image_val_of_injOn (H : Set.InjOn f s) : (image f s).1 = s.1.map f 
goal: (Finset.image f s).val = Multiset.map f s.val

full_name: Finset.image_id
code: @[simp]
theorem image_id [DecidableEq α] : s.image id = s 
goal: Finset.image id s = s

full_name: Finset.image_id'
code: @[simp]
theorem image_id' [DecidableEq α] : (s.image fun x => x) = s 
goal: Finset.image (fun x => x) s = s

full_name: Finset.image_image
code: theorem image_image [DecidableEq γ] {g : β → γ} : (s.image f).image g = s.image (g ∘ f) 
goal: Finset.image g (Finset.image f s) = Finset.image (g ∘ f) s

full_name: Finset.image_comm
code: theorem image_comm {β'} [DecidableEq β'] [DecidableEq γ] {f : β → γ} {g : α → β} {f' : α → β'}
    {g' : β' → γ} (h_comm : ∀ a, f (g a) = g' (f' a)) :
    (s.image g).image f = (s.image f').image g' 
goal: Finset.image f (Finset.image g s) = Finset.image g' (Finset.image f' s)

full_name: Function.Semiconj.finset_image
code: theorem _root_.Function.Semiconj.finset_image [DecidableEq α] {f : α → β} {ga : α → α} {gb : β → β}
    (h : Function.Semiconj f ga gb) : Function.Semiconj (image f) (image ga) (image gb) 
goal: Function.Semiconj (Finset.image f) (Finset.image ga) (Finset.image gb)

full_name: Function.Commute.finset_image
code: theorem _root_.Function.Commute.finset_image [DecidableEq α] {f g : α → α}
    (h : Function.Commute f g) : Function.Commute (image f) (image g) 
goal: Function.Commute (Finset.image f) (Finset.image g)

full_name: Finset.image_subset_image
code: theorem image_subset_image {s₁ s₂ : Finset α} (h : s₁ ⊆ s₂) : s₁.image f ⊆ s₂.image f 
goal: Finset.image f s₁ ⊆ Finset.image f s₂

full_name: Finset.image_subset_iff
code: theorem image_subset_iff : s.image f ⊆ t ↔ ∀ x ∈ s, f x ∈ t 
goal: Finset.image f s ⊆ t ↔ ∀ x ∈ s, f x ∈ t

full_name: Finset.image_mono
code: theorem image_mono (f : α → β) : Monotone (Finset.image f) 
goal: Monotone (Finset.image f)

full_name: Finset.image_injective
code: lemma image_injective (hf : Injective f) : Injective (image f) 
goal: Function.Injective (Finset.image f)

full_name: Finset.image_inj
code: lemma image_inj {t : Finset α} (hf : Injective f) : s.image f = t.image f ↔ s = t 
goal: Finset.image f s = Finset.image f t ↔ s = t

full_name: Finset.image_subset_image_iff
code: theorem image_subset_image_iff {t : Finset α} (hf : Injective f) :
    s.image f ⊆ t.image f ↔ s ⊆ t 
goal: Finset.image f s ⊆ Finset.image f t ↔ s ⊆ t

full_name: Finset.image_ssubset_image
code: lemma image_ssubset_image {t : Finset α} (hf : Injective f) : s.image f ⊂ t.image f ↔ s ⊂ t 
goal: Finset.image f s ⊂ Finset.image f t ↔ s ⊂ t

full_name: Finset.coe_image_subset_range
code: theorem coe_image_subset_range : ↑(s.image f) ⊆ Set.range f 
goal: ↑(Finset.image f s) ⊆ Set.range f

full_name: Finset.filter_image
code: theorem filter_image {p : β → Prop} [DecidablePred p] :
    (s.image f).filter p = (s.filter fun a ↦ p (f a)).image f 
goal: Finset.filter p (Finset.image f s) = Finset.image f (Finset.filter (fun a => p (f a)) s)

full_name: Finset.image_union
code: theorem image_union [DecidableEq α] {f : α → β} (s₁ s₂ : Finset α) :
    (s₁ ∪ s₂).image f = s₁.image f ∪ s₂.image f 
goal: Finset.image f (s₁ ∪ s₂) = Finset.image f s₁ ∪ Finset.image f s₂

full_name: Finset.image_inter_subset
code: theorem image_inter_subset [DecidableEq α] (f : α → β) (s t : Finset α) :
    (s ∩ t).image f ⊆ s.image f ∩ t.image f 
goal: Finset.image f (s ∩ t) ⊆ Finset.image f s ∩ Finset.image f t

full_name: Finset.image_inter_of_injOn
code: theorem image_inter_of_injOn [DecidableEq α] {f : α → β} (s t : Finset α)
    (hf : Set.InjOn f (s ∪ t)) : (s ∩ t).image f = s.image f ∩ t.image f 
goal: Finset.image f (s ∩ t) = Finset.image f s ∩ Finset.image f t

full_name: Finset.image_inter
code: theorem image_inter [DecidableEq α] (s₁ s₂ : Finset α) (hf : Injective f) :
    (s₁ ∩ s₂).image f = s₁.image f ∩ s₂.image f 
goal: Finset.image f (s₁ ∩ s₂) = Finset.image f s₁ ∩ Finset.image f s₂

full_name: Finset.image_singleton
code: @[simp]
theorem image_singleton (f : α → β) (a : α) : image f {a} = {f a} 
goal: Finset.image f {a} = {f a}

full_name: Finset.image_insert
code: @[simp]
theorem image_insert [DecidableEq α] (f : α → β) (a : α) (s : Finset α) :
    (insert a s).image f = insert (f a) (s.image f) 
goal: Finset.image f (insert a s) = insert (f a) (Finset.image f s)

full_name: Finset.erase_image_subset_image_erase
code: theorem erase_image_subset_image_erase [DecidableEq α] (f : α → β) (s : Finset α) (a : α) :
    (s.image f).erase (f a) ⊆ (s.erase a).image f 
goal: (Finset.image f s).erase (f a) ⊆ Finset.image f (s.erase a)

full_name: Finset.image_erase
code: @[simp]
theorem image_erase [DecidableEq α] {f : α → β} (hf : Injective f) (s : Finset α) (a : α) :
    (s.erase a).image f = (s.image f).erase (f a) 
goal: Finset.image f (s.erase a) = (Finset.image f s).erase (f a)

full_name: Finset.image_eq_empty
code: @[simp]
theorem image_eq_empty : s.image f = ∅ ↔ s = ∅ 
goal: Finset.image f s = ∅ ↔ s = ∅

full_name: Finset.image_sdiff
code: theorem image_sdiff [DecidableEq α] {f : α → β} (s t : Finset α) (hf : Injective f) :
    (s \ t).image f = s.image f \ t.image f 
goal: Finset.image f (s \ t) = Finset.image f s \ Finset.image f t

full_name: Finset.image_symmDiff
code: theorem image_symmDiff [DecidableEq α] {f : α → β} (s t : Finset α) (hf : Injective f) :
    (s ∆ t).image f = s.image f ∆ t.image f 
goal: Finset.image f (symmDiff s t) = symmDiff (Finset.image f s) (Finset.image f t)

full_name: Disjoint.of_image_finset
code: @[simp]
theorem _root_.Disjoint.of_image_finset {s t : Finset α} {f : α → β}
    (h : Disjoint (s.image f) (t.image f)) : Disjoint s t 
goal: Disjoint s t

full_name: Finset.mem_range_iff_mem_finset_range_of_mod_eq'
code: theorem mem_range_iff_mem_finset_range_of_mod_eq' [DecidableEq α] {f : ℕ → α} {a : α} {n : ℕ}
    (hn : 0 < n) (h : ∀ i, f (i % n) = f i) :
    a ∈ Set.range f ↔ a ∈ (Finset.range n).image fun i => f i 
goal: a ∈ Set.range f ↔ a ∈ Finset.image (fun i => f i) (Finset.range n)

full_name: Finset.mem_range_iff_mem_finset_range_of_mod_eq
code: theorem mem_range_iff_mem_finset_range_of_mod_eq [DecidableEq α] {f : ℤ → α} {a : α} {n : ℕ}
    (hn : 0 < n) (h : ∀ i, f (i % n) = f i) :
    a ∈ Set.range f ↔ a ∈ (Finset.range n).image (fun (i : ℕ) => f i) 
goal: a ∈ Set.range f ↔ a ∈ Finset.image (fun i => f ↑i) (Finset.range n)

full_name: Finset.range_add
code: theorem range_add (a b : ℕ) : range (a + b) = range a ∪ (range b).map (addLeftEmbedding a) 
goal: Finset.range (a + b) = Finset.range a ∪ Finset.map (addLeftEmbedding a) (Finset.range b)

full_name: Finset.attach_image_val
code: @[simp]
theorem attach_image_val [DecidableEq α] {s : Finset α} : s.attach.image Subtype.val = s 
goal: Finset.image Subtype.val s.attach = s

full_name: Finset.attach_insert
code: @[simp]
theorem attach_insert [DecidableEq α] {a : α} {s : Finset α} :
    attach (insert a s) =
      insert (⟨a, mem_insert_self a s⟩ : { x // x ∈ insert a s })
        ((attach s).image fun x => ⟨x.1, mem_insert_of_mem x.2⟩) 
goal: (insert a s).attach = insert ⟨a, ⋯⟩ (Finset.image (fun x => ⟨↑x, ⋯⟩) s.attach)

full_name: Finset.disjoint_image
code: @[simp]
theorem disjoint_image {s t : Finset α} {f : α → β} (hf : Injective f) :
    Disjoint (s.image f) (t.image f) ↔ Disjoint s t 
goal: Disjoint (Finset.image f s) (Finset.image f t) ↔ Disjoint s t

full_name: Finset.image_const
code: theorem image_const {s : Finset α} (h : s.Nonempty) (b : β) : (s.image fun _ => b) = singleton b 
goal: Finset.image (fun x => b) s = {b}

full_name: Finset.map_erase
code: @[simp]
theorem map_erase [DecidableEq α] (f : α ↪ β) (s : Finset α) (a : α) :
    (s.erase a).map f = (s.map f).erase (f a) 
goal: Finset.map f (s.erase a) = (Finset.map f s).erase (f a)

full_name: Finset.image_biUnion
code: theorem image_biUnion [DecidableEq γ] {f : α → β} {s : Finset α} {t : β → Finset γ} :
    (s.image f).biUnion t = s.biUnion fun a => t (f a) 
goal: (Finset.image f s).biUnion t = s.biUnion fun a => t (f a)

full_name: Finset.biUnion_image
code: theorem biUnion_image [DecidableEq γ] {s : Finset α} {t : α → Finset β} {f : β → γ} :
    (s.biUnion t).image f = s.biUnion fun a => (t a).image f 
goal: Finset.image f (s.biUnion t) = s.biUnion fun a => Finset.image f (t a)

full_name: Finset.image_biUnion_filter_eq
code: theorem image_biUnion_filter_eq [DecidableEq α] (s : Finset β) (g : β → α) :
    ((s.image g).biUnion fun a => s.filter fun c => g c = a) = s 
goal: ((Finset.image g s).biUnion fun a => Finset.filter (fun c => g c = a) s) = s

full_name: Finset.biUnion_singleton
code: theorem biUnion_singleton {f : α → β} : (s.biUnion fun a => {f a}) = s.image f 
goal: (s.biUnion fun a => {f a}) = Finset.image f s

full_name: Finset.filterMap
code: /-- `filterMap f s` is a combination filter/map operation on `s`.
  The function `f : α → Option β` is applied to each element of `s`;
  if `f a` is `some b` then `b` is included in the result, otherwise
  `a` is excluded from the resulting finset.

  In notation, `filterMap f s` is the finset `{b : β | ∃ a ∈ s , f a = some b}`. -/
-- TODO: should there be `filterImage` too?
def filterMap (f : α → Option β) (s : Finset α)
    (f_inj : ∀ a a' b, b ∈ f a → b ∈ f a' → a = a') : Finset β 
goal: Finset β

full_name: Finset.filterMap_val
code: @[simp]
theorem filterMap_val : (filterMap f s' f_inj).1 = s'.1.filterMap f 
goal: (Finset.filterMap f s' f_inj).val = Multiset.filterMap f s'.val

full_name: Finset.filterMap_empty
code: @[simp]
theorem filterMap_empty : (∅ : Finset α).filterMap f f_inj = ∅ 
goal: Finset.filterMap f ∅ f_inj = ∅

full_name: Finset.mem_filterMap
code: @[simp]
theorem mem_filterMap {b : β} : b ∈ s.filterMap f f_inj ↔ ∃ a ∈ s, f a = some b 
goal: b ∈ Finset.filterMap f s f_inj ↔ ∃ a ∈ s, f a = some b

full_name: Finset.coe_filterMap
code: @[simp, norm_cast]
theorem coe_filterMap : (s.filterMap f f_inj : Set β) = {b | ∃ a ∈ s, f a = some b} 
goal: ↑(Finset.filterMap f s f_inj) = {b | ∃ a ∈ s, f a = some b}

full_name: Finset.filterMap_some
code: @[simp]
theorem filterMap_some : s.filterMap some (by simp) = s 
goal: Finset.filterMap some s ⋯ = s

full_name: Finset.filterMap_mono
code: theorem filterMap_mono (h : s ⊆ t) :
    filterMap f s f_inj ⊆ filterMap f t f_inj 
goal: Finset.filterMap f s f_inj ⊆ Finset.filterMap f t f_inj

full_name: Finset.subtype
code: /-- Given a finset `s` and a predicate `p`, `s.subtype p` is the finset of `Subtype p` whose
elements belong to `s`. -/
protected def subtype {α} (p : α → Prop) [DecidablePred p] (s : Finset α) : Finset (Subtype p) 
goal: Finset (Subtype p)

full_name: Finset.mem_subtype
code: @[simp]
theorem mem_subtype {p : α → Prop} [DecidablePred p] {s : Finset α} :
    ∀ {a : Subtype p}, a ∈ s.subtype p ↔ (a : α) ∈ s
  
goal: a ∈ Finset.subtype p s ↔ ↑a ∈ s

full_name: Finset.subtype_eq_empty
code: theorem subtype_eq_empty {p : α → Prop} [DecidablePred p] {s : Finset α} :
    s.subtype p = ∅ ↔ ∀ x, p x → x ∉ s 
goal: Finset.subtype p s = ∅ ↔ ∀ (x : α), p x → x ∉ s

full_name: Finset.subtype_mono
code: @[mono]
theorem subtype_mono {p : α → Prop} [DecidablePred p] : Monotone (Finset.subtype p) 
goal: Monotone (Finset.subtype p)

full_name: Finset.subtype_map
code: /-- `s.subtype p` converts back to `s.filter p` with
`Embedding.subtype`. -/
@[simp]
theorem subtype_map (p : α → Prop) [DecidablePred p] {s : Finset α} :
    (s.subtype p).map (Embedding.subtype _) = s.filter p 
goal: Finset.map (Function.Embedding.subtype p) (Finset.subtype p s) = Finset.filter p s

full_name: Finset.subtype_map_of_mem
code: /-- If all elements of a `Finset` satisfy the predicate `p`,
`s.subtype p` converts back to `s` with `Embedding.subtype`. -/
theorem subtype_map_of_mem {p : α → Prop} [DecidablePred p] {s : Finset α} (h : ∀ x ∈ s, p x) :
    (s.subtype p).map (Embedding.subtype _) = s 
goal: Finset.map (Function.Embedding.subtype p) (Finset.subtype p s) = s

full_name: Finset.property_of_mem_map_subtype
code: /-- If a `Finset` of a subtype is converted to the main type with
`Embedding.subtype`, all elements of the result have the property of
the subtype. -/
theorem property_of_mem_map_subtype {p : α → Prop} (s : Finset { x // p x }) {a : α}
    (h : a ∈ s.map (Embedding.subtype _)) : p a 
goal: p a

full_name: Finset.not_mem_map_subtype_of_not_property
code: /-- If a `Finset` of a subtype is converted to the main type with
`Embedding.subtype`, the result does not contain any value that does
not satisfy the property of the subtype. -/
theorem not_mem_map_subtype_of_not_property {p : α → Prop} (s : Finset { x // p x }) {a : α}
    (h : ¬p a) : a ∉ s.map (Embedding.subtype _) 
goal: a ∉ Finset.map (Function.Embedding.subtype fun x => p x) s

full_name: Finset.map_subtype_subset
code: /-- If a `Finset` of a subtype is converted to the main type with
`Embedding.subtype`, the result is a subset of the set giving the
subtype. -/
theorem map_subtype_subset {t : Set α} (s : Finset t) : ↑(s.map (Embedding.subtype _)) ⊆ t 
goal: ↑(Finset.map (Function.Embedding.subtype fun x => x ∈ t) s) ⊆ t

full_name: Finset.fin
code: /-- Given a finset `s` of natural numbers and a bound `n`,
`s.fin n` is the finset of all elements of `s` less than `n`.
-/
protected def fin (n : ℕ) (s : Finset ℕ) : Finset (Fin n) 
goal: Finset (Fin n)

full_name: Finset.mem_fin
code: @[simp]
theorem mem_fin {n} {s : Finset ℕ} : ∀ a : Fin n, a ∈ s.fin n ↔ (a : ℕ) ∈ s
  
goal: a ∈ Finset.fin n s ↔ ↑a ∈ s

full_name: Finset.fin_mono
code: @[mono]
theorem fin_mono {n} : Monotone (Finset.fin n) 
goal: Monotone (Finset.fin n)

full_name: Finset.fin_map
code: @[simp]
theorem fin_map {n} {s : Finset ℕ} : (s.fin n).map Fin.valEmbedding = s.filter (· < n) 
goal: Finset.map Fin.valEmbedding (Finset.fin n s) = Finset.filter (fun x => x < n) s

full_name: Finset.subset_image_iff
code: /-- If a `Finset` is a subset of the image of a `Set` under `f`,
then it is equal to the `Finset.image` of a `Finset` subset of that `Set`. -/
theorem subset_image_iff [DecidableEq β] {s : Set α} {t : Finset β} {f : α → β} :
    ↑t ⊆ f '' s ↔ ∃ s' : Finset α, ↑s' ⊆ s ∧ s'.image f = t 
goal: ↑t ⊆ f '' s ↔ ∃ s', ↑s' ⊆ s ∧ Finset.image f s' = t

full_name: Finset.range_sdiff_zero
code: theorem range_sdiff_zero {n : ℕ} : range (n + 1) \ {0} = (range n).image Nat.succ 
goal: Finset.range (n + 1) \ {0} = Finset.image Nat.succ (Finset.range n)

full_name: Multiset.toFinset_map
code: theorem Multiset.toFinset_map [DecidableEq α] [DecidableEq β] (f : α → β) (m : Multiset α) :
    (m.map f).toFinset = m.toFinset.image f 
goal: (Multiset.map f m).toFinset = Finset.image f m.toFinset

full_name: Equiv.finsetCongr
code: /-- Given an equivalence `α` to `β`, produce an equivalence between `Finset α` and `Finset β`. -/
protected def finsetCongr (e : α ≃ β) : Finset α ≃ Finset β 
goal: Finset α ≃ Finset β

full_name: Equiv.finsetCongr_apply
code: @[simp]
theorem finsetCongr_apply (e : α ≃ β) (s : Finset α) : e.finsetCongr s = s.map e.toEmbedding 
goal: e.finsetCongr s = Finset.map e.toEmbedding s

full_name: Equiv.finsetCongr_refl
code: @[simp]
theorem finsetCongr_refl : (Equiv.refl α).finsetCongr = Equiv.refl _ 
goal: (Equiv.refl α).finsetCongr = Equiv.refl (Finset α)

full_name: Equiv.finsetCongr_symm
code: @[simp]
theorem finsetCongr_symm (e : α ≃ β) : e.finsetCongr.symm = e.symm.finsetCongr 
goal: e.finsetCongr.symm = e.symm.finsetCongr

full_name: Equiv.finsetCongr_trans
code: @[simp]
theorem finsetCongr_trans (e : α ≃ β) (e' : β ≃ γ) :
    e.finsetCongr.trans e'.finsetCongr = (e.trans e').finsetCongr 
goal: e.finsetCongr.trans e'.finsetCongr = (e.trans e').finsetCongr

full_name: Equiv.finsetCongr_toEmbedding
code: theorem finsetCongr_toEmbedding (e : α ≃ β) :
    e.finsetCongr.toEmbedding = (Finset.mapEmbedding e.toEmbedding).toEmbedding 
goal: e.finsetCongr.toEmbedding = (Finset.mapEmbedding e.toEmbedding).toEmbedding