File: Mathlib/Data/Finset/NAry.lean

full_name: Finset.image₂
code: /-- The image of a binary function `f : α → β → γ` as a function `Finset α → Finset β → Finset γ`.
Mathematically this should be thought of as the image of the corresponding function `α × β → γ`. -/
def image₂ (f : α → β → γ) (s : Finset α) (t : Finset β) : Finset γ 
goal: Finset γ

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

full_name: Finset.coe_image₂
code: @[simp, norm_cast]
theorem coe_image₂ (f : α → β → γ) (s : Finset α) (t : Finset β) :
    (image₂ f s t : Set γ) = Set.image2 f s t 
goal: ↑(Finset.image₂ f s t) = Set.image2 f ↑s ↑t

full_name: Finset.card_image₂_le
code: theorem card_image₂_le (f : α → β → γ) (s : Finset α) (t : Finset β) :
    (image₂ f s t).card ≤ s.card * t.card 
goal: (Finset.image₂ f s t).card ≤ s.card * t.card

full_name: Finset.card_image₂_iff
code: theorem card_image₂_iff :
    (image₂ f s t).card = s.card * t.card ↔ (s ×ˢ t : Set (α × β)).InjOn fun x => f x.1 x.2 
goal: (Finset.image₂ f s t).card = s.card * t.card ↔ Set.InjOn (fun x => f x.1 x.2) (↑s ×ˢ ↑t)

full_name: Finset.card_image₂
code: theorem card_image₂ (hf : Injective2 f) (s : Finset α) (t : Finset β) :
    (image₂ f s t).card = s.card * t.card 
goal: (Finset.image₂ f s t).card = s.card * t.card

full_name: Finset.mem_image₂_of_mem
code: theorem mem_image₂_of_mem (ha : a ∈ s) (hb : b ∈ t) : f a b ∈ image₂ f s t 
goal: f a b ∈ Finset.image₂ f s t

full_name: Finset.mem_image₂_iff
code: theorem mem_image₂_iff (hf : Injective2 f) : f a b ∈ image₂ f s t ↔ a ∈ s ∧ b ∈ t 
goal: f a b ∈ Finset.image₂ f s t ↔ a ∈ s ∧ b ∈ t

full_name: Finset.image₂_subset
code: theorem image₂_subset (hs : s ⊆ s') (ht : t ⊆ t') : image₂ f s t ⊆ image₂ f s' t' 
goal: Finset.image₂ f s t ⊆ Finset.image₂ f s' t'

