data.finset.n_aryMathlib.Data.Finset.NAry

This file has been ported!

Changes since the initial port

The following section lists changes to this file in mathlib3 and mathlib4 that occured after the initial port. Most recent changes are shown first. Hovering over a commit will show all commits associated with the same mathlib3 commit.

Changes in mathlib3

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(last sync)

feat(data/finset/pointwise): |s| ∣ |s * t| (#18663)
Diff
@@ -358,6 +358,37 @@ lemma image₂_right_identity {f : γ → β → γ} {b : β} (h : ∀ a, f a b
   image₂ f s {b} = s :=
 by rw [image₂_singleton_right, funext h, image_id']
 
+/-- 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`. -/
+lemma card_dvd_card_image₂_right (hf : ∀ a ∈ s, injective (f a))
+  (hs : ((λ a, t.image $ f a) '' s).pairwise_disjoint id) :
+  t.card ∣ (image₂ f s t).card :=
+begin
+  classical,
+  induction s using finset.induction with a s ha ih,
+  { simp },
+  specialize ih (forall_of_forall_insert hf)
+    (hs.subset $ set.image_subset _ $ coe_subset.2 $ subset_insert _ _),
+  rw image₂_insert_left,
+  by_cases h : disjoint (image (f a) t) (image₂ f s t),
+  { rw card_union_eq h,
+    exact (card_image_of_injective _ $ hf _ $ mem_insert_self _ _).symm.dvd.add ih },
+  simp_rw [←bUnion_image_left, disjoint_bUnion_right, not_forall] at h,
+  obtain ⟨b, hb, h⟩ := h,
+  rwa union_eq_right_iff_subset.2,
+  exact (hs.eq (set.mem_image_of_mem _ $ mem_insert_self _ _)
+    (set.mem_image_of_mem _ $ mem_insert_of_mem hb) h).trans_subset (image_subset_image₂_right hb),
+end
+
+/-- 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`. -/
+lemma card_dvd_card_image₂_left (hf : ∀ b ∈ t, injective (λ a, f a b))
+  (ht : ((λ b, s.image $ λ a, f a b) '' t).pairwise_disjoint id) :
+  s.card ∣ (image₂ f s t).card :=
+by { rw ←image₂_swap, exact card_dvd_card_image₂_right hf ht }
+
 variables [decidable_eq α] [decidable_eq β]
 
 lemma image₂_inter_union_subset_union :

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

feat(data/{set,finset}/pointwise): a • t ⊆ s • t (#18697)

Eta expansion in the lemma statements is deliberate, to make the left and right lemmas more similar and allow further rewrites.

Also additivise finset.bUnion_smul_finset, fix the name of finset.smul_finset_mem_smul_finset to finset.smul_mem_smul_finset, move image2_swap/image₂_swap further up the file to let them be used in earlier proofs.

Diff
@@ -75,7 +75,7 @@ image₂_subset hs subset.rfl
 lemma image_subset_image₂_left (hb : b ∈ t) : s.image (λ a, f a b) ⊆ image₂ f s t :=
 image_subset_iff.2 $ λ a ha, mem_image₂_of_mem ha hb
 
-lemma image_subset_image₂_right (ha : a ∈ s) : t.image (f a) ⊆ image₂ f s t :=
+lemma image_subset_image₂_right (ha : a ∈ s) : t.image (λ b, f a b) ⊆ image₂ f s t :=
 image_subset_iff.2 $ λ b, mem_image₂_of_mem ha
 
 lemma forall_image₂_iff {p : γ → Prop} : (∀ z ∈ image₂ f s t, p z) ↔ ∀ (x ∈ s) (y ∈ t), p (f x y) :=
@@ -84,6 +84,12 @@ by simp_rw [←mem_coe, coe_image₂, forall_image2_iff]
 @[simp] lemma image₂_subset_iff : image₂ f s t ⊆ u ↔ ∀ (x ∈ s) (y ∈ t), f x y ∈ u :=
 forall_image₂_iff
 
+lemma image₂_subset_iff_left : image₂ f s t ⊆ u ↔ ∀ a ∈ s, t.image (λ b, f a b) ⊆ u :=
+by simp_rw [image₂_subset_iff, image_subset_iff]
+
+lemma image₂_subset_iff_right : image₂ f s t ⊆ u ↔ ∀ b ∈ t, s.image (λ a, f a b) ⊆ u :=
+by simp_rw [image₂_subset_iff, image_subset_iff, @forall₂_swap α]
+
 @[simp] lemma image₂_nonempty_iff : (image₂ f s t).nonempty ↔ s.nonempty ∧ t.nonempty :=
 by { rw [←coe_nonempty, coe_image₂], exact image2_nonempty_iff }
 
@@ -113,6 +119,14 @@ coe_injective $ by { push_cast, exact image2_union_left }
 lemma image₂_union_right [decidable_eq β] : image₂ f s (t ∪ t') = image₂ f s t ∪ image₂ f s t' :=
 coe_injective $ by { push_cast, exact image2_union_right }
 
+@[simp] lemma image₂_insert_left [decidable_eq α] :
+  image₂ f (insert a s) t = t.image (λ b, f a b) ∪ image₂ f s t :=
+coe_injective $ by { push_cast, exact image2_insert_left }
+
+@[simp] lemma image₂_insert_right [decidable_eq β] :
+  image₂ f s (insert b t) = s.image (λ a, f a b) ∪ image₂ f s t :=
+coe_injective $ by { push_cast, exact image2_insert_right }
+
 lemma image₂_inter_left [decidable_eq α] (hf : injective2 f) :
   image₂ f (s ∩ s') t = image₂ f s t ∩ image₂ f s' t :=
 coe_injective $ by { push_cast, exact image2_inter_left hf }
@@ -214,10 +228,6 @@ lemma image₂_image_right (f : α → γ → δ) (g : β → γ) :
   image₂ f s (t.image g) = image₂ (λ a b, f a (g b)) s t :=
 coe_injective $ by { push_cast, exact image2_image_right _ _ }
 
-lemma image₂_swap (f : α → β → γ) (s : finset α) (t : finset β) :
-  image₂ f s t = image₂ (λ a b, f b a) t s :=
-coe_injective $ by { push_cast, exact image2_swap _ _ _ }
-
 @[simp] lemma image₂_mk_eq_product [decidable_eq α] [decidable_eq β] (s : finset α) (t : finset β) :
   image₂ prod.mk s t = s ×ˢ t :=
 by ext; simp [prod.ext_iff]
@@ -229,6 +239,10 @@ by { classical, rw [←image₂_mk_eq_product, image_image₂, curry] }
 @[simp] lemma image_uncurry_product (f : α → β → γ) (s : finset α) (t : finset β) :
   (s ×ˢ t).image (uncurry f) = image₂ f s t := by rw [←image₂_curry, curry_uncurry]
 
+lemma image₂_swap (f : α → β → γ) (s : finset α) (t : finset β) :
+  image₂ f s t = image₂ (λ a b, f b a) t s :=
+coe_injective $ by { push_cast, exact image2_swap _ _ _ }
+
 @[simp] lemma image₂_left [decidable_eq α] (h : t.nonempty) : image₂ (λ x y, x) s t = s :=
 coe_injective $ by { push_cast, exact image2_left h }
 
@@ -346,6 +360,14 @@ by rw [image₂_singleton_right, funext h, image_id']
 
 variables [decidable_eq α] [decidable_eq β]
 
+lemma image₂_inter_union_subset_union :
+  image₂ f (s ∩ s') (t ∪ t') ⊆ image₂ f s t ∪ image₂ f s' t' :=
+coe_subset.1 $ by { push_cast, exact set.image2_inter_union_subset_union }
+
+lemma image₂_union_inter_subset_union :
+  image₂ f (s ∪ s') (t ∩ t') ⊆ image₂ f s t ∪ image₂ f s' t' :=
+coe_subset.1 $ by { push_cast, exact set.image2_union_inter_subset_union }
+
 lemma 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 :=
 coe_subset.1 $ by { push_cast, exact image2_inter_union_subset hf }

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

feat(data/finset/pointwise): s ∩ t * s ∪ t ⊆ s * t (#17961)

and distributivity of set.to_finset/set.finite.to_finset over algebraic operations.

Diff
@@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 -/
 import data.finset.prod
+import data.set.finite
 
 /-!
 # N-ary images of finsets
@@ -25,10 +26,10 @@ and `set.image2` already fulfills this task.
 
 open function set
 
-namespace finset
-
 variables {α α' β β' γ γ' δ δ' ε ε' ζ ζ' ν : Type*}
-  [decidable_eq α'] [decidable_eq β'] [decidable_eq γ] [decidable_eq γ'] [decidable_eq δ]
+
+namespace finset
+variables [decidable_eq α'] [decidable_eq β'] [decidable_eq γ] [decidable_eq γ'] [decidable_eq δ]
   [decidable_eq δ'] [decidable_eq ε] [decidable_eq ε']
   {f f' : α → β → γ} {g g' : α → β → γ → δ} {s s' : finset α} {t t' : finset β} {u u' : finset γ}
   {a a' : α} {b b' : β} {c : γ}
@@ -343,4 +344,29 @@ lemma image₂_right_identity {f : γ → β → γ} {b : β} (h : ∀ a, f a b
   image₂ f s {b} = s :=
 by rw [image₂_singleton_right, funext h, image_id']
 
+variables [decidable_eq α] [decidable_eq β]
+
+lemma 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 :=
+coe_subset.1 $ by { push_cast, exact image2_inter_union_subset hf }
+
+lemma 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 :=
+coe_subset.1 $ by { push_cast, exact image2_union_inter_subset hf }
+
 end finset
+
+namespace set
+variables [decidable_eq γ] {s : set α} {t : set β}
+
+@[simp] lemma to_finset_image2 (f : α → β → γ) (s : set α) (t : set β) [fintype s] [fintype t]
+  [fintype (image2 f s t)] :
+  (image2 f s t).to_finset = finset.image₂ f s.to_finset t.to_finset :=
+finset.coe_injective $ by simp
+
+lemma finite.to_finset_image2 (f : α → β → γ) (hs : s.finite) (ht : t.finite)
+  (hf := hs.image2 f ht) :
+  hf.to_finset = finset.image₂ f hs.to_finset ht.to_finset :=
+finset.coe_injective $ by simp
+
+end set

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

feat(data/set/sups): Set family operations (#18172)

Followup to #17947. Add a similar set API (but do not define set.disj_sups because I don't need it), correct a few lemma names and connect to upper/lower sets.

Diff
@@ -27,7 +27,7 @@ open function set
 
 namespace finset
 
-variables {α α' β β' γ γ' δ δ' ε ε' : Type*}
+variables {α α' β β' γ γ' δ δ' ε ε' ζ ζ' ν : Type*}
   [decidable_eq α'] [decidable_eq β'] [decidable_eq γ] [decidable_eq γ'] [decidable_eq δ]
   [decidable_eq δ'] [decidable_eq ε] [decidable_eq ε']
   {f f' : α → β → γ} {g g' : α → β → γ → δ} {s s' : finset α} {t t' : finset β} {u u' : finset γ}
@@ -71,11 +71,11 @@ lemma image₂_subset_left (ht : t ⊆ t') : image₂ f s t ⊆ image₂ f s t'
 lemma image₂_subset_right (hs : s ⊆ s') : image₂ f s t ⊆ image₂ f s' t :=
 image₂_subset hs subset.rfl
 
-lemma image_subset_image₂_left (hb : b ∈ t) : (λ a, f a b) '' s ⊆ image₂ f s t :=
-ball_image_of_ball $ λ a ha, mem_image₂_of_mem ha hb
+lemma image_subset_image₂_left (hb : b ∈ t) : s.image (λ a, f a b) ⊆ image₂ f s t :=
+image_subset_iff.2 $ λ a ha, mem_image₂_of_mem ha hb
 
-lemma image_subset_image₂_right (ha : a ∈ s) : f a '' t ⊆ image₂ f s t :=
-ball_image_of_ball $ λ b, mem_image₂_of_mem ha
+lemma image_subset_image₂_right (ha : a ∈ s) : t.image (f a) ⊆ image₂ f s t :=
+image_subset_iff.2 $ λ b, mem_image₂_of_mem ha
 
 lemma forall_image₂_iff {p : γ → Prop} : (∀ z ∈ image₂ f s t, p z) ↔ ∀ (x ∈ s) (y ∈ t), p (f x y) :=
 by simp_rw [←mem_coe, coe_image₂, forall_image2_iff]
@@ -252,6 +252,13 @@ lemma image₂_right_comm {γ : Type*} {u : finset γ} {f : δ → γ → ε} {g
   image₂ f (image₂ g s t) u = image₂ g' (image₂ f' s u) t :=
 coe_injective $ by { push_cast, exact image2_right_comm h_right_comm }
 
+lemma image₂_image₂_image₂_comm {γ δ : Type*} {u : finset γ} {v : finset δ} [decidable_eq ζ]
+  [decidable_eq ζ'] [decidable_eq ν] {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) :=
+coe_injective $ by { push_cast, exact image2_image2_image2_comm h_comm }
+
 lemma 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₂) :=

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

refactor(*): use option.map₂ (#18081)

Relevant parts are forward-ported as leanprover-community/mathlib4#1439

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>

Diff
@@ -321,4 +321,16 @@ lemma image_image₂_right_anticomm {f : α → β' → γ} {g : β → β'} {f'
   image₂ f s (t.image g) = (image₂ f' t s).image g' :=
 (image_image₂_antidistrib_right $ λ a b, (h_right_anticomm b a).symm).symm
 
+/-- If `a` is a left identity for `f : α → β → β`, then `{a}` is a left identity for
+`finset.image₂ f`. -/
+lemma image₂_left_identity {f : α → γ → γ} {a : α} (h : ∀ b, f a b = b) (t : finset γ) :
+  image₂ f {a} t = t :=
+coe_injective $ by rw [coe_image₂, coe_singleton, set.image2_left_identity h]
+
+/-- If `b` is a right identity for `f : α → β → α`, then `{b}` is a right identity for
+`finset.image₂ f`. -/
+lemma image₂_right_identity {f : γ → β → γ} {b : β} (h : ∀ a, f a b = a) (s : finset γ) :
+  image₂ f s {b} = s :=
+by rw [image₂_singleton_right, funext h, image_id']
+
 end finset

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(first ported)

Changes in mathlib3port

mathlib3
mathlib3port
Diff
@@ -49,7 +49,7 @@ def image₂ (f : α → β → γ) (s : Finset α) (t : Finset β) : Finset γ
 #print Finset.mem_image₂ /-
 @[simp]
 theorem mem_image₂ : c ∈ image₂ f s t ↔ ∃ a b, a ∈ s ∧ b ∈ t ∧ f a b = c := by
-  simp [image₂, and_assoc']
+  simp [image₂, and_assoc]
 #align finset.mem_image₂ Finset.mem_image₂
 -/
 
Diff
@@ -631,7 +631,7 @@ theorem card_dvd_card_image₂_right (hf : ∀ a ∈ s, Injective (f a))
   by_cases h : Disjoint (image (f a) t) (image₂ f s t)
   · rw [card_union_eq h]
     exact (card_image_of_injective _ <| hf _ <| mem_insert_self _ _).symm.Dvd.add ih
-  simp_rw [← bUnion_image_left, disjoint_bUnion_right, Classical.not_forall] at h 
+  simp_rw [← bUnion_image_left, disjoint_bUnion_right, Classical.not_forall] at h
   obtain ⟨b, hb, h⟩ := h
   rwa [union_eq_right_iff_subset.2]
   exact
Diff
@@ -416,7 +416,8 @@ theorem image₂_mk_eq_product [DecidableEq α] [DecidableEq β] (s : Finset α)
 #print Finset.image₂_curry /-
 @[simp]
 theorem image₂_curry (f : α × β → γ) (s : Finset α) (t : Finset β) :
-    image₂ (curry f) s t = (s ×ˢ t).image f := by classical
+    image₂ (curry f) s t = (s ×ˢ t).image f := by
+  classical rw [← image₂_mk_eq_product, image_image₂, curry]
 #align finset.image₂_curry Finset.image₂_curry
 -/
 
@@ -621,6 +622,22 @@ applications are disjoint (but not necessarily distinct!), then the size of `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 := by
   classical
+  induction' s using Finset.induction with a s ha ih
+  · simp
+  specialize
+    ih (forall_of_forall_insert hf)
+      (hs.subset <| Set.image_subset _ <| coe_subset.2 <| subset_insert _ _)
+  rw [image₂_insert_left]
+  by_cases h : Disjoint (image (f a) t) (image₂ f s t)
+  · rw [card_union_eq h]
+    exact (card_image_of_injective _ <| hf _ <| mem_insert_self _ _).symm.Dvd.add ih
+  simp_rw [← bUnion_image_left, disjoint_bUnion_right, Classical.not_forall] at h 
+  obtain ⟨b, hb, h⟩ := h
+  rwa [union_eq_right_iff_subset.2]
+  exact
+    (hs.eq (Set.mem_image_of_mem _ <| mem_insert_self _ _)
+          (Set.mem_image_of_mem _ <| mem_insert_of_mem hb) h).trans_subset
+      (image_subset_image₂_right hb)
 #align finset.card_dvd_card_image₂_right Finset.card_dvd_card_image₂_right
 -/
 
Diff
@@ -416,8 +416,7 @@ theorem image₂_mk_eq_product [DecidableEq α] [DecidableEq β] (s : Finset α)
 #print Finset.image₂_curry /-
 @[simp]
 theorem image₂_curry (f : α × β → γ) (s : Finset α) (t : Finset β) :
-    image₂ (curry f) s t = (s ×ˢ t).image f := by
-  classical rw [← image₂_mk_eq_product, image_image₂, curry]
+    image₂ (curry f) s t = (s ×ˢ t).image f := by classical
 #align finset.image₂_curry Finset.image₂_curry
 -/
 
@@ -622,22 +621,6 @@ applications are disjoint (but not necessarily distinct!), then the size of `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 := by
   classical
-  induction' s using Finset.induction with a s ha ih
-  · simp
-  specialize
-    ih (forall_of_forall_insert hf)
-      (hs.subset <| Set.image_subset _ <| coe_subset.2 <| subset_insert _ _)
-  rw [image₂_insert_left]
-  by_cases h : Disjoint (image (f a) t) (image₂ f s t)
-  · rw [card_union_eq h]
-    exact (card_image_of_injective _ <| hf _ <| mem_insert_self _ _).symm.Dvd.add ih
-  simp_rw [← bUnion_image_left, disjoint_bUnion_right, Classical.not_forall] at h 
-  obtain ⟨b, hb, h⟩ := h
-  rwa [union_eq_right_iff_subset.2]
-  exact
-    (hs.eq (Set.mem_image_of_mem _ <| mem_insert_self _ _)
-          (Set.mem_image_of_mem _ <| mem_insert_of_mem hb) h).trans_subset
-      (image_subset_image₂_right hb)
 #align finset.card_dvd_card_image₂_right Finset.card_dvd_card_image₂_right
 -/
 
Diff
@@ -224,13 +224,13 @@ theorem image₂_singleton : image₂ f {a} {b} = {f a b} := by simp
 
 #print Finset.image₂_union_left /-
 theorem image₂_union_left [DecidableEq α] : image₂ f (s ∪ s') t = image₂ f s t ∪ image₂ f s' t :=
-  coe_injective <| by push_cast ; exact image2_union_left
+  coe_injective <| by push_cast; exact image2_union_left
 #align finset.image₂_union_left Finset.image₂_union_left
 -/
 
 #print Finset.image₂_union_right /-
 theorem image₂_union_right [DecidableEq β] : image₂ f s (t ∪ t') = image₂ f s t ∪ image₂ f s t' :=
-  coe_injective <| by push_cast ; exact image2_union_right
+  coe_injective <| by push_cast; exact image2_union_right
 #align finset.image₂_union_right Finset.image₂_union_right
 -/
 
@@ -238,7 +238,7 @@ theorem image₂_union_right [DecidableEq β] : image₂ f s (t ∪ t') = image
 @[simp]
 theorem image₂_insert_left [DecidableEq α] :
     image₂ f (insert a s) t = (t.image fun b => f a b) ∪ image₂ f s t :=
-  coe_injective <| by push_cast ; exact image2_insert_left
+  coe_injective <| by push_cast; exact image2_insert_left
 #align finset.image₂_insert_left Finset.image₂_insert_left
 -/
 
@@ -246,41 +246,41 @@ theorem image₂_insert_left [DecidableEq α] :
 @[simp]
 theorem image₂_insert_right [DecidableEq β] :
     image₂ f s (insert b t) = (s.image fun a => f a b) ∪ image₂ f s t :=
-  coe_injective <| by push_cast ; exact image2_insert_right
+  coe_injective <| by push_cast; exact image2_insert_right
 #align finset.image₂_insert_right Finset.image₂_insert_right
 -/
 
 #print Finset.image₂_inter_left /-
 theorem image₂_inter_left [DecidableEq α] (hf : Injective2 f) :
     image₂ f (s ∩ s') t = image₂ f s t ∩ image₂ f s' t :=
-  coe_injective <| by push_cast ; exact image2_inter_left hf
+  coe_injective <| by push_cast; exact image2_inter_left hf
 #align finset.image₂_inter_left Finset.image₂_inter_left
 -/
 
 #print Finset.image₂_inter_right /-
 theorem image₂_inter_right [DecidableEq β] (hf : Injective2 f) :
     image₂ f s (t ∩ t') = image₂ f s t ∩ image₂ f s t' :=
-  coe_injective <| by push_cast ; exact image2_inter_right hf
+  coe_injective <| by push_cast; exact image2_inter_right hf
 #align finset.image₂_inter_right Finset.image₂_inter_right
 -/
 
 #print Finset.image₂_inter_subset_left /-
 theorem image₂_inter_subset_left [DecidableEq α] :
     image₂ f (s ∩ s') t ⊆ image₂ f s t ∩ image₂ f s' t :=
-  coe_subset.1 <| by push_cast ; exact image2_inter_subset_left
+  coe_subset.1 <| by push_cast; exact image2_inter_subset_left
 #align finset.image₂_inter_subset_left Finset.image₂_inter_subset_left
 -/
 
 #print Finset.image₂_inter_subset_right /-
 theorem image₂_inter_subset_right [DecidableEq β] :
     image₂ f s (t ∩ t') ⊆ image₂ f s t ∩ image₂ f s t' :=
-  coe_subset.1 <| by push_cast ; exact image2_inter_subset_right
+  coe_subset.1 <| by push_cast; exact image2_inter_subset_right
 #align finset.image₂_inter_subset_right Finset.image₂_inter_subset_right
 -/
 
 #print Finset.image₂_congr /-
 theorem image₂_congr (h : ∀ a ∈ s, ∀ b ∈ t, f a b = f' a b) : image₂ f s t = image₂ f' s t :=
-  coe_injective <| by push_cast ; exact image2_congr h
+  coe_injective <| by push_cast; exact image2_congr h
 #align finset.image₂_congr Finset.image₂_congr
 -/
 
@@ -362,13 +362,13 @@ variable {s t}
 
 #print Finset.biUnion_image_left /-
 theorem biUnion_image_left : (s.biUnion fun a => t.image <| f a) = image₂ f s t :=
-  coe_injective <| by push_cast ; exact Set.iUnion_image_left _
+  coe_injective <| by push_cast; exact Set.iUnion_image_left _
 #align finset.bUnion_image_left Finset.biUnion_image_left
 -/
 
 #print Finset.biUnion_image_right /-
 theorem biUnion_image_right : (t.biUnion fun b => s.image fun a => f a b) = image₂ f s t :=
-  coe_injective <| by push_cast ; exact Set.iUnion_image_right _
+  coe_injective <| by push_cast; exact Set.iUnion_image_right _
 #align finset.bUnion_image_right Finset.biUnion_image_right
 -/
 
@@ -386,21 +386,21 @@ The proof pattern is `image₂_lemma operation_lemma`. For example, `image₂_co
 #print Finset.image_image₂ /-
 theorem image_image₂ (f : α → β → γ) (g : γ → δ) :
     (image₂ f s t).image g = image₂ (fun a b => g (f a b)) s t :=
-  coe_injective <| by push_cast ; exact image_image2 _ _
+  coe_injective <| by push_cast; exact image_image2 _ _
 #align finset.image_image₂ Finset.image_image₂
 -/
 
 #print Finset.image₂_image_left /-
 theorem image₂_image_left (f : γ → β → δ) (g : α → γ) :
     image₂ f (s.image g) t = image₂ (fun a b => f (g a) b) s t :=
-  coe_injective <| by push_cast ; exact image2_image_left _ _
+  coe_injective <| by push_cast; exact image2_image_left _ _
 #align finset.image₂_image_left Finset.image₂_image_left
 -/
 
 #print Finset.image₂_image_right /-
 theorem image₂_image_right (f : α → γ → δ) (g : β → γ) :
     image₂ f s (t.image g) = image₂ (fun a b => f a (g b)) s t :=
-  coe_injective <| by push_cast ; exact image2_image_right _ _
+  coe_injective <| by push_cast; exact image2_image_right _ _
 #align finset.image₂_image_right Finset.image₂_image_right
 -/
 
@@ -432,21 +432,21 @@ theorem image_uncurry_product (f : α → β → γ) (s : Finset α) (t : Finset
 #print Finset.image₂_swap /-
 theorem image₂_swap (f : α → β → γ) (s : Finset α) (t : Finset β) :
     image₂ f s t = image₂ (fun a b => f b a) t s :=
-  coe_injective <| by push_cast ; exact image2_swap _ _ _
+  coe_injective <| by push_cast; exact image2_swap _ _ _
 #align finset.image₂_swap Finset.image₂_swap
 -/
 
 #print Finset.image₂_left /-
 @[simp]
 theorem image₂_left [DecidableEq α] (h : t.Nonempty) : image₂ (fun x y => x) s t = s :=
-  coe_injective <| by push_cast ; exact image2_left h
+  coe_injective <| by push_cast; exact image2_left h
 #align finset.image₂_left Finset.image₂_left
 -/
 
 #print Finset.image₂_right /-
 @[simp]
 theorem image₂_right [DecidableEq β] (h : s.Nonempty) : image₂ (fun x y => y) s t = t :=
-  coe_injective <| by push_cast ; exact image2_right h
+  coe_injective <| by push_cast; exact image2_right h
 #align finset.image₂_right Finset.image₂_right
 -/
 
@@ -454,7 +454,7 @@ theorem image₂_right [DecidableEq β] (h : s.Nonempty) : image₂ (fun x y =>
 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) :=
-  coe_injective <| by push_cast ; exact image2_assoc h_assoc
+  coe_injective <| by push_cast; exact image2_assoc h_assoc
 #align finset.image₂_assoc Finset.image₂_assoc
 -/
 
@@ -468,7 +468,7 @@ theorem image₂_comm {g : β → α → γ} (h_comm : ∀ a b, f a b = g b a) :
 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) :=
-  coe_injective <| by push_cast ; exact image2_left_comm h_left_comm
+  coe_injective <| by push_cast; exact image2_left_comm h_left_comm
 #align finset.image₂_left_comm Finset.image₂_left_comm
 -/
 
@@ -476,7 +476,7 @@ theorem image₂_left_comm {γ : Type _} {u : Finset γ} {f : α → δ → ε}
 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 :=
-  coe_injective <| by push_cast ; exact image2_right_comm h_right_comm
+  coe_injective <| by push_cast; exact image2_right_comm h_right_comm
 #align finset.image₂_right_comm Finset.image₂_right_comm
 -/
 
@@ -486,7 +486,7 @@ theorem image₂_image₂_image₂_comm {γ δ : Type _} {u : Finset γ} {v : Fi
     {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) :=
-  coe_injective <| by push_cast ; exact image2_image2_image2_comm h_comm
+  coe_injective <| by push_cast; exact image2_image2_image2_comm h_comm
 #align finset.image₂_image₂_image₂_comm Finset.image₂_image₂_image₂_comm
 -/
 
@@ -494,7 +494,7 @@ theorem image₂_image₂_image₂_comm {γ δ : Type _} {u : Finset γ} {v : Fi
 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₂) :=
-  coe_injective <| by push_cast ; exact image_image2_distrib h_distrib
+  coe_injective <| by push_cast; exact image_image2_distrib h_distrib
 #align finset.image_image₂_distrib Finset.image_image₂_distrib
 -/
 
@@ -503,7 +503,7 @@ theorem image_image₂_distrib {g : γ → δ} {f' : α' → β' → δ} {g₁ :
 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 :=
-  coe_injective <| by push_cast ; exact image_image2_distrib_left h_distrib
+  coe_injective <| by push_cast; exact image_image2_distrib_left h_distrib
 #align finset.image_image₂_distrib_left Finset.image_image₂_distrib_left
 -/
 
@@ -512,7 +512,7 @@ theorem image_image₂_distrib_left {g : γ → δ} {f' : α' → β → δ} {g'
 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') :=
-  coe_injective <| by push_cast ; exact image_image2_distrib_right h_distrib
+  coe_injective <| by push_cast; exact image_image2_distrib_right h_distrib
 #align finset.image_image₂_distrib_right Finset.image_image₂_distrib_right
 -/
 
@@ -540,7 +540,7 @@ theorem image₂_distrib_subset_left {γ : Type _} {u : Finset γ} {f : α → 
     {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) :=
-  coe_subset.1 <| by push_cast ; exact Set.image2_distrib_subset_left h_distrib
+  coe_subset.1 <| by push_cast; exact Set.image2_distrib_subset_left h_distrib
 #align finset.image₂_distrib_subset_left Finset.image₂_distrib_subset_left
 -/
 
@@ -550,7 +550,7 @@ theorem image₂_distrib_subset_right {γ : Type _} {u : Finset γ} {f : δ →
     {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) :=
-  coe_subset.1 <| by push_cast ; exact Set.image2_distrib_subset_right h_distrib
+  coe_subset.1 <| by push_cast; exact Set.image2_distrib_subset_right h_distrib
 #align finset.image₂_distrib_subset_right Finset.image₂_distrib_subset_right
 -/
 
@@ -567,7 +567,7 @@ theorem image_image₂_antidistrib {g : γ → δ} {f' : β' → α' → δ} {g
 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 :=
-  coe_injective <| by push_cast ; exact image_image2_antidistrib_left h_antidistrib
+  coe_injective <| by push_cast; exact image_image2_antidistrib_left h_antidistrib
 #align finset.image_image₂_antidistrib_left Finset.image_image₂_antidistrib_left
 -/
 
@@ -576,7 +576,7 @@ theorem image_image₂_antidistrib_left {g : γ → δ} {f' : β' → α → δ}
 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') :=
-  coe_injective <| by push_cast ; exact image_image2_antidistrib_right h_antidistrib
+  coe_injective <| by push_cast; exact image_image2_antidistrib_right h_antidistrib
 #align finset.image_image₂_antidistrib_right Finset.image_image₂_antidistrib_right
 -/
 
@@ -656,28 +656,28 @@ variable [DecidableEq α] [DecidableEq β]
 #print Finset.image₂_inter_union_subset_union /-
 theorem image₂_inter_union_subset_union :
     image₂ f (s ∩ s') (t ∪ t') ⊆ image₂ f s t ∪ image₂ f s' t' :=
-  coe_subset.1 <| by push_cast ; exact Set.image2_inter_union_subset_union
+  coe_subset.1 <| by push_cast; exact Set.image2_inter_union_subset_union
 #align finset.image₂_inter_union_subset_union Finset.image₂_inter_union_subset_union
 -/
 
 #print Finset.image₂_union_inter_subset_union /-
 theorem image₂_union_inter_subset_union :
     image₂ f (s ∪ s') (t ∩ t') ⊆ image₂ f s t ∪ image₂ f s' t' :=
-  coe_subset.1 <| by push_cast ; exact Set.image2_union_inter_subset_union
+  coe_subset.1 <| by push_cast; exact Set.image2_union_inter_subset_union
 #align finset.image₂_union_inter_subset_union Finset.image₂_union_inter_subset_union
 -/
 
 #print Finset.image₂_inter_union_subset /-
 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 :=
-  coe_subset.1 <| by push_cast ; exact image2_inter_union_subset hf
+  coe_subset.1 <| by push_cast; exact image2_inter_union_subset hf
 #align finset.image₂_inter_union_subset Finset.image₂_inter_union_subset
 -/
 
 #print Finset.image₂_union_inter_subset /-
 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 :=
-  coe_subset.1 <| by push_cast ; exact image2_union_inter_subset hf
+  coe_subset.1 <| by push_cast; exact image2_union_inter_subset hf
 #align finset.image₂_union_inter_subset Finset.image₂_union_inter_subset
 -/
 
Diff
@@ -631,7 +631,7 @@ theorem card_dvd_card_image₂_right (hf : ∀ a ∈ s, Injective (f a))
   by_cases h : Disjoint (image (f a) t) (image₂ f s t)
   · rw [card_union_eq h]
     exact (card_image_of_injective _ <| hf _ <| mem_insert_self _ _).symm.Dvd.add ih
-  simp_rw [← bUnion_image_left, disjoint_bUnion_right, not_forall] at h 
+  simp_rw [← bUnion_image_left, disjoint_bUnion_right, Classical.not_forall] at h 
   obtain ⟨b, hb, h⟩ := h
   rwa [union_eq_right_iff_subset.2]
   exact
Diff
@@ -3,8 +3,8 @@ Copyright (c) 2022 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 -/
-import Mathbin.Data.Finset.Prod
-import Mathbin.Data.Set.Finite
+import Data.Finset.Prod
+import Data.Set.Finite
 
 #align_import data.finset.n_ary from "leanprover-community/mathlib"@"eba7871095e834365616b5e43c8c7bb0b37058d0"
 
Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2022 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
-
-! This file was ported from Lean 3 source module data.finset.n_ary
-! leanprover-community/mathlib commit eba7871095e834365616b5e43c8c7bb0b37058d0
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.Finset.Prod
 import Mathbin.Data.Set.Finite
 
+#align_import data.finset.n_ary from "leanprover-community/mathlib"@"eba7871095e834365616b5e43c8c7bb0b37058d0"
+
 /-!
 # N-ary images of finsets
 
Diff
@@ -305,7 +305,7 @@ theorem subset_image₂ {s : Set α} {t : Set β} (hu : ↑u ⊆ image2 f s t) :
   haveI := Classical.decEq α
   haveI := Classical.decEq β
   refine' ⟨insert x s', insert y t', _⟩
-  simp_rw [coe_insert, Set.insert_subset]
+  simp_rw [coe_insert, Set.insert_subset_iff]
   exact
     ⟨⟨hx, hs⟩, ⟨hy, hs'⟩,
       insert_subset.2
Diff
@@ -618,6 +618,7 @@ theorem image₂_right_identity {f : γ → β → γ} {b : β} (h : ∀ a, f a
 #align finset.image₂_right_identity Finset.image₂_right_identity
 -/
 
+#print Finset.card_dvd_card_image₂_right /-
 /-- 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`. -/
@@ -641,7 +642,9 @@ theorem card_dvd_card_image₂_right (hf : ∀ a ∈ s, Injective (f a))
           (Set.mem_image_of_mem _ <| mem_insert_of_mem hb) h).trans_subset
       (image_subset_image₂_right hb)
 #align finset.card_dvd_card_image₂_right Finset.card_dvd_card_image₂_right
+-/
 
+#print Finset.card_dvd_card_image₂_left /-
 /-- 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`. -/
@@ -649,6 +652,7 @@ 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 := by rw [← image₂_swap]; exact card_dvd_card_image₂_right hf ht
 #align finset.card_dvd_card_image₂_left Finset.card_dvd_card_image₂_left
+-/
 
 variable [DecidableEq α] [DecidableEq β]
 
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module data.finset.n_ary
-! leanprover-community/mathlib commit 5e526d18cea33550268dcbbddcb822d5cde40654
+! leanprover-community/mathlib commit eba7871095e834365616b5e43c8c7bb0b37058d0
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -618,6 +618,38 @@ theorem image₂_right_identity {f : γ → β → γ} {b : β} (h : ∀ a, f a
 #align finset.image₂_right_identity Finset.image₂_right_identity
 -/
 
+/-- 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 := by
+  classical
+  induction' s using Finset.induction with a s ha ih
+  · simp
+  specialize
+    ih (forall_of_forall_insert hf)
+      (hs.subset <| Set.image_subset _ <| coe_subset.2 <| subset_insert _ _)
+  rw [image₂_insert_left]
+  by_cases h : Disjoint (image (f a) t) (image₂ f s t)
+  · rw [card_union_eq h]
+    exact (card_image_of_injective _ <| hf _ <| mem_insert_self _ _).symm.Dvd.add ih
+  simp_rw [← bUnion_image_left, disjoint_bUnion_right, not_forall] at h 
+  obtain ⟨b, hb, h⟩ := h
+  rwa [union_eq_right_iff_subset.2]
+  exact
+    (hs.eq (Set.mem_image_of_mem _ <| mem_insert_self _ _)
+          (Set.mem_image_of_mem _ <| mem_insert_of_mem hb) h).trans_subset
+      (image_subset_image₂_right hb)
+#align finset.card_dvd_card_image₂_right Finset.card_dvd_card_image₂_right
+
+/-- 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 := by rw [← image₂_swap]; exact card_dvd_card_image₂_right hf ht
+#align finset.card_dvd_card_image₂_left Finset.card_dvd_card_image₂_left
+
 variable [DecidableEq α] [DecidableEq β]
 
 #print Finset.image₂_inter_union_subset_union /-
Diff
@@ -49,177 +49,252 @@ def image₂ (f : α → β → γ) (s : Finset α) (t : Finset β) : Finset γ
 #align finset.image₂ Finset.image₂
 -/
 
+#print Finset.mem_image₂ /-
 @[simp]
 theorem mem_image₂ : c ∈ image₂ f s t ↔ ∃ a b, a ∈ s ∧ b ∈ t ∧ f a b = c := by
   simp [image₂, and_assoc']
 #align finset.mem_image₂ Finset.mem_image₂
+-/
 
+#print Finset.coe_image₂ /-
 @[simp, norm_cast]
 theorem coe_image₂ (f : α → β → γ) (s : Finset α) (t : Finset β) :
     (image₂ f s t : Set γ) = Set.image2 f s t :=
   Set.ext fun _ => mem_image₂
 #align finset.coe_image₂ Finset.coe_image₂
+-/
 
+#print Finset.card_image₂_le /-
 theorem card_image₂_le (f : α → β → γ) (s : Finset α) (t : Finset β) :
     (image₂ f s t).card ≤ s.card * t.card :=
   card_image_le.trans_eq <| card_product _ _
 #align finset.card_image₂_le Finset.card_image₂_le
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print Finset.card_image₂_iff /-
 theorem card_image₂_iff :
     (image₂ f s t).card = s.card * t.card ↔ (s ×ˢ t : Set (α × β)).InjOn fun x => f x.1 x.2 := by
   rw [← card_product, ← coe_product]; exact card_image_iff
 #align finset.card_image₂_iff Finset.card_image₂_iff
+-/
 
+#print Finset.card_image₂ /-
 theorem card_image₂ (hf : Injective2 f) (s : Finset α) (t : Finset β) :
     (image₂ f s t).card = s.card * t.card :=
   (card_image_of_injective _ hf.uncurry).trans <| card_product _ _
 #align finset.card_image₂ Finset.card_image₂
+-/
 
+#print Finset.mem_image₂_of_mem /-
 theorem mem_image₂_of_mem (ha : a ∈ s) (hb : b ∈ t) : f a b ∈ image₂ f s t :=
   mem_image₂.2 ⟨a, b, ha, hb, rfl⟩
 #align finset.mem_image₂_of_mem Finset.mem_image₂_of_mem
+-/
 
+#print Finset.mem_image₂_iff /-
 theorem mem_image₂_iff (hf : Injective2 f) : f a b ∈ image₂ f s t ↔ a ∈ s ∧ b ∈ t := by
   rw [← mem_coe, coe_image₂, mem_image2_iff hf, mem_coe, mem_coe]
 #align finset.mem_image₂_iff Finset.mem_image₂_iff
+-/
 
+#print Finset.image₂_subset /-
 theorem image₂_subset (hs : s ⊆ s') (ht : t ⊆ t') : image₂ f s t ⊆ image₂ f s' t' := by
   rw [← coe_subset, coe_image₂, coe_image₂]; exact image2_subset hs ht
 #align finset.image₂_subset Finset.image₂_subset
+-/
 
+#print Finset.image₂_subset_left /-
 theorem image₂_subset_left (ht : t ⊆ t') : image₂ f s t ⊆ image₂ f s t' :=
   image₂_subset Subset.rfl ht
 #align finset.image₂_subset_left Finset.image₂_subset_left
+-/
 
+#print Finset.image₂_subset_right /-
 theorem image₂_subset_right (hs : s ⊆ s') : image₂ f s t ⊆ image₂ f s' t :=
   image₂_subset hs Subset.rfl
 #align finset.image₂_subset_right Finset.image₂_subset_right
+-/
 
+#print Finset.image_subset_image₂_left /-
 theorem image_subset_image₂_left (hb : b ∈ t) : (s.image fun a => f a b) ⊆ image₂ f s t :=
   image_subset_iff.2 fun a ha => mem_image₂_of_mem ha hb
 #align finset.image_subset_image₂_left Finset.image_subset_image₂_left
+-/
 
+#print Finset.image_subset_image₂_right /-
 theorem image_subset_image₂_right (ha : a ∈ s) : (t.image fun b => f a b) ⊆ image₂ f s t :=
   image_subset_iff.2 fun b => mem_image₂_of_mem ha
 #align finset.image_subset_image₂_right Finset.image_subset_image₂_right
+-/
 
+#print Finset.forall_image₂_iff /-
 theorem forall_image₂_iff {p : γ → Prop} :
     (∀ z ∈ image₂ f s t, p z) ↔ ∀ x ∈ s, ∀ y ∈ t, p (f x y) := by
   simp_rw [← mem_coe, coe_image₂, forall_image2_iff]
 #align finset.forall_image₂_iff Finset.forall_image₂_iff
+-/
 
+#print Finset.image₂_subset_iff /-
 @[simp]
 theorem image₂_subset_iff : image₂ f s t ⊆ u ↔ ∀ x ∈ s, ∀ y ∈ t, f x y ∈ u :=
   forall_image₂_iff
 #align finset.image₂_subset_iff Finset.image₂_subset_iff
+-/
 
+#print Finset.image₂_subset_iff_left /-
 theorem image₂_subset_iff_left : image₂ f s t ⊆ u ↔ ∀ a ∈ s, (t.image fun b => f a b) ⊆ u := by
   simp_rw [image₂_subset_iff, image_subset_iff]
 #align finset.image₂_subset_iff_left Finset.image₂_subset_iff_left
+-/
 
+#print Finset.image₂_subset_iff_right /-
 theorem image₂_subset_iff_right : image₂ f s t ⊆ u ↔ ∀ b ∈ t, (s.image fun a => f a b) ⊆ u := by
   simp_rw [image₂_subset_iff, image_subset_iff, @forall₂_swap α]
 #align finset.image₂_subset_iff_right Finset.image₂_subset_iff_right
+-/
 
+#print Finset.image₂_nonempty_iff /-
 @[simp]
 theorem image₂_nonempty_iff : (image₂ f s t).Nonempty ↔ s.Nonempty ∧ t.Nonempty := by
   rw [← coe_nonempty, coe_image₂]; exact image2_nonempty_iff
 #align finset.image₂_nonempty_iff Finset.image₂_nonempty_iff
+-/
 
+#print Finset.Nonempty.image₂ /-
 theorem Nonempty.image₂ (hs : s.Nonempty) (ht : t.Nonempty) : (image₂ f s t).Nonempty :=
   image₂_nonempty_iff.2 ⟨hs, ht⟩
 #align finset.nonempty.image₂ Finset.Nonempty.image₂
+-/
 
+#print Finset.Nonempty.of_image₂_left /-
 theorem Nonempty.of_image₂_left (h : (image₂ f s t).Nonempty) : s.Nonempty :=
   (image₂_nonempty_iff.1 h).1
 #align finset.nonempty.of_image₂_left Finset.Nonempty.of_image₂_left
+-/
 
+#print Finset.Nonempty.of_image₂_right /-
 theorem Nonempty.of_image₂_right (h : (image₂ f s t).Nonempty) : t.Nonempty :=
   (image₂_nonempty_iff.1 h).2
 #align finset.nonempty.of_image₂_right Finset.Nonempty.of_image₂_right
+-/
 
+#print Finset.image₂_empty_left /-
 @[simp]
 theorem image₂_empty_left : image₂ f ∅ t = ∅ :=
   coe_injective <| by simp
 #align finset.image₂_empty_left Finset.image₂_empty_left
+-/
 
+#print Finset.image₂_empty_right /-
 @[simp]
 theorem image₂_empty_right : image₂ f s ∅ = ∅ :=
   coe_injective <| by simp
 #align finset.image₂_empty_right Finset.image₂_empty_right
+-/
 
+#print Finset.image₂_eq_empty_iff /-
 @[simp]
 theorem image₂_eq_empty_iff : image₂ f s t = ∅ ↔ s = ∅ ∨ t = ∅ := by
   simp_rw [← not_nonempty_iff_eq_empty, image₂_nonempty_iff, not_and_or]
 #align finset.image₂_eq_empty_iff Finset.image₂_eq_empty_iff
+-/
 
+#print Finset.image₂_singleton_left /-
 @[simp]
 theorem image₂_singleton_left : image₂ f {a} t = t.image fun b => f a b :=
   ext fun x => by simp
 #align finset.image₂_singleton_left Finset.image₂_singleton_left
+-/
 
+#print Finset.image₂_singleton_right /-
 @[simp]
 theorem image₂_singleton_right : image₂ f s {b} = s.image fun a => f a b :=
   ext fun x => by simp
 #align finset.image₂_singleton_right Finset.image₂_singleton_right
+-/
 
+#print Finset.image₂_singleton_left' /-
 theorem image₂_singleton_left' : image₂ f {a} t = t.image (f a) :=
   image₂_singleton_left
 #align finset.image₂_singleton_left' Finset.image₂_singleton_left'
+-/
 
+#print Finset.image₂_singleton /-
 theorem image₂_singleton : image₂ f {a} {b} = {f a b} := by simp
 #align finset.image₂_singleton Finset.image₂_singleton
+-/
 
+#print Finset.image₂_union_left /-
 theorem image₂_union_left [DecidableEq α] : image₂ f (s ∪ s') t = image₂ f s t ∪ image₂ f s' t :=
   coe_injective <| by push_cast ; exact image2_union_left
 #align finset.image₂_union_left Finset.image₂_union_left
+-/
 
+#print Finset.image₂_union_right /-
 theorem image₂_union_right [DecidableEq β] : image₂ f s (t ∪ t') = image₂ f s t ∪ image₂ f s t' :=
   coe_injective <| by push_cast ; exact image2_union_right
 #align finset.image₂_union_right Finset.image₂_union_right
+-/
 
+#print Finset.image₂_insert_left /-
 @[simp]
 theorem image₂_insert_left [DecidableEq α] :
     image₂ f (insert a s) t = (t.image fun b => f a b) ∪ image₂ f s t :=
   coe_injective <| by push_cast ; exact image2_insert_left
 #align finset.image₂_insert_left Finset.image₂_insert_left
+-/
 
+#print Finset.image₂_insert_right /-
 @[simp]
 theorem image₂_insert_right [DecidableEq β] :
     image₂ f s (insert b t) = (s.image fun a => f a b) ∪ image₂ f s t :=
   coe_injective <| by push_cast ; exact image2_insert_right
 #align finset.image₂_insert_right Finset.image₂_insert_right
+-/
 
+#print Finset.image₂_inter_left /-
 theorem image₂_inter_left [DecidableEq α] (hf : Injective2 f) :
     image₂ f (s ∩ s') t = image₂ f s t ∩ image₂ f s' t :=
   coe_injective <| by push_cast ; exact image2_inter_left hf
 #align finset.image₂_inter_left Finset.image₂_inter_left
+-/
 
+#print Finset.image₂_inter_right /-
 theorem image₂_inter_right [DecidableEq β] (hf : Injective2 f) :
     image₂ f s (t ∩ t') = image₂ f s t ∩ image₂ f s t' :=
   coe_injective <| by push_cast ; exact image2_inter_right hf
 #align finset.image₂_inter_right Finset.image₂_inter_right
+-/
 
+#print Finset.image₂_inter_subset_left /-
 theorem image₂_inter_subset_left [DecidableEq α] :
     image₂ f (s ∩ s') t ⊆ image₂ f s t ∩ image₂ f s' t :=
   coe_subset.1 <| by push_cast ; exact image2_inter_subset_left
 #align finset.image₂_inter_subset_left Finset.image₂_inter_subset_left
+-/
 
+#print Finset.image₂_inter_subset_right /-
 theorem image₂_inter_subset_right [DecidableEq β] :
     image₂ f s (t ∩ t') ⊆ image₂ f s t ∩ image₂ f s t' :=
   coe_subset.1 <| by push_cast ; exact image2_inter_subset_right
 #align finset.image₂_inter_subset_right Finset.image₂_inter_subset_right
+-/
 
+#print Finset.image₂_congr /-
 theorem image₂_congr (h : ∀ a ∈ s, ∀ b ∈ t, f a b = f' a b) : image₂ f s t = image₂ f' s t :=
   coe_injective <| by push_cast ; exact image2_congr h
 #align finset.image₂_congr Finset.image₂_congr
+-/
 
+#print Finset.image₂_congr' /-
 /-- 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 :=
   image₂_congr fun a _ b _ => h a b
 #align finset.image₂_congr' Finset.image₂_congr'
+-/
 
+#print Finset.subset_image₂ /-
 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' :=
   by
@@ -237,34 +312,46 @@ theorem subset_image₂ {s : Set α} {t : Set β} (hu : ↑u ⊆ image2 f s t) :
         ⟨mem_image₂.2 ⟨x, y, mem_insert_self _ _, mem_insert_self _ _, ha⟩,
           h.trans <| image₂_subset (subset_insert _ _) <| subset_insert _ _⟩⟩
 #align finset.subset_image₂ Finset.subset_image₂
+-/
 
 variable (s t)
 
+#print Finset.card_image₂_singleton_left /-
 theorem card_image₂_singleton_left (hf : Injective (f a)) : (image₂ f {a} t).card = t.card := by
   rw [image₂_singleton_left, card_image_of_injective _ hf]
 #align finset.card_image₂_singleton_left Finset.card_image₂_singleton_left
+-/
 
+#print Finset.card_image₂_singleton_right /-
 theorem card_image₂_singleton_right (hf : Injective fun a => f a b) :
     (image₂ f s {b}).card = s.card := by rw [image₂_singleton_right, card_image_of_injective _ hf]
 #align finset.card_image₂_singleton_right Finset.card_image₂_singleton_right
+-/
 
+#print Finset.image₂_singleton_inter /-
 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₂ := by
   simp_rw [image₂_singleton_left, image_inter _ _ hf]
 #align finset.image₂_singleton_inter Finset.image₂_singleton_inter
+-/
 
+#print Finset.image₂_inter_singleton /-
 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} := by
   simp_rw [image₂_singleton_right, image_inter _ _ hf]
 #align finset.image₂_inter_singleton Finset.image₂_inter_singleton
+-/
 
+#print Finset.card_le_card_image₂_left /-
 theorem card_le_card_image₂_left {s : Finset α} (hs : s.Nonempty) (hf : ∀ a, Injective (f a)) :
     t.card ≤ (image₂ f s t).card := by
   obtain ⟨a, ha⟩ := hs
   rw [← card_image₂_singleton_left _ (hf a)]
   exact card_le_of_subset (image₂_subset_right <| singleton_subset_iff.2 ha)
 #align finset.card_le_card_image₂_left Finset.card_le_card_image₂_left
+-/
 
+#print Finset.card_le_card_image₂_right /-
 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 :=
   by
@@ -272,12 +359,15 @@ theorem card_le_card_image₂_right {t : Finset β} (ht : t.Nonempty)
   rw [← card_image₂_singleton_right _ (hf b)]
   exact card_le_of_subset (image₂_subset_left <| singleton_subset_iff.2 hb)
 #align finset.card_le_card_image₂_right Finset.card_le_card_image₂_right
+-/
 
 variable {s t}
 
+#print Finset.biUnion_image_left /-
 theorem biUnion_image_left : (s.biUnion fun a => t.image <| f a) = image₂ f s t :=
   coe_injective <| by push_cast ; exact Set.iUnion_image_left _
 #align finset.bUnion_image_left Finset.biUnion_image_left
+-/
 
 #print Finset.biUnion_image_right /-
 theorem biUnion_image_right : (t.biUnion fun b => s.image fun a => f a b) = image₂ f s t :=
@@ -296,10 +386,12 @@ The proof pattern is `image₂_lemma operation_lemma`. For example, `image₂_co
 -/
 
 
+#print Finset.image_image₂ /-
 theorem image_image₂ (f : α → β → γ) (g : γ → δ) :
     (image₂ f s t).image g = image₂ (fun a b => g (f a b)) s t :=
   coe_injective <| by push_cast ; exact image_image2 _ _
 #align finset.image_image₂ Finset.image_image₂
+-/
 
 #print Finset.image₂_image_left /-
 theorem image₂_image_left (f : γ → β → δ) (g : α → γ) :
@@ -308,39 +400,51 @@ theorem image₂_image_left (f : γ → β → δ) (g : α → γ) :
 #align finset.image₂_image_left Finset.image₂_image_left
 -/
 
+#print Finset.image₂_image_right /-
 theorem image₂_image_right (f : α → γ → δ) (g : β → γ) :
     image₂ f s (t.image g) = image₂ (fun a b => f a (g b)) s t :=
   coe_injective <| by push_cast ; exact image2_image_right _ _
 #align finset.image₂_image_right Finset.image₂_image_right
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print Finset.image₂_mk_eq_product /-
 @[simp]
 theorem image₂_mk_eq_product [DecidableEq α] [DecidableEq β] (s : Finset α) (t : Finset β) :
     image₂ Prod.mk s t = s ×ˢ t := by ext <;> simp [Prod.ext_iff]
 #align finset.image₂_mk_eq_product Finset.image₂_mk_eq_product
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print Finset.image₂_curry /-
 @[simp]
 theorem image₂_curry (f : α × β → γ) (s : Finset α) (t : Finset β) :
     image₂ (curry f) s t = (s ×ˢ t).image f := by
   classical rw [← image₂_mk_eq_product, image_image₂, curry]
 #align finset.image₂_curry Finset.image₂_curry
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print Finset.image_uncurry_product /-
 @[simp]
 theorem image_uncurry_product (f : α → β → γ) (s : Finset α) (t : Finset β) :
     (s ×ˢ t).image (uncurry f) = image₂ f s t := by rw [← image₂_curry, curry_uncurry]
 #align finset.image_uncurry_product Finset.image_uncurry_product
+-/
 
+#print Finset.image₂_swap /-
 theorem image₂_swap (f : α → β → γ) (s : Finset α) (t : Finset β) :
     image₂ f s t = image₂ (fun a b => f b a) t s :=
   coe_injective <| by push_cast ; exact image2_swap _ _ _
 #align finset.image₂_swap Finset.image₂_swap
+-/
 
+#print Finset.image₂_left /-
 @[simp]
 theorem image₂_left [DecidableEq α] (h : t.Nonempty) : image₂ (fun x y => x) s t = s :=
   coe_injective <| by push_cast ; exact image2_left h
 #align finset.image₂_left Finset.image₂_left
+-/
 
 #print Finset.image₂_right /-
 @[simp]
@@ -349,28 +453,37 @@ theorem image₂_right [DecidableEq β] (h : s.Nonempty) : image₂ (fun x y =>
 #align finset.image₂_right Finset.image₂_right
 -/
 
+#print Finset.image₂_assoc /-
 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) :=
   coe_injective <| by push_cast ; exact image2_assoc h_assoc
 #align finset.image₂_assoc Finset.image₂_assoc
+-/
 
+#print Finset.image₂_comm /-
 theorem image₂_comm {g : β → α → γ} (h_comm : ∀ a b, f a b = g b a) : image₂ f s t = image₂ g t s :=
   (image₂_swap _ _ _).trans <| by simp_rw [h_comm]
 #align finset.image₂_comm Finset.image₂_comm
+-/
 
+#print Finset.image₂_left_comm /-
 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) :=
   coe_injective <| by push_cast ; exact image2_left_comm h_left_comm
 #align finset.image₂_left_comm Finset.image₂_left_comm
+-/
 
+#print Finset.image₂_right_comm /-
 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 :=
   coe_injective <| by push_cast ; exact image2_right_comm h_right_comm
 #align finset.image₂_right_comm Finset.image₂_right_comm
+-/
 
+#print Finset.image₂_image₂_image₂_comm /-
 theorem image₂_image₂_image₂_comm {γ δ : Type _} {u : Finset γ} {v : Finset δ} [DecidableEq ζ]
     [DecidableEq ζ'] [DecidableEq ν] {f : ε → ζ → ν} {g : α → β → ε} {h : γ → δ → ζ}
     {f' : ε' → ζ' → ν} {g' : α → γ → ε'} {h' : β → δ → ζ'}
@@ -378,41 +491,53 @@ theorem image₂_image₂_image₂_comm {γ δ : Type _} {u : Finset γ} {v : Fi
     image₂ f (image₂ g s t) (image₂ h u v) = image₂ f' (image₂ g' s u) (image₂ h' t v) :=
   coe_injective <| by push_cast ; exact image2_image2_image2_comm h_comm
 #align finset.image₂_image₂_image₂_comm Finset.image₂_image₂_image₂_comm
+-/
 
+#print Finset.image_image₂_distrib /-
 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₂) :=
   coe_injective <| by push_cast ; exact image_image2_distrib h_distrib
 #align finset.image_image₂_distrib Finset.image_image₂_distrib
+-/
 
+#print Finset.image_image₂_distrib_left /-
 /-- 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 :=
   coe_injective <| by push_cast ; exact image_image2_distrib_left h_distrib
 #align finset.image_image₂_distrib_left Finset.image_image₂_distrib_left
+-/
 
+#print Finset.image_image₂_distrib_right /-
 /-- 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') :=
   coe_injective <| by push_cast ; exact image_image2_distrib_right h_distrib
 #align finset.image_image₂_distrib_right Finset.image_image₂_distrib_right
+-/
 
+#print Finset.image₂_image_left_comm /-
 /-- 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' :=
   (image_image₂_distrib_left fun a b => (h_left_comm a b).symm).symm
 #align finset.image₂_image_left_comm Finset.image₂_image_left_comm
+-/
 
+#print Finset.image_image₂_right_comm /-
 /-- 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' :=
   (image_image₂_distrib_right fun a b => (h_right_comm a b).symm).symm
 #align finset.image_image₂_right_comm Finset.image_image₂_right_comm
+-/
 
+#print Finset.image₂_distrib_subset_left /-
 /-- 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' : β' → γ' → ε}
@@ -420,7 +545,9 @@ theorem image₂_distrib_subset_left {γ : Type _} {u : Finset γ} {f : α → 
     image₂ f s (image₂ g t u) ⊆ image₂ g' (image₂ f₁ s t) (image₂ f₂ s u) :=
   coe_subset.1 <| by push_cast ; exact Set.image2_distrib_subset_left h_distrib
 #align finset.image₂_distrib_subset_left Finset.image₂_distrib_subset_left
+-/
 
+#print Finset.image₂_distrib_subset_right /-
 /-- 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' : α' → β' → ε}
@@ -428,40 +555,51 @@ theorem image₂_distrib_subset_right {γ : Type _} {u : Finset γ} {f : δ →
     image₂ f (image₂ g s t) u ⊆ image₂ g' (image₂ f₁ s u) (image₂ f₂ t u) :=
   coe_subset.1 <| by push_cast ; exact Set.image2_distrib_subset_right h_distrib
 #align finset.image₂_distrib_subset_right Finset.image₂_distrib_subset_right
+-/
 
+#print Finset.image_image₂_antidistrib /-
 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₂) := by rw [image₂_swap f];
   exact image_image₂_distrib fun _ _ => h_antidistrib _ _
 #align finset.image_image₂_antidistrib Finset.image_image₂_antidistrib
+-/
 
+#print Finset.image_image₂_antidistrib_left /-
 /-- 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 :=
   coe_injective <| by push_cast ; exact image_image2_antidistrib_left h_antidistrib
 #align finset.image_image₂_antidistrib_left Finset.image_image₂_antidistrib_left
+-/
 
+#print Finset.image_image₂_antidistrib_right /-
 /-- 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') :=
   coe_injective <| by push_cast ; exact image_image2_antidistrib_right h_antidistrib
 #align finset.image_image₂_antidistrib_right Finset.image_image₂_antidistrib_right
+-/
 
+#print Finset.image₂_image_left_anticomm /-
 /-- 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' :=
   (image_image₂_antidistrib_left fun a b => (h_left_anticomm b a).symm).symm
 #align finset.image₂_image_left_anticomm Finset.image₂_image_left_anticomm
+-/
 
+#print Finset.image_image₂_right_anticomm /-
 /-- 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' :=
   (image_image₂_antidistrib_right fun a b => (h_right_anticomm b a).symm).symm
 #align finset.image_image₂_right_anticomm Finset.image_image₂_right_anticomm
+-/
 
 #print Finset.image₂_left_identity /-
 /-- If `a` is a left identity for `f : α → β → β`, then `{a}` is a left identity for
@@ -482,25 +620,33 @@ theorem image₂_right_identity {f : γ → β → γ} {b : β} (h : ∀ a, f a
 
 variable [DecidableEq α] [DecidableEq β]
 
+#print Finset.image₂_inter_union_subset_union /-
 theorem image₂_inter_union_subset_union :
     image₂ f (s ∩ s') (t ∪ t') ⊆ image₂ f s t ∪ image₂ f s' t' :=
   coe_subset.1 <| by push_cast ; exact Set.image2_inter_union_subset_union
 #align finset.image₂_inter_union_subset_union Finset.image₂_inter_union_subset_union
+-/
 
+#print Finset.image₂_union_inter_subset_union /-
 theorem image₂_union_inter_subset_union :
     image₂ f (s ∪ s') (t ∩ t') ⊆ image₂ f s t ∪ image₂ f s' t' :=
   coe_subset.1 <| by push_cast ; exact Set.image2_union_inter_subset_union
 #align finset.image₂_union_inter_subset_union Finset.image₂_union_inter_subset_union
+-/
 
+#print Finset.image₂_inter_union_subset /-
 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 :=
   coe_subset.1 <| by push_cast ; exact image2_inter_union_subset hf
 #align finset.image₂_inter_union_subset Finset.image₂_inter_union_subset
+-/
 
+#print Finset.image₂_union_inter_subset /-
 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 :=
   coe_subset.1 <| by push_cast ; exact image2_union_inter_subset hf
 #align finset.image₂_union_inter_subset Finset.image₂_union_inter_subset
+-/
 
 end Finset
 
@@ -508,16 +654,20 @@ namespace Set
 
 variable [DecidableEq γ] {s : Set α} {t : Set β}
 
+#print Set.toFinset_image2 /-
 @[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 :=
   Finset.coe_injective <| by simp
 #align set.to_finset_image2 Set.toFinset_image2
+-/
 
+#print Set.Finite.toFinset_image2 /-
 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 :=
   Finset.coe_injective <| by simp
 #align set.finite.to_finset_image2 Set.Finite.toFinset_image2
+-/
 
 end Set
 
Diff
@@ -221,7 +221,7 @@ theorem image₂_congr' (h : ∀ a b, f a b = f' a b) : image₂ f s t = image
 #align finset.image₂_congr' Finset.image₂_congr'
 
 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' :=
+    ∃ (s' : Finset α) (t' : Finset β), ↑s' ⊆ s ∧ ↑t' ⊆ t ∧ u ⊆ image₂ f s' t' :=
   by
   apply Finset.induction_on' u
   · exact ⟨∅, ∅, Set.empty_subset _, Set.empty_subset _, empty_subset _⟩
Diff
@@ -49,405 +49,177 @@ def image₂ (f : α → β → γ) (s : Finset α) (t : Finset β) : Finset γ
 #align finset.image₂ Finset.image₂
 -/
 
-/- warning: finset.mem_image₂ -> Finset.mem_image₂ is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {c : γ}, Iff (Membership.Mem.{u3, u3} γ (Finset.{u3} γ) (Finset.hasMem.{u3} γ) c (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (Exists.{succ u1} α (fun (a : α) => Exists.{succ u2} β (fun (b : β) => And (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) a s) (And (Membership.Mem.{u2, u2} β (Finset.{u2} β) (Finset.hasMem.{u2} β) b t) (Eq.{succ u3} γ (f a b) c)))))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {t : Finset.{u1} β} {c : γ}, Iff (Membership.mem.{u3, u3} γ (Finset.{u3} γ) (Finset.instMembershipFinset.{u3} γ) c (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (Exists.{succ u2} α (fun (a : α) => Exists.{succ u1} β (fun (b : β) => And (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) (And (Membership.mem.{u1, u1} β (Finset.{u1} β) (Finset.instMembershipFinset.{u1} β) b t) (Eq.{succ u3} γ (f a b) c)))))
-Case conversion may be inaccurate. Consider using '#align finset.mem_image₂ Finset.mem_image₂ₓ'. -/
 @[simp]
 theorem mem_image₂ : c ∈ image₂ f s t ↔ ∃ a b, a ∈ s ∧ b ∈ t ∧ f a b = c := by
   simp [image₂, and_assoc']
 #align finset.mem_image₂ Finset.mem_image₂
 
-/- warning: finset.coe_image₂ -> Finset.coe_image₂ is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] (f : α -> β -> γ) (s : Finset.{u1} α) (t : Finset.{u2} β), Eq.{succ u3} (Set.{u3} γ) ((fun (a : Type.{u3}) (b : Type.{u3}) [self : HasLiftT.{succ u3, succ u3} a b] => self.0) (Finset.{u3} γ) (Set.{u3} γ) (HasLiftT.mk.{succ u3, succ u3} (Finset.{u3} γ) (Set.{u3} γ) (CoeTCₓ.coe.{succ u3, succ u3} (Finset.{u3} γ) (Set.{u3} γ) (Finset.Set.hasCoeT.{u3} γ))) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (Set.image2.{u1, u2, u3} α β γ f ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (Finset.{u1} α) (Set.{u1} α) (HasLiftT.mk.{succ u1, succ u1} (Finset.{u1} α) (Set.{u1} α) (CoeTCₓ.coe.{succ u1, succ u1} (Finset.{u1} α) (Set.{u1} α) (Finset.Set.hasCoeT.{u1} α))) s) ((fun (a : Type.{u2}) (b : Type.{u2}) [self : HasLiftT.{succ u2, succ u2} a b] => self.0) (Finset.{u2} β) (Set.{u2} β) (HasLiftT.mk.{succ u2, succ u2} (Finset.{u2} β) (Set.{u2} β) (CoeTCₓ.coe.{succ u2, succ u2} (Finset.{u2} β) (Set.{u2} β) (Finset.Set.hasCoeT.{u2} β))) t))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_3 : DecidableEq.{succ u1} γ] (f : α -> β -> γ) (s : Finset.{u3} α) (t : Finset.{u2} β), Eq.{succ u1} (Set.{u1} γ) (Finset.toSet.{u1} γ (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (Set.image2.{u3, u2, u1} α β γ f (Finset.toSet.{u3} α s) (Finset.toSet.{u2} β t))
-Case conversion may be inaccurate. Consider using '#align finset.coe_image₂ Finset.coe_image₂ₓ'. -/
 @[simp, norm_cast]
 theorem coe_image₂ (f : α → β → γ) (s : Finset α) (t : Finset β) :
     (image₂ f s t : Set γ) = Set.image2 f s t :=
   Set.ext fun _ => mem_image₂
 #align finset.coe_image₂ Finset.coe_image₂
 
-/- warning: finset.card_image₂_le -> Finset.card_image₂_le is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] (f : α -> β -> γ) (s : Finset.{u1} α) (t : Finset.{u2} β), LE.le.{0} Nat Nat.hasLe (Finset.card.{u3} γ (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat Nat.hasMul) (Finset.card.{u1} α s) (Finset.card.{u2} β t))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_3 : DecidableEq.{succ u1} γ] (f : α -> β -> γ) (s : Finset.{u3} α) (t : Finset.{u2} β), LE.le.{0} Nat instLENat (Finset.card.{u1} γ (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat instMulNat) (Finset.card.{u3} α s) (Finset.card.{u2} β t))
-Case conversion may be inaccurate. Consider using '#align finset.card_image₂_le Finset.card_image₂_leₓ'. -/
 theorem card_image₂_le (f : α → β → γ) (s : Finset α) (t : Finset β) :
     (image₂ f s t).card ≤ s.card * t.card :=
   card_image_le.trans_eq <| card_product _ _
 #align finset.card_image₂_le Finset.card_image₂_le
 
-/- warning: finset.card_image₂_iff -> Finset.card_image₂_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β}, Iff (Eq.{1} Nat (Finset.card.{u3} γ (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat Nat.hasMul) (Finset.card.{u1} α s) (Finset.card.{u2} β t))) (Set.InjOn.{max u1 u2, u3} (Prod.{u1, u2} α β) γ (fun (x : Prod.{u1, u2} α β) => f (Prod.fst.{u1, u2} α β x) (Prod.snd.{u1, u2} α β x)) (Set.prod.{u1, u2} α β ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (Finset.{u1} α) (Set.{u1} α) (HasLiftT.mk.{succ u1, succ u1} (Finset.{u1} α) (Set.{u1} α) (CoeTCₓ.coe.{succ u1, succ u1} (Finset.{u1} α) (Set.{u1} α) (Finset.Set.hasCoeT.{u1} α))) s) ((fun (a : Type.{u2}) (b : Type.{u2}) [self : HasLiftT.{succ u2, succ u2} a b] => self.0) (Finset.{u2} β) (Set.{u2} β) (HasLiftT.mk.{succ u2, succ u2} (Finset.{u2} β) (Set.{u2} β) (CoeTCₓ.coe.{succ u2, succ u2} (Finset.{u2} β) (Set.{u2} β) (Finset.Set.hasCoeT.{u2} β))) t)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {t : Finset.{u1} β}, Iff (Eq.{1} Nat (Finset.card.{u3} γ (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat instMulNat) (Finset.card.{u2} α s) (Finset.card.{u1} β t))) (Set.InjOn.{max u2 u1, u3} (Prod.{u2, u1} α β) γ (fun (x : Prod.{u2, u1} α β) => f (Prod.fst.{u2, u1} α β x) (Prod.snd.{u2, u1} α β x)) (Set.prod.{u2, u1} α β (Finset.toSet.{u2} α s) (Finset.toSet.{u1} β t)))
-Case conversion may be inaccurate. Consider using '#align finset.card_image₂_iff Finset.card_image₂_iffₓ'. -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 theorem card_image₂_iff :
     (image₂ f s t).card = s.card * t.card ↔ (s ×ˢ t : Set (α × β)).InjOn fun x => f x.1 x.2 := by
   rw [← card_product, ← coe_product]; exact card_image_iff
 #align finset.card_image₂_iff Finset.card_image₂_iff
 
-/- warning: finset.card_image₂ -> Finset.card_image₂ is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ}, (Function.Injective2.{succ u1, succ u2, succ u3} α β γ f) -> (forall (s : Finset.{u1} α) (t : Finset.{u2} β), Eq.{1} Nat (Finset.card.{u3} γ (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat Nat.hasMul) (Finset.card.{u1} α s) (Finset.card.{u2} β t)))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_3 : DecidableEq.{succ u1} γ] {f : α -> β -> γ}, (Function.Injective2.{succ u3, succ u2, succ u1} α β γ f) -> (forall (s : Finset.{u3} α) (t : Finset.{u2} β), Eq.{1} Nat (Finset.card.{u1} γ (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (HMul.hMul.{0, 0, 0} Nat Nat Nat (instHMul.{0} Nat instMulNat) (Finset.card.{u3} α s) (Finset.card.{u2} β t)))
-Case conversion may be inaccurate. Consider using '#align finset.card_image₂ Finset.card_image₂ₓ'. -/
 theorem card_image₂ (hf : Injective2 f) (s : Finset α) (t : Finset β) :
     (image₂ f s t).card = s.card * t.card :=
   (card_image_of_injective _ hf.uncurry).trans <| card_product _ _
 #align finset.card_image₂ Finset.card_image₂
 
-/- warning: finset.mem_image₂_of_mem -> Finset.mem_image₂_of_mem is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {a : α} {b : β}, (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) a s) -> (Membership.Mem.{u2, u2} β (Finset.{u2} β) (Finset.hasMem.{u2} β) b t) -> (Membership.Mem.{u3, u3} γ (Finset.{u3} γ) (Finset.hasMem.{u3} γ) (f a b) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_3 : DecidableEq.{succ u1} γ] {f : α -> β -> γ} {s : Finset.{u3} α} {t : Finset.{u2} β} {a : α} {b : β}, (Membership.mem.{u3, u3} α (Finset.{u3} α) (Finset.instMembershipFinset.{u3} α) a s) -> (Membership.mem.{u2, u2} β (Finset.{u2} β) (Finset.instMembershipFinset.{u2} β) b t) -> (Membership.mem.{u1, u1} γ (Finset.{u1} γ) (Finset.instMembershipFinset.{u1} γ) (f a b) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
-Case conversion may be inaccurate. Consider using '#align finset.mem_image₂_of_mem Finset.mem_image₂_of_memₓ'. -/
 theorem mem_image₂_of_mem (ha : a ∈ s) (hb : b ∈ t) : f a b ∈ image₂ f s t :=
   mem_image₂.2 ⟨a, b, ha, hb, rfl⟩
 #align finset.mem_image₂_of_mem Finset.mem_image₂_of_mem
 
-/- warning: finset.mem_image₂_iff -> Finset.mem_image₂_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {a : α} {b : β}, (Function.Injective2.{succ u1, succ u2, succ u3} α β γ f) -> (Iff (Membership.Mem.{u3, u3} γ (Finset.{u3} γ) (Finset.hasMem.{u3} γ) (f a b) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (And (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) a s) (Membership.Mem.{u2, u2} β (Finset.{u2} β) (Finset.hasMem.{u2} β) b t)))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_3 : DecidableEq.{succ u1} γ] {f : α -> β -> γ} {s : Finset.{u3} α} {t : Finset.{u2} β} {a : α} {b : β}, (Function.Injective2.{succ u3, succ u2, succ u1} α β γ f) -> (Iff (Membership.mem.{u1, u1} γ (Finset.{u1} γ) (Finset.instMembershipFinset.{u1} γ) (f a b) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (And (Membership.mem.{u3, u3} α (Finset.{u3} α) (Finset.instMembershipFinset.{u3} α) a s) (Membership.mem.{u2, u2} β (Finset.{u2} β) (Finset.instMembershipFinset.{u2} β) b t)))
-Case conversion may be inaccurate. Consider using '#align finset.mem_image₂_iff Finset.mem_image₂_iffₓ'. -/
 theorem mem_image₂_iff (hf : Injective2 f) : f a b ∈ image₂ f s t ↔ a ∈ s ∧ b ∈ t := by
   rw [← mem_coe, coe_image₂, mem_image2_iff hf, mem_coe, mem_coe]
 #align finset.mem_image₂_iff Finset.mem_image₂_iff
 
-/- warning: finset.image₂_subset -> Finset.image₂_subset is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {s' : Finset.{u1} α} {t : Finset.{u2} β} {t' : Finset.{u2} β}, (HasSubset.Subset.{u1} (Finset.{u1} α) (Finset.hasSubset.{u1} α) s s') -> (HasSubset.Subset.{u2} (Finset.{u2} β) (Finset.hasSubset.{u2} β) t t') -> (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s' t'))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_3 : DecidableEq.{succ u1} γ] {f : α -> β -> γ} {s : Finset.{u3} α} {s' : Finset.{u3} α} {t : Finset.{u2} β} {t' : Finset.{u2} β}, (HasSubset.Subset.{u3} (Finset.{u3} α) (Finset.instHasSubsetFinset.{u3} α) s s') -> (HasSubset.Subset.{u2} (Finset.{u2} β) (Finset.instHasSubsetFinset.{u2} β) t t') -> (HasSubset.Subset.{u1} (Finset.{u1} γ) (Finset.instHasSubsetFinset.{u1} γ) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s' t'))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_subset Finset.image₂_subsetₓ'. -/
 theorem image₂_subset (hs : s ⊆ s') (ht : t ⊆ t') : image₂ f s t ⊆ image₂ f s' t' := by
   rw [← coe_subset, coe_image₂, coe_image₂]; exact image2_subset hs ht
 #align finset.image₂_subset Finset.image₂_subset
 
-/- warning: finset.image₂_subset_left -> Finset.image₂_subset_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {t' : Finset.{u2} β}, (HasSubset.Subset.{u2} (Finset.{u2} β) (Finset.hasSubset.{u2} β) t t') -> (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t'))
-but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u3}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u3} β} {t' : Finset.{u3} β}, (HasSubset.Subset.{u3} (Finset.{u3} β) (Finset.instHasSubsetFinset.{u3} β) t t') -> (HasSubset.Subset.{u2} (Finset.{u2} γ) (Finset.instHasSubsetFinset.{u2} γ) (Finset.image₂.{u1, u3, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u1, u3, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t'))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_subset_left Finset.image₂_subset_leftₓ'. -/
 theorem image₂_subset_left (ht : t ⊆ t') : image₂ f s t ⊆ image₂ f s t' :=
   image₂_subset Subset.rfl ht
 #align finset.image₂_subset_left Finset.image₂_subset_left
 
-/- warning: finset.image₂_subset_right -> Finset.image₂_subset_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {s' : Finset.{u1} α} {t : Finset.{u2} β}, (HasSubset.Subset.{u1} (Finset.{u1} α) (Finset.hasSubset.{u1} α) s s') -> (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s' t))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {s : Finset.{u3} α} {s' : Finset.{u3} α} {t : Finset.{u1} β}, (HasSubset.Subset.{u3} (Finset.{u3} α) (Finset.instHasSubsetFinset.{u3} α) s s') -> (HasSubset.Subset.{u2} (Finset.{u2} γ) (Finset.instHasSubsetFinset.{u2} γ) (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s' t))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_subset_right Finset.image₂_subset_rightₓ'. -/
 theorem image₂_subset_right (hs : s ⊆ s') : image₂ f s t ⊆ image₂ f s' t :=
   image₂_subset hs Subset.rfl
 #align finset.image₂_subset_right Finset.image₂_subset_right
 
-/- warning: finset.image_subset_image₂_left -> Finset.image_subset_image₂_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {b : β}, (Membership.Mem.{u2, u2} β (Finset.{u2} β) (Finset.hasMem.{u2} β) b t) -> (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image.{u1, u3} α γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (a : α) => f a b) s) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
-but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u3}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u3} β} {b : β}, (Membership.mem.{u3, u3} β (Finset.{u3} β) (Finset.instMembershipFinset.{u3} β) b t) -> (HasSubset.Subset.{u2} (Finset.{u2} γ) (Finset.instHasSubsetFinset.{u2} γ) (Finset.image.{u1, u2} α γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (a : α) => f a b) s) (Finset.image₂.{u1, u3, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
-Case conversion may be inaccurate. Consider using '#align finset.image_subset_image₂_left Finset.image_subset_image₂_leftₓ'. -/
 theorem image_subset_image₂_left (hb : b ∈ t) : (s.image fun a => f a b) ⊆ image₂ f s t :=
   image_subset_iff.2 fun a ha => mem_image₂_of_mem ha hb
 #align finset.image_subset_image₂_left Finset.image_subset_image₂_left
 
-/- warning: finset.image_subset_image₂_right -> Finset.image_subset_image₂_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {a : α}, (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) a s) -> (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image.{u2, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (b : β) => f a b) t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {s : Finset.{u3} α} {t : Finset.{u1} β} {a : α}, (Membership.mem.{u3, u3} α (Finset.{u3} α) (Finset.instMembershipFinset.{u3} α) a s) -> (HasSubset.Subset.{u2} (Finset.{u2} γ) (Finset.instHasSubsetFinset.{u2} γ) (Finset.image.{u1, u2} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (b : β) => f a b) t) (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
-Case conversion may be inaccurate. Consider using '#align finset.image_subset_image₂_right Finset.image_subset_image₂_rightₓ'. -/
 theorem image_subset_image₂_right (ha : a ∈ s) : (t.image fun b => f a b) ⊆ image₂ f s t :=
   image_subset_iff.2 fun b => mem_image₂_of_mem ha
 #align finset.image_subset_image₂_right Finset.image_subset_image₂_right
 
-/- warning: finset.forall_image₂_iff -> Finset.forall_image₂_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {p : γ -> Prop}, Iff (forall (z : γ), (Membership.Mem.{u3, u3} γ (Finset.{u3} γ) (Finset.hasMem.{u3} γ) z (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) -> (p z)) (forall (x : α), (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) x s) -> (forall (y : β), (Membership.Mem.{u2, u2} β (Finset.{u2} β) (Finset.hasMem.{u2} β) y t) -> (p (f x y))))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {t : Finset.{u1} β} {p : γ -> Prop}, Iff (forall (z : γ), (Membership.mem.{u3, u3} γ (Finset.{u3} γ) (Finset.instMembershipFinset.{u3} γ) z (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) -> (p z)) (forall (x : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x s) -> (forall (y : β), (Membership.mem.{u1, u1} β (Finset.{u1} β) (Finset.instMembershipFinset.{u1} β) y t) -> (p (f x y))))
-Case conversion may be inaccurate. Consider using '#align finset.forall_image₂_iff Finset.forall_image₂_iffₓ'. -/
 theorem forall_image₂_iff {p : γ → Prop} :
     (∀ z ∈ image₂ f s t, p z) ↔ ∀ x ∈ s, ∀ y ∈ t, p (f x y) := by
   simp_rw [← mem_coe, coe_image₂, forall_image2_iff]
 #align finset.forall_image₂_iff Finset.forall_image₂_iff
 
-/- warning: finset.image₂_subset_iff -> Finset.image₂_subset_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {u : Finset.{u3} γ}, Iff (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) u) (forall (x : α), (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) x s) -> (forall (y : β), (Membership.Mem.{u2, u2} β (Finset.{u2} β) (Finset.hasMem.{u2} β) y t) -> (Membership.Mem.{u3, u3} γ (Finset.{u3} γ) (Finset.hasMem.{u3} γ) (f x y) u)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {t : Finset.{u1} β} {u : Finset.{u3} γ}, Iff (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.instHasSubsetFinset.{u3} γ) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) u) (forall (x : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) x s) -> (forall (y : β), (Membership.mem.{u1, u1} β (Finset.{u1} β) (Finset.instMembershipFinset.{u1} β) y t) -> (Membership.mem.{u3, u3} γ (Finset.{u3} γ) (Finset.instMembershipFinset.{u3} γ) (f x y) u)))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_subset_iff Finset.image₂_subset_iffₓ'. -/
 @[simp]
 theorem image₂_subset_iff : image₂ f s t ⊆ u ↔ ∀ x ∈ s, ∀ y ∈ t, f x y ∈ u :=
   forall_image₂_iff
 #align finset.image₂_subset_iff Finset.image₂_subset_iff
 
-/- warning: finset.image₂_subset_iff_left -> Finset.image₂_subset_iff_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {u : Finset.{u3} γ}, Iff (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) u) (forall (a : α), (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) a s) -> (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image.{u2, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (b : β) => f a b) t) u))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {t : Finset.{u1} β} {u : Finset.{u3} γ}, Iff (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.instHasSubsetFinset.{u3} γ) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) u) (forall (a : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) -> (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.instHasSubsetFinset.{u3} γ) (Finset.image.{u1, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (b : β) => f a b) t) u))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_subset_iff_left Finset.image₂_subset_iff_leftₓ'. -/
 theorem image₂_subset_iff_left : image₂ f s t ⊆ u ↔ ∀ a ∈ s, (t.image fun b => f a b) ⊆ u := by
   simp_rw [image₂_subset_iff, image_subset_iff]
 #align finset.image₂_subset_iff_left Finset.image₂_subset_iff_left
 
-/- warning: finset.image₂_subset_iff_right -> Finset.image₂_subset_iff_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {u : Finset.{u3} γ}, Iff (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) u) (forall (b : β), (Membership.Mem.{u2, u2} β (Finset.{u2} β) (Finset.hasMem.{u2} β) b t) -> (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image.{u1, u3} α γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (a : α) => f a b) s) u))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {t : Finset.{u1} β} {u : Finset.{u3} γ}, Iff (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.instHasSubsetFinset.{u3} γ) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) u) (forall (b : β), (Membership.mem.{u1, u1} β (Finset.{u1} β) (Finset.instMembershipFinset.{u1} β) b t) -> (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.instHasSubsetFinset.{u3} γ) (Finset.image.{u2, u3} α γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (a : α) => f a b) s) u))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_subset_iff_right Finset.image₂_subset_iff_rightₓ'. -/
 theorem image₂_subset_iff_right : image₂ f s t ⊆ u ↔ ∀ b ∈ t, (s.image fun a => f a b) ⊆ u := by
   simp_rw [image₂_subset_iff, image_subset_iff, @forall₂_swap α]
 #align finset.image₂_subset_iff_right Finset.image₂_subset_iff_right
 
-/- warning: finset.image₂_nonempty_iff -> Finset.image₂_nonempty_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β}, Iff (Finset.Nonempty.{u3} γ (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (And (Finset.Nonempty.{u1} α s) (Finset.Nonempty.{u2} β t))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {t : Finset.{u1} β}, Iff (Finset.Nonempty.{u3} γ (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (And (Finset.Nonempty.{u2} α s) (Finset.Nonempty.{u1} β t))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_nonempty_iff Finset.image₂_nonempty_iffₓ'. -/
 @[simp]
 theorem image₂_nonempty_iff : (image₂ f s t).Nonempty ↔ s.Nonempty ∧ t.Nonempty := by
   rw [← coe_nonempty, coe_image₂]; exact image2_nonempty_iff
 #align finset.image₂_nonempty_iff Finset.image₂_nonempty_iff
 
-/- warning: finset.nonempty.image₂ -> Finset.Nonempty.image₂ is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β}, (Finset.Nonempty.{u1} α s) -> (Finset.Nonempty.{u2} β t) -> (Finset.Nonempty.{u3} γ (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_3 : DecidableEq.{succ u1} γ] {f : α -> β -> γ} {s : Finset.{u3} α} {t : Finset.{u2} β}, (Finset.Nonempty.{u3} α s) -> (Finset.Nonempty.{u2} β t) -> (Finset.Nonempty.{u1} γ (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
-Case conversion may be inaccurate. Consider using '#align finset.nonempty.image₂ Finset.Nonempty.image₂ₓ'. -/
 theorem Nonempty.image₂ (hs : s.Nonempty) (ht : t.Nonempty) : (image₂ f s t).Nonempty :=
   image₂_nonempty_iff.2 ⟨hs, ht⟩
 #align finset.nonempty.image₂ Finset.Nonempty.image₂
 
-/- warning: finset.nonempty.of_image₂_left -> Finset.Nonempty.of_image₂_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β}, (Finset.Nonempty.{u3} γ (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) -> (Finset.Nonempty.{u1} α s)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {t : Finset.{u1} β}, (Finset.Nonempty.{u3} γ (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) -> (Finset.Nonempty.{u2} α s)
-Case conversion may be inaccurate. Consider using '#align finset.nonempty.of_image₂_left Finset.Nonempty.of_image₂_leftₓ'. -/
 theorem Nonempty.of_image₂_left (h : (image₂ f s t).Nonempty) : s.Nonempty :=
   (image₂_nonempty_iff.1 h).1
 #align finset.nonempty.of_image₂_left Finset.Nonempty.of_image₂_left
 
-/- warning: finset.nonempty.of_image₂_right -> Finset.Nonempty.of_image₂_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β}, (Finset.Nonempty.{u3} γ (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) -> (Finset.Nonempty.{u2} β t)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {t : Finset.{u1} β}, (Finset.Nonempty.{u3} γ (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) -> (Finset.Nonempty.{u1} β t)
-Case conversion may be inaccurate. Consider using '#align finset.nonempty.of_image₂_right Finset.Nonempty.of_image₂_rightₓ'. -/
 theorem Nonempty.of_image₂_right (h : (image₂ f s t).Nonempty) : t.Nonempty :=
   (image₂_nonempty_iff.1 h).2
 #align finset.nonempty.of_image₂_right Finset.Nonempty.of_image₂_right
 
-/- warning: finset.image₂_empty_left -> Finset.image₂_empty_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {t : Finset.{u2} β}, Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (EmptyCollection.emptyCollection.{u1} (Finset.{u1} α) (Finset.hasEmptyc.{u1} α)) t) (EmptyCollection.emptyCollection.{u3} (Finset.{u3} γ) (Finset.hasEmptyc.{u3} γ))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {t : Finset.{u1} β}, Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (EmptyCollection.emptyCollection.{u2} (Finset.{u2} α) (Finset.instEmptyCollectionFinset.{u2} α)) t) (EmptyCollection.emptyCollection.{u3} (Finset.{u3} γ) (Finset.instEmptyCollectionFinset.{u3} γ))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_empty_left Finset.image₂_empty_leftₓ'. -/
 @[simp]
 theorem image₂_empty_left : image₂ f ∅ t = ∅ :=
   coe_injective <| by simp
 #align finset.image₂_empty_left Finset.image₂_empty_left
 
-/- warning: finset.image₂_empty_right -> Finset.image₂_empty_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α}, Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s (EmptyCollection.emptyCollection.{u2} (Finset.{u2} β) (Finset.hasEmptyc.{u2} β))) (EmptyCollection.emptyCollection.{u3} (Finset.{u3} γ) (Finset.hasEmptyc.{u3} γ))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α}, Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s (EmptyCollection.emptyCollection.{u1} (Finset.{u1} β) (Finset.instEmptyCollectionFinset.{u1} β))) (EmptyCollection.emptyCollection.{u3} (Finset.{u3} γ) (Finset.instEmptyCollectionFinset.{u3} γ))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_empty_right Finset.image₂_empty_rightₓ'. -/
 @[simp]
 theorem image₂_empty_right : image₂ f s ∅ = ∅ :=
   coe_injective <| by simp
 #align finset.image₂_empty_right Finset.image₂_empty_right
 
-/- warning: finset.image₂_eq_empty_iff -> Finset.image₂_eq_empty_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β}, Iff (Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (EmptyCollection.emptyCollection.{u3} (Finset.{u3} γ) (Finset.hasEmptyc.{u3} γ))) (Or (Eq.{succ u1} (Finset.{u1} α) s (EmptyCollection.emptyCollection.{u1} (Finset.{u1} α) (Finset.hasEmptyc.{u1} α))) (Eq.{succ u2} (Finset.{u2} β) t (EmptyCollection.emptyCollection.{u2} (Finset.{u2} β) (Finset.hasEmptyc.{u2} β))))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {t : Finset.{u1} β}, Iff (Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (EmptyCollection.emptyCollection.{u3} (Finset.{u3} γ) (Finset.instEmptyCollectionFinset.{u3} γ))) (Or (Eq.{succ u2} (Finset.{u2} α) s (EmptyCollection.emptyCollection.{u2} (Finset.{u2} α) (Finset.instEmptyCollectionFinset.{u2} α))) (Eq.{succ u1} (Finset.{u1} β) t (EmptyCollection.emptyCollection.{u1} (Finset.{u1} β) (Finset.instEmptyCollectionFinset.{u1} β))))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_eq_empty_iff Finset.image₂_eq_empty_iffₓ'. -/
 @[simp]
 theorem image₂_eq_empty_iff : image₂ f s t = ∅ ↔ s = ∅ ∨ t = ∅ := by
   simp_rw [← not_nonempty_iff_eq_empty, image₂_nonempty_iff, not_and_or]
 #align finset.image₂_eq_empty_iff Finset.image₂_eq_empty_iff
 
-/- warning: finset.image₂_singleton_left -> Finset.image₂_singleton_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {t : Finset.{u2} β} {a : α}, Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Singleton.singleton.{u1, u1} α (Finset.{u1} α) (Finset.hasSingleton.{u1} α) a) t) (Finset.image.{u2, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (b : β) => f a b) t)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {t : Finset.{u1} β} {a : α}, Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Singleton.singleton.{u2, u2} α (Finset.{u2} α) (Finset.instSingletonFinset.{u2} α) a) t) (Finset.image.{u1, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (b : β) => f a b) t)
-Case conversion may be inaccurate. Consider using '#align finset.image₂_singleton_left Finset.image₂_singleton_leftₓ'. -/
 @[simp]
 theorem image₂_singleton_left : image₂ f {a} t = t.image fun b => f a b :=
   ext fun x => by simp
 #align finset.image₂_singleton_left Finset.image₂_singleton_left
 
-/- warning: finset.image₂_singleton_right -> Finset.image₂_singleton_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {b : β}, Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s (Singleton.singleton.{u2, u2} β (Finset.{u2} β) (Finset.hasSingleton.{u2} β) b)) (Finset.image.{u1, u3} α γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (a : α) => f a b) s)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {b : β}, Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s (Singleton.singleton.{u1, u1} β (Finset.{u1} β) (Finset.instSingletonFinset.{u1} β) b)) (Finset.image.{u2, u3} α γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (a : α) => f a b) s)
-Case conversion may be inaccurate. Consider using '#align finset.image₂_singleton_right Finset.image₂_singleton_rightₓ'. -/
 @[simp]
 theorem image₂_singleton_right : image₂ f s {b} = s.image fun a => f a b :=
   ext fun x => by simp
 #align finset.image₂_singleton_right Finset.image₂_singleton_right
 
-/- warning: finset.image₂_singleton_left' -> Finset.image₂_singleton_left' is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {t : Finset.{u2} β} {a : α}, Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Singleton.singleton.{u1, u1} α (Finset.{u1} α) (Finset.hasSingleton.{u1} α) a) t) (Finset.image.{u2, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (f a) t)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {t : Finset.{u1} β} {a : α}, Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Singleton.singleton.{u2, u2} α (Finset.{u2} α) (Finset.instSingletonFinset.{u2} α) a) t) (Finset.image.{u1, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (f a) t)
-Case conversion may be inaccurate. Consider using '#align finset.image₂_singleton_left' Finset.image₂_singleton_left'ₓ'. -/
 theorem image₂_singleton_left' : image₂ f {a} t = t.image (f a) :=
   image₂_singleton_left
 #align finset.image₂_singleton_left' Finset.image₂_singleton_left'
 
-/- warning: finset.image₂_singleton -> Finset.image₂_singleton is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {a : α} {b : β}, Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Singleton.singleton.{u1, u1} α (Finset.{u1} α) (Finset.hasSingleton.{u1} α) a) (Singleton.singleton.{u2, u2} β (Finset.{u2} β) (Finset.hasSingleton.{u2} β) b)) (Singleton.singleton.{u3, u3} γ (Finset.{u3} γ) (Finset.hasSingleton.{u3} γ) (f a b))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {a : α} {b : β}, Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Singleton.singleton.{u2, u2} α (Finset.{u2} α) (Finset.instSingletonFinset.{u2} α) a) (Singleton.singleton.{u1, u1} β (Finset.{u1} β) (Finset.instSingletonFinset.{u1} β) b)) (Singleton.singleton.{u3, u3} γ (Finset.{u3} γ) (Finset.instSingletonFinset.{u3} γ) (f a b))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_singleton Finset.image₂_singletonₓ'. -/
 theorem image₂_singleton : image₂ f {a} {b} = {f a b} := by simp
 #align finset.image₂_singleton Finset.image₂_singleton
 
-/- warning: finset.image₂_union_left -> Finset.image₂_union_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {s' : Finset.{u1} α} {t : Finset.{u2} β} [_inst_9 : DecidableEq.{succ u1} α], Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Union.union.{u1} (Finset.{u1} α) (Finset.hasUnion.{u1} α (fun (a : α) (b : α) => _inst_9 a b)) s s') t) (Union.union.{u3} (Finset.{u3} γ) (Finset.hasUnion.{u3} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s' t))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {s : Finset.{u3} α} {s' : Finset.{u3} α} {t : Finset.{u1} β} [_inst_9 : DecidableEq.{succ u3} α], Eq.{succ u2} (Finset.{u2} γ) (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Union.union.{u3} (Finset.{u3} α) (Finset.instUnionFinset.{u3} α (fun (a : α) (b : α) => _inst_9 a b)) s s') t) (Union.union.{u2} (Finset.{u2} γ) (Finset.instUnionFinset.{u2} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s' t))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_union_left Finset.image₂_union_leftₓ'. -/
 theorem image₂_union_left [DecidableEq α] : image₂ f (s ∪ s') t = image₂ f s t ∪ image₂ f s' t :=
   coe_injective <| by push_cast ; exact image2_union_left
 #align finset.image₂_union_left Finset.image₂_union_left
 
-/- warning: finset.image₂_union_right -> Finset.image₂_union_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {t' : Finset.{u2} β} [_inst_9 : DecidableEq.{succ u2} β], Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s (Union.union.{u2} (Finset.{u2} β) (Finset.hasUnion.{u2} β (fun (a : β) (b : β) => _inst_9 a b)) t t')) (Union.union.{u3} (Finset.{u3} γ) (Finset.hasUnion.{u3} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t'))
-but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u3}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u3} β} {t' : Finset.{u3} β} [_inst_9 : DecidableEq.{succ u3} β], Eq.{succ u2} (Finset.{u2} γ) (Finset.image₂.{u1, u3, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s (Union.union.{u3} (Finset.{u3} β) (Finset.instUnionFinset.{u3} β (fun (a : β) (b : β) => _inst_9 a b)) t t')) (Union.union.{u2} (Finset.{u2} γ) (Finset.instUnionFinset.{u2} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u1, u3, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u1, u3, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t'))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_union_right Finset.image₂_union_rightₓ'. -/
 theorem image₂_union_right [DecidableEq β] : image₂ f s (t ∪ t') = image₂ f s t ∪ image₂ f s t' :=
   coe_injective <| by push_cast ; exact image2_union_right
 #align finset.image₂_union_right Finset.image₂_union_right
 
-/- warning: finset.image₂_insert_left -> Finset.image₂_insert_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {a : α} [_inst_9 : DecidableEq.{succ u1} α], Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Insert.insert.{u1, u1} α (Finset.{u1} α) (Finset.hasInsert.{u1} α (fun (a : α) (b : α) => _inst_9 a b)) a s) t) (Union.union.{u3} (Finset.{u3} γ) (Finset.hasUnion.{u3} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image.{u2, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (b : β) => f a b) t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {s : Finset.{u3} α} {t : Finset.{u1} β} {a : α} [_inst_9 : DecidableEq.{succ u3} α], Eq.{succ u2} (Finset.{u2} γ) (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Insert.insert.{u3, u3} α (Finset.{u3} α) (Finset.instInsertFinset.{u3} α (fun (a : α) (b : α) => _inst_9 a b)) a s) t) (Union.union.{u2} (Finset.{u2} γ) (Finset.instUnionFinset.{u2} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image.{u1, u2} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (b : β) => f a b) t) (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_insert_left Finset.image₂_insert_leftₓ'. -/
 @[simp]
 theorem image₂_insert_left [DecidableEq α] :
     image₂ f (insert a s) t = (t.image fun b => f a b) ∪ image₂ f s t :=
   coe_injective <| by push_cast ; exact image2_insert_left
 #align finset.image₂_insert_left Finset.image₂_insert_left
 
-/- warning: finset.image₂_insert_right -> Finset.image₂_insert_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {b : β} [_inst_9 : DecidableEq.{succ u2} β], Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s (Insert.insert.{u2, u2} β (Finset.{u2} β) (Finset.hasInsert.{u2} β (fun (a : β) (b : β) => _inst_9 a b)) b t)) (Union.union.{u3} (Finset.{u3} γ) (Finset.hasUnion.{u3} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image.{u1, u3} α γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (a : α) => f a b) s) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
-but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u3}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u3} β} {b : β} [_inst_9 : DecidableEq.{succ u3} β], Eq.{succ u2} (Finset.{u2} γ) (Finset.image₂.{u1, u3, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s (Insert.insert.{u3, u3} β (Finset.{u3} β) (Finset.instInsertFinset.{u3} β (fun (a : β) (b : β) => _inst_9 a b)) b t)) (Union.union.{u2} (Finset.{u2} γ) (Finset.instUnionFinset.{u2} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image.{u1, u2} α γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (a : α) => f a b) s) (Finset.image₂.{u1, u3, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_insert_right Finset.image₂_insert_rightₓ'. -/
 @[simp]
 theorem image₂_insert_right [DecidableEq β] :
     image₂ f s (insert b t) = (s.image fun a => f a b) ∪ image₂ f s t :=
   coe_injective <| by push_cast ; exact image2_insert_right
 #align finset.image₂_insert_right Finset.image₂_insert_right
 
-/- warning: finset.image₂_inter_left -> Finset.image₂_inter_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {s' : Finset.{u1} α} {t : Finset.{u2} β} [_inst_9 : DecidableEq.{succ u1} α], (Function.Injective2.{succ u1, succ u2, succ u3} α β γ f) -> (Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Inter.inter.{u1} (Finset.{u1} α) (Finset.hasInter.{u1} α (fun (a : α) (b : α) => _inst_9 a b)) s s') t) (Inter.inter.{u3} (Finset.{u3} γ) (Finset.hasInter.{u3} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s' t)))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_3 : DecidableEq.{succ u1} γ] {f : α -> β -> γ} {s : Finset.{u3} α} {s' : Finset.{u3} α} {t : Finset.{u2} β} [_inst_9 : DecidableEq.{succ u3} α], (Function.Injective2.{succ u3, succ u2, succ u1} α β γ f) -> (Eq.{succ u1} (Finset.{u1} γ) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Inter.inter.{u3} (Finset.{u3} α) (Finset.instInterFinset.{u3} α (fun (a : α) (b : α) => _inst_9 a b)) s s') t) (Inter.inter.{u1} (Finset.{u1} γ) (Finset.instInterFinset.{u1} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s' t)))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_inter_left Finset.image₂_inter_leftₓ'. -/
 theorem image₂_inter_left [DecidableEq α] (hf : Injective2 f) :
     image₂ f (s ∩ s') t = image₂ f s t ∩ image₂ f s' t :=
   coe_injective <| by push_cast ; exact image2_inter_left hf
 #align finset.image₂_inter_left Finset.image₂_inter_left
 
-/- warning: finset.image₂_inter_right -> Finset.image₂_inter_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {t' : Finset.{u2} β} [_inst_9 : DecidableEq.{succ u2} β], (Function.Injective2.{succ u1, succ u2, succ u3} α β γ f) -> (Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s (Inter.inter.{u2} (Finset.{u2} β) (Finset.hasInter.{u2} β (fun (a : β) (b : β) => _inst_9 a b)) t t')) (Inter.inter.{u3} (Finset.{u3} γ) (Finset.hasInter.{u3} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t')))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u3}} {γ : Type.{u1}} [_inst_3 : DecidableEq.{succ u1} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {t : Finset.{u3} β} {t' : Finset.{u3} β} [_inst_9 : DecidableEq.{succ u3} β], (Function.Injective2.{succ u2, succ u3, succ u1} α β γ f) -> (Eq.{succ u1} (Finset.{u1} γ) (Finset.image₂.{u2, u3, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s (Inter.inter.{u3} (Finset.{u3} β) (Finset.instInterFinset.{u3} β (fun (a : β) (b : β) => _inst_9 a b)) t t')) (Inter.inter.{u1} (Finset.{u1} γ) (Finset.instInterFinset.{u1} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u2, u3, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u2, u3, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t')))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_inter_right Finset.image₂_inter_rightₓ'. -/
 theorem image₂_inter_right [DecidableEq β] (hf : Injective2 f) :
     image₂ f s (t ∩ t') = image₂ f s t ∩ image₂ f s t' :=
   coe_injective <| by push_cast ; exact image2_inter_right hf
 #align finset.image₂_inter_right Finset.image₂_inter_right
 
-/- warning: finset.image₂_inter_subset_left -> Finset.image₂_inter_subset_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {s' : Finset.{u1} α} {t : Finset.{u2} β} [_inst_9 : DecidableEq.{succ u1} α], HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Inter.inter.{u1} (Finset.{u1} α) (Finset.hasInter.{u1} α (fun (a : α) (b : α) => _inst_9 a b)) s s') t) (Inter.inter.{u3} (Finset.{u3} γ) (Finset.hasInter.{u3} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s' t))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {s : Finset.{u3} α} {s' : Finset.{u3} α} {t : Finset.{u1} β} [_inst_9 : DecidableEq.{succ u3} α], HasSubset.Subset.{u2} (Finset.{u2} γ) (Finset.instHasSubsetFinset.{u2} γ) (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Inter.inter.{u3} (Finset.{u3} α) (Finset.instInterFinset.{u3} α (fun (a : α) (b : α) => _inst_9 a b)) s s') t) (Inter.inter.{u2} (Finset.{u2} γ) (Finset.instInterFinset.{u2} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s' t))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_inter_subset_left Finset.image₂_inter_subset_leftₓ'. -/
 theorem image₂_inter_subset_left [DecidableEq α] :
     image₂ f (s ∩ s') t ⊆ image₂ f s t ∩ image₂ f s' t :=
   coe_subset.1 <| by push_cast ; exact image2_inter_subset_left
 #align finset.image₂_inter_subset_left Finset.image₂_inter_subset_left
 
-/- warning: finset.image₂_inter_subset_right -> Finset.image₂_inter_subset_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {t' : Finset.{u2} β} [_inst_9 : DecidableEq.{succ u2} β], HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s (Inter.inter.{u2} (Finset.{u2} β) (Finset.hasInter.{u2} β (fun (a : β) (b : β) => _inst_9 a b)) t t')) (Inter.inter.{u3} (Finset.{u3} γ) (Finset.hasInter.{u3} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t'))
-but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u3}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u3} β} {t' : Finset.{u3} β} [_inst_9 : DecidableEq.{succ u3} β], HasSubset.Subset.{u2} (Finset.{u2} γ) (Finset.instHasSubsetFinset.{u2} γ) (Finset.image₂.{u1, u3, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s (Inter.inter.{u3} (Finset.{u3} β) (Finset.instInterFinset.{u3} β (fun (a : β) (b : β) => _inst_9 a b)) t t')) (Inter.inter.{u2} (Finset.{u2} γ) (Finset.instInterFinset.{u2} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u1, u3, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u1, u3, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t'))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_inter_subset_right Finset.image₂_inter_subset_rightₓ'. -/
 theorem image₂_inter_subset_right [DecidableEq β] :
     image₂ f s (t ∩ t') ⊆ image₂ f s t ∩ image₂ f s t' :=
   coe_subset.1 <| by push_cast ; exact image2_inter_subset_right
 #align finset.image₂_inter_subset_right Finset.image₂_inter_subset_right
 
-/- warning: finset.image₂_congr -> Finset.image₂_congr is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {f' : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β}, (forall (a : α), (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) a s) -> (forall (b : β), (Membership.Mem.{u2, u2} β (Finset.{u2} β) (Finset.hasMem.{u2} β) b t) -> (Eq.{succ u3} γ (f a b) (f' a b)))) -> (Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f' s t))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_3 : DecidableEq.{succ u1} γ] {f : α -> β -> γ} {f' : α -> β -> γ} {s : Finset.{u3} α} {t : Finset.{u2} β}, (forall (a : α), (Membership.mem.{u3, u3} α (Finset.{u3} α) (Finset.instMembershipFinset.{u3} α) a s) -> (forall (b : β), (Membership.mem.{u2, u2} β (Finset.{u2} β) (Finset.instMembershipFinset.{u2} β) b t) -> (Eq.{succ u1} γ (f a b) (f' a b)))) -> (Eq.{succ u1} (Finset.{u1} γ) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f' s t))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_congr Finset.image₂_congrₓ'. -/
 theorem image₂_congr (h : ∀ a ∈ s, ∀ b ∈ t, f a b = f' a b) : image₂ f s t = image₂ f' s t :=
   coe_injective <| by push_cast ; exact image2_congr h
 #align finset.image₂_congr Finset.image₂_congr
 
-/- warning: finset.image₂_congr' -> Finset.image₂_congr' is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {f' : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β}, (forall (a : α) (b : β), Eq.{succ u3} γ (f a b) (f' a b)) -> (Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f' s t))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {f' : α -> β -> γ} {s : Finset.{u2} α} {t : Finset.{u1} β}, (forall (a : α) (b : β), Eq.{succ u3} γ (f a b) (f' a b)) -> (Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f' s t))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_congr' Finset.image₂_congr'ₓ'. -/
 /-- 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 :=
   image₂_congr fun a _ b _ => h a b
 #align finset.image₂_congr' Finset.image₂_congr'
 
-/- warning: finset.subset_image₂ -> Finset.subset_image₂ is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {u : Finset.{u3} γ} {s : Set.{u1} α} {t : Set.{u2} β}, (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) ((fun (a : Type.{u3}) (b : Type.{u3}) [self : HasLiftT.{succ u3, succ u3} a b] => self.0) (Finset.{u3} γ) (Set.{u3} γ) (HasLiftT.mk.{succ u3, succ u3} (Finset.{u3} γ) (Set.{u3} γ) (CoeTCₓ.coe.{succ u3, succ u3} (Finset.{u3} γ) (Set.{u3} γ) (Finset.Set.hasCoeT.{u3} γ))) u) (Set.image2.{u1, u2, u3} α β γ f s t)) -> (Exists.{succ u1} (Finset.{u1} α) (fun (s' : Finset.{u1} α) => Exists.{succ u2} (Finset.{u2} β) (fun (t' : Finset.{u2} β) => And (HasSubset.Subset.{u1} (Set.{u1} α) (Set.hasSubset.{u1} α) ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (Finset.{u1} α) (Set.{u1} α) (HasLiftT.mk.{succ u1, succ u1} (Finset.{u1} α) (Set.{u1} α) (CoeTCₓ.coe.{succ u1, succ u1} (Finset.{u1} α) (Set.{u1} α) (Finset.Set.hasCoeT.{u1} α))) s') s) (And (HasSubset.Subset.{u2} (Set.{u2} β) (Set.hasSubset.{u2} β) ((fun (a : Type.{u2}) (b : Type.{u2}) [self : HasLiftT.{succ u2, succ u2} a b] => self.0) (Finset.{u2} β) (Set.{u2} β) (HasLiftT.mk.{succ u2, succ u2} (Finset.{u2} β) (Set.{u2} β) (CoeTCₓ.coe.{succ u2, succ u2} (Finset.{u2} β) (Set.{u2} β) (Finset.Set.hasCoeT.{u2} β))) t') t) (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) u (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s' t'))))))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_3 : DecidableEq.{succ u1} γ] {f : α -> β -> γ} {u : Finset.{u1} γ} {s : Set.{u3} α} {t : Set.{u2} β}, (HasSubset.Subset.{u1} (Set.{u1} γ) (Set.instHasSubsetSet.{u1} γ) (Finset.toSet.{u1} γ u) (Set.image2.{u3, u2, u1} α β γ f s t)) -> (Exists.{succ u3} (Finset.{u3} α) (fun (s' : Finset.{u3} α) => Exists.{succ u2} (Finset.{u2} β) (fun (t' : Finset.{u2} β) => And (HasSubset.Subset.{u3} (Set.{u3} α) (Set.instHasSubsetSet.{u3} α) (Finset.toSet.{u3} α s') s) (And (HasSubset.Subset.{u2} (Set.{u2} β) (Set.instHasSubsetSet.{u2} β) (Finset.toSet.{u2} β t') t) (HasSubset.Subset.{u1} (Finset.{u1} γ) (Finset.instHasSubsetFinset.{u1} γ) u (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s' t'))))))
-Case conversion may be inaccurate. Consider using '#align finset.subset_image₂ Finset.subset_image₂ₓ'. -/
 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' :=
   by
@@ -468,54 +240,24 @@ theorem subset_image₂ {s : Set α} {t : Set β} (hu : ↑u ⊆ image2 f s t) :
 
 variable (s t)
 
-/- warning: finset.card_image₂_singleton_left -> Finset.card_image₂_singleton_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} (t : Finset.{u2} β) {a : α}, (Function.Injective.{succ u2, succ u3} β γ (f a)) -> (Eq.{1} Nat (Finset.card.{u3} γ (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Singleton.singleton.{u1, u1} α (Finset.{u1} α) (Finset.hasSingleton.{u1} α) a) t)) (Finset.card.{u2} β t))
-but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u3}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} (t : Finset.{u3} β) {a : α}, (Function.Injective.{succ u3, succ u2} β γ (f a)) -> (Eq.{1} Nat (Finset.card.{u2} γ (Finset.image₂.{u1, u3, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Singleton.singleton.{u1, u1} α (Finset.{u1} α) (Finset.instSingletonFinset.{u1} α) a) t)) (Finset.card.{u3} β t))
-Case conversion may be inaccurate. Consider using '#align finset.card_image₂_singleton_left Finset.card_image₂_singleton_leftₓ'. -/
 theorem card_image₂_singleton_left (hf : Injective (f a)) : (image₂ f {a} t).card = t.card := by
   rw [image₂_singleton_left, card_image_of_injective _ hf]
 #align finset.card_image₂_singleton_left Finset.card_image₂_singleton_left
 
-/- warning: finset.card_image₂_singleton_right -> Finset.card_image₂_singleton_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} (s : Finset.{u1} α) {b : β}, (Function.Injective.{succ u1, succ u3} α γ (fun (a : α) => f a b)) -> (Eq.{1} Nat (Finset.card.{u3} γ (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s (Singleton.singleton.{u2, u2} β (Finset.{u2} β) (Finset.hasSingleton.{u2} β) b))) (Finset.card.{u1} α s))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} (s : Finset.{u3} α) {b : β}, (Function.Injective.{succ u3, succ u2} α γ (fun (a : α) => f a b)) -> (Eq.{1} Nat (Finset.card.{u2} γ (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s (Singleton.singleton.{u1, u1} β (Finset.{u1} β) (Finset.instSingletonFinset.{u1} β) b))) (Finset.card.{u3} α s))
-Case conversion may be inaccurate. Consider using '#align finset.card_image₂_singleton_right Finset.card_image₂_singleton_rightₓ'. -/
 theorem card_image₂_singleton_right (hf : Injective fun a => f a b) :
     (image₂ f s {b}).card = s.card := by rw [image₂_singleton_right, card_image_of_injective _ hf]
 #align finset.card_image₂_singleton_right Finset.card_image₂_singleton_right
 
-/- warning: finset.image₂_singleton_inter -> Finset.image₂_singleton_inter is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {a : α} [_inst_9 : DecidableEq.{succ u2} β] (t₁ : Finset.{u2} β) (t₂ : Finset.{u2} β), (Function.Injective.{succ u2, succ u3} β γ (f a)) -> (Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Singleton.singleton.{u1, u1} α (Finset.{u1} α) (Finset.hasSingleton.{u1} α) a) (Inter.inter.{u2} (Finset.{u2} β) (Finset.hasInter.{u2} β (fun (a : β) (b : β) => _inst_9 a b)) t₁ t₂)) (Inter.inter.{u3} (Finset.{u3} γ) (Finset.hasInter.{u3} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Singleton.singleton.{u1, u1} α (Finset.{u1} α) (Finset.hasSingleton.{u1} α) a) t₁) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Singleton.singleton.{u1, u1} α (Finset.{u1} α) (Finset.hasSingleton.{u1} α) a) t₂)))
-but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u3}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {a : α} [_inst_9 : DecidableEq.{succ u3} β] (t₁ : Finset.{u3} β) (t₂ : Finset.{u3} β), (Function.Injective.{succ u3, succ u2} β γ (f a)) -> (Eq.{succ u2} (Finset.{u2} γ) (Finset.image₂.{u1, u3, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Singleton.singleton.{u1, u1} α (Finset.{u1} α) (Finset.instSingletonFinset.{u1} α) a) (Inter.inter.{u3} (Finset.{u3} β) (Finset.instInterFinset.{u3} β (fun (a : β) (b : β) => _inst_9 a b)) t₁ t₂)) (Inter.inter.{u2} (Finset.{u2} γ) (Finset.instInterFinset.{u2} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u1, u3, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Singleton.singleton.{u1, u1} α (Finset.{u1} α) (Finset.instSingletonFinset.{u1} α) a) t₁) (Finset.image₂.{u1, u3, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Singleton.singleton.{u1, u1} α (Finset.{u1} α) (Finset.instSingletonFinset.{u1} α) a) t₂)))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_singleton_inter Finset.image₂_singleton_interₓ'. -/
 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₂ := by
   simp_rw [image₂_singleton_left, image_inter _ _ hf]
 #align finset.image₂_singleton_inter Finset.image₂_singleton_inter
 
-/- warning: finset.image₂_inter_singleton -> Finset.image₂_inter_singleton is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {b : β} [_inst_9 : DecidableEq.{succ u1} α] (s₁ : Finset.{u1} α) (s₂ : Finset.{u1} α), (Function.Injective.{succ u1, succ u3} α γ (fun (a : α) => f a b)) -> (Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Inter.inter.{u1} (Finset.{u1} α) (Finset.hasInter.{u1} α (fun (a : α) (b : α) => _inst_9 a b)) s₁ s₂) (Singleton.singleton.{u2, u2} β (Finset.{u2} β) (Finset.hasSingleton.{u2} β) b)) (Inter.inter.{u3} (Finset.{u3} γ) (Finset.hasInter.{u3} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s₁ (Singleton.singleton.{u2, u2} β (Finset.{u2} β) (Finset.hasSingleton.{u2} β) b)) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s₂ (Singleton.singleton.{u2, u2} β (Finset.{u2} β) (Finset.hasSingleton.{u2} β) b))))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {b : β} [_inst_9 : DecidableEq.{succ u3} α] (s₁ : Finset.{u3} α) (s₂ : Finset.{u3} α), (Function.Injective.{succ u3, succ u2} α γ (fun (a : α) => f a b)) -> (Eq.{succ u2} (Finset.{u2} γ) (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Inter.inter.{u3} (Finset.{u3} α) (Finset.instInterFinset.{u3} α (fun (a : α) (b : α) => _inst_9 a b)) s₁ s₂) (Singleton.singleton.{u1, u1} β (Finset.{u1} β) (Finset.instSingletonFinset.{u1} β) b)) (Inter.inter.{u2} (Finset.{u2} γ) (Finset.instInterFinset.{u2} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s₁ (Singleton.singleton.{u1, u1} β (Finset.{u1} β) (Finset.instSingletonFinset.{u1} β) b)) (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s₂ (Singleton.singleton.{u1, u1} β (Finset.{u1} β) (Finset.instSingletonFinset.{u1} β) b))))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_inter_singleton Finset.image₂_inter_singletonₓ'. -/
 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} := by
   simp_rw [image₂_singleton_right, image_inter _ _ hf]
 #align finset.image₂_inter_singleton Finset.image₂_inter_singleton
 
-/- warning: finset.card_le_card_image₂_left -> Finset.card_le_card_image₂_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} (t : Finset.{u2} β) {s : Finset.{u1} α}, (Finset.Nonempty.{u1} α s) -> (forall (a : α), Function.Injective.{succ u2, succ u3} β γ (f a)) -> (LE.le.{0} Nat Nat.hasLe (Finset.card.{u2} β t) (Finset.card.{u3} γ (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_3 : DecidableEq.{succ u1} γ] {f : α -> β -> γ} (t : Finset.{u2} β) {s : Finset.{u3} α}, (Finset.Nonempty.{u3} α s) -> (forall (a : α), Function.Injective.{succ u2, succ u1} β γ (f a)) -> (LE.le.{0} Nat instLENat (Finset.card.{u2} β t) (Finset.card.{u1} γ (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)))
-Case conversion may be inaccurate. Consider using '#align finset.card_le_card_image₂_left Finset.card_le_card_image₂_leftₓ'. -/
 theorem card_le_card_image₂_left {s : Finset α} (hs : s.Nonempty) (hf : ∀ a, Injective (f a)) :
     t.card ≤ (image₂ f s t).card := by
   obtain ⟨a, ha⟩ := hs
@@ -523,12 +265,6 @@ theorem card_le_card_image₂_left {s : Finset α} (hs : s.Nonempty) (hf : ∀ a
   exact card_le_of_subset (image₂_subset_right <| singleton_subset_iff.2 ha)
 #align finset.card_le_card_image₂_left Finset.card_le_card_image₂_left
 
-/- warning: finset.card_le_card_image₂_right -> Finset.card_le_card_image₂_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} (s : Finset.{u1} α) {t : Finset.{u2} β}, (Finset.Nonempty.{u2} β t) -> (forall (b : β), Function.Injective.{succ u1, succ u3} α γ (fun (a : α) => f a b)) -> (LE.le.{0} Nat Nat.hasLe (Finset.card.{u1} α s) (Finset.card.{u3} γ (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u3}} {γ : Type.{u1}} [_inst_3 : DecidableEq.{succ u1} γ] {f : α -> β -> γ} (s : Finset.{u2} α) {t : Finset.{u3} β}, (Finset.Nonempty.{u3} β t) -> (forall (b : β), Function.Injective.{succ u2, succ u1} α γ (fun (a : α) => f a b)) -> (LE.le.{0} Nat instLENat (Finset.card.{u2} α s) (Finset.card.{u1} γ (Finset.image₂.{u2, u3, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)))
-Case conversion may be inaccurate. Consider using '#align finset.card_le_card_image₂_right Finset.card_le_card_image₂_rightₓ'. -/
 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 :=
   by
@@ -539,12 +275,6 @@ theorem card_le_card_image₂_right {t : Finset β} (ht : t.Nonempty)
 
 variable {s t}
 
-/- warning: finset.bUnion_image_left -> Finset.biUnion_image_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β}, Eq.{succ u3} (Finset.{u3} γ) (Finset.biUnion.{u1, u3} α γ (fun (a : γ) (b : γ) => _inst_3 a b) s (fun (a : α) => Finset.image.{u2, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (f a) t)) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {t : Finset.{u1} β}, Eq.{succ u3} (Finset.{u3} γ) (Finset.biUnion.{u2, u3} α γ (fun (a : γ) (b : γ) => _inst_3 a b) s (fun (a : α) => Finset.image.{u1, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (f a) t)) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)
-Case conversion may be inaccurate. Consider using '#align finset.bUnion_image_left Finset.biUnion_image_leftₓ'. -/
 theorem biUnion_image_left : (s.biUnion fun a => t.image <| f a) = image₂ f s t :=
   coe_injective <| by push_cast ; exact Set.iUnion_image_left _
 #align finset.bUnion_image_left Finset.biUnion_image_left
@@ -566,12 +296,6 @@ The proof pattern is `image₂_lemma operation_lemma`. For example, `image₂_co
 -/
 
 
-/- warning: finset.image_image₂ -> Finset.image_image₂ is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} [_inst_3 : DecidableEq.{succ u3} γ] [_inst_5 : DecidableEq.{succ u4} δ] {s : Finset.{u1} α} {t : Finset.{u2} β} (f : α -> β -> γ) (g : γ -> δ), Eq.{succ u4} (Finset.{u4} δ) (Finset.image.{u3, u4} γ δ (fun (a : δ) (b : δ) => _inst_5 a b) g (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (Finset.image₂.{u1, u2, u4} α β δ (fun (a : δ) (b : δ) => _inst_5 a b) (fun (a : α) (b : β) => g (f a b)) s t)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {δ : Type.{u4}} [_inst_3 : DecidableEq.{succ u3} γ] [_inst_5 : DecidableEq.{succ u4} δ] {s : Finset.{u2} α} {t : Finset.{u1} β} (f : α -> β -> γ) (g : γ -> δ), Eq.{succ u4} (Finset.{u4} δ) (Finset.image.{u3, u4} γ δ (fun (a : δ) (b : δ) => _inst_5 a b) g (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (Finset.image₂.{u2, u1, u4} α β δ (fun (a : δ) (b : δ) => _inst_5 a b) (fun (a : α) (b : β) => g (f a b)) s t)
-Case conversion may be inaccurate. Consider using '#align finset.image_image₂ Finset.image_image₂ₓ'. -/
 theorem image_image₂ (f : α → β → γ) (g : γ → δ) :
     (image₂ f s t).image g = image₂ (fun a b => g (f a b)) s t :=
   coe_injective <| by push_cast ; exact image_image2 _ _
@@ -584,35 +308,17 @@ theorem image₂_image_left (f : γ → β → δ) (g : α → γ) :
 #align finset.image₂_image_left Finset.image₂_image_left
 -/
 
-/- warning: finset.image₂_image_right -> Finset.image₂_image_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} [_inst_3 : DecidableEq.{succ u3} γ] [_inst_5 : DecidableEq.{succ u4} δ] {s : Finset.{u1} α} {t : Finset.{u2} β} (f : α -> γ -> δ) (g : β -> γ), Eq.{succ u4} (Finset.{u4} δ) (Finset.image₂.{u1, u3, u4} α γ δ (fun (a : δ) (b : δ) => _inst_5 a b) f s (Finset.image.{u2, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) g t)) (Finset.image₂.{u1, u2, u4} α β δ (fun (a : δ) (b : δ) => _inst_5 a b) (fun (a : α) (b : β) => f a (g b)) s t)
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} {δ : Type.{u4}} [_inst_3 : DecidableEq.{succ u2} γ] [_inst_5 : DecidableEq.{succ u4} δ] {s : Finset.{u3} α} {t : Finset.{u1} β} (f : α -> γ -> δ) (g : β -> γ), Eq.{succ u4} (Finset.{u4} δ) (Finset.image₂.{u3, u2, u4} α γ δ (fun (a : δ) (b : δ) => _inst_5 a b) f s (Finset.image.{u1, u2} β γ (fun (a : γ) (b : γ) => _inst_3 a b) g t)) (Finset.image₂.{u3, u1, u4} α β δ (fun (a : δ) (b : δ) => _inst_5 a b) (fun (a : α) (b : β) => f a (g b)) s t)
-Case conversion may be inaccurate. Consider using '#align finset.image₂_image_right Finset.image₂_image_rightₓ'. -/
 theorem image₂_image_right (f : α → γ → δ) (g : β → γ) :
     image₂ f s (t.image g) = image₂ (fun a b => f a (g b)) s t :=
   coe_injective <| by push_cast ; exact image2_image_right _ _
 #align finset.image₂_image_right Finset.image₂_image_right
 
-/- warning: finset.image₂_mk_eq_product -> Finset.image₂_mk_eq_product is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_9 : DecidableEq.{succ u1} α] [_inst_10 : DecidableEq.{succ u2} β] (s : Finset.{u1} α) (t : Finset.{u2} β), Eq.{succ (max u1 u2)} (Finset.{max u1 u2} (Prod.{u1, u2} α β)) (Finset.image₂.{u1, u2, max u1 u2} α β (Prod.{u1, u2} α β) (fun (a : Prod.{u1, u2} α β) (b : Prod.{u1, u2} α β) => Prod.decidableEq.{u1, u2} α β (fun (a : α) (b : α) => _inst_9 a b) (fun (a : β) (b : β) => _inst_10 a b) a b) (Prod.mk.{u1, u2} α β) s t) (Finset.product.{u1, u2} α β s t)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_9 : DecidableEq.{succ u2} α] [_inst_10 : DecidableEq.{succ u1} β] (s : Finset.{u2} α) (t : Finset.{u1} β), Eq.{max (succ u2) (succ u1)} (Finset.{max u1 u2} (Prod.{u2, u1} α β)) (Finset.image₂.{u2, u1, max u1 u2} α β (Prod.{u2, u1} α β) (fun (a : Prod.{u2, u1} α β) (b : Prod.{u2, u1} α β) => instDecidableEqProd.{u2, u1} α β (fun (a : α) (b : α) => _inst_9 a b) (fun (a : β) (b : β) => _inst_10 a b) a b) (Prod.mk.{u2, u1} α β) s t) (Finset.product.{u2, u1} α β s t)
-Case conversion may be inaccurate. Consider using '#align finset.image₂_mk_eq_product Finset.image₂_mk_eq_productₓ'. -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 @[simp]
 theorem image₂_mk_eq_product [DecidableEq α] [DecidableEq β] (s : Finset α) (t : Finset β) :
     image₂ Prod.mk s t = s ×ˢ t := by ext <;> simp [Prod.ext_iff]
 #align finset.image₂_mk_eq_product Finset.image₂_mk_eq_product
 
-/- warning: finset.image₂_curry -> Finset.image₂_curry is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] (f : (Prod.{u1, u2} α β) -> γ) (s : Finset.{u1} α) (t : Finset.{u2} β), Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) (Function.curry.{u1, u2, u3} α β γ f) s t) (Finset.image.{max u1 u2, u3} (Prod.{u1, u2} α β) γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Finset.product.{u1, u2} α β s t))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_3 : DecidableEq.{succ u1} γ] (f : (Prod.{u3, u2} α β) -> γ) (s : Finset.{u3} α) (t : Finset.{u2} β), Eq.{succ u1} (Finset.{u1} γ) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) (Function.curry.{u3, u2, u1} α β γ f) s t) (Finset.image.{max u3 u2, u1} (Prod.{u3, u2} α β) γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Finset.product.{u3, u2} α β s t))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_curry Finset.image₂_curryₓ'. -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 @[simp]
 theorem image₂_curry (f : α × β → γ) (s : Finset α) (t : Finset β) :
@@ -620,35 +326,17 @@ theorem image₂_curry (f : α × β → γ) (s : Finset α) (t : Finset β) :
   classical rw [← image₂_mk_eq_product, image_image₂, curry]
 #align finset.image₂_curry Finset.image₂_curry
 
-/- warning: finset.image_uncurry_product -> Finset.image_uncurry_product is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] (f : α -> β -> γ) (s : Finset.{u1} α) (t : Finset.{u2} β), Eq.{succ u3} (Finset.{u3} γ) (Finset.image.{max u1 u2, u3} (Prod.{u1, u2} α β) γ (fun (a : γ) (b : γ) => _inst_3 a b) (Function.uncurry.{u1, u2, u3} α β γ f) (Finset.product.{u1, u2} α β s t)) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_3 : DecidableEq.{succ u1} γ] (f : α -> β -> γ) (s : Finset.{u3} α) (t : Finset.{u2} β), Eq.{succ u1} (Finset.{u1} γ) (Finset.image.{max u2 u3, u1} (Prod.{u3, u2} α β) γ (fun (a : γ) (b : γ) => _inst_3 a b) (Function.uncurry.{u3, u2, u1} α β γ f) (Finset.product.{u3, u2} α β s t)) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)
-Case conversion may be inaccurate. Consider using '#align finset.image_uncurry_product Finset.image_uncurry_productₓ'. -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 @[simp]
 theorem image_uncurry_product (f : α → β → γ) (s : Finset α) (t : Finset β) :
     (s ×ˢ t).image (uncurry f) = image₂ f s t := by rw [← image₂_curry, curry_uncurry]
 #align finset.image_uncurry_product Finset.image_uncurry_product
 
-/- warning: finset.image₂_swap -> Finset.image₂_swap is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] (f : α -> β -> γ) (s : Finset.{u1} α) (t : Finset.{u2} β), Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u2, u1, u3} β α γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (a : β) (b : α) => f b a) t s)
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_3 : DecidableEq.{succ u1} γ] (f : α -> β -> γ) (s : Finset.{u3} α) (t : Finset.{u2} β), Eq.{succ u1} (Finset.{u1} γ) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u2, u3, u1} β α γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (a : β) (b : α) => f b a) t s)
-Case conversion may be inaccurate. Consider using '#align finset.image₂_swap Finset.image₂_swapₓ'. -/
 theorem image₂_swap (f : α → β → γ) (s : Finset α) (t : Finset β) :
     image₂ f s t = image₂ (fun a b => f b a) t s :=
   coe_injective <| by push_cast ; exact image2_swap _ _ _
 #align finset.image₂_swap Finset.image₂_swap
 
-/- warning: finset.image₂_left -> Finset.image₂_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {s : Finset.{u1} α} {t : Finset.{u2} β} [_inst_9 : DecidableEq.{succ u1} α], (Finset.Nonempty.{u2} β t) -> (Eq.{succ u1} (Finset.{u1} α) (Finset.image₂.{u1, u2, u1} α β α (fun (a : α) (b : α) => _inst_9 a b) (fun (x : α) (y : β) => x) s t) s)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {s : Finset.{u2} α} {t : Finset.{u1} β} [_inst_9 : DecidableEq.{succ u2} α], (Finset.Nonempty.{u1} β t) -> (Eq.{succ u2} (Finset.{u2} α) (Finset.image₂.{u2, u1, u2} α β α (fun (a : α) (b : α) => _inst_9 a b) (fun (x : α) (y : β) => x) s t) s)
-Case conversion may be inaccurate. Consider using '#align finset.image₂_left Finset.image₂_leftₓ'. -/
 @[simp]
 theorem image₂_left [DecidableEq α] (h : t.Nonempty) : image₂ (fun x y => x) s t = s :=
   coe_injective <| by push_cast ; exact image2_left h
@@ -661,55 +349,28 @@ theorem image₂_right [DecidableEq β] (h : s.Nonempty) : image₂ (fun x y =>
 #align finset.image₂_right Finset.image₂_right
 -/
 
-/- warning: finset.image₂_assoc -> Finset.image₂_assoc is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {δ : Type.{u3}} {ε : Type.{u4}} {ε' : Type.{u5}} [_inst_5 : DecidableEq.{succ u3} δ] [_inst_7 : DecidableEq.{succ u4} ε] [_inst_8 : DecidableEq.{succ u5} ε'] {s : Finset.{u1} α} {t : Finset.{u2} β} {γ : Type.{u6}} {u : Finset.{u6} γ} {f : δ -> γ -> ε} {g : α -> β -> δ} {f' : α -> ε' -> ε} {g' : β -> γ -> ε'}, (forall (a : α) (b : β) (c : γ), Eq.{succ u4} ε (f (g a b) c) (f' a (g' b c))) -> (Eq.{succ u4} (Finset.{u4} ε) (Finset.image₂.{u3, u6, u4} δ γ ε (fun (a : ε) (b : ε) => _inst_7 a b) f (Finset.image₂.{u1, u2, u3} α β δ (fun (a : δ) (b : δ) => _inst_5 a b) g s t) u) (Finset.image₂.{u1, u5, u4} α ε' ε (fun (a : ε) (b : ε) => _inst_7 a b) f' s (Finset.image₂.{u2, u6, u5} β γ ε' (fun (a : ε') (b : ε') => _inst_8 a b) g' t u)))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {δ : Type.{u4}} {ε : Type.{u5}} {ε' : Type.{u1}} [_inst_5 : DecidableEq.{succ u4} δ] [_inst_7 : DecidableEq.{succ u5} ε] [_inst_8 : DecidableEq.{succ u1} ε'] {s : Finset.{u3} α} {t : Finset.{u2} β} {γ : Type.{u6}} {u : Finset.{u6} γ} {f : δ -> γ -> ε} {g : α -> β -> δ} {f' : α -> ε' -> ε} {g' : β -> γ -> ε'}, (forall (a : α) (b : β) (c : γ), Eq.{succ u5} ε (f (g a b) c) (f' a (g' b c))) -> (Eq.{succ u5} (Finset.{u5} ε) (Finset.image₂.{u4, u6, u5} δ γ ε (fun (a : ε) (b : ε) => _inst_7 a b) f (Finset.image₂.{u3, u2, u4} α β δ (fun (a : δ) (b : δ) => _inst_5 a b) g s t) u) (Finset.image₂.{u3, u1, u5} α ε' ε (fun (a : ε) (b : ε) => _inst_7 a b) f' s (Finset.image₂.{u2, u6, u1} β γ ε' (fun (a : ε') (b : ε') => _inst_8 a b) g' t u)))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_assoc Finset.image₂_assocₓ'. -/
 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) :=
   coe_injective <| by push_cast ; exact image2_assoc h_assoc
 #align finset.image₂_assoc Finset.image₂_assoc
 
-/- warning: finset.image₂_comm -> Finset.image₂_comm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {g : β -> α -> γ}, (forall (a : α) (b : β), Eq.{succ u3} γ (f a b) (g b a)) -> (Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u2, u1, u3} β α γ (fun (a : γ) (b : γ) => _inst_3 a b) g t s))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {t : Finset.{u1} β} {g : β -> α -> γ}, (forall (a : α) (b : β), Eq.{succ u3} γ (f a b) (g b a)) -> (Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u1, u2, u3} β α γ (fun (a : γ) (b : γ) => _inst_3 a b) g t s))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_comm Finset.image₂_commₓ'. -/
 theorem image₂_comm {g : β → α → γ} (h_comm : ∀ a b, f a b = g b a) : image₂ f s t = image₂ g t s :=
   (image₂_swap _ _ _).trans <| by simp_rw [h_comm]
 #align finset.image₂_comm Finset.image₂_comm
 
-/- warning: finset.image₂_left_comm -> Finset.image₂_left_comm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {δ : Type.{u3}} {δ' : Type.{u4}} {ε : Type.{u5}} [_inst_5 : DecidableEq.{succ u3} δ] [_inst_6 : DecidableEq.{succ u4} δ'] [_inst_7 : DecidableEq.{succ u5} ε] {s : Finset.{u1} α} {t : Finset.{u2} β} {γ : Type.{u6}} {u : Finset.{u6} γ} {f : α -> δ -> ε} {g : β -> γ -> δ} {f' : α -> γ -> δ'} {g' : β -> δ' -> ε}, (forall (a : α) (b : β) (c : γ), Eq.{succ u5} ε (f a (g b c)) (g' b (f' a c))) -> (Eq.{succ u5} (Finset.{u5} ε) (Finset.image₂.{u1, u3, u5} α δ ε (fun (a : ε) (b : ε) => _inst_7 a b) f s (Finset.image₂.{u2, u6, u3} β γ δ (fun (a : δ) (b : δ) => _inst_5 a b) g t u)) (Finset.image₂.{u2, u4, u5} β δ' ε (fun (a : ε) (b : ε) => _inst_7 a b) g' t (Finset.image₂.{u1, u6, u4} α γ δ' (fun (a : δ') (b : δ') => _inst_6 a b) f' s u)))
-but is expected to have type
-  forall {α : Type.{u4}} {β : Type.{u2}} {δ : Type.{u3}} {δ' : Type.{u1}} {ε : Type.{u5}} [_inst_5 : DecidableEq.{succ u3} δ] [_inst_6 : DecidableEq.{succ u1} δ'] [_inst_7 : DecidableEq.{succ u5} ε] {s : Finset.{u4} α} {t : Finset.{u2} β} {γ : Type.{u6}} {u : Finset.{u6} γ} {f : α -> δ -> ε} {g : β -> γ -> δ} {f' : α -> γ -> δ'} {g' : β -> δ' -> ε}, (forall (a : α) (b : β) (c : γ), Eq.{succ u5} ε (f a (g b c)) (g' b (f' a c))) -> (Eq.{succ u5} (Finset.{u5} ε) (Finset.image₂.{u4, u3, u5} α δ ε (fun (a : ε) (b : ε) => _inst_7 a b) f s (Finset.image₂.{u2, u6, u3} β γ δ (fun (a : δ) (b : δ) => _inst_5 a b) g t u)) (Finset.image₂.{u2, u1, u5} β δ' ε (fun (a : ε) (b : ε) => _inst_7 a b) g' t (Finset.image₂.{u4, u6, u1} α γ δ' (fun (a : δ') (b : δ') => _inst_6 a b) f' s u)))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_left_comm Finset.image₂_left_commₓ'. -/
 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) :=
   coe_injective <| by push_cast ; exact image2_left_comm h_left_comm
 #align finset.image₂_left_comm Finset.image₂_left_comm
 
-/- warning: finset.image₂_right_comm -> Finset.image₂_right_comm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {δ : Type.{u3}} {δ' : Type.{u4}} {ε : Type.{u5}} [_inst_5 : DecidableEq.{succ u3} δ] [_inst_6 : DecidableEq.{succ u4} δ'] [_inst_7 : DecidableEq.{succ u5} ε] {s : Finset.{u1} α} {t : Finset.{u2} β} {γ : Type.{u6}} {u : Finset.{u6} γ} {f : δ -> γ -> ε} {g : α -> β -> δ} {f' : α -> γ -> δ'} {g' : δ' -> β -> ε}, (forall (a : α) (b : β) (c : γ), Eq.{succ u5} ε (f (g a b) c) (g' (f' a c) b)) -> (Eq.{succ u5} (Finset.{u5} ε) (Finset.image₂.{u3, u6, u5} δ γ ε (fun (a : ε) (b : ε) => _inst_7 a b) f (Finset.image₂.{u1, u2, u3} α β δ (fun (a : δ) (b : δ) => _inst_5 a b) g s t) u) (Finset.image₂.{u4, u2, u5} δ' β ε (fun (a : ε) (b : ε) => _inst_7 a b) g' (Finset.image₂.{u1, u6, u4} α γ δ' (fun (a : δ') (b : δ') => _inst_6 a b) f' s u) t))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {δ : Type.{u4}} {δ' : Type.{u1}} {ε : Type.{u5}} [_inst_5 : DecidableEq.{succ u4} δ] [_inst_6 : DecidableEq.{succ u1} δ'] [_inst_7 : DecidableEq.{succ u5} ε] {s : Finset.{u3} α} {t : Finset.{u2} β} {γ : Type.{u6}} {u : Finset.{u6} γ} {f : δ -> γ -> ε} {g : α -> β -> δ} {f' : α -> γ -> δ'} {g' : δ' -> β -> ε}, (forall (a : α) (b : β) (c : γ), Eq.{succ u5} ε (f (g a b) c) (g' (f' a c) b)) -> (Eq.{succ u5} (Finset.{u5} ε) (Finset.image₂.{u4, u6, u5} δ γ ε (fun (a : ε) (b : ε) => _inst_7 a b) f (Finset.image₂.{u3, u2, u4} α β δ (fun (a : δ) (b : δ) => _inst_5 a b) g s t) u) (Finset.image₂.{u1, u2, u5} δ' β ε (fun (a : ε) (b : ε) => _inst_7 a b) g' (Finset.image₂.{u3, u6, u1} α γ δ' (fun (a : δ') (b : δ') => _inst_6 a b) f' s u) t))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_right_comm Finset.image₂_right_commₓ'. -/
 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 :=
   coe_injective <| by push_cast ; exact image2_right_comm h_right_comm
 #align finset.image₂_right_comm Finset.image₂_right_comm
 
-/- warning: finset.image₂_image₂_image₂_comm -> Finset.image₂_image₂_image₂_comm is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align finset.image₂_image₂_image₂_comm Finset.image₂_image₂_image₂_commₓ'. -/
 theorem image₂_image₂_image₂_comm {γ δ : Type _} {u : Finset γ} {v : Finset δ} [DecidableEq ζ]
     [DecidableEq ζ'] [DecidableEq ν] {f : ε → ζ → ν} {g : α → β → ε} {h : γ → δ → ζ}
     {f' : ε' → ζ' → ν} {g' : α → γ → ε'} {h' : β → δ → ζ'}
@@ -718,24 +379,12 @@ theorem image₂_image₂_image₂_comm {γ δ : Type _} {u : Finset γ} {v : Fi
   coe_injective <| by push_cast ; exact image2_image2_image2_comm h_comm
 #align finset.image₂_image₂_image₂_comm Finset.image₂_image₂_image₂_comm
 
-/- warning: finset.image_image₂_distrib -> Finset.image_image₂_distrib is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {β' : Type.{u4}} {γ : Type.{u5}} {δ : Type.{u6}} [_inst_1 : DecidableEq.{succ u2} α'] [_inst_2 : DecidableEq.{succ u4} β'] [_inst_3 : DecidableEq.{succ u5} γ] [_inst_5 : DecidableEq.{succ u6} δ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u3} β} {g : γ -> δ} {f' : α' -> β' -> δ} {g₁ : α -> α'} {g₂ : β -> β'}, (forall (a : α) (b : β), Eq.{succ u6} δ (g (f a b)) (f' (g₁ a) (g₂ b))) -> (Eq.{succ u6} (Finset.{u6} δ) (Finset.image.{u5, u6} γ δ (fun (a : δ) (b : δ) => _inst_5 a b) g (Finset.image₂.{u1, u3, u5} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (Finset.image₂.{u2, u4, u6} α' β' δ (fun (a : δ) (b : δ) => _inst_5 a b) f' (Finset.image.{u1, u2} α α' (fun (a : α') (b : α') => _inst_1 a b) g₁ s) (Finset.image.{u3, u4} β β' (fun (a : β') (b : β') => _inst_2 a b) g₂ t)))
-but is expected to have type
-  forall {α : Type.{u4}} {α' : Type.{u2}} {β : Type.{u3}} {β' : Type.{u1}} {γ : Type.{u5}} {δ : Type.{u6}} [_inst_1 : DecidableEq.{succ u2} α'] [_inst_2 : DecidableEq.{succ u1} β'] [_inst_3 : DecidableEq.{succ u5} γ] [_inst_5 : DecidableEq.{succ u6} δ] {f : α -> β -> γ} {s : Finset.{u4} α} {t : Finset.{u3} β} {g : γ -> δ} {f' : α' -> β' -> δ} {g₁ : α -> α'} {g₂ : β -> β'}, (forall (a : α) (b : β), Eq.{succ u6} δ (g (f a b)) (f' (g₁ a) (g₂ b))) -> (Eq.{succ u6} (Finset.{u6} δ) (Finset.image.{u5, u6} γ δ (fun (a : δ) (b : δ) => _inst_5 a b) g (Finset.image₂.{u4, u3, u5} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (Finset.image₂.{u2, u1, u6} α' β' δ (fun (a : δ) (b : δ) => _inst_5 a b) f' (Finset.image.{u4, u2} α α' (fun (a : α') (b : α') => _inst_1 a b) g₁ s) (Finset.image.{u3, u1} β β' (fun (a : β') (b : β') => _inst_2 a b) g₂ t)))
-Case conversion may be inaccurate. Consider using '#align finset.image_image₂_distrib Finset.image_image₂_distribₓ'. -/
 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₂) :=
   coe_injective <| by push_cast ; exact image_image2_distrib h_distrib
 #align finset.image_image₂_distrib Finset.image_image₂_distrib
 
-/- warning: finset.image_image₂_distrib_left -> Finset.image_image₂_distrib_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} [_inst_1 : DecidableEq.{succ u2} α'] [_inst_3 : DecidableEq.{succ u4} γ] [_inst_5 : DecidableEq.{succ u5} δ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u3} β} {g : γ -> δ} {f' : α' -> β -> δ} {g' : α -> α'}, (forall (a : α) (b : β), Eq.{succ u5} δ (g (f a b)) (f' (g' a) b)) -> (Eq.{succ u5} (Finset.{u5} δ) (Finset.image.{u4, u5} γ δ (fun (a : δ) (b : δ) => _inst_5 a b) g (Finset.image₂.{u1, u3, u4} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (Finset.image₂.{u2, u3, u5} α' β δ (fun (a : δ) (b : δ) => _inst_5 a b) f' (Finset.image.{u1, u2} α α' (fun (a : α') (b : α') => _inst_1 a b) g' s) t))
-but is expected to have type
-  forall {α : Type.{u3}} {α' : Type.{u1}} {β : Type.{u2}} {γ : Type.{u4}} {δ : Type.{u5}} [_inst_1 : DecidableEq.{succ u1} α'] [_inst_3 : DecidableEq.{succ u4} γ] [_inst_5 : DecidableEq.{succ u5} δ] {f : α -> β -> γ} {s : Finset.{u3} α} {t : Finset.{u2} β} {g : γ -> δ} {f' : α' -> β -> δ} {g' : α -> α'}, (forall (a : α) (b : β), Eq.{succ u5} δ (g (f a b)) (f' (g' a) b)) -> (Eq.{succ u5} (Finset.{u5} δ) (Finset.image.{u4, u5} γ δ (fun (a : δ) (b : δ) => _inst_5 a b) g (Finset.image₂.{u3, u2, u4} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (Finset.image₂.{u1, u2, u5} α' β δ (fun (a : δ) (b : δ) => _inst_5 a b) f' (Finset.image.{u3, u1} α α' (fun (a : α') (b : α') => _inst_1 a b) g' s) t))
-Case conversion may be inaccurate. Consider using '#align finset.image_image₂_distrib_left Finset.image_image₂_distrib_leftₓ'. -/
 /-- 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) :
@@ -743,12 +392,6 @@ theorem image_image₂_distrib_left {g : γ → δ} {f' : α' → β → δ} {g'
   coe_injective <| by push_cast ; exact image_image2_distrib_left h_distrib
 #align finset.image_image₂_distrib_left Finset.image_image₂_distrib_left
 
-/- warning: finset.image_image₂_distrib_right -> Finset.image_image₂_distrib_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {β' : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} [_inst_2 : DecidableEq.{succ u3} β'] [_inst_3 : DecidableEq.{succ u4} γ] [_inst_5 : DecidableEq.{succ u5} δ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {g : γ -> δ} {f' : α -> β' -> δ} {g' : β -> β'}, (forall (a : α) (b : β), Eq.{succ u5} δ (g (f a b)) (f' a (g' b))) -> (Eq.{succ u5} (Finset.{u5} δ) (Finset.image.{u4, u5} γ δ (fun (a : δ) (b : δ) => _inst_5 a b) g (Finset.image₂.{u1, u2, u4} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (Finset.image₂.{u1, u3, u5} α β' δ (fun (a : δ) (b : δ) => _inst_5 a b) f' s (Finset.image.{u2, u3} β β' (fun (a : β') (b : β') => _inst_2 a b) g' t)))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {β' : Type.{u1}} {γ : Type.{u4}} {δ : Type.{u5}} [_inst_2 : DecidableEq.{succ u1} β'] [_inst_3 : DecidableEq.{succ u4} γ] [_inst_5 : DecidableEq.{succ u5} δ] {f : α -> β -> γ} {s : Finset.{u3} α} {t : Finset.{u2} β} {g : γ -> δ} {f' : α -> β' -> δ} {g' : β -> β'}, (forall (a : α) (b : β), Eq.{succ u5} δ (g (f a b)) (f' a (g' b))) -> (Eq.{succ u5} (Finset.{u5} δ) (Finset.image.{u4, u5} γ δ (fun (a : δ) (b : δ) => _inst_5 a b) g (Finset.image₂.{u3, u2, u4} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (Finset.image₂.{u3, u1, u5} α β' δ (fun (a : δ) (b : δ) => _inst_5 a b) f' s (Finset.image.{u2, u1} β β' (fun (a : β') (b : β') => _inst_2 a b) g' t)))
-Case conversion may be inaccurate. Consider using '#align finset.image_image₂_distrib_right Finset.image_image₂_distrib_rightₓ'. -/
 /-- 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)) :
@@ -756,12 +399,6 @@ theorem image_image₂_distrib_right {g : γ → δ} {f' : α → β' → δ} {g
   coe_injective <| by push_cast ; exact image_image2_distrib_right h_distrib
 #align finset.image_image₂_distrib_right Finset.image_image₂_distrib_right
 
-/- warning: finset.image₂_image_left_comm -> Finset.image₂_image_left_comm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} [_inst_1 : DecidableEq.{succ u2} α'] [_inst_3 : DecidableEq.{succ u4} γ] [_inst_5 : DecidableEq.{succ u5} δ] {s : Finset.{u1} α} {t : Finset.{u3} β} {f : α' -> β -> γ} {g : α -> α'} {f' : α -> β -> δ} {g' : δ -> γ}, (forall (a : α) (b : β), Eq.{succ u4} γ (f (g a) b) (g' (f' a b))) -> (Eq.{succ u4} (Finset.{u4} γ) (Finset.image₂.{u2, u3, u4} α' β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Finset.image.{u1, u2} α α' (fun (a : α') (b : α') => _inst_1 a b) g s) t) (Finset.image.{u5, u4} δ γ (fun (a : γ) (b : γ) => _inst_3 a b) g' (Finset.image₂.{u1, u3, u5} α β δ (fun (a : δ) (b : δ) => _inst_5 a b) f' s t)))
-but is expected to have type
-  forall {α : Type.{u2}} {α' : Type.{u4}} {β : Type.{u3}} {γ : Type.{u5}} {δ : Type.{u1}} [_inst_1 : DecidableEq.{succ u4} α'] [_inst_3 : DecidableEq.{succ u5} γ] [_inst_5 : DecidableEq.{succ u1} δ] {s : Finset.{u2} α} {t : Finset.{u3} β} {f : α' -> β -> γ} {g : α -> α'} {f' : α -> β -> δ} {g' : δ -> γ}, (forall (a : α) (b : β), Eq.{succ u5} γ (f (g a) b) (g' (f' a b))) -> (Eq.{succ u5} (Finset.{u5} γ) (Finset.image₂.{u4, u3, u5} α' β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Finset.image.{u2, u4} α α' (fun (a : α') (b : α') => _inst_1 a b) g s) t) (Finset.image.{u1, u5} δ γ (fun (a : γ) (b : γ) => _inst_3 a b) g' (Finset.image₂.{u2, u3, u1} α β δ (fun (a : δ) (b : δ) => _inst_5 a b) f' s t)))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_image_left_comm Finset.image₂_image_left_commₓ'. -/
 /-- 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)) :
@@ -769,12 +406,6 @@ theorem image₂_image_left_comm {f : α' → β → γ} {g : α → α'} {f' :
   (image_image₂_distrib_left fun a b => (h_left_comm a b).symm).symm
 #align finset.image₂_image_left_comm Finset.image₂_image_left_comm
 
-/- warning: finset.image_image₂_right_comm -> Finset.image_image₂_right_comm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {β' : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} [_inst_2 : DecidableEq.{succ u3} β'] [_inst_3 : DecidableEq.{succ u4} γ] [_inst_5 : DecidableEq.{succ u5} δ] {s : Finset.{u1} α} {t : Finset.{u2} β} {f : α -> β' -> γ} {g : β -> β'} {f' : α -> β -> δ} {g' : δ -> γ}, (forall (a : α) (b : β), Eq.{succ u4} γ (f a (g b)) (g' (f' a b))) -> (Eq.{succ u4} (Finset.{u4} γ) (Finset.image₂.{u1, u3, u4} α β' γ (fun (a : γ) (b : γ) => _inst_3 a b) f s (Finset.image.{u2, u3} β β' (fun (a : β') (b : β') => _inst_2 a b) g t)) (Finset.image.{u5, u4} δ γ (fun (a : γ) (b : γ) => _inst_3 a b) g' (Finset.image₂.{u1, u2, u5} α β δ (fun (a : δ) (b : δ) => _inst_5 a b) f' s t)))
-but is expected to have type
-  forall {α : Type.{u4}} {β : Type.{u2}} {β' : Type.{u3}} {γ : Type.{u5}} {δ : Type.{u1}} [_inst_2 : DecidableEq.{succ u3} β'] [_inst_3 : DecidableEq.{succ u5} γ] [_inst_5 : DecidableEq.{succ u1} δ] {s : Finset.{u4} α} {t : Finset.{u2} β} {f : α -> β' -> γ} {g : β -> β'} {f' : α -> β -> δ} {g' : δ -> γ}, (forall (a : α) (b : β), Eq.{succ u5} γ (f a (g b)) (g' (f' a b))) -> (Eq.{succ u5} (Finset.{u5} γ) (Finset.image₂.{u4, u3, u5} α β' γ (fun (a : γ) (b : γ) => _inst_3 a b) f s (Finset.image.{u2, u3} β β' (fun (a : β') (b : β') => _inst_2 a b) g t)) (Finset.image.{u1, u5} δ γ (fun (a : γ) (b : γ) => _inst_3 a b) g' (Finset.image₂.{u4, u2, u1} α β δ (fun (a : δ) (b : δ) => _inst_5 a b) f' s t)))
-Case conversion may be inaccurate. Consider using '#align finset.image_image₂_right_comm Finset.image_image₂_right_commₓ'. -/
 /-- 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)) :
@@ -782,9 +413,6 @@ theorem image_image₂_right_comm {f : α → β' → γ} {g : β → β'} {f' :
   (image_image₂_distrib_right fun a b => (h_right_comm a b).symm).symm
 #align finset.image_image₂_right_comm Finset.image_image₂_right_comm
 
-/- warning: finset.image₂_distrib_subset_left -> Finset.image₂_distrib_subset_left is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align finset.image₂_distrib_subset_left Finset.image₂_distrib_subset_leftₓ'. -/
 /-- 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' : β' → γ' → ε}
@@ -793,9 +421,6 @@ theorem image₂_distrib_subset_left {γ : Type _} {u : Finset γ} {f : α → 
   coe_subset.1 <| by push_cast ; exact Set.image2_distrib_subset_left h_distrib
 #align finset.image₂_distrib_subset_left Finset.image₂_distrib_subset_left
 
-/- warning: finset.image₂_distrib_subset_right -> Finset.image₂_distrib_subset_right is a dubious translation:
-<too large>
-Case conversion may be inaccurate. Consider using '#align finset.image₂_distrib_subset_right Finset.image₂_distrib_subset_rightₓ'. -/
 /-- 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' : α' → β' → ε}
@@ -804,24 +429,12 @@ theorem image₂_distrib_subset_right {γ : Type _} {u : Finset γ} {f : δ →
   coe_subset.1 <| by push_cast ; exact Set.image2_distrib_subset_right h_distrib
 #align finset.image₂_distrib_subset_right Finset.image₂_distrib_subset_right
 
-/- warning: finset.image_image₂_antidistrib -> Finset.image_image₂_antidistrib is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {β' : Type.{u4}} {γ : Type.{u5}} {δ : Type.{u6}} [_inst_1 : DecidableEq.{succ u2} α'] [_inst_2 : DecidableEq.{succ u4} β'] [_inst_3 : DecidableEq.{succ u5} γ] [_inst_5 : DecidableEq.{succ u6} δ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u3} β} {g : γ -> δ} {f' : β' -> α' -> δ} {g₁ : β -> β'} {g₂ : α -> α'}, (forall (a : α) (b : β), Eq.{succ u6} δ (g (f a b)) (f' (g₁ b) (g₂ a))) -> (Eq.{succ u6} (Finset.{u6} δ) (Finset.image.{u5, u6} γ δ (fun (a : δ) (b : δ) => _inst_5 a b) g (Finset.image₂.{u1, u3, u5} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (Finset.image₂.{u4, u2, u6} β' α' δ (fun (a : δ) (b : δ) => _inst_5 a b) f' (Finset.image.{u3, u4} β β' (fun (a : β') (b : β') => _inst_2 a b) g₁ t) (Finset.image.{u1, u2} α α' (fun (a : α') (b : α') => _inst_1 a b) g₂ s)))
-but is expected to have type
-  forall {α : Type.{u4}} {α' : Type.{u1}} {β : Type.{u3}} {β' : Type.{u2}} {γ : Type.{u5}} {δ : Type.{u6}} [_inst_1 : DecidableEq.{succ u1} α'] [_inst_2 : DecidableEq.{succ u2} β'] [_inst_3 : DecidableEq.{succ u5} γ] [_inst_5 : DecidableEq.{succ u6} δ] {f : α -> β -> γ} {s : Finset.{u4} α} {t : Finset.{u3} β} {g : γ -> δ} {f' : β' -> α' -> δ} {g₁ : β -> β'} {g₂ : α -> α'}, (forall (a : α) (b : β), Eq.{succ u6} δ (g (f a b)) (f' (g₁ b) (g₂ a))) -> (Eq.{succ u6} (Finset.{u6} δ) (Finset.image.{u5, u6} γ δ (fun (a : δ) (b : δ) => _inst_5 a b) g (Finset.image₂.{u4, u3, u5} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (Finset.image₂.{u2, u1, u6} β' α' δ (fun (a : δ) (b : δ) => _inst_5 a b) f' (Finset.image.{u3, u2} β β' (fun (a : β') (b : β') => _inst_2 a b) g₁ t) (Finset.image.{u4, u1} α α' (fun (a : α') (b : α') => _inst_1 a b) g₂ s)))
-Case conversion may be inaccurate. Consider using '#align finset.image_image₂_antidistrib Finset.image_image₂_antidistribₓ'. -/
 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₂) := by rw [image₂_swap f];
   exact image_image₂_distrib fun _ _ => h_antidistrib _ _
 #align finset.image_image₂_antidistrib Finset.image_image₂_antidistrib
 
-/- warning: finset.image_image₂_antidistrib_left -> Finset.image_image₂_antidistrib_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {β' : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} [_inst_2 : DecidableEq.{succ u3} β'] [_inst_3 : DecidableEq.{succ u4} γ] [_inst_5 : DecidableEq.{succ u5} δ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {g : γ -> δ} {f' : β' -> α -> δ} {g' : β -> β'}, (forall (a : α) (b : β), Eq.{succ u5} δ (g (f a b)) (f' (g' b) a)) -> (Eq.{succ u5} (Finset.{u5} δ) (Finset.image.{u4, u5} γ δ (fun (a : δ) (b : δ) => _inst_5 a b) g (Finset.image₂.{u1, u2, u4} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (Finset.image₂.{u3, u1, u5} β' α δ (fun (a : δ) (b : δ) => _inst_5 a b) f' (Finset.image.{u2, u3} β β' (fun (a : β') (b : β') => _inst_2 a b) g' t) s))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {β' : Type.{u1}} {γ : Type.{u4}} {δ : Type.{u5}} [_inst_2 : DecidableEq.{succ u1} β'] [_inst_3 : DecidableEq.{succ u4} γ] [_inst_5 : DecidableEq.{succ u5} δ] {f : α -> β -> γ} {s : Finset.{u3} α} {t : Finset.{u2} β} {g : γ -> δ} {f' : β' -> α -> δ} {g' : β -> β'}, (forall (a : α) (b : β), Eq.{succ u5} δ (g (f a b)) (f' (g' b) a)) -> (Eq.{succ u5} (Finset.{u5} δ) (Finset.image.{u4, u5} γ δ (fun (a : δ) (b : δ) => _inst_5 a b) g (Finset.image₂.{u3, u2, u4} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (Finset.image₂.{u1, u3, u5} β' α δ (fun (a : δ) (b : δ) => _inst_5 a b) f' (Finset.image.{u2, u1} β β' (fun (a : β') (b : β') => _inst_2 a b) g' t) s))
-Case conversion may be inaccurate. Consider using '#align finset.image_image₂_antidistrib_left Finset.image_image₂_antidistrib_leftₓ'. -/
 /-- 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) :
@@ -829,12 +442,6 @@ theorem image_image₂_antidistrib_left {g : γ → δ} {f' : β' → α → δ}
   coe_injective <| by push_cast ; exact image_image2_antidistrib_left h_antidistrib
 #align finset.image_image₂_antidistrib_left Finset.image_image₂_antidistrib_left
 
-/- warning: finset.image_image₂_antidistrib_right -> Finset.image_image₂_antidistrib_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} [_inst_1 : DecidableEq.{succ u2} α'] [_inst_3 : DecidableEq.{succ u4} γ] [_inst_5 : DecidableEq.{succ u5} δ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u3} β} {g : γ -> δ} {f' : β -> α' -> δ} {g' : α -> α'}, (forall (a : α) (b : β), Eq.{succ u5} δ (g (f a b)) (f' b (g' a))) -> (Eq.{succ u5} (Finset.{u5} δ) (Finset.image.{u4, u5} γ δ (fun (a : δ) (b : δ) => _inst_5 a b) g (Finset.image₂.{u1, u3, u4} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (Finset.image₂.{u3, u2, u5} β α' δ (fun (a : δ) (b : δ) => _inst_5 a b) f' t (Finset.image.{u1, u2} α α' (fun (a : α') (b : α') => _inst_1 a b) g' s)))
-but is expected to have type
-  forall {α : Type.{u3}} {α' : Type.{u1}} {β : Type.{u2}} {γ : Type.{u4}} {δ : Type.{u5}} [_inst_1 : DecidableEq.{succ u1} α'] [_inst_3 : DecidableEq.{succ u4} γ] [_inst_5 : DecidableEq.{succ u5} δ] {f : α -> β -> γ} {s : Finset.{u3} α} {t : Finset.{u2} β} {g : γ -> δ} {f' : β -> α' -> δ} {g' : α -> α'}, (forall (a : α) (b : β), Eq.{succ u5} δ (g (f a b)) (f' b (g' a))) -> (Eq.{succ u5} (Finset.{u5} δ) (Finset.image.{u4, u5} γ δ (fun (a : δ) (b : δ) => _inst_5 a b) g (Finset.image₂.{u3, u2, u4} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (Finset.image₂.{u2, u1, u5} β α' δ (fun (a : δ) (b : δ) => _inst_5 a b) f' t (Finset.image.{u3, u1} α α' (fun (a : α') (b : α') => _inst_1 a b) g' s)))
-Case conversion may be inaccurate. Consider using '#align finset.image_image₂_antidistrib_right Finset.image_image₂_antidistrib_rightₓ'. -/
 /-- 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)) :
@@ -842,12 +449,6 @@ theorem image_image₂_antidistrib_right {g : γ → δ} {f' : β → α' → δ
   coe_injective <| by push_cast ; exact image_image2_antidistrib_right h_antidistrib
 #align finset.image_image₂_antidistrib_right Finset.image_image₂_antidistrib_right
 
-/- warning: finset.image₂_image_left_anticomm -> Finset.image₂_image_left_anticomm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} [_inst_1 : DecidableEq.{succ u2} α'] [_inst_3 : DecidableEq.{succ u4} γ] [_inst_5 : DecidableEq.{succ u5} δ] {s : Finset.{u1} α} {t : Finset.{u3} β} {f : α' -> β -> γ} {g : α -> α'} {f' : β -> α -> δ} {g' : δ -> γ}, (forall (a : α) (b : β), Eq.{succ u4} γ (f (g a) b) (g' (f' b a))) -> (Eq.{succ u4} (Finset.{u4} γ) (Finset.image₂.{u2, u3, u4} α' β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Finset.image.{u1, u2} α α' (fun (a : α') (b : α') => _inst_1 a b) g s) t) (Finset.image.{u5, u4} δ γ (fun (a : γ) (b : γ) => _inst_3 a b) g' (Finset.image₂.{u3, u1, u5} β α δ (fun (a : δ) (b : δ) => _inst_5 a b) f' t s)))
-but is expected to have type
-  forall {α : Type.{u2}} {α' : Type.{u4}} {β : Type.{u3}} {γ : Type.{u5}} {δ : Type.{u1}} [_inst_1 : DecidableEq.{succ u4} α'] [_inst_3 : DecidableEq.{succ u5} γ] [_inst_5 : DecidableEq.{succ u1} δ] {s : Finset.{u2} α} {t : Finset.{u3} β} {f : α' -> β -> γ} {g : α -> α'} {f' : β -> α -> δ} {g' : δ -> γ}, (forall (a : α) (b : β), Eq.{succ u5} γ (f (g a) b) (g' (f' b a))) -> (Eq.{succ u5} (Finset.{u5} γ) (Finset.image₂.{u4, u3, u5} α' β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Finset.image.{u2, u4} α α' (fun (a : α') (b : α') => _inst_1 a b) g s) t) (Finset.image.{u1, u5} δ γ (fun (a : γ) (b : γ) => _inst_3 a b) g' (Finset.image₂.{u3, u2, u1} β α δ (fun (a : δ) (b : δ) => _inst_5 a b) f' t s)))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_image_left_anticomm Finset.image₂_image_left_anticommₓ'. -/
 /-- 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)) :
@@ -855,12 +456,6 @@ theorem image₂_image_left_anticomm {f : α' → β → γ} {g : α → α'} {f
   (image_image₂_antidistrib_left fun a b => (h_left_anticomm b a).symm).symm
 #align finset.image₂_image_left_anticomm Finset.image₂_image_left_anticomm
 
-/- warning: finset.image_image₂_right_anticomm -> Finset.image_image₂_right_anticomm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {β' : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} [_inst_2 : DecidableEq.{succ u3} β'] [_inst_3 : DecidableEq.{succ u4} γ] [_inst_5 : DecidableEq.{succ u5} δ] {s : Finset.{u1} α} {t : Finset.{u2} β} {f : α -> β' -> γ} {g : β -> β'} {f' : β -> α -> δ} {g' : δ -> γ}, (forall (a : α) (b : β), Eq.{succ u4} γ (f a (g b)) (g' (f' b a))) -> (Eq.{succ u4} (Finset.{u4} γ) (Finset.image₂.{u1, u3, u4} α β' γ (fun (a : γ) (b : γ) => _inst_3 a b) f s (Finset.image.{u2, u3} β β' (fun (a : β') (b : β') => _inst_2 a b) g t)) (Finset.image.{u5, u4} δ γ (fun (a : γ) (b : γ) => _inst_3 a b) g' (Finset.image₂.{u2, u1, u5} β α δ (fun (a : δ) (b : δ) => _inst_5 a b) f' t s)))
-but is expected to have type
-  forall {α : Type.{u4}} {β : Type.{u2}} {β' : Type.{u3}} {γ : Type.{u5}} {δ : Type.{u1}} [_inst_2 : DecidableEq.{succ u3} β'] [_inst_3 : DecidableEq.{succ u5} γ] [_inst_5 : DecidableEq.{succ u1} δ] {s : Finset.{u4} α} {t : Finset.{u2} β} {f : α -> β' -> γ} {g : β -> β'} {f' : β -> α -> δ} {g' : δ -> γ}, (forall (a : α) (b : β), Eq.{succ u5} γ (f a (g b)) (g' (f' b a))) -> (Eq.{succ u5} (Finset.{u5} γ) (Finset.image₂.{u4, u3, u5} α β' γ (fun (a : γ) (b : γ) => _inst_3 a b) f s (Finset.image.{u2, u3} β β' (fun (a : β') (b : β') => _inst_2 a b) g t)) (Finset.image.{u1, u5} δ γ (fun (a : γ) (b : γ) => _inst_3 a b) g' (Finset.image₂.{u2, u4, u1} β α δ (fun (a : δ) (b : δ) => _inst_5 a b) f' t s)))
-Case conversion may be inaccurate. Consider using '#align finset.image_image₂_right_anticomm Finset.image_image₂_right_anticommₓ'. -/
 /-- 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)) :
@@ -887,45 +482,21 @@ theorem image₂_right_identity {f : γ → β → γ} {b : β} (h : ∀ a, f a
 
 variable [DecidableEq α] [DecidableEq β]
 
-/- warning: finset.image₂_inter_union_subset_union -> Finset.image₂_inter_union_subset_union is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {s' : Finset.{u1} α} {t : Finset.{u2} β} {t' : Finset.{u2} β} [_inst_9 : DecidableEq.{succ u1} α] [_inst_10 : DecidableEq.{succ u2} β], HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Inter.inter.{u1} (Finset.{u1} α) (Finset.hasInter.{u1} α (fun (a : α) (b : α) => _inst_9 a b)) s s') (Union.union.{u2} (Finset.{u2} β) (Finset.hasUnion.{u2} β (fun (a : β) (b : β) => _inst_10 a b)) t t')) (Union.union.{u3} (Finset.{u3} γ) (Finset.hasUnion.{u3} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s' t'))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {s' : Finset.{u2} α} {t : Finset.{u1} β} {t' : Finset.{u1} β} [_inst_9 : DecidableEq.{succ u2} α] [_inst_10 : DecidableEq.{succ u1} β], HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.instHasSubsetFinset.{u3} γ) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Inter.inter.{u2} (Finset.{u2} α) (Finset.instInterFinset.{u2} α (fun (a : α) (b : α) => _inst_9 a b)) s s') (Union.union.{u1} (Finset.{u1} β) (Finset.instUnionFinset.{u1} β (fun (a : β) (b : β) => _inst_10 a b)) t t')) (Union.union.{u3} (Finset.{u3} γ) (Finset.instUnionFinset.{u3} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s' t'))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_inter_union_subset_union Finset.image₂_inter_union_subset_unionₓ'. -/
 theorem image₂_inter_union_subset_union :
     image₂ f (s ∩ s') (t ∪ t') ⊆ image₂ f s t ∪ image₂ f s' t' :=
   coe_subset.1 <| by push_cast ; exact Set.image2_inter_union_subset_union
 #align finset.image₂_inter_union_subset_union Finset.image₂_inter_union_subset_union
 
-/- warning: finset.image₂_union_inter_subset_union -> Finset.image₂_union_inter_subset_union is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {s' : Finset.{u1} α} {t : Finset.{u2} β} {t' : Finset.{u2} β} [_inst_9 : DecidableEq.{succ u1} α] [_inst_10 : DecidableEq.{succ u2} β], HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Union.union.{u1} (Finset.{u1} α) (Finset.hasUnion.{u1} α (fun (a : α) (b : α) => _inst_9 a b)) s s') (Inter.inter.{u2} (Finset.{u2} β) (Finset.hasInter.{u2} β (fun (a : β) (b : β) => _inst_10 a b)) t t')) (Union.union.{u3} (Finset.{u3} γ) (Finset.hasUnion.{u3} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s' t'))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {s' : Finset.{u2} α} {t : Finset.{u1} β} {t' : Finset.{u1} β} [_inst_9 : DecidableEq.{succ u2} α] [_inst_10 : DecidableEq.{succ u1} β], HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.instHasSubsetFinset.{u3} γ) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Union.union.{u2} (Finset.{u2} α) (Finset.instUnionFinset.{u2} α (fun (a : α) (b : α) => _inst_9 a b)) s s') (Inter.inter.{u1} (Finset.{u1} β) (Finset.instInterFinset.{u1} β (fun (a : β) (b : β) => _inst_10 a b)) t t')) (Union.union.{u3} (Finset.{u3} γ) (Finset.instUnionFinset.{u3} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s' t'))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_union_inter_subset_union Finset.image₂_union_inter_subset_unionₓ'. -/
 theorem image₂_union_inter_subset_union :
     image₂ f (s ∪ s') (t ∩ t') ⊆ image₂ f s t ∪ image₂ f s' t' :=
   coe_subset.1 <| by push_cast ; exact Set.image2_union_inter_subset_union
 #align finset.image₂_union_inter_subset_union Finset.image₂_union_inter_subset_union
 
-/- warning: finset.image₂_inter_union_subset -> Finset.image₂_inter_union_subset is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_9 : DecidableEq.{succ u1} α] [_inst_10 : DecidableEq.{succ u2} β] {f : α -> α -> β} {s : Finset.{u1} α} {t : Finset.{u1} α}, (forall (a : α) (b : α), Eq.{succ u2} β (f a b) (f b a)) -> (HasSubset.Subset.{u2} (Finset.{u2} β) (Finset.hasSubset.{u2} β) (Finset.image₂.{u1, u1, u2} α α β (fun (a : β) (b : β) => _inst_10 a b) f (Inter.inter.{u1} (Finset.{u1} α) (Finset.hasInter.{u1} α (fun (a : α) (b : α) => _inst_9 a b)) s t) (Union.union.{u1} (Finset.{u1} α) (Finset.hasUnion.{u1} α (fun (a : α) (b : α) => _inst_9 a b)) s t)) (Finset.image₂.{u1, u1, u2} α α β (fun (a : β) (b : β) => _inst_10 a b) f s t))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_9 : DecidableEq.{succ u2} α] [_inst_10 : DecidableEq.{succ u1} β] {f : α -> α -> β} {s : Finset.{u2} α} {t : Finset.{u2} α}, (forall (a : α) (b : α), Eq.{succ u1} β (f a b) (f b a)) -> (HasSubset.Subset.{u1} (Finset.{u1} β) (Finset.instHasSubsetFinset.{u1} β) (Finset.image₂.{u2, u2, u1} α α β (fun (a : β) (b : β) => _inst_10 a b) f (Inter.inter.{u2} (Finset.{u2} α) (Finset.instInterFinset.{u2} α (fun (a : α) (b : α) => _inst_9 a b)) s t) (Union.union.{u2} (Finset.{u2} α) (Finset.instUnionFinset.{u2} α (fun (a : α) (b : α) => _inst_9 a b)) s t)) (Finset.image₂.{u2, u2, u1} α α β (fun (a : β) (b : β) => _inst_10 a b) f s t))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_inter_union_subset Finset.image₂_inter_union_subsetₓ'. -/
 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 :=
   coe_subset.1 <| by push_cast ; exact image2_inter_union_subset hf
 #align finset.image₂_inter_union_subset Finset.image₂_inter_union_subset
 
-/- warning: finset.image₂_union_inter_subset -> Finset.image₂_union_inter_subset is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_9 : DecidableEq.{succ u1} α] [_inst_10 : DecidableEq.{succ u2} β] {f : α -> α -> β} {s : Finset.{u1} α} {t : Finset.{u1} α}, (forall (a : α) (b : α), Eq.{succ u2} β (f a b) (f b a)) -> (HasSubset.Subset.{u2} (Finset.{u2} β) (Finset.hasSubset.{u2} β) (Finset.image₂.{u1, u1, u2} α α β (fun (a : β) (b : β) => _inst_10 a b) f (Union.union.{u1} (Finset.{u1} α) (Finset.hasUnion.{u1} α (fun (a : α) (b : α) => _inst_9 a b)) s t) (Inter.inter.{u1} (Finset.{u1} α) (Finset.hasInter.{u1} α (fun (a : α) (b : α) => _inst_9 a b)) s t)) (Finset.image₂.{u1, u1, u2} α α β (fun (a : β) (b : β) => _inst_10 a b) f s t))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_9 : DecidableEq.{succ u2} α] [_inst_10 : DecidableEq.{succ u1} β] {f : α -> α -> β} {s : Finset.{u2} α} {t : Finset.{u2} α}, (forall (a : α) (b : α), Eq.{succ u1} β (f a b) (f b a)) -> (HasSubset.Subset.{u1} (Finset.{u1} β) (Finset.instHasSubsetFinset.{u1} β) (Finset.image₂.{u2, u2, u1} α α β (fun (a : β) (b : β) => _inst_10 a b) f (Union.union.{u2} (Finset.{u2} α) (Finset.instUnionFinset.{u2} α (fun (a : α) (b : α) => _inst_9 a b)) s t) (Inter.inter.{u2} (Finset.{u2} α) (Finset.instInterFinset.{u2} α (fun (a : α) (b : α) => _inst_9 a b)) s t)) (Finset.image₂.{u2, u2, u1} α α β (fun (a : β) (b : β) => _inst_10 a b) f s t))
-Case conversion may be inaccurate. Consider using '#align finset.image₂_union_inter_subset Finset.image₂_union_inter_subsetₓ'. -/
 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 :=
   coe_subset.1 <| by push_cast ; exact image2_union_inter_subset hf
@@ -937,24 +508,12 @@ namespace Set
 
 variable [DecidableEq γ] {s : Set α} {t : Set β}
 
-/- warning: set.to_finset_image2 -> Set.toFinset_image2 is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_1 : DecidableEq.{succ u3} γ] (f : α -> β -> γ) (s : Set.{u1} α) (t : Set.{u2} β) [_inst_2 : Fintype.{u1} (coeSort.{succ u1, succ (succ u1)} (Set.{u1} α) Type.{u1} (Set.hasCoeToSort.{u1} α) s)] [_inst_3 : Fintype.{u2} (coeSort.{succ u2, succ (succ u2)} (Set.{u2} β) Type.{u2} (Set.hasCoeToSort.{u2} β) t)] [_inst_4 : Fintype.{u3} (coeSort.{succ u3, succ (succ u3)} (Set.{u3} γ) Type.{u3} (Set.hasCoeToSort.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t))], Eq.{succ u3} (Finset.{u3} γ) (Set.toFinset.{u3} γ (Set.image2.{u1, u2, u3} α β γ f s t) _inst_4) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_1 a b) f (Set.toFinset.{u1} α s _inst_2) (Set.toFinset.{u2} β t _inst_3))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} γ] (f : α -> β -> γ) (s : Set.{u3} α) (t : Set.{u2} β) [_inst_2 : Fintype.{u3} (Set.Elem.{u3} α s)] [_inst_3 : Fintype.{u2} (Set.Elem.{u2} β t)] [_inst_4 : Fintype.{u1} (Set.Elem.{u1} γ (Set.image2.{u3, u2, u1} α β γ f s t))], Eq.{succ u1} (Finset.{u1} γ) (Set.toFinset.{u1} γ (Set.image2.{u3, u2, u1} α β γ f s t) _inst_4) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_1 a b) f (Set.toFinset.{u3} α s _inst_2) (Set.toFinset.{u2} β t _inst_3))
-Case conversion may be inaccurate. Consider using '#align set.to_finset_image2 Set.toFinset_image2ₓ'. -/
 @[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 :=
   Finset.coe_injective <| by simp
 #align set.to_finset_image2 Set.toFinset_image2
 
-/- warning: set.finite.to_finset_image2 -> Set.Finite.toFinset_image2 is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_1 : DecidableEq.{succ u3} γ] {s : Set.{u1} α} {t : Set.{u2} β} (f : α -> β -> γ) (hs : Set.Finite.{u1} α s) (ht : Set.Finite.{u2} β t) (hf : optParam.{0} (Set.Finite.{u3} γ (Set.image2.{u1, u2, u3} α β γ f s t)) (Set.Finite.image2.{u1, u2, u3} α β γ s t f hs ht)), Eq.{succ u3} (Finset.{u3} γ) (Set.Finite.toFinset.{u3} γ (Set.image2.{u1, u2, u3} α β γ f s t) hf) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_1 a b) f (Set.Finite.toFinset.{u1} α s hs) (Set.Finite.toFinset.{u2} β t ht))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} γ] {s : Set.{u3} α} {t : Set.{u2} β} (f : α -> β -> γ) (hs : Set.Finite.{u3} α s) (ht : Set.Finite.{u2} β t) (hf : optParam.{0} (Set.Finite.{u1} γ (Set.image2.{u3, u2, u1} α β γ f s t)) (Set.Finite.image2.{u3, u2, u1} α β γ s t f hs ht)), Eq.{succ u1} (Finset.{u1} γ) (Set.Finite.toFinset.{u1} γ (Set.image2.{u3, u2, u1} α β γ f s t) hf) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_1 a b) f (Set.Finite.toFinset.{u3} α s hs) (Set.Finite.toFinset.{u2} β t ht))
-Case conversion may be inaccurate. Consider using '#align set.finite.to_finset_image2 Set.Finite.toFinset_image2ₓ'. -/
 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 :=
   Finset.coe_injective <| by simp
Diff
@@ -91,10 +91,8 @@ but is expected to have type
 Case conversion may be inaccurate. Consider using '#align finset.card_image₂_iff Finset.card_image₂_iffₓ'. -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 theorem card_image₂_iff :
-    (image₂ f s t).card = s.card * t.card ↔ (s ×ˢ t : Set (α × β)).InjOn fun x => f x.1 x.2 :=
-  by
-  rw [← card_product, ← coe_product]
-  exact card_image_iff
+    (image₂ f s t).card = s.card * t.card ↔ (s ×ˢ t : Set (α × β)).InjOn fun x => f x.1 x.2 := by
+  rw [← card_product, ← coe_product]; exact card_image_iff
 #align finset.card_image₂_iff Finset.card_image₂_iff
 
 /- warning: finset.card_image₂ -> Finset.card_image₂ is a dubious translation:
@@ -134,10 +132,8 @@ lean 3 declaration is
 but is expected to have type
   forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_3 : DecidableEq.{succ u1} γ] {f : α -> β -> γ} {s : Finset.{u3} α} {s' : Finset.{u3} α} {t : Finset.{u2} β} {t' : Finset.{u2} β}, (HasSubset.Subset.{u3} (Finset.{u3} α) (Finset.instHasSubsetFinset.{u3} α) s s') -> (HasSubset.Subset.{u2} (Finset.{u2} β) (Finset.instHasSubsetFinset.{u2} β) t t') -> (HasSubset.Subset.{u1} (Finset.{u1} γ) (Finset.instHasSubsetFinset.{u1} γ) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s' t'))
 Case conversion may be inaccurate. Consider using '#align finset.image₂_subset Finset.image₂_subsetₓ'. -/
-theorem image₂_subset (hs : s ⊆ s') (ht : t ⊆ t') : image₂ f s t ⊆ image₂ f s' t' :=
-  by
-  rw [← coe_subset, coe_image₂, coe_image₂]
-  exact image2_subset hs ht
+theorem image₂_subset (hs : s ⊆ s') (ht : t ⊆ t') : image₂ f s t ⊆ image₂ f s' t' := by
+  rw [← coe_subset, coe_image₂, coe_image₂]; exact image2_subset hs ht
 #align finset.image₂_subset Finset.image₂_subset
 
 /- warning: finset.image₂_subset_left -> Finset.image₂_subset_left is a dubious translation:
@@ -229,10 +225,8 @@ but is expected to have type
   forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {t : Finset.{u1} β}, Iff (Finset.Nonempty.{u3} γ (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (And (Finset.Nonempty.{u2} α s) (Finset.Nonempty.{u1} β t))
 Case conversion may be inaccurate. Consider using '#align finset.image₂_nonempty_iff Finset.image₂_nonempty_iffₓ'. -/
 @[simp]
-theorem image₂_nonempty_iff : (image₂ f s t).Nonempty ↔ s.Nonempty ∧ t.Nonempty :=
-  by
-  rw [← coe_nonempty, coe_image₂]
-  exact image2_nonempty_iff
+theorem image₂_nonempty_iff : (image₂ f s t).Nonempty ↔ s.Nonempty ∧ t.Nonempty := by
+  rw [← coe_nonempty, coe_image₂]; exact image2_nonempty_iff
 #align finset.image₂_nonempty_iff Finset.image₂_nonempty_iff
 
 /- warning: finset.nonempty.image₂ -> Finset.Nonempty.image₂ is a dubious translation:
@@ -346,9 +340,7 @@ but is expected to have type
   forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {s : Finset.{u3} α} {s' : Finset.{u3} α} {t : Finset.{u1} β} [_inst_9 : DecidableEq.{succ u3} α], Eq.{succ u2} (Finset.{u2} γ) (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Union.union.{u3} (Finset.{u3} α) (Finset.instUnionFinset.{u3} α (fun (a : α) (b : α) => _inst_9 a b)) s s') t) (Union.union.{u2} (Finset.{u2} γ) (Finset.instUnionFinset.{u2} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s' t))
 Case conversion may be inaccurate. Consider using '#align finset.image₂_union_left Finset.image₂_union_leftₓ'. -/
 theorem image₂_union_left [DecidableEq α] : image₂ f (s ∪ s') t = image₂ f s t ∪ image₂ f s' t :=
-  coe_injective <| by
-    push_cast
-    exact image2_union_left
+  coe_injective <| by push_cast ; exact image2_union_left
 #align finset.image₂_union_left Finset.image₂_union_left
 
 /- warning: finset.image₂_union_right -> Finset.image₂_union_right is a dubious translation:
@@ -358,9 +350,7 @@ but is expected to have type
   forall {α : Type.{u1}} {β : Type.{u3}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u3} β} {t' : Finset.{u3} β} [_inst_9 : DecidableEq.{succ u3} β], Eq.{succ u2} (Finset.{u2} γ) (Finset.image₂.{u1, u3, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s (Union.union.{u3} (Finset.{u3} β) (Finset.instUnionFinset.{u3} β (fun (a : β) (b : β) => _inst_9 a b)) t t')) (Union.union.{u2} (Finset.{u2} γ) (Finset.instUnionFinset.{u2} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u1, u3, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u1, u3, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t'))
 Case conversion may be inaccurate. Consider using '#align finset.image₂_union_right Finset.image₂_union_rightₓ'. -/
 theorem image₂_union_right [DecidableEq β] : image₂ f s (t ∪ t') = image₂ f s t ∪ image₂ f s t' :=
-  coe_injective <| by
-    push_cast
-    exact image2_union_right
+  coe_injective <| by push_cast ; exact image2_union_right
 #align finset.image₂_union_right Finset.image₂_union_right
 
 /- warning: finset.image₂_insert_left -> Finset.image₂_insert_left is a dubious translation:
@@ -372,9 +362,7 @@ Case conversion may be inaccurate. Consider using '#align finset.image₂_insert
 @[simp]
 theorem image₂_insert_left [DecidableEq α] :
     image₂ f (insert a s) t = (t.image fun b => f a b) ∪ image₂ f s t :=
-  coe_injective <| by
-    push_cast
-    exact image2_insert_left
+  coe_injective <| by push_cast ; exact image2_insert_left
 #align finset.image₂_insert_left Finset.image₂_insert_left
 
 /- warning: finset.image₂_insert_right -> Finset.image₂_insert_right is a dubious translation:
@@ -386,9 +374,7 @@ Case conversion may be inaccurate. Consider using '#align finset.image₂_insert
 @[simp]
 theorem image₂_insert_right [DecidableEq β] :
     image₂ f s (insert b t) = (s.image fun a => f a b) ∪ image₂ f s t :=
-  coe_injective <| by
-    push_cast
-    exact image2_insert_right
+  coe_injective <| by push_cast ; exact image2_insert_right
 #align finset.image₂_insert_right Finset.image₂_insert_right
 
 /- warning: finset.image₂_inter_left -> Finset.image₂_inter_left is a dubious translation:
@@ -399,9 +385,7 @@ but is expected to have type
 Case conversion may be inaccurate. Consider using '#align finset.image₂_inter_left Finset.image₂_inter_leftₓ'. -/
 theorem image₂_inter_left [DecidableEq α] (hf : Injective2 f) :
     image₂ f (s ∩ s') t = image₂ f s t ∩ image₂ f s' t :=
-  coe_injective <| by
-    push_cast
-    exact image2_inter_left hf
+  coe_injective <| by push_cast ; exact image2_inter_left hf
 #align finset.image₂_inter_left Finset.image₂_inter_left
 
 /- warning: finset.image₂_inter_right -> Finset.image₂_inter_right is a dubious translation:
@@ -412,9 +396,7 @@ but is expected to have type
 Case conversion may be inaccurate. Consider using '#align finset.image₂_inter_right Finset.image₂_inter_rightₓ'. -/
 theorem image₂_inter_right [DecidableEq β] (hf : Injective2 f) :
     image₂ f s (t ∩ t') = image₂ f s t ∩ image₂ f s t' :=
-  coe_injective <| by
-    push_cast
-    exact image2_inter_right hf
+  coe_injective <| by push_cast ; exact image2_inter_right hf
 #align finset.image₂_inter_right Finset.image₂_inter_right
 
 /- warning: finset.image₂_inter_subset_left -> Finset.image₂_inter_subset_left is a dubious translation:
@@ -425,9 +407,7 @@ but is expected to have type
 Case conversion may be inaccurate. Consider using '#align finset.image₂_inter_subset_left Finset.image₂_inter_subset_leftₓ'. -/
 theorem image₂_inter_subset_left [DecidableEq α] :
     image₂ f (s ∩ s') t ⊆ image₂ f s t ∩ image₂ f s' t :=
-  coe_subset.1 <| by
-    push_cast
-    exact image2_inter_subset_left
+  coe_subset.1 <| by push_cast ; exact image2_inter_subset_left
 #align finset.image₂_inter_subset_left Finset.image₂_inter_subset_left
 
 /- warning: finset.image₂_inter_subset_right -> Finset.image₂_inter_subset_right is a dubious translation:
@@ -438,9 +418,7 @@ but is expected to have type
 Case conversion may be inaccurate. Consider using '#align finset.image₂_inter_subset_right Finset.image₂_inter_subset_rightₓ'. -/
 theorem image₂_inter_subset_right [DecidableEq β] :
     image₂ f s (t ∩ t') ⊆ image₂ f s t ∩ image₂ f s t' :=
-  coe_subset.1 <| by
-    push_cast
-    exact image2_inter_subset_right
+  coe_subset.1 <| by push_cast ; exact image2_inter_subset_right
 #align finset.image₂_inter_subset_right Finset.image₂_inter_subset_right
 
 /- warning: finset.image₂_congr -> Finset.image₂_congr is a dubious translation:
@@ -450,9 +428,7 @@ but is expected to have type
   forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_3 : DecidableEq.{succ u1} γ] {f : α -> β -> γ} {f' : α -> β -> γ} {s : Finset.{u3} α} {t : Finset.{u2} β}, (forall (a : α), (Membership.mem.{u3, u3} α (Finset.{u3} α) (Finset.instMembershipFinset.{u3} α) a s) -> (forall (b : β), (Membership.mem.{u2, u2} β (Finset.{u2} β) (Finset.instMembershipFinset.{u2} β) b t) -> (Eq.{succ u1} γ (f a b) (f' a b)))) -> (Eq.{succ u1} (Finset.{u1} γ) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f' s t))
 Case conversion may be inaccurate. Consider using '#align finset.image₂_congr Finset.image₂_congrₓ'. -/
 theorem image₂_congr (h : ∀ a ∈ s, ∀ b ∈ t, f a b = f' a b) : image₂ f s t = image₂ f' s t :=
-  coe_injective <| by
-    push_cast
-    exact image2_congr h
+  coe_injective <| by push_cast ; exact image2_congr h
 #align finset.image₂_congr Finset.image₂_congr
 
 /- warning: finset.image₂_congr' -> Finset.image₂_congr' is a dubious translation:
@@ -570,16 +546,12 @@ but is expected to have type
   forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {t : Finset.{u1} β}, Eq.{succ u3} (Finset.{u3} γ) (Finset.biUnion.{u2, u3} α γ (fun (a : γ) (b : γ) => _inst_3 a b) s (fun (a : α) => Finset.image.{u1, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (f a) t)) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)
 Case conversion may be inaccurate. Consider using '#align finset.bUnion_image_left Finset.biUnion_image_leftₓ'. -/
 theorem biUnion_image_left : (s.biUnion fun a => t.image <| f a) = image₂ f s t :=
-  coe_injective <| by
-    push_cast
-    exact Set.iUnion_image_left _
+  coe_injective <| by push_cast ; exact Set.iUnion_image_left _
 #align finset.bUnion_image_left Finset.biUnion_image_left
 
 #print Finset.biUnion_image_right /-
 theorem biUnion_image_right : (t.biUnion fun b => s.image fun a => f a b) = image₂ f s t :=
-  coe_injective <| by
-    push_cast
-    exact Set.iUnion_image_right _
+  coe_injective <| by push_cast ; exact Set.iUnion_image_right _
 #align finset.bUnion_image_right Finset.biUnion_image_right
 -/
 
@@ -602,17 +574,13 @@ but is expected to have type
 Case conversion may be inaccurate. Consider using '#align finset.image_image₂ Finset.image_image₂ₓ'. -/
 theorem image_image₂ (f : α → β → γ) (g : γ → δ) :
     (image₂ f s t).image g = image₂ (fun a b => g (f a b)) s t :=
-  coe_injective <| by
-    push_cast
-    exact image_image2 _ _
+  coe_injective <| by push_cast ; exact image_image2 _ _
 #align finset.image_image₂ Finset.image_image₂
 
 #print Finset.image₂_image_left /-
 theorem image₂_image_left (f : γ → β → δ) (g : α → γ) :
     image₂ f (s.image g) t = image₂ (fun a b => f (g a) b) s t :=
-  coe_injective <| by
-    push_cast
-    exact image2_image_left _ _
+  coe_injective <| by push_cast ; exact image2_image_left _ _
 #align finset.image₂_image_left Finset.image₂_image_left
 -/
 
@@ -624,9 +592,7 @@ but is expected to have type
 Case conversion may be inaccurate. Consider using '#align finset.image₂_image_right Finset.image₂_image_rightₓ'. -/
 theorem image₂_image_right (f : α → γ → δ) (g : β → γ) :
     image₂ f s (t.image g) = image₂ (fun a b => f a (g b)) s t :=
-  coe_injective <| by
-    push_cast
-    exact image2_image_right _ _
+  coe_injective <| by push_cast ; exact image2_image_right _ _
 #align finset.image₂_image_right Finset.image₂_image_right
 
 /- warning: finset.image₂_mk_eq_product -> Finset.image₂_mk_eq_product is a dubious translation:
@@ -674,9 +640,7 @@ but is expected to have type
 Case conversion may be inaccurate. Consider using '#align finset.image₂_swap Finset.image₂_swapₓ'. -/
 theorem image₂_swap (f : α → β → γ) (s : Finset α) (t : Finset β) :
     image₂ f s t = image₂ (fun a b => f b a) t s :=
-  coe_injective <| by
-    push_cast
-    exact image2_swap _ _ _
+  coe_injective <| by push_cast ; exact image2_swap _ _ _
 #align finset.image₂_swap Finset.image₂_swap
 
 /- warning: finset.image₂_left -> Finset.image₂_left is a dubious translation:
@@ -687,17 +651,13 @@ but is expected to have type
 Case conversion may be inaccurate. Consider using '#align finset.image₂_left Finset.image₂_leftₓ'. -/
 @[simp]
 theorem image₂_left [DecidableEq α] (h : t.Nonempty) : image₂ (fun x y => x) s t = s :=
-  coe_injective <| by
-    push_cast
-    exact image2_left h
+  coe_injective <| by push_cast ; exact image2_left h
 #align finset.image₂_left Finset.image₂_left
 
 #print Finset.image₂_right /-
 @[simp]
 theorem image₂_right [DecidableEq β] (h : s.Nonempty) : image₂ (fun x y => y) s t = t :=
-  coe_injective <| by
-    push_cast
-    exact image2_right h
+  coe_injective <| by push_cast ; exact image2_right h
 #align finset.image₂_right Finset.image₂_right
 -/
 
@@ -710,9 +670,7 @@ Case conversion may be inaccurate. Consider using '#align finset.image₂_assoc
 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) :=
-  coe_injective <| by
-    push_cast
-    exact image2_assoc h_assoc
+  coe_injective <| by push_cast ; exact image2_assoc h_assoc
 #align finset.image₂_assoc Finset.image₂_assoc
 
 /- warning: finset.image₂_comm -> Finset.image₂_comm is a dubious translation:
@@ -734,9 +692,7 @@ Case conversion may be inaccurate. Consider using '#align finset.image₂_left_c
 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) :=
-  coe_injective <| by
-    push_cast
-    exact image2_left_comm h_left_comm
+  coe_injective <| by push_cast ; exact image2_left_comm h_left_comm
 #align finset.image₂_left_comm Finset.image₂_left_comm
 
 /- warning: finset.image₂_right_comm -> Finset.image₂_right_comm is a dubious translation:
@@ -748,9 +704,7 @@ Case conversion may be inaccurate. Consider using '#align finset.image₂_right_
 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 :=
-  coe_injective <| by
-    push_cast
-    exact image2_right_comm h_right_comm
+  coe_injective <| by push_cast ; exact image2_right_comm h_right_comm
 #align finset.image₂_right_comm Finset.image₂_right_comm
 
 /- warning: finset.image₂_image₂_image₂_comm -> Finset.image₂_image₂_image₂_comm is a dubious translation:
@@ -761,9 +715,7 @@ theorem image₂_image₂_image₂_comm {γ δ : Type _} {u : Finset γ} {v : Fi
     {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) :=
-  coe_injective <| by
-    push_cast
-    exact image2_image2_image2_comm h_comm
+  coe_injective <| by push_cast ; exact image2_image2_image2_comm h_comm
 #align finset.image₂_image₂_image₂_comm Finset.image₂_image₂_image₂_comm
 
 /- warning: finset.image_image₂_distrib -> Finset.image_image₂_distrib is a dubious translation:
@@ -775,9 +727,7 @@ Case conversion may be inaccurate. Consider using '#align finset.image_image₂_
 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₂) :=
-  coe_injective <| by
-    push_cast
-    exact image_image2_distrib h_distrib
+  coe_injective <| by push_cast ; exact image_image2_distrib h_distrib
 #align finset.image_image₂_distrib Finset.image_image₂_distrib
 
 /- warning: finset.image_image₂_distrib_left -> Finset.image_image₂_distrib_left is a dubious translation:
@@ -790,9 +740,7 @@ Case conversion may be inaccurate. Consider using '#align finset.image_image₂_
 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 :=
-  coe_injective <| by
-    push_cast
-    exact image_image2_distrib_left h_distrib
+  coe_injective <| by push_cast ; exact image_image2_distrib_left h_distrib
 #align finset.image_image₂_distrib_left Finset.image_image₂_distrib_left
 
 /- warning: finset.image_image₂_distrib_right -> Finset.image_image₂_distrib_right is a dubious translation:
@@ -805,9 +753,7 @@ Case conversion may be inaccurate. Consider using '#align finset.image_image₂_
 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') :=
-  coe_injective <| by
-    push_cast
-    exact image_image2_distrib_right h_distrib
+  coe_injective <| by push_cast ; exact image_image2_distrib_right h_distrib
 #align finset.image_image₂_distrib_right Finset.image_image₂_distrib_right
 
 /- warning: finset.image₂_image_left_comm -> Finset.image₂_image_left_comm is a dubious translation:
@@ -844,9 +790,7 @@ theorem image₂_distrib_subset_left {γ : Type _} {u : Finset γ} {f : α → 
     {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) :=
-  coe_subset.1 <| by
-    push_cast
-    exact Set.image2_distrib_subset_left h_distrib
+  coe_subset.1 <| by push_cast ; exact Set.image2_distrib_subset_left h_distrib
 #align finset.image₂_distrib_subset_left Finset.image₂_distrib_subset_left
 
 /- warning: finset.image₂_distrib_subset_right -> Finset.image₂_distrib_subset_right is a dubious translation:
@@ -857,9 +801,7 @@ theorem image₂_distrib_subset_right {γ : Type _} {u : Finset γ} {f : δ →
     {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) :=
-  coe_subset.1 <| by
-    push_cast
-    exact Set.image2_distrib_subset_right h_distrib
+  coe_subset.1 <| by push_cast ; exact Set.image2_distrib_subset_right h_distrib
 #align finset.image₂_distrib_subset_right Finset.image₂_distrib_subset_right
 
 /- warning: finset.image_image₂_antidistrib -> Finset.image_image₂_antidistrib is a dubious translation:
@@ -870,9 +812,7 @@ but is expected to have type
 Case conversion may be inaccurate. Consider using '#align finset.image_image₂_antidistrib Finset.image_image₂_antidistribₓ'. -/
 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₂) :=
-  by
-  rw [image₂_swap f]
+    (image₂ f s t).image g = image₂ f' (t.image g₁) (s.image g₂) := by rw [image₂_swap f];
   exact image_image₂_distrib fun _ _ => h_antidistrib _ _
 #align finset.image_image₂_antidistrib Finset.image_image₂_antidistrib
 
@@ -886,9 +826,7 @@ Case conversion may be inaccurate. Consider using '#align finset.image_image₂_
 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 :=
-  coe_injective <| by
-    push_cast
-    exact image_image2_antidistrib_left h_antidistrib
+  coe_injective <| by push_cast ; exact image_image2_antidistrib_left h_antidistrib
 #align finset.image_image₂_antidistrib_left Finset.image_image₂_antidistrib_left
 
 /- warning: finset.image_image₂_antidistrib_right -> Finset.image_image₂_antidistrib_right is a dubious translation:
@@ -901,9 +839,7 @@ Case conversion may be inaccurate. Consider using '#align finset.image_image₂_
 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') :=
-  coe_injective <| by
-    push_cast
-    exact image_image2_antidistrib_right h_antidistrib
+  coe_injective <| by push_cast ; exact image_image2_antidistrib_right h_antidistrib
 #align finset.image_image₂_antidistrib_right Finset.image_image₂_antidistrib_right
 
 /- warning: finset.image₂_image_left_anticomm -> Finset.image₂_image_left_anticomm is a dubious translation:
@@ -959,9 +895,7 @@ but is expected to have type
 Case conversion may be inaccurate. Consider using '#align finset.image₂_inter_union_subset_union Finset.image₂_inter_union_subset_unionₓ'. -/
 theorem image₂_inter_union_subset_union :
     image₂ f (s ∩ s') (t ∪ t') ⊆ image₂ f s t ∪ image₂ f s' t' :=
-  coe_subset.1 <| by
-    push_cast
-    exact Set.image2_inter_union_subset_union
+  coe_subset.1 <| by push_cast ; exact Set.image2_inter_union_subset_union
 #align finset.image₂_inter_union_subset_union Finset.image₂_inter_union_subset_union
 
 /- warning: finset.image₂_union_inter_subset_union -> Finset.image₂_union_inter_subset_union is a dubious translation:
@@ -972,9 +906,7 @@ but is expected to have type
 Case conversion may be inaccurate. Consider using '#align finset.image₂_union_inter_subset_union Finset.image₂_union_inter_subset_unionₓ'. -/
 theorem image₂_union_inter_subset_union :
     image₂ f (s ∪ s') (t ∩ t') ⊆ image₂ f s t ∪ image₂ f s' t' :=
-  coe_subset.1 <| by
-    push_cast
-    exact Set.image2_union_inter_subset_union
+  coe_subset.1 <| by push_cast ; exact Set.image2_union_inter_subset_union
 #align finset.image₂_union_inter_subset_union Finset.image₂_union_inter_subset_union
 
 /- warning: finset.image₂_inter_union_subset -> Finset.image₂_inter_union_subset is a dubious translation:
@@ -985,9 +917,7 @@ but is expected to have type
 Case conversion may be inaccurate. Consider using '#align finset.image₂_inter_union_subset Finset.image₂_inter_union_subsetₓ'. -/
 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 :=
-  coe_subset.1 <| by
-    push_cast
-    exact image2_inter_union_subset hf
+  coe_subset.1 <| by push_cast ; exact image2_inter_union_subset hf
 #align finset.image₂_inter_union_subset Finset.image₂_inter_union_subset
 
 /- warning: finset.image₂_union_inter_subset -> Finset.image₂_union_inter_subset is a dubious translation:
@@ -998,9 +928,7 @@ but is expected to have type
 Case conversion may be inaccurate. Consider using '#align finset.image₂_union_inter_subset Finset.image₂_union_inter_subsetₓ'. -/
 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 :=
-  coe_subset.1 <| by
-    push_cast
-    exact image2_union_inter_subset hf
+  coe_subset.1 <| by push_cast ; exact image2_union_inter_subset hf
 #align finset.image₂_union_inter_subset Finset.image₂_union_inter_subset
 
 end Finset
Diff
@@ -754,10 +754,7 @@ theorem image₂_right_comm {γ : Type _} {u : Finset γ} {f : δ → γ → ε}
 #align finset.image₂_right_comm Finset.image₂_right_comm
 
 /- warning: finset.image₂_image₂_image₂_comm -> Finset.image₂_image₂_image₂_comm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {ε : Type.{u3}} {ε' : Type.{u4}} {ζ : Type.{u5}} {ζ' : Type.{u6}} {ν : Type.{u7}} [_inst_7 : DecidableEq.{succ u3} ε] [_inst_8 : DecidableEq.{succ u4} ε'] {s : Finset.{u1} α} {t : Finset.{u2} β} {γ : Type.{u8}} {δ : Type.{u9}} {u : Finset.{u8} γ} {v : Finset.{u9} δ} [_inst_9 : DecidableEq.{succ u5} ζ] [_inst_10 : DecidableEq.{succ u6} ζ'] [_inst_11 : DecidableEq.{succ u7} ν] {f : ε -> ζ -> ν} {g : α -> β -> ε} {h : γ -> δ -> ζ} {f' : ε' -> ζ' -> ν} {g' : α -> γ -> ε'} {h' : β -> δ -> ζ'}, (forall (a : α) (b : β) (c : γ) (d : δ), Eq.{succ u7} ν (f (g a b) (h c d)) (f' (g' a c) (h' b d))) -> (Eq.{succ u7} (Finset.{u7} ν) (Finset.image₂.{u3, u5, u7} ε ζ ν (fun (a : ν) (b : ν) => _inst_11 a b) f (Finset.image₂.{u1, u2, u3} α β ε (fun (a : ε) (b : ε) => _inst_7 a b) g s t) (Finset.image₂.{u8, u9, u5} γ δ ζ (fun (a : ζ) (b : ζ) => _inst_9 a b) h u v)) (Finset.image₂.{u4, u6, u7} ε' ζ' ν (fun (a : ν) (b : ν) => _inst_11 a b) f' (Finset.image₂.{u1, u8, u4} α γ ε' (fun (a : ε') (b : ε') => _inst_8 a b) g' s u) (Finset.image₂.{u2, u9, u6} β δ ζ' (fun (a : ζ') (b : ζ') => _inst_10 a b) h' t v)))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {ε : Type.{u4}} {ε' : Type.{u1}} {ζ : Type.{u7}} {ζ' : Type.{u6}} {ν : Type.{u5}} [_inst_7 : DecidableEq.{succ u4} ε] [_inst_8 : DecidableEq.{succ u1} ε'] {s : Finset.{u3} α} {t : Finset.{u2} β} {γ : Type.{u9}} {δ : Type.{u8}} {u : Finset.{u9} γ} {v : Finset.{u8} δ} [_inst_9 : DecidableEq.{succ u7} ζ] [_inst_10 : DecidableEq.{succ u6} ζ'] [_inst_11 : DecidableEq.{succ u5} ν] {f : ε -> ζ -> ν} {g : α -> β -> ε} {h : γ -> δ -> ζ} {f' : ε' -> ζ' -> ν} {g' : α -> γ -> ε'} {h' : β -> δ -> ζ'}, (forall (a : α) (b : β) (c : γ) (d : δ), Eq.{succ u5} ν (f (g a b) (h c d)) (f' (g' a c) (h' b d))) -> (Eq.{succ u5} (Finset.{u5} ν) (Finset.image₂.{u4, u7, u5} ε ζ ν (fun (a : ν) (b : ν) => _inst_11 a b) f (Finset.image₂.{u3, u2, u4} α β ε (fun (a : ε) (b : ε) => _inst_7 a b) g s t) (Finset.image₂.{u9, u8, u7} γ δ ζ (fun (a : ζ) (b : ζ) => _inst_9 a b) h u v)) (Finset.image₂.{u1, u6, u5} ε' ζ' ν (fun (a : ν) (b : ν) => _inst_11 a b) f' (Finset.image₂.{u3, u9, u1} α γ ε' (fun (a : ε') (b : ε') => _inst_8 a b) g' s u) (Finset.image₂.{u2, u8, u6} β δ ζ' (fun (a : ζ') (b : ζ') => _inst_10 a b) h' t v)))
+<too large>
 Case conversion may be inaccurate. Consider using '#align finset.image₂_image₂_image₂_comm Finset.image₂_image₂_image₂_commₓ'. -/
 theorem image₂_image₂_image₂_comm {γ δ : Type _} {u : Finset γ} {v : Finset δ} [DecidableEq ζ]
     [DecidableEq ζ'] [DecidableEq ν] {f : ε → ζ → ν} {g : α → β → ε} {h : γ → δ → ζ}
@@ -840,10 +837,7 @@ theorem image_image₂_right_comm {f : α → β' → γ} {g : β → β'} {f' :
 #align finset.image_image₂_right_comm Finset.image_image₂_right_comm
 
 /- warning: finset.image₂_distrib_subset_left -> Finset.image₂_distrib_subset_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {β' : Type.{u3}} {γ' : Type.{u4}} {δ : Type.{u5}} {ε : Type.{u6}} [_inst_2 : DecidableEq.{succ u3} β'] [_inst_4 : DecidableEq.{succ u4} γ'] [_inst_5 : DecidableEq.{succ u5} δ] [_inst_7 : DecidableEq.{succ u6} ε] {s : Finset.{u1} α} {t : Finset.{u2} β} {γ : Type.{u7}} {u : Finset.{u7} γ} {f : α -> δ -> ε} {g : β -> γ -> δ} {f₁ : α -> β -> β'} {f₂ : α -> γ -> γ'} {g' : β' -> γ' -> ε}, (forall (a : α) (b : β) (c : γ), Eq.{succ u6} ε (f a (g b c)) (g' (f₁ a b) (f₂ a c))) -> (HasSubset.Subset.{u6} (Finset.{u6} ε) (Finset.hasSubset.{u6} ε) (Finset.image₂.{u1, u5, u6} α δ ε (fun (a : ε) (b : ε) => _inst_7 a b) f s (Finset.image₂.{u2, u7, u5} β γ δ (fun (a : δ) (b : δ) => _inst_5 a b) g t u)) (Finset.image₂.{u3, u4, u6} β' γ' ε (fun (a : ε) (b : ε) => _inst_7 a b) g' (Finset.image₂.{u1, u2, u3} α β β' (fun (a : β') (b : β') => _inst_2 a b) f₁ s t) (Finset.image₂.{u1, u7, u4} α γ γ' (fun (a : γ') (b : γ') => _inst_4 a b) f₂ s u)))
-but is expected to have type
-  forall {α : Type.{u5}} {β : Type.{u3}} {β' : Type.{u2}} {γ' : Type.{u1}} {δ : Type.{u4}} {ε : Type.{u6}} [_inst_2 : DecidableEq.{succ u2} β'] [_inst_4 : DecidableEq.{succ u1} γ'] [_inst_5 : DecidableEq.{succ u4} δ] [_inst_7 : DecidableEq.{succ u6} ε] {s : Finset.{u5} α} {t : Finset.{u3} β} {γ : Type.{u7}} {u : Finset.{u7} γ} {f : α -> δ -> ε} {g : β -> γ -> δ} {f₁ : α -> β -> β'} {f₂ : α -> γ -> γ'} {g' : β' -> γ' -> ε}, (forall (a : α) (b : β) (c : γ), Eq.{succ u6} ε (f a (g b c)) (g' (f₁ a b) (f₂ a c))) -> (HasSubset.Subset.{u6} (Finset.{u6} ε) (Finset.instHasSubsetFinset.{u6} ε) (Finset.image₂.{u5, u4, u6} α δ ε (fun (a : ε) (b : ε) => _inst_7 a b) f s (Finset.image₂.{u3, u7, u4} β γ δ (fun (a : δ) (b : δ) => _inst_5 a b) g t u)) (Finset.image₂.{u2, u1, u6} β' γ' ε (fun (a : ε) (b : ε) => _inst_7 a b) g' (Finset.image₂.{u5, u3, u2} α β β' (fun (a : β') (b : β') => _inst_2 a b) f₁ s t) (Finset.image₂.{u5, u7, u1} α γ γ' (fun (a : γ') (b : γ') => _inst_4 a b) f₂ s u)))
+<too large>
 Case conversion may be inaccurate. Consider using '#align finset.image₂_distrib_subset_left Finset.image₂_distrib_subset_leftₓ'. -/
 /-- 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 : β → γ → δ}
@@ -856,10 +850,7 @@ theorem image₂_distrib_subset_left {γ : Type _} {u : Finset γ} {f : α → 
 #align finset.image₂_distrib_subset_left Finset.image₂_distrib_subset_left
 
 /- warning: finset.image₂_distrib_subset_right -> Finset.image₂_distrib_subset_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {β' : Type.{u4}} {δ : Type.{u5}} {ε : Type.{u6}} [_inst_1 : DecidableEq.{succ u2} α'] [_inst_2 : DecidableEq.{succ u4} β'] [_inst_5 : DecidableEq.{succ u5} δ] [_inst_7 : DecidableEq.{succ u6} ε] {s : Finset.{u1} α} {t : Finset.{u3} β} {γ : Type.{u7}} {u : Finset.{u7} γ} {f : δ -> γ -> ε} {g : α -> β -> δ} {f₁ : α -> γ -> α'} {f₂ : β -> γ -> β'} {g' : α' -> β' -> ε}, (forall (a : α) (b : β) (c : γ), Eq.{succ u6} ε (f (g a b) c) (g' (f₁ a c) (f₂ b c))) -> (HasSubset.Subset.{u6} (Finset.{u6} ε) (Finset.hasSubset.{u6} ε) (Finset.image₂.{u5, u7, u6} δ γ ε (fun (a : ε) (b : ε) => _inst_7 a b) f (Finset.image₂.{u1, u3, u5} α β δ (fun (a : δ) (b : δ) => _inst_5 a b) g s t) u) (Finset.image₂.{u2, u4, u6} α' β' ε (fun (a : ε) (b : ε) => _inst_7 a b) g' (Finset.image₂.{u1, u7, u2} α γ α' (fun (a : α') (b : α') => _inst_1 a b) f₁ s u) (Finset.image₂.{u3, u7, u4} β γ β' (fun (a : β') (b : β') => _inst_2 a b) f₂ t u)))
-but is expected to have type
-  forall {α : Type.{u4}} {α' : Type.{u2}} {β : Type.{u3}} {β' : Type.{u1}} {δ : Type.{u5}} {ε : Type.{u6}} [_inst_1 : DecidableEq.{succ u2} α'] [_inst_2 : DecidableEq.{succ u1} β'] [_inst_5 : DecidableEq.{succ u5} δ] [_inst_7 : DecidableEq.{succ u6} ε] {s : Finset.{u4} α} {t : Finset.{u3} β} {γ : Type.{u7}} {u : Finset.{u7} γ} {f : δ -> γ -> ε} {g : α -> β -> δ} {f₁ : α -> γ -> α'} {f₂ : β -> γ -> β'} {g' : α' -> β' -> ε}, (forall (a : α) (b : β) (c : γ), Eq.{succ u6} ε (f (g a b) c) (g' (f₁ a c) (f₂ b c))) -> (HasSubset.Subset.{u6} (Finset.{u6} ε) (Finset.instHasSubsetFinset.{u6} ε) (Finset.image₂.{u5, u7, u6} δ γ ε (fun (a : ε) (b : ε) => _inst_7 a b) f (Finset.image₂.{u4, u3, u5} α β δ (fun (a : δ) (b : δ) => _inst_5 a b) g s t) u) (Finset.image₂.{u2, u1, u6} α' β' ε (fun (a : ε) (b : ε) => _inst_7 a b) g' (Finset.image₂.{u4, u7, u2} α γ α' (fun (a : α') (b : α') => _inst_1 a b) f₁ s u) (Finset.image₂.{u3, u7, u1} β γ β' (fun (a : β') (b : β') => _inst_2 a b) f₂ t u)))
+<too large>
 Case conversion may be inaccurate. Consider using '#align finset.image₂_distrib_subset_right Finset.image₂_distrib_subset_rightₓ'. -/
 /-- 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 : α → β → δ}
Diff
@@ -563,24 +563,24 @@ theorem card_le_card_image₂_right {t : Finset β} (ht : t.Nonempty)
 
 variable {s t}
 
-/- warning: finset.bUnion_image_left -> Finset.bunionᵢ_image_left is a dubious translation:
+/- warning: finset.bUnion_image_left -> Finset.biUnion_image_left is a dubious translation:
 lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β}, Eq.{succ u3} (Finset.{u3} γ) (Finset.bunionᵢ.{u1, u3} α γ (fun (a : γ) (b : γ) => _inst_3 a b) s (fun (a : α) => Finset.image.{u2, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (f a) t)) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)
+  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β}, Eq.{succ u3} (Finset.{u3} γ) (Finset.biUnion.{u1, u3} α γ (fun (a : γ) (b : γ) => _inst_3 a b) s (fun (a : α) => Finset.image.{u2, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (f a) t)) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)
 but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {t : Finset.{u1} β}, Eq.{succ u3} (Finset.{u3} γ) (Finset.bunionᵢ.{u2, u3} α γ (fun (a : γ) (b : γ) => _inst_3 a b) s (fun (a : α) => Finset.image.{u1, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (f a) t)) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)
-Case conversion may be inaccurate. Consider using '#align finset.bUnion_image_left Finset.bunionᵢ_image_leftₓ'. -/
-theorem bunionᵢ_image_left : (s.bunionᵢ fun a => t.image <| f a) = image₂ f s t :=
+  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {t : Finset.{u1} β}, Eq.{succ u3} (Finset.{u3} γ) (Finset.biUnion.{u2, u3} α γ (fun (a : γ) (b : γ) => _inst_3 a b) s (fun (a : α) => Finset.image.{u1, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (f a) t)) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)
+Case conversion may be inaccurate. Consider using '#align finset.bUnion_image_left Finset.biUnion_image_leftₓ'. -/
+theorem biUnion_image_left : (s.biUnion fun a => t.image <| f a) = image₂ f s t :=
   coe_injective <| by
     push_cast
-    exact Set.unionᵢ_image_left _
-#align finset.bUnion_image_left Finset.bunionᵢ_image_left
+    exact Set.iUnion_image_left _
+#align finset.bUnion_image_left Finset.biUnion_image_left
 
-#print Finset.bunionᵢ_image_right /-
-theorem bunionᵢ_image_right : (t.bunionᵢ fun b => s.image fun a => f a b) = image₂ f s t :=
+#print Finset.biUnion_image_right /-
+theorem biUnion_image_right : (t.biUnion fun b => s.image fun a => f a b) = image₂ f s t :=
   coe_injective <| by
     push_cast
-    exact Set.unionᵢ_image_right _
-#align finset.bUnion_image_right Finset.bunionᵢ_image_right
+    exact Set.iUnion_image_right _
+#align finset.bUnion_image_right Finset.biUnion_image_right
 -/
 
 /-!
Diff
@@ -174,7 +174,7 @@ theorem image_subset_image₂_left (hb : b ∈ t) : (s.image fun a => f a b) ⊆
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {a : α}, (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) a s) -> (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image.{u2, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (b : β) => f a b) t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
 but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {s : Finset.{u3} α} {t : Finset.{u1} β} {a : α}, (Membership.mem.{u3, u3} α (Finset.{u3} α) (Finset.instMembershipFinset.{u3} α) a s) -> (HasSubset.Subset.{u2} (Finset.{u2} γ) (Finset.instHasSubsetFinset.{u2} γ) (Finset.image.{u1, u2} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (f a) t) (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
+  forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {s : Finset.{u3} α} {t : Finset.{u1} β} {a : α}, (Membership.mem.{u3, u3} α (Finset.{u3} α) (Finset.instMembershipFinset.{u3} α) a s) -> (HasSubset.Subset.{u2} (Finset.{u2} γ) (Finset.instHasSubsetFinset.{u2} γ) (Finset.image.{u1, u2} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (b : β) => f a b) t) (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
 Case conversion may be inaccurate. Consider using '#align finset.image_subset_image₂_right Finset.image_subset_image₂_rightₓ'. -/
 theorem image_subset_image₂_right (ha : a ∈ s) : (t.image fun b => f a b) ⊆ image₂ f s t :=
   image_subset_iff.2 fun b => mem_image₂_of_mem ha
@@ -202,10 +202,22 @@ theorem image₂_subset_iff : image₂ f s t ⊆ u ↔ ∀ x ∈ s, ∀ y ∈ t,
   forall_image₂_iff
 #align finset.image₂_subset_iff Finset.image₂_subset_iff
 
+/- warning: finset.image₂_subset_iff_left -> Finset.image₂_subset_iff_left is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {u : Finset.{u3} γ}, Iff (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) u) (forall (a : α), (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) a s) -> (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image.{u2, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (b : β) => f a b) t) u))
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {t : Finset.{u1} β} {u : Finset.{u3} γ}, Iff (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.instHasSubsetFinset.{u3} γ) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) u) (forall (a : α), (Membership.mem.{u2, u2} α (Finset.{u2} α) (Finset.instMembershipFinset.{u2} α) a s) -> (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.instHasSubsetFinset.{u3} γ) (Finset.image.{u1, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (b : β) => f a b) t) u))
+Case conversion may be inaccurate. Consider using '#align finset.image₂_subset_iff_left Finset.image₂_subset_iff_leftₓ'. -/
 theorem image₂_subset_iff_left : image₂ f s t ⊆ u ↔ ∀ a ∈ s, (t.image fun b => f a b) ⊆ u := by
   simp_rw [image₂_subset_iff, image_subset_iff]
 #align finset.image₂_subset_iff_left Finset.image₂_subset_iff_left
 
+/- warning: finset.image₂_subset_iff_right -> Finset.image₂_subset_iff_right is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {u : Finset.{u3} γ}, Iff (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) u) (forall (b : β), (Membership.Mem.{u2, u2} β (Finset.{u2} β) (Finset.hasMem.{u2} β) b t) -> (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image.{u1, u3} α γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (a : α) => f a b) s) u))
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {t : Finset.{u1} β} {u : Finset.{u3} γ}, Iff (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.instHasSubsetFinset.{u3} γ) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) u) (forall (b : β), (Membership.mem.{u1, u1} β (Finset.{u1} β) (Finset.instMembershipFinset.{u1} β) b t) -> (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.instHasSubsetFinset.{u3} γ) (Finset.image.{u2, u3} α γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (a : α) => f a b) s) u))
+Case conversion may be inaccurate. Consider using '#align finset.image₂_subset_iff_right Finset.image₂_subset_iff_rightₓ'. -/
 theorem image₂_subset_iff_right : image₂ f s t ⊆ u ↔ ∀ b ∈ t, (s.image fun a => f a b) ⊆ u := by
   simp_rw [image₂_subset_iff, image_subset_iff, @forall₂_swap α]
 #align finset.image₂_subset_iff_right Finset.image₂_subset_iff_right
@@ -351,6 +363,12 @@ theorem image₂_union_right [DecidableEq β] : image₂ f s (t ∪ t') = image
     exact image2_union_right
 #align finset.image₂_union_right Finset.image₂_union_right
 
+/- warning: finset.image₂_insert_left -> Finset.image₂_insert_left is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {a : α} [_inst_9 : DecidableEq.{succ u1} α], Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Insert.insert.{u1, u1} α (Finset.{u1} α) (Finset.hasInsert.{u1} α (fun (a : α) (b : α) => _inst_9 a b)) a s) t) (Union.union.{u3} (Finset.{u3} γ) (Finset.hasUnion.{u3} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image.{u2, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (b : β) => f a b) t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
+but is expected to have type
+  forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {s : Finset.{u3} α} {t : Finset.{u1} β} {a : α} [_inst_9 : DecidableEq.{succ u3} α], Eq.{succ u2} (Finset.{u2} γ) (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Insert.insert.{u3, u3} α (Finset.{u3} α) (Finset.instInsertFinset.{u3} α (fun (a : α) (b : α) => _inst_9 a b)) a s) t) (Union.union.{u2} (Finset.{u2} γ) (Finset.instUnionFinset.{u2} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image.{u1, u2} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (b : β) => f a b) t) (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
+Case conversion may be inaccurate. Consider using '#align finset.image₂_insert_left Finset.image₂_insert_leftₓ'. -/
 @[simp]
 theorem image₂_insert_left [DecidableEq α] :
     image₂ f (insert a s) t = (t.image fun b => f a b) ∪ image₂ f s t :=
@@ -359,6 +377,12 @@ theorem image₂_insert_left [DecidableEq α] :
     exact image2_insert_left
 #align finset.image₂_insert_left Finset.image₂_insert_left
 
+/- warning: finset.image₂_insert_right -> Finset.image₂_insert_right is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {b : β} [_inst_9 : DecidableEq.{succ u2} β], Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s (Insert.insert.{u2, u2} β (Finset.{u2} β) (Finset.hasInsert.{u2} β (fun (a : β) (b : β) => _inst_9 a b)) b t)) (Union.union.{u3} (Finset.{u3} γ) (Finset.hasUnion.{u3} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image.{u1, u3} α γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (a : α) => f a b) s) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
+but is expected to have type
+  forall {α : Type.{u1}} {β : Type.{u3}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u3} β} {b : β} [_inst_9 : DecidableEq.{succ u3} β], Eq.{succ u2} (Finset.{u2} γ) (Finset.image₂.{u1, u3, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s (Insert.insert.{u3, u3} β (Finset.{u3} β) (Finset.instInsertFinset.{u3} β (fun (a : β) (b : β) => _inst_9 a b)) b t)) (Union.union.{u2} (Finset.{u2} γ) (Finset.instUnionFinset.{u2} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image.{u1, u2} α γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (a : α) => f a b) s) (Finset.image₂.{u1, u3, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
+Case conversion may be inaccurate. Consider using '#align finset.image₂_insert_right Finset.image₂_insert_rightₓ'. -/
 @[simp]
 theorem image₂_insert_right [DecidableEq β] :
     image₂ f s (insert b t) = (s.image fun a => f a b) ∪ image₂ f s t :=
@@ -936,6 +960,12 @@ theorem image₂_right_identity {f : γ → β → γ} {b : β} (h : ∀ a, f a
 
 variable [DecidableEq α] [DecidableEq β]
 
+/- warning: finset.image₂_inter_union_subset_union -> Finset.image₂_inter_union_subset_union is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {s' : Finset.{u1} α} {t : Finset.{u2} β} {t' : Finset.{u2} β} [_inst_9 : DecidableEq.{succ u1} α] [_inst_10 : DecidableEq.{succ u2} β], HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Inter.inter.{u1} (Finset.{u1} α) (Finset.hasInter.{u1} α (fun (a : α) (b : α) => _inst_9 a b)) s s') (Union.union.{u2} (Finset.{u2} β) (Finset.hasUnion.{u2} β (fun (a : β) (b : β) => _inst_10 a b)) t t')) (Union.union.{u3} (Finset.{u3} γ) (Finset.hasUnion.{u3} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s' t'))
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {s' : Finset.{u2} α} {t : Finset.{u1} β} {t' : Finset.{u1} β} [_inst_9 : DecidableEq.{succ u2} α] [_inst_10 : DecidableEq.{succ u1} β], HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.instHasSubsetFinset.{u3} γ) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Inter.inter.{u2} (Finset.{u2} α) (Finset.instInterFinset.{u2} α (fun (a : α) (b : α) => _inst_9 a b)) s s') (Union.union.{u1} (Finset.{u1} β) (Finset.instUnionFinset.{u1} β (fun (a : β) (b : β) => _inst_10 a b)) t t')) (Union.union.{u3} (Finset.{u3} γ) (Finset.instUnionFinset.{u3} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s' t'))
+Case conversion may be inaccurate. Consider using '#align finset.image₂_inter_union_subset_union Finset.image₂_inter_union_subset_unionₓ'. -/
 theorem image₂_inter_union_subset_union :
     image₂ f (s ∩ s') (t ∪ t') ⊆ image₂ f s t ∪ image₂ f s' t' :=
   coe_subset.1 <| by
@@ -943,6 +973,12 @@ theorem image₂_inter_union_subset_union :
     exact Set.image2_inter_union_subset_union
 #align finset.image₂_inter_union_subset_union Finset.image₂_inter_union_subset_union
 
+/- warning: finset.image₂_union_inter_subset_union -> Finset.image₂_union_inter_subset_union is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {s' : Finset.{u1} α} {t : Finset.{u2} β} {t' : Finset.{u2} β} [_inst_9 : DecidableEq.{succ u1} α] [_inst_10 : DecidableEq.{succ u2} β], HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Union.union.{u1} (Finset.{u1} α) (Finset.hasUnion.{u1} α (fun (a : α) (b : α) => _inst_9 a b)) s s') (Inter.inter.{u2} (Finset.{u2} β) (Finset.hasInter.{u2} β (fun (a : β) (b : β) => _inst_10 a b)) t t')) (Union.union.{u3} (Finset.{u3} γ) (Finset.hasUnion.{u3} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s' t'))
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u2} α} {s' : Finset.{u2} α} {t : Finset.{u1} β} {t' : Finset.{u1} β} [_inst_9 : DecidableEq.{succ u2} α] [_inst_10 : DecidableEq.{succ u1} β], HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.instHasSubsetFinset.{u3} γ) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Union.union.{u2} (Finset.{u2} α) (Finset.instUnionFinset.{u2} α (fun (a : α) (b : α) => _inst_9 a b)) s s') (Inter.inter.{u1} (Finset.{u1} β) (Finset.instInterFinset.{u1} β (fun (a : β) (b : β) => _inst_10 a b)) t t')) (Union.union.{u3} (Finset.{u3} γ) (Finset.instUnionFinset.{u3} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u2, u1, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s' t'))
+Case conversion may be inaccurate. Consider using '#align finset.image₂_union_inter_subset_union Finset.image₂_union_inter_subset_unionₓ'. -/
 theorem image₂_union_inter_subset_union :
     image₂ f (s ∪ s') (t ∩ t') ⊆ image₂ f s t ∪ image₂ f s' t' :=
   coe_subset.1 <| by
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module data.finset.n_ary
-! leanprover-community/mathlib commit 517cc149e0b515d2893baa376226ed10feb319c7
+! leanprover-community/mathlib commit 5e526d18cea33550268dcbbddcb822d5cde40654
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -172,11 +172,11 @@ theorem image_subset_image₂_left (hb : b ∈ t) : (s.image fun a => f a b) ⊆
 
 /- warning: finset.image_subset_image₂_right -> Finset.image_subset_image₂_right is a dubious translation:
 lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {a : α}, (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) a s) -> (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image.{u2, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (f a) t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
+  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {a : α}, (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) a s) -> (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image.{u2, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (b : β) => f a b) t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
 but is expected to have type
   forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {s : Finset.{u3} α} {t : Finset.{u1} β} {a : α}, (Membership.mem.{u3, u3} α (Finset.{u3} α) (Finset.instMembershipFinset.{u3} α) a s) -> (HasSubset.Subset.{u2} (Finset.{u2} γ) (Finset.instHasSubsetFinset.{u2} γ) (Finset.image.{u1, u2} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (f a) t) (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
 Case conversion may be inaccurate. Consider using '#align finset.image_subset_image₂_right Finset.image_subset_image₂_rightₓ'. -/
-theorem image_subset_image₂_right (ha : a ∈ s) : t.image (f a) ⊆ image₂ f s t :=
+theorem image_subset_image₂_right (ha : a ∈ s) : (t.image fun b => f a b) ⊆ image₂ f s t :=
   image_subset_iff.2 fun b => mem_image₂_of_mem ha
 #align finset.image_subset_image₂_right Finset.image_subset_image₂_right
 
@@ -202,6 +202,14 @@ theorem image₂_subset_iff : image₂ f s t ⊆ u ↔ ∀ x ∈ s, ∀ y ∈ t,
   forall_image₂_iff
 #align finset.image₂_subset_iff Finset.image₂_subset_iff
 
+theorem image₂_subset_iff_left : image₂ f s t ⊆ u ↔ ∀ a ∈ s, (t.image fun b => f a b) ⊆ u := by
+  simp_rw [image₂_subset_iff, image_subset_iff]
+#align finset.image₂_subset_iff_left Finset.image₂_subset_iff_left
+
+theorem image₂_subset_iff_right : image₂ f s t ⊆ u ↔ ∀ b ∈ t, (s.image fun a => f a b) ⊆ u := by
+  simp_rw [image₂_subset_iff, image_subset_iff, @forall₂_swap α]
+#align finset.image₂_subset_iff_right Finset.image₂_subset_iff_right
+
 /- warning: finset.image₂_nonempty_iff -> Finset.image₂_nonempty_iff is a dubious translation:
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β}, Iff (Finset.Nonempty.{u3} γ (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (And (Finset.Nonempty.{u1} α s) (Finset.Nonempty.{u2} β t))
@@ -343,6 +351,22 @@ theorem image₂_union_right [DecidableEq β] : image₂ f s (t ∪ t') = image
     exact image2_union_right
 #align finset.image₂_union_right Finset.image₂_union_right
 
+@[simp]
+theorem image₂_insert_left [DecidableEq α] :
+    image₂ f (insert a s) t = (t.image fun b => f a b) ∪ image₂ f s t :=
+  coe_injective <| by
+    push_cast
+    exact image2_insert_left
+#align finset.image₂_insert_left Finset.image₂_insert_left
+
+@[simp]
+theorem image₂_insert_right [DecidableEq β] :
+    image₂ f s (insert b t) = (s.image fun a => f a b) ∪ image₂ f s t :=
+  coe_injective <| by
+    push_cast
+    exact image2_insert_right
+#align finset.image₂_insert_right Finset.image₂_insert_right
+
 /- warning: finset.image₂_inter_left -> Finset.image₂_inter_left is a dubious translation:
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {s' : Finset.{u1} α} {t : Finset.{u2} β} [_inst_9 : DecidableEq.{succ u1} α], (Function.Injective2.{succ u1, succ u2, succ u3} α β γ f) -> (Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f (Inter.inter.{u1} (Finset.{u1} α) (Finset.hasInter.{u1} α (fun (a : α) (b : α) => _inst_9 a b)) s s') t) (Inter.inter.{u3} (Finset.{u3} γ) (Finset.hasInter.{u3} γ (fun (a : γ) (b : γ) => _inst_3 a b)) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s' t)))
@@ -581,19 +605,6 @@ theorem image₂_image_right (f : α → γ → δ) (g : β → γ) :
     exact image2_image_right _ _
 #align finset.image₂_image_right Finset.image₂_image_right
 
-/- warning: finset.image₂_swap -> Finset.image₂_swap is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] (f : α -> β -> γ) (s : Finset.{u1} α) (t : Finset.{u2} β), Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u2, u1, u3} β α γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (a : β) (b : α) => f b a) t s)
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_3 : DecidableEq.{succ u1} γ] (f : α -> β -> γ) (s : Finset.{u3} α) (t : Finset.{u2} β), Eq.{succ u1} (Finset.{u1} γ) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u2, u3, u1} β α γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (a : β) (b : α) => f b a) t s)
-Case conversion may be inaccurate. Consider using '#align finset.image₂_swap Finset.image₂_swapₓ'. -/
-theorem image₂_swap (f : α → β → γ) (s : Finset α) (t : Finset β) :
-    image₂ f s t = image₂ (fun a b => f b a) t s :=
-  coe_injective <| by
-    push_cast
-    exact image2_swap _ _ _
-#align finset.image₂_swap Finset.image₂_swap
-
 /- warning: finset.image₂_mk_eq_product -> Finset.image₂_mk_eq_product is a dubious translation:
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} [_inst_9 : DecidableEq.{succ u1} α] [_inst_10 : DecidableEq.{succ u2} β] (s : Finset.{u1} α) (t : Finset.{u2} β), Eq.{succ (max u1 u2)} (Finset.{max u1 u2} (Prod.{u1, u2} α β)) (Finset.image₂.{u1, u2, max u1 u2} α β (Prod.{u1, u2} α β) (fun (a : Prod.{u1, u2} α β) (b : Prod.{u1, u2} α β) => Prod.decidableEq.{u1, u2} α β (fun (a : α) (b : α) => _inst_9 a b) (fun (a : β) (b : β) => _inst_10 a b) a b) (Prod.mk.{u1, u2} α β) s t) (Finset.product.{u1, u2} α β s t)
@@ -631,6 +642,19 @@ theorem image_uncurry_product (f : α → β → γ) (s : Finset α) (t : Finset
     (s ×ˢ t).image (uncurry f) = image₂ f s t := by rw [← image₂_curry, curry_uncurry]
 #align finset.image_uncurry_product Finset.image_uncurry_product
 
+/- warning: finset.image₂_swap -> Finset.image₂_swap is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] (f : α -> β -> γ) (s : Finset.{u1} α) (t : Finset.{u2} β), Eq.{succ u3} (Finset.{u3} γ) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u2, u1, u3} β α γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (a : β) (b : α) => f b a) t s)
+but is expected to have type
+  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_3 : DecidableEq.{succ u1} γ] (f : α -> β -> γ) (s : Finset.{u3} α) (t : Finset.{u2} β), Eq.{succ u1} (Finset.{u1} γ) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t) (Finset.image₂.{u2, u3, u1} β α γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (a : β) (b : α) => f b a) t s)
+Case conversion may be inaccurate. Consider using '#align finset.image₂_swap Finset.image₂_swapₓ'. -/
+theorem image₂_swap (f : α → β → γ) (s : Finset α) (t : Finset β) :
+    image₂ f s t = image₂ (fun a b => f b a) t s :=
+  coe_injective <| by
+    push_cast
+    exact image2_swap _ _ _
+#align finset.image₂_swap Finset.image₂_swap
+
 /- warning: finset.image₂_left -> Finset.image₂_left is a dubious translation:
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {s : Finset.{u1} α} {t : Finset.{u2} β} [_inst_9 : DecidableEq.{succ u1} α], (Finset.Nonempty.{u2} β t) -> (Eq.{succ u1} (Finset.{u1} α) (Finset.image₂.{u1, u2, u1} α β α (fun (a : α) (b : α) => _inst_9 a b) (fun (x : α) (y : β) => x) s t) s)
@@ -912,6 +936,20 @@ theorem image₂_right_identity {f : γ → β → γ} {b : β} (h : ∀ a, f a
 
 variable [DecidableEq α] [DecidableEq β]
 
+theorem image₂_inter_union_subset_union :
+    image₂ f (s ∩ s') (t ∪ t') ⊆ image₂ f s t ∪ image₂ f s' t' :=
+  coe_subset.1 <| by
+    push_cast
+    exact Set.image2_inter_union_subset_union
+#align finset.image₂_inter_union_subset_union Finset.image₂_inter_union_subset_union
+
+theorem image₂_union_inter_subset_union :
+    image₂ f (s ∪ s') (t ∩ t') ⊆ image₂ f s t ∪ image₂ f s' t' :=
+  coe_subset.1 <| by
+    push_cast
+    exact Set.image2_union_inter_subset_union
+#align finset.image₂_union_inter_subset_union Finset.image₂_union_inter_subset_union
+
 /- warning: finset.image₂_inter_union_subset -> Finset.image₂_inter_union_subset is a dubious translation:
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} [_inst_9 : DecidableEq.{succ u1} α] [_inst_10 : DecidableEq.{succ u2} β] {f : α -> α -> β} {s : Finset.{u1} α} {t : Finset.{u1} α}, (forall (a : α) (b : α), Eq.{succ u2} β (f a b) (f b a)) -> (HasSubset.Subset.{u2} (Finset.{u2} β) (Finset.hasSubset.{u2} β) (Finset.image₂.{u1, u1, u2} α α β (fun (a : β) (b : β) => _inst_10 a b) f (Inter.inter.{u1} (Finset.{u1} α) (Finset.hasInter.{u1} α (fun (a : α) (b : α) => _inst_9 a b)) s t) (Union.union.{u1} (Finset.{u1} α) (Finset.hasUnion.{u1} α (fun (a : α) (b : α) => _inst_9 a b)) s t)) (Finset.image₂.{u1, u1, u2} α α β (fun (a : β) (b : β) => _inst_10 a b) f s t))
Diff
@@ -960,7 +960,7 @@ theorem toFinset_image2 (f : α → β → γ) (s : Set α) (t : Set β) [Fintyp
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_1 : DecidableEq.{succ u3} γ] {s : Set.{u1} α} {t : Set.{u2} β} (f : α -> β -> γ) (hs : Set.Finite.{u1} α s) (ht : Set.Finite.{u2} β t) (hf : optParam.{0} (Set.Finite.{u3} γ (Set.image2.{u1, u2, u3} α β γ f s t)) (Set.Finite.image2.{u1, u2, u3} α β γ s t f hs ht)), Eq.{succ u3} (Finset.{u3} γ) (Set.Finite.toFinset.{u3} γ (Set.image2.{u1, u2, u3} α β γ f s t) hf) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_1 a b) f (Set.Finite.toFinset.{u1} α s hs) (Set.Finite.toFinset.{u2} β t ht))
 but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} γ] {s : Set.{u3} α} {t : Set.{u2} β} (f : α -> β -> γ) (hs : Set.Finite.{u3} α s) (ht : Set.Finite.{u2} β t) (hf : optParam.{0} (Set.Finite.{u1} γ (Set.image2.{u3, u2, u1} α β γ f s t)) (Set.Finite.image2.{u3, u2, u1} α β γ f s t hs ht)), Eq.{succ u1} (Finset.{u1} γ) (Set.Finite.toFinset.{u1} γ (Set.image2.{u3, u2, u1} α β γ f s t) hf) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_1 a b) f (Set.Finite.toFinset.{u3} α s hs) (Set.Finite.toFinset.{u2} β t ht))
+  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} γ] {s : Set.{u3} α} {t : Set.{u2} β} (f : α -> β -> γ) (hs : Set.Finite.{u3} α s) (ht : Set.Finite.{u2} β t) (hf : optParam.{0} (Set.Finite.{u1} γ (Set.image2.{u3, u2, u1} α β γ f s t)) (Set.Finite.image2.{u3, u2, u1} α β γ s t f hs ht)), Eq.{succ u1} (Finset.{u1} γ) (Set.Finite.toFinset.{u1} γ (Set.image2.{u3, u2, u1} α β γ f s t) hf) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_1 a b) f (Set.Finite.toFinset.{u3} α s hs) (Set.Finite.toFinset.{u2} β t ht))
 Case conversion may be inaccurate. Consider using '#align set.finite.to_finset_image2 Set.Finite.toFinset_image2ₓ'. -/
 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 :=
Diff
@@ -958,7 +958,7 @@ theorem toFinset_image2 (f : α → β → γ) (s : Set α) (t : Set β) [Fintyp
 
 /- warning: set.finite.to_finset_image2 -> Set.Finite.toFinset_image2 is a dubious translation:
 lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_1 : DecidableEq.{succ u3} γ] {s : Set.{u1} α} {t : Set.{u2} β} (f : α -> β -> γ) (hs : Set.Finite.{u1} α s) (ht : Set.Finite.{u2} β t) (hf : optParam.{0} (Set.Finite.{u3} γ (Set.image2.{u1, u2, u3} α β γ f s t)) (Set.Finite.image2.{u1, u2, u3} α β γ f s t hs ht)), Eq.{succ u3} (Finset.{u3} γ) (Set.Finite.toFinset.{u3} γ (Set.image2.{u1, u2, u3} α β γ f s t) hf) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_1 a b) f (Set.Finite.toFinset.{u1} α s hs) (Set.Finite.toFinset.{u2} β t ht))
+  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_1 : DecidableEq.{succ u3} γ] {s : Set.{u1} α} {t : Set.{u2} β} (f : α -> β -> γ) (hs : Set.Finite.{u1} α s) (ht : Set.Finite.{u2} β t) (hf : optParam.{0} (Set.Finite.{u3} γ (Set.image2.{u1, u2, u3} α β γ f s t)) (Set.Finite.image2.{u1, u2, u3} α β γ s t f hs ht)), Eq.{succ u3} (Finset.{u3} γ) (Set.Finite.toFinset.{u3} γ (Set.image2.{u1, u2, u3} α β γ f s t) hf) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_1 a b) f (Set.Finite.toFinset.{u1} α s hs) (Set.Finite.toFinset.{u2} β t ht))
 but is expected to have type
   forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} γ] {s : Set.{u3} α} {t : Set.{u2} β} (f : α -> β -> γ) (hs : Set.Finite.{u3} α s) (ht : Set.Finite.{u2} β t) (hf : optParam.{0} (Set.Finite.{u1} γ (Set.image2.{u3, u2, u1} α β γ f s t)) (Set.Finite.image2.{u3, u2, u1} α β γ f s t hs ht)), Eq.{succ u1} (Finset.{u1} γ) (Set.Finite.toFinset.{u1} γ (Set.image2.{u3, u2, u1} α β γ f s t) hf) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_1 a b) f (Set.Finite.toFinset.{u3} α s hs) (Set.Finite.toFinset.{u2} β t ht))
 Case conversion may be inaccurate. Consider using '#align set.finite.to_finset_image2 Set.Finite.toFinset_image2ₓ'. -/
Diff
@@ -912,6 +912,12 @@ theorem image₂_right_identity {f : γ → β → γ} {b : β} (h : ∀ a, f a
 
 variable [DecidableEq α] [DecidableEq β]
 
+/- warning: finset.image₂_inter_union_subset -> Finset.image₂_inter_union_subset is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_9 : DecidableEq.{succ u1} α] [_inst_10 : DecidableEq.{succ u2} β] {f : α -> α -> β} {s : Finset.{u1} α} {t : Finset.{u1} α}, (forall (a : α) (b : α), Eq.{succ u2} β (f a b) (f b a)) -> (HasSubset.Subset.{u2} (Finset.{u2} β) (Finset.hasSubset.{u2} β) (Finset.image₂.{u1, u1, u2} α α β (fun (a : β) (b : β) => _inst_10 a b) f (Inter.inter.{u1} (Finset.{u1} α) (Finset.hasInter.{u1} α (fun (a : α) (b : α) => _inst_9 a b)) s t) (Union.union.{u1} (Finset.{u1} α) (Finset.hasUnion.{u1} α (fun (a : α) (b : α) => _inst_9 a b)) s t)) (Finset.image₂.{u1, u1, u2} α α β (fun (a : β) (b : β) => _inst_10 a b) f s t))
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_9 : DecidableEq.{succ u2} α] [_inst_10 : DecidableEq.{succ u1} β] {f : α -> α -> β} {s : Finset.{u2} α} {t : Finset.{u2} α}, (forall (a : α) (b : α), Eq.{succ u1} β (f a b) (f b a)) -> (HasSubset.Subset.{u1} (Finset.{u1} β) (Finset.instHasSubsetFinset.{u1} β) (Finset.image₂.{u2, u2, u1} α α β (fun (a : β) (b : β) => _inst_10 a b) f (Inter.inter.{u2} (Finset.{u2} α) (Finset.instInterFinset.{u2} α (fun (a : α) (b : α) => _inst_9 a b)) s t) (Union.union.{u2} (Finset.{u2} α) (Finset.instUnionFinset.{u2} α (fun (a : α) (b : α) => _inst_9 a b)) s t)) (Finset.image₂.{u2, u2, u1} α α β (fun (a : β) (b : β) => _inst_10 a b) f s t))
+Case conversion may be inaccurate. Consider using '#align finset.image₂_inter_union_subset Finset.image₂_inter_union_subsetₓ'. -/
 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 :=
   coe_subset.1 <| by
@@ -919,6 +925,12 @@ theorem image₂_inter_union_subset {f : α → α → β} {s t : Finset α} (hf
     exact image2_inter_union_subset hf
 #align finset.image₂_inter_union_subset Finset.image₂_inter_union_subset
 
+/- warning: finset.image₂_union_inter_subset -> Finset.image₂_union_inter_subset is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} [_inst_9 : DecidableEq.{succ u1} α] [_inst_10 : DecidableEq.{succ u2} β] {f : α -> α -> β} {s : Finset.{u1} α} {t : Finset.{u1} α}, (forall (a : α) (b : α), Eq.{succ u2} β (f a b) (f b a)) -> (HasSubset.Subset.{u2} (Finset.{u2} β) (Finset.hasSubset.{u2} β) (Finset.image₂.{u1, u1, u2} α α β (fun (a : β) (b : β) => _inst_10 a b) f (Union.union.{u1} (Finset.{u1} α) (Finset.hasUnion.{u1} α (fun (a : α) (b : α) => _inst_9 a b)) s t) (Inter.inter.{u1} (Finset.{u1} α) (Finset.hasInter.{u1} α (fun (a : α) (b : α) => _inst_9 a b)) s t)) (Finset.image₂.{u1, u1, u2} α α β (fun (a : β) (b : β) => _inst_10 a b) f s t))
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} [_inst_9 : DecidableEq.{succ u2} α] [_inst_10 : DecidableEq.{succ u1} β] {f : α -> α -> β} {s : Finset.{u2} α} {t : Finset.{u2} α}, (forall (a : α) (b : α), Eq.{succ u1} β (f a b) (f b a)) -> (HasSubset.Subset.{u1} (Finset.{u1} β) (Finset.instHasSubsetFinset.{u1} β) (Finset.image₂.{u2, u2, u1} α α β (fun (a : β) (b : β) => _inst_10 a b) f (Union.union.{u2} (Finset.{u2} α) (Finset.instUnionFinset.{u2} α (fun (a : α) (b : α) => _inst_9 a b)) s t) (Inter.inter.{u2} (Finset.{u2} α) (Finset.instInterFinset.{u2} α (fun (a : α) (b : α) => _inst_9 a b)) s t)) (Finset.image₂.{u2, u2, u1} α α β (fun (a : β) (b : β) => _inst_10 a b) f s t))
+Case conversion may be inaccurate. Consider using '#align finset.image₂_union_inter_subset Finset.image₂_union_inter_subsetₓ'. -/
 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 :=
   coe_subset.1 <| by
@@ -932,12 +944,24 @@ namespace Set
 
 variable [DecidableEq γ] {s : Set α} {t : Set β}
 
+/- warning: set.to_finset_image2 -> Set.toFinset_image2 is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_1 : DecidableEq.{succ u3} γ] (f : α -> β -> γ) (s : Set.{u1} α) (t : Set.{u2} β) [_inst_2 : Fintype.{u1} (coeSort.{succ u1, succ (succ u1)} (Set.{u1} α) Type.{u1} (Set.hasCoeToSort.{u1} α) s)] [_inst_3 : Fintype.{u2} (coeSort.{succ u2, succ (succ u2)} (Set.{u2} β) Type.{u2} (Set.hasCoeToSort.{u2} β) t)] [_inst_4 : Fintype.{u3} (coeSort.{succ u3, succ (succ u3)} (Set.{u3} γ) Type.{u3} (Set.hasCoeToSort.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t))], Eq.{succ u3} (Finset.{u3} γ) (Set.toFinset.{u3} γ (Set.image2.{u1, u2, u3} α β γ f s t) _inst_4) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_1 a b) f (Set.toFinset.{u1} α s _inst_2) (Set.toFinset.{u2} β t _inst_3))
+but is expected to have type
+  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} γ] (f : α -> β -> γ) (s : Set.{u3} α) (t : Set.{u2} β) [_inst_2 : Fintype.{u3} (Set.Elem.{u3} α s)] [_inst_3 : Fintype.{u2} (Set.Elem.{u2} β t)] [_inst_4 : Fintype.{u1} (Set.Elem.{u1} γ (Set.image2.{u3, u2, u1} α β γ f s t))], Eq.{succ u1} (Finset.{u1} γ) (Set.toFinset.{u1} γ (Set.image2.{u3, u2, u1} α β γ f s t) _inst_4) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_1 a b) f (Set.toFinset.{u3} α s _inst_2) (Set.toFinset.{u2} β t _inst_3))
+Case conversion may be inaccurate. Consider using '#align set.to_finset_image2 Set.toFinset_image2ₓ'. -/
 @[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 :=
   Finset.coe_injective <| by simp
 #align set.to_finset_image2 Set.toFinset_image2
 
+/- warning: set.finite.to_finset_image2 -> Set.Finite.toFinset_image2 is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_1 : DecidableEq.{succ u3} γ] {s : Set.{u1} α} {t : Set.{u2} β} (f : α -> β -> γ) (hs : Set.Finite.{u1} α s) (ht : Set.Finite.{u2} β t) (hf : optParam.{0} (Set.Finite.{u3} γ (Set.image2.{u1, u2, u3} α β γ f s t)) (Set.Finite.image2.{u1, u2, u3} α β γ f s t hs ht)), Eq.{succ u3} (Finset.{u3} γ) (Set.Finite.toFinset.{u3} γ (Set.image2.{u1, u2, u3} α β γ f s t) hf) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_1 a b) f (Set.Finite.toFinset.{u1} α s hs) (Set.Finite.toFinset.{u2} β t ht))
+but is expected to have type
+  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} [_inst_1 : DecidableEq.{succ u1} γ] {s : Set.{u3} α} {t : Set.{u2} β} (f : α -> β -> γ) (hs : Set.Finite.{u3} α s) (ht : Set.Finite.{u2} β t) (hf : optParam.{0} (Set.Finite.{u1} γ (Set.image2.{u3, u2, u1} α β γ f s t)) (Set.Finite.image2.{u3, u2, u1} α β γ f s t hs ht)), Eq.{succ u1} (Finset.{u1} γ) (Set.Finite.toFinset.{u1} γ (Set.image2.{u3, u2, u1} α β γ f s t) hf) (Finset.image₂.{u3, u2, u1} α β γ (fun (a : γ) (b : γ) => _inst_1 a b) f (Set.Finite.toFinset.{u3} α s hs) (Set.Finite.toFinset.{u2} β t ht))
+Case conversion may be inaccurate. Consider using '#align set.finite.to_finset_image2 Set.Finite.toFinset_image2ₓ'. -/
 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 :=
   Finset.coe_injective <| by simp
Diff
@@ -4,11 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module data.finset.n_ary
-! leanprover-community/mathlib commit 20715f4ac6819ef2453d9e5106ecd086a5dc2a5e
+! leanprover-community/mathlib commit 517cc149e0b515d2893baa376226ed10feb319c7
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathbin.Data.Finset.Prod
+import Mathbin.Data.Set.Finite
 
 /-!
 # N-ary images of finsets
@@ -31,12 +32,13 @@ and `set.image2` already fulfills this task.
 
 open Function Set
 
+variable {α α' β β' γ γ' δ δ' ε ε' ζ ζ' ν : Type _}
+
 namespace Finset
 
-variable {α α' β β' γ γ' δ δ' ε ε' ζ ζ' ν : Type _} [DecidableEq α'] [DecidableEq β']
-  [DecidableEq γ] [DecidableEq γ'] [DecidableEq δ] [DecidableEq δ'] [DecidableEq ε] [DecidableEq ε']
-  {f f' : α → β → γ} {g g' : α → β → γ → δ} {s s' : Finset α} {t t' : Finset β} {u u' : Finset γ}
-  {a a' : α} {b b' : β} {c : γ}
+variable [DecidableEq α'] [DecidableEq β'] [DecidableEq γ] [DecidableEq γ'] [DecidableEq δ]
+  [DecidableEq δ'] [DecidableEq ε] [DecidableEq ε'] {f f' : α → β → γ} {g g' : α → β → γ → δ}
+  {s s' : Finset α} {t t' : Finset β} {u u' : Finset γ} {a a' : α} {b b' : β} {c : γ}
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 #print Finset.image₂ /-
@@ -908,5 +910,38 @@ theorem image₂_right_identity {f : γ → β → γ} {b : β} (h : ∀ a, f a
 #align finset.image₂_right_identity Finset.image₂_right_identity
 -/
 
+variable [DecidableEq α] [DecidableEq β]
+
+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 :=
+  coe_subset.1 <| by
+    push_cast
+    exact image2_inter_union_subset hf
+#align finset.image₂_inter_union_subset Finset.image₂_inter_union_subset
+
+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 :=
+  coe_subset.1 <| by
+    push_cast
+    exact image2_union_inter_subset hf
+#align finset.image₂_union_inter_subset Finset.image₂_union_inter_subset
+
 end Finset
 
+namespace Set
+
+variable [DecidableEq γ] {s : Set α} {t : Set β}
+
+@[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 :=
+  Finset.coe_injective <| by simp
+#align set.to_finset_image2 Set.toFinset_image2
+
+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 :=
+  Finset.coe_injective <| by simp
+#align set.finite.to_finset_image2 Set.Finite.toFinset_image2
+
+end Set
+
Diff
@@ -162,7 +162,7 @@ theorem image₂_subset_right (hs : s ⊆ s') : image₂ f s t ⊆ image₂ f s'
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {b : β}, (Membership.Mem.{u2, u2} β (Finset.{u2} β) (Finset.hasMem.{u2} β) b t) -> (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image.{u1, u3} α γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (a : α) => f a b) s) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
 but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u3}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u3} β} {b : β}, (Membership.mem.{u3, u3} β (Finset.{u3} β) (Finset.instMembershipFinset.{u3} β) b t) -> (HasSubset.Subset.{u2} (Set.{u2} γ) (Set.instHasSubsetSet.{u2} γ) (Set.image.{u1, u2} α γ (fun (a : α) => f a b) (Finset.toSet.{u1} α s)) (Finset.toSet.{u2} γ (Finset.image₂.{u1, u3, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)))
+  forall {α : Type.{u1}} {β : Type.{u3}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u3} β} {b : β}, (Membership.mem.{u3, u3} β (Finset.{u3} β) (Finset.instMembershipFinset.{u3} β) b t) -> (HasSubset.Subset.{u2} (Finset.{u2} γ) (Finset.instHasSubsetFinset.{u2} γ) (Finset.image.{u1, u2} α γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (a : α) => f a b) s) (Finset.image₂.{u1, u3, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
 Case conversion may be inaccurate. Consider using '#align finset.image_subset_image₂_left Finset.image_subset_image₂_leftₓ'. -/
 theorem image_subset_image₂_left (hb : b ∈ t) : (s.image fun a => f a b) ⊆ image₂ f s t :=
   image_subset_iff.2 fun a ha => mem_image₂_of_mem ha hb
@@ -172,7 +172,7 @@ theorem image_subset_image₂_left (hb : b ∈ t) : (s.image fun a => f a b) ⊆
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {a : α}, (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) a s) -> (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image.{u2, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (f a) t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
 but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {s : Finset.{u3} α} {t : Finset.{u1} β} {a : α}, (Membership.mem.{u3, u3} α (Finset.{u3} α) (Finset.instMembershipFinset.{u3} α) a s) -> (HasSubset.Subset.{u2} (Set.{u2} γ) (Set.instHasSubsetSet.{u2} γ) (Set.image.{u1, u2} β γ (f a) (Finset.toSet.{u1} β t)) (Finset.toSet.{u2} γ (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)))
+  forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {s : Finset.{u3} α} {t : Finset.{u1} β} {a : α}, (Membership.mem.{u3, u3} α (Finset.{u3} α) (Finset.instMembershipFinset.{u3} α) a s) -> (HasSubset.Subset.{u2} (Finset.{u2} γ) (Finset.instHasSubsetFinset.{u2} γ) (Finset.image.{u1, u2} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (f a) t) (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
 Case conversion may be inaccurate. Consider using '#align finset.image_subset_image₂_right Finset.image_subset_image₂_rightₓ'. -/
 theorem image_subset_image₂_right (ha : a ∈ s) : t.image (f a) ⊆ image₂ f s t :=
   image_subset_iff.2 fun b => mem_image₂_of_mem ha
@@ -703,6 +703,12 @@ theorem image₂_right_comm {γ : Type _} {u : Finset γ} {f : δ → γ → ε}
     exact image2_right_comm h_right_comm
 #align finset.image₂_right_comm Finset.image₂_right_comm
 
+/- warning: finset.image₂_image₂_image₂_comm -> Finset.image₂_image₂_image₂_comm is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} {ε : Type.{u3}} {ε' : Type.{u4}} {ζ : Type.{u5}} {ζ' : Type.{u6}} {ν : Type.{u7}} [_inst_7 : DecidableEq.{succ u3} ε] [_inst_8 : DecidableEq.{succ u4} ε'] {s : Finset.{u1} α} {t : Finset.{u2} β} {γ : Type.{u8}} {δ : Type.{u9}} {u : Finset.{u8} γ} {v : Finset.{u9} δ} [_inst_9 : DecidableEq.{succ u5} ζ] [_inst_10 : DecidableEq.{succ u6} ζ'] [_inst_11 : DecidableEq.{succ u7} ν] {f : ε -> ζ -> ν} {g : α -> β -> ε} {h : γ -> δ -> ζ} {f' : ε' -> ζ' -> ν} {g' : α -> γ -> ε'} {h' : β -> δ -> ζ'}, (forall (a : α) (b : β) (c : γ) (d : δ), Eq.{succ u7} ν (f (g a b) (h c d)) (f' (g' a c) (h' b d))) -> (Eq.{succ u7} (Finset.{u7} ν) (Finset.image₂.{u3, u5, u7} ε ζ ν (fun (a : ν) (b : ν) => _inst_11 a b) f (Finset.image₂.{u1, u2, u3} α β ε (fun (a : ε) (b : ε) => _inst_7 a b) g s t) (Finset.image₂.{u8, u9, u5} γ δ ζ (fun (a : ζ) (b : ζ) => _inst_9 a b) h u v)) (Finset.image₂.{u4, u6, u7} ε' ζ' ν (fun (a : ν) (b : ν) => _inst_11 a b) f' (Finset.image₂.{u1, u8, u4} α γ ε' (fun (a : ε') (b : ε') => _inst_8 a b) g' s u) (Finset.image₂.{u2, u9, u6} β δ ζ' (fun (a : ζ') (b : ζ') => _inst_10 a b) h' t v)))
+but is expected to have type
+  forall {α : Type.{u3}} {β : Type.{u2}} {ε : Type.{u4}} {ε' : Type.{u1}} {ζ : Type.{u7}} {ζ' : Type.{u6}} {ν : Type.{u5}} [_inst_7 : DecidableEq.{succ u4} ε] [_inst_8 : DecidableEq.{succ u1} ε'] {s : Finset.{u3} α} {t : Finset.{u2} β} {γ : Type.{u9}} {δ : Type.{u8}} {u : Finset.{u9} γ} {v : Finset.{u8} δ} [_inst_9 : DecidableEq.{succ u7} ζ] [_inst_10 : DecidableEq.{succ u6} ζ'] [_inst_11 : DecidableEq.{succ u5} ν] {f : ε -> ζ -> ν} {g : α -> β -> ε} {h : γ -> δ -> ζ} {f' : ε' -> ζ' -> ν} {g' : α -> γ -> ε'} {h' : β -> δ -> ζ'}, (forall (a : α) (b : β) (c : γ) (d : δ), Eq.{succ u5} ν (f (g a b) (h c d)) (f' (g' a c) (h' b d))) -> (Eq.{succ u5} (Finset.{u5} ν) (Finset.image₂.{u4, u7, u5} ε ζ ν (fun (a : ν) (b : ν) => _inst_11 a b) f (Finset.image₂.{u3, u2, u4} α β ε (fun (a : ε) (b : ε) => _inst_7 a b) g s t) (Finset.image₂.{u9, u8, u7} γ δ ζ (fun (a : ζ) (b : ζ) => _inst_9 a b) h u v)) (Finset.image₂.{u1, u6, u5} ε' ζ' ν (fun (a : ν) (b : ν) => _inst_11 a b) f' (Finset.image₂.{u3, u9, u1} α γ ε' (fun (a : ε') (b : ε') => _inst_8 a b) g' s u) (Finset.image₂.{u2, u8, u6} β δ ζ' (fun (a : ζ') (b : ζ') => _inst_10 a b) h' t v)))
+Case conversion may be inaccurate. Consider using '#align finset.image₂_image₂_image₂_comm Finset.image₂_image₂_image₂_commₓ'. -/
 theorem image₂_image₂_image₂_comm {γ δ : Type _} {u : Finset γ} {v : Finset δ} [DecidableEq ζ]
     [DecidableEq ζ'] [DecidableEq ν] {f : ε → ζ → ν} {g : α → β → ε} {h : γ → δ → ζ}
     {f' : ε' → ζ' → ν} {g' : α → γ → ε'} {h' : β → δ → ζ'}
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module data.finset.n_ary
-! leanprover-community/mathlib commit cc70d9141824ea8982d1562ce009952f2c3ece30
+! leanprover-community/mathlib commit 20715f4ac6819ef2453d9e5106ecd086a5dc2a5e
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -33,8 +33,8 @@ open Function Set
 
 namespace Finset
 
-variable {α α' β β' γ γ' δ δ' ε ε' : Type _} [DecidableEq α'] [DecidableEq β'] [DecidableEq γ]
-  [DecidableEq γ'] [DecidableEq δ] [DecidableEq δ'] [DecidableEq ε] [DecidableEq ε']
+variable {α α' β β' γ γ' δ δ' ε ε' ζ ζ' ν : Type _} [DecidableEq α'] [DecidableEq β']
+  [DecidableEq γ] [DecidableEq γ'] [DecidableEq δ] [DecidableEq δ'] [DecidableEq ε] [DecidableEq ε']
   {f f' : α → β → γ} {g g' : α → β → γ → δ} {s s' : Finset α} {t t' : Finset β} {u u' : Finset γ}
   {a a' : α} {b b' : β} {c : γ}
 
@@ -160,22 +160,22 @@ theorem image₂_subset_right (hs : s ⊆ s') : image₂ f s t ⊆ image₂ f s'
 
 /- warning: finset.image_subset_image₂_left -> Finset.image_subset_image₂_left is a dubious translation:
 lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {b : β}, (Membership.Mem.{u2, u2} β (Finset.{u2} β) (Finset.hasMem.{u2} β) b t) -> (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) (Set.image.{u1, u3} α γ (fun (a : α) => f a b) ((fun (a : Type.{u1}) (b : Type.{u1}) [self : HasLiftT.{succ u1, succ u1} a b] => self.0) (Finset.{u1} α) (Set.{u1} α) (HasLiftT.mk.{succ u1, succ u1} (Finset.{u1} α) (Set.{u1} α) (CoeTCₓ.coe.{succ u1, succ u1} (Finset.{u1} α) (Set.{u1} α) (Finset.Set.hasCoeT.{u1} α))) s)) ((fun (a : Type.{u3}) (b : Type.{u3}) [self : HasLiftT.{succ u3, succ u3} a b] => self.0) (Finset.{u3} γ) (Set.{u3} γ) (HasLiftT.mk.{succ u3, succ u3} (Finset.{u3} γ) (Set.{u3} γ) (CoeTCₓ.coe.{succ u3, succ u3} (Finset.{u3} γ) (Set.{u3} γ) (Finset.Set.hasCoeT.{u3} γ))) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)))
+  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {b : β}, (Membership.Mem.{u2, u2} β (Finset.{u2} β) (Finset.hasMem.{u2} β) b t) -> (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image.{u1, u3} α γ (fun (a : γ) (b : γ) => _inst_3 a b) (fun (a : α) => f a b) s) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
 but is expected to have type
   forall {α : Type.{u1}} {β : Type.{u3}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u3} β} {b : β}, (Membership.mem.{u3, u3} β (Finset.{u3} β) (Finset.instMembershipFinset.{u3} β) b t) -> (HasSubset.Subset.{u2} (Set.{u2} γ) (Set.instHasSubsetSet.{u2} γ) (Set.image.{u1, u2} α γ (fun (a : α) => f a b) (Finset.toSet.{u1} α s)) (Finset.toSet.{u2} γ (Finset.image₂.{u1, u3, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)))
 Case conversion may be inaccurate. Consider using '#align finset.image_subset_image₂_left Finset.image_subset_image₂_leftₓ'. -/
-theorem image_subset_image₂_left (hb : b ∈ t) : (fun a => f a b) '' s ⊆ image₂ f s t :=
-  ball_image_of_ball fun a ha => mem_image₂_of_mem ha hb
+theorem image_subset_image₂_left (hb : b ∈ t) : (s.image fun a => f a b) ⊆ image₂ f s t :=
+  image_subset_iff.2 fun a ha => mem_image₂_of_mem ha hb
 #align finset.image_subset_image₂_left Finset.image_subset_image₂_left
 
 /- warning: finset.image_subset_image₂_right -> Finset.image_subset_image₂_right is a dubious translation:
 lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {a : α}, (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) a s) -> (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) (Set.image.{u2, u3} β γ (f a) ((fun (a : Type.{u2}) (b : Type.{u2}) [self : HasLiftT.{succ u2, succ u2} a b] => self.0) (Finset.{u2} β) (Set.{u2} β) (HasLiftT.mk.{succ u2, succ u2} (Finset.{u2} β) (Set.{u2} β) (CoeTCₓ.coe.{succ u2, succ u2} (Finset.{u2} β) (Set.{u2} β) (Finset.Set.hasCoeT.{u2} β))) t)) ((fun (a : Type.{u3}) (b : Type.{u3}) [self : HasLiftT.{succ u3, succ u3} a b] => self.0) (Finset.{u3} γ) (Set.{u3} γ) (HasLiftT.mk.{succ u3, succ u3} (Finset.{u3} γ) (Set.{u3} γ) (CoeTCₓ.coe.{succ u3, succ u3} (Finset.{u3} γ) (Set.{u3} γ) (Finset.Set.hasCoeT.{u3} γ))) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)))
+  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} [_inst_3 : DecidableEq.{succ u3} γ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u2} β} {a : α}, (Membership.Mem.{u1, u1} α (Finset.{u1} α) (Finset.hasMem.{u1} α) a s) -> (HasSubset.Subset.{u3} (Finset.{u3} γ) (Finset.hasSubset.{u3} γ) (Finset.image.{u2, u3} β γ (fun (a : γ) (b : γ) => _inst_3 a b) (f a) t) (Finset.image₂.{u1, u2, u3} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t))
 but is expected to have type
   forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} [_inst_3 : DecidableEq.{succ u2} γ] {f : α -> β -> γ} {s : Finset.{u3} α} {t : Finset.{u1} β} {a : α}, (Membership.mem.{u3, u3} α (Finset.{u3} α) (Finset.instMembershipFinset.{u3} α) a s) -> (HasSubset.Subset.{u2} (Set.{u2} γ) (Set.instHasSubsetSet.{u2} γ) (Set.image.{u1, u2} β γ (f a) (Finset.toSet.{u1} β t)) (Finset.toSet.{u2} γ (Finset.image₂.{u3, u1, u2} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)))
 Case conversion may be inaccurate. Consider using '#align finset.image_subset_image₂_right Finset.image_subset_image₂_rightₓ'. -/
-theorem image_subset_image₂_right (ha : a ∈ s) : f a '' t ⊆ image₂ f s t :=
-  ball_image_of_ball fun b => mem_image₂_of_mem ha
+theorem image_subset_image₂_right (ha : a ∈ s) : t.image (f a) ⊆ image₂ f s t :=
+  image_subset_iff.2 fun b => mem_image₂_of_mem ha
 #align finset.image_subset_image₂_right Finset.image_subset_image₂_right
 
 /- warning: finset.forall_image₂_iff -> Finset.forall_image₂_iff is a dubious translation:
@@ -703,6 +703,16 @@ theorem image₂_right_comm {γ : Type _} {u : Finset γ} {f : δ → γ → ε}
     exact image2_right_comm h_right_comm
 #align finset.image₂_right_comm Finset.image₂_right_comm
 
+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) :=
+  coe_injective <| by
+    push_cast
+    exact image2_image2_image2_comm h_comm
+#align finset.image₂_image₂_image₂_comm Finset.image₂_image₂_image₂_comm
+
 /- warning: finset.image_image₂_distrib -> Finset.image_image₂_distrib is a dubious translation:
 lean 3 declaration is
   forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {β' : Type.{u4}} {γ : Type.{u5}} {δ : Type.{u6}} [_inst_1 : DecidableEq.{succ u2} α'] [_inst_2 : DecidableEq.{succ u4} β'] [_inst_3 : DecidableEq.{succ u5} γ] [_inst_5 : DecidableEq.{succ u6} δ] {f : α -> β -> γ} {s : Finset.{u1} α} {t : Finset.{u3} β} {g : γ -> δ} {f' : α' -> β' -> δ} {g₁ : α -> α'} {g₂ : β -> β'}, (forall (a : α) (b : β), Eq.{succ u6} δ (g (f a b)) (f' (g₁ a) (g₂ b))) -> (Eq.{succ u6} (Finset.{u6} δ) (Finset.image.{u5, u6} γ δ (fun (a : δ) (b : δ) => _inst_5 a b) g (Finset.image₂.{u1, u3, u5} α β γ (fun (a : γ) (b : γ) => _inst_3 a b) f s t)) (Finset.image₂.{u2, u4, u6} α' β' δ (fun (a : δ) (b : δ) => _inst_5 a b) f' (Finset.image.{u1, u2} α α' (fun (a : α') (b : α') => _inst_1 a b) g₁ s) (Finset.image.{u3, u4} β β' (fun (a : β') (b : β') => _inst_2 a b) g₂ t)))
Diff
@@ -875,18 +875,22 @@ theorem image_image₂_right_anticomm {f : α → β' → γ} {g : β → β'} {
   (image_image₂_antidistrib_right fun a b => (h_right_anticomm b a).symm).symm
 #align finset.image_image₂_right_anticomm Finset.image_image₂_right_anticomm
 
+#print Finset.image₂_left_identity /-
 /-- 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 :=
   coe_injective <| by rw [coe_image₂, coe_singleton, Set.image2_left_identity h]
 #align finset.image₂_left_identity Finset.image₂_left_identity
+-/
 
+#print Finset.image₂_right_identity /-
 /-- 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 := by rw [image₂_singleton_right, funext h, image_id']
 #align finset.image₂_right_identity Finset.image₂_right_identity
+-/
 
 end Finset
 

Changes in mathlib4

mathlib3
mathlib4
chore(Data/List): Use Std lemmas (#11711)

Make use of Nat-specific lemmas from Std rather than the general ones provided by mathlib. Also reverse the dependency between Multiset.Nodup/Multiset.dedup and Multiset.sum since only the latter needs algebra. Also rename Algebra.BigOperators.Multiset.Abs to Algebra.BigOperators.Multiset.Order and move some lemmas from Algebra.BigOperators.Multiset.Basic to it.

The ultimate goal here is to carve out Data, Algebra and Order sublibraries.

Diff
@@ -509,7 +509,7 @@ theorem card_dvd_card_image₂_right (hf : ∀ a ∈ s, Injective (f a))
   rw [image₂_insert_left]
   by_cases h : Disjoint (image (f a) t) (image₂ f s t)
   · rw [card_union_of_disjoint h]
-    exact (card_image_of_injective _ <| hf _ <| mem_insert_self _ _).symm.dvd.add ih
+    exact Nat.dvd_add (card_image_of_injective _ <| hf _ <| mem_insert_self _ _).symm.dvd ih
   simp_rw [← biUnion_image_left, disjoint_biUnion_right, not_forall] at h
   obtain ⟨b, hb, h⟩ := h
   rwa [union_eq_right.2]
chore: bump aesop; update syntax (#10955)

Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -114,7 +114,7 @@ theorem image₂_subset_iff_right : image₂ f s t ⊆ u ↔ ∀ b ∈ t, (s.ima
   simp_rw [image₂_subset_iff, image_subset_iff, @forall₂_swap α]
 #align finset.image₂_subset_iff_right Finset.image₂_subset_iff_right
 
-@[simp, aesop safe apply (rule_sets [finsetNonempty])]
+@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
 theorem image₂_nonempty_iff : (image₂ f s t).Nonempty ↔ s.Nonempty ∧ t.Nonempty := by
   rw [← coe_nonempty, coe_image₂]
   exact image2_nonempty_iff
feat: Positivity extension for Finset.sum (#10538)

Also define a new aesop rule-set and an auxiliary metaprogram proveFinsetNonempty for dealing with Finset.Nonempty conditions.

From LeanAPAP

Co-authored-by: Alex J. Best <alex.j.best@gmail.com>

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Alex J Best <alex.j.best@gmail.com>

Diff
@@ -114,7 +114,7 @@ theorem image₂_subset_iff_right : image₂ f s t ⊆ u ↔ ∀ b ∈ t, (s.ima
   simp_rw [image₂_subset_iff, image_subset_iff, @forall₂_swap α]
 #align finset.image₂_subset_iff_right Finset.image₂_subset_iff_right
 
-@[simp]
+@[simp, aesop safe apply (rule_sets [finsetNonempty])]
 theorem image₂_nonempty_iff : (image₂ f s t).Nonempty ↔ s.Nonempty ∧ t.Nonempty := by
   rw [← coe_nonempty, coe_image₂]
   exact image2_nonempty_iff
feat: (s ∩ t).card = s.card + t.card - (s ∪ t).card (#10224)

once coerced to an AddGroupWithOne. Also unify Finset.card_disjoint_union and Finset.card_union_eq

From LeanAPAP

Diff
@@ -508,7 +508,7 @@ theorem card_dvd_card_image₂_right (hf : ∀ a ∈ s, Injective (f a))
     (hs.subset <| Set.image_subset _ <| coe_subset.2 <| subset_insert _ _)
   rw [image₂_insert_left]
   by_cases h : Disjoint (image (f a) t) (image₂ f s t)
-  · rw [card_union_eq h]
+  · rw [card_union_of_disjoint h]
     exact (card_image_of_injective _ <| hf _ <| mem_insert_self _ _).symm.dvd.add ih
   simp_rw [← biUnion_image_left, disjoint_biUnion_right, not_forall] at h
   obtain ⟨b, hb, h⟩ := h
feat(Finset/{NAry,Pointwise}): add lemmas about Finset.sup etc (#8950)
Diff
@@ -317,15 +317,12 @@ theorem image₂_mk_eq_product [DecidableEq α] [DecidableEq β] (s : Finset α)
 
 @[simp]
 theorem image₂_curry (f : α × β → γ) (s : Finset α) (t : Finset β) :
-    image₂ (curry f) s t = (s ×ˢ t).image f := by
-  classical
-  rw [← image₂_mk_eq_product, image_image₂]
-  dsimp (config := { unfoldPartialApp := true }) [curry]
+    image₂ (curry f) s t = (s ×ˢ t).image f := rfl
 #align finset.image₂_curry Finset.image₂_curry
 
 @[simp]
 theorem image_uncurry_product (f : α → β → γ) (s : Finset α) (t : Finset β) :
-    (s ×ˢ t).image (uncurry f) = image₂ f s t := by rw [← image₂_curry, curry_uncurry]
+    (s ×ˢ t).image (uncurry f) = image₂ f s t := rfl
 #align finset.image_uncurry_product Finset.image_uncurry_product
 
 theorem image₂_swap (f : α → β → γ) (s : Finset α) (t : Finset β) :
@@ -529,6 +526,8 @@ theorem card_dvd_card_image₂_left (hf : ∀ b ∈ t, Injective fun a => f a b)
     s.card ∣ (image₂ f s t).card := by rw [← image₂_swap]; exact card_dvd_card_image₂_right hf ht
 #align finset.card_dvd_card_image₂_left Finset.card_dvd_card_image₂_left
 
+/-- 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' := by
   rw [← Set.image_prod, subset_image_iff] at hu
@@ -540,6 +539,8 @@ theorem subset_image₂ {s : Set α} {t : Set β} (hu : ↑u ⊆ image2 f s t) :
   exact ⟨fun _ h ↦ (hu h).1, fun _ h ↦ (hu h).2, fun x hx ↦ mem_image₂_of_mem hx hx⟩
 #align finset.subset_image₂ Finset.subset_image₂
 
+section UnionInter
+
 variable [DecidableEq α] [DecidableEq β]
 
 theorem image₂_inter_union_subset_union :
@@ -570,6 +571,80 @@ theorem image₂_union_inter_subset {f : α → α → β} {s t : Finset α} (hf
     exact image2_union_inter_subset hf
 #align finset.image₂_union_inter_subset Finset.image₂_union_inter_subset
 
+end UnionInter
+
+section SemilatticeSup
+
+variable [SemilatticeSup δ]
+
+@[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 := by
+  rw [sup'_le_iff, forall_image₂_iff]
+
+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 ·) := by
+  simp only [image₂, sup'_image, sup'_product_left]; rfl
+
+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) := by
+  simp only [image₂, sup'_image, sup'_product_right]; rfl
+
+variable [OrderBot δ]
+
+@[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 := by
+  rw [Finset.sup_le_iff, forall_image₂_iff]
+
+variable (s t)
+
+lemma sup_image₂_left (g : γ → δ) : sup (image₂ f s t) g = sup s fun x ↦ sup t (g <| f x ·) := by
+  simp only [image₂, sup_image, sup_product_left]; rfl
+
+lemma sup_image₂_right (g : γ → δ) : sup (image₂ f s t) g = sup t fun y ↦ sup s (g <| f · y) := by
+  simp only [image₂, sup_image, sup_product_right]; rfl
+
+end SemilatticeSup
+
+section SemilatticeInf
+
+variable [SemilatticeInf δ]
+
+@[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) := by
+  rw [le_inf'_iff, forall_image₂_iff]
+
+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 ·) :=
+  sup'_image₂_left (δ := δᵒᵈ) g h
+
+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) :=
+  sup'_image₂_right (δ := δᵒᵈ) g h
+
+variable [OrderTop δ]
+
+@[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) :=
+  sup_image₂_le (δ := δᵒᵈ)
+
+variable (s t)
+
+lemma inf_image₂_left (g : γ → δ) : inf (image₂ f s t) g = inf s fun x ↦ inf t (g ∘ f x) :=
+  sup_image₂_left (δ := δᵒᵈ) ..
+
+lemma inf_image₂_right (g : γ → δ) : inf (image₂ f s t) g = inf t fun y ↦ inf s (g <| f · y) :=
+  sup_image₂_right (δ := δᵒᵈ) ..
+
+end SemilatticeInf
+
 end Finset
 
 open Finset
refactor(*): change definition of Set.image2 etc (#9275)
  • Redefine Set.image2 to use ∃ a ∈ s, ∃ b ∈ t, f a b = c instead of ∃ a b, a ∈ s ∧ b ∈ t ∧ f a b = c.
  • Redefine Set.seq as Set.image2. The new definition is equal to the old one but rw [Set.seq] gives a different result.
  • Redefine Filter.map₂ to use ∃ u ∈ f, ∃ v ∈ g, image2 m u v ⊆ s instead of ∃ u v, u ∈ f ∧ v ∈ g ∧ ...
  • Update lemmas like Set.mem_image2, Finset.mem_image₂, Set.mem_mul, Finset.mem_div etc

The two reasons to make the change are:

  • ∃ a ∈ s, ∃ b ∈ t, _ is a simp-normal form, and
  • it looks a bit nicer.
Diff
@@ -41,7 +41,7 @@ def image₂ (f : α → β → γ) (s : Finset α) (t : Finset β) : Finset γ
 #align finset.image₂ Finset.image₂
 
 @[simp]
-theorem mem_image₂ : c ∈ image₂ f s t ↔ ∃ a b, a ∈ s ∧ b ∈ t ∧ f a b = c := by
+theorem mem_image₂ : c ∈ image₂ f s t ↔ ∃ a ∈ s, ∃ b ∈ t, f a b = c := by
   simp [image₂, and_assoc]
 #align finset.mem_image₂ Finset.mem_image₂
 
@@ -68,7 +68,7 @@ theorem card_image₂ (hf : Injective2 f) (s : Finset α) (t : Finset β) :
 #align finset.card_image₂ Finset.card_image₂
 
 theorem mem_image₂_of_mem (ha : a ∈ s) (hb : b ∈ t) : f a b ∈ image₂ f s t :=
-  mem_image₂.2 ⟨a, b, ha, hb, rfl⟩
+  mem_image₂.2 ⟨a, ha, b, hb, rfl⟩
 #align finset.mem_image₂_of_mem Finset.mem_image₂_of_mem
 
 theorem mem_image₂_iff (hf : Injective2 f) : f a b ∈ image₂ f s t ↔ a ∈ s ∧ b ∈ t := by
feat: (a • s)⁻¹ = s⁻¹ • a⁻¹ (#9199)

and other simple pointwise lemmas for Set and Finset. Also add supporting Fintype.piFinset lemmas and fix the names of two lemmas.

From LeanAPAP and LeanCamCombi

Diff
@@ -572,6 +572,18 @@ theorem image₂_union_inter_subset {f : α → α → β} {s t : Finset α} (hf
 
 end Finset
 
+open Finset
+
+namespace Fintype
+variable {ι : Type*} {α β γ : ι → Type*} [DecidableEq ι] [Fintype ι] [∀ i, DecidableEq (γ i)]
+
+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) := by
+  ext; simp only [mem_piFinset, mem_image₂, Classical.skolem, forall_and, Function.funext_iff]
+
+end Fintype
+
 namespace Set
 
 variable [DecidableEq γ] {s : Set α} {t : Set β}
chore: Improve Finset lemma names (#8894)

Change a few lemma names that have historically bothered me.

  • Finset.card_le_of_subsetFinset.card_le_card
  • Multiset.card_le_of_leMultiset.card_le_card
  • Multiset.card_lt_of_ltMultiset.card_lt_card
  • Set.ncard_le_of_subsetSet.ncard_le_ncard
  • Finset.image_filterFinset.filter_image
  • CompleteLattice.finset_sup_compact_of_compactCompleteLattice.isCompactElement_finset_sup
Diff
@@ -255,14 +255,14 @@ theorem card_le_card_image₂_left {s : Finset α} (hs : s.Nonempty) (hf : ∀ a
     t.card ≤ (image₂ f s t).card := by
   obtain ⟨a, ha⟩ := hs
   rw [← card_image₂_singleton_left _ (hf a)]
-  exact card_le_of_subset (image₂_subset_right <| singleton_subset_iff.2 ha)
+  exact card_le_card (image₂_subset_right <| singleton_subset_iff.2 ha)
 #align finset.card_le_card_image₂_left Finset.card_le_card_image₂_left
 
 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 := by
   obtain ⟨b, hb⟩ := ht
   rw [← card_image₂_singleton_right _ (hf b)]
-  exact card_le_of_subset (image₂_subset_left <| singleton_subset_iff.2 hb)
+  exact card_le_card (image₂_subset_left <| singleton_subset_iff.2 hb)
 #align finset.card_le_card_image₂_right Finset.card_le_card_image₂_right
 
 variable {s t}
chore(Data/Finset): golf (#9058)

Golf the proof of Finset.subset_image₂ by reusing Finset.subset_image_iff.

Diff
@@ -231,24 +231,6 @@ theorem image₂_congr' (h : ∀ a b, f a b = f' a b) : image₂ f s t = image
   image₂_congr fun a _ b _ => h a b
 #align finset.image₂_congr' Finset.image₂_congr'
 
-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' := by
-  apply @Finset.induction_on' γ _ _ u
-  · use ∅; use ∅; simp only [coe_empty];
-    exact ⟨Set.empty_subset _, Set.empty_subset _, empty_subset _⟩
-  rintro a u ha _ _ ⟨s', t', hs, hs', h⟩
-  obtain ⟨x, y, hx, hy, ha⟩ := hu ha
-  haveI := Classical.decEq α
-  haveI := Classical.decEq β
-  refine' ⟨insert x s', insert y t', _⟩
-  simp_rw [coe_insert, Set.insert_subset_iff]
-  exact
-    ⟨⟨hx, hs⟩, ⟨hy, hs'⟩,
-      insert_subset_iff.2
-        ⟨mem_image₂.2 ⟨x, y, mem_insert_self _ _, mem_insert_self _ _, ha⟩,
-          h.trans <| image₂_subset (subset_insert _ _) <| subset_insert _ _⟩⟩
-#align finset.subset_image₂ Finset.subset_image₂
-
 variable (s t)
 
 theorem card_image₂_singleton_left (hf : Injective (f a)) : (image₂ f {a} t).card = t.card := by
@@ -547,6 +529,17 @@ theorem card_dvd_card_image₂_left (hf : ∀ b ∈ t, Injective fun a => f a b)
     s.card ∣ (image₂ f s t).card := by rw [← image₂_swap]; exact card_dvd_card_image₂_right hf ht
 #align finset.card_dvd_card_image₂_left Finset.card_dvd_card_image₂_left
 
+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' := by
+  rw [← Set.image_prod, subset_image_iff] at hu
+  rcases hu with ⟨u, hu, rfl⟩
+  classical
+  use u.image Prod.fst, u.image Prod.snd
+  simp only [coe_image, Set.image_subset_iff, image₂_image_left, image₂_image_right,
+    image_subset_iff]
+  exact ⟨fun _ h ↦ (hu h).1, fun _ h ↦ (hu h).2, fun x hx ↦ mem_image₂_of_mem hx hx⟩
+#align finset.subset_image₂ Finset.subset_image₂
+
 variable [DecidableEq α] [DecidableEq β]
 
 theorem image₂_inter_union_subset_union :
chore: bump to v4.3.0-rc2 (#8366)

PR contents

This is the supremum of

along with some minor fixes from failures on nightly-testing as Mathlib master is merged into it.

Note that some PRs for changes that are already compatible with the current toolchain and will be necessary have already been split out: #8380.

I am hopeful that in future we will be able to progressively merge adaptation PRs into a bump/v4.X.0 branch, so we never end up with a "big merge" like this. However one of these adaptation PRs (#8056) predates my new scheme for combined CI, and it wasn't possible to keep that PR viable in the meantime.

Lean PRs involved in this bump

In particular this includes adjustments for the Lean PRs

leanprover/lean4#2778

We can get rid of all the

local macro_rules | `($x ^ $y) => `(HPow.hPow $x $y) -- Porting note: See issue [lean4#2220](https://github.com/leanprover/lean4/pull/2220)

macros across Mathlib (and in any projects that want to write natural number powers of reals).

leanprover/lean4#2722

Changes the default behaviour of simp to (config := {decide := false}). This makes simp (and consequentially norm_num) less powerful, but also more consistent, and less likely to blow up in long failures. This requires a variety of changes: changing some previously by simp or norm_num to decide or rfl, or adding (config := {decide := true}).

leanprover/lean4#2783

This changed the behaviour of simp so that simp [f] will only unfold "fully applied" occurrences of f. The old behaviour can be recovered with simp (config := { unfoldPartialApp := true }). We may in future add a syntax for this, e.g. simp [!f]; please provide feedback! In the meantime, we have made the following changes:

  • switching to using explicit lemmas that have the intended level of application
  • (config := { unfoldPartialApp := true }) in some places, to recover the old behaviour
  • Using @[eqns] to manually adjust the equation lemmas for a particular definition, recovering the old behaviour just for that definition. See #8371, where we do this for Function.comp and Function.flip.

This change in Lean may require further changes down the line (e.g. adding the !f syntax, and/or upstreaming the special treatment for Function.comp and Function.flip, and/or removing this special treatment). Please keep an open and skeptical mind about these changes!

Co-authored-by: leanprover-community-mathlib4-bot <leanprover-community-mathlib4-bot@users.noreply.github.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com> Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Mauricio Collares <mauricio@collares.org>

Diff
@@ -336,7 +336,9 @@ theorem image₂_mk_eq_product [DecidableEq α] [DecidableEq β] (s : Finset α)
 @[simp]
 theorem image₂_curry (f : α × β → γ) (s : Finset α) (t : Finset β) :
     image₂ (curry f) s t = (s ×ˢ t).image f := by
-  classical rw [← image₂_mk_eq_product, image_image₂]; dsimp [curry]
+  classical
+  rw [← image₂_mk_eq_product, image_image₂]
+  dsimp (config := { unfoldPartialApp := true }) [curry]
 #align finset.image₂_curry Finset.image₂_curry
 
 @[simp]
chore: Make Set/Finset lemmas match lattice lemma names (#7378)

Rename union_eq_left_iff_subset to union_eq_left to match sup_eq_left. Similarly for the right and inter versions.

Diff
@@ -531,7 +531,7 @@ theorem card_dvd_card_image₂_right (hf : ∀ a ∈ s, Injective (f a))
     exact (card_image_of_injective _ <| hf _ <| mem_insert_self _ _).symm.dvd.add ih
   simp_rw [← biUnion_image_left, disjoint_biUnion_right, not_forall] at h
   obtain ⟨b, hb, h⟩ := h
-  rwa [union_eq_right_iff_subset.2]
+  rwa [union_eq_right.2]
   exact (hs.eq (Set.mem_image_of_mem _ <| mem_insert_self _ _)
       (Set.mem_image_of_mem _ <| mem_insert_of_mem hb) h).trans_subset
     (image_subset_image₂_right hb)
chore: banish Type _ and Sort _ (#6499)

We remove all possible occurences of Type _ and Sort _ in favor of Type* and Sort*.

This has nice performance benefits.

Diff
@@ -26,7 +26,7 @@ and `Set.image2` already fulfills this task.
 
 open Function Set
 
-variable {α α' β β' γ γ' δ δ' ε ε' ζ ζ' ν : Type _}
+variable {α α' β β' γ γ' δ δ' ε ε' ζ ζ' ν : Type*}
 
 namespace Finset
 
@@ -365,7 +365,7 @@ theorem image₂_right [DecidableEq β] (h : s.Nonempty) : image₂ (fun _ y =>
     exact image2_right h
 #align finset.image₂_right Finset.image₂_right
 
-theorem image₂_assoc {γ : Type _} {u : Finset γ} {f : δ → γ → ε} {g : α → β → δ} {f' : α → ε' → ε}
+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) :=
   coe_injective <| by
@@ -377,7 +377,7 @@ theorem image₂_comm {g : β → α → γ} (h_comm : ∀ a b, f a b = g b a) :
   (image₂_swap _ _ _).trans <| by simp_rw [h_comm]
 #align finset.image₂_comm Finset.image₂_comm
 
-theorem image₂_left_comm {γ : Type _} {u : Finset γ} {f : α → δ → ε} {g : β → γ → δ}
+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) :=
   coe_injective <| by
@@ -385,7 +385,7 @@ theorem image₂_left_comm {γ : Type _} {u : Finset γ} {f : α → δ → ε}
     exact image2_left_comm h_left_comm
 #align finset.image₂_left_comm Finset.image₂_left_comm
 
-theorem image₂_right_comm {γ : Type _} {u : Finset γ} {f : δ → γ → ε} {g : α → β → δ}
+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 :=
   coe_injective <| by
@@ -393,7 +393,7 @@ theorem image₂_right_comm {γ : Type _} {u : Finset γ} {f : δ → γ → ε}
     exact image2_right_comm h_right_comm
 #align finset.image₂_right_comm Finset.image₂_right_comm
 
-theorem image₂_image₂_image₂_comm {γ δ : Type _} {u : Finset γ} {v : Finset δ} [DecidableEq ζ]
+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)) :
@@ -444,7 +444,7 @@ theorem image_image₂_right_comm {f : α → β' → γ} {g : β → β'} {f' :
 #align finset.image_image₂_right_comm Finset.image_image₂_right_comm
 
 /-- 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 : β → γ → δ}
+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) :=
@@ -454,7 +454,7 @@ theorem image₂_distrib_subset_left {γ : Type _} {u : Finset γ} {f : α → 
 #align finset.image₂_distrib_subset_left Finset.image₂_distrib_subset_left
 
 /-- 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 : α → β → δ}
+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) :=
chore: script to replace headers with #align_import statements (#5979)

Open in Gitpod

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Scott Morrison <scott.morrison@gmail.com>

Diff
@@ -2,15 +2,12 @@
 Copyright (c) 2022 Yaël Dillies. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
-
-! This file was ported from Lean 3 source module data.finset.n_ary
-! leanprover-community/mathlib commit eba7871095e834365616b5e43c8c7bb0b37058d0
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Data.Finset.Prod
 import Mathlib.Data.Set.Finite
 
+#align_import data.finset.n_ary from "leanprover-community/mathlib"@"eba7871095e834365616b5e43c8c7bb0b37058d0"
+
 /-!
 # N-ary images of finsets
 
feat(Data.Set.Basic/Data.Finset.Basic): rename insert_subset (#5450)

Currently, (for both Set and Finset) insert_subset is an iff lemma stating that insert a s ⊆ t if and only if a ∈ t and s ⊆ t. For both types, this PR renames this lemma to insert_subset_iff, and adds an insert_subset lemma that gives the implication just in the reverse direction : namely theorem insert_subset (ha : a ∈ t) (hs : s ⊆ t) : insert a s ⊆ t .

This both aligns the naming with union_subset and union_subset_iff, and removes the need for the awkward insert_subset.mpr ⟨_,_⟩ idiom. It touches a lot of files (too many to list), but in a trivial way.

Diff
@@ -244,10 +244,10 @@ theorem subset_image₂ {s : Set α} {t : Set β} (hu : ↑u ⊆ image2 f s t) :
   haveI := Classical.decEq α
   haveI := Classical.decEq β
   refine' ⟨insert x s', insert y t', _⟩
-  simp_rw [coe_insert, Set.insert_subset]
+  simp_rw [coe_insert, Set.insert_subset_iff]
   exact
     ⟨⟨hx, hs⟩, ⟨hy, hs'⟩,
-      insert_subset.2
+      insert_subset_iff.2
         ⟨mem_image₂.2 ⟨x, y, mem_insert_self _ _, mem_insert_self _ _, ha⟩,
           h.trans <| image₂_subset (subset_insert _ _) <| subset_insert _ _⟩⟩
 #align finset.subset_image₂ Finset.subset_image₂
feat(data/finset/pointwise): |s| ∣ |s * t| (#5385)

Forward-port leanprover-community/mathlib#18663

Also add a missing lemma.

Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module data.finset.n_ary
-! leanprover-community/mathlib commit 5e526d18cea33550268dcbbddcb822d5cde40654
+! leanprover-community/mathlib commit eba7871095e834365616b5e43c8c7bb0b37058d0
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -518,6 +518,36 @@ theorem image₂_right_identity {f : γ → β → γ} {b : β} (h : ∀ a, f a
     image₂ f s {b} = s := by rw [image₂_singleton_right, funext h, image_id']
 #align finset.image₂_right_identity Finset.image₂_right_identity
 
+/-- 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 := by
+  classical
+  induction' s using Finset.induction with a s _ ih
+  · simp
+  specialize ih (forall_of_forall_insert hf)
+    (hs.subset <| Set.image_subset _ <| coe_subset.2 <| subset_insert _ _)
+  rw [image₂_insert_left]
+  by_cases h : Disjoint (image (f a) t) (image₂ f s t)
+  · rw [card_union_eq h]
+    exact (card_image_of_injective _ <| hf _ <| mem_insert_self _ _).symm.dvd.add ih
+  simp_rw [← biUnion_image_left, disjoint_biUnion_right, not_forall] at h
+  obtain ⟨b, hb, h⟩ := h
+  rwa [union_eq_right_iff_subset.2]
+  exact (hs.eq (Set.mem_image_of_mem _ <| mem_insert_self _ _)
+      (Set.mem_image_of_mem _ <| mem_insert_of_mem hb) h).trans_subset
+    (image_subset_image₂_right hb)
+#align finset.card_dvd_card_image₂_right Finset.card_dvd_card_image₂_right
+
+/-- 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 := by rw [← image₂_swap]; exact card_dvd_card_image₂_right hf ht
+#align finset.card_dvd_card_image₂_left Finset.card_dvd_card_image₂_left
+
 variable [DecidableEq α] [DecidableEq β]
 
 theorem image₂_inter_union_subset_union :
chore: formatting issues (#4947)

Co-authored-by: Scott Morrison <scott.morrison@anu.edu.au> Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>

Diff
@@ -235,7 +235,7 @@ theorem image₂_congr' (h : ∀ a b, f a b = f' a b) : image₂ f s t = image
 #align finset.image₂_congr' Finset.image₂_congr'
 
 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' := by
+    ∃ (s' : Finset α) (t' : Finset β), ↑s' ⊆ s ∧ ↑t' ⊆ t ∧ u ⊆ image₂ f s' t' := by
   apply @Finset.induction_on' γ _ _ u
   · use ∅; use ∅; simp only [coe_empty];
     exact ⟨Set.empty_subset _, Set.empty_subset _, empty_subset _⟩
refactor: use the typeclass SProd to implement overloaded notation · ×ˢ · (#4200)

Currently, the following notations are changed from · ×ˢ · because Lean 4 can't deal with ambiguous notations. | Definition | Notation | | :

Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com> Co-authored-by: Kyle Miller <kmill31415@gmail.com> Co-authored-by: Chris Hughes <chrishughes24@gmail.com>

Diff
@@ -40,7 +40,7 @@ variable [DecidableEq α'] [DecidableEq β'] [DecidableEq γ] [DecidableEq γ']
 /-- 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 γ :=
-  (s ×ᶠ t).image <| uncurry f
+  (s ×ˢ t).image <| uncurry f
 #align finset.image₂ Finset.image₂
 
 @[simp]
@@ -333,18 +333,18 @@ theorem image₂_image_right (f : α → γ → δ) (g : β → γ) :
 
 @[simp]
 theorem image₂_mk_eq_product [DecidableEq α] [DecidableEq β] (s : Finset α) (t : Finset β) :
-    image₂ Prod.mk s t = s ×ᶠ t := by ext; simp [Prod.ext_iff]
+    image₂ Prod.mk s t = s ×ˢ t := by ext; simp [Prod.ext_iff]
 #align finset.image₂_mk_eq_product Finset.image₂_mk_eq_product
 
 @[simp]
 theorem image₂_curry (f : α × β → γ) (s : Finset α) (t : Finset β) :
-    image₂ (curry f) s t = (s ×ᶠ t).image f := by
+    image₂ (curry f) s t = (s ×ˢ t).image f := by
   classical rw [← image₂_mk_eq_product, image_image₂]; dsimp [curry]
 #align finset.image₂_curry Finset.image₂_curry
 
 @[simp]
 theorem image_uncurry_product (f : α → β → γ) (s : Finset α) (t : Finset β) :
-    (s ×ᶠ t).image (uncurry f) = image₂ f s t := by rw [← image₂_curry, curry_uncurry]
+    (s ×ˢ t).image (uncurry f) = image₂ f s t := by rw [← image₂_curry, curry_uncurry]
 #align finset.image_uncurry_product Finset.image_uncurry_product
 
 theorem image₂_swap (f : α → β → γ) (s : Finset α) (t : Finset β) :
chore: Rename to sSup/iSup (#3938)

As discussed on Zulip

Renames

  • supₛsSup
  • infₛsInf
  • supᵢiSup
  • infᵢiInf
  • bsupₛbsSup
  • binfₛbsInf
  • bsupᵢbiSup
  • binfᵢbiInf
  • csupₛcsSup
  • cinfₛcsInf
  • csupᵢciSup
  • cinfᵢciInf
  • unionₛsUnion
  • interₛsInter
  • unionᵢiUnion
  • interᵢiInter
  • bunionₛbsUnion
  • binterₛbsInter
  • bunionᵢbiUnion
  • binterᵢbiInter

Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>

Diff
@@ -288,17 +288,17 @@ theorem card_le_card_image₂_right {t : Finset β} (ht : t.Nonempty)
 
 variable {s t}
 
-theorem bunionᵢ_image_left : (s.bunionᵢ fun a => t.image <| f a) = image₂ f s t :=
+theorem biUnion_image_left : (s.biUnion fun a => t.image <| f a) = image₂ f s t :=
   coe_injective <| by
     push_cast
-    exact Set.unionᵢ_image_left _
-#align finset.bUnion_image_left Finset.bunionᵢ_image_left
+    exact Set.iUnion_image_left _
+#align finset.bUnion_image_left Finset.biUnion_image_left
 
-theorem bunionᵢ_image_right : (t.bunionᵢ fun b => s.image fun a => f a b) = image₂ f s t :=
+theorem biUnion_image_right : (t.biUnion fun b => s.image fun a => f a b) = image₂ f s t :=
   coe_injective <| by
     push_cast
-    exact Set.unionᵢ_image_right _
-#align finset.bUnion_image_right Finset.bunionᵢ_image_right
+    exact Set.iUnion_image_right _
+#align finset.bUnion_image_right Finset.biUnion_image_right
 
 /-!
 ### Algebraic replacement rules
chore: bye-bye, solo bys! (#3825)

This PR puts, with one exception, every single remaining by that lies all by itself on its own line to the previous line, thus matching the current behaviour of start-port.sh. The exception is when the by begins the second or later argument to a tuple or anonymous constructor; see https://github.com/leanprover-community/mathlib4/pull/3825#discussion_r1186702599.

Essentially this is s/\n *by$/ by/g, but with manual editing to satisfy the linter's max-100-char-line requirement. The Python style linter is also modified to catch these "isolated bys".

Diff
@@ -60,8 +60,7 @@ theorem card_image₂_le (f : α → β → γ) (s : Finset α) (t : Finset β)
 #align finset.card_image₂_le Finset.card_image₂_le
 
 theorem card_image₂_iff :
-    (image₂ f s t).card = s.card * t.card ↔ (s ×ˢ t : Set (α × β)).InjOn fun x => f x.1 x.2 :=
-  by
+    (image₂ f s t).card = s.card * t.card ↔ (s ×ˢ t : Set (α × β)).InjOn fun x => f x.1 x.2 := by
   rw [← card_product, ← coe_product]
   exact card_image_iff
 #align finset.card_image₂_iff Finset.card_image₂_iff
@@ -79,8 +78,7 @@ theorem mem_image₂_iff (hf : Injective2 f) : f a b ∈ image₂ f s t ↔ a 
   rw [← mem_coe, coe_image₂, mem_image2_iff hf, mem_coe, mem_coe]
 #align finset.mem_image₂_iff Finset.mem_image₂_iff
 
-theorem image₂_subset (hs : s ⊆ s') (ht : t ⊆ t') : image₂ f s t ⊆ image₂ f s' t' :=
-  by
+theorem image₂_subset (hs : s ⊆ s') (ht : t ⊆ t') : image₂ f s t ⊆ image₂ f s' t' := by
   rw [← coe_subset, coe_image₂, coe_image₂]
   exact image2_subset hs ht
 #align finset.image₂_subset Finset.image₂_subset
@@ -120,8 +118,7 @@ theorem image₂_subset_iff_right : image₂ f s t ⊆ u ↔ ∀ b ∈ t, (s.ima
 #align finset.image₂_subset_iff_right Finset.image₂_subset_iff_right
 
 @[simp]
-theorem image₂_nonempty_iff : (image₂ f s t).Nonempty ↔ s.Nonempty ∧ t.Nonempty :=
-  by
+theorem image₂_nonempty_iff : (image₂ f s t).Nonempty ↔ s.Nonempty ∧ t.Nonempty := by
   rw [← coe_nonempty, coe_image₂]
   exact image2_nonempty_iff
 #align finset.image₂_nonempty_iff Finset.image₂_nonempty_iff
@@ -238,8 +235,7 @@ theorem image₂_congr' (h : ∀ a b, f a b = f' a b) : image₂ f s t = image
 #align finset.image₂_congr' Finset.image₂_congr'
 
 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' :=
-  by
+    ∃ (s' : Finset α)(t' : Finset β), ↑s' ⊆ s ∧ ↑t' ⊆ t ∧ u ⊆ image₂ f s' t' := by
   apply @Finset.induction_on' γ _ _ u
   · use ∅; use ∅; simp only [coe_empty];
     exact ⟨Set.empty_subset _, Set.empty_subset _, empty_subset _⟩
@@ -284,8 +280,7 @@ theorem card_le_card_image₂_left {s : Finset α} (hs : s.Nonempty) (hf : ∀ a
 #align finset.card_le_card_image₂_left Finset.card_le_card_image₂_left
 
 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 :=
-  by
+    (hf : ∀ b, Injective fun a => f a b) : s.card ≤ (image₂ f s t).card := by
   obtain ⟨b, hb⟩ := ht
   rw [← card_image₂_singleton_right _ (hf b)]
   exact card_le_of_subset (image₂_subset_left <| singleton_subset_iff.2 hb)
@@ -473,8 +468,7 @@ theorem image₂_distrib_subset_right {γ : Type _} {u : Finset γ} {f : δ →
 
 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₂) :=
-  by
+    (image₂ f s t).image g = image₂ f' (t.image g₁) (s.image g₂) := by
   rw [image₂_swap f]
   exact image_image₂_distrib fun _ _ => h_antidistrib _ _
 #align finset.image_image₂_antidistrib Finset.image_image₂_antidistrib
feat: a • t ⊆ s • t (#3227)

Match https://github.com/leanprover-community/mathlib/pull/18697

Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com>

Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module data.finset.n_ary
-! leanprover-community/mathlib commit 517cc149e0b515d2893baa376226ed10feb319c7
+! leanprover-community/mathlib commit 5e526d18cea33550268dcbbddcb822d5cde40654
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -97,7 +97,7 @@ theorem image_subset_image₂_left (hb : b ∈ t) : s.image (fun a => f a b) ⊆
   image_subset_iff.2 fun _ ha => mem_image₂_of_mem ha hb
 #align finset.image_subset_image₂_left Finset.image_subset_image₂_left
 
-theorem image_subset_image₂_right (ha : a ∈ s) : t.image (f a) ⊆ image₂ f s t :=
+theorem image_subset_image₂_right (ha : a ∈ s) : t.image (fun b => f a b) ⊆ image₂ f s t :=
   image_subset_iff.2 fun _ => mem_image₂_of_mem ha
 #align finset.image_subset_image₂_right Finset.image_subset_image₂_right
 
@@ -111,6 +111,14 @@ theorem image₂_subset_iff : image₂ f s t ⊆ u ↔ ∀ x ∈ s, ∀ y ∈ t,
   forall_image₂_iff
 #align finset.image₂_subset_iff Finset.image₂_subset_iff
 
+theorem image₂_subset_iff_left : image₂ f s t ⊆ u ↔ ∀ a ∈ s, (t.image fun b => f a b) ⊆ u := by
+  simp_rw [image₂_subset_iff, image_subset_iff]
+#align finset.image₂_subset_iff_left Finset.image₂_subset_iff_left
+
+theorem image₂_subset_iff_right : image₂ f s t ⊆ u ↔ ∀ b ∈ t, (s.image fun a => f a b) ⊆ u := by
+  simp_rw [image₂_subset_iff, image_subset_iff, @forall₂_swap α]
+#align finset.image₂_subset_iff_right Finset.image₂_subset_iff_right
+
 @[simp]
 theorem image₂_nonempty_iff : (image₂ f s t).Nonempty ↔ s.Nonempty ∧ t.Nonempty :=
   by
@@ -174,6 +182,22 @@ theorem image₂_union_right [DecidableEq β] : image₂ f s (t ∪ t') = image
     exact image2_union_right
 #align finset.image₂_union_right Finset.image₂_union_right
 
+@[simp]
+theorem image₂_insert_left [DecidableEq α] :
+    image₂ f (insert a s) t = (t.image fun b => f a b) ∪ image₂ f s t :=
+  coe_injective <| by
+    push_cast
+    exact image2_insert_left
+#align finset.image₂_insert_left Finset.image₂_insert_left
+
+@[simp]
+theorem image₂_insert_right [DecidableEq β] :
+    image₂ f s (insert b t) = (s.image fun a => f a b) ∪ image₂ f s t :=
+  coe_injective <| by
+    push_cast
+    exact image2_insert_right
+#align finset.image₂_insert_right Finset.image₂_insert_right
+
 theorem image₂_inter_left [DecidableEq α] (hf : Injective2 f) :
     image₂ f (s ∩ s') t = image₂ f s t ∩ image₂ f s' t :=
   coe_injective <| by
@@ -312,13 +336,6 @@ theorem image₂_image_right (f : α → γ → δ) (g : β → γ) :
     exact image2_image_right _ _
 #align finset.image₂_image_right Finset.image₂_image_right
 
-theorem image₂_swap (f : α → β → γ) (s : Finset α) (t : Finset β) :
-    image₂ f s t = image₂ (fun a b => f b a) t s :=
-  coe_injective <| by
-    push_cast
-    exact image2_swap _ _ _
-#align finset.image₂_swap Finset.image₂_swap
-
 @[simp]
 theorem image₂_mk_eq_product [DecidableEq α] [DecidableEq β] (s : Finset α) (t : Finset β) :
     image₂ Prod.mk s t = s ×ᶠ t := by ext; simp [Prod.ext_iff]
@@ -335,6 +352,13 @@ theorem image_uncurry_product (f : α → β → γ) (s : Finset α) (t : Finset
     (s ×ᶠ t).image (uncurry f) = image₂ f s t := by rw [← image₂_curry, curry_uncurry]
 #align finset.image_uncurry_product Finset.image_uncurry_product
 
+theorem image₂_swap (f : α → β → γ) (s : Finset α) (t : Finset β) :
+    image₂ f s t = image₂ (fun a b => f b a) t s :=
+  coe_injective <| by
+    push_cast
+    exact image2_swap _ _ _
+#align finset.image₂_swap Finset.image₂_swap
+
 @[simp]
 theorem image₂_left [DecidableEq α] (h : t.Nonempty) : image₂ (fun x _ => x) s t = s :=
   coe_injective <| by
@@ -502,6 +526,20 @@ theorem image₂_right_identity {f : γ → β → γ} {b : β} (h : ∀ a, f a
 
 variable [DecidableEq α] [DecidableEq β]
 
+theorem image₂_inter_union_subset_union :
+    image₂ f (s ∩ s') (t ∪ t') ⊆ image₂ f s t ∪ image₂ f s' t' :=
+  coe_subset.1 <| by
+    push_cast
+    exact Set.image2_inter_union_subset_union
+#align finset.image₂_inter_union_subset_union Finset.image₂_inter_union_subset_union
+
+theorem image₂_union_inter_subset_union :
+    image₂ f (s ∪ s') (t ∩ t') ⊆ image₂ f s t ∪ image₂ f s' t' :=
+  coe_subset.1 <| by
+    push_cast
+    exact Set.image2_union_inter_subset_union
+#align finset.image₂_union_inter_subset_union Finset.image₂_union_inter_subset_union
+
 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 :=
   coe_subset.1 <| by
feat: s ∩ t * s ∪ t ⊆ s * t (#1619)

Match https://github.com/leanprover-community/mathlib/pull/17961

Co-authored-by: Eric Wieser <wieser.eric@gmail.com> Co-authored-by: Jeremy Tan Jie Rui <reddeloostw@gmail.com> Co-authored-by: Parcly Taxel <reddeloostw@gmail.com>

Diff
@@ -4,11 +4,12 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module data.finset.n_ary
-! leanprover-community/mathlib commit 20715f4ac6819ef2453d9e5106ecd086a5dc2a5e
+! leanprover-community/mathlib commit 517cc149e0b515d2893baa376226ed10feb319c7
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
 import Mathlib.Data.Finset.Prod
+import Mathlib.Data.Set.Finite
 
 /-!
 # N-ary images of finsets
@@ -28,12 +29,13 @@ and `Set.image2` already fulfills this task.
 
 open Function Set
 
+variable {α α' β β' γ γ' δ δ' ε ε' ζ ζ' ν : Type _}
+
 namespace Finset
 
-variable {α α' β β' γ γ' δ δ' ε ε' ζ ζ' ν : Type _} [DecidableEq α'] [DecidableEq β']
-  [DecidableEq γ] [DecidableEq γ'] [DecidableEq δ] [DecidableEq δ'] [DecidableEq ε] [DecidableEq ε']
-  {f f' : α → β → γ} {g g' : α → β → γ → δ} {s s' : Finset α} {t t' : Finset β} {u u' : Finset γ}
-  {a a' : α} {b b' : β} {c : γ}
+variable [DecidableEq α'] [DecidableEq β'] [DecidableEq γ] [DecidableEq γ'] [DecidableEq δ]
+  [DecidableEq δ'] [DecidableEq ε] [DecidableEq ε'] {f f' : α → β → γ} {g g' : α → β → γ → δ}
+  {s s' : Finset α} {t t' : Finset β} {u u' : Finset γ} {a a' : α} {b b' : β} {c : γ}
 
 /-- 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 `α × β → γ`. -/
@@ -498,4 +500,37 @@ theorem image₂_right_identity {f : γ → β → γ} {b : β} (h : ∀ a, f a
     image₂ f s {b} = s := by rw [image₂_singleton_right, funext h, image_id']
 #align finset.image₂_right_identity Finset.image₂_right_identity
 
+variable [DecidableEq α] [DecidableEq β]
+
+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 :=
+  coe_subset.1 <| by
+    push_cast
+    exact image2_inter_union_subset hf
+#align finset.image₂_inter_union_subset Finset.image₂_inter_union_subset
+
+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 :=
+  coe_subset.1 <| by
+    push_cast
+    exact image2_union_inter_subset hf
+#align finset.image₂_union_inter_subset Finset.image₂_union_inter_subset
+
 end Finset
+
+namespace Set
+
+variable [DecidableEq γ] {s : Set α} {t : Set β}
+
+@[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 :=
+  Finset.coe_injective <| by simp
+#align set.to_finset_image2 Set.toFinset_image2
+
+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 :=
+  Finset.coe_injective <| by simp
+#align set.finite.to_finset_image2 Set.Finite.toFinset_image2
+
+end Set
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module data.finset.n_ary
-! leanprover-community/mathlib commit 995b47e555f1b6297c7cf16855f1023e355219fb
+! leanprover-community/mathlib commit 20715f4ac6819ef2453d9e5106ecd086a5dc2a5e
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -30,8 +30,8 @@ open Function Set
 
 namespace Finset
 
-variable {α α' β β' γ γ' δ δ' ε ε' : Type _} [DecidableEq α'] [DecidableEq β'] [DecidableEq γ]
-  [DecidableEq γ'] [DecidableEq δ] [DecidableEq δ'] [DecidableEq ε] [DecidableEq ε']
+variable {α α' β β' γ γ' δ δ' ε ε' ζ ζ' ν : Type _} [DecidableEq α'] [DecidableEq β']
+  [DecidableEq γ] [DecidableEq γ'] [DecidableEq δ] [DecidableEq δ'] [DecidableEq ε] [DecidableEq ε']
   {f f' : α → β → γ} {g g' : α → β → γ → δ} {s s' : Finset α} {t t' : Finset β} {u u' : Finset γ}
   {a a' : α} {b b' : β} {c : γ}
 
@@ -91,12 +91,12 @@ theorem image₂_subset_right (hs : s ⊆ s') : image₂ f s t ⊆ image₂ f s'
   image₂_subset hs Subset.rfl
 #align finset.image₂_subset_right Finset.image₂_subset_right
 
-theorem image_subset_image₂_left (hb : b ∈ t) : (fun a => f a b) '' s ⊆ image₂ f s t :=
-  ball_image_of_ball fun _ ha => mem_image₂_of_mem ha hb
+theorem image_subset_image₂_left (hb : b ∈ t) : s.image (fun a => f a b) ⊆ image₂ f s t :=
+  image_subset_iff.2 fun _ ha => mem_image₂_of_mem ha hb
 #align finset.image_subset_image₂_left Finset.image_subset_image₂_left
 
-theorem image_subset_image₂_right (ha : a ∈ s) : f a '' t ⊆ image₂ f s t :=
-  ball_image_of_ball fun _ => mem_image₂_of_mem ha
+theorem image_subset_image₂_right (ha : a ∈ s) : t.image (f a) ⊆ image₂ f s t :=
+  image_subset_iff.2 fun _ => mem_image₂_of_mem ha
 #align finset.image_subset_image₂_right Finset.image_subset_image₂_right
 
 theorem forall_image₂_iff {p : γ → Prop} :
@@ -375,6 +375,16 @@ theorem image₂_right_comm {γ : Type _} {u : Finset γ} {f : δ → γ → ε}
     exact image2_right_comm h_right_comm
 #align finset.image₂_right_comm Finset.image₂_right_comm
 
+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) :=
+  coe_injective <| by
+    push_cast
+    exact image2_image2_image2_comm h_comm
+#align finset.image₂_image₂_image₂_comm Finset.image₂_image₂_image₂_comm
+
 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₂) :=
chore: update SHA of already forward-ported files (#2181)

Update some SHAs of files that changed in mathlib3.

These 17 files need mainly only updated SHA as they've been only touched by backports or already have been forward-ported.

The relevant changes are:

Co-authored-by: Eric Wieser <wieser.eric@gmail.com>

Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Yaël Dillies
 
 ! This file was ported from Lean 3 source module data.finset.n_ary
-! leanprover-community/mathlib commit 9003f28797c0664a49e4179487267c494477d853
+! leanprover-community/mathlib commit 995b47e555f1b6297c7cf16855f1023e355219fb
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -475,4 +475,17 @@ theorem image_image₂_right_anticomm {f : α → β' → γ} {g : β → β'} {
   (image_image₂_antidistrib_right fun a b => (h_right_anticomm b a).symm).symm
 #align finset.image_image₂_right_anticomm Finset.image_image₂_right_anticomm
 
+/-- 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 :=
+  coe_injective <| by rw [coe_image₂, coe_singleton, Set.image2_left_identity h]
+#align finset.image₂_left_identity Finset.image₂_left_identity
+
+/-- 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 := by rw [image₂_singleton_right, funext h, image_id']
+#align finset.image₂_right_identity Finset.image₂_right_identity
+
 end Finset
feat: port Data.Finset.NAry (#1610)

Co-authored-by: Chris Hughes <33847686+ChrisHughes24@users.noreply.github.com>

Dependencies 6 + 211

212 files ported (97.2%)
94224 lines ported (97.8%)
Show graph

The unported dependencies are