full_name: Finset.image₂_subset_left
code: theorem image₂_subset_left (ht : t ⊆ t') : image₂ f s t ⊆ image₂ f s t' 
goal: Finset.image₂ f s t ⊆ Finset.image₂ f s t'

full_name: Finset.image₂_subset_right
code: theorem image₂_subset_right (hs : s ⊆ s') : image₂ f s t ⊆ image₂ f s' t 
goal: Finset.image₂ f s t ⊆ Finset.image₂ f s' t

full_name: Finset.image_subset_image₂_left
code: theorem image_subset_image₂_left (hb : b ∈ t) : s.image (fun a => f a b) ⊆ image₂ f s t 
goal: Finset.image (fun a => f a b) s ⊆ Finset.image₂ f s t

full_name: Finset.image_subset_image₂_right
code: theorem image_subset_image₂_right (ha : a ∈ s) : t.image (fun b => f a b) ⊆ image₂ f s t 
goal: Finset.image (fun b => f a b) t ⊆ Finset.image₂ f s t

full_name: Finset.forall_image₂_iff
code: theorem forall_image₂_iff {p : γ → Prop} :
    (∀ z ∈ image₂ f s t, p z) ↔ ∀ x ∈ s, ∀ y ∈ t, p (f x y) 
goal: (∀ z ∈ Finset.image₂ f s t, p z) ↔ ∀ x ∈ s, ∀ y ∈ t, p (f x y)

full_name: Finset.image₂_subset_iff
code: @[simp]
theorem image₂_subset_iff : image₂ f s t ⊆ u ↔ ∀ x ∈ s, ∀ y ∈ t, f x y ∈ u 
goal: Finset.image₂ f s t ⊆ u ↔ ∀ x ∈ s, ∀ y ∈ t, f x y ∈ u

full_name: Finset.image₂_subset_iff_left
code: theorem image₂_subset_iff_left : image₂ f s t ⊆ u ↔ ∀ a ∈ s, (t.image fun b => f a b) ⊆ u 
goal: Finset.image₂ f s t ⊆ u ↔ ∀ a ∈ s, Finset.image (fun b => f a b) t ⊆ u

full_name: Finset.image₂_subset_iff_right
code: theorem image₂_subset_iff_right : image₂ f s t ⊆ u ↔ ∀ b ∈ t, (s.image fun a => f a b) ⊆ u 
goal: Finset.image₂ f s t ⊆ u ↔ ∀ b ∈ t, Finset.image (fun a => f a b) s ⊆ u

full_name: Finset.image₂_nonempty_iff
code: @[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem image₂_nonempty_iff : (image₂ f s t).Nonempty ↔ s.Nonempty ∧ t.Nonempty 
goal: (Finset.image₂ f s t).Nonempty ↔ s.Nonempty ∧ t.Nonempty

full_name: Finset.Nonempty.image₂
code: theorem Nonempty.image₂ (hs : s.Nonempty) (ht : t.Nonempty) : (image₂ f s t).Nonempty 
goal: (Finset.image₂ f s t).Nonempty

full_name: Finset.Nonempty.of_image₂_left
code: theorem Nonempty.of_image₂_left (h : (s.image₂ f t).Nonempty) : s.Nonempty 
goal: s.Nonempty

full_name: Finset.Nonempty.of_image₂_right
code: theorem Nonempty.of_image₂_right (h : (s.image₂ f t).Nonempty) : t.Nonempty 
goal: t.Nonempty

full_name: Finset.image₂_empty_left
code: @[simp]
theorem image₂_empty_left : image₂ f ∅ t = ∅ 
goal: Finset.image₂ f ∅ t = ∅

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

full_name: Finset.image₂_eq_empty_iff
code: @[simp]
theorem image₂_eq_empty_iff : image₂ f s t = ∅ ↔ s = ∅ ∨ t = ∅ 
goal: Finset.image₂ f s t = ∅ ↔ s = ∅ ∨ t = ∅

full_name: Finset.image₂_singleton_left
code: @[simp]
theorem image₂_singleton_left : image₂ f {a} t = t.image fun b => f a b 
goal: Finset.image₂ f {a} t = Finset.image (fun b => f a b) t

full_name: Finset.image₂_singleton_right
code: @[simp]
theorem image₂_singleton_right : image₂ f s {b} = s.image fun a => f a b 
goal: Finset.image₂ f s {b} = Finset.image (fun a => f a b) s

full_name: Finset.image₂_singleton_left'
code: theorem image₂_singleton_left' : image₂ f {a} t = t.image (f a) 
goal: Finset.image₂ f {a} t = Finset.image (f a) t

full_name: Finset.image₂_singleton
code: theorem image₂_singleton : image₂ f {a} {b} = {f a b} 
goal: Finset.image₂ f {a} {b} = {f a b}

full_name: Finset.image₂_union_left
code: theorem image₂_union_left [DecidableEq α] : image₂ f (s ∪ s') t = image₂ f s t ∪ image₂ f s' t 
goal: Finset.image₂ f (s ∪ s') t = Finset.image₂ f s t ∪ Finset.image₂ f s' t

full_name: Finset.image₂_union_right
code: theorem image₂_union_right [DecidableEq β] : image₂ f s (t ∪ t') = image₂ f s t ∪ image₂ f s t' 
goal: Finset.image₂ f s (t ∪ t') = Finset.image₂ f s t ∪ Finset.image₂ f s t'

full_name: Finset.image₂_insert_left
code: @[simp]
theorem image₂_insert_left [DecidableEq α] :
    image₂ f (insert a s) t = (t.image fun b => f a b) ∪ image₂ f s t 
goal: Finset.image₂ f (insert a s) t = Finset.image (fun b => f a b) t ∪ Finset.image₂ f s t

full_name: Finset.image₂_insert_right
code: @[simp]
theorem image₂_insert_right [DecidableEq β] :
    image₂ f s (insert b t) = (s.image fun a => f a b) ∪ image₂ f s t 
goal: Finset.image₂ f s (insert b t) = Finset.image (fun a => f a b) s ∪ Finset.image₂ f s t

full_name: Finset.image₂_inter_left
code: theorem image₂_inter_left [DecidableEq α] (hf : Injective2 f) :
    image₂ f (s ∩ s') t = image₂ f s t ∩ image₂ f s' t 
goal: Finset.image₂ f (s ∩ s') t = Finset.image₂ f s t ∩ Finset.image₂ f s' t

full_name: Finset.image₂_inter_right
code: theorem image₂_inter_right [DecidableEq β] (hf : Injective2 f) :
    image₂ f s (t ∩ t') = image₂ f s t ∩ image₂ f s t' 
goal: Finset.image₂ f s (t ∩ t') = Finset.image₂ f s t ∩ Finset.image₂ f s t'

full_name: Finset.image₂_inter_subset_left
code: theorem image₂_inter_subset_left [DecidableEq α] :
    image₂ f (s ∩ s') t ⊆ image₂ f s t ∩ image₂ f s' t 
goal: Finset.image₂ f (s ∩ s') t ⊆ Finset.image₂ f s t ∩ Finset.image₂ f s' t

full_name: Finset.image₂_inter_subset_right
code: theorem image₂_inter_subset_right [DecidableEq β] :
    image₂ f s (t ∩ t') ⊆ image₂ f s t ∩ image₂ f s t' 
goal: Finset.image₂ f s (t ∩ t') ⊆ Finset.image₂ f s t ∩ Finset.image₂ f s t'

full_name: Finset.image₂_congr
code: theorem image₂_congr (h : ∀ a ∈ s, ∀ b ∈ t, f a b = f' a b) : image₂ f s t = image₂ f' s t 
goal: Finset.image₂ f s t = Finset.image₂ f' s t

full_name: Finset.image₂_congr'
code: /-- A common special case of `image₂_congr` -/
theorem image₂_congr' (h : ∀ a b, f a b = f' a b) : image₂ f s t = image₂ f' s t 
goal: Finset.image₂ f s t = Finset.image₂ f' s t

full_name: Finset.card_image₂_singleton_left
code: theorem card_image₂_singleton_left (hf : Injective (f a)) : (image₂ f {a} t).card = t.card 
goal: (Finset.image₂ f {a} t).card = t.card

full_name: Finset.card_image₂_singleton_right
code: theorem card_image₂_singleton_right (hf : Injective fun a => f a b) :
    (image₂ f s {b}).card = s.card 
goal: (Finset.image₂ f s {b}).card = s.card

full_name: Finset.image₂_singleton_inter
code: theorem image₂_singleton_inter [DecidableEq β] (t₁ t₂ : Finset β) (hf : Injective (f a)) :
    image₂ f {a} (t₁ ∩ t₂) = image₂ f {a} t₁ ∩ image₂ f {a} t₂ 
goal: Finset.image₂ f {a} (t₁ ∩ t₂) = Finset.image₂ f {a} t₁ ∩ Finset.image₂ f {a} t₂

full_name: Finset.image₂_inter_singleton
code: theorem image₂_inter_singleton [DecidableEq α] (s₁ s₂ : Finset α) (hf : Injective fun a => f a b) :
    image₂ f (s₁ ∩ s₂) {b} = image₂ f s₁ {b} ∩ image₂ f s₂ {b} 
goal: Finset.image₂ f (s₁ ∩ s₂) {b} = Finset.image₂ f s₁ {b} ∩ Finset.image₂ f s₂ {b}

full_name: Finset.card_le_card_image₂_left
code: theorem card_le_card_image₂_left {s : Finset α} (hs : s.Nonempty) (hf : ∀ a, Injective (f a)) :
    t.card ≤ (image₂ f s t).card 
goal: t.card ≤ (Finset.image₂ f s t).card

full_name: Finset.card_le_card_image₂_right
code: theorem card_le_card_image₂_right {t : Finset β} (ht : t.Nonempty)
    (hf : ∀ b, Injective fun a => f a b) : s.card ≤ (image₂ f s t).card 
goal: s.card ≤ (Finset.image₂ f s t).card

full_name: Finset.biUnion_image_left
code: theorem biUnion_image_left : (s.biUnion fun a => t.image <| f a) = image₂ f s t 
goal: (s.biUnion fun a => Finset.image (f a) t) = Finset.image₂ f s t

full_name: Finset.biUnion_image_right
code: theorem biUnion_image_right : (t.biUnion fun b => s.image fun a => f a b) = image₂ f s t 
goal: (t.biUnion fun b => Finset.image (fun a => f a b) s) = Finset.image₂ f s t

full_name: Finset.image_image₂
code: theorem image_image₂ (f : α → β → γ) (g : γ → δ) :
    (image₂ f s t).image g = image₂ (fun a b => g (f a b)) s t 
goal: Finset.image g (Finset.image₂ f s t) = Finset.image₂ (fun a b => g (f a b)) s t

full_name: Finset.image₂_image_left
code: theorem image₂_image_left (f : γ → β → δ) (g : α → γ) :
    image₂ f (s.image g) t = image₂ (fun a b => f (g a) b) s t 
goal: Finset.image₂ f (Finset.image g s) t = Finset.image₂ (fun a b => f (g a) b) s t

full_name: Finset.image₂_image_right
code: theorem image₂_image_right (f : α → γ → δ) (g : β → γ) :
    image₂ f s (t.image g) = image₂ (fun a b => f a (g b)) s t 
goal: Finset.image₂ f s (Finset.image g t) = Finset.image₂ (fun a b => f a (g b)) s t

full_name: Finset.image₂_mk_eq_product
code: @[simp]
theorem image₂_mk_eq_product [DecidableEq α] [DecidableEq β] (s : Finset α) (t : Finset β) :
    image₂ Prod.mk s t = s ×ˢ t 
goal: Finset.image₂ Prod.mk s t = s ×ˢ t

full_name: Finset.image₂_curry
code: @[simp]
theorem image₂_curry (f : α × β → γ) (s : Finset α) (t : Finset β) :
    image₂ (curry f) s t = (s ×ˢ t).image f 
goal: Finset.image₂ (Function.curry f) s t = Finset.image f (s ×ˢ t)

full_name: Finset.image_uncurry_product
code: @[simp]
theorem image_uncurry_product (f : α → β → γ) (s : Finset α) (t : Finset β) :
    (s ×ˢ t).image (uncurry f) = image₂ f s t 
goal: Finset.image (Function.uncurry f) (s ×ˢ t) = Finset.image₂ f s t

full_name: Finset.image₂_swap
code: theorem image₂_swap (f : α → β → γ) (s : Finset α) (t : Finset β) :
    image₂ f s t = image₂ (fun a b => f b a) t s 
goal: Finset.image₂ f s t = Finset.image₂ (fun a b => f b a) t s

full_name: Finset.image₂_left
code: @[simp]
theorem image₂_left [DecidableEq α] (h : t.Nonempty) : image₂ (fun x _ => x) s t = s 
goal: Finset.image₂ (fun x x_1 => x) s t = s

full_name: Finset.image₂_right
code: @[simp]
theorem image₂_right [DecidableEq β] (h : s.Nonempty) : image₂ (fun _ y => y) s t = t 
goal: Finset.image₂ (fun x y => y) s t = t

full_name: Finset.image₂_assoc
code: theorem image₂_assoc {γ : Type*} {u : Finset γ} {f : δ → γ → ε} {g : α → β → δ} {f' : α → ε' → ε}
    {g' : β → γ → ε'} (h_assoc : ∀ a b c, f (g a b) c = f' a (g' b c)) :
    image₂ f (image₂ g s t) u = image₂ f' s (image₂ g' t u) 
goal: Finset.image₂ f (Finset.image₂ g s t) u = Finset.image₂ f' s (Finset.image₂ g' t u)

full_name: Finset.image₂_comm
code: theorem image₂_comm {g : β → α → γ} (h_comm : ∀ a b, f a b = g b a) : image₂ f s t = image₂ g t s 
goal: Finset.image₂ f s t = Finset.image₂ g t s

full_name: Finset.image₂_left_comm
code: theorem image₂_left_comm {γ : Type*} {u : Finset γ} {f : α → δ → ε} {g : β → γ → δ}
    {f' : α → γ → δ'} {g' : β → δ' → ε} (h_left_comm : ∀ a b c, f a (g b c) = g' b (f' a c)) :
    image₂ f s (image₂ g t u) = image₂ g' t (image₂ f' s u) 
goal: Finset.image₂ f s (Finset.image₂ g t u) = Finset.image₂ g' t (Finset.image₂ f' s u)

full_name: Finset.image₂_right_comm
code: theorem image₂_right_comm {γ : Type*} {u : Finset γ} {f : δ → γ → ε} {g : α → β → δ}
    {f' : α → γ → δ'} {g' : δ' → β → ε} (h_right_comm : ∀ a b c, f (g a b) c = g' (f' a c) b) :
    image₂ f (image₂ g s t) u = image₂ g' (image₂ f' s u) t 
goal: Finset.image₂ f (Finset.image₂ g s t) u = Finset.image₂ g' (Finset.image₂ f' s u) t

full_name: Finset.image₂_image₂_image₂_comm
code: theorem image₂_image₂_image₂_comm {γ δ : Type*} {u : Finset γ} {v : Finset δ} [DecidableEq ζ]
    [DecidableEq ζ'] [DecidableEq ν] {f : ε → ζ → ν} {g : α → β → ε} {h : γ → δ → ζ}
    {f' : ε' → ζ' → ν} {g' : α → γ → ε'} {h' : β → δ → ζ'}
    (h_comm : ∀ a b c d, f (g a b) (h c d) = f' (g' a c) (h' b d)) :
    image₂ f (image₂ g s t) (image₂ h u v) = image₂ f' (image₂ g' s u) (image₂ h' t v) 
goal: Finset.image₂ f (Finset.image₂ g s t) (Finset.image₂ h u v) =
  Finset.image₂ f' (Finset.image₂ g' s u) (Finset.image₂ h' t v)

full_name: Finset.image_image₂_distrib
code: theorem image_image₂_distrib {g : γ → δ} {f' : α' → β' → δ} {g₁ : α → α'} {g₂ : β → β'}
    (h_distrib : ∀ a b, g (f a b) = f' (g₁ a) (g₂ b)) :
    (image₂ f s t).image g = image₂ f' (s.image g₁) (t.image g₂) 
goal: Finset.image g (Finset.image₂ f s t) = Finset.image₂ f' (Finset.image g₁ s) (Finset.image g₂ t)

full_name: Finset.image_image₂_distrib_left
code: /-- Symmetric statement to `Finset.image₂_image_left_comm`. -/
theorem image_image₂_distrib_left {g : γ → δ} {f' : α' → β → δ} {g' : α → α'}
    (h_distrib : ∀ a b, g (f a b) = f' (g' a) b) :
    (image₂ f s t).image g = image₂ f' (s.image g') t 
goal: Finset.image g (Finset.image₂ f s t) = Finset.image₂ f' (Finset.image g' s) t

full_name: Finset.image_image₂_distrib_right
code: /-- Symmetric statement to `Finset.image_image₂_right_comm`. -/
theorem image_image₂_distrib_right {g : γ → δ} {f' : α → β' → δ} {g' : β → β'}
    (h_distrib : ∀ a b, g (f a b) = f' a (g' b)) :
    (image₂ f s t).image g = image₂ f' s (t.image g') 
goal: Finset.image g (Finset.image₂ f s t) = Finset.image₂ f' s (Finset.image g' t)

full_name: Finset.image₂_image_left_comm
code: /-- Symmetric statement to `Finset.image_image₂_distrib_left`. -/
theorem image₂_image_left_comm {f : α' → β → γ} {g : α → α'} {f' : α → β → δ} {g' : δ → γ}
    (h_left_comm : ∀ a b, f (g a) b = g' (f' a b)) :
    image₂ f (s.image g) t = (image₂ f' s t).image g' 
goal: Finset.image₂ f (Finset.image g s) t = Finset.image g' (Finset.image₂ f' s t)

full_name: Finset.image_image₂_right_comm
code: /-- Symmetric statement to `Finset.image_image₂_distrib_right`. -/
theorem image_image₂_right_comm {f : α → β' → γ} {g : β → β'} {f' : α → β → δ} {g' : δ → γ}
    (h_right_comm : ∀ a b, f a (g b) = g' (f' a b)) :
    image₂ f s (t.image g) = (image₂ f' s t).image g' 
goal: Finset.image₂ f s (Finset.image g t) = Finset.image g' (Finset.image₂ f' s t)

full_name: Finset.image₂_distrib_subset_left
code: /-- The other direction does not hold because of the `s`-`s` cross terms on the RHS. -/
theorem image₂_distrib_subset_left {γ : Type*} {u : Finset γ} {f : α → δ → ε} {g : β → γ → δ}
    {f₁ : α → β → β'} {f₂ : α → γ → γ'} {g' : β' → γ' → ε}
    (h_distrib : ∀ a b c, f a (g b c) = g' (f₁ a b) (f₂ a c)) :
    image₂ f s (image₂ g t u) ⊆ image₂ g' (image₂ f₁ s t) (image₂ f₂ s u) 
goal: Finset.image₂ f s (Finset.image₂ g t u) ⊆ Finset.image₂ g' (Finset.image₂ f₁ s t) (Finset.image₂ f₂ s u)

full_name: Finset.image₂_distrib_subset_right
code: /-- The other direction does not hold because of the `u`-`u` cross terms on the RHS. -/
theorem image₂_distrib_subset_right {γ : Type*} {u : Finset γ} {f : δ → γ → ε} {g : α → β → δ}
    {f₁ : α → γ → α'} {f₂ : β → γ → β'} {g' : α' → β' → ε}
    (h_distrib : ∀ a b c, f (g a b) c = g' (f₁ a c) (f₂ b c)) :
    image₂ f (image₂ g s t) u ⊆ image₂ g' (image₂ f₁ s u) (image₂ f₂ t u) 
goal: Finset.image₂ f (Finset.image₂ g s t) u ⊆ Finset.image₂ g' (Finset.image₂ f₁ s u) (Finset.image₂ f₂ t u)

full_name: Finset.image_image₂_antidistrib
code: theorem image_image₂_antidistrib {g : γ → δ} {f' : β' → α' → δ} {g₁ : β → β'} {g₂ : α → α'}
    (h_antidistrib : ∀ a b, g (f a b) = f' (g₁ b) (g₂ a)) :
    (image₂ f s t).image g = image₂ f' (t.image g₁) (s.image g₂) 
goal: Finset.image g (Finset.image₂ f s t) = Finset.image₂ f' (Finset.image g₁ t) (Finset.image g₂ s)

full_name: Finset.image_image₂_antidistrib_left
code: /-- Symmetric statement to `Finset.image₂_image_left_anticomm`. -/
theorem image_image₂_antidistrib_left {g : γ → δ} {f' : β' → α → δ} {g' : β → β'}
    (h_antidistrib : ∀ a b, g (f a b) = f' (g' b) a) :
    (image₂ f s t).image g = image₂ f' (t.image g') s 
goal: Finset.image g (Finset.image₂ f s t) = Finset.image₂ f' (Finset.image g' t) s

full_name: Finset.image_image₂_antidistrib_right
code: /-- Symmetric statement to `Finset.image_image₂_right_anticomm`. -/
theorem image_image₂_antidistrib_right {g : γ → δ} {f' : β → α' → δ} {g' : α → α'}
    (h_antidistrib : ∀ a b, g (f a b) = f' b (g' a)) :
    (image₂ f s t).image g = image₂ f' t (s.image g') 
goal: Finset.image g (Finset.image₂ f s t) = Finset.image₂ f' t (Finset.image g' s)

full_name: Finset.image₂_image_left_anticomm
code: /-- Symmetric statement to `Finset.image_image₂_antidistrib_left`. -/
theorem image₂_image_left_anticomm {f : α' → β → γ} {g : α → α'} {f' : β → α → δ} {g' : δ → γ}
    (h_left_anticomm : ∀ a b, f (g a) b = g' (f' b a)) :
    image₂ f (s.image g) t = (image₂ f' t s).image g' 
goal: Finset.image₂ f (Finset.image g s) t = Finset.image g' (Finset.image₂ f' t s)

full_name: Finset.image_image₂_right_anticomm
code: /-- Symmetric statement to `Finset.image_image₂_antidistrib_right`. -/
theorem image_image₂_right_anticomm {f : α → β' → γ} {g : β → β'} {f' : β → α → δ} {g' : δ → γ}
    (h_right_anticomm : ∀ a b, f a (g b) = g' (f' b a)) :
    image₂ f s (t.image g) = (image₂ f' t s).image g' 
goal: Finset.image₂ f s (Finset.image g t) = Finset.image g' (Finset.image₂ f' t s)

full_name: Finset.image₂_left_identity
code: /-- If `a` is a left identity for `f : α → β → β`, then `{a}` is a left identity for
`Finset.image₂ f`. -/
theorem image₂_left_identity {f : α → γ → γ} {a : α} (h : ∀ b, f a b = b) (t : Finset γ) :
    image₂ f {a} t = t 
goal: Finset.image₂ f {a} t = t

full_name: Finset.image₂_right_identity
code: /-- If `b` is a right identity for `f : α → β → α`, then `{b}` is a right identity for
`Finset.image₂ f`. -/
theorem image₂_right_identity {f : γ → β → γ} {b : β} (h : ∀ a, f a b = a) (s : Finset γ) :
    image₂ f s {b} = s 
goal: Finset.image₂ f s {b} = s

full_name: Finset.card_dvd_card_image₂_right
code: /-- If each partial application of `f` is injective, and images of `s` under those partial
applications are disjoint (but not necessarily distinct!), then the size of `t` divides the size of
`finset.image₂ f s t`. -/
theorem card_dvd_card_image₂_right (hf : ∀ a ∈ s, Injective (f a))
    (hs : ((fun a => t.image <| f a) '' s).PairwiseDisjoint id) : t.card ∣ (image₂ f s t).card 
goal: t.card ∣ (Finset.image₂ f s t).card

full_name: Finset.card_dvd_card_image₂_left
code: /-- If each partial application of `f` is injective, and images of `t` under those partial
applications are disjoint (but not necessarily distinct!), then the size of `s` divides the size of
`finset.image₂ f s t`. -/
theorem card_dvd_card_image₂_left (hf : ∀ b ∈ t, Injective fun a => f a b)
    (ht : ((fun b => s.image fun a => f a b) '' t).PairwiseDisjoint id) :
    s.card ∣ (image₂ f s t).card 
goal: s.card ∣ (Finset.image₂ f s t).card

full_name: Finset.subset_image₂
code: /-- If a `Finset` is a subset of the image of two `Set`s under a binary operation,
then it is a subset of the `Finset.image₂` of two `Finset` subsets of these `Set`s. -/
theorem subset_image₂ {s : Set α} {t : Set β} (hu : ↑u ⊆ image2 f s t) :
    ∃ (s' : Finset α) (t' : Finset β), ↑s' ⊆ s ∧ ↑t' ⊆ t ∧ u ⊆ image₂ f s' t' 
goal: ∃ s' t', ↑s' ⊆ s ∧ ↑t' ⊆ t ∧ u ⊆ Finset.image₂ f s' t'

full_name: Finset.image₂_inter_union_subset_union
code: theorem image₂_inter_union_subset_union :
    image₂ f (s ∩ s') (t ∪ t') ⊆ image₂ f s t ∪ image₂ f s' t' 
goal: Finset.image₂ f (s ∩ s') (t ∪ t') ⊆ Finset.image₂ f s t ∪ Finset.image₂ f s' t'

full_name: Finset.image₂_union_inter_subset_union
code: theorem image₂_union_inter_subset_union :
    image₂ f (s ∪ s') (t ∩ t') ⊆ image₂ f s t ∪ image₂ f s' t' 
goal: Finset.image₂ f (s ∪ s') (t ∩ t') ⊆ Finset.image₂ f s t ∪ Finset.image₂ f s' t'

full_name: Finset.image₂_inter_union_subset
code: theorem image₂_inter_union_subset {f : α → α → β} {s t : Finset α} (hf : ∀ a b, f a b = f b a) :
    image₂ f (s ∩ t) (s ∪ t) ⊆ image₂ f s t 
goal: Finset.image₂ f (s ∩ t) (s ∪ t) ⊆ Finset.image₂ f s t

full_name: Finset.image₂_union_inter_subset
code: theorem image₂_union_inter_subset {f : α → α → β} {s t : Finset α} (hf : ∀ a b, f a b = f b a) :
    image₂ f (s ∪ t) (s ∩ t) ⊆ image₂ f s t 
goal: Finset.image₂ f (s ∪ t) (s ∩ t) ⊆ Finset.image₂ f s t

full_name: Finset.sup'_image₂_le
code: @[simp (default + 1)] -- otherwise `simp` doesn't use `forall_image₂_iff`
lemma sup'_image₂_le {g : γ → δ} {a : δ} (h : (image₂ f s t).Nonempty) :
    sup' (image₂ f s t) h g ≤ a ↔ ∀ x ∈ s, ∀ y ∈ t, g (f x y) ≤ a 
goal: (Finset.image₂ f s t).sup' h g ≤ a ↔ ∀ x ∈ s, ∀ y ∈ t, g (f x y) ≤ a

full_name: Finset.sup'_image₂_left
code: lemma sup'_image₂_left (g : γ → δ) (h : (image₂ f s t).Nonempty) :
    sup' (image₂ f s t) h g =
      sup' s h.of_image₂_left fun x ↦ sup' t h.of_image₂_right (g <| f x ·) 
goal: (Finset.image₂ f s t).sup' h g = s.sup' ⋯ fun x => t.sup' ⋯ fun x_1 => g (f x x_1)

full_name: Finset.sup'_image₂_right
code: lemma sup'_image₂_right (g : γ → δ) (h : (image₂ f s t).Nonempty) :
    sup' (image₂ f s t) h g =
      sup' t h.of_image₂_right fun y ↦ sup' s h.of_image₂_left (g <| f · y) 
goal: (Finset.image₂ f s t).sup' h g = t.sup' ⋯ fun y => s.sup' ⋯ fun x => g (f x y)

full_name: Finset.sup_image₂_le
code: @[simp (default + 1)] -- otherwise `simp` doesn't use `forall_image₂_iff`
lemma sup_image₂_le {g : γ → δ} {a : δ} :
    sup (image₂ f s t) g ≤ a ↔ ∀ x ∈ s, ∀ y ∈ t, g (f x y) ≤ a 
goal: (Finset.image₂ f s t).sup g ≤ a ↔ ∀ x ∈ s, ∀ y ∈ t, g (f x y) ≤ a

full_name: Finset.sup_image₂_left
code: lemma sup_image₂_left (g : γ → δ) : sup (image₂ f s t) g = sup s fun x ↦ sup t (g <| f x ·) 
goal: (Finset.image₂ f s t).sup g = s.sup fun x => t.sup fun x_1 => g (f x x_1)

full_name: Finset.sup_image₂_right
code: lemma sup_image₂_right (g : γ → δ) : sup (image₂ f s t) g = sup t fun y ↦ sup s (g <| f · y) 
goal: (Finset.image₂ f s t).sup g = t.sup fun y => s.sup fun x => g (f x y)

full_name: Finset.le_inf'_image₂
code: @[simp (default + 1)] -- otherwise `simp` doesn't use `forall_image₂_iff`
lemma le_inf'_image₂ {g : γ → δ} {a : δ} (h : (image₂ f s t).Nonempty) :
    a ≤ inf' (image₂ f s t) h g ↔ ∀ x ∈ s, ∀ y ∈ t, a ≤ g (f x y) 
goal: a ≤ (Finset.image₂ f s t).inf' h g ↔ ∀ x ∈ s, ∀ y ∈ t, a ≤ g (f x y)

full_name: Finset.inf'_image₂_left
code: lemma inf'_image₂_left (g : γ → δ) (h : (image₂ f s t).Nonempty) :
    inf' (image₂ f s t) h g =
      inf' s h.of_image₂_left fun x ↦ inf' t h.of_image₂_right (g <| f x ·) 
goal: (Finset.image₂ f s t).inf' h g = s.inf' ⋯ fun x => t.inf' ⋯ fun x_1 => g (f x x_1)

full_name: Finset.inf'_image₂_right
code: lemma inf'_image₂_right (g : γ → δ) (h : (image₂ f s t).Nonempty) :
    inf' (image₂ f s t) h g =
      inf' t h.of_image₂_right fun y ↦ inf' s h.of_image₂_left (g <| f · y) 
goal: (Finset.image₂ f s t).inf' h g = t.inf' ⋯ fun y => s.inf' ⋯ fun x => g (f x y)

full_name: Finset.le_inf_image₂
code: @[simp (default + 1)] -- otherwise `simp` doesn't use `forall_image₂_iff`
lemma le_inf_image₂ {g : γ → δ} {a : δ} :
    a ≤ inf (image₂ f s t) g ↔ ∀ x ∈ s, ∀ y ∈ t, a ≤ g (f x y) 
goal: a ≤ (Finset.image₂ f s t).inf g ↔ ∀ x ∈ s, ∀ y ∈ t, a ≤ g (f x y)

full_name: Finset.inf_image₂_left
code: lemma inf_image₂_left (g : γ → δ) : inf (image₂ f s t) g = inf s fun x ↦ inf t (g ∘ f x) 
goal: (Finset.image₂ f s t).inf g = s.inf fun x => t.inf (g ∘ f x)

full_name: Finset.inf_image₂_right
code: lemma inf_image₂_right (g : γ → δ) : inf (image₂ f s t) g = inf t fun y ↦ inf s (g <| f · y) 
goal: (Finset.image₂ f s t).inf g = t.inf fun y => s.inf fun x => g (f x y)

full_name: Fintype.piFinset_image₂
code: lemma piFinset_image₂ (f : ∀ i, α i → β i → γ i) (s : ∀ i, Finset (α i)) (t : ∀ i, Finset (β i)) :
    piFinset (fun i ↦ image₂ (f i) (s i) (t i)) =
      image₂ (fun a b i ↦ f _ (a i) (b i)) (piFinset s) (piFinset t) 
goal: (Fintype.piFinset fun i => Finset.image₂ (f i) (s i) (t i)) =
  Finset.image₂ (fun a b i => f i (a i) (b i)) (Fintype.piFinset s) (Fintype.piFinset t)

full_name: Set.toFinset_image2
code: @[simp]
theorem toFinset_image2 (f : α → β → γ) (s : Set α) (t : Set β) [Fintype s] [Fintype t]
    [Fintype (image2 f s t)] : (image2 f s t).toFinset = Finset.image₂ f s.toFinset t.toFinset 
goal: (Set.image2 f s t).toFinset = Finset.image₂ f s.toFinset t.toFinset

full_name: Set.Finite.toFinset_image2
code: theorem Finite.toFinset_image2 (f : α → β → γ) (hs : s.Finite) (ht : t.Finite)
    (hf := hs.image2 f ht) : hf.toFinset = Finset.image₂ f hs.toFinset ht.toFinset 
goal: Set.Finite.toFinset hf = Finset.image₂ f hs.toFinset ht.toFinset