data.set.n_aryMathlib.Data.Set.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)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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/{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
@@ -67,6 +67,12 @@ lemma forall_image2_iff {p : γ → Prop} :
   image2 f s t ⊆ u ↔ ∀ (x ∈ s) (y ∈ t), f x y ∈ u :=
 forall_image2_iff
 
+lemma image2_subset_iff_left : image2 f s t ⊆ u ↔ ∀ a ∈ s, (λ b, f a b) '' t ⊆ u :=
+by simp_rw [image2_subset_iff, image_subset_iff, subset_def, mem_preimage]
+
+lemma image2_subset_iff_right : image2 f s t ⊆ u ↔ ∀ b ∈ t, (λ a, f a b) '' s ⊆ u :=
+by simp_rw [image2_subset_iff, image_subset_iff, subset_def, mem_preimage, @forall₂_swap α]
+
 variables (f)
 
 @[simp] lemma image_prod : (λ x : α × β, f x.1 x.2) '' s ×ˢ t = image2 f s t :=
@@ -83,6 +89,9 @@ image_prod _
   image2 (λ a b, f (a, b)) s t = f '' s ×ˢ t :=
 by simp [←image_uncurry_prod, uncurry]
 
+lemma image2_swap (s : set α) (t : set β) : image2 f s t = image2 (λ a b, f b a) t s :=
+by { ext, split; rintro ⟨a, b, ha, hb, rfl⟩; refine ⟨b, a, hb, ha, rfl⟩ }
+
 variables {f}
 
 lemma image2_union_left : image2 f (s ∪ s') t = image2 f s t ∪ image2 f s' t :=
@@ -95,13 +104,7 @@ begin
 end
 
 lemma image2_union_right : image2 f s (t ∪ t') = image2 f s t ∪ image2 f s t' :=
-begin
-  ext c,
-  split,
-  { rintro ⟨a, b, ha, h1b|h2b, rfl⟩;[left, right]; exact ⟨_, _, ‹_›, ‹_›, rfl⟩ },
-  { rintro (⟨_, _, _, _, rfl⟩|⟨_, _, _, _, rfl⟩); refine ⟨_, _, ‹_›, _, rfl⟩;
-    simp [mem_union, *] }
-end
+by rw [←image2_swap, image2_union_left, image2_swap f, image2_swap f]
 
 lemma image2_inter_left (hf : injective2 f) : image2 f (s ∩ s') t = image2 f s t ∩ image2 f s' t :=
 by simp_rw [←image_uncurry_prod, inter_prod, image_inter hf.uncurry]
@@ -138,6 +141,12 @@ by { rintro _ ⟨a, b, ha, ⟨h1b, h2b⟩, rfl⟩, split; exact ⟨_, _, ‹_›
 
 lemma image2_singleton : image2 f {a} {b} = {f a b} := by simp
 
+@[simp] lemma image2_insert_left : image2 f (insert a s) t = (λ b, f a b) '' t ∪ image2 f s t :=
+by rw [insert_eq, image2_union_left, image2_singleton_left]
+
+@[simp] lemma image2_insert_right : image2 f s (insert b t) = (λ a, f a b) '' s  ∪ image2 f s t :=
+by rw [insert_eq, image2_union_right, image2_singleton_right]
+
 @[congr] lemma image2_congr (h : ∀ (a ∈ s) (b ∈ t), f a b = f' a b) :
   image2 f s t = image2 f' s t :=
 by { ext, split; rintro ⟨a, b, ha, hb, rfl⟩; refine ⟨a, b, ha, hb, by rw h a ha b hb⟩ }
@@ -208,10 +217,6 @@ begin
   { rintro ⟨a, b, ha, hb, rfl⟩, refine ⟨a, _, ha, ⟨b, hb, rfl⟩, rfl⟩ }
 end
 
-lemma image2_swap (f : α → β → γ) (s : set α) (t : set β) :
-  image2 f s t = image2 (λ a b, f b a) t s :=
-by { ext, split; rintro ⟨a, b, ha, hb, rfl⟩; refine ⟨b, a, hb, ha, rfl⟩ }
-
 @[simp] lemma image2_left (h : t.nonempty) : image2 (λ x y, x) s t = s :=
 by simp [nonempty_def.mp h, ext_iff]
 
@@ -339,14 +344,20 @@ lemma image2_right_identity {f : α → β → α} {b : β} (h : ∀ a, f a b =
   image2 f s {b} = s :=
 by rw [image2_singleton_right, funext h, image_id']
 
+lemma image2_inter_union_subset_union :
+  image2 f (s ∩ s') (t ∪ t') ⊆ image2 f s t ∪ image2 f s' t' :=
+by { rw image2_union_right, exact union_subset_union
+  (image2_subset_right $ inter_subset_left _ _) (image2_subset_right $ inter_subset_right _ _) }
+
+lemma image2_union_inter_subset_union :
+  image2 f (s ∪ s') (t ∩ t') ⊆ image2 f s t ∪ image2 f s' t' :=
+by { rw image2_union_left, exact union_subset_union
+  (image2_subset_left $ inter_subset_left _ _) (image2_subset_left $ inter_subset_right _ _) }
+
 lemma image2_inter_union_subset {f : α → α → β} {s t : set α} (hf : ∀ a b, f a b = f b a) :
   image2 f (s ∩ t) (s ∪ t) ⊆ image2 f s t :=
-begin
-  rintro _ ⟨a, b, ha, hb | hb, rfl⟩,
-  { rw hf,
-    exact mem_image2_of_mem hb ha.2 },
-  { exact mem_image2_of_mem ha.1 hb }
-end
+by { rw inter_comm,
+  exact image2_inter_union_subset_union.trans (union_subset (image2_comm hf).subset subset.rfl) }
 
 lemma image2_union_inter_subset {f : α → α → β} {s t : set α} (hf : ∀ a b, f a b = f b a) :
   image2 f (s ∪ t) (s ∩ t) ⊆ image2 f s t :=

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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
@@ -339,4 +339,17 @@ lemma image2_right_identity {f : α → β → α} {b : β} (h : ∀ a, f a b =
   image2 f s {b} = s :=
 by rw [image2_singleton_right, funext h, image_id']
 
+lemma image2_inter_union_subset {f : α → α → β} {s t : set α} (hf : ∀ a b, f a b = f b a) :
+  image2 f (s ∩ t) (s ∪ t) ⊆ image2 f s t :=
+begin
+  rintro _ ⟨a, b, ha, hb | hb, rfl⟩,
+  { rw hf,
+    exact mem_image2_of_mem hb ha.2 },
+  { exact mem_image2_of_mem ha.1 hb }
+end
+
+lemma image2_union_inter_subset {f : α → α → β} {s t : set α} (hf : ∀ a b, f a b = f b a) :
+  image2 f (s ∪ t) (s ∩ t) ⊆ image2 f s t :=
+by { rw image2_comm hf, exact image2_inter_union_subset hf }
+
 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
@@ -26,8 +26,9 @@ and `set.image2` already fulfills this task.
 open function
 
 namespace set
-variables {α α' β β' γ γ' δ δ' ε ε' : Type*} {f f' : α → β → γ} {g g' : α → β → γ → δ}
-variables {s s' : set α} {t t' : set β} {u u' : set γ} {a a' : α} {b b' : β} {c c' : γ} {d d' : δ}
+variables {α α' β β' γ γ' δ δ' ε ε' ζ ζ' ν : Type*} {f f' : α → β → γ} {g g' : α → β → γ → δ}
+variables {s s' : set α} {t t' : set β} {u u' : set γ} {v : set δ} {a a' : α} {b b' : β} {c c' : γ}
+  {d d' : δ}
 
 
 /-- The image of a binary function `f : α → β → γ` as a function `set α → set β → set γ`.
@@ -235,6 +236,19 @@ lemma image2_right_comm {f : δ → γ → ε} {g : α → β → δ} {f' : α 
   image2 f (image2 g s t) u = image2 g' (image2 f' s u) t :=
 by { rw [image2_swap g, image2_swap g'], exact image2_assoc (λ _ _ _, h_right_comm _ _ _) }
 
+lemma image2_image2_image2_comm {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)) :
+  image2 f (image2 g s t) (image2 h u v) = image2 f' (image2 g' s u) (image2 h' t v) :=
+begin
+  ext,
+  split,
+  { rintro ⟨_, _, ⟨a, b, ha, hb, rfl⟩, ⟨c, d, hc, hd, rfl⟩, rfl⟩,
+    exact ⟨_, _, ⟨a, c, ha, hc, rfl⟩, ⟨b, d, hb, hd, rfl⟩, (h_comm _ _ _ _).symm⟩ },
+  { rintro ⟨_, _, ⟨a, c, ha, hc, rfl⟩, ⟨b, d, hb, hd, rfl⟩, rfl⟩,
+    exact ⟨_, _, ⟨a, b, ha, hb, rfl⟩, ⟨c, d, hc, hd, rfl⟩, h_comm _ _ _ _⟩ }
+end
+
 lemma image_image2_distrib {g : γ → δ} {f' : α' → β' → δ} {g₁ : α → α'} {g₂ : β → β'}
   (h_distrib : ∀ a b, g (f a b) = f' (g₁ a) (g₂ b)) :
   (image2 f s t).image g = image2 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
@@ -313,4 +313,16 @@ lemma image_image2_right_anticomm {f : α → β' → γ} {g : β → β'} {f' :
   image2 f s (t.image g) = (image2 f' t s).image g' :=
 (image_image2_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
+`set.image2 f`. -/
+lemma image2_left_identity {f : α → β → β} {a : α} (h : ∀ b, f a b = b) (t : set β) :
+  image2 f {a} t = t :=
+by rw [image2_singleton_left, show f a = id, from funext h, image_id]
+
+/-- If `b` is a right identity for `f : α → β → α`, then `{b}` is a right identity for
+`set.image2 f`. -/
+lemma image2_right_identity {f : α → β → α} {b : β} (h : ∀ a, f a b = a) (s : set α) :
+  image2 f s {b} = s :=
+by rw [image2_singleton_right, funext h, image_id']
+
 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)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

chore(data/set/image): Turn lemma around (#17945)

Turn set.image_inter around to match all other distributivity lemmas (set.image_union, set.image_Inter, set.image_Union, finset.image_inter, finset.image_union, ...)

Diff
@@ -104,10 +104,10 @@ begin
 end
 
 lemma image2_inter_left (hf : injective2 f) : image2 f (s ∩ s') t = image2 f s t ∩ image2 f s' t :=
-by simp_rw [←image_uncurry_prod, inter_prod, ←image_inter hf.uncurry]
+by simp_rw [←image_uncurry_prod, inter_prod, image_inter hf.uncurry]
 
 lemma image2_inter_right (hf : injective2 f) : image2 f s (t ∩ t') = image2 f s t ∩ image2 f s t' :=
-by simp_rw [←image_uncurry_prod, prod_inter, ←image_inter hf.uncurry]
+by simp_rw [←image_uncurry_prod, prod_inter, image_inter hf.uncurry]
 
 @[simp] lemma image2_empty_left : image2 f ∅ t = ∅ := ext $ by simp
 @[simp] lemma image2_empty_right : image2 f s ∅ = ∅ := ext $ by simp

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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/n_ary): Distributivity of (#17924)

set.image2 f for injective2 f distributes over intersection.

Also move the required results from data.set.prod to data.set.n_ary. As a bonus, this makes quite a few files not depend on data.set.n_ary anymore and matches the import direction for the corresponding finset files.

Diff
@@ -3,8 +3,7 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Floris van Doorn
 -/
-import data.set.basic
-import data.set.image
+import data.set.prod
 
 /-!
 # N-ary images of sets
@@ -64,6 +63,24 @@ lemma forall_image2_iff {p : γ → Prop} :
   image2 f s t ⊆ u ↔ ∀ (x ∈ s) (y ∈ t), f x y ∈ u :=
 forall_image2_iff
 
+variables (f)
+
+@[simp] lemma image_prod : (λ x : α × β, f x.1 x.2) '' s ×ˢ t = image2 f s t :=
+ext $ λ a,
+⟨ by { rintro ⟨_, _, rfl⟩, exact ⟨_, _, (mem_prod.1 ‹_›).1, (mem_prod.1 ‹_›).2, rfl⟩ },
+  by { rintro ⟨_, _, _, _, rfl⟩, exact ⟨(_, _), ⟨‹_›, ‹_›⟩, rfl⟩ }⟩
+
+@[simp] lemma image_uncurry_prod (s : set α) (t : set β) : uncurry f '' s ×ˢ t = image2 f s t :=
+image_prod _
+
+@[simp] lemma image2_mk_eq_prod : image2 prod.mk s t = s ×ˢ t := ext $ by simp
+
+@[simp] lemma image2_curry (f : α × β → γ) (s : set α) (t : set β) :
+  image2 (λ a b, f (a, b)) s t = f '' s ×ˢ t :=
+by simp [←image_uncurry_prod, uncurry]
+
+variables {f}
+
 lemma image2_union_left : image2 f (s ∪ s') t = image2 f s t ∪ image2 f s' t :=
 begin
   ext c,
@@ -82,6 +99,12 @@ begin
     simp [mem_union, *] }
 end
 
+lemma image2_inter_left (hf : injective2 f) : image2 f (s ∩ s') t = image2 f s t ∩ image2 f s' t :=
+by simp_rw [←image_uncurry_prod, inter_prod, ←image_inter hf.uncurry]
+
+lemma image2_inter_right (hf : injective2 f) : image2 f s (t ∩ t') = image2 f s t ∩ image2 f s t' :=
+by simp_rw [←image_uncurry_prod, prod_inter, ←image_inter hf.uncurry]
+
 @[simp] lemma image2_empty_left : image2 f ∅ t = ∅ := ext $ by simp
 @[simp] lemma image2_empty_right : image2 f s ∅ = ∅ := ext $ by simp
 

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(no changes)

(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
@@ -301,7 +301,6 @@ theorem image2_congr' (h : ∀ a b, f a b = f' a b) : image2 f s t = image2 f' s
 #align set.image2_congr' Set.image2_congr'
 -/
 
-#print Set.image3 /-
 /-- The image of a ternary function `f : α → β → γ → δ` as a function
   `set α → set β → set γ → set δ`. Mathematically this should be thought of as the image of the
   corresponding function `α × β × γ → δ`.
@@ -309,23 +308,17 @@ theorem image2_congr' (h : ∀ a b, f a b = f' a b) : image2 f s t = image2 f' s
 def image3 (g : α → β → γ → δ) (s : Set α) (t : Set β) (u : Set γ) : Set δ :=
   {d | ∃ a b c, a ∈ s ∧ b ∈ t ∧ c ∈ u ∧ g a b c = d}
 #align set.image3 Set.image3
--/
 
-#print Set.mem_image3 /-
 @[simp]
 theorem mem_image3 : d ∈ image3 g s t u ↔ ∃ a b c, a ∈ s ∧ b ∈ t ∧ c ∈ u ∧ g a b c = d :=
   Iff.rfl
 #align set.mem_image3 Set.mem_image3
--/
 
-#print Set.image3_mono /-
 theorem image3_mono (hs : s ⊆ s') (ht : t ⊆ t') (hu : u ⊆ u') :
     image3 g s t u ⊆ image3 g s' t' u' := fun x =>
   Exists₃.imp fun a b c ⟨ha, hb, hc, hx⟩ => ⟨hs ha, ht hb, hu hc, hx⟩
 #align set.image3_mono Set.image3_mono
--/
 
-#print Set.image3_congr /-
 @[congr]
 theorem image3_congr (h : ∀ a ∈ s, ∀ b ∈ t, ∀ c ∈ u, g a b c = g' a b c) :
     image3 g s t u = image3 g' s t u := by
@@ -333,16 +326,12 @@ theorem image3_congr (h : ∀ a ∈ s, ∀ b ∈ t, ∀ c ∈ u, g a b c = g' a
   constructor <;> rintro ⟨a, b, c, ha, hb, hc, rfl⟩ <;>
     exact ⟨a, b, c, ha, hb, hc, by rw [h a ha b hb c hc]⟩
 #align set.image3_congr Set.image3_congr
--/
 
-#print Set.image3_congr' /-
 /-- A common special case of `image3_congr` -/
 theorem image3_congr' (h : ∀ a b c, g a b c = g' a b c) : image3 g s t u = image3 g' s t u :=
   image3_congr fun a _ b _ c _ => h a b c
 #align set.image3_congr' Set.image3_congr'
--/
 
-#print Set.image2_image2_left /-
 theorem image2_image2_left (f : δ → γ → ε) (g : α → β → δ) :
     image2 f (image2 g s t) u = image3 (fun a b c => f (g a b) c) s t u :=
   by
@@ -350,9 +339,7 @@ theorem image2_image2_left (f : δ → γ → ε) (g : α → β → δ) :
   · rintro ⟨_, c, ⟨a, b, ha, hb, rfl⟩, hc, rfl⟩; refine' ⟨a, b, c, ha, hb, hc, rfl⟩
   · rintro ⟨a, b, c, ha, hb, hc, rfl⟩; refine' ⟨_, c, ⟨a, b, ha, hb, rfl⟩, hc, rfl⟩
 #align set.image2_image2_left Set.image2_image2_left
--/
 
-#print Set.image2_image2_right /-
 theorem image2_image2_right (f : α → δ → ε) (g : β → γ → δ) :
     image2 f s (image2 g t u) = image3 (fun a b c => f a (g b c)) s t u :=
   by
@@ -360,7 +347,6 @@ theorem image2_image2_right (f : α → δ → ε) (g : β → γ → δ) :
   · rintro ⟨a, _, ha, ⟨b, c, hb, hc, rfl⟩, rfl⟩; refine' ⟨a, b, c, ha, hb, hc, rfl⟩
   · rintro ⟨a, b, c, ha, hb, hc, rfl⟩; refine' ⟨a, _, ha, ⟨b, c, hb, hc, rfl⟩, rfl⟩
 #align set.image2_image2_right Set.image2_image2_right
--/
 
 #print Set.image_image2 /-
 theorem image_image2 (f : α → β → γ) (g : γ → δ) :
Diff
@@ -3,7 +3,7 @@ Copyright (c) 2020 Floris van Doorn. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Floris van Doorn
 -/
-import Mathbin.Data.Set.Prod
+import Data.Set.Prod
 
 #align_import data.set.n_ary from "leanprover-community/mathlib"@"5e526d18cea33550268dcbbddcb822d5cde40654"
 
Diff
@@ -2,14 +2,11 @@
 Copyright (c) 2020 Floris van Doorn. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Floris van Doorn
-
-! This file was ported from Lean 3 source module data.set.n_ary
-! leanprover-community/mathlib commit 5e526d18cea33550268dcbbddcb822d5cde40654
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathbin.Data.Set.Prod
 
+#align_import data.set.n_ary from "leanprover-community/mathlib"@"5e526d18cea33550268dcbbddcb822d5cde40654"
+
 /-!
 # N-ary images of sets
 
Diff
@@ -46,93 +46,128 @@ def image2 (f : α → β → γ) (s : Set α) (t : Set β) : Set γ :=
 #align set.image2 Set.image2
 -/
 
+#print Set.mem_image2 /-
 @[simp]
 theorem mem_image2 : c ∈ image2 f s t ↔ ∃ a b, a ∈ s ∧ b ∈ t ∧ f a b = c :=
   Iff.rfl
 #align set.mem_image2 Set.mem_image2
+-/
 
+#print Set.mem_image2_of_mem /-
 theorem mem_image2_of_mem (ha : a ∈ s) (hb : b ∈ t) : f a b ∈ image2 f s t :=
   ⟨a, b, ha, hb, rfl⟩
 #align set.mem_image2_of_mem Set.mem_image2_of_mem
+-/
 
+#print Set.mem_image2_iff /-
 theorem mem_image2_iff (hf : Injective2 f) : f a b ∈ image2 f s t ↔ a ∈ s ∧ b ∈ t :=
   ⟨by rintro ⟨a', b', ha', hb', h⟩; rcases hf h with ⟨rfl, rfl⟩; exact ⟨ha', hb'⟩, fun ⟨ha, hb⟩ =>
     mem_image2_of_mem ha hb⟩
 #align set.mem_image2_iff Set.mem_image2_iff
+-/
 
+#print Set.image2_subset /-
 /-- image2 is monotone with respect to `⊆`. -/
 theorem image2_subset (hs : s ⊆ s') (ht : t ⊆ t') : image2 f s t ⊆ image2 f s' t' := by
   rintro _ ⟨a, b, ha, hb, rfl⟩; exact mem_image2_of_mem (hs ha) (ht hb)
 #align set.image2_subset Set.image2_subset
+-/
 
+#print Set.image2_subset_left /-
 theorem image2_subset_left (ht : t ⊆ t') : image2 f s t ⊆ image2 f s t' :=
   image2_subset Subset.rfl ht
 #align set.image2_subset_left Set.image2_subset_left
+-/
 
+#print Set.image2_subset_right /-
 theorem image2_subset_right (hs : s ⊆ s') : image2 f s t ⊆ image2 f s' t :=
   image2_subset hs Subset.rfl
 #align set.image2_subset_right Set.image2_subset_right
+-/
 
+#print Set.image_subset_image2_left /-
 theorem image_subset_image2_left (hb : b ∈ t) : (fun a => f a b) '' s ⊆ image2 f s t :=
   ball_image_of_ball fun a ha => mem_image2_of_mem ha hb
 #align set.image_subset_image2_left Set.image_subset_image2_left
+-/
 
+#print Set.image_subset_image2_right /-
 theorem image_subset_image2_right (ha : a ∈ s) : f a '' t ⊆ image2 f s t :=
   ball_image_of_ball fun b => mem_image2_of_mem ha
 #align set.image_subset_image2_right Set.image_subset_image2_right
+-/
 
+#print Set.forall_image2_iff /-
 theorem forall_image2_iff {p : γ → Prop} :
     (∀ z ∈ image2 f s t, p z) ↔ ∀ x ∈ s, ∀ y ∈ t, p (f x y) :=
   ⟨fun h x hx y hy => h _ ⟨x, y, hx, hy, rfl⟩, fun h z ⟨x, y, hx, hy, hz⟩ => hz ▸ h x hx y hy⟩
 #align set.forall_image2_iff Set.forall_image2_iff
+-/
 
+#print Set.image2_subset_iff /-
 @[simp]
 theorem image2_subset_iff {u : Set γ} : image2 f s t ⊆ u ↔ ∀ x ∈ s, ∀ y ∈ t, f x y ∈ u :=
   forall_image2_iff
 #align set.image2_subset_iff Set.image2_subset_iff
+-/
 
+#print Set.image2_subset_iff_left /-
 theorem image2_subset_iff_left : image2 f s t ⊆ u ↔ ∀ a ∈ s, (fun b => f a b) '' t ⊆ u := by
   simp_rw [image2_subset_iff, image_subset_iff, subset_def, mem_preimage]
 #align set.image2_subset_iff_left Set.image2_subset_iff_left
+-/
 
+#print Set.image2_subset_iff_right /-
 theorem image2_subset_iff_right : image2 f s t ⊆ u ↔ ∀ b ∈ t, (fun a => f a b) '' s ⊆ u := by
   simp_rw [image2_subset_iff, image_subset_iff, subset_def, mem_preimage, @forall₂_swap α]
 #align set.image2_subset_iff_right Set.image2_subset_iff_right
+-/
 
 variable (f)
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print Set.image_prod /-
 @[simp]
 theorem image_prod : (fun x : α × β => f x.1 x.2) '' s ×ˢ t = image2 f s t :=
   ext fun a =>
     ⟨by rintro ⟨_, _, rfl⟩; exact ⟨_, _, (mem_prod.1 ‹_›).1, (mem_prod.1 ‹_›).2, rfl⟩, by
       rintro ⟨_, _, _, _, rfl⟩; exact ⟨(_, _), ⟨‹_›, ‹_›⟩, rfl⟩⟩
 #align set.image_prod Set.image_prod
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print Set.image_uncurry_prod /-
 @[simp]
 theorem image_uncurry_prod (s : Set α) (t : Set β) : uncurry f '' s ×ˢ t = image2 f s t :=
   image_prod _
 #align set.image_uncurry_prod Set.image_uncurry_prod
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print Set.image2_mk_eq_prod /-
 @[simp]
 theorem image2_mk_eq_prod : image2 Prod.mk s t = s ×ˢ t :=
   ext <| by simp
 #align set.image2_mk_eq_prod Set.image2_mk_eq_prod
+-/
 
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
+#print Set.image2_curry /-
 @[simp]
 theorem image2_curry (f : α × β → γ) (s : Set α) (t : Set β) :
     image2 (fun a b => f (a, b)) s t = f '' s ×ˢ t := by simp [← image_uncurry_prod, uncurry]
 #align set.image2_curry Set.image2_curry
+-/
 
+#print Set.image2_swap /-
 theorem image2_swap (s : Set α) (t : Set β) : image2 f s t = image2 (fun a b => f b a) t s := by
   ext; constructor <;> rintro ⟨a, b, ha, hb, rfl⟩ <;> refine' ⟨b, a, hb, ha, rfl⟩
 #align set.image2_swap Set.image2_swap
+-/
 
 variable {f}
 
+#print Set.image2_union_left /-
 theorem image2_union_left : image2 f (s ∪ s') t = image2 f s t ∪ image2 f s' t :=
   by
   ext c
@@ -142,93 +177,132 @@ theorem image2_union_left : image2 f (s ∪ s') t = image2 f s t ∪ image2 f s'
     rintro (⟨_, _, _, _, rfl⟩ | ⟨_, _, _, _, rfl⟩) <;> refine' ⟨_, _, _, ‹_›, rfl⟩ <;>
       simp [mem_union, *]
 #align set.image2_union_left Set.image2_union_left
+-/
 
+#print Set.image2_union_right /-
 theorem image2_union_right : image2 f s (t ∪ t') = image2 f s t ∪ image2 f s t' := by
   rw [← image2_swap, image2_union_left, image2_swap f, image2_swap f]
 #align set.image2_union_right Set.image2_union_right
+-/
 
+#print Set.image2_inter_left /-
 theorem image2_inter_left (hf : Injective2 f) :
     image2 f (s ∩ s') t = image2 f s t ∩ image2 f s' t := by
   simp_rw [← image_uncurry_prod, inter_prod, image_inter hf.uncurry]
 #align set.image2_inter_left Set.image2_inter_left
+-/
 
+#print Set.image2_inter_right /-
 theorem image2_inter_right (hf : Injective2 f) :
     image2 f s (t ∩ t') = image2 f s t ∩ image2 f s t' := by
   simp_rw [← image_uncurry_prod, prod_inter, image_inter hf.uncurry]
 #align set.image2_inter_right Set.image2_inter_right
+-/
 
+#print Set.image2_empty_left /-
 @[simp]
 theorem image2_empty_left : image2 f ∅ t = ∅ :=
   ext <| by simp
 #align set.image2_empty_left Set.image2_empty_left
+-/
 
+#print Set.image2_empty_right /-
 @[simp]
 theorem image2_empty_right : image2 f s ∅ = ∅ :=
   ext <| by simp
 #align set.image2_empty_right Set.image2_empty_right
+-/
 
+#print Set.Nonempty.image2 /-
 theorem Nonempty.image2 : s.Nonempty → t.Nonempty → (image2 f s t).Nonempty :=
   fun ⟨a, ha⟩ ⟨b, hb⟩ => ⟨_, mem_image2_of_mem ha hb⟩
 #align set.nonempty.image2 Set.Nonempty.image2
+-/
 
+#print Set.image2_nonempty_iff /-
 @[simp]
 theorem image2_nonempty_iff : (image2 f s t).Nonempty ↔ s.Nonempty ∧ t.Nonempty :=
   ⟨fun ⟨_, a, b, ha, hb, _⟩ => ⟨⟨a, ha⟩, b, hb⟩, fun h => h.1.image2 h.2⟩
 #align set.image2_nonempty_iff Set.image2_nonempty_iff
+-/
 
+#print Set.Nonempty.of_image2_left /-
 theorem Nonempty.of_image2_left (h : (image2 f s t).Nonempty) : s.Nonempty :=
   (image2_nonempty_iff.1 h).1
 #align set.nonempty.of_image2_left Set.Nonempty.of_image2_left
+-/
 
+#print Set.Nonempty.of_image2_right /-
 theorem Nonempty.of_image2_right (h : (image2 f s t).Nonempty) : t.Nonempty :=
   (image2_nonempty_iff.1 h).2
 #align set.nonempty.of_image2_right Set.Nonempty.of_image2_right
+-/
 
+#print Set.image2_eq_empty_iff /-
 @[simp]
 theorem image2_eq_empty_iff : image2 f s t = ∅ ↔ s = ∅ ∨ t = ∅ := by
   simp_rw [← not_nonempty_iff_eq_empty, image2_nonempty_iff, not_and_or]
 #align set.image2_eq_empty_iff Set.image2_eq_empty_iff
+-/
 
+#print Set.image2_inter_subset_left /-
 theorem image2_inter_subset_left : image2 f (s ∩ s') t ⊆ image2 f s t ∩ image2 f s' t := by
   rintro _ ⟨a, b, ⟨h1a, h2a⟩, hb, rfl⟩; constructor <;> exact ⟨_, _, ‹_›, ‹_›, rfl⟩
 #align set.image2_inter_subset_left Set.image2_inter_subset_left
+-/
 
+#print Set.image2_inter_subset_right /-
 theorem image2_inter_subset_right : image2 f s (t ∩ t') ⊆ image2 f s t ∩ image2 f s t' := by
   rintro _ ⟨a, b, ha, ⟨h1b, h2b⟩, rfl⟩; constructor <;> exact ⟨_, _, ‹_›, ‹_›, rfl⟩
 #align set.image2_inter_subset_right Set.image2_inter_subset_right
+-/
 
+#print Set.image2_singleton_left /-
 @[simp]
 theorem image2_singleton_left : image2 f {a} t = f a '' t :=
   ext fun x => by simp
 #align set.image2_singleton_left Set.image2_singleton_left
+-/
 
+#print Set.image2_singleton_right /-
 @[simp]
 theorem image2_singleton_right : image2 f s {b} = (fun a => f a b) '' s :=
   ext fun x => by simp
 #align set.image2_singleton_right Set.image2_singleton_right
+-/
 
+#print Set.image2_singleton /-
 theorem image2_singleton : image2 f {a} {b} = {f a b} := by simp
 #align set.image2_singleton Set.image2_singleton
+-/
 
+#print Set.image2_insert_left /-
 @[simp]
 theorem image2_insert_left : image2 f (insert a s) t = (fun b => f a b) '' t ∪ image2 f s t := by
   rw [insert_eq, image2_union_left, image2_singleton_left]
 #align set.image2_insert_left Set.image2_insert_left
+-/
 
+#print Set.image2_insert_right /-
 @[simp]
 theorem image2_insert_right : image2 f s (insert b t) = (fun a => f a b) '' s ∪ image2 f s t := by
   rw [insert_eq, image2_union_right, image2_singleton_right]
 #align set.image2_insert_right Set.image2_insert_right
+-/
 
+#print Set.image2_congr /-
 @[congr]
 theorem image2_congr (h : ∀ a ∈ s, ∀ b ∈ t, f a b = f' a b) : image2 f s t = image2 f' s t := by
   ext; constructor <;> rintro ⟨a, b, ha, hb, rfl⟩ <;> refine' ⟨a, b, ha, hb, by rw [h a ha b hb]⟩
 #align set.image2_congr Set.image2_congr
+-/
 
+#print Set.image2_congr' /-
 /-- A common special case of `image2_congr` -/
 theorem image2_congr' (h : ∀ a b, f a b = f' a b) : image2 f s t = image2 f' s t :=
   image2_congr fun a _ b _ => h a b
 #align set.image2_congr' Set.image2_congr'
+-/
 
 #print Set.image3 /-
 /-- The image of a ternary function `f : α → β → γ → δ` as a function
@@ -240,16 +314,21 @@ def image3 (g : α → β → γ → δ) (s : Set α) (t : Set β) (u : Set γ)
 #align set.image3 Set.image3
 -/
 
+#print Set.mem_image3 /-
 @[simp]
 theorem mem_image3 : d ∈ image3 g s t u ↔ ∃ a b c, a ∈ s ∧ b ∈ t ∧ c ∈ u ∧ g a b c = d :=
   Iff.rfl
 #align set.mem_image3 Set.mem_image3
+-/
 
+#print Set.image3_mono /-
 theorem image3_mono (hs : s ⊆ s') (ht : t ⊆ t') (hu : u ⊆ u') :
     image3 g s t u ⊆ image3 g s' t' u' := fun x =>
   Exists₃.imp fun a b c ⟨ha, hb, hc, hx⟩ => ⟨hs ha, ht hb, hu hc, hx⟩
 #align set.image3_mono Set.image3_mono
+-/
 
+#print Set.image3_congr /-
 @[congr]
 theorem image3_congr (h : ∀ a ∈ s, ∀ b ∈ t, ∀ c ∈ u, g a b c = g' a b c) :
     image3 g s t u = image3 g' s t u := by
@@ -257,12 +336,16 @@ theorem image3_congr (h : ∀ a ∈ s, ∀ b ∈ t, ∀ c ∈ u, g a b c = g' a
   constructor <;> rintro ⟨a, b, c, ha, hb, hc, rfl⟩ <;>
     exact ⟨a, b, c, ha, hb, hc, by rw [h a ha b hb c hc]⟩
 #align set.image3_congr Set.image3_congr
+-/
 
+#print Set.image3_congr' /-
 /-- A common special case of `image3_congr` -/
 theorem image3_congr' (h : ∀ a b c, g a b c = g' a b c) : image3 g s t u = image3 g' s t u :=
   image3_congr fun a _ b _ c _ => h a b c
 #align set.image3_congr' Set.image3_congr'
+-/
 
+#print Set.image2_image2_left /-
 theorem image2_image2_left (f : δ → γ → ε) (g : α → β → δ) :
     image2 f (image2 g s t) u = image3 (fun a b c => f (g a b) c) s t u :=
   by
@@ -270,7 +353,9 @@ theorem image2_image2_left (f : δ → γ → ε) (g : α → β → δ) :
   · rintro ⟨_, c, ⟨a, b, ha, hb, rfl⟩, hc, rfl⟩; refine' ⟨a, b, c, ha, hb, hc, rfl⟩
   · rintro ⟨a, b, c, ha, hb, hc, rfl⟩; refine' ⟨_, c, ⟨a, b, ha, hb, rfl⟩, hc, rfl⟩
 #align set.image2_image2_left Set.image2_image2_left
+-/
 
+#print Set.image2_image2_right /-
 theorem image2_image2_right (f : α → δ → ε) (g : β → γ → δ) :
     image2 f s (image2 g t u) = image3 (fun a b c => f a (g b c)) s t u :=
   by
@@ -278,7 +363,9 @@ theorem image2_image2_right (f : α → δ → ε) (g : β → γ → δ) :
   · rintro ⟨a, _, ha, ⟨b, c, hb, hc, rfl⟩, rfl⟩; refine' ⟨a, b, c, ha, hb, hc, rfl⟩
   · rintro ⟨a, b, c, ha, hb, hc, rfl⟩; refine' ⟨a, _, ha, ⟨b, c, hb, hc, rfl⟩, rfl⟩
 #align set.image2_image2_right Set.image2_image2_right
+-/
 
+#print Set.image_image2 /-
 theorem image_image2 (f : α → β → γ) (g : γ → δ) :
     g '' image2 f s t = image2 (fun a b => g (f a b)) s t :=
   by
@@ -286,6 +373,7 @@ theorem image_image2 (f : α → β → γ) (g : γ → δ) :
   · rintro ⟨_, ⟨a, b, ha, hb, rfl⟩, rfl⟩; refine' ⟨a, b, ha, hb, rfl⟩
   · rintro ⟨a, b, ha, hb, rfl⟩; refine' ⟨_, ⟨a, b, ha, hb, rfl⟩, rfl⟩
 #align set.image_image2 Set.image_image2
+-/
 
 #print Set.image2_image_left /-
 theorem image2_image_left (f : γ → β → δ) (g : α → γ) :
@@ -297,6 +385,7 @@ theorem image2_image_left (f : γ → β → δ) (g : α → γ) :
 #align set.image2_image_left Set.image2_image_left
 -/
 
+#print Set.image2_image_right /-
 theorem image2_image_right (f : α → γ → δ) (g : β → γ) :
     image2 f s (g '' t) = image2 (fun a b => f a (g b)) s t :=
   by
@@ -304,6 +393,7 @@ theorem image2_image_right (f : α → γ → δ) (g : β → γ) :
   · rintro ⟨a, _, ha, ⟨b, hb, rfl⟩, rfl⟩; refine' ⟨a, b, ha, hb, rfl⟩
   · rintro ⟨a, b, ha, hb, rfl⟩; refine' ⟨a, _, ha, ⟨b, hb, rfl⟩, rfl⟩
 #align set.image2_image_right Set.image2_image_right
+-/
 
 #print Set.image2_left /-
 @[simp]
@@ -312,33 +402,44 @@ theorem image2_left (h : t.Nonempty) : image2 (fun x y => x) s t = s := by
 #align set.image2_left Set.image2_left
 -/
 
+#print Set.image2_right /-
 @[simp]
 theorem image2_right (h : s.Nonempty) : image2 (fun x y => y) s t = t := by
   simp [nonempty_def.mp h, ext_iff]
 #align set.image2_right Set.image2_right
+-/
 
+#print Set.image2_assoc /-
 theorem image2_assoc {f : δ → γ → ε} {g : α → β → δ} {f' : α → ε' → ε} {g' : β → γ → ε'}
     (h_assoc : ∀ a b c, f (g a b) c = f' a (g' b c)) :
     image2 f (image2 g s t) u = image2 f' s (image2 g' t u) := by
   simp only [image2_image2_left, image2_image2_right, h_assoc]
 #align set.image2_assoc Set.image2_assoc
+-/
 
+#print Set.image2_comm /-
 theorem image2_comm {g : β → α → γ} (h_comm : ∀ a b, f a b = g b a) : image2 f s t = image2 g t s :=
   (image2_swap _ _ _).trans <| by simp_rw [h_comm]
 #align set.image2_comm Set.image2_comm
+-/
 
+#print Set.image2_left_comm /-
 theorem image2_left_comm {f : α → δ → ε} {g : β → γ → δ} {f' : α → γ → δ'} {g' : β → δ' → ε}
     (h_left_comm : ∀ a b c, f a (g b c) = g' b (f' a c)) :
     image2 f s (image2 g t u) = image2 g' t (image2 f' s u) := by
   rw [image2_swap f', image2_swap f]; exact image2_assoc fun _ _ _ => h_left_comm _ _ _
 #align set.image2_left_comm Set.image2_left_comm
+-/
 
+#print Set.image2_right_comm /-
 theorem image2_right_comm {f : δ → γ → ε} {g : α → β → δ} {f' : α → γ → δ'} {g' : δ' → β → ε}
     (h_right_comm : ∀ a b c, f (g a b) c = g' (f' a c) b) :
     image2 f (image2 g s t) u = image2 g' (image2 f' s u) t := by
   rw [image2_swap g, image2_swap g']; exact image2_assoc fun _ _ _ => h_right_comm _ _ _
 #align set.image2_right_comm Set.image2_right_comm
+-/
 
+#print Set.image2_image2_image2_comm /-
 theorem image2_image2_image2_comm {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)) :
@@ -351,41 +452,53 @@ theorem image2_image2_image2_comm {f : ε → ζ → ν} {g : α → β → ε}
   · rintro ⟨_, _, ⟨a, c, ha, hc, rfl⟩, ⟨b, d, hb, hd, rfl⟩, rfl⟩
     exact ⟨_, _, ⟨a, b, ha, hb, rfl⟩, ⟨c, d, hc, hd, rfl⟩, h_comm _ _ _ _⟩
 #align set.image2_image2_image2_comm Set.image2_image2_image2_comm
+-/
 
+#print Set.image_image2_distrib /-
 theorem image_image2_distrib {g : γ → δ} {f' : α' → β' → δ} {g₁ : α → α'} {g₂ : β → β'}
     (h_distrib : ∀ a b, g (f a b) = f' (g₁ a) (g₂ b)) :
     (image2 f s t).image g = image2 f' (s.image g₁) (t.image g₂) := by
   simp_rw [image_image2, image2_image_left, image2_image_right, h_distrib]
 #align set.image_image2_distrib Set.image_image2_distrib
+-/
 
+#print Set.image_image2_distrib_left /-
 /-- Symmetric statement to `set.image2_image_left_comm`. -/
 theorem image_image2_distrib_left {g : γ → δ} {f' : α' → β → δ} {g' : α → α'}
     (h_distrib : ∀ a b, g (f a b) = f' (g' a) b) :
     (image2 f s t).image g = image2 f' (s.image g') t :=
   (image_image2_distrib h_distrib).trans <| by rw [image_id']
 #align set.image_image2_distrib_left Set.image_image2_distrib_left
+-/
 
+#print Set.image_image2_distrib_right /-
 /-- Symmetric statement to `set.image_image2_right_comm`. -/
 theorem image_image2_distrib_right {g : γ → δ} {f' : α → β' → δ} {g' : β → β'}
     (h_distrib : ∀ a b, g (f a b) = f' a (g' b)) :
     (image2 f s t).image g = image2 f' s (t.image g') :=
   (image_image2_distrib h_distrib).trans <| by rw [image_id']
 #align set.image_image2_distrib_right Set.image_image2_distrib_right
+-/
 
+#print Set.image2_image_left_comm /-
 /-- Symmetric statement to `set.image_image2_distrib_left`. -/
 theorem image2_image_left_comm {f : α' → β → γ} {g : α → α'} {f' : α → β → δ} {g' : δ → γ}
     (h_left_comm : ∀ a b, f (g a) b = g' (f' a b)) :
     image2 f (s.image g) t = (image2 f' s t).image g' :=
   (image_image2_distrib_left fun a b => (h_left_comm a b).symm).symm
 #align set.image2_image_left_comm Set.image2_image_left_comm
+-/
 
+#print Set.image_image2_right_comm /-
 /-- Symmetric statement to `set.image_image2_distrib_right`. -/
 theorem image_image2_right_comm {f : α → β' → γ} {g : β → β'} {f' : α → β → δ} {g' : δ → γ}
     (h_right_comm : ∀ a b, f a (g b) = g' (f' a b)) :
     image2 f s (t.image g) = (image2 f' s t).image g' :=
   (image_image2_distrib_right fun a b => (h_right_comm a b).symm).symm
 #align set.image_image2_right_comm Set.image_image2_right_comm
+-/
 
+#print Set.image2_distrib_subset_left /-
 /-- The other direction does not hold because of the `s`-`s` cross terms on the RHS. -/
 theorem image2_distrib_subset_left {f : α → δ → ε} {g : β → γ → δ} {f₁ : α → β → β'}
     {f₂ : α → γ → γ'} {g' : β' → γ' → ε} (h_distrib : ∀ a b c, f a (g b c) = g' (f₁ a b) (f₂ a c)) :
@@ -395,7 +508,9 @@ theorem image2_distrib_subset_left {f : α → δ → ε} {g : β → γ → δ}
   rw [h_distrib]
   exact mem_image2_of_mem (mem_image2_of_mem ha hb) (mem_image2_of_mem ha hc)
 #align set.image2_distrib_subset_left Set.image2_distrib_subset_left
+-/
 
+#print Set.image2_distrib_subset_right /-
 /-- The other direction does not hold because of the `u`-`u` cross terms on the RHS. -/
 theorem image2_distrib_subset_right {f : δ → γ → ε} {g : α → β → δ} {f₁ : α → γ → α'}
     {f₂ : β → γ → β'} {g' : α' → β' → ε} (h_distrib : ∀ a b c, f (g a b) c = g' (f₁ a c) (f₂ b c)) :
@@ -405,40 +520,51 @@ theorem image2_distrib_subset_right {f : δ → γ → ε} {g : α → β → δ
   rw [h_distrib]
   exact mem_image2_of_mem (mem_image2_of_mem ha hc) (mem_image2_of_mem hb hc)
 #align set.image2_distrib_subset_right Set.image2_distrib_subset_right
+-/
 
+#print Set.image_image2_antidistrib /-
 theorem image_image2_antidistrib {g : γ → δ} {f' : β' → α' → δ} {g₁ : β → β'} {g₂ : α → α'}
     (h_antidistrib : ∀ a b, g (f a b) = f' (g₁ b) (g₂ a)) :
     (image2 f s t).image g = image2 f' (t.image g₁) (s.image g₂) := by rw [image2_swap f];
   exact image_image2_distrib fun _ _ => h_antidistrib _ _
 #align set.image_image2_antidistrib Set.image_image2_antidistrib
+-/
 
+#print Set.image_image2_antidistrib_left /-
 /-- Symmetric statement to `set.image2_image_left_anticomm`. -/
 theorem image_image2_antidistrib_left {g : γ → δ} {f' : β' → α → δ} {g' : β → β'}
     (h_antidistrib : ∀ a b, g (f a b) = f' (g' b) a) :
     (image2 f s t).image g = image2 f' (t.image g') s :=
   (image_image2_antidistrib h_antidistrib).trans <| by rw [image_id']
 #align set.image_image2_antidistrib_left Set.image_image2_antidistrib_left
+-/
 
+#print Set.image_image2_antidistrib_right /-
 /-- Symmetric statement to `set.image_image2_right_anticomm`. -/
 theorem image_image2_antidistrib_right {g : γ → δ} {f' : β → α' → δ} {g' : α → α'}
     (h_antidistrib : ∀ a b, g (f a b) = f' b (g' a)) :
     (image2 f s t).image g = image2 f' t (s.image g') :=
   (image_image2_antidistrib h_antidistrib).trans <| by rw [image_id']
 #align set.image_image2_antidistrib_right Set.image_image2_antidistrib_right
+-/
 
+#print Set.image2_image_left_anticomm /-
 /-- Symmetric statement to `set.image_image2_antidistrib_left`. -/
 theorem image2_image_left_anticomm {f : α' → β → γ} {g : α → α'} {f' : β → α → δ} {g' : δ → γ}
     (h_left_anticomm : ∀ a b, f (g a) b = g' (f' b a)) :
     image2 f (s.image g) t = (image2 f' t s).image g' :=
   (image_image2_antidistrib_left fun a b => (h_left_anticomm b a).symm).symm
 #align set.image2_image_left_anticomm Set.image2_image_left_anticomm
+-/
 
+#print Set.image_image2_right_anticomm /-
 /-- Symmetric statement to `set.image_image2_antidistrib_right`. -/
 theorem image_image2_right_anticomm {f : α → β' → γ} {g : β → β'} {f' : β → α → δ} {g' : δ → γ}
     (h_right_anticomm : ∀ a b, f a (g b) = g' (f' b a)) :
     image2 f s (t.image g) = (image2 f' t s).image g' :=
   (image_image2_antidistrib_right fun a b => (h_right_anticomm b a).symm).symm
 #align set.image_image2_right_anticomm Set.image_image2_right_anticomm
+-/
 
 #print Set.image2_left_identity /-
 /-- If `a` is a left identity for `f : α → β → β`, then `{a}` is a left identity for
@@ -448,37 +574,47 @@ theorem image2_left_identity {f : α → β → β} {a : α} (h : ∀ b, f a b =
 #align set.image2_left_identity Set.image2_left_identity
 -/
 
+#print Set.image2_right_identity /-
 /-- If `b` is a right identity for `f : α → β → α`, then `{b}` is a right identity for
 `set.image2 f`. -/
 theorem image2_right_identity {f : α → β → α} {b : β} (h : ∀ a, f a b = a) (s : Set α) :
     image2 f s {b} = s := by rw [image2_singleton_right, funext h, image_id']
 #align set.image2_right_identity Set.image2_right_identity
+-/
 
+#print Set.image2_inter_union_subset_union /-
 theorem image2_inter_union_subset_union :
     image2 f (s ∩ s') (t ∪ t') ⊆ image2 f s t ∪ image2 f s' t' := by rw [image2_union_right];
   exact
     union_subset_union (image2_subset_right <| inter_subset_left _ _)
       (image2_subset_right <| inter_subset_right _ _)
 #align set.image2_inter_union_subset_union Set.image2_inter_union_subset_union
+-/
 
+#print Set.image2_union_inter_subset_union /-
 theorem image2_union_inter_subset_union :
     image2 f (s ∪ s') (t ∩ t') ⊆ image2 f s t ∪ image2 f s' t' := by rw [image2_union_left];
   exact
     union_subset_union (image2_subset_left <| inter_subset_left _ _)
       (image2_subset_left <| inter_subset_right _ _)
 #align set.image2_union_inter_subset_union Set.image2_union_inter_subset_union
+-/
 
+#print Set.image2_inter_union_subset /-
 theorem image2_inter_union_subset {f : α → α → β} {s t : Set α} (hf : ∀ a b, f a b = f b a) :
     image2 f (s ∩ t) (s ∪ t) ⊆ image2 f s t :=
   by
   rw [inter_comm]
   exact image2_inter_union_subset_union.trans (union_subset (image2_comm hf).Subset subset.rfl)
 #align set.image2_inter_union_subset Set.image2_inter_union_subset
+-/
 
+#print Set.image2_union_inter_subset /-
 theorem image2_union_inter_subset {f : α → α → β} {s t : Set α} (hf : ∀ a b, f a b = f b a) :
     image2 f (s ∪ t) (s ∩ t) ⊆ image2 f s t := by rw [image2_comm hf];
   exact image2_inter_union_subset hf
 #align set.image2_union_inter_subset Set.image2_union_inter_subset
+-/
 
 end Set
 
Diff
@@ -42,7 +42,7 @@ variable {s s' : Set α} {t t' : Set β} {u u' : Set γ} {v : Set δ} {a a' : α
 /-- The image of a binary function `f : α → β → γ` as a function `set α → set β → set γ`.
 Mathematically this should be thought of as the image of the corresponding function `α × β → γ`.-/
 def image2 (f : α → β → γ) (s : Set α) (t : Set β) : Set γ :=
-  { c | ∃ a b, a ∈ s ∧ b ∈ t ∧ f a b = c }
+  {c | ∃ a b, a ∈ s ∧ b ∈ t ∧ f a b = c}
 #align set.image2 Set.image2
 -/
 
@@ -236,7 +236,7 @@ theorem image2_congr' (h : ∀ a b, f a b = f' a b) : image2 f s t = image2 f' s
   corresponding function `α × β × γ → δ`.
 -/
 def image3 (g : α → β → γ → δ) (s : Set α) (t : Set β) (u : Set γ) : Set δ :=
-  { d | ∃ a b c, a ∈ s ∧ b ∈ t ∧ c ∈ u ∧ g a b c = d }
+  {d | ∃ a b c, a ∈ s ∧ b ∈ t ∧ c ∈ u ∧ g a b c = d}
 #align set.image3 Set.image3
 -/
 
Diff
@@ -137,7 +137,7 @@ theorem image2_union_left : image2 f (s ∪ s') t = image2 f s t ∪ image2 f s'
   by
   ext c
   constructor
-  · rintro ⟨a, b, ha | ha, hb, rfl⟩ <;> [left;right] <;> exact ⟨_, _, ‹_›, ‹_›, rfl⟩
+  · rintro ⟨a, b, ha | ha, hb, rfl⟩ <;> [left; right] <;> exact ⟨_, _, ‹_›, ‹_›, rfl⟩
   ·
     rintro (⟨_, _, _, _, rfl⟩ | ⟨_, _, _, _, rfl⟩) <;> refine' ⟨_, _, _, ‹_›, rfl⟩ <;>
       simp [mem_union, *]
Diff
@@ -46,139 +46,61 @@ def image2 (f : α → β → γ) (s : Set α) (t : Set β) : Set γ :=
 #align set.image2 Set.image2
 -/
 
-/- warning: set.mem_image2 -> Set.mem_image2 is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β} {c : γ}, Iff (Membership.Mem.{u3, u3} γ (Set.{u3} γ) (Set.hasMem.{u3} γ) c (Set.image2.{u1, u2, u3} α β γ f s t)) (Exists.{succ u1} α (fun (a : α) => Exists.{succ u2} β (fun (b : β) => And (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) (And (Membership.Mem.{u2, u2} β (Set.{u2} β) (Set.hasMem.{u2} β) b t) (Eq.{succ u3} γ (f a b) c)))))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {t : Set.{u1} β} {c : γ}, Iff (Membership.mem.{u3, u3} γ (Set.{u3} γ) (Set.instMembershipSet.{u3} γ) c (Set.image2.{u2, u1, u3} α β γ f s t)) (Exists.{succ u2} α (fun (a : α) => Exists.{succ u1} β (fun (b : β) => And (Membership.mem.{u2, u2} α (Set.{u2} α) (Set.instMembershipSet.{u2} α) a s) (And (Membership.mem.{u1, u1} β (Set.{u1} β) (Set.instMembershipSet.{u1} β) b t) (Eq.{succ u3} γ (f a b) c)))))
-Case conversion may be inaccurate. Consider using '#align set.mem_image2 Set.mem_image2ₓ'. -/
 @[simp]
 theorem mem_image2 : c ∈ image2 f s t ↔ ∃ a b, a ∈ s ∧ b ∈ t ∧ f a b = c :=
   Iff.rfl
 #align set.mem_image2 Set.mem_image2
 
-/- warning: set.mem_image2_of_mem -> Set.mem_image2_of_mem is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β} {a : α} {b : β}, (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) -> (Membership.Mem.{u2, u2} β (Set.{u2} β) (Set.hasMem.{u2} β) b t) -> (Membership.Mem.{u3, u3} γ (Set.{u3} γ) (Set.hasMem.{u3} γ) (f a b) (Set.image2.{u1, u2, u3} α β γ f s t))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {f : α -> β -> γ} {s : Set.{u3} α} {t : Set.{u2} β} {a : α} {b : β}, (Membership.mem.{u3, u3} α (Set.{u3} α) (Set.instMembershipSet.{u3} α) a s) -> (Membership.mem.{u2, u2} β (Set.{u2} β) (Set.instMembershipSet.{u2} β) b t) -> (Membership.mem.{u1, u1} γ (Set.{u1} γ) (Set.instMembershipSet.{u1} γ) (f a b) (Set.image2.{u3, u2, u1} α β γ f s t))
-Case conversion may be inaccurate. Consider using '#align set.mem_image2_of_mem Set.mem_image2_of_memₓ'. -/
 theorem mem_image2_of_mem (ha : a ∈ s) (hb : b ∈ t) : f a b ∈ image2 f s t :=
   ⟨a, b, ha, hb, rfl⟩
 #align set.mem_image2_of_mem Set.mem_image2_of_mem
 
-/- warning: set.mem_image2_iff -> Set.mem_image2_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β} {a : α} {b : β}, (Function.Injective2.{succ u1, succ u2, succ u3} α β γ f) -> (Iff (Membership.Mem.{u3, u3} γ (Set.{u3} γ) (Set.hasMem.{u3} γ) (f a b) (Set.image2.{u1, u2, u3} α β γ f s t)) (And (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) (Membership.Mem.{u2, u2} β (Set.{u2} β) (Set.hasMem.{u2} β) b t)))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {f : α -> β -> γ} {s : Set.{u3} α} {t : Set.{u2} β} {a : α} {b : β}, (Function.Injective2.{succ u3, succ u2, succ u1} α β γ f) -> (Iff (Membership.mem.{u1, u1} γ (Set.{u1} γ) (Set.instMembershipSet.{u1} γ) (f a b) (Set.image2.{u3, u2, u1} α β γ f s t)) (And (Membership.mem.{u3, u3} α (Set.{u3} α) (Set.instMembershipSet.{u3} α) a s) (Membership.mem.{u2, u2} β (Set.{u2} β) (Set.instMembershipSet.{u2} β) b t)))
-Case conversion may be inaccurate. Consider using '#align set.mem_image2_iff Set.mem_image2_iffₓ'. -/
 theorem mem_image2_iff (hf : Injective2 f) : f a b ∈ image2 f s t ↔ a ∈ s ∧ b ∈ t :=
   ⟨by rintro ⟨a', b', ha', hb', h⟩; rcases hf h with ⟨rfl, rfl⟩; exact ⟨ha', hb'⟩, fun ⟨ha, hb⟩ =>
     mem_image2_of_mem ha hb⟩
 #align set.mem_image2_iff Set.mem_image2_iff
 
-/- warning: set.image2_subset -> Set.image2_subset is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {s' : Set.{u1} α} {t : Set.{u2} β} {t' : Set.{u2} β}, (HasSubset.Subset.{u1} (Set.{u1} α) (Set.hasSubset.{u1} α) s s') -> (HasSubset.Subset.{u2} (Set.{u2} β) (Set.hasSubset.{u2} β) t t') -> (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) (Set.image2.{u1, u2, u3} α β γ f s' t'))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {f : α -> β -> γ} {s : Set.{u3} α} {s' : Set.{u3} α} {t : Set.{u2} β} {t' : Set.{u2} β}, (HasSubset.Subset.{u3} (Set.{u3} α) (Set.instHasSubsetSet.{u3} α) s s') -> (HasSubset.Subset.{u2} (Set.{u2} β) (Set.instHasSubsetSet.{u2} β) t t') -> (HasSubset.Subset.{u1} (Set.{u1} γ) (Set.instHasSubsetSet.{u1} γ) (Set.image2.{u3, u2, u1} α β γ f s t) (Set.image2.{u3, u2, u1} α β γ f s' t'))
-Case conversion may be inaccurate. Consider using '#align set.image2_subset Set.image2_subsetₓ'. -/
 /-- image2 is monotone with respect to `⊆`. -/
 theorem image2_subset (hs : s ⊆ s') (ht : t ⊆ t') : image2 f s t ⊆ image2 f s' t' := by
   rintro _ ⟨a, b, ha, hb, rfl⟩; exact mem_image2_of_mem (hs ha) (ht hb)
 #align set.image2_subset Set.image2_subset
 
-/- warning: set.image2_subset_left -> Set.image2_subset_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β} {t' : Set.{u2} β}, (HasSubset.Subset.{u2} (Set.{u2} β) (Set.hasSubset.{u2} β) t t') -> (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) (Set.image2.{u1, u2, u3} α β γ f s t'))
-but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u3}} {γ : Type.{u2}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u3} β} {t' : Set.{u3} β}, (HasSubset.Subset.{u3} (Set.{u3} β) (Set.instHasSubsetSet.{u3} β) t t') -> (HasSubset.Subset.{u2} (Set.{u2} γ) (Set.instHasSubsetSet.{u2} γ) (Set.image2.{u1, u3, u2} α β γ f s t) (Set.image2.{u1, u3, u2} α β γ f s t'))
-Case conversion may be inaccurate. Consider using '#align set.image2_subset_left Set.image2_subset_leftₓ'. -/
 theorem image2_subset_left (ht : t ⊆ t') : image2 f s t ⊆ image2 f s t' :=
   image2_subset Subset.rfl ht
 #align set.image2_subset_left Set.image2_subset_left
 
-/- warning: set.image2_subset_right -> Set.image2_subset_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {s' : Set.{u1} α} {t : Set.{u2} β}, (HasSubset.Subset.{u1} (Set.{u1} α) (Set.hasSubset.{u1} α) s s') -> (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) (Set.image2.{u1, u2, u3} α β γ f s' t))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} {f : α -> β -> γ} {s : Set.{u3} α} {s' : Set.{u3} α} {t : Set.{u1} β}, (HasSubset.Subset.{u3} (Set.{u3} α) (Set.instHasSubsetSet.{u3} α) s s') -> (HasSubset.Subset.{u2} (Set.{u2} γ) (Set.instHasSubsetSet.{u2} γ) (Set.image2.{u3, u1, u2} α β γ f s t) (Set.image2.{u3, u1, u2} α β γ f s' t))
-Case conversion may be inaccurate. Consider using '#align set.image2_subset_right Set.image2_subset_rightₓ'. -/
 theorem image2_subset_right (hs : s ⊆ s') : image2 f s t ⊆ image2 f s' t :=
   image2_subset hs Subset.rfl
 #align set.image2_subset_right Set.image2_subset_right
 
-/- warning: set.image_subset_image2_left -> Set.image_subset_image2_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β} {b : β}, (Membership.Mem.{u2, u2} β (Set.{u2} β) (Set.hasMem.{u2} β) b t) -> (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) (Set.image.{u1, u3} α γ (fun (a : α) => f a b) s) (Set.image2.{u1, u2, u3} α β γ f s t))
-but is expected to have type
-  forall {α : Type.{u1}} {β : Type.{u3}} {γ : Type.{u2}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u3} β} {b : β}, (Membership.mem.{u3, u3} β (Set.{u3} β) (Set.instMembershipSet.{u3} β) b t) -> (HasSubset.Subset.{u2} (Set.{u2} γ) (Set.instHasSubsetSet.{u2} γ) (Set.image.{u1, u2} α γ (fun (a : α) => f a b) s) (Set.image2.{u1, u3, u2} α β γ f s t))
-Case conversion may be inaccurate. Consider using '#align set.image_subset_image2_left Set.image_subset_image2_leftₓ'. -/
 theorem image_subset_image2_left (hb : b ∈ t) : (fun a => f a b) '' s ⊆ image2 f s t :=
   ball_image_of_ball fun a ha => mem_image2_of_mem ha hb
 #align set.image_subset_image2_left Set.image_subset_image2_left
 
-/- warning: set.image_subset_image2_right -> Set.image_subset_image2_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β} {a : α}, (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) -> (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) (Set.image.{u2, u3} β γ (f a) t) (Set.image2.{u1, u2, u3} α β γ f s t))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} {f : α -> β -> γ} {s : Set.{u3} α} {t : Set.{u1} β} {a : α}, (Membership.mem.{u3, u3} α (Set.{u3} α) (Set.instMembershipSet.{u3} α) a s) -> (HasSubset.Subset.{u2} (Set.{u2} γ) (Set.instHasSubsetSet.{u2} γ) (Set.image.{u1, u2} β γ (f a) t) (Set.image2.{u3, u1, u2} α β γ f s t))
-Case conversion may be inaccurate. Consider using '#align set.image_subset_image2_right Set.image_subset_image2_rightₓ'. -/
 theorem image_subset_image2_right (ha : a ∈ s) : f a '' t ⊆ image2 f s t :=
   ball_image_of_ball fun b => mem_image2_of_mem ha
 #align set.image_subset_image2_right Set.image_subset_image2_right
 
-/- warning: set.forall_image2_iff -> Set.forall_image2_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β} {p : γ -> Prop}, Iff (forall (z : γ), (Membership.Mem.{u3, u3} γ (Set.{u3} γ) (Set.hasMem.{u3} γ) z (Set.image2.{u1, u2, u3} α β γ f s t)) -> (p z)) (forall (x : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) x s) -> (forall (y : β), (Membership.Mem.{u2, u2} β (Set.{u2} β) (Set.hasMem.{u2} β) y t) -> (p (f x y))))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {t : Set.{u1} β} {p : γ -> Prop}, Iff (forall (z : γ), (Membership.mem.{u3, u3} γ (Set.{u3} γ) (Set.instMembershipSet.{u3} γ) z (Set.image2.{u2, u1, u3} α β γ f s t)) -> (p z)) (forall (x : α), (Membership.mem.{u2, u2} α (Set.{u2} α) (Set.instMembershipSet.{u2} α) x s) -> (forall (y : β), (Membership.mem.{u1, u1} β (Set.{u1} β) (Set.instMembershipSet.{u1} β) y t) -> (p (f x y))))
-Case conversion may be inaccurate. Consider using '#align set.forall_image2_iff Set.forall_image2_iffₓ'. -/
 theorem forall_image2_iff {p : γ → Prop} :
     (∀ z ∈ image2 f s t, p z) ↔ ∀ x ∈ s, ∀ y ∈ t, p (f x y) :=
   ⟨fun h x hx y hy => h _ ⟨x, y, hx, hy, rfl⟩, fun h z ⟨x, y, hx, hy, hz⟩ => hz ▸ h x hx y hy⟩
 #align set.forall_image2_iff Set.forall_image2_iff
 
-/- warning: set.image2_subset_iff -> Set.image2_subset_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β} {u : Set.{u3} γ}, Iff (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) u) (forall (x : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) x s) -> (forall (y : β), (Membership.Mem.{u2, u2} β (Set.{u2} β) (Set.hasMem.{u2} β) y t) -> (Membership.Mem.{u3, u3} γ (Set.{u3} γ) (Set.hasMem.{u3} γ) (f x y) u)))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {t : Set.{u1} β} {u : Set.{u3} γ}, Iff (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.instHasSubsetSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s t) u) (forall (x : α), (Membership.mem.{u2, u2} α (Set.{u2} α) (Set.instMembershipSet.{u2} α) x s) -> (forall (y : β), (Membership.mem.{u1, u1} β (Set.{u1} β) (Set.instMembershipSet.{u1} β) y t) -> (Membership.mem.{u3, u3} γ (Set.{u3} γ) (Set.instMembershipSet.{u3} γ) (f x y) u)))
-Case conversion may be inaccurate. Consider using '#align set.image2_subset_iff Set.image2_subset_iffₓ'. -/
 @[simp]
 theorem image2_subset_iff {u : Set γ} : image2 f s t ⊆ u ↔ ∀ x ∈ s, ∀ y ∈ t, f x y ∈ u :=
   forall_image2_iff
 #align set.image2_subset_iff Set.image2_subset_iff
 
-/- warning: set.image2_subset_iff_left -> Set.image2_subset_iff_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β} {u : Set.{u3} γ}, Iff (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) u) (forall (a : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) -> (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) (Set.image.{u2, u3} β γ (fun (b : β) => f a b) t) u))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {t : Set.{u1} β} {u : Set.{u3} γ}, Iff (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.instHasSubsetSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s t) u) (forall (a : α), (Membership.mem.{u2, u2} α (Set.{u2} α) (Set.instMembershipSet.{u2} α) a s) -> (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.instHasSubsetSet.{u3} γ) (Set.image.{u1, u3} β γ (fun (b : β) => f a b) t) u))
-Case conversion may be inaccurate. Consider using '#align set.image2_subset_iff_left Set.image2_subset_iff_leftₓ'. -/
 theorem image2_subset_iff_left : image2 f s t ⊆ u ↔ ∀ a ∈ s, (fun b => f a b) '' t ⊆ u := by
   simp_rw [image2_subset_iff, image_subset_iff, subset_def, mem_preimage]
 #align set.image2_subset_iff_left Set.image2_subset_iff_left
 
-/- warning: set.image2_subset_iff_right -> Set.image2_subset_iff_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β} {u : Set.{u3} γ}, Iff (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) u) (forall (b : β), (Membership.Mem.{u2, u2} β (Set.{u2} β) (Set.hasMem.{u2} β) b t) -> (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) (Set.image.{u1, u3} α γ (fun (a : α) => f a b) s) u))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {t : Set.{u1} β} {u : Set.{u3} γ}, Iff (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.instHasSubsetSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s t) u) (forall (b : β), (Membership.mem.{u1, u1} β (Set.{u1} β) (Set.instMembershipSet.{u1} β) b t) -> (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.instHasSubsetSet.{u3} γ) (Set.image.{u2, u3} α γ (fun (a : α) => f a b) s) u))
-Case conversion may be inaccurate. Consider using '#align set.image2_subset_iff_right Set.image2_subset_iff_rightₓ'. -/
 theorem image2_subset_iff_right : image2 f s t ⊆ u ↔ ∀ b ∈ t, (fun a => f a b) '' s ⊆ u := by
   simp_rw [image2_subset_iff, image_subset_iff, subset_def, mem_preimage, @forall₂_swap α]
 #align set.image2_subset_iff_right Set.image2_subset_iff_right
 
 variable (f)
 
-/- warning: set.image_prod -> Set.image_prod is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) {s : Set.{u1} α} {t : Set.{u2} β}, Eq.{succ u3} (Set.{u3} γ) (Set.image.{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} α β s t)) (Set.image2.{u1, u2, u3} α β γ f s t)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} (f : α -> β -> γ) {s : Set.{u2} α} {t : Set.{u1} β}, Eq.{succ u3} (Set.{u3} γ) (Set.image.{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} α β s t)) (Set.image2.{u2, u1, u3} α β γ f s t)
-Case conversion may be inaccurate. Consider using '#align set.image_prod Set.image_prodₓ'. -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 @[simp]
 theorem image_prod : (fun x : α × β => f x.1 x.2) '' s ×ˢ t = image2 f s t :=
@@ -187,60 +109,30 @@ theorem image_prod : (fun x : α × β => f x.1 x.2) '' s ×ˢ t = image2 f s t
       rintro ⟨_, _, _, _, rfl⟩; exact ⟨(_, _), ⟨‹_›, ‹_›⟩, rfl⟩⟩
 #align set.image_prod Set.image_prod
 
-/- warning: set.image_uncurry_prod -> Set.image_uncurry_prod is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (s : Set.{u1} α) (t : Set.{u2} β), Eq.{succ u3} (Set.{u3} γ) (Set.image.{max u1 u2, u3} (Prod.{u1, u2} α β) γ (Function.uncurry.{u1, u2, u3} α β γ f) (Set.prod.{u1, u2} α β s t)) (Set.image2.{u1, u2, u3} α β γ f s t)
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : α -> β -> γ) (s : Set.{u3} α) (t : Set.{u2} β), Eq.{succ u1} (Set.{u1} γ) (Set.image.{max u2 u3, u1} (Prod.{u3, u2} α β) γ (Function.uncurry.{u3, u2, u1} α β γ f) (Set.prod.{u3, u2} α β s t)) (Set.image2.{u3, u2, u1} α β γ f s t)
-Case conversion may be inaccurate. Consider using '#align set.image_uncurry_prod Set.image_uncurry_prodₓ'. -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 @[simp]
 theorem image_uncurry_prod (s : Set α) (t : Set β) : uncurry f '' s ×ˢ t = image2 f s t :=
   image_prod _
 #align set.image_uncurry_prod Set.image_uncurry_prod
 
-/- warning: set.image2_mk_eq_prod -> Set.image2_mk_eq_prod is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {s : Set.{u1} α} {t : Set.{u2} β}, Eq.{succ (max u1 u2)} (Set.{max u1 u2} (Prod.{u1, u2} α β)) (Set.image2.{u1, u2, max u1 u2} α β (Prod.{u1, u2} α β) (Prod.mk.{u1, u2} α β) s t) (Set.prod.{u1, u2} α β s t)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {s : Set.{u2} α} {t : Set.{u1} β}, Eq.{max (succ u2) (succ u1)} (Set.{max u1 u2} (Prod.{u2, u1} α β)) (Set.image2.{u2, u1, max u1 u2} α β (Prod.{u2, u1} α β) (Prod.mk.{u2, u1} α β) s t) (Set.prod.{u2, u1} α β s t)
-Case conversion may be inaccurate. Consider using '#align set.image2_mk_eq_prod Set.image2_mk_eq_prodₓ'. -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 @[simp]
 theorem image2_mk_eq_prod : image2 Prod.mk s t = s ×ˢ t :=
   ext <| by simp
 #align set.image2_mk_eq_prod Set.image2_mk_eq_prod
 
-/- warning: set.image2_curry -> Set.image2_curry is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : (Prod.{u1, u2} α β) -> γ) (s : Set.{u1} α) (t : Set.{u2} β), Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u1, u2, u3} α β γ (fun (a : α) (b : β) => f (Prod.mk.{u1, u2} α β a b)) s t) (Set.image.{max u1 u2, u3} (Prod.{u1, u2} α β) γ f (Set.prod.{u1, u2} α β s t))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : (Prod.{u3, u2} α β) -> γ) (s : Set.{u3} α) (t : Set.{u2} β), Eq.{succ u1} (Set.{u1} γ) (Set.image2.{u3, u2, u1} α β γ (fun (a : α) (b : β) => f (Prod.mk.{u3, u2} α β a b)) s t) (Set.image.{max u3 u2, u1} (Prod.{u3, u2} α β) γ f (Set.prod.{u3, u2} α β s t))
-Case conversion may be inaccurate. Consider using '#align set.image2_curry Set.image2_curryₓ'. -/
 /- ./././Mathport/Syntax/Translate/Expr.lean:177:8: unsupported: ambiguous notation -/
 @[simp]
 theorem image2_curry (f : α × β → γ) (s : Set α) (t : Set β) :
     image2 (fun a b => f (a, b)) s t = f '' s ×ˢ t := by simp [← image_uncurry_prod, uncurry]
 #align set.image2_curry Set.image2_curry
 
-/- warning: set.image2_swap -> Set.image2_swap is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (s : Set.{u1} α) (t : Set.{u2} β), Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) (Set.image2.{u2, u1, u3} β α γ (fun (a : β) (b : α) => f b a) t s)
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : α -> β -> γ) (s : Set.{u3} α) (t : Set.{u2} β), Eq.{succ u1} (Set.{u1} γ) (Set.image2.{u3, u2, u1} α β γ f s t) (Set.image2.{u2, u3, u1} β α γ (fun (a : β) (b : α) => f b a) t s)
-Case conversion may be inaccurate. Consider using '#align set.image2_swap Set.image2_swapₓ'. -/
 theorem image2_swap (s : Set α) (t : Set β) : image2 f s t = image2 (fun a b => f b a) t s := by
   ext; constructor <;> rintro ⟨a, b, ha, hb, rfl⟩ <;> refine' ⟨b, a, hb, ha, rfl⟩
 #align set.image2_swap Set.image2_swap
 
 variable {f}
 
-/- warning: set.image2_union_left -> Set.image2_union_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {s' : Set.{u1} α} {t : Set.{u2} β}, Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s s') t) (Union.union.{u3} (Set.{u3} γ) (Set.hasUnion.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) (Set.image2.{u1, u2, u3} α β γ f s' t))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {s' : Set.{u2} α} {t : Set.{u1} β}, Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f (Union.union.{u2} (Set.{u2} α) (Set.instUnionSet.{u2} α) s s') t) (Union.union.{u3} (Set.{u3} γ) (Set.instUnionSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s t) (Set.image2.{u2, u1, u3} α β γ f s' t))
-Case conversion may be inaccurate. Consider using '#align set.image2_union_left Set.image2_union_leftₓ'. -/
 theorem image2_union_left : image2 f (s ∪ s') t = image2 f s t ∪ image2 f s' t :=
   by
   ext c
@@ -251,202 +143,88 @@ theorem image2_union_left : image2 f (s ∪ s') t = image2 f s t ∪ image2 f s'
       simp [mem_union, *]
 #align set.image2_union_left Set.image2_union_left
 
-/- warning: set.image2_union_right -> Set.image2_union_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β} {t' : Set.{u2} β}, Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s (Union.union.{u2} (Set.{u2} β) (Set.hasUnion.{u2} β) t t')) (Union.union.{u3} (Set.{u3} γ) (Set.hasUnion.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) (Set.image2.{u1, u2, u3} α β γ f s t'))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {t : Set.{u1} β} {t' : Set.{u1} β}, Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s (Union.union.{u1} (Set.{u1} β) (Set.instUnionSet.{u1} β) t t')) (Union.union.{u3} (Set.{u3} γ) (Set.instUnionSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s t) (Set.image2.{u2, u1, u3} α β γ f s t'))
-Case conversion may be inaccurate. Consider using '#align set.image2_union_right Set.image2_union_rightₓ'. -/
 theorem image2_union_right : image2 f s (t ∪ t') = image2 f s t ∪ image2 f s t' := by
   rw [← image2_swap, image2_union_left, image2_swap f, image2_swap f]
 #align set.image2_union_right Set.image2_union_right
 
-/- warning: set.image2_inter_left -> Set.image2_inter_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {s' : Set.{u1} α} {t : Set.{u2} β}, (Function.Injective2.{succ u1, succ u2, succ u3} α β γ f) -> (Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s s') t) (Inter.inter.{u3} (Set.{u3} γ) (Set.hasInter.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) (Set.image2.{u1, u2, u3} α β γ f s' t)))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {f : α -> β -> γ} {s : Set.{u3} α} {s' : Set.{u3} α} {t : Set.{u2} β}, (Function.Injective2.{succ u3, succ u2, succ u1} α β γ f) -> (Eq.{succ u1} (Set.{u1} γ) (Set.image2.{u3, u2, u1} α β γ f (Inter.inter.{u3} (Set.{u3} α) (Set.instInterSet.{u3} α) s s') t) (Inter.inter.{u1} (Set.{u1} γ) (Set.instInterSet.{u1} γ) (Set.image2.{u3, u2, u1} α β γ f s t) (Set.image2.{u3, u2, u1} α β γ f s' t)))
-Case conversion may be inaccurate. Consider using '#align set.image2_inter_left Set.image2_inter_leftₓ'. -/
 theorem image2_inter_left (hf : Injective2 f) :
     image2 f (s ∩ s') t = image2 f s t ∩ image2 f s' t := by
   simp_rw [← image_uncurry_prod, inter_prod, image_inter hf.uncurry]
 #align set.image2_inter_left Set.image2_inter_left
 
-/- warning: set.image2_inter_right -> Set.image2_inter_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β} {t' : Set.{u2} β}, (Function.Injective2.{succ u1, succ u2, succ u3} α β γ f) -> (Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s (Inter.inter.{u2} (Set.{u2} β) (Set.hasInter.{u2} β) t t')) (Inter.inter.{u3} (Set.{u3} γ) (Set.hasInter.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) (Set.image2.{u1, u2, u3} α β γ f s t')))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {f : α -> β -> γ} {s : Set.{u3} α} {t : Set.{u2} β} {t' : Set.{u2} β}, (Function.Injective2.{succ u3, succ u2, succ u1} α β γ f) -> (Eq.{succ u1} (Set.{u1} γ) (Set.image2.{u3, u2, u1} α β γ f s (Inter.inter.{u2} (Set.{u2} β) (Set.instInterSet.{u2} β) t t')) (Inter.inter.{u1} (Set.{u1} γ) (Set.instInterSet.{u1} γ) (Set.image2.{u3, u2, u1} α β γ f s t) (Set.image2.{u3, u2, u1} α β γ f s t')))
-Case conversion may be inaccurate. Consider using '#align set.image2_inter_right Set.image2_inter_rightₓ'. -/
 theorem image2_inter_right (hf : Injective2 f) :
     image2 f s (t ∩ t') = image2 f s t ∩ image2 f s t' := by
   simp_rw [← image_uncurry_prod, prod_inter, image_inter hf.uncurry]
 #align set.image2_inter_right Set.image2_inter_right
 
-/- warning: set.image2_empty_left -> Set.image2_empty_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {t : Set.{u2} β}, Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f (EmptyCollection.emptyCollection.{u1} (Set.{u1} α) (Set.hasEmptyc.{u1} α)) t) (EmptyCollection.emptyCollection.{u3} (Set.{u3} γ) (Set.hasEmptyc.{u3} γ))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {t : Set.{u1} β}, Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f (EmptyCollection.emptyCollection.{u2} (Set.{u2} α) (Set.instEmptyCollectionSet.{u2} α)) t) (EmptyCollection.emptyCollection.{u3} (Set.{u3} γ) (Set.instEmptyCollectionSet.{u3} γ))
-Case conversion may be inaccurate. Consider using '#align set.image2_empty_left Set.image2_empty_leftₓ'. -/
 @[simp]
 theorem image2_empty_left : image2 f ∅ t = ∅ :=
   ext <| by simp
 #align set.image2_empty_left Set.image2_empty_left
 
-/- warning: set.image2_empty_right -> Set.image2_empty_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α}, Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s (EmptyCollection.emptyCollection.{u2} (Set.{u2} β) (Set.hasEmptyc.{u2} β))) (EmptyCollection.emptyCollection.{u3} (Set.{u3} γ) (Set.hasEmptyc.{u3} γ))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α}, Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s (EmptyCollection.emptyCollection.{u1} (Set.{u1} β) (Set.instEmptyCollectionSet.{u1} β))) (EmptyCollection.emptyCollection.{u3} (Set.{u3} γ) (Set.instEmptyCollectionSet.{u3} γ))
-Case conversion may be inaccurate. Consider using '#align set.image2_empty_right Set.image2_empty_rightₓ'. -/
 @[simp]
 theorem image2_empty_right : image2 f s ∅ = ∅ :=
   ext <| by simp
 #align set.image2_empty_right Set.image2_empty_right
 
-/- warning: set.nonempty.image2 -> Set.Nonempty.image2 is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β}, (Set.Nonempty.{u1} α s) -> (Set.Nonempty.{u2} β t) -> (Set.Nonempty.{u3} γ (Set.image2.{u1, u2, u3} α β γ f s t))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {f : α -> β -> γ} {s : Set.{u3} α} {t : Set.{u2} β}, (Set.Nonempty.{u3} α s) -> (Set.Nonempty.{u2} β t) -> (Set.Nonempty.{u1} γ (Set.image2.{u3, u2, u1} α β γ f s t))
-Case conversion may be inaccurate. Consider using '#align set.nonempty.image2 Set.Nonempty.image2ₓ'. -/
 theorem Nonempty.image2 : s.Nonempty → t.Nonempty → (image2 f s t).Nonempty :=
   fun ⟨a, ha⟩ ⟨b, hb⟩ => ⟨_, mem_image2_of_mem ha hb⟩
 #align set.nonempty.image2 Set.Nonempty.image2
 
-/- warning: set.image2_nonempty_iff -> Set.image2_nonempty_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β}, Iff (Set.Nonempty.{u3} γ (Set.image2.{u1, u2, u3} α β γ f s t)) (And (Set.Nonempty.{u1} α s) (Set.Nonempty.{u2} β t))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {t : Set.{u1} β}, Iff (Set.Nonempty.{u3} γ (Set.image2.{u2, u1, u3} α β γ f s t)) (And (Set.Nonempty.{u2} α s) (Set.Nonempty.{u1} β t))
-Case conversion may be inaccurate. Consider using '#align set.image2_nonempty_iff Set.image2_nonempty_iffₓ'. -/
 @[simp]
 theorem image2_nonempty_iff : (image2 f s t).Nonempty ↔ s.Nonempty ∧ t.Nonempty :=
   ⟨fun ⟨_, a, b, ha, hb, _⟩ => ⟨⟨a, ha⟩, b, hb⟩, fun h => h.1.image2 h.2⟩
 #align set.image2_nonempty_iff Set.image2_nonempty_iff
 
-/- warning: set.nonempty.of_image2_left -> Set.Nonempty.of_image2_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β}, (Set.Nonempty.{u3} γ (Set.image2.{u1, u2, u3} α β γ f s t)) -> (Set.Nonempty.{u1} α s)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {t : Set.{u1} β}, (Set.Nonempty.{u3} γ (Set.image2.{u2, u1, u3} α β γ f s t)) -> (Set.Nonempty.{u2} α s)
-Case conversion may be inaccurate. Consider using '#align set.nonempty.of_image2_left Set.Nonempty.of_image2_leftₓ'. -/
 theorem Nonempty.of_image2_left (h : (image2 f s t).Nonempty) : s.Nonempty :=
   (image2_nonempty_iff.1 h).1
 #align set.nonempty.of_image2_left Set.Nonempty.of_image2_left
 
-/- warning: set.nonempty.of_image2_right -> Set.Nonempty.of_image2_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β}, (Set.Nonempty.{u3} γ (Set.image2.{u1, u2, u3} α β γ f s t)) -> (Set.Nonempty.{u2} β t)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {t : Set.{u1} β}, (Set.Nonempty.{u3} γ (Set.image2.{u2, u1, u3} α β γ f s t)) -> (Set.Nonempty.{u1} β t)
-Case conversion may be inaccurate. Consider using '#align set.nonempty.of_image2_right Set.Nonempty.of_image2_rightₓ'. -/
 theorem Nonempty.of_image2_right (h : (image2 f s t).Nonempty) : t.Nonempty :=
   (image2_nonempty_iff.1 h).2
 #align set.nonempty.of_image2_right Set.Nonempty.of_image2_right
 
-/- warning: set.image2_eq_empty_iff -> Set.image2_eq_empty_iff is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β}, Iff (Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) (EmptyCollection.emptyCollection.{u3} (Set.{u3} γ) (Set.hasEmptyc.{u3} γ))) (Or (Eq.{succ u1} (Set.{u1} α) s (EmptyCollection.emptyCollection.{u1} (Set.{u1} α) (Set.hasEmptyc.{u1} α))) (Eq.{succ u2} (Set.{u2} β) t (EmptyCollection.emptyCollection.{u2} (Set.{u2} β) (Set.hasEmptyc.{u2} β))))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {t : Set.{u1} β}, Iff (Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s t) (EmptyCollection.emptyCollection.{u3} (Set.{u3} γ) (Set.instEmptyCollectionSet.{u3} γ))) (Or (Eq.{succ u2} (Set.{u2} α) s (EmptyCollection.emptyCollection.{u2} (Set.{u2} α) (Set.instEmptyCollectionSet.{u2} α))) (Eq.{succ u1} (Set.{u1} β) t (EmptyCollection.emptyCollection.{u1} (Set.{u1} β) (Set.instEmptyCollectionSet.{u1} β))))
-Case conversion may be inaccurate. Consider using '#align set.image2_eq_empty_iff Set.image2_eq_empty_iffₓ'. -/
 @[simp]
 theorem image2_eq_empty_iff : image2 f s t = ∅ ↔ s = ∅ ∨ t = ∅ := by
   simp_rw [← not_nonempty_iff_eq_empty, image2_nonempty_iff, not_and_or]
 #align set.image2_eq_empty_iff Set.image2_eq_empty_iff
 
-/- warning: set.image2_inter_subset_left -> Set.image2_inter_subset_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {s' : Set.{u1} α} {t : Set.{u2} β}, HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s s') t) (Inter.inter.{u3} (Set.{u3} γ) (Set.hasInter.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) (Set.image2.{u1, u2, u3} α β γ f s' t))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {s' : Set.{u2} α} {t : Set.{u1} β}, HasSubset.Subset.{u3} (Set.{u3} γ) (Set.instHasSubsetSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f (Inter.inter.{u2} (Set.{u2} α) (Set.instInterSet.{u2} α) s s') t) (Inter.inter.{u3} (Set.{u3} γ) (Set.instInterSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s t) (Set.image2.{u2, u1, u3} α β γ f s' t))
-Case conversion may be inaccurate. Consider using '#align set.image2_inter_subset_left Set.image2_inter_subset_leftₓ'. -/
 theorem image2_inter_subset_left : image2 f (s ∩ s') t ⊆ image2 f s t ∩ image2 f s' t := by
   rintro _ ⟨a, b, ⟨h1a, h2a⟩, hb, rfl⟩; constructor <;> exact ⟨_, _, ‹_›, ‹_›, rfl⟩
 #align set.image2_inter_subset_left Set.image2_inter_subset_left
 
-/- warning: set.image2_inter_subset_right -> Set.image2_inter_subset_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β} {t' : Set.{u2} β}, HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s (Inter.inter.{u2} (Set.{u2} β) (Set.hasInter.{u2} β) t t')) (Inter.inter.{u3} (Set.{u3} γ) (Set.hasInter.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) (Set.image2.{u1, u2, u3} α β γ f s t'))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {t : Set.{u1} β} {t' : Set.{u1} β}, HasSubset.Subset.{u3} (Set.{u3} γ) (Set.instHasSubsetSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s (Inter.inter.{u1} (Set.{u1} β) (Set.instInterSet.{u1} β) t t')) (Inter.inter.{u3} (Set.{u3} γ) (Set.instInterSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s t) (Set.image2.{u2, u1, u3} α β γ f s t'))
-Case conversion may be inaccurate. Consider using '#align set.image2_inter_subset_right Set.image2_inter_subset_rightₓ'. -/
 theorem image2_inter_subset_right : image2 f s (t ∩ t') ⊆ image2 f s t ∩ image2 f s t' := by
   rintro _ ⟨a, b, ha, ⟨h1b, h2b⟩, rfl⟩; constructor <;> exact ⟨_, _, ‹_›, ‹_›, rfl⟩
 #align set.image2_inter_subset_right Set.image2_inter_subset_right
 
-/- warning: set.image2_singleton_left -> Set.image2_singleton_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {t : Set.{u2} β} {a : α}, Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f (Singleton.singleton.{u1, u1} α (Set.{u1} α) (Set.hasSingleton.{u1} α) a) t) (Set.image.{u2, u3} β γ (f a) t)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {t : Set.{u1} β} {a : α}, Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f (Singleton.singleton.{u2, u2} α (Set.{u2} α) (Set.instSingletonSet.{u2} α) a) t) (Set.image.{u1, u3} β γ (f a) t)
-Case conversion may be inaccurate. Consider using '#align set.image2_singleton_left Set.image2_singleton_leftₓ'. -/
 @[simp]
 theorem image2_singleton_left : image2 f {a} t = f a '' t :=
   ext fun x => by simp
 #align set.image2_singleton_left Set.image2_singleton_left
 
-/- warning: set.image2_singleton_right -> Set.image2_singleton_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {b : β}, Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s (Singleton.singleton.{u2, u2} β (Set.{u2} β) (Set.hasSingleton.{u2} β) b)) (Set.image.{u1, u3} α γ (fun (a : α) => f a b) s)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {b : β}, Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s (Singleton.singleton.{u1, u1} β (Set.{u1} β) (Set.instSingletonSet.{u1} β) b)) (Set.image.{u2, u3} α γ (fun (a : α) => f a b) s)
-Case conversion may be inaccurate. Consider using '#align set.image2_singleton_right Set.image2_singleton_rightₓ'. -/
 @[simp]
 theorem image2_singleton_right : image2 f s {b} = (fun a => f a b) '' s :=
   ext fun x => by simp
 #align set.image2_singleton_right Set.image2_singleton_right
 
-/- warning: set.image2_singleton -> Set.image2_singleton is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {a : α} {b : β}, Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f (Singleton.singleton.{u1, u1} α (Set.{u1} α) (Set.hasSingleton.{u1} α) a) (Singleton.singleton.{u2, u2} β (Set.{u2} β) (Set.hasSingleton.{u2} β) b)) (Singleton.singleton.{u3, u3} γ (Set.{u3} γ) (Set.hasSingleton.{u3} γ) (f a b))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {a : α} {b : β}, Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f (Singleton.singleton.{u2, u2} α (Set.{u2} α) (Set.instSingletonSet.{u2} α) a) (Singleton.singleton.{u1, u1} β (Set.{u1} β) (Set.instSingletonSet.{u1} β) b)) (Singleton.singleton.{u3, u3} γ (Set.{u3} γ) (Set.instSingletonSet.{u3} γ) (f a b))
-Case conversion may be inaccurate. Consider using '#align set.image2_singleton Set.image2_singletonₓ'. -/
 theorem image2_singleton : image2 f {a} {b} = {f a b} := by simp
 #align set.image2_singleton Set.image2_singleton
 
-/- warning: set.image2_insert_left -> Set.image2_insert_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β} {a : α}, Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f (Insert.insert.{u1, u1} α (Set.{u1} α) (Set.hasInsert.{u1} α) a s) t) (Union.union.{u3} (Set.{u3} γ) (Set.hasUnion.{u3} γ) (Set.image.{u2, u3} β γ (fun (b : β) => f a b) t) (Set.image2.{u1, u2, u3} α β γ f s t))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {t : Set.{u1} β} {a : α}, Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f (Insert.insert.{u2, u2} α (Set.{u2} α) (Set.instInsertSet.{u2} α) a s) t) (Union.union.{u3} (Set.{u3} γ) (Set.instUnionSet.{u3} γ) (Set.image.{u1, u3} β γ (fun (b : β) => f a b) t) (Set.image2.{u2, u1, u3} α β γ f s t))
-Case conversion may be inaccurate. Consider using '#align set.image2_insert_left Set.image2_insert_leftₓ'. -/
 @[simp]
 theorem image2_insert_left : image2 f (insert a s) t = (fun b => f a b) '' t ∪ image2 f s t := by
   rw [insert_eq, image2_union_left, image2_singleton_left]
 #align set.image2_insert_left Set.image2_insert_left
 
-/- warning: set.image2_insert_right -> Set.image2_insert_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β} {b : β}, Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s (Insert.insert.{u2, u2} β (Set.{u2} β) (Set.hasInsert.{u2} β) b t)) (Union.union.{u3} (Set.{u3} γ) (Set.hasUnion.{u3} γ) (Set.image.{u1, u3} α γ (fun (a : α) => f a b) s) (Set.image2.{u1, u2, u3} α β γ f s t))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {t : Set.{u1} β} {b : β}, Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s (Insert.insert.{u1, u1} β (Set.{u1} β) (Set.instInsertSet.{u1} β) b t)) (Union.union.{u3} (Set.{u3} γ) (Set.instUnionSet.{u3} γ) (Set.image.{u2, u3} α γ (fun (a : α) => f a b) s) (Set.image2.{u2, u1, u3} α β γ f s t))
-Case conversion may be inaccurate. Consider using '#align set.image2_insert_right Set.image2_insert_rightₓ'. -/
 @[simp]
 theorem image2_insert_right : image2 f s (insert b t) = (fun a => f a b) '' s ∪ image2 f s t := by
   rw [insert_eq, image2_union_right, image2_singleton_right]
 #align set.image2_insert_right Set.image2_insert_right
 
-/- warning: set.image2_congr -> Set.image2_congr is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {f' : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β}, (forall (a : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) -> (forall (b : β), (Membership.Mem.{u2, u2} β (Set.{u2} β) (Set.hasMem.{u2} β) b t) -> (Eq.{succ u3} γ (f a b) (f' a b)))) -> (Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) (Set.image2.{u1, u2, u3} α β γ f' s t))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {f : α -> β -> γ} {f' : α -> β -> γ} {s : Set.{u3} α} {t : Set.{u2} β}, (forall (a : α), (Membership.mem.{u3, u3} α (Set.{u3} α) (Set.instMembershipSet.{u3} α) a s) -> (forall (b : β), (Membership.mem.{u2, u2} β (Set.{u2} β) (Set.instMembershipSet.{u2} β) b t) -> (Eq.{succ u1} γ (f a b) (f' a b)))) -> (Eq.{succ u1} (Set.{u1} γ) (Set.image2.{u3, u2, u1} α β γ f s t) (Set.image2.{u3, u2, u1} α β γ f' s t))
-Case conversion may be inaccurate. Consider using '#align set.image2_congr Set.image2_congrₓ'. -/
 @[congr]
 theorem image2_congr (h : ∀ a ∈ s, ∀ b ∈ t, f a b = f' a b) : image2 f s t = image2 f' s t := by
   ext; constructor <;> rintro ⟨a, b, ha, hb, rfl⟩ <;> refine' ⟨a, b, ha, hb, by rw [h a ha b hb]⟩
 #align set.image2_congr Set.image2_congr
 
-/- warning: set.image2_congr' -> Set.image2_congr' is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {f' : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β}, (forall (a : α) (b : β), Eq.{succ u3} γ (f a b) (f' a b)) -> (Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) (Set.image2.{u1, u2, u3} α β γ f' s t))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {f' : α -> β -> γ} {s : Set.{u2} α} {t : Set.{u1} β}, (forall (a : α) (b : β), Eq.{succ u3} γ (f a b) (f' a b)) -> (Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s t) (Set.image2.{u2, u1, u3} α β γ f' s t))
-Case conversion may be inaccurate. Consider using '#align set.image2_congr' Set.image2_congr'ₓ'. -/
 /-- A common special case of `image2_congr` -/
 theorem image2_congr' (h : ∀ a b, f a b = f' a b) : image2 f s t = image2 f' s t :=
   image2_congr fun a _ b _ => h a b
@@ -462,34 +240,16 @@ def image3 (g : α → β → γ → δ) (s : Set α) (t : Set β) (u : Set γ)
 #align set.image3 Set.image3
 -/
 
-/- warning: set.mem_image3 -> Set.mem_image3 is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} {g : α -> β -> γ -> δ} {s : Set.{u1} α} {t : Set.{u2} β} {u : Set.{u3} γ} {d : δ}, Iff (Membership.Mem.{u4, u4} δ (Set.{u4} δ) (Set.hasMem.{u4} δ) d (Set.image3.{u1, u2, u3, u4} α β γ δ g s t u)) (Exists.{succ u1} α (fun (a : α) => Exists.{succ u2} β (fun (b : β) => Exists.{succ u3} γ (fun (c : γ) => And (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) (And (Membership.Mem.{u2, u2} β (Set.{u2} β) (Set.hasMem.{u2} β) b t) (And (Membership.Mem.{u3, u3} γ (Set.{u3} γ) (Set.hasMem.{u3} γ) c u) (Eq.{succ u4} δ (g a b c) d)))))))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {δ : Type.{u4}} {g : α -> β -> γ -> δ} {s : Set.{u3} α} {t : Set.{u2} β} {u : Set.{u1} γ} {d : δ}, Iff (Membership.mem.{u4, u4} δ (Set.{u4} δ) (Set.instMembershipSet.{u4} δ) d (Set.image3.{u3, u2, u1, u4} α β γ δ g s t u)) (Exists.{succ u3} α (fun (a : α) => Exists.{succ u2} β (fun (b : β) => Exists.{succ u1} γ (fun (c : γ) => And (Membership.mem.{u3, u3} α (Set.{u3} α) (Set.instMembershipSet.{u3} α) a s) (And (Membership.mem.{u2, u2} β (Set.{u2} β) (Set.instMembershipSet.{u2} β) b t) (And (Membership.mem.{u1, u1} γ (Set.{u1} γ) (Set.instMembershipSet.{u1} γ) c u) (Eq.{succ u4} δ (g a b c) d)))))))
-Case conversion may be inaccurate. Consider using '#align set.mem_image3 Set.mem_image3ₓ'. -/
 @[simp]
 theorem mem_image3 : d ∈ image3 g s t u ↔ ∃ a b c, a ∈ s ∧ b ∈ t ∧ c ∈ u ∧ g a b c = d :=
   Iff.rfl
 #align set.mem_image3 Set.mem_image3
 
-/- warning: set.image3_mono -> Set.image3_mono is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} {g : α -> β -> γ -> δ} {s : Set.{u1} α} {s' : Set.{u1} α} {t : Set.{u2} β} {t' : Set.{u2} β} {u : Set.{u3} γ} {u' : Set.{u3} γ}, (HasSubset.Subset.{u1} (Set.{u1} α) (Set.hasSubset.{u1} α) s s') -> (HasSubset.Subset.{u2} (Set.{u2} β) (Set.hasSubset.{u2} β) t t') -> (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) u u') -> (HasSubset.Subset.{u4} (Set.{u4} δ) (Set.hasSubset.{u4} δ) (Set.image3.{u1, u2, u3, u4} α β γ δ g s t u) (Set.image3.{u1, u2, u3, u4} α β γ δ g s' t' u'))
-but is expected to have type
-  forall {α : Type.{u4}} {β : Type.{u3}} {γ : Type.{u2}} {δ : Type.{u1}} {g : α -> β -> γ -> δ} {s : Set.{u4} α} {s' : Set.{u4} α} {t : Set.{u3} β} {t' : Set.{u3} β} {u : Set.{u2} γ} {u' : Set.{u2} γ}, (HasSubset.Subset.{u4} (Set.{u4} α) (Set.instHasSubsetSet.{u4} α) s s') -> (HasSubset.Subset.{u3} (Set.{u3} β) (Set.instHasSubsetSet.{u3} β) t t') -> (HasSubset.Subset.{u2} (Set.{u2} γ) (Set.instHasSubsetSet.{u2} γ) u u') -> (HasSubset.Subset.{u1} (Set.{u1} δ) (Set.instHasSubsetSet.{u1} δ) (Set.image3.{u4, u3, u2, u1} α β γ δ g s t u) (Set.image3.{u4, u3, u2, u1} α β γ δ g s' t' u'))
-Case conversion may be inaccurate. Consider using '#align set.image3_mono Set.image3_monoₓ'. -/
 theorem image3_mono (hs : s ⊆ s') (ht : t ⊆ t') (hu : u ⊆ u') :
     image3 g s t u ⊆ image3 g s' t' u' := fun x =>
   Exists₃.imp fun a b c ⟨ha, hb, hc, hx⟩ => ⟨hs ha, ht hb, hu hc, hx⟩
 #align set.image3_mono Set.image3_mono
 
-/- warning: set.image3_congr -> Set.image3_congr is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} {g : α -> β -> γ -> δ} {g' : α -> β -> γ -> δ} {s : Set.{u1} α} {t : Set.{u2} β} {u : Set.{u3} γ}, (forall (a : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) -> (forall (b : β), (Membership.Mem.{u2, u2} β (Set.{u2} β) (Set.hasMem.{u2} β) b t) -> (forall (c : γ), (Membership.Mem.{u3, u3} γ (Set.{u3} γ) (Set.hasMem.{u3} γ) c u) -> (Eq.{succ u4} δ (g a b c) (g' a b c))))) -> (Eq.{succ u4} (Set.{u4} δ) (Set.image3.{u1, u2, u3, u4} α β γ δ g s t u) (Set.image3.{u1, u2, u3, u4} α β γ δ g' s t u))
-but is expected to have type
-  forall {α : Type.{u4}} {β : Type.{u3}} {γ : Type.{u2}} {δ : Type.{u1}} {g : α -> β -> γ -> δ} {g' : α -> β -> γ -> δ} {s : Set.{u4} α} {t : Set.{u3} β} {u : Set.{u2} γ}, (forall (a : α), (Membership.mem.{u4, u4} α (Set.{u4} α) (Set.instMembershipSet.{u4} α) a s) -> (forall (b : β), (Membership.mem.{u3, u3} β (Set.{u3} β) (Set.instMembershipSet.{u3} β) b t) -> (forall (c : γ), (Membership.mem.{u2, u2} γ (Set.{u2} γ) (Set.instMembershipSet.{u2} γ) c u) -> (Eq.{succ u1} δ (g a b c) (g' a b c))))) -> (Eq.{succ u1} (Set.{u1} δ) (Set.image3.{u4, u3, u2, u1} α β γ δ g s t u) (Set.image3.{u4, u3, u2, u1} α β γ δ g' s t u))
-Case conversion may be inaccurate. Consider using '#align set.image3_congr Set.image3_congrₓ'. -/
 @[congr]
 theorem image3_congr (h : ∀ a ∈ s, ∀ b ∈ t, ∀ c ∈ u, g a b c = g' a b c) :
     image3 g s t u = image3 g' s t u := by
@@ -498,23 +258,11 @@ theorem image3_congr (h : ∀ a ∈ s, ∀ b ∈ t, ∀ c ∈ u, g a b c = g' a
     exact ⟨a, b, c, ha, hb, hc, by rw [h a ha b hb c hc]⟩
 #align set.image3_congr Set.image3_congr
 
-/- warning: set.image3_congr' -> Set.image3_congr' is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} {g : α -> β -> γ -> δ} {g' : α -> β -> γ -> δ} {s : Set.{u1} α} {t : Set.{u2} β} {u : Set.{u3} γ}, (forall (a : α) (b : β) (c : γ), Eq.{succ u4} δ (g a b c) (g' a b c)) -> (Eq.{succ u4} (Set.{u4} δ) (Set.image3.{u1, u2, u3, u4} α β γ δ g s t u) (Set.image3.{u1, u2, u3, u4} α β γ δ g' s t u))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {δ : Type.{u4}} {g : α -> β -> γ -> δ} {g' : α -> β -> γ -> δ} {s : Set.{u3} α} {t : Set.{u2} β} {u : Set.{u1} γ}, (forall (a : α) (b : β) (c : γ), Eq.{succ u4} δ (g a b c) (g' a b c)) -> (Eq.{succ u4} (Set.{u4} δ) (Set.image3.{u3, u2, u1, u4} α β γ δ g s t u) (Set.image3.{u3, u2, u1, u4} α β γ δ g' s t u))
-Case conversion may be inaccurate. Consider using '#align set.image3_congr' Set.image3_congr'ₓ'. -/
 /-- A common special case of `image3_congr` -/
 theorem image3_congr' (h : ∀ a b c, g a b c = g' a b c) : image3 g s t u = image3 g' s t u :=
   image3_congr fun a _ b _ c _ => h a b c
 #align set.image3_congr' Set.image3_congr'
 
-/- warning: set.image2_image2_left -> Set.image2_image2_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} {ε : Type.{u5}} {s : Set.{u1} α} {t : Set.{u2} β} {u : Set.{u3} γ} (f : δ -> γ -> ε) (g : α -> β -> δ), Eq.{succ u5} (Set.{u5} ε) (Set.image2.{u4, u3, u5} δ γ ε f (Set.image2.{u1, u2, u4} α β δ g s t) u) (Set.image3.{u1, u2, u3, u5} α β γ ε (fun (a : α) (b : β) (c : γ) => f (g a b) c) s t u)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {δ : Type.{u4}} {ε : Type.{u5}} {s : Set.{u2} α} {t : Set.{u1} β} {u : Set.{u3} γ} (f : δ -> γ -> ε) (g : α -> β -> δ), Eq.{succ u5} (Set.{u5} ε) (Set.image2.{u4, u3, u5} δ γ ε f (Set.image2.{u2, u1, u4} α β δ g s t) u) (Set.image3.{u2, u1, u3, u5} α β γ ε (fun (a : α) (b : β) (c : γ) => f (g a b) c) s t u)
-Case conversion may be inaccurate. Consider using '#align set.image2_image2_left Set.image2_image2_leftₓ'. -/
 theorem image2_image2_left (f : δ → γ → ε) (g : α → β → δ) :
     image2 f (image2 g s t) u = image3 (fun a b c => f (g a b) c) s t u :=
   by
@@ -523,12 +271,6 @@ theorem image2_image2_left (f : δ → γ → ε) (g : α → β → δ) :
   · rintro ⟨a, b, c, ha, hb, hc, rfl⟩; refine' ⟨_, c, ⟨a, b, ha, hb, rfl⟩, hc, rfl⟩
 #align set.image2_image2_left Set.image2_image2_left
 
-/- warning: set.image2_image2_right -> Set.image2_image2_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} {ε : Type.{u5}} {s : Set.{u1} α} {t : Set.{u2} β} {u : Set.{u3} γ} (f : α -> δ -> ε) (g : β -> γ -> δ), Eq.{succ u5} (Set.{u5} ε) (Set.image2.{u1, u4, u5} α δ ε f s (Set.image2.{u2, u3, u4} β γ δ g t u)) (Set.image3.{u1, u2, u3, u5} α β γ ε (fun (a : α) (b : β) (c : γ) => f a (g b c)) s t u)
-but is expected to have type
-  forall {α : Type.{u4}} {β : Type.{u2}} {γ : Type.{u1}} {δ : Type.{u3}} {ε : Type.{u5}} {s : Set.{u4} α} {t : Set.{u2} β} {u : Set.{u1} γ} (f : α -> δ -> ε) (g : β -> γ -> δ), Eq.{succ u5} (Set.{u5} ε) (Set.image2.{u4, u3, u5} α δ ε f s (Set.image2.{u2, u1, u3} β γ δ g t u)) (Set.image3.{u4, u2, u1, u5} α β γ ε (fun (a : α) (b : β) (c : γ) => f a (g b c)) s t u)
-Case conversion may be inaccurate. Consider using '#align set.image2_image2_right Set.image2_image2_rightₓ'. -/
 theorem image2_image2_right (f : α → δ → ε) (g : β → γ → δ) :
     image2 f s (image2 g t u) = image3 (fun a b c => f a (g b c)) s t u :=
   by
@@ -537,12 +279,6 @@ theorem image2_image2_right (f : α → δ → ε) (g : β → γ → δ) :
   · rintro ⟨a, b, c, ha, hb, hc, rfl⟩; refine' ⟨a, _, ha, ⟨b, c, hb, hc, rfl⟩, rfl⟩
 #align set.image2_image2_right Set.image2_image2_right
 
-/- warning: set.image_image2 -> Set.image_image2 is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} {s : Set.{u1} α} {t : Set.{u2} β} (f : α -> β -> γ) (g : γ -> δ), Eq.{succ u4} (Set.{u4} δ) (Set.image.{u3, u4} γ δ g (Set.image2.{u1, u2, u3} α β γ f s t)) (Set.image2.{u1, u2, u4} α β δ (fun (a : α) (b : β) => g (f a b)) s t)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {δ : Type.{u4}} {s : Set.{u2} α} {t : Set.{u1} β} (f : α -> β -> γ) (g : γ -> δ), Eq.{succ u4} (Set.{u4} δ) (Set.image.{u3, u4} γ δ g (Set.image2.{u2, u1, u3} α β γ f s t)) (Set.image2.{u2, u1, u4} α β δ (fun (a : α) (b : β) => g (f a b)) s t)
-Case conversion may be inaccurate. Consider using '#align set.image_image2 Set.image_image2ₓ'. -/
 theorem image_image2 (f : α → β → γ) (g : γ → δ) :
     g '' image2 f s t = image2 (fun a b => g (f a b)) s t :=
   by
@@ -561,12 +297,6 @@ theorem image2_image_left (f : γ → β → δ) (g : α → γ) :
 #align set.image2_image_left Set.image2_image_left
 -/
 
-/- warning: set.image2_image_right -> Set.image2_image_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} {s : Set.{u1} α} {t : Set.{u2} β} (f : α -> γ -> δ) (g : β -> γ), Eq.{succ u4} (Set.{u4} δ) (Set.image2.{u1, u3, u4} α γ δ f s (Set.image.{u2, u3} β γ g t)) (Set.image2.{u1, u2, u4} α β δ (fun (a : α) (b : β) => f a (g b)) s t)
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u1}} {γ : Type.{u2}} {δ : Type.{u4}} {s : Set.{u3} α} {t : Set.{u1} β} (f : α -> γ -> δ) (g : β -> γ), Eq.{succ u4} (Set.{u4} δ) (Set.image2.{u3, u2, u4} α γ δ f s (Set.image.{u1, u2} β γ g t)) (Set.image2.{u3, u1, u4} α β δ (fun (a : α) (b : β) => f a (g b)) s t)
-Case conversion may be inaccurate. Consider using '#align set.image2_image_right Set.image2_image_rightₓ'. -/
 theorem image2_image_right (f : α → γ → δ) (g : β → γ) :
     image2 f s (g '' t) = image2 (fun a b => f a (g b)) s t :=
   by
@@ -582,69 +312,33 @@ theorem image2_left (h : t.Nonempty) : image2 (fun x y => x) s t = s := by
 #align set.image2_left Set.image2_left
 -/
 
-/- warning: set.image2_right -> Set.image2_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {s : Set.{u1} α} {t : Set.{u2} β}, (Set.Nonempty.{u1} α s) -> (Eq.{succ u2} (Set.{u2} β) (Set.image2.{u1, u2, u2} α β β (fun (x : α) (y : β) => y) s t) t)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {s : Set.{u2} α} {t : Set.{u1} β}, (Set.Nonempty.{u2} α s) -> (Eq.{succ u1} (Set.{u1} β) (Set.image2.{u2, u1, u1} α β β (fun (x : α) (y : β) => y) s t) t)
-Case conversion may be inaccurate. Consider using '#align set.image2_right Set.image2_rightₓ'. -/
 @[simp]
 theorem image2_right (h : s.Nonempty) : image2 (fun x y => y) s t = t := by
   simp [nonempty_def.mp h, ext_iff]
 #align set.image2_right Set.image2_right
 
-/- warning: set.image2_assoc -> Set.image2_assoc is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} {ε : Type.{u5}} {ε' : Type.{u6}} {s : Set.{u1} α} {t : Set.{u2} β} {u : Set.{u3} γ} {f : δ -> γ -> ε} {g : α -> β -> δ} {f' : α -> ε' -> ε} {g' : β -> γ -> ε'}, (forall (a : α) (b : β) (c : γ), Eq.{succ u5} ε (f (g a b) c) (f' a (g' b c))) -> (Eq.{succ u5} (Set.{u5} ε) (Set.image2.{u4, u3, u5} δ γ ε f (Set.image2.{u1, u2, u4} α β δ g s t) u) (Set.image2.{u1, u6, u5} α ε' ε f' s (Set.image2.{u2, u3, u6} β γ ε' g' t u)))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u4}} {δ : Type.{u5}} {ε : Type.{u6}} {ε' : Type.{u1}} {s : Set.{u3} α} {t : Set.{u2} β} {u : Set.{u4} γ} {f : δ -> γ -> ε} {g : α -> β -> δ} {f' : α -> ε' -> ε} {g' : β -> γ -> ε'}, (forall (a : α) (b : β) (c : γ), Eq.{succ u6} ε (f (g a b) c) (f' a (g' b c))) -> (Eq.{succ u6} (Set.{u6} ε) (Set.image2.{u5, u4, u6} δ γ ε f (Set.image2.{u3, u2, u5} α β δ g s t) u) (Set.image2.{u3, u1, u6} α ε' ε f' s (Set.image2.{u2, u4, u1} β γ ε' g' t u)))
-Case conversion may be inaccurate. Consider using '#align set.image2_assoc Set.image2_assocₓ'. -/
 theorem image2_assoc {f : δ → γ → ε} {g : α → β → δ} {f' : α → ε' → ε} {g' : β → γ → ε'}
     (h_assoc : ∀ a b c, f (g a b) c = f' a (g' b c)) :
     image2 f (image2 g s t) u = image2 f' s (image2 g' t u) := by
   simp only [image2_image2_left, image2_image2_right, h_assoc]
 #align set.image2_assoc Set.image2_assoc
 
-/- warning: set.image2_comm -> Set.image2_comm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β} {g : β -> α -> γ}, (forall (a : α) (b : β), Eq.{succ u3} γ (f a b) (g b a)) -> (Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) (Set.image2.{u2, u1, u3} β α γ g t s))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {t : Set.{u1} β} {g : β -> α -> γ}, (forall (a : α) (b : β), Eq.{succ u3} γ (f a b) (g b a)) -> (Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s t) (Set.image2.{u1, u2, u3} β α γ g t s))
-Case conversion may be inaccurate. Consider using '#align set.image2_comm Set.image2_commₓ'. -/
 theorem image2_comm {g : β → α → γ} (h_comm : ∀ a b, f a b = g b a) : image2 f s t = image2 g t s :=
   (image2_swap _ _ _).trans <| by simp_rw [h_comm]
 #align set.image2_comm Set.image2_comm
 
-/- warning: set.image2_left_comm -> Set.image2_left_comm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} {δ' : Type.{u5}} {ε : Type.{u6}} {s : Set.{u1} α} {t : Set.{u2} β} {u : Set.{u3} γ} {f : α -> δ -> ε} {g : β -> γ -> δ} {f' : α -> γ -> δ'} {g' : β -> δ' -> ε}, (forall (a : α) (b : β) (c : γ), Eq.{succ u6} ε (f a (g b c)) (g' b (f' a c))) -> (Eq.{succ u6} (Set.{u6} ε) (Set.image2.{u1, u4, u6} α δ ε f s (Set.image2.{u2, u3, u4} β γ δ g t u)) (Set.image2.{u2, u5, u6} β δ' ε g' t (Set.image2.{u1, u3, u5} α γ δ' f' s u)))
-but is expected to have type
-  forall {α : Type.{u5}} {β : Type.{u3}} {γ : Type.{u2}} {δ : Type.{u4}} {δ' : Type.{u1}} {ε : Type.{u6}} {s : Set.{u5} α} {t : Set.{u3} β} {u : Set.{u2} γ} {f : α -> δ -> ε} {g : β -> γ -> δ} {f' : α -> γ -> δ'} {g' : β -> δ' -> ε}, (forall (a : α) (b : β) (c : γ), Eq.{succ u6} ε (f a (g b c)) (g' b (f' a c))) -> (Eq.{succ u6} (Set.{u6} ε) (Set.image2.{u5, u4, u6} α δ ε f s (Set.image2.{u3, u2, u4} β γ δ g t u)) (Set.image2.{u3, u1, u6} β δ' ε g' t (Set.image2.{u5, u2, u1} α γ δ' f' s u)))
-Case conversion may be inaccurate. Consider using '#align set.image2_left_comm Set.image2_left_commₓ'. -/
 theorem image2_left_comm {f : α → δ → ε} {g : β → γ → δ} {f' : α → γ → δ'} {g' : β → δ' → ε}
     (h_left_comm : ∀ a b c, f a (g b c) = g' b (f' a c)) :
     image2 f s (image2 g t u) = image2 g' t (image2 f' s u) := by
   rw [image2_swap f', image2_swap f]; exact image2_assoc fun _ _ _ => h_left_comm _ _ _
 #align set.image2_left_comm Set.image2_left_comm
 
-/- warning: set.image2_right_comm -> Set.image2_right_comm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} {δ' : Type.{u5}} {ε : Type.{u6}} {s : Set.{u1} α} {t : Set.{u2} β} {u : Set.{u3} γ} {f : δ -> γ -> ε} {g : α -> β -> δ} {f' : α -> γ -> δ'} {g' : δ' -> β -> ε}, (forall (a : α) (b : β) (c : γ), Eq.{succ u6} ε (f (g a b) c) (g' (f' a c) b)) -> (Eq.{succ u6} (Set.{u6} ε) (Set.image2.{u4, u3, u6} δ γ ε f (Set.image2.{u1, u2, u4} α β δ g s t) u) (Set.image2.{u5, u2, u6} δ' β ε g' (Set.image2.{u1, u3, u5} α γ δ' f' s u) t))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u4}} {δ : Type.{u5}} {δ' : Type.{u1}} {ε : Type.{u6}} {s : Set.{u3} α} {t : Set.{u2} β} {u : Set.{u4} γ} {f : δ -> γ -> ε} {g : α -> β -> δ} {f' : α -> γ -> δ'} {g' : δ' -> β -> ε}, (forall (a : α) (b : β) (c : γ), Eq.{succ u6} ε (f (g a b) c) (g' (f' a c) b)) -> (Eq.{succ u6} (Set.{u6} ε) (Set.image2.{u5, u4, u6} δ γ ε f (Set.image2.{u3, u2, u5} α β δ g s t) u) (Set.image2.{u1, u2, u6} δ' β ε g' (Set.image2.{u3, u4, u1} α γ δ' f' s u) t))
-Case conversion may be inaccurate. Consider using '#align set.image2_right_comm Set.image2_right_commₓ'. -/
 theorem image2_right_comm {f : δ → γ → ε} {g : α → β → δ} {f' : α → γ → δ'} {g' : δ' → β → ε}
     (h_right_comm : ∀ a b c, f (g a b) c = g' (f' a c) b) :
     image2 f (image2 g s t) u = image2 g' (image2 f' s u) t := by
   rw [image2_swap g, image2_swap g']; exact image2_assoc fun _ _ _ => h_right_comm _ _ _
 #align set.image2_right_comm Set.image2_right_comm
 
-/- warning: set.image2_image2_image2_comm -> Set.image2_image2_image2_comm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} {ε : Type.{u5}} {ε' : Type.{u6}} {ζ : Type.{u7}} {ζ' : Type.{u8}} {ν : Type.{u9}} {s : Set.{u1} α} {t : Set.{u2} β} {u : Set.{u3} γ} {v : Set.{u4} δ} {f : ε -> ζ -> ν} {g : α -> β -> ε} {h : γ -> δ -> ζ} {f' : ε' -> ζ' -> ν} {g' : α -> γ -> ε'} {h' : β -> δ -> ζ'}, (forall (a : α) (b : β) (c : γ) (d : δ), Eq.{succ u9} ν (f (g a b) (h c d)) (f' (g' a c) (h' b d))) -> (Eq.{succ u9} (Set.{u9} ν) (Set.image2.{u5, u7, u9} ε ζ ν f (Set.image2.{u1, u2, u5} α β ε g s t) (Set.image2.{u3, u4, u7} γ δ ζ h u v)) (Set.image2.{u6, u8, u9} ε' ζ' ν f' (Set.image2.{u1, u3, u6} α γ ε' g' s u) (Set.image2.{u2, u4, u8} β δ ζ' h' t v)))
-but is expected to have type
-  forall {α : Type.{u6}} {β : Type.{u5}} {γ : Type.{u4}} {δ : Type.{u3}} {ε : Type.{u8}} {ε' : Type.{u2}} {ζ : Type.{u7}} {ζ' : Type.{u1}} {ν : Type.{u9}} {s : Set.{u6} α} {t : Set.{u5} β} {u : Set.{u4} γ} {v : Set.{u3} δ} {f : ε -> ζ -> ν} {g : α -> β -> ε} {h : γ -> δ -> ζ} {f' : ε' -> ζ' -> ν} {g' : α -> γ -> ε'} {h' : β -> δ -> ζ'}, (forall (a : α) (b : β) (c : γ) (d : δ), Eq.{succ u9} ν (f (g a b) (h c d)) (f' (g' a c) (h' b d))) -> (Eq.{succ u9} (Set.{u9} ν) (Set.image2.{u8, u7, u9} ε ζ ν f (Set.image2.{u6, u5, u8} α β ε g s t) (Set.image2.{u4, u3, u7} γ δ ζ h u v)) (Set.image2.{u2, u1, u9} ε' ζ' ν f' (Set.image2.{u6, u4, u2} α γ ε' g' s u) (Set.image2.{u5, u3, u1} β δ ζ' h' t v)))
-Case conversion may be inaccurate. Consider using '#align set.image2_image2_image2_comm Set.image2_image2_image2_commₓ'. -/
 theorem image2_image2_image2_comm {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)) :
@@ -658,24 +352,12 @@ theorem image2_image2_image2_comm {f : ε → ζ → ν} {g : α → β → ε}
     exact ⟨_, _, ⟨a, b, ha, hb, rfl⟩, ⟨c, d, hc, hd, rfl⟩, h_comm _ _ _ _⟩
 #align set.image2_image2_image2_comm Set.image2_image2_image2_comm
 
-/- warning: set.image_image2_distrib -> Set.image_image2_distrib is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {β' : Type.{u4}} {γ : Type.{u5}} {δ : Type.{u6}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u3} β} {g : γ -> δ} {f' : α' -> β' -> δ} {g₁ : α -> α'} {g₂ : β -> β'}, (forall (a : α) (b : β), Eq.{succ u6} δ (g (f a b)) (f' (g₁ a) (g₂ b))) -> (Eq.{succ u6} (Set.{u6} δ) (Set.image.{u5, u6} γ δ g (Set.image2.{u1, u3, u5} α β γ f s t)) (Set.image2.{u2, u4, u6} α' β' δ f' (Set.image.{u1, u2} α α' g₁ s) (Set.image.{u3, u4} β β' g₂ t)))
-but is expected to have type
-  forall {α : Type.{u4}} {α' : Type.{u2}} {β : Type.{u3}} {β' : Type.{u1}} {γ : Type.{u5}} {δ : Type.{u6}} {f : α -> β -> γ} {s : Set.{u4} α} {t : Set.{u3} β} {g : γ -> δ} {f' : α' -> β' -> δ} {g₁ : α -> α'} {g₂ : β -> β'}, (forall (a : α) (b : β), Eq.{succ u6} δ (g (f a b)) (f' (g₁ a) (g₂ b))) -> (Eq.{succ u6} (Set.{u6} δ) (Set.image.{u5, u6} γ δ g (Set.image2.{u4, u3, u5} α β γ f s t)) (Set.image2.{u2, u1, u6} α' β' δ f' (Set.image.{u4, u2} α α' g₁ s) (Set.image.{u3, u1} β β' g₂ t)))
-Case conversion may be inaccurate. Consider using '#align set.image_image2_distrib Set.image_image2_distribₓ'. -/
 theorem image_image2_distrib {g : γ → δ} {f' : α' → β' → δ} {g₁ : α → α'} {g₂ : β → β'}
     (h_distrib : ∀ a b, g (f a b) = f' (g₁ a) (g₂ b)) :
     (image2 f s t).image g = image2 f' (s.image g₁) (t.image g₂) := by
   simp_rw [image_image2, image2_image_left, image2_image_right, h_distrib]
 #align set.image_image2_distrib Set.image_image2_distrib
 
-/- warning: set.image_image2_distrib_left -> Set.image_image2_distrib_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u3} β} {g : γ -> δ} {f' : α' -> β -> δ} {g' : α -> α'}, (forall (a : α) (b : β), Eq.{succ u5} δ (g (f a b)) (f' (g' a) b)) -> (Eq.{succ u5} (Set.{u5} δ) (Set.image.{u4, u5} γ δ g (Set.image2.{u1, u3, u4} α β γ f s t)) (Set.image2.{u2, u3, u5} α' β δ f' (Set.image.{u1, u2} α α' g' s) t))
-but is expected to have type
-  forall {α : Type.{u3}} {α' : Type.{u1}} {β : Type.{u2}} {γ : Type.{u4}} {δ : Type.{u5}} {f : α -> β -> γ} {s : Set.{u3} α} {t : Set.{u2} β} {g : γ -> δ} {f' : α' -> β -> δ} {g' : α -> α'}, (forall (a : α) (b : β), Eq.{succ u5} δ (g (f a b)) (f' (g' a) b)) -> (Eq.{succ u5} (Set.{u5} δ) (Set.image.{u4, u5} γ δ g (Set.image2.{u3, u2, u4} α β γ f s t)) (Set.image2.{u1, u2, u5} α' β δ f' (Set.image.{u3, u1} α α' g' s) t))
-Case conversion may be inaccurate. Consider using '#align set.image_image2_distrib_left Set.image_image2_distrib_leftₓ'. -/
 /-- Symmetric statement to `set.image2_image_left_comm`. -/
 theorem image_image2_distrib_left {g : γ → δ} {f' : α' → β → δ} {g' : α → α'}
     (h_distrib : ∀ a b, g (f a b) = f' (g' a) b) :
@@ -683,12 +365,6 @@ theorem image_image2_distrib_left {g : γ → δ} {f' : α' → β → δ} {g' :
   (image_image2_distrib h_distrib).trans <| by rw [image_id']
 #align set.image_image2_distrib_left Set.image_image2_distrib_left
 
-/- warning: set.image_image2_distrib_right -> Set.image_image2_distrib_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {β' : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β} {g : γ -> δ} {f' : α -> β' -> δ} {g' : β -> β'}, (forall (a : α) (b : β), Eq.{succ u5} δ (g (f a b)) (f' a (g' b))) -> (Eq.{succ u5} (Set.{u5} δ) (Set.image.{u4, u5} γ δ g (Set.image2.{u1, u2, u4} α β γ f s t)) (Set.image2.{u1, u3, u5} α β' δ f' s (Set.image.{u2, u3} β β' g' t)))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {β' : Type.{u1}} {γ : Type.{u4}} {δ : Type.{u5}} {f : α -> β -> γ} {s : Set.{u3} α} {t : Set.{u2} β} {g : γ -> δ} {f' : α -> β' -> δ} {g' : β -> β'}, (forall (a : α) (b : β), Eq.{succ u5} δ (g (f a b)) (f' a (g' b))) -> (Eq.{succ u5} (Set.{u5} δ) (Set.image.{u4, u5} γ δ g (Set.image2.{u3, u2, u4} α β γ f s t)) (Set.image2.{u3, u1, u5} α β' δ f' s (Set.image.{u2, u1} β β' g' t)))
-Case conversion may be inaccurate. Consider using '#align set.image_image2_distrib_right Set.image_image2_distrib_rightₓ'. -/
 /-- Symmetric statement to `set.image_image2_right_comm`. -/
 theorem image_image2_distrib_right {g : γ → δ} {f' : α → β' → δ} {g' : β → β'}
     (h_distrib : ∀ a b, g (f a b) = f' a (g' b)) :
@@ -696,12 +372,6 @@ theorem image_image2_distrib_right {g : γ → δ} {f' : α → β' → δ} {g'
   (image_image2_distrib h_distrib).trans <| by rw [image_id']
 #align set.image_image2_distrib_right Set.image_image2_distrib_right
 
-/- warning: set.image2_image_left_comm -> Set.image2_image_left_comm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} {s : Set.{u1} α} {t : Set.{u3} β} {f : α' -> β -> γ} {g : α -> α'} {f' : α -> β -> δ} {g' : δ -> γ}, (forall (a : α) (b : β), Eq.{succ u4} γ (f (g a) b) (g' (f' a b))) -> (Eq.{succ u4} (Set.{u4} γ) (Set.image2.{u2, u3, u4} α' β γ f (Set.image.{u1, u2} α α' g s) t) (Set.image.{u5, u4} δ γ g' (Set.image2.{u1, u3, u5} α β δ f' s t)))
-but is expected to have type
-  forall {α : Type.{u2}} {α' : Type.{u4}} {β : Type.{u3}} {γ : Type.{u5}} {δ : Type.{u1}} {s : Set.{u2} α} {t : Set.{u3} β} {f : α' -> β -> γ} {g : α -> α'} {f' : α -> β -> δ} {g' : δ -> γ}, (forall (a : α) (b : β), Eq.{succ u5} γ (f (g a) b) (g' (f' a b))) -> (Eq.{succ u5} (Set.{u5} γ) (Set.image2.{u4, u3, u5} α' β γ f (Set.image.{u2, u4} α α' g s) t) (Set.image.{u1, u5} δ γ g' (Set.image2.{u2, u3, u1} α β δ f' s t)))
-Case conversion may be inaccurate. Consider using '#align set.image2_image_left_comm Set.image2_image_left_commₓ'. -/
 /-- Symmetric statement to `set.image_image2_distrib_left`. -/
 theorem image2_image_left_comm {f : α' → β → γ} {g : α → α'} {f' : α → β → δ} {g' : δ → γ}
     (h_left_comm : ∀ a b, f (g a) b = g' (f' a b)) :
@@ -709,12 +379,6 @@ theorem image2_image_left_comm {f : α' → β → γ} {g : α → α'} {f' : α
   (image_image2_distrib_left fun a b => (h_left_comm a b).symm).symm
 #align set.image2_image_left_comm Set.image2_image_left_comm
 
-/- warning: set.image_image2_right_comm -> Set.image_image2_right_comm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {β' : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} {s : Set.{u1} α} {t : Set.{u2} β} {f : α -> β' -> γ} {g : β -> β'} {f' : α -> β -> δ} {g' : δ -> γ}, (forall (a : α) (b : β), Eq.{succ u4} γ (f a (g b)) (g' (f' a b))) -> (Eq.{succ u4} (Set.{u4} γ) (Set.image2.{u1, u3, u4} α β' γ f s (Set.image.{u2, u3} β β' g t)) (Set.image.{u5, u4} δ γ g' (Set.image2.{u1, u2, u5} α β δ f' s t)))
-but is expected to have type
-  forall {α : Type.{u4}} {β : Type.{u2}} {β' : Type.{u3}} {γ : Type.{u5}} {δ : Type.{u1}} {s : Set.{u4} α} {t : Set.{u2} β} {f : α -> β' -> γ} {g : β -> β'} {f' : α -> β -> δ} {g' : δ -> γ}, (forall (a : α) (b : β), Eq.{succ u5} γ (f a (g b)) (g' (f' a b))) -> (Eq.{succ u5} (Set.{u5} γ) (Set.image2.{u4, u3, u5} α β' γ f s (Set.image.{u2, u3} β β' g t)) (Set.image.{u1, u5} δ γ g' (Set.image2.{u4, u2, u1} α β δ f' s t)))
-Case conversion may be inaccurate. Consider using '#align set.image_image2_right_comm Set.image_image2_right_commₓ'. -/
 /-- Symmetric statement to `set.image_image2_distrib_right`. -/
 theorem image_image2_right_comm {f : α → β' → γ} {g : β → β'} {f' : α → β → δ} {g' : δ → γ}
     (h_right_comm : ∀ a b, f a (g b) = g' (f' a b)) :
@@ -722,12 +386,6 @@ theorem image_image2_right_comm {f : α → β' → γ} {g : β → β'} {f' : 
   (image_image2_distrib_right fun a b => (h_right_comm a b).symm).symm
 #align set.image_image2_right_comm Set.image_image2_right_comm
 
-/- warning: set.image2_distrib_subset_left -> Set.image2_distrib_subset_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {β' : Type.{u3}} {γ : Type.{u4}} {γ' : Type.{u5}} {δ : Type.{u6}} {ε : Type.{u7}} {s : Set.{u1} α} {t : Set.{u2} β} {u : Set.{u4} γ} {f : α -> δ -> ε} {g : β -> γ -> δ} {f₁ : α -> β -> β'} {f₂ : α -> γ -> γ'} {g' : β' -> γ' -> ε}, (forall (a : α) (b : β) (c : γ), Eq.{succ u7} ε (f a (g b c)) (g' (f₁ a b) (f₂ a c))) -> (HasSubset.Subset.{u7} (Set.{u7} ε) (Set.hasSubset.{u7} ε) (Set.image2.{u1, u6, u7} α δ ε f s (Set.image2.{u2, u4, u6} β γ δ g t u)) (Set.image2.{u3, u5, u7} β' γ' ε g' (Set.image2.{u1, u2, u3} α β β' f₁ s t) (Set.image2.{u1, u4, u5} α γ γ' f₂ s u)))
-but is expected to have type
-  forall {α : Type.{u6}} {β : Type.{u4}} {β' : Type.{u2}} {γ : Type.{u3}} {γ' : Type.{u1}} {δ : Type.{u5}} {ε : Type.{u7}} {s : Set.{u6} α} {t : Set.{u4} β} {u : Set.{u3} γ} {f : α -> δ -> ε} {g : β -> γ -> δ} {f₁ : α -> β -> β'} {f₂ : α -> γ -> γ'} {g' : β' -> γ' -> ε}, (forall (a : α) (b : β) (c : γ), Eq.{succ u7} ε (f a (g b c)) (g' (f₁ a b) (f₂ a c))) -> (HasSubset.Subset.{u7} (Set.{u7} ε) (Set.instHasSubsetSet.{u7} ε) (Set.image2.{u6, u5, u7} α δ ε f s (Set.image2.{u4, u3, u5} β γ δ g t u)) (Set.image2.{u2, u1, u7} β' γ' ε g' (Set.image2.{u6, u4, u2} α β β' f₁ s t) (Set.image2.{u6, u3, u1} α γ γ' f₂ s u)))
-Case conversion may be inaccurate. Consider using '#align set.image2_distrib_subset_left Set.image2_distrib_subset_leftₓ'. -/
 /-- The other direction does not hold because of the `s`-`s` cross terms on the RHS. -/
 theorem image2_distrib_subset_left {f : α → δ → ε} {g : β → γ → δ} {f₁ : α → β → β'}
     {f₂ : α → γ → γ'} {g' : β' → γ' → ε} (h_distrib : ∀ a b c, f a (g b c) = g' (f₁ a b) (f₂ a c)) :
@@ -738,12 +396,6 @@ theorem image2_distrib_subset_left {f : α → δ → ε} {g : β → γ → δ}
   exact mem_image2_of_mem (mem_image2_of_mem ha hb) (mem_image2_of_mem ha hc)
 #align set.image2_distrib_subset_left Set.image2_distrib_subset_left
 
-/- warning: set.image2_distrib_subset_right -> Set.image2_distrib_subset_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {β' : Type.{u4}} {γ : Type.{u5}} {δ : Type.{u6}} {ε : Type.{u7}} {s : Set.{u1} α} {t : Set.{u3} β} {u : Set.{u5} γ} {f : δ -> γ -> ε} {g : α -> β -> δ} {f₁ : α -> γ -> α'} {f₂ : β -> γ -> β'} {g' : α' -> β' -> ε}, (forall (a : α) (b : β) (c : γ), Eq.{succ u7} ε (f (g a b) c) (g' (f₁ a c) (f₂ b c))) -> (HasSubset.Subset.{u7} (Set.{u7} ε) (Set.hasSubset.{u7} ε) (Set.image2.{u6, u5, u7} δ γ ε f (Set.image2.{u1, u3, u6} α β δ g s t) u) (Set.image2.{u2, u4, u7} α' β' ε g' (Set.image2.{u1, u5, u2} α γ α' f₁ s u) (Set.image2.{u3, u5, u4} β γ β' f₂ t u)))
-but is expected to have type
-  forall {α : Type.{u4}} {α' : Type.{u2}} {β : Type.{u3}} {β' : Type.{u1}} {γ : Type.{u5}} {δ : Type.{u6}} {ε : Type.{u7}} {s : Set.{u4} α} {t : Set.{u3} β} {u : Set.{u5} γ} {f : δ -> γ -> ε} {g : α -> β -> δ} {f₁ : α -> γ -> α'} {f₂ : β -> γ -> β'} {g' : α' -> β' -> ε}, (forall (a : α) (b : β) (c : γ), Eq.{succ u7} ε (f (g a b) c) (g' (f₁ a c) (f₂ b c))) -> (HasSubset.Subset.{u7} (Set.{u7} ε) (Set.instHasSubsetSet.{u7} ε) (Set.image2.{u6, u5, u7} δ γ ε f (Set.image2.{u4, u3, u6} α β δ g s t) u) (Set.image2.{u2, u1, u7} α' β' ε g' (Set.image2.{u4, u5, u2} α γ α' f₁ s u) (Set.image2.{u3, u5, u1} β γ β' f₂ t u)))
-Case conversion may be inaccurate. Consider using '#align set.image2_distrib_subset_right Set.image2_distrib_subset_rightₓ'. -/
 /-- The other direction does not hold because of the `u`-`u` cross terms on the RHS. -/
 theorem image2_distrib_subset_right {f : δ → γ → ε} {g : α → β → δ} {f₁ : α → γ → α'}
     {f₂ : β → γ → β'} {g' : α' → β' → ε} (h_distrib : ∀ a b c, f (g a b) c = g' (f₁ a c) (f₂ b c)) :
@@ -754,24 +406,12 @@ theorem image2_distrib_subset_right {f : δ → γ → ε} {g : α → β → δ
   exact mem_image2_of_mem (mem_image2_of_mem ha hc) (mem_image2_of_mem hb hc)
 #align set.image2_distrib_subset_right Set.image2_distrib_subset_right
 
-/- warning: set.image_image2_antidistrib -> Set.image_image2_antidistrib is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {β' : Type.{u4}} {γ : Type.{u5}} {δ : Type.{u6}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u3} β} {g : γ -> δ} {f' : β' -> α' -> δ} {g₁ : β -> β'} {g₂ : α -> α'}, (forall (a : α) (b : β), Eq.{succ u6} δ (g (f a b)) (f' (g₁ b) (g₂ a))) -> (Eq.{succ u6} (Set.{u6} δ) (Set.image.{u5, u6} γ δ g (Set.image2.{u1, u3, u5} α β γ f s t)) (Set.image2.{u4, u2, u6} β' α' δ f' (Set.image.{u3, u4} β β' g₁ t) (Set.image.{u1, u2} α α' g₂ s)))
-but is expected to have type
-  forall {α : Type.{u4}} {α' : Type.{u1}} {β : Type.{u3}} {β' : Type.{u2}} {γ : Type.{u5}} {δ : Type.{u6}} {f : α -> β -> γ} {s : Set.{u4} α} {t : Set.{u3} β} {g : γ -> δ} {f' : β' -> α' -> δ} {g₁ : β -> β'} {g₂ : α -> α'}, (forall (a : α) (b : β), Eq.{succ u6} δ (g (f a b)) (f' (g₁ b) (g₂ a))) -> (Eq.{succ u6} (Set.{u6} δ) (Set.image.{u5, u6} γ δ g (Set.image2.{u4, u3, u5} α β γ f s t)) (Set.image2.{u2, u1, u6} β' α' δ f' (Set.image.{u3, u2} β β' g₁ t) (Set.image.{u4, u1} α α' g₂ s)))
-Case conversion may be inaccurate. Consider using '#align set.image_image2_antidistrib Set.image_image2_antidistribₓ'. -/
 theorem image_image2_antidistrib {g : γ → δ} {f' : β' → α' → δ} {g₁ : β → β'} {g₂ : α → α'}
     (h_antidistrib : ∀ a b, g (f a b) = f' (g₁ b) (g₂ a)) :
     (image2 f s t).image g = image2 f' (t.image g₁) (s.image g₂) := by rw [image2_swap f];
   exact image_image2_distrib fun _ _ => h_antidistrib _ _
 #align set.image_image2_antidistrib Set.image_image2_antidistrib
 
-/- warning: set.image_image2_antidistrib_left -> Set.image_image2_antidistrib_left is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {β' : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β} {g : γ -> δ} {f' : β' -> α -> δ} {g' : β -> β'}, (forall (a : α) (b : β), Eq.{succ u5} δ (g (f a b)) (f' (g' b) a)) -> (Eq.{succ u5} (Set.{u5} δ) (Set.image.{u4, u5} γ δ g (Set.image2.{u1, u2, u4} α β γ f s t)) (Set.image2.{u3, u1, u5} β' α δ f' (Set.image.{u2, u3} β β' g' t) s))
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {β' : Type.{u1}} {γ : Type.{u4}} {δ : Type.{u5}} {f : α -> β -> γ} {s : Set.{u3} α} {t : Set.{u2} β} {g : γ -> δ} {f' : β' -> α -> δ} {g' : β -> β'}, (forall (a : α) (b : β), Eq.{succ u5} δ (g (f a b)) (f' (g' b) a)) -> (Eq.{succ u5} (Set.{u5} δ) (Set.image.{u4, u5} γ δ g (Set.image2.{u3, u2, u4} α β γ f s t)) (Set.image2.{u1, u3, u5} β' α δ f' (Set.image.{u2, u1} β β' g' t) s))
-Case conversion may be inaccurate. Consider using '#align set.image_image2_antidistrib_left Set.image_image2_antidistrib_leftₓ'. -/
 /-- Symmetric statement to `set.image2_image_left_anticomm`. -/
 theorem image_image2_antidistrib_left {g : γ → δ} {f' : β' → α → δ} {g' : β → β'}
     (h_antidistrib : ∀ a b, g (f a b) = f' (g' b) a) :
@@ -779,12 +419,6 @@ theorem image_image2_antidistrib_left {g : γ → δ} {f' : β' → α → δ} {
   (image_image2_antidistrib h_antidistrib).trans <| by rw [image_id']
 #align set.image_image2_antidistrib_left Set.image_image2_antidistrib_left
 
-/- warning: set.image_image2_antidistrib_right -> Set.image_image2_antidistrib_right is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u3} β} {g : γ -> δ} {f' : β -> α' -> δ} {g' : α -> α'}, (forall (a : α) (b : β), Eq.{succ u5} δ (g (f a b)) (f' b (g' a))) -> (Eq.{succ u5} (Set.{u5} δ) (Set.image.{u4, u5} γ δ g (Set.image2.{u1, u3, u4} α β γ f s t)) (Set.image2.{u3, u2, u5} β α' δ f' t (Set.image.{u1, u2} α α' g' s)))
-but is expected to have type
-  forall {α : Type.{u3}} {α' : Type.{u1}} {β : Type.{u2}} {γ : Type.{u4}} {δ : Type.{u5}} {f : α -> β -> γ} {s : Set.{u3} α} {t : Set.{u2} β} {g : γ -> δ} {f' : β -> α' -> δ} {g' : α -> α'}, (forall (a : α) (b : β), Eq.{succ u5} δ (g (f a b)) (f' b (g' a))) -> (Eq.{succ u5} (Set.{u5} δ) (Set.image.{u4, u5} γ δ g (Set.image2.{u3, u2, u4} α β γ f s t)) (Set.image2.{u2, u1, u5} β α' δ f' t (Set.image.{u3, u1} α α' g' s)))
-Case conversion may be inaccurate. Consider using '#align set.image_image2_antidistrib_right Set.image_image2_antidistrib_rightₓ'. -/
 /-- Symmetric statement to `set.image_image2_right_anticomm`. -/
 theorem image_image2_antidistrib_right {g : γ → δ} {f' : β → α' → δ} {g' : α → α'}
     (h_antidistrib : ∀ a b, g (f a b) = f' b (g' a)) :
@@ -792,12 +426,6 @@ theorem image_image2_antidistrib_right {g : γ → δ} {f' : β → α' → δ}
   (image_image2_antidistrib h_antidistrib).trans <| by rw [image_id']
 #align set.image_image2_antidistrib_right Set.image_image2_antidistrib_right
 
-/- warning: set.image2_image_left_anticomm -> Set.image2_image_left_anticomm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} {s : Set.{u1} α} {t : Set.{u3} β} {f : α' -> β -> γ} {g : α -> α'} {f' : β -> α -> δ} {g' : δ -> γ}, (forall (a : α) (b : β), Eq.{succ u4} γ (f (g a) b) (g' (f' b a))) -> (Eq.{succ u4} (Set.{u4} γ) (Set.image2.{u2, u3, u4} α' β γ f (Set.image.{u1, u2} α α' g s) t) (Set.image.{u5, u4} δ γ g' (Set.image2.{u3, u1, u5} β α δ f' t s)))
-but is expected to have type
-  forall {α : Type.{u2}} {α' : Type.{u4}} {β : Type.{u3}} {γ : Type.{u5}} {δ : Type.{u1}} {s : Set.{u2} α} {t : Set.{u3} β} {f : α' -> β -> γ} {g : α -> α'} {f' : β -> α -> δ} {g' : δ -> γ}, (forall (a : α) (b : β), Eq.{succ u5} γ (f (g a) b) (g' (f' b a))) -> (Eq.{succ u5} (Set.{u5} γ) (Set.image2.{u4, u3, u5} α' β γ f (Set.image.{u2, u4} α α' g s) t) (Set.image.{u1, u5} δ γ g' (Set.image2.{u3, u2, u1} β α δ f' t s)))
-Case conversion may be inaccurate. Consider using '#align set.image2_image_left_anticomm Set.image2_image_left_anticommₓ'. -/
 /-- Symmetric statement to `set.image_image2_antidistrib_left`. -/
 theorem image2_image_left_anticomm {f : α' → β → γ} {g : α → α'} {f' : β → α → δ} {g' : δ → γ}
     (h_left_anticomm : ∀ a b, f (g a) b = g' (f' b a)) :
@@ -805,12 +433,6 @@ theorem image2_image_left_anticomm {f : α' → β → γ} {g : α → α'} {f'
   (image_image2_antidistrib_left fun a b => (h_left_anticomm b a).symm).symm
 #align set.image2_image_left_anticomm Set.image2_image_left_anticomm
 
-/- warning: set.image_image2_right_anticomm -> Set.image_image2_right_anticomm is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {β' : Type.{u3}} {γ : Type.{u4}} {δ : Type.{u5}} {s : Set.{u1} α} {t : Set.{u2} β} {f : α -> β' -> γ} {g : β -> β'} {f' : β -> α -> δ} {g' : δ -> γ}, (forall (a : α) (b : β), Eq.{succ u4} γ (f a (g b)) (g' (f' b a))) -> (Eq.{succ u4} (Set.{u4} γ) (Set.image2.{u1, u3, u4} α β' γ f s (Set.image.{u2, u3} β β' g t)) (Set.image.{u5, u4} δ γ g' (Set.image2.{u2, u1, u5} β α δ f' t s)))
-but is expected to have type
-  forall {α : Type.{u4}} {β : Type.{u2}} {β' : Type.{u3}} {γ : Type.{u5}} {δ : Type.{u1}} {s : Set.{u4} α} {t : Set.{u2} β} {f : α -> β' -> γ} {g : β -> β'} {f' : β -> α -> δ} {g' : δ -> γ}, (forall (a : α) (b : β), Eq.{succ u5} γ (f a (g b)) (g' (f' b a))) -> (Eq.{succ u5} (Set.{u5} γ) (Set.image2.{u4, u3, u5} α β' γ f s (Set.image.{u2, u3} β β' g t)) (Set.image.{u1, u5} δ γ g' (Set.image2.{u2, u4, u1} β α δ f' t s)))
-Case conversion may be inaccurate. Consider using '#align set.image_image2_right_anticomm Set.image_image2_right_anticommₓ'. -/
 /-- Symmetric statement to `set.image_image2_antidistrib_right`. -/
 theorem image_image2_right_anticomm {f : α → β' → γ} {g : β → β'} {f' : β → α → δ} {g' : δ → γ}
     (h_right_anticomm : ∀ a b, f a (g b) = g' (f' b a)) :
@@ -826,24 +448,12 @@ theorem image2_left_identity {f : α → β → β} {a : α} (h : ∀ b, f a b =
 #align set.image2_left_identity Set.image2_left_identity
 -/
 
-/- warning: set.image2_right_identity -> Set.image2_right_identity is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {f : α -> β -> α} {b : β}, (forall (a : α), Eq.{succ u1} α (f a b) a) -> (forall (s : Set.{u1} α), Eq.{succ u1} (Set.{u1} α) (Set.image2.{u1, u2, u1} α β α f s (Singleton.singleton.{u2, u2} β (Set.{u2} β) (Set.hasSingleton.{u2} β) b)) s)
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {f : α -> β -> α} {b : β}, (forall (a : α), Eq.{succ u2} α (f a b) a) -> (forall (s : Set.{u2} α), Eq.{succ u2} (Set.{u2} α) (Set.image2.{u2, u1, u2} α β α f s (Singleton.singleton.{u1, u1} β (Set.{u1} β) (Set.instSingletonSet.{u1} β) b)) s)
-Case conversion may be inaccurate. Consider using '#align set.image2_right_identity Set.image2_right_identityₓ'. -/
 /-- If `b` is a right identity for `f : α → β → α`, then `{b}` is a right identity for
 `set.image2 f`. -/
 theorem image2_right_identity {f : α → β → α} {b : β} (h : ∀ a, f a b = a) (s : Set α) :
     image2 f s {b} = s := by rw [image2_singleton_right, funext h, image_id']
 #align set.image2_right_identity Set.image2_right_identity
 
-/- warning: set.image2_inter_union_subset_union -> Set.image2_inter_union_subset_union is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {s' : Set.{u1} α} {t : Set.{u2} β} {t' : Set.{u2} β}, HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s s') (Union.union.{u2} (Set.{u2} β) (Set.hasUnion.{u2} β) t t')) (Union.union.{u3} (Set.{u3} γ) (Set.hasUnion.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) (Set.image2.{u1, u2, u3} α β γ f s' t'))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {s' : Set.{u2} α} {t : Set.{u1} β} {t' : Set.{u1} β}, HasSubset.Subset.{u3} (Set.{u3} γ) (Set.instHasSubsetSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f (Inter.inter.{u2} (Set.{u2} α) (Set.instInterSet.{u2} α) s s') (Union.union.{u1} (Set.{u1} β) (Set.instUnionSet.{u1} β) t t')) (Union.union.{u3} (Set.{u3} γ) (Set.instUnionSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s t) (Set.image2.{u2, u1, u3} α β γ f s' t'))
-Case conversion may be inaccurate. Consider using '#align set.image2_inter_union_subset_union Set.image2_inter_union_subset_unionₓ'. -/
 theorem image2_inter_union_subset_union :
     image2 f (s ∩ s') (t ∪ t') ⊆ image2 f s t ∪ image2 f s' t' := by rw [image2_union_right];
   exact
@@ -851,12 +461,6 @@ theorem image2_inter_union_subset_union :
       (image2_subset_right <| inter_subset_right _ _)
 #align set.image2_inter_union_subset_union Set.image2_inter_union_subset_union
 
-/- warning: set.image2_union_inter_subset_union -> Set.image2_union_inter_subset_union is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {s' : Set.{u1} α} {t : Set.{u2} β} {t' : Set.{u2} β}, HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s s') (Inter.inter.{u2} (Set.{u2} β) (Set.hasInter.{u2} β) t t')) (Union.union.{u3} (Set.{u3} γ) (Set.hasUnion.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) (Set.image2.{u1, u2, u3} α β γ f s' t'))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {s' : Set.{u2} α} {t : Set.{u1} β} {t' : Set.{u1} β}, HasSubset.Subset.{u3} (Set.{u3} γ) (Set.instHasSubsetSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f (Union.union.{u2} (Set.{u2} α) (Set.instUnionSet.{u2} α) s s') (Inter.inter.{u1} (Set.{u1} β) (Set.instInterSet.{u1} β) t t')) (Union.union.{u3} (Set.{u3} γ) (Set.instUnionSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s t) (Set.image2.{u2, u1, u3} α β γ f s' t'))
-Case conversion may be inaccurate. Consider using '#align set.image2_union_inter_subset_union Set.image2_union_inter_subset_unionₓ'. -/
 theorem image2_union_inter_subset_union :
     image2 f (s ∪ s') (t ∩ t') ⊆ image2 f s t ∪ image2 f s' t' := by rw [image2_union_left];
   exact
@@ -864,12 +468,6 @@ theorem image2_union_inter_subset_union :
       (image2_subset_left <| inter_subset_right _ _)
 #align set.image2_union_inter_subset_union Set.image2_union_inter_subset_union
 
-/- warning: set.image2_inter_union_subset -> Set.image2_inter_union_subset is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {f : α -> α -> β} {s : Set.{u1} α} {t : Set.{u1} α}, (forall (a : α) (b : α), Eq.{succ u2} β (f a b) (f b a)) -> (HasSubset.Subset.{u2} (Set.{u2} β) (Set.hasSubset.{u2} β) (Set.image2.{u1, u1, u2} α α β f (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s t) (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t)) (Set.image2.{u1, u1, u2} α α β f s t))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {f : α -> α -> β} {s : Set.{u2} α} {t : Set.{u2} α}, (forall (a : α) (b : α), Eq.{succ u1} β (f a b) (f b a)) -> (HasSubset.Subset.{u1} (Set.{u1} β) (Set.instHasSubsetSet.{u1} β) (Set.image2.{u2, u2, u1} α α β f (Inter.inter.{u2} (Set.{u2} α) (Set.instInterSet.{u2} α) s t) (Union.union.{u2} (Set.{u2} α) (Set.instUnionSet.{u2} α) s t)) (Set.image2.{u2, u2, u1} α α β f s t))
-Case conversion may be inaccurate. Consider using '#align set.image2_inter_union_subset Set.image2_inter_union_subsetₓ'. -/
 theorem image2_inter_union_subset {f : α → α → β} {s t : Set α} (hf : ∀ a b, f a b = f b a) :
     image2 f (s ∩ t) (s ∪ t) ⊆ image2 f s t :=
   by
@@ -877,12 +475,6 @@ theorem image2_inter_union_subset {f : α → α → β} {s t : Set α} (hf : 
   exact image2_inter_union_subset_union.trans (union_subset (image2_comm hf).Subset subset.rfl)
 #align set.image2_inter_union_subset Set.image2_inter_union_subset
 
-/- warning: set.image2_union_inter_subset -> Set.image2_union_inter_subset is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {f : α -> α -> β} {s : Set.{u1} α} {t : Set.{u1} α}, (forall (a : α) (b : α), Eq.{succ u2} β (f a b) (f b a)) -> (HasSubset.Subset.{u2} (Set.{u2} β) (Set.hasSubset.{u2} β) (Set.image2.{u1, u1, u2} α α β f (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t) (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s t)) (Set.image2.{u1, u1, u2} α α β f s t))
-but is expected to have type
-  forall {α : Type.{u2}} {β : Type.{u1}} {f : α -> α -> β} {s : Set.{u2} α} {t : Set.{u2} α}, (forall (a : α) (b : α), Eq.{succ u1} β (f a b) (f b a)) -> (HasSubset.Subset.{u1} (Set.{u1} β) (Set.instHasSubsetSet.{u1} β) (Set.image2.{u2, u2, u1} α α β f (Union.union.{u2} (Set.{u2} α) (Set.instUnionSet.{u2} α) s t) (Inter.inter.{u2} (Set.{u2} α) (Set.instInterSet.{u2} α) s t)) (Set.image2.{u2, u2, u1} α α β f s t))
-Case conversion may be inaccurate. Consider using '#align set.image2_union_inter_subset Set.image2_union_inter_subsetₓ'. -/
 theorem image2_union_inter_subset {f : α → α → β} {s t : Set α} (hf : ∀ a b, f a b = f b a) :
     image2 f (s ∪ t) (s ∩ t) ⊆ image2 f s t := by rw [image2_comm hf];
   exact image2_inter_union_subset hf
Diff
@@ -74,10 +74,8 @@ but is expected to have type
   forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {f : α -> β -> γ} {s : Set.{u3} α} {t : Set.{u2} β} {a : α} {b : β}, (Function.Injective2.{succ u3, succ u2, succ u1} α β γ f) -> (Iff (Membership.mem.{u1, u1} γ (Set.{u1} γ) (Set.instMembershipSet.{u1} γ) (f a b) (Set.image2.{u3, u2, u1} α β γ f s t)) (And (Membership.mem.{u3, u3} α (Set.{u3} α) (Set.instMembershipSet.{u3} α) a s) (Membership.mem.{u2, u2} β (Set.{u2} β) (Set.instMembershipSet.{u2} β) b t)))
 Case conversion may be inaccurate. Consider using '#align set.mem_image2_iff Set.mem_image2_iffₓ'. -/
 theorem mem_image2_iff (hf : Injective2 f) : f a b ∈ image2 f s t ↔ a ∈ s ∧ b ∈ t :=
-  ⟨by
-    rintro ⟨a', b', ha', hb', h⟩
-    rcases hf h with ⟨rfl, rfl⟩
-    exact ⟨ha', hb'⟩, fun ⟨ha, hb⟩ => mem_image2_of_mem ha hb⟩
+  ⟨by rintro ⟨a', b', ha', hb', h⟩; rcases hf h with ⟨rfl, rfl⟩; exact ⟨ha', hb'⟩, fun ⟨ha, hb⟩ =>
+    mem_image2_of_mem ha hb⟩
 #align set.mem_image2_iff Set.mem_image2_iff
 
 /- warning: set.image2_subset -> Set.image2_subset is a dubious translation:
@@ -87,10 +85,8 @@ but is expected to have type
   forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {f : α -> β -> γ} {s : Set.{u3} α} {s' : Set.{u3} α} {t : Set.{u2} β} {t' : Set.{u2} β}, (HasSubset.Subset.{u3} (Set.{u3} α) (Set.instHasSubsetSet.{u3} α) s s') -> (HasSubset.Subset.{u2} (Set.{u2} β) (Set.instHasSubsetSet.{u2} β) t t') -> (HasSubset.Subset.{u1} (Set.{u1} γ) (Set.instHasSubsetSet.{u1} γ) (Set.image2.{u3, u2, u1} α β γ f s t) (Set.image2.{u3, u2, u1} α β γ f s' t'))
 Case conversion may be inaccurate. Consider using '#align set.image2_subset Set.image2_subsetₓ'. -/
 /-- image2 is monotone with respect to `⊆`. -/
-theorem image2_subset (hs : s ⊆ s') (ht : t ⊆ t') : image2 f s t ⊆ image2 f s' t' :=
-  by
-  rintro _ ⟨a, b, ha, hb, rfl⟩
-  exact mem_image2_of_mem (hs ha) (ht hb)
+theorem image2_subset (hs : s ⊆ s') (ht : t ⊆ t') : image2 f s t ⊆ image2 f s' t' := by
+  rintro _ ⟨a, b, ha, hb, rfl⟩; exact mem_image2_of_mem (hs ha) (ht hb)
 #align set.image2_subset Set.image2_subset
 
 /- warning: set.image2_subset_left -> Set.image2_subset_left is a dubious translation:
@@ -187,12 +183,8 @@ Case conversion may be inaccurate. Consider using '#align set.image_prod Set.ima
 @[simp]
 theorem image_prod : (fun x : α × β => f x.1 x.2) '' s ×ˢ t = image2 f s t :=
   ext fun a =>
-    ⟨by
-      rintro ⟨_, _, rfl⟩
-      exact ⟨_, _, (mem_prod.1 ‹_›).1, (mem_prod.1 ‹_›).2, rfl⟩,
-      by
-      rintro ⟨_, _, _, _, rfl⟩
-      exact ⟨(_, _), ⟨‹_›, ‹_›⟩, rfl⟩⟩
+    ⟨by rintro ⟨_, _, rfl⟩; exact ⟨_, _, (mem_prod.1 ‹_›).1, (mem_prod.1 ‹_›).2, rfl⟩, by
+      rintro ⟨_, _, _, _, rfl⟩; exact ⟨(_, _), ⟨‹_›, ‹_›⟩, rfl⟩⟩
 #align set.image_prod Set.image_prod
 
 /- warning: set.image_uncurry_prod -> Set.image_uncurry_prod is a dubious translation:
@@ -237,10 +229,8 @@ lean 3 declaration is
 but is expected to have type
   forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : α -> β -> γ) (s : Set.{u3} α) (t : Set.{u2} β), Eq.{succ u1} (Set.{u1} γ) (Set.image2.{u3, u2, u1} α β γ f s t) (Set.image2.{u2, u3, u1} β α γ (fun (a : β) (b : α) => f b a) t s)
 Case conversion may be inaccurate. Consider using '#align set.image2_swap Set.image2_swapₓ'. -/
-theorem image2_swap (s : Set α) (t : Set β) : image2 f s t = image2 (fun a b => f b a) t s :=
-  by
-  ext
-  constructor <;> rintro ⟨a, b, ha, hb, rfl⟩ <;> refine' ⟨b, a, hb, ha, rfl⟩
+theorem image2_swap (s : Set α) (t : Set β) : image2 f s t = image2 (fun a b => f b a) t s := by
+  ext; constructor <;> rintro ⟨a, b, ha, hb, rfl⟩ <;> refine' ⟨b, a, hb, ha, rfl⟩
 #align set.image2_swap Set.image2_swap
 
 variable {f}
@@ -373,10 +363,8 @@ lean 3 declaration is
 but is expected to have type
   forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {s' : Set.{u2} α} {t : Set.{u1} β}, HasSubset.Subset.{u3} (Set.{u3} γ) (Set.instHasSubsetSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f (Inter.inter.{u2} (Set.{u2} α) (Set.instInterSet.{u2} α) s s') t) (Inter.inter.{u3} (Set.{u3} γ) (Set.instInterSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s t) (Set.image2.{u2, u1, u3} α β γ f s' t))
 Case conversion may be inaccurate. Consider using '#align set.image2_inter_subset_left Set.image2_inter_subset_leftₓ'. -/
-theorem image2_inter_subset_left : image2 f (s ∩ s') t ⊆ image2 f s t ∩ image2 f s' t :=
-  by
-  rintro _ ⟨a, b, ⟨h1a, h2a⟩, hb, rfl⟩
-  constructor <;> exact ⟨_, _, ‹_›, ‹_›, rfl⟩
+theorem image2_inter_subset_left : image2 f (s ∩ s') t ⊆ image2 f s t ∩ image2 f s' t := by
+  rintro _ ⟨a, b, ⟨h1a, h2a⟩, hb, rfl⟩; constructor <;> exact ⟨_, _, ‹_›, ‹_›, rfl⟩
 #align set.image2_inter_subset_left Set.image2_inter_subset_left
 
 /- warning: set.image2_inter_subset_right -> Set.image2_inter_subset_right is a dubious translation:
@@ -385,10 +373,8 @@ lean 3 declaration is
 but is expected to have type
   forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {t : Set.{u1} β} {t' : Set.{u1} β}, HasSubset.Subset.{u3} (Set.{u3} γ) (Set.instHasSubsetSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s (Inter.inter.{u1} (Set.{u1} β) (Set.instInterSet.{u1} β) t t')) (Inter.inter.{u3} (Set.{u3} γ) (Set.instInterSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s t) (Set.image2.{u2, u1, u3} α β γ f s t'))
 Case conversion may be inaccurate. Consider using '#align set.image2_inter_subset_right Set.image2_inter_subset_rightₓ'. -/
-theorem image2_inter_subset_right : image2 f s (t ∩ t') ⊆ image2 f s t ∩ image2 f s t' :=
-  by
-  rintro _ ⟨a, b, ha, ⟨h1b, h2b⟩, rfl⟩
-  constructor <;> exact ⟨_, _, ‹_›, ‹_›, rfl⟩
+theorem image2_inter_subset_right : image2 f s (t ∩ t') ⊆ image2 f s t ∩ image2 f s t' := by
+  rintro _ ⟨a, b, ha, ⟨h1b, h2b⟩, rfl⟩; constructor <;> exact ⟨_, _, ‹_›, ‹_›, rfl⟩
 #align set.image2_inter_subset_right Set.image2_inter_subset_right
 
 /- warning: set.image2_singleton_left -> Set.image2_singleton_left is a dubious translation:
@@ -451,10 +437,8 @@ but is expected to have type
   forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} {f : α -> β -> γ} {f' : α -> β -> γ} {s : Set.{u3} α} {t : Set.{u2} β}, (forall (a : α), (Membership.mem.{u3, u3} α (Set.{u3} α) (Set.instMembershipSet.{u3} α) a s) -> (forall (b : β), (Membership.mem.{u2, u2} β (Set.{u2} β) (Set.instMembershipSet.{u2} β) b t) -> (Eq.{succ u1} γ (f a b) (f' a b)))) -> (Eq.{succ u1} (Set.{u1} γ) (Set.image2.{u3, u2, u1} α β γ f s t) (Set.image2.{u3, u2, u1} α β γ f' s t))
 Case conversion may be inaccurate. Consider using '#align set.image2_congr Set.image2_congrₓ'. -/
 @[congr]
-theorem image2_congr (h : ∀ a ∈ s, ∀ b ∈ t, f a b = f' a b) : image2 f s t = image2 f' s t :=
-  by
-  ext
-  constructor <;> rintro ⟨a, b, ha, hb, rfl⟩ <;> refine' ⟨a, b, ha, hb, by rw [h a ha b hb]⟩
+theorem image2_congr (h : ∀ a ∈ s, ∀ b ∈ t, f a b = f' a b) : image2 f s t = image2 f' s t := by
+  ext; constructor <;> rintro ⟨a, b, ha, hb, rfl⟩ <;> refine' ⟨a, b, ha, hb, by rw [h a ha b hb]⟩
 #align set.image2_congr Set.image2_congr
 
 /- warning: set.image2_congr' -> Set.image2_congr' is a dubious translation:
@@ -535,10 +519,8 @@ theorem image2_image2_left (f : δ → γ → ε) (g : α → β → δ) :
     image2 f (image2 g s t) u = image3 (fun a b c => f (g a b) c) s t u :=
   by
   ext; constructor
-  · rintro ⟨_, c, ⟨a, b, ha, hb, rfl⟩, hc, rfl⟩
-    refine' ⟨a, b, c, ha, hb, hc, rfl⟩
-  · rintro ⟨a, b, c, ha, hb, hc, rfl⟩
-    refine' ⟨_, c, ⟨a, b, ha, hb, rfl⟩, hc, rfl⟩
+  · rintro ⟨_, c, ⟨a, b, ha, hb, rfl⟩, hc, rfl⟩; refine' ⟨a, b, c, ha, hb, hc, rfl⟩
+  · rintro ⟨a, b, c, ha, hb, hc, rfl⟩; refine' ⟨_, c, ⟨a, b, ha, hb, rfl⟩, hc, rfl⟩
 #align set.image2_image2_left Set.image2_image2_left
 
 /- warning: set.image2_image2_right -> Set.image2_image2_right is a dubious translation:
@@ -551,10 +533,8 @@ theorem image2_image2_right (f : α → δ → ε) (g : β → γ → δ) :
     image2 f s (image2 g t u) = image3 (fun a b c => f a (g b c)) s t u :=
   by
   ext; constructor
-  · rintro ⟨a, _, ha, ⟨b, c, hb, hc, rfl⟩, rfl⟩
-    refine' ⟨a, b, c, ha, hb, hc, rfl⟩
-  · rintro ⟨a, b, c, ha, hb, hc, rfl⟩
-    refine' ⟨a, _, ha, ⟨b, c, hb, hc, rfl⟩, rfl⟩
+  · rintro ⟨a, _, ha, ⟨b, c, hb, hc, rfl⟩, rfl⟩; refine' ⟨a, b, c, ha, hb, hc, rfl⟩
+  · rintro ⟨a, b, c, ha, hb, hc, rfl⟩; refine' ⟨a, _, ha, ⟨b, c, hb, hc, rfl⟩, rfl⟩
 #align set.image2_image2_right Set.image2_image2_right
 
 /- warning: set.image_image2 -> Set.image_image2 is a dubious translation:
@@ -567,10 +547,8 @@ theorem image_image2 (f : α → β → γ) (g : γ → δ) :
     g '' image2 f s t = image2 (fun a b => g (f a b)) s t :=
   by
   ext; constructor
-  · rintro ⟨_, ⟨a, b, ha, hb, rfl⟩, rfl⟩
-    refine' ⟨a, b, ha, hb, rfl⟩
-  · rintro ⟨a, b, ha, hb, rfl⟩
-    refine' ⟨_, ⟨a, b, ha, hb, rfl⟩, rfl⟩
+  · rintro ⟨_, ⟨a, b, ha, hb, rfl⟩, rfl⟩; refine' ⟨a, b, ha, hb, rfl⟩
+  · rintro ⟨a, b, ha, hb, rfl⟩; refine' ⟨_, ⟨a, b, ha, hb, rfl⟩, rfl⟩
 #align set.image_image2 Set.image_image2
 
 #print Set.image2_image_left /-
@@ -578,10 +556,8 @@ theorem image2_image_left (f : γ → β → δ) (g : α → γ) :
     image2 f (g '' s) t = image2 (fun a b => f (g a) b) s t :=
   by
   ext; constructor
-  · rintro ⟨_, b, ⟨a, ha, rfl⟩, hb, rfl⟩
-    refine' ⟨a, b, ha, hb, rfl⟩
-  · rintro ⟨a, b, ha, hb, rfl⟩
-    refine' ⟨_, b, ⟨a, ha, rfl⟩, hb, rfl⟩
+  · rintro ⟨_, b, ⟨a, ha, rfl⟩, hb, rfl⟩; refine' ⟨a, b, ha, hb, rfl⟩
+  · rintro ⟨a, b, ha, hb, rfl⟩; refine' ⟨_, b, ⟨a, ha, rfl⟩, hb, rfl⟩
 #align set.image2_image_left Set.image2_image_left
 -/
 
@@ -595,10 +571,8 @@ theorem image2_image_right (f : α → γ → δ) (g : β → γ) :
     image2 f s (g '' t) = image2 (fun a b => f a (g b)) s t :=
   by
   ext; constructor
-  · rintro ⟨a, _, ha, ⟨b, hb, rfl⟩, rfl⟩
-    refine' ⟨a, b, ha, hb, rfl⟩
-  · rintro ⟨a, b, ha, hb, rfl⟩
-    refine' ⟨a, _, ha, ⟨b, hb, rfl⟩, rfl⟩
+  · rintro ⟨a, _, ha, ⟨b, hb, rfl⟩, rfl⟩; refine' ⟨a, b, ha, hb, rfl⟩
+  · rintro ⟨a, b, ha, hb, rfl⟩; refine' ⟨a, _, ha, ⟨b, hb, rfl⟩, rfl⟩
 #align set.image2_image_right Set.image2_image_right
 
 #print Set.image2_left /-
@@ -649,10 +623,8 @@ but is expected to have type
 Case conversion may be inaccurate. Consider using '#align set.image2_left_comm Set.image2_left_commₓ'. -/
 theorem image2_left_comm {f : α → δ → ε} {g : β → γ → δ} {f' : α → γ → δ'} {g' : β → δ' → ε}
     (h_left_comm : ∀ a b c, f a (g b c) = g' b (f' a c)) :
-    image2 f s (image2 g t u) = image2 g' t (image2 f' s u) :=
-  by
-  rw [image2_swap f', image2_swap f]
-  exact image2_assoc fun _ _ _ => h_left_comm _ _ _
+    image2 f s (image2 g t u) = image2 g' t (image2 f' s u) := by
+  rw [image2_swap f', image2_swap f]; exact image2_assoc fun _ _ _ => h_left_comm _ _ _
 #align set.image2_left_comm Set.image2_left_comm
 
 /- warning: set.image2_right_comm -> Set.image2_right_comm is a dubious translation:
@@ -663,10 +635,8 @@ but is expected to have type
 Case conversion may be inaccurate. Consider using '#align set.image2_right_comm Set.image2_right_commₓ'. -/
 theorem image2_right_comm {f : δ → γ → ε} {g : α → β → δ} {f' : α → γ → δ'} {g' : δ' → β → ε}
     (h_right_comm : ∀ a b c, f (g a b) c = g' (f' a c) b) :
-    image2 f (image2 g s t) u = image2 g' (image2 f' s u) t :=
-  by
-  rw [image2_swap g, image2_swap g']
-  exact image2_assoc fun _ _ _ => h_right_comm _ _ _
+    image2 f (image2 g s t) u = image2 g' (image2 f' s u) t := by
+  rw [image2_swap g, image2_swap g']; exact image2_assoc fun _ _ _ => h_right_comm _ _ _
 #align set.image2_right_comm Set.image2_right_comm
 
 /- warning: set.image2_image2_image2_comm -> Set.image2_image2_image2_comm is a dubious translation:
@@ -792,9 +762,7 @@ but is expected to have type
 Case conversion may be inaccurate. Consider using '#align set.image_image2_antidistrib Set.image_image2_antidistribₓ'. -/
 theorem image_image2_antidistrib {g : γ → δ} {f' : β' → α' → δ} {g₁ : β → β'} {g₂ : α → α'}
     (h_antidistrib : ∀ a b, g (f a b) = f' (g₁ b) (g₂ a)) :
-    (image2 f s t).image g = image2 f' (t.image g₁) (s.image g₂) :=
-  by
-  rw [image2_swap f]
+    (image2 f s t).image g = image2 f' (t.image g₁) (s.image g₂) := by rw [image2_swap f];
   exact image_image2_distrib fun _ _ => h_antidistrib _ _
 #align set.image_image2_antidistrib Set.image_image2_antidistrib
 
@@ -877,9 +845,7 @@ but is expected to have type
   forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {s' : Set.{u2} α} {t : Set.{u1} β} {t' : Set.{u1} β}, HasSubset.Subset.{u3} (Set.{u3} γ) (Set.instHasSubsetSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f (Inter.inter.{u2} (Set.{u2} α) (Set.instInterSet.{u2} α) s s') (Union.union.{u1} (Set.{u1} β) (Set.instUnionSet.{u1} β) t t')) (Union.union.{u3} (Set.{u3} γ) (Set.instUnionSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s t) (Set.image2.{u2, u1, u3} α β γ f s' t'))
 Case conversion may be inaccurate. Consider using '#align set.image2_inter_union_subset_union Set.image2_inter_union_subset_unionₓ'. -/
 theorem image2_inter_union_subset_union :
-    image2 f (s ∩ s') (t ∪ t') ⊆ image2 f s t ∪ image2 f s' t' :=
-  by
-  rw [image2_union_right]
+    image2 f (s ∩ s') (t ∪ t') ⊆ image2 f s t ∪ image2 f s' t' := by rw [image2_union_right];
   exact
     union_subset_union (image2_subset_right <| inter_subset_left _ _)
       (image2_subset_right <| inter_subset_right _ _)
@@ -892,9 +858,7 @@ but is expected to have type
   forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {s' : Set.{u2} α} {t : Set.{u1} β} {t' : Set.{u1} β}, HasSubset.Subset.{u3} (Set.{u3} γ) (Set.instHasSubsetSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f (Union.union.{u2} (Set.{u2} α) (Set.instUnionSet.{u2} α) s s') (Inter.inter.{u1} (Set.{u1} β) (Set.instInterSet.{u1} β) t t')) (Union.union.{u3} (Set.{u3} γ) (Set.instUnionSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s t) (Set.image2.{u2, u1, u3} α β γ f s' t'))
 Case conversion may be inaccurate. Consider using '#align set.image2_union_inter_subset_union Set.image2_union_inter_subset_unionₓ'. -/
 theorem image2_union_inter_subset_union :
-    image2 f (s ∪ s') (t ∩ t') ⊆ image2 f s t ∪ image2 f s' t' :=
-  by
-  rw [image2_union_left]
+    image2 f (s ∪ s') (t ∩ t') ⊆ image2 f s t ∪ image2 f s' t' := by rw [image2_union_left];
   exact
     union_subset_union (image2_subset_left <| inter_subset_left _ _)
       (image2_subset_left <| inter_subset_right _ _)
@@ -920,9 +884,7 @@ but is expected to have type
   forall {α : Type.{u2}} {β : Type.{u1}} {f : α -> α -> β} {s : Set.{u2} α} {t : Set.{u2} α}, (forall (a : α) (b : α), Eq.{succ u1} β (f a b) (f b a)) -> (HasSubset.Subset.{u1} (Set.{u1} β) (Set.instHasSubsetSet.{u1} β) (Set.image2.{u2, u2, u1} α α β f (Union.union.{u2} (Set.{u2} α) (Set.instUnionSet.{u2} α) s t) (Inter.inter.{u2} (Set.{u2} α) (Set.instInterSet.{u2} α) s t)) (Set.image2.{u2, u2, u1} α α β f s t))
 Case conversion may be inaccurate. Consider using '#align set.image2_union_inter_subset Set.image2_union_inter_subsetₓ'. -/
 theorem image2_union_inter_subset {f : α → α → β} {s t : Set α} (hf : ∀ a b, f a b = f b a) :
-    image2 f (s ∪ t) (s ∩ t) ⊆ image2 f s t :=
-  by
-  rw [image2_comm hf]
+    image2 f (s ∪ t) (s ∩ t) ⊆ image2 f s t := by rw [image2_comm hf];
   exact image2_inter_union_subset hf
 #align set.image2_union_inter_subset Set.image2_union_inter_subset
 
Diff
@@ -255,7 +255,7 @@ theorem image2_union_left : image2 f (s ∪ s') t = image2 f s t ∪ image2 f s'
   by
   ext c
   constructor
-  · rintro ⟨a, b, ha | ha, hb, rfl⟩ <;> [left, right] <;> exact ⟨_, _, ‹_›, ‹_›, rfl⟩
+  · rintro ⟨a, b, ha | ha, hb, rfl⟩ <;> [left;right] <;> exact ⟨_, _, ‹_›, ‹_›, rfl⟩
   ·
     rintro (⟨_, _, _, _, rfl⟩ | ⟨_, _, _, _, rfl⟩) <;> refine' ⟨_, _, _, ‹_›, rfl⟩ <;>
       simp [mem_union, *]
Diff
@@ -155,10 +155,22 @@ theorem image2_subset_iff {u : Set γ} : image2 f s t ⊆ u ↔ ∀ x ∈ s, ∀
   forall_image2_iff
 #align set.image2_subset_iff Set.image2_subset_iff
 
+/- warning: set.image2_subset_iff_left -> Set.image2_subset_iff_left is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β} {u : Set.{u3} γ}, Iff (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) u) (forall (a : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) -> (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) (Set.image.{u2, u3} β γ (fun (b : β) => f a b) t) u))
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {t : Set.{u1} β} {u : Set.{u3} γ}, Iff (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.instHasSubsetSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s t) u) (forall (a : α), (Membership.mem.{u2, u2} α (Set.{u2} α) (Set.instMembershipSet.{u2} α) a s) -> (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.instHasSubsetSet.{u3} γ) (Set.image.{u1, u3} β γ (fun (b : β) => f a b) t) u))
+Case conversion may be inaccurate. Consider using '#align set.image2_subset_iff_left Set.image2_subset_iff_leftₓ'. -/
 theorem image2_subset_iff_left : image2 f s t ⊆ u ↔ ∀ a ∈ s, (fun b => f a b) '' t ⊆ u := by
   simp_rw [image2_subset_iff, image_subset_iff, subset_def, mem_preimage]
 #align set.image2_subset_iff_left Set.image2_subset_iff_left
 
+/- warning: set.image2_subset_iff_right -> Set.image2_subset_iff_right is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β} {u : Set.{u3} γ}, Iff (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) u) (forall (b : β), (Membership.Mem.{u2, u2} β (Set.{u2} β) (Set.hasMem.{u2} β) b t) -> (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) (Set.image.{u1, u3} α γ (fun (a : α) => f a b) s) u))
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {t : Set.{u1} β} {u : Set.{u3} γ}, Iff (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.instHasSubsetSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s t) u) (forall (b : β), (Membership.mem.{u1, u1} β (Set.{u1} β) (Set.instMembershipSet.{u1} β) b t) -> (HasSubset.Subset.{u3} (Set.{u3} γ) (Set.instHasSubsetSet.{u3} γ) (Set.image.{u2, u3} α γ (fun (a : α) => f a b) s) u))
+Case conversion may be inaccurate. Consider using '#align set.image2_subset_iff_right Set.image2_subset_iff_rightₓ'. -/
 theorem image2_subset_iff_right : image2 f s t ⊆ u ↔ ∀ b ∈ t, (fun a => f a b) '' s ⊆ u := by
   simp_rw [image2_subset_iff, image_subset_iff, subset_def, mem_preimage, @forall₂_swap α]
 #align set.image2_subset_iff_right Set.image2_subset_iff_right
@@ -410,11 +422,23 @@ Case conversion may be inaccurate. Consider using '#align set.image2_singleton S
 theorem image2_singleton : image2 f {a} {b} = {f a b} := by simp
 #align set.image2_singleton Set.image2_singleton
 
+/- warning: set.image2_insert_left -> Set.image2_insert_left is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β} {a : α}, Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f (Insert.insert.{u1, u1} α (Set.{u1} α) (Set.hasInsert.{u1} α) a s) t) (Union.union.{u3} (Set.{u3} γ) (Set.hasUnion.{u3} γ) (Set.image.{u2, u3} β γ (fun (b : β) => f a b) t) (Set.image2.{u1, u2, u3} α β γ f s t))
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {t : Set.{u1} β} {a : α}, Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f (Insert.insert.{u2, u2} α (Set.{u2} α) (Set.instInsertSet.{u2} α) a s) t) (Union.union.{u3} (Set.{u3} γ) (Set.instUnionSet.{u3} γ) (Set.image.{u1, u3} β γ (fun (b : β) => f a b) t) (Set.image2.{u2, u1, u3} α β γ f s t))
+Case conversion may be inaccurate. Consider using '#align set.image2_insert_left Set.image2_insert_leftₓ'. -/
 @[simp]
 theorem image2_insert_left : image2 f (insert a s) t = (fun b => f a b) '' t ∪ image2 f s t := by
   rw [insert_eq, image2_union_left, image2_singleton_left]
 #align set.image2_insert_left Set.image2_insert_left
 
+/- warning: set.image2_insert_right -> Set.image2_insert_right is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β} {b : β}, Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s (Insert.insert.{u2, u2} β (Set.{u2} β) (Set.hasInsert.{u2} β) b t)) (Union.union.{u3} (Set.{u3} γ) (Set.hasUnion.{u3} γ) (Set.image.{u1, u3} α γ (fun (a : α) => f a b) s) (Set.image2.{u1, u2, u3} α β γ f s t))
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {t : Set.{u1} β} {b : β}, Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s (Insert.insert.{u1, u1} β (Set.{u1} β) (Set.instInsertSet.{u1} β) b t)) (Union.union.{u3} (Set.{u3} γ) (Set.instUnionSet.{u3} γ) (Set.image.{u2, u3} α γ (fun (a : α) => f a b) s) (Set.image2.{u2, u1, u3} α β γ f s t))
+Case conversion may be inaccurate. Consider using '#align set.image2_insert_right Set.image2_insert_rightₓ'. -/
 @[simp]
 theorem image2_insert_right : image2 f s (insert b t) = (fun a => f a b) '' s ∪ image2 f s t := by
   rw [insert_eq, image2_union_right, image2_singleton_right]
@@ -846,6 +870,12 @@ theorem image2_right_identity {f : α → β → α} {b : β} (h : ∀ a, f a b
     image2 f s {b} = s := by rw [image2_singleton_right, funext h, image_id']
 #align set.image2_right_identity Set.image2_right_identity
 
+/- warning: set.image2_inter_union_subset_union -> Set.image2_inter_union_subset_union is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {s' : Set.{u1} α} {t : Set.{u2} β} {t' : Set.{u2} β}, HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s s') (Union.union.{u2} (Set.{u2} β) (Set.hasUnion.{u2} β) t t')) (Union.union.{u3} (Set.{u3} γ) (Set.hasUnion.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) (Set.image2.{u1, u2, u3} α β γ f s' t'))
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {s' : Set.{u2} α} {t : Set.{u1} β} {t' : Set.{u1} β}, HasSubset.Subset.{u3} (Set.{u3} γ) (Set.instHasSubsetSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f (Inter.inter.{u2} (Set.{u2} α) (Set.instInterSet.{u2} α) s s') (Union.union.{u1} (Set.{u1} β) (Set.instUnionSet.{u1} β) t t')) (Union.union.{u3} (Set.{u3} γ) (Set.instUnionSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s t) (Set.image2.{u2, u1, u3} α β γ f s' t'))
+Case conversion may be inaccurate. Consider using '#align set.image2_inter_union_subset_union Set.image2_inter_union_subset_unionₓ'. -/
 theorem image2_inter_union_subset_union :
     image2 f (s ∩ s') (t ∪ t') ⊆ image2 f s t ∪ image2 f s' t' :=
   by
@@ -855,6 +885,12 @@ theorem image2_inter_union_subset_union :
       (image2_subset_right <| inter_subset_right _ _)
 #align set.image2_inter_union_subset_union Set.image2_inter_union_subset_union
 
+/- warning: set.image2_union_inter_subset_union -> Set.image2_union_inter_subset_union is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u1} α} {s' : Set.{u1} α} {t : Set.{u2} β} {t' : Set.{u2} β}, HasSubset.Subset.{u3} (Set.{u3} γ) (Set.hasSubset.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s s') (Inter.inter.{u2} (Set.{u2} β) (Set.hasInter.{u2} β) t t')) (Union.union.{u3} (Set.{u3} γ) (Set.hasUnion.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) (Set.image2.{u1, u2, u3} α β γ f s' t'))
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {s' : Set.{u2} α} {t : Set.{u1} β} {t' : Set.{u1} β}, HasSubset.Subset.{u3} (Set.{u3} γ) (Set.instHasSubsetSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f (Union.union.{u2} (Set.{u2} α) (Set.instUnionSet.{u2} α) s s') (Inter.inter.{u1} (Set.{u1} β) (Set.instInterSet.{u1} β) t t')) (Union.union.{u3} (Set.{u3} γ) (Set.instUnionSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s t) (Set.image2.{u2, u1, u3} α β γ f s' t'))
+Case conversion may be inaccurate. Consider using '#align set.image2_union_inter_subset_union Set.image2_union_inter_subset_unionₓ'. -/
 theorem image2_union_inter_subset_union :
     image2 f (s ∪ s') (t ∩ t') ⊆ image2 f s t ∪ image2 f s' t' :=
   by
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Floris van Doorn
 
 ! This file was ported from Lean 3 source module data.set.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.
 -/
@@ -155,6 +155,14 @@ theorem image2_subset_iff {u : Set γ} : image2 f s t ⊆ u ↔ ∀ x ∈ s, ∀
   forall_image2_iff
 #align set.image2_subset_iff Set.image2_subset_iff
 
+theorem image2_subset_iff_left : image2 f s t ⊆ u ↔ ∀ a ∈ s, (fun b => f a b) '' t ⊆ u := by
+  simp_rw [image2_subset_iff, image_subset_iff, subset_def, mem_preimage]
+#align set.image2_subset_iff_left Set.image2_subset_iff_left
+
+theorem image2_subset_iff_right : image2 f s t ⊆ u ↔ ∀ b ∈ t, (fun a => f a b) '' s ⊆ u := by
+  simp_rw [image2_subset_iff, image_subset_iff, subset_def, mem_preimage, @forall₂_swap α]
+#align set.image2_subset_iff_right Set.image2_subset_iff_right
+
 variable (f)
 
 /- warning: set.image_prod -> Set.image_prod is a dubious translation:
@@ -211,6 +219,18 @@ theorem image2_curry (f : α × β → γ) (s : Set α) (t : Set β) :
     image2 (fun a b => f (a, b)) s t = f '' s ×ˢ t := by simp [← image_uncurry_prod, uncurry]
 #align set.image2_curry Set.image2_curry
 
+/- warning: set.image2_swap -> Set.image2_swap is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (s : Set.{u1} α) (t : Set.{u2} β), Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) (Set.image2.{u2, u1, u3} β α γ (fun (a : β) (b : α) => f b a) t s)
+but is expected to have type
+  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : α -> β -> γ) (s : Set.{u3} α) (t : Set.{u2} β), Eq.{succ u1} (Set.{u1} γ) (Set.image2.{u3, u2, u1} α β γ f s t) (Set.image2.{u2, u3, u1} β α γ (fun (a : β) (b : α) => f b a) t s)
+Case conversion may be inaccurate. Consider using '#align set.image2_swap Set.image2_swapₓ'. -/
+theorem image2_swap (s : Set α) (t : Set β) : image2 f s t = image2 (fun a b => f b a) t s :=
+  by
+  ext
+  constructor <;> rintro ⟨a, b, ha, hb, rfl⟩ <;> refine' ⟨b, a, hb, ha, rfl⟩
+#align set.image2_swap Set.image2_swap
+
 variable {f}
 
 /- warning: set.image2_union_left -> Set.image2_union_left is a dubious translation:
@@ -235,14 +255,8 @@ lean 3 declaration is
 but is expected to have type
   forall {α : Type.{u2}} {β : Type.{u1}} {γ : Type.{u3}} {f : α -> β -> γ} {s : Set.{u2} α} {t : Set.{u1} β} {t' : Set.{u1} β}, Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s (Union.union.{u1} (Set.{u1} β) (Set.instUnionSet.{u1} β) t t')) (Union.union.{u3} (Set.{u3} γ) (Set.instUnionSet.{u3} γ) (Set.image2.{u2, u1, u3} α β γ f s t) (Set.image2.{u2, u1, u3} α β γ f s t'))
 Case conversion may be inaccurate. Consider using '#align set.image2_union_right Set.image2_union_rightₓ'. -/
-theorem image2_union_right : image2 f s (t ∪ t') = image2 f s t ∪ image2 f s t' :=
-  by
-  ext c
-  constructor
-  · rintro ⟨a, b, ha, h1b | h2b, rfl⟩ <;> [left, right] <;> exact ⟨_, _, ‹_›, ‹_›, rfl⟩
-  ·
-    rintro (⟨_, _, _, _, rfl⟩ | ⟨_, _, _, _, rfl⟩) <;> refine' ⟨_, _, ‹_›, _, rfl⟩ <;>
-      simp [mem_union, *]
+theorem image2_union_right : image2 f s (t ∪ t') = image2 f s t ∪ image2 f s t' := by
+  rw [← image2_swap, image2_union_left, image2_swap f, image2_swap f]
 #align set.image2_union_right Set.image2_union_right
 
 /- warning: set.image2_inter_left -> Set.image2_inter_left is a dubious translation:
@@ -396,6 +410,16 @@ Case conversion may be inaccurate. Consider using '#align set.image2_singleton S
 theorem image2_singleton : image2 f {a} {b} = {f a b} := by simp
 #align set.image2_singleton Set.image2_singleton
 
+@[simp]
+theorem image2_insert_left : image2 f (insert a s) t = (fun b => f a b) '' t ∪ image2 f s t := by
+  rw [insert_eq, image2_union_left, image2_singleton_left]
+#align set.image2_insert_left Set.image2_insert_left
+
+@[simp]
+theorem image2_insert_right : image2 f s (insert b t) = (fun a => f a b) '' s ∪ image2 f s t := by
+  rw [insert_eq, image2_union_right, image2_singleton_right]
+#align set.image2_insert_right Set.image2_insert_right
+
 /- warning: set.image2_congr -> Set.image2_congr is a dubious translation:
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {f : α -> β -> γ} {f' : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u2} β}, (forall (a : α), (Membership.Mem.{u1, u1} α (Set.{u1} α) (Set.hasMem.{u1} α) a s) -> (forall (b : β), (Membership.Mem.{u2, u2} β (Set.{u2} β) (Set.hasMem.{u2} β) b t) -> (Eq.{succ u3} γ (f a b) (f' a b)))) -> (Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) (Set.image2.{u1, u2, u3} α β γ f' s t))
@@ -553,19 +577,6 @@ theorem image2_image_right (f : α → γ → δ) (g : β → γ) :
     refine' ⟨a, _, ha, ⟨b, hb, rfl⟩, rfl⟩
 #align set.image2_image_right Set.image2_image_right
 
-/- warning: set.image2_swap -> Set.image2_swap is a dubious translation:
-lean 3 declaration is
-  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} (f : α -> β -> γ) (s : Set.{u1} α) (t : Set.{u2} β), Eq.{succ u3} (Set.{u3} γ) (Set.image2.{u1, u2, u3} α β γ f s t) (Set.image2.{u2, u1, u3} β α γ (fun (a : β) (b : α) => f b a) t s)
-but is expected to have type
-  forall {α : Type.{u3}} {β : Type.{u2}} {γ : Type.{u1}} (f : α -> β -> γ) (s : Set.{u3} α) (t : Set.{u2} β), Eq.{succ u1} (Set.{u1} γ) (Set.image2.{u3, u2, u1} α β γ f s t) (Set.image2.{u2, u3, u1} β α γ (fun (a : β) (b : α) => f b a) t s)
-Case conversion may be inaccurate. Consider using '#align set.image2_swap Set.image2_swapₓ'. -/
-theorem image2_swap (f : α → β → γ) (s : Set α) (t : Set β) :
-    image2 f s t = image2 (fun a b => f b a) t s :=
-  by
-  ext
-  constructor <;> rintro ⟨a, b, ha, hb, rfl⟩ <;> refine' ⟨b, a, hb, ha, rfl⟩
-#align set.image2_swap Set.image2_swap
-
 #print Set.image2_left /-
 @[simp]
 theorem image2_left (h : t.Nonempty) : image2 (fun x y => x) s t = s := by
@@ -835,6 +846,24 @@ theorem image2_right_identity {f : α → β → α} {b : β} (h : ∀ a, f a b
     image2 f s {b} = s := by rw [image2_singleton_right, funext h, image_id']
 #align set.image2_right_identity Set.image2_right_identity
 
+theorem image2_inter_union_subset_union :
+    image2 f (s ∩ s') (t ∪ t') ⊆ image2 f s t ∪ image2 f s' t' :=
+  by
+  rw [image2_union_right]
+  exact
+    union_subset_union (image2_subset_right <| inter_subset_left _ _)
+      (image2_subset_right <| inter_subset_right _ _)
+#align set.image2_inter_union_subset_union Set.image2_inter_union_subset_union
+
+theorem image2_union_inter_subset_union :
+    image2 f (s ∪ s') (t ∩ t') ⊆ image2 f s t ∪ image2 f s' t' :=
+  by
+  rw [image2_union_left]
+  exact
+    union_subset_union (image2_subset_left <| inter_subset_left _ _)
+      (image2_subset_left <| inter_subset_right _ _)
+#align set.image2_union_inter_subset_union Set.image2_union_inter_subset_union
+
 /- warning: set.image2_inter_union_subset -> Set.image2_inter_union_subset is a dubious translation:
 lean 3 declaration is
   forall {α : Type.{u1}} {β : Type.{u2}} {f : α -> α -> β} {s : Set.{u1} α} {t : Set.{u1} α}, (forall (a : α) (b : α), Eq.{succ u2} β (f a b) (f b a)) -> (HasSubset.Subset.{u2} (Set.{u2} β) (Set.hasSubset.{u2} β) (Set.image2.{u1, u1, u2} α α β f (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s t) (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t)) (Set.image2.{u1, u1, u2} α α β f s t))
@@ -844,10 +873,8 @@ Case conversion may be inaccurate. Consider using '#align set.image2_inter_union
 theorem image2_inter_union_subset {f : α → α → β} {s t : Set α} (hf : ∀ a b, f a b = f b a) :
     image2 f (s ∩ t) (s ∪ t) ⊆ image2 f s t :=
   by
-  rintro _ ⟨a, b, ha, hb | hb, rfl⟩
-  · rw [hf]
-    exact mem_image2_of_mem hb ha.2
-  · exact mem_image2_of_mem ha.1 hb
+  rw [inter_comm]
+  exact image2_inter_union_subset_union.trans (union_subset (image2_comm hf).Subset subset.rfl)
 #align set.image2_inter_union_subset Set.image2_inter_union_subset
 
 /- warning: set.image2_union_inter_subset -> Set.image2_union_inter_subset is a dubious translation:
Diff
@@ -835,6 +835,12 @@ theorem image2_right_identity {f : α → β → α} {b : β} (h : ∀ a, f a b
     image2 f s {b} = s := by rw [image2_singleton_right, funext h, image_id']
 #align set.image2_right_identity Set.image2_right_identity
 
+/- warning: set.image2_inter_union_subset -> Set.image2_inter_union_subset is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} {f : α -> α -> β} {s : Set.{u1} α} {t : Set.{u1} α}, (forall (a : α) (b : α), Eq.{succ u2} β (f a b) (f b a)) -> (HasSubset.Subset.{u2} (Set.{u2} β) (Set.hasSubset.{u2} β) (Set.image2.{u1, u1, u2} α α β f (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s t) (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t)) (Set.image2.{u1, u1, u2} α α β f s t))
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} {f : α -> α -> β} {s : Set.{u2} α} {t : Set.{u2} α}, (forall (a : α) (b : α), Eq.{succ u1} β (f a b) (f b a)) -> (HasSubset.Subset.{u1} (Set.{u1} β) (Set.instHasSubsetSet.{u1} β) (Set.image2.{u2, u2, u1} α α β f (Inter.inter.{u2} (Set.{u2} α) (Set.instInterSet.{u2} α) s t) (Union.union.{u2} (Set.{u2} α) (Set.instUnionSet.{u2} α) s t)) (Set.image2.{u2, u2, u1} α α β f s t))
+Case conversion may be inaccurate. Consider using '#align set.image2_inter_union_subset Set.image2_inter_union_subsetₓ'. -/
 theorem image2_inter_union_subset {f : α → α → β} {s t : Set α} (hf : ∀ a b, f a b = f b a) :
     image2 f (s ∩ t) (s ∪ t) ⊆ image2 f s t :=
   by
@@ -844,6 +850,12 @@ theorem image2_inter_union_subset {f : α → α → β} {s t : Set α} (hf : 
   · exact mem_image2_of_mem ha.1 hb
 #align set.image2_inter_union_subset Set.image2_inter_union_subset
 
+/- warning: set.image2_union_inter_subset -> Set.image2_union_inter_subset is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} {f : α -> α -> β} {s : Set.{u1} α} {t : Set.{u1} α}, (forall (a : α) (b : α), Eq.{succ u2} β (f a b) (f b a)) -> (HasSubset.Subset.{u2} (Set.{u2} β) (Set.hasSubset.{u2} β) (Set.image2.{u1, u1, u2} α α β f (Union.union.{u1} (Set.{u1} α) (Set.hasUnion.{u1} α) s t) (Inter.inter.{u1} (Set.{u1} α) (Set.hasInter.{u1} α) s t)) (Set.image2.{u1, u1, u2} α α β f s t))
+but is expected to have type
+  forall {α : Type.{u2}} {β : Type.{u1}} {f : α -> α -> β} {s : Set.{u2} α} {t : Set.{u2} α}, (forall (a : α) (b : α), Eq.{succ u1} β (f a b) (f b a)) -> (HasSubset.Subset.{u1} (Set.{u1} β) (Set.instHasSubsetSet.{u1} β) (Set.image2.{u2, u2, u1} α α β f (Union.union.{u2} (Set.{u2} α) (Set.instUnionSet.{u2} α) s t) (Inter.inter.{u2} (Set.{u2} α) (Set.instInterSet.{u2} α) s t)) (Set.image2.{u2, u2, u1} α α β f s t))
+Case conversion may be inaccurate. Consider using '#align set.image2_union_inter_subset Set.image2_union_inter_subsetₓ'. -/
 theorem image2_union_inter_subset {f : α → α → β} {s t : Set α} (hf : ∀ a b, f a b = f b a) :
     image2 f (s ∪ t) (s ∩ t) ⊆ image2 f s t :=
   by
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Floris van Doorn
 
 ! This file was ported from Lean 3 source module data.set.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.
 -/
@@ -835,5 +835,21 @@ theorem image2_right_identity {f : α → β → α} {b : β} (h : ∀ a, f a b
     image2 f s {b} = s := by rw [image2_singleton_right, funext h, image_id']
 #align set.image2_right_identity Set.image2_right_identity
 
+theorem image2_inter_union_subset {f : α → α → β} {s t : Set α} (hf : ∀ a b, f a b = f b a) :
+    image2 f (s ∩ t) (s ∪ t) ⊆ image2 f s t :=
+  by
+  rintro _ ⟨a, b, ha, hb | hb, rfl⟩
+  · rw [hf]
+    exact mem_image2_of_mem hb ha.2
+  · exact mem_image2_of_mem ha.1 hb
+#align set.image2_inter_union_subset Set.image2_inter_union_subset
+
+theorem image2_union_inter_subset {f : α → α → β} {s t : Set α} (hf : ∀ a b, f a b = f b a) :
+    image2 f (s ∪ t) (s ∩ t) ⊆ image2 f s t :=
+  by
+  rw [image2_comm hf]
+  exact image2_inter_union_subset hf
+#align set.image2_union_inter_subset Set.image2_union_inter_subset
+
 end Set
 
Diff
@@ -634,6 +634,12 @@ theorem image2_right_comm {f : δ → γ → ε} {g : α → β → δ} {f' : α
   exact image2_assoc fun _ _ _ => h_right_comm _ _ _
 #align set.image2_right_comm Set.image2_right_comm
 
+/- warning: set.image2_image2_image2_comm -> Set.image2_image2_image2_comm is a dubious translation:
+lean 3 declaration is
+  forall {α : Type.{u1}} {β : Type.{u2}} {γ : Type.{u3}} {δ : Type.{u4}} {ε : Type.{u5}} {ε' : Type.{u6}} {ζ : Type.{u7}} {ζ' : Type.{u8}} {ν : Type.{u9}} {s : Set.{u1} α} {t : Set.{u2} β} {u : Set.{u3} γ} {v : Set.{u4} δ} {f : ε -> ζ -> ν} {g : α -> β -> ε} {h : γ -> δ -> ζ} {f' : ε' -> ζ' -> ν} {g' : α -> γ -> ε'} {h' : β -> δ -> ζ'}, (forall (a : α) (b : β) (c : γ) (d : δ), Eq.{succ u9} ν (f (g a b) (h c d)) (f' (g' a c) (h' b d))) -> (Eq.{succ u9} (Set.{u9} ν) (Set.image2.{u5, u7, u9} ε ζ ν f (Set.image2.{u1, u2, u5} α β ε g s t) (Set.image2.{u3, u4, u7} γ δ ζ h u v)) (Set.image2.{u6, u8, u9} ε' ζ' ν f' (Set.image2.{u1, u3, u6} α γ ε' g' s u) (Set.image2.{u2, u4, u8} β δ ζ' h' t v)))
+but is expected to have type
+  forall {α : Type.{u6}} {β : Type.{u5}} {γ : Type.{u4}} {δ : Type.{u3}} {ε : Type.{u8}} {ε' : Type.{u2}} {ζ : Type.{u7}} {ζ' : Type.{u1}} {ν : Type.{u9}} {s : Set.{u6} α} {t : Set.{u5} β} {u : Set.{u4} γ} {v : Set.{u3} δ} {f : ε -> ζ -> ν} {g : α -> β -> ε} {h : γ -> δ -> ζ} {f' : ε' -> ζ' -> ν} {g' : α -> γ -> ε'} {h' : β -> δ -> ζ'}, (forall (a : α) (b : β) (c : γ) (d : δ), Eq.{succ u9} ν (f (g a b) (h c d)) (f' (g' a c) (h' b d))) -> (Eq.{succ u9} (Set.{u9} ν) (Set.image2.{u8, u7, u9} ε ζ ν f (Set.image2.{u6, u5, u8} α β ε g s t) (Set.image2.{u4, u3, u7} γ δ ζ h u v)) (Set.image2.{u2, u1, u9} ε' ζ' ν f' (Set.image2.{u6, u4, u2} α γ ε' g' s u) (Set.image2.{u5, u3, u1} β δ ζ' h' t v)))
+Case conversion may be inaccurate. Consider using '#align set.image2_image2_image2_comm Set.image2_image2_image2_commₓ'. -/
 theorem image2_image2_image2_comm {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)) :
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Floris van Doorn
 
 ! This file was ported from Lean 3 source module data.set.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.
 -/
@@ -33,9 +33,10 @@ open Function
 
 namespace Set
 
-variable {α α' β β' γ γ' δ δ' ε ε' : Type _} {f f' : α → β → γ} {g g' : α → β → γ → δ}
+variable {α α' β β' γ γ' δ δ' ε ε' ζ ζ' ν : Type _} {f f' : α → β → γ} {g g' : α → β → γ → δ}
 
-variable {s s' : Set α} {t t' : Set β} {u u' : Set γ} {a a' : α} {b b' : β} {c c' : γ} {d d' : δ}
+variable {s s' : Set α} {t t' : Set β} {u u' : Set γ} {v : Set δ} {a a' : α} {b b' : β} {c c' : γ}
+  {d d' : δ}
 
 #print Set.image2 /-
 /-- The image of a binary function `f : α → β → γ` as a function `set α → set β → set γ`.
@@ -633,6 +634,19 @@ theorem image2_right_comm {f : δ → γ → ε} {g : α → β → δ} {f' : α
   exact image2_assoc fun _ _ _ => h_right_comm _ _ _
 #align set.image2_right_comm Set.image2_right_comm
 
+theorem image2_image2_image2_comm {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)) :
+    image2 f (image2 g s t) (image2 h u v) = image2 f' (image2 g' s u) (image2 h' t v) :=
+  by
+  ext
+  constructor
+  · rintro ⟨_, _, ⟨a, b, ha, hb, rfl⟩, ⟨c, d, hc, hd, rfl⟩, rfl⟩
+    exact ⟨_, _, ⟨a, c, ha, hc, rfl⟩, ⟨b, d, hb, hd, rfl⟩, (h_comm _ _ _ _).symm⟩
+  · rintro ⟨_, _, ⟨a, c, ha, hc, rfl⟩, ⟨b, d, hb, hd, rfl⟩, rfl⟩
+    exact ⟨_, _, ⟨a, b, ha, hb, rfl⟩, ⟨c, d, hc, hd, rfl⟩, h_comm _ _ _ _⟩
+#align set.image2_image2_image2_comm Set.image2_image2_image2_comm
+
 /- warning: set.image_image2_distrib -> Set.image_image2_distrib is a dubious translation:
 lean 3 declaration is
   forall {α : Type.{u1}} {α' : Type.{u2}} {β : Type.{u3}} {β' : Type.{u4}} {γ : Type.{u5}} {δ : Type.{u6}} {f : α -> β -> γ} {s : Set.{u1} α} {t : Set.{u3} β} {g : γ -> δ} {f' : α' -> β' -> δ} {g₁ : α -> α'} {g₂ : β -> β'}, (forall (a : α) (b : β), Eq.{succ u6} δ (g (f a b)) (f' (g₁ a) (g₂ b))) -> (Eq.{succ u6} (Set.{u6} δ) (Set.image.{u5, u6} γ δ g (Set.image2.{u1, u3, u5} α β γ f s t)) (Set.image2.{u2, u4, u6} α' β' δ f' (Set.image.{u1, u2} α α' g₁ s) (Set.image.{u3, u4} β β' g₂ t)))

Changes in mathlib4

mathlib3
mathlib4
chore: Remove ball and bex from lemma names (#10816)

ball for "bounded forall" and bex for "bounded exists" are from experience very confusing abbreviations. This PR renames them to forall_mem and exists_mem in the few Set lemma names that mention them.

Also deprecate ball_image_of_ball, mem_image_elim, mem_image_elim_on since those lemmas are duplicates of the renamed lemmas (apart from argument order and implicitness, which I am also fixing by making the binder in the RHS of forall_mem_image semi-implicit), have obscure names and are completely unused.

Diff
@@ -48,11 +48,11 @@ theorem image2_subset_right (hs : s ⊆ s') : image2 f s t ⊆ image2 f s' t :=
 #align set.image2_subset_right Set.image2_subset_right
 
 theorem image_subset_image2_left (hb : b ∈ t) : (fun a => f a b) '' s ⊆ image2 f s t :=
-  ball_image_of_ball fun _ ha => mem_image2_of_mem ha hb
+  forall_mem_image.2 fun _ ha => mem_image2_of_mem ha hb
 #align set.image_subset_image2_left Set.image_subset_image2_left
 
 theorem image_subset_image2_right (ha : a ∈ s) : f a '' t ⊆ image2 f s t :=
-  ball_image_of_ball fun _ => mem_image2_of_mem ha
+  forall_mem_image.2 fun _ => mem_image2_of_mem ha
 #align set.image_subset_image2_right Set.image_subset_image2_right
 
 theorem forall_image2_iff {p : γ → Prop} :
chore(Data/Set): move definitions to a new file (#9737)

This and other similar PRs will help us reduce import dependencies and improve parallel compilation in the future.

Diff
@@ -26,21 +26,6 @@ variable {α α' β β' γ γ' δ δ' ε ε' ζ ζ' ν : Type*} {f f' : α → 
 variable {s s' : Set α} {t t' : Set β} {u u' : Set γ} {v : Set δ} {a a' : α} {b b' : β} {c c' : γ}
   {d d' : δ}
 
-/-- The image of a binary function `f : α → β → γ` as a function `Set α → Set β → Set γ`.
-Mathematically this should be thought of as the image of the corresponding function `α × β → γ`.-/
-def image2 (f : α → β → γ) (s : Set α) (t : Set β) : Set γ :=
-  { c | ∃ a ∈ s, ∃ b ∈ t, f a b = c }
-#align set.image2 Set.image2
-
-@[simp]
-theorem mem_image2 : c ∈ image2 f s t ↔ ∃ a ∈ s, ∃ b ∈ t, f a b = c :=
-  Iff.rfl
-#align set.mem_image2 Set.mem_image2
-
-theorem mem_image2_of_mem (ha : a ∈ s) (hb : b ∈ t) : f a b ∈ image2 f s t :=
-  ⟨a, ha, b, hb, rfl⟩
-#align set.mem_image2_of_mem Set.mem_image2_of_mem
-
 theorem mem_image2_iff (hf : Injective2 f) : f a b ∈ image2 f s t ↔ a ∈ s ∧ b ∈ t :=
   ⟨by
     rintro ⟨a', ha', b', hb', h⟩
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
@@ -29,28 +29,28 @@ variable {s s' : Set α} {t t' : Set β} {u u' : Set γ} {v : Set δ} {a a' : α
 /-- The image of a binary function `f : α → β → γ` as a function `Set α → Set β → Set γ`.
 Mathematically this should be thought of as the image of the corresponding function `α × β → γ`.-/
 def image2 (f : α → β → γ) (s : Set α) (t : Set β) : Set γ :=
-  { c | ∃ a b, a ∈ s ∧ b ∈ t ∧ f a b = c }
+  { c | ∃ a ∈ s, ∃ b ∈ t, f a b = c }
 #align set.image2 Set.image2
 
 @[simp]
-theorem mem_image2 : c ∈ image2 f s t ↔ ∃ a b, a ∈ s ∧ b ∈ t ∧ f a b = c :=
+theorem mem_image2 : c ∈ image2 f s t ↔ ∃ a ∈ s, ∃ b ∈ t, f a b = c :=
   Iff.rfl
 #align set.mem_image2 Set.mem_image2
 
 theorem mem_image2_of_mem (ha : a ∈ s) (hb : b ∈ t) : f a b ∈ image2 f s t :=
-  ⟨a, b, ha, hb, rfl⟩
+  ⟨a, ha, b, hb, rfl⟩
 #align set.mem_image2_of_mem Set.mem_image2_of_mem
 
 theorem mem_image2_iff (hf : Injective2 f) : f a b ∈ image2 f s t ↔ a ∈ s ∧ b ∈ t :=
   ⟨by
-    rintro ⟨a', b', ha', hb', h⟩
+    rintro ⟨a', ha', b', hb', h⟩
     rcases hf h with ⟨rfl, rfl⟩
     exact ⟨ha', hb'⟩, fun ⟨ha, hb⟩ => mem_image2_of_mem ha hb⟩
 #align set.mem_image2_iff Set.mem_image2_iff
 
 /-- image2 is monotone with respect to `⊆`. -/
 theorem image2_subset (hs : s ⊆ s') (ht : t ⊆ t') : image2 f s t ⊆ image2 f s' t' := by
-  rintro _ ⟨a, b, ha, hb, rfl⟩
+  rintro _ ⟨a, ha, b, hb, rfl⟩
   exact mem_image2_of_mem (hs ha) (ht hb)
 #align set.image2_subset Set.image2_subset
 
@@ -72,7 +72,7 @@ theorem image_subset_image2_right (ha : a ∈ s) : f a '' t ⊆ image2 f s t :=
 
 theorem forall_image2_iff {p : γ → Prop} :
     (∀ z ∈ image2 f s t, p z) ↔ ∀ x ∈ s, ∀ y ∈ t, p (f x y) :=
-  ⟨fun h x hx y hy => h _ ⟨x, y, hx, hy, rfl⟩, fun h _ ⟨x, y, hx, hy, hz⟩ => hz ▸ h x hx y hy⟩
+  ⟨fun h x hx y hy => h _ ⟨x, hx, y, hy, rfl⟩, fun h _ ⟨x, hx, y, hy, hz⟩ => hz ▸ h x hx y hy⟩
 #align set.forall_image2_iff Set.forall_image2_iff
 
 @[simp]
@@ -92,16 +92,14 @@ variable (f)
 
 -- Porting note: Removing `simp` - LHS does not simplify
 lemma image_prod : (fun x : α × β ↦ f x.1 x.2) '' s ×ˢ t = image2 f s t :=
-  ext $ fun a ↦
-  ⟨ by rintro ⟨_, _, rfl⟩; exact ⟨_, _, (mem_prod.1 ‹_›).1, (mem_prod.1 ‹_›).2, rfl⟩,
-    by rintro ⟨_, _, _, _, rfl⟩; exact ⟨(_, _), ⟨‹_›, ‹_›⟩, rfl⟩⟩
+  ext fun _ ↦ by simp [and_assoc]
 #align set.image_prod Set.image_prod
 
 @[simp] lemma image_uncurry_prod (s : Set α) (t : Set β) : uncurry f '' s ×ˢ t = image2 f s t :=
   image_prod _
 #align set.image_uncurry_prod Set.image_uncurry_prod
 
-@[simp] lemma image2_mk_eq_prod : image2 Prod.mk s t = s ×ˢ t := ext $ by simp
+@[simp] lemma image2_mk_eq_prod : image2 Prod.mk s t = s ×ˢ t := ext <| by simp
 #align set.image2_mk_eq_prod Set.image2_mk_eq_prod
 
 -- Porting note: Removing `simp` - LHS does not simplify
@@ -112,7 +110,7 @@ lemma image2_curry (f : α × β → γ) (s : Set α) (t : Set β) :
 
 theorem image2_swap (s : Set α) (t : Set β) : image2 f s t = image2 (fun a b => f b a) t s := by
   ext
-  constructor <;> rintro ⟨a, b, ha, hb, rfl⟩ <;> exact ⟨b, a, hb, ha, rfl⟩
+  constructor <;> rintro ⟨a, ha, b, hb, rfl⟩ <;> exact ⟨b, hb, a, ha, rfl⟩
 #align set.image2_swap Set.image2_swap
 
 variable {f}
@@ -151,7 +149,7 @@ theorem Nonempty.image2 : s.Nonempty → t.Nonempty → (image2 f s t).Nonempty
 
 @[simp]
 theorem image2_nonempty_iff : (image2 f s t).Nonempty ↔ s.Nonempty ∧ t.Nonempty :=
-  ⟨fun ⟨_, a, b, ha, hb, _⟩ => ⟨⟨a, ha⟩, b, hb⟩, fun h => h.1.image2 h.2⟩
+  ⟨fun ⟨_, a, ha, b, hb, _⟩ => ⟨⟨a, ha⟩, b, hb⟩, fun h => h.1.image2 h.2⟩
 #align set.image2_nonempty_iff Set.image2_nonempty_iff
 
 theorem Nonempty.of_image2_left (h : (Set.image2 f s t).Nonempty) : s.Nonempty :=
@@ -207,7 +205,7 @@ theorem image2_insert_right : image2 f s (insert b t) = (fun a => f a b) '' s 
 @[congr]
 theorem image2_congr (h : ∀ a ∈ s, ∀ b ∈ t, f a b = f' a b) : image2 f s t = image2 f' s t := by
   ext
-  constructor <;> rintro ⟨a, b, ha, hb, rfl⟩ <;> refine' ⟨a, b, ha, hb, by rw [h a ha b hb]⟩
+  constructor <;> rintro ⟨a, ha, b, hb, rfl⟩ <;> exact ⟨a, ha, b, hb, by rw [h a ha b hb]⟩
 #align set.image2_congr Set.image2_congr
 
 /-- A common special case of `image2_congr` -/
@@ -254,10 +252,8 @@ lemma image2_range (f : α' → β' → γ) (g : α → α') (h : β → β') :
 
 theorem image2_assoc {f : δ → γ → ε} {g : α → β → δ} {f' : α → ε' → ε} {g' : β → γ → ε'}
     (h_assoc : ∀ a b c, f (g a b) c = f' a (g' b c)) :
-    image2 f (image2 g s t) u = image2 f' s (image2 g' t u) := by
-  rw [← image_prod g, ← image_prod g', image2_image_left, image2_image_right]
-  ext
-  simp only [mem_image2, Prod.exists, h_assoc, prod_mk_mem_set_prod_eq, and_assoc]
+    image2 f (image2 g s t) u = image2 f' s (image2 g' t u) :=
+  eq_of_forall_subset_iff fun _ ↦ by simp only [image2_subset_iff, forall_image2_iff, h_assoc]
 #align set.image2_assoc Set.image2_assoc
 
 theorem image2_comm {g : β → α → γ} (h_comm : ∀ a b, f a b = g b a) : image2 f s t = image2 g t s :=
@@ -283,10 +279,10 @@ theorem image2_image2_image2_comm {f : ε → ζ → ν} {g : α → β → ε}
     (h_comm : ∀ a b c d, f (g a b) (h c d) = f' (g' a c) (h' b d)) :
     image2 f (image2 g s t) (image2 h u v) = image2 f' (image2 g' s u) (image2 h' t v) := by
   ext; constructor
-  · rintro ⟨_, _, ⟨a, b, ha, hb, rfl⟩, ⟨c, d, hc, hd, rfl⟩, rfl⟩
-    exact ⟨_, _, ⟨a, c, ha, hc, rfl⟩, ⟨b, d, hb, hd, rfl⟩, (h_comm _ _ _ _).symm⟩
-  · rintro ⟨_, _, ⟨a, c, ha, hc, rfl⟩, ⟨b, d, hb, hd, rfl⟩, rfl⟩
-    exact ⟨_, _, ⟨a, b, ha, hb, rfl⟩, ⟨c, d, hc, hd, rfl⟩, h_comm _ _ _ _⟩
+  · rintro ⟨_, ⟨a, ha, b, hb, rfl⟩, _, ⟨c, hc, d, hd, rfl⟩, rfl⟩
+    exact ⟨_, ⟨a, ha, c, hc, rfl⟩, _, ⟨b, hb, d, hd, rfl⟩, (h_comm _ _ _ _).symm⟩
+  · rintro ⟨_, ⟨a, ha, c, hc, rfl⟩, _, ⟨b, hb, d, hd, rfl⟩, rfl⟩
+    exact ⟨_, ⟨a, ha, b, hb, rfl⟩, _, ⟨c, hc, d, hd, rfl⟩, h_comm _ _ _ _⟩
 #align set.image2_image2_image2_comm Set.image2_image2_image2_comm
 
 theorem image_image2_distrib {g : γ → δ} {f' : α' → β' → δ} {g₁ : α → α'} {g₂ : β → β'}
@@ -327,7 +323,7 @@ theorem image_image2_right_comm {f : α → β' → γ} {g : β → β'} {f' : 
 theorem image2_distrib_subset_left {f : α → δ → ε} {g : β → γ → δ} {f₁ : α → β → β'}
     {f₂ : α → γ → γ'} {g' : β' → γ' → ε} (h_distrib : ∀ a b c, f a (g b c) = g' (f₁ a b) (f₂ a c)) :
     image2 f s (image2 g t u) ⊆ image2 g' (image2 f₁ s t) (image2 f₂ s u) := by
-  rintro _ ⟨a, _, ha, ⟨b, c, hb, hc, rfl⟩, rfl⟩
+  rintro _ ⟨a, ha, _, ⟨b, hb, c, hc, rfl⟩, rfl⟩
   rw [h_distrib]
   exact mem_image2_of_mem (mem_image2_of_mem ha hb) (mem_image2_of_mem ha hc)
 #align set.image2_distrib_subset_left Set.image2_distrib_subset_left
@@ -336,7 +332,7 @@ theorem image2_distrib_subset_left {f : α → δ → ε} {g : β → γ → δ}
 theorem image2_distrib_subset_right {f : δ → γ → ε} {g : α → β → δ} {f₁ : α → γ → α'}
     {f₂ : β → γ → β'} {g' : α' → β' → ε} (h_distrib : ∀ a b c, f (g a b) c = g' (f₁ a c) (f₂ b c)) :
     image2 f (image2 g s t) u ⊆ image2 g' (image2 f₁ s u) (image2 f₂ t u) := by
-  rintro _ ⟨_, c, ⟨a, b, ha, hb, rfl⟩, hc, rfl⟩
+  rintro _ ⟨_, ⟨a, ha, b, hb, rfl⟩, c, hc, rfl⟩
   rw [h_distrib]
   exact mem_image2_of_mem (mem_image2_of_mem ha hc) (mem_image2_of_mem hb hc)
 #align set.image2_distrib_subset_right Set.image2_distrib_subset_right
feat(Set/NAry): add Set.image2_range (#9220)

Generalize Set.range_smul_range to any Set.image2.

Diff
@@ -248,6 +248,10 @@ theorem image2_right (h : s.Nonempty) : image2 (fun _ y => y) s t = t := by
   simp [nonempty_def.mp h, ext_iff]
 #align set.image2_right Set.image2_right
 
+lemma image2_range (f : α' → β' → γ) (g : α → α') (h : β → β') :
+    image2 f (range g) (range h) = range fun x : α × β ↦ f (g x.1) (h x.2) := by
+  simp_rw [← image_univ, image2_image_left, image2_image_right, ← image_prod, univ_prod_univ]
+
 theorem image2_assoc {f : δ → γ → ε} {g : α → β → δ} {f' : α → ε' → ε} {g' : β → γ → ε'}
     (h_assoc : ∀ a b c, f (g a b) c = f' a (g' b c)) :
     image2 f (image2 g s t) u = image2 f' s (image2 g' t u) := by
chore(Set/NAry): drop Set.image3 (#9221)

Set.image3 was only used to prove associativity of Set.image2. It had basically no API and had exactly one (easily replaced) use outside Data.Set.NAry). There is no specific function as a replacement, but it can be obtained by combining Set.image2 twice.

Diff
@@ -17,10 +17,6 @@ This is mostly useful to define pointwise operations and `Set.seq`.
 
 This file is very similar to `Data.Finset.NAry`, to `Order.Filter.NAry`, and to
 `Data.Option.NAry`. Please keep them in sync.
-
-We also define `Set.image3`.
-Its only purpose is to prove properties of `Set.image2`,
-and it should be rarely used outside of this file.
 -/
 
 open Function
@@ -219,62 +215,17 @@ theorem image2_congr' (h : ∀ a b, f a b = f' a b) : image2 f s t = image2 f' s
   image2_congr fun a _ b _ => h a b
 #align set.image2_congr' Set.image2_congr'
 
-/-- The image of a ternary function `f : α → β → γ → δ` as a function
-  `Set α → Set β → Set γ → Set δ`. Mathematically this should be thought of as the image of the
-  corresponding function `α × β × γ → δ`.
--/
-def image3 (g : α → β → γ → δ) (s : Set α) (t : Set β) (u : Set γ) : Set δ :=
-  { d | ∃ a b c, a ∈ s ∧ b ∈ t ∧ c ∈ u ∧ g a b c = d }
-#align set.image3 Set.image3
-
-@[simp]
-theorem mem_image3 : d ∈ image3 g s t u ↔ ∃ a b c, a ∈ s ∧ b ∈ t ∧ c ∈ u ∧ g a b c = d :=
-  Iff.rfl
-#align set.mem_image3 Set.mem_image3
-
-theorem image3_mono (hs : s ⊆ s') (ht : t ⊆ t') (hu : u ⊆ u') :
-    image3 g s t u ⊆ image3 g s' t' u' := fun _ =>
-  Exists₃.imp fun _ _ _ ⟨ha, hb, hc, hx⟩ => ⟨hs ha, ht hb, hu hc, hx⟩
-#align set.image3_mono Set.image3_mono
-
-@[congr]
-theorem image3_congr (h : ∀ a ∈ s, ∀ b ∈ t, ∀ c ∈ u, g a b c = g' a b c) :
-    image3 g s t u = image3 g' s t u := by
-  ext x
-  constructor <;> rintro ⟨a, b, c, ha, hb, hc, rfl⟩ <;>
-    exact ⟨a, b, c, ha, hb, hc, by rw [h a ha b hb c hc]⟩
-#align set.image3_congr Set.image3_congr
-
-/-- A common special case of `image3_congr` -/
-theorem image3_congr' (h : ∀ a b c, g a b c = g' a b c) : image3 g s t u = image3 g' s t u :=
-  image3_congr fun a _ b _ c _ => h a b c
-#align set.image3_congr' Set.image3_congr'
-
-theorem image2_image2_left (f : δ → γ → ε) (g : α → β → δ) :
-    image2 f (image2 g s t) u = image3 (fun a b c => f (g a b) c) s t u := by
-  ext; constructor
-  · rintro ⟨_, c, ⟨a, b, ha, hb, rfl⟩, hc, rfl⟩
-    refine' ⟨a, b, c, ha, hb, hc, rfl⟩
-  · rintro ⟨a, b, c, ha, hb, hc, rfl⟩
-    refine' ⟨_, c, ⟨a, b, ha, hb, rfl⟩, hc, rfl⟩
-#align set.image2_image2_left Set.image2_image2_left
-
-theorem image2_image2_right (f : α → δ → ε) (g : β → γ → δ) :
-    image2 f s (image2 g t u) = image3 (fun a b c => f a (g b c)) s t u := by
-  ext; constructor
-  · rintro ⟨a, _, ha, ⟨b, c, hb, hc, rfl⟩, rfl⟩
-    refine' ⟨a, b, c, ha, hb, hc, rfl⟩
-  · rintro ⟨a, b, c, ha, hb, hc, rfl⟩
-    refine' ⟨a, _, ha, ⟨b, c, hb, hc, rfl⟩, rfl⟩
-#align set.image2_image2_right Set.image2_image2_right
+#noalign set.image3
+#noalign set.mem_image3
+#noalign set.image3_mono
+#noalign set.image3_congr
+#noalign set.image3_congr'
+#noalign set.image2_image2_left
+#noalign set.image2_image2_right
 
 theorem image_image2 (f : α → β → γ) (g : γ → δ) :
     g '' image2 f s t = image2 (fun a b => g (f a b)) s t := by
-  ext; constructor
-  · rintro ⟨_, ⟨a, b, ha, hb, rfl⟩, rfl⟩
-    refine' ⟨a, b, ha, hb, rfl⟩
-  · rintro ⟨a, b, ha, hb, rfl⟩
-    refine' ⟨_, ⟨a, b, ha, hb, rfl⟩, rfl⟩
+  simp only [← image_prod, image_image]
 #align set.image_image2 Set.image_image2
 
 theorem image2_image_left (f : γ → β → δ) (g : α → γ) :
@@ -300,7 +251,9 @@ theorem image2_right (h : s.Nonempty) : image2 (fun _ y => y) s t = t := by
 theorem image2_assoc {f : δ → γ → ε} {g : α → β → δ} {f' : α → ε' → ε} {g' : β → γ → ε'}
     (h_assoc : ∀ a b c, f (g a b) c = f' a (g' b c)) :
     image2 f (image2 g s t) u = image2 f' s (image2 g' t u) := by
-  simp only [image2_image2_left, image2_image2_right, h_assoc]
+  rw [← image_prod g, ← image_prod g', image2_image_left, image2_image_right]
+  ext
+  simp only [mem_image2, Prod.exists, h_assoc, prod_mk_mem_set_prod_eq, and_assoc]
 #align set.image2_assoc Set.image2_assoc
 
 theorem image2_comm {g : β → α → γ} (h_comm : ∀ a b, f a b = g b a) : image2 f s t = image2 g t s :=
chore(Set/NAry): fix docstring, golf (#9059)
  • Fix the module docstring of Data.Set.NAry. It looks like it was copied from Data.Finset.NAry while synchronizing the files.

  • Golf some proofs.

Diff
@@ -10,19 +10,19 @@ import Mathlib.Data.Set.Prod
 /-!
 # N-ary images of sets
 
-This file defines `Set.image2`, the binary image of finsets. This is the finset version of
-`Set.image2`. This is mostly useful to define pointwise operations.
+This file defines `Set.image2`, the binary image of sets.
+This is mostly useful to define pointwise operations and `Set.seq`.
 
 ## Notes
 
-This file is very similar to the n-ary section of `Data.Set.Basic`, to `Order.Filter.NAry` and to
+This file is very similar to `Data.Finset.NAry`, to `Order.Filter.NAry`, and to
 `Data.Option.NAry`. Please keep them in sync.
 
-We do not define `Set.image3` as its only purpose would be to prove properties of `Set.image2`
-and `Set.image2` already fulfills this task.
+We also define `Set.image3`.
+Its only purpose is to prove properties of `Set.image2`,
+and it should be rarely used outside of this file.
 -/
 
-
 open Function
 
 namespace Set
@@ -122,11 +122,7 @@ theorem image2_swap (s : Set α) (t : Set β) : image2 f s t = image2 (fun a b =
 variable {f}
 
 theorem image2_union_left : image2 f (s ∪ s') t = image2 f s t ∪ image2 f s' t := by
-  ext c
-  constructor
-  · rintro ⟨a, b, ha | ha, hb, rfl⟩ <;> [left; right] <;> exact ⟨_, _, ‹_›, ‹_›, rfl⟩
-  · rintro (⟨_, _, _, _, rfl⟩ | ⟨_, _, _, _, rfl⟩) <;> refine' ⟨_, _, _, ‹_›, rfl⟩ <;>
-      simp [mem_union, *]
+  simp_rw [← image_prod, union_prod, image_union]
 #align set.image2_union_left Set.image2_union_left
 
 theorem image2_union_right : image2 f s (t ∪ t') = image2 f s t ∪ image2 f s t' := by
@@ -181,14 +177,12 @@ theorem Subsingleton.image2 (hs : s.Subsingleton) (ht : t.Subsingleton) (f : α
   rw [← image_prod]
   apply (hs.prod ht).image
 
-theorem image2_inter_subset_left : image2 f (s ∩ s') t ⊆ image2 f s t ∩ image2 f s' t := by
-  rintro _ ⟨a, b, ⟨h1a, h2a⟩, hb, rfl⟩
-  constructor <;> exact ⟨_, _, ‹_›, ‹_›, rfl⟩
+theorem image2_inter_subset_left : image2 f (s ∩ s') t ⊆ image2 f s t ∩ image2 f s' t :=
+  Monotone.map_inf_le (fun _ _ ↦ image2_subset_right) s s'
 #align set.image2_inter_subset_left Set.image2_inter_subset_left
 
-theorem image2_inter_subset_right : image2 f s (t ∩ t') ⊆ image2 f s t ∩ image2 f s t' := by
-  rintro _ ⟨a, b, ha, ⟨h1b, h2b⟩, rfl⟩
-  constructor <;> exact ⟨_, _, ‹_›, ‹_›, rfl⟩
+theorem image2_inter_subset_right : image2 f s (t ∩ t') ⊆ image2 f s t ∩ image2 f s t' :=
+  Monotone.map_inf_le (fun _ _ ↦ image2_subset_left) t t'
 #align set.image2_inter_subset_right Set.image2_inter_subset_right
 
 @[simp]
@@ -285,20 +279,12 @@ theorem image_image2 (f : α → β → γ) (g : γ → δ) :
 
 theorem image2_image_left (f : γ → β → δ) (g : α → γ) :
     image2 f (g '' s) t = image2 (fun a b => f (g a) b) s t := by
-  ext; constructor
-  · rintro ⟨_, b, ⟨a, ha, rfl⟩, hb, rfl⟩
-    refine' ⟨a, b, ha, hb, rfl⟩
-  · rintro ⟨a, b, ha, hb, rfl⟩
-    refine' ⟨_, b, ⟨a, ha, rfl⟩, hb, rfl⟩
+  ext; simp
 #align set.image2_image_left Set.image2_image_left
 
 theorem image2_image_right (f : α → γ → δ) (g : β → γ) :
     image2 f s (g '' t) = image2 (fun a b => f a (g b)) s t := by
-  ext; constructor
-  · rintro ⟨a, _, ha, ⟨b, hb, rfl⟩, rfl⟩
-    refine' ⟨a, b, ha, hb, rfl⟩
-  · rintro ⟨a, b, ha, hb, rfl⟩
-    refine' ⟨a, _, ha, ⟨b, hb, rfl⟩, rfl⟩
+  ext; simp
 #align set.image2_image_right Set.image2_image_right
 
 @[simp]
chore: space after (#8178)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -111,7 +111,7 @@ lemma image_prod : (fun x : α × β ↦ f x.1 x.2) '' s ×ˢ t = image2 f s t :
 -- Porting note: Removing `simp` - LHS does not simplify
 lemma image2_curry (f : α × β → γ) (s : Set α) (t : Set β) :
     image2 (fun a b ↦ f (a, b)) s t = f '' s ×ˢ t := by
-  simp [←image_uncurry_prod, uncurry]
+  simp [← image_uncurry_prod, uncurry]
 #align set.image2_curry Set.image2_curry
 
 theorem image2_swap (s : Set α) (t : Set β) : image2 f s t = image2 (fun a b => f b a) t s := by
@@ -135,12 +135,12 @@ theorem image2_union_right : image2 f s (t ∪ t') = image2 f s t ∪ image2 f s
 
 lemma image2_inter_left (hf : Injective2 f) :
     image2 f (s ∩ s') t = image2 f s t ∩ image2 f s' t := by
-  simp_rw [←image_uncurry_prod, inter_prod, image_inter hf.uncurry]
+  simp_rw [← image_uncurry_prod, inter_prod, image_inter hf.uncurry]
 #align set.image2_inter_left Set.image2_inter_left
 
 lemma image2_inter_right (hf : Injective2 f) :
     image2 f s (t ∩ t') = image2 f s t ∩ image2 f s t' := by
-  simp_rw [←image_uncurry_prod, prod_inter, image_inter hf.uncurry]
+  simp_rw [← image_uncurry_prod, prod_inter, image_inter hf.uncurry]
 #align set.image2_inter_right Set.image2_inter_right
 
 @[simp]
chore: only four spaces for subsequent lines (#7286)

Co-authored-by: Moritz Firsching <firsching@google.com>

Diff
@@ -110,8 +110,8 @@ lemma image_prod : (fun x : α × β ↦ f x.1 x.2) '' s ×ˢ t = image2 f s t :
 
 -- Porting note: Removing `simp` - LHS does not simplify
 lemma image2_curry (f : α × β → γ) (s : Set α) (t : Set β) :
-  image2 (fun a b ↦ f (a, b)) s t = f '' s ×ˢ t :=
-by simp [←image_uncurry_prod, uncurry]
+    image2 (fun a b ↦ f (a, b)) s t = f '' s ×ˢ t := by
+  simp [←image_uncurry_prod, uncurry]
 #align set.image2_curry Set.image2_curry
 
 theorem image2_swap (s : Set α) (t : Set β) : image2 f s t = image2 (fun a b => f b a) t s := by
feat(Set/NAry): add Set.Subsingleton.image2 (#6671)
Diff
@@ -176,6 +176,11 @@ theorem image2_eq_empty_iff : image2 f s t = ∅ ↔ s = ∅ ∨ t = ∅ := by
   simp [not_nonempty_iff_eq_empty]
 #align set.image2_eq_empty_iff Set.image2_eq_empty_iff
 
+theorem Subsingleton.image2 (hs : s.Subsingleton) (ht : t.Subsingleton) (f : α → β → γ) :
+    (image2 f s t).Subsingleton := by
+  rw [← image_prod]
+  apply (hs.prod ht).image
+
 theorem image2_inter_subset_left : image2 f (s ∩ s') t ⊆ image2 f s t ∩ image2 f s' t := by
   rintro _ ⟨a, b, ⟨h1a, h2a⟩, hb, rfl⟩
   constructor <;> exact ⟨_, _, ‹_›, ‹_›, rfl⟩
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
 
 namespace Set
-variable {α α' β β' γ γ' δ δ' ε ε' ζ ζ' ν : Type _} {f f' : α → β → γ} {g g' : α → β → γ → δ}
+variable {α α' β β' γ γ' δ δ' ε ε' ζ ζ' ν : Type*} {f f' : α → β → γ} {g g' : α → β → γ → δ}
 variable {s s' : Set α} {t t' : Set β} {u u' : Set γ} {v : Set δ} {a a' : α} {b b' : β} {c c' : γ}
   {d d' : δ}
 
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,14 +2,11 @@
 Copyright (c) 2020 Floris van Doorn. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Floris van Doorn
-
-! This file was ported from Lean 3 source module data.set.n_ary
-! leanprover-community/mathlib commit 5e526d18cea33550268dcbbddcb822d5cde40654
-! Please do not edit these lines, except to modify the commit id
-! if you have ported upstream changes.
 -/
 import Mathlib.Data.Set.Prod
 
+#align_import data.set.n_ary from "leanprover-community/mathlib"@"5e526d18cea33550268dcbbddcb822d5cde40654"
+
 /-!
 # N-ary images of sets
 
chore: formatting issues (#4947)

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

Diff
@@ -99,13 +99,13 @@ variable (f)
 
 -- Porting note: Removing `simp` - LHS does not simplify
 lemma image_prod : (fun x : α × β ↦ f x.1 x.2) '' s ×ˢ t = image2 f s t :=
-ext $ fun a ↦
-⟨ by rintro ⟨_, _, rfl⟩; exact ⟨_, _, (mem_prod.1 ‹_›).1, (mem_prod.1 ‹_›).2, rfl⟩,
-  by rintro ⟨_, _, _, _, rfl⟩; exact ⟨(_, _), ⟨‹_›, ‹_›⟩, rfl⟩⟩
+  ext $ fun a ↦
+  ⟨ by rintro ⟨_, _, rfl⟩; exact ⟨_, _, (mem_prod.1 ‹_›).1, (mem_prod.1 ‹_›).2, rfl⟩,
+    by rintro ⟨_, _, _, _, rfl⟩; exact ⟨(_, _), ⟨‹_›, ‹_›⟩, rfl⟩⟩
 #align set.image_prod Set.image_prod
 
 @[simp] lemma image_uncurry_prod (s : Set α) (t : Set β) : uncurry f '' s ×ˢ t = image2 f s t :=
-image_prod _
+  image_prod _
 #align set.image_uncurry_prod Set.image_uncurry_prod
 
 @[simp] lemma image2_mk_eq_prod : image2 Prod.mk s t = s ×ˢ t := ext $ by simp
@@ -136,12 +136,14 @@ theorem image2_union_right : image2 f s (t ∪ t') = image2 f s t ∪ image2 f s
   rw [← image2_swap, image2_union_left, image2_swap f, image2_swap f]
 #align set.image2_union_right Set.image2_union_right
 
-lemma image2_inter_left (hf : Injective2 f) : image2 f (s ∩ s') t = image2 f s t ∩ image2 f s' t :=
-by simp_rw [←image_uncurry_prod, inter_prod, image_inter hf.uncurry]
+lemma image2_inter_left (hf : Injective2 f) :
+    image2 f (s ∩ s') t = image2 f s t ∩ image2 f s' t := by
+  simp_rw [←image_uncurry_prod, inter_prod, image_inter hf.uncurry]
 #align set.image2_inter_left Set.image2_inter_left
 
-lemma image2_inter_right (hf : Injective2 f) : image2 f s (t ∩ t') = image2 f s t ∩ image2 f s t' :=
-by simp_rw [←image_uncurry_prod, prod_inter, image_inter hf.uncurry]
+lemma image2_inter_right (hf : Injective2 f) :
+    image2 f s (t ∩ t') = image2 f s t ∩ image2 f s t' := by
+  simp_rw [←image_uncurry_prod, prod_inter, image_inter hf.uncurry]
 #align set.image2_inter_right Set.image2_inter_right
 
 @[simp]
chore: fix upper/lowercase in comments (#4360)
  • Run a non-interactive version of fix-comments.py on all files.
  • Go through the diff and manually add/discard/edit chunks.
Diff
@@ -14,7 +14,7 @@ import Mathlib.Data.Set.Prod
 # N-ary images of sets
 
 This file defines `Set.image2`, the binary image of finsets. This is the finset version of
-`set.image2`. This is mostly useful to define pointwise operations.
+`Set.image2`. This is mostly useful to define pointwise operations.
 
 ## Notes
 
chore: update std 05-22 (#4248)

The main breaking change is that tac <;> [t1, t2] is now written tac <;> [t1; t2], to avoid clashing with tactics like cases and use that take comma-separated lists.

Diff
@@ -127,7 +127,7 @@ variable {f}
 theorem image2_union_left : image2 f (s ∪ s') t = image2 f s t ∪ image2 f s' t := by
   ext c
   constructor
-  · rintro ⟨a, b, ha | ha, hb, rfl⟩ <;> [left, right] <;> exact ⟨_, _, ‹_›, ‹_›, rfl⟩
+  · rintro ⟨a, b, ha | ha, hb, rfl⟩ <;> [left; right] <;> exact ⟨_, _, ‹_›, ‹_›, rfl⟩
   · rintro (⟨_, _, _, _, rfl⟩ | ⟨_, _, _, _, rfl⟩) <;> refine' ⟨_, _, _, ‹_›, rfl⟩ <;>
       simp [mem_union, *]
 #align set.image2_union_left Set.image2_union_left
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: Floris van Doorn
 
 ! This file was ported from Lean 3 source module data.set.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.
 -/
@@ -87,6 +87,14 @@ theorem image2_subset_iff {u : Set γ} : image2 f s t ⊆ u ↔ ∀ x ∈ s, ∀
   forall_image2_iff
 #align set.image2_subset_iff Set.image2_subset_iff
 
+theorem image2_subset_iff_left : image2 f s t ⊆ u ↔ ∀ a ∈ s, (fun b => f a b) '' t ⊆ u := by
+  simp_rw [image2_subset_iff, image_subset_iff, subset_def, mem_preimage]
+#align set.image2_subset_iff_left Set.image2_subset_iff_left
+
+theorem image2_subset_iff_right : image2 f s t ⊆ u ↔ ∀ b ∈ t, (fun a => f a b) '' s ⊆ u := by
+  simp_rw [image2_subset_iff, image_subset_iff, subset_def, mem_preimage, @forall₂_swap α]
+#align set.image2_subset_iff_right Set.image2_subset_iff_right
+
 variable (f)
 
 -- Porting note: Removing `simp` - LHS does not simplify
@@ -109,6 +117,11 @@ lemma image2_curry (f : α × β → γ) (s : Set α) (t : Set β) :
 by simp [←image_uncurry_prod, uncurry]
 #align set.image2_curry Set.image2_curry
 
+theorem image2_swap (s : Set α) (t : Set β) : image2 f s t = image2 (fun a b => f b a) t s := by
+  ext
+  constructor <;> rintro ⟨a, b, ha, hb, rfl⟩ <;> exact ⟨b, a, hb, ha, rfl⟩
+#align set.image2_swap Set.image2_swap
+
 variable {f}
 
 theorem image2_union_left : image2 f (s ∪ s') t = image2 f s t ∪ image2 f s' t := by
@@ -120,11 +133,7 @@ theorem image2_union_left : image2 f (s ∪ s') t = image2 f s t ∪ image2 f s'
 #align set.image2_union_left Set.image2_union_left
 
 theorem image2_union_right : image2 f s (t ∪ t') = image2 f s t ∪ image2 f s t' := by
-  ext c
-  constructor
-  · rintro ⟨a, b, ha, h1b | h2b, rfl⟩ <;> [left, right] <;> exact ⟨_, _, ‹_›, ‹_›, rfl⟩
-  · rintro (⟨_, _, _, _, rfl⟩ | ⟨_, _, _, _, rfl⟩) <;> refine' ⟨_, _, ‹_›, _, rfl⟩ <;>
-      simp [mem_union, *]
+  rw [← image2_swap, image2_union_left, image2_swap f, image2_swap f]
 #align set.image2_union_right Set.image2_union_right
 
 lemma image2_inter_left (hf : Injective2 f) : image2 f (s ∩ s') t = image2 f s t ∩ image2 f s' t :=
@@ -191,6 +200,16 @@ theorem image2_singleton_right : image2 f s {b} = (fun a => f a b) '' s :=
 theorem image2_singleton : image2 f {a} {b} = {f a b} := by simp
 #align set.image2_singleton Set.image2_singleton
 
+@[simp]
+theorem image2_insert_left : image2 f (insert a s) t = (fun b => f a b) '' t ∪ image2 f s t := by
+  rw [insert_eq, image2_union_left, image2_singleton_left]
+#align set.image2_insert_left Set.image2_insert_left
+
+@[simp]
+theorem image2_insert_right : image2 f s (insert b t) = (fun a => f a b) '' s ∪ image2 f s t := by
+  rw [insert_eq, image2_union_right, image2_singleton_right]
+#align set.image2_insert_right Set.image2_insert_right
+
 @[congr]
 theorem image2_congr (h : ∀ a ∈ s, ∀ b ∈ t, f a b = f' a b) : image2 f s t = image2 f' s t := by
   ext
@@ -278,12 +297,6 @@ theorem image2_image_right (f : α → γ → δ) (g : β → γ) :
     refine' ⟨a, _, ha, ⟨b, hb, rfl⟩, rfl⟩
 #align set.image2_image_right Set.image2_image_right
 
-theorem image2_swap (f : α → β → γ) (s : Set α) (t : Set β) :
-    image2 f s t = image2 (fun a b => f b a) t s := by
-  ext
-  constructor <;> rintro ⟨a, b, ha, hb, rfl⟩ <;> refine' ⟨b, a, hb, ha, rfl⟩
-#align set.image2_swap Set.image2_swap
-
 @[simp]
 theorem image2_left (h : t.Nonempty) : image2 (fun x _ => x) s t = s := by
   simp [nonempty_def.mp h, ext_iff]
@@ -430,12 +443,26 @@ lemma image2_right_identity {f : α → β → α} {b : β} (h : ∀ a, f a b =
   rw [image2_singleton_right, funext h, image_id']
 #align set.image2_right_identity Set.image2_right_identity
 
+theorem image2_inter_union_subset_union :
+    image2 f (s ∩ s') (t ∪ t') ⊆ image2 f s t ∪ image2 f s' t' := by
+  rw [image2_union_right]
+  exact
+    union_subset_union (image2_subset_right <| inter_subset_left _ _)
+      (image2_subset_right <| inter_subset_right _ _)
+#align set.image2_inter_union_subset_union Set.image2_inter_union_subset_union
+
+theorem image2_union_inter_subset_union :
+    image2 f (s ∪ s') (t ∩ t') ⊆ image2 f s t ∪ image2 f s' t' := by
+  rw [image2_union_left]
+  exact
+    union_subset_union (image2_subset_left <| inter_subset_left _ _)
+      (image2_subset_left <| inter_subset_right _ _)
+#align set.image2_union_inter_subset_union Set.image2_union_inter_subset_union
+
 theorem image2_inter_union_subset {f : α → α → β} {s t : Set α} (hf : ∀ a b, f a b = f b a) :
     image2 f (s ∩ t) (s ∪ t) ⊆ image2 f s t := by
-  rintro _ ⟨a, b, ha, hb | hb, rfl⟩
-  · rw [hf]
-    exact mem_image2_of_mem hb ha.2
-  · exact mem_image2_of_mem ha.1 hb
+  rw [inter_comm]
+  exact image2_inter_union_subset_union.trans (union_subset (image2_comm hf).subset Subset.rfl)
 #align set.image2_inter_union_subset Set.image2_inter_union_subset
 
 theorem image2_union_inter_subset {f : α → α → β} {s t : Set α} (hf : ∀ a b, f a b = f b a) :
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,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Floris van Doorn
 
 ! This file was ported from Lean 3 source module data.set.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.
 -/
@@ -430,4 +430,18 @@ lemma image2_right_identity {f : α → β → α} {b : β} (h : ∀ a, f a b =
   rw [image2_singleton_right, funext h, image_id']
 #align set.image2_right_identity Set.image2_right_identity
 
+theorem image2_inter_union_subset {f : α → α → β} {s t : Set α} (hf : ∀ a b, f a b = f b a) :
+    image2 f (s ∩ t) (s ∪ t) ⊆ image2 f s t := by
+  rintro _ ⟨a, b, ha, hb | hb, rfl⟩
+  · rw [hf]
+    exact mem_image2_of_mem hb ha.2
+  · exact mem_image2_of_mem ha.1 hb
+#align set.image2_inter_union_subset Set.image2_inter_union_subset
+
+theorem image2_union_inter_subset {f : α → α → β} {s t : Set α} (hf : ∀ a b, f a b = f b a) :
+    image2 f (s ∪ t) (s ∩ t) ⊆ image2 f s t := by
+  rw [image2_comm hf]
+  exact image2_inter_union_subset hf
+#align set.image2_union_inter_subset Set.image2_union_inter_subset
+
 end Set
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Floris van Doorn
 
 ! This file was ported from Lean 3 source module data.set.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.
 -/
@@ -29,10 +29,9 @@ and `Set.image2` already fulfills this task.
 open Function
 
 namespace Set
-
-variable {α α' β β' γ γ' δ δ' ε ε' : Type _} {f f' : α → β → γ} {g g' : α → β → γ → δ}
-
-variable {s s' : Set α} {t t' : Set β} {u u' : Set γ} {a a' : α} {b b' : β} {c c' : γ} {d d' : δ}
+variable {α α' β β' γ γ' δ δ' ε ε' ζ ζ' ν : Type _} {f f' : α → β → γ} {g g' : α → β → γ → δ}
+variable {s s' : Set α} {t t' : Set β} {u u' : Set γ} {v : Set δ} {a a' : α} {b b' : β} {c c' : γ}
+  {d d' : δ}
 
 /-- The image of a binary function `f : α → β → γ` as a function `Set α → Set β → Set γ`.
 Mathematically this should be thought of as the image of the corresponding function `α × β → γ`.-/
@@ -319,6 +318,17 @@ theorem image2_right_comm {f : δ → γ → ε} {g : α → β → δ} {f' : α
   exact image2_assoc fun _ _ _ => h_right_comm _ _ _
 #align set.image2_right_comm Set.image2_right_comm
 
+theorem image2_image2_image2_comm {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)) :
+    image2 f (image2 g s t) (image2 h u v) = image2 f' (image2 g' s u) (image2 h' t v) := by
+  ext; constructor
+  · rintro ⟨_, _, ⟨a, b, ha, hb, rfl⟩, ⟨c, d, hc, hd, rfl⟩, rfl⟩
+    exact ⟨_, _, ⟨a, c, ha, hc, rfl⟩, ⟨b, d, hb, hd, rfl⟩, (h_comm _ _ _ _).symm⟩
+  · rintro ⟨_, _, ⟨a, c, ha, hc, rfl⟩, ⟨b, d, hb, hd, rfl⟩, rfl⟩
+    exact ⟨_, _, ⟨a, b, ha, hb, rfl⟩, ⟨c, d, hc, hd, rfl⟩, h_comm _ _ _ _⟩
+#align set.image2_image2_image2_comm Set.image2_image2_image2_comm
+
 theorem image_image2_distrib {g : γ → δ} {f' : α' → β' → δ} {g₁ : α → α'} {g₂ : β → β'}
     (h_distrib : ∀ a b, g (f a b) = f' (g₁ a) (g₂ b)) :
     (image2 f s t).image g = image2 f' (s.image g₁) (t.image g₂) := by
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: Floris van Doorn
 
 ! This file was ported from Lean 3 source module data.set.n_ary
-! leanprover-community/mathlib commit 2ed7e4aec72395b6a7c3ac4ac7873a7a43ead17c
+! leanprover-community/mathlib commit 995b47e555f1b6297c7cf16855f1023e355219fb
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
chore: fix casing errors per naming scheme (#1670)
Diff
@@ -204,7 +204,7 @@ theorem image2_congr' (h : ∀ a b, f a b = f' a b) : image2 f s t = image2 f' s
 #align set.image2_congr' Set.image2_congr'
 
 /-- The image of a ternary function `f : α → β → γ → δ` as a function
-  `Set α → Set β → Set γ → set δ`. Mathematically this should be thought of as the image of the
+  `Set α → Set β → Set γ → Set δ`. Mathematically this should be thought of as the image of the
   corresponding function `α × β × γ → δ`.
 -/
 def image3 (g : α → β → γ → δ) (s : Set α) (t : Set β) (u : Set γ) : Set δ :=
Refactor: use Option.map₂ (#1439)

This is a forward-port of leanprover-community/mathlib#18081

Diff
@@ -406,4 +406,18 @@ theorem image_image2_right_anticomm {f : α → β' → γ} {g : β → β'} {f'
   (image_image2_antidistrib_right fun a b => (h_right_anticomm b a).symm).symm
 #align set.image_image2_right_anticomm Set.image_image2_right_anticomm
 
+/-- If `a` is a left identity for `f : α → β → β`, then `{a}` is a left identity for
+`Set.image2 f`. -/
+lemma image2_left_identity {f : α → β → β} {a : α} (h : ∀ b, f a b = b) (t : Set β) :
+    image2 f {a} t = t := by
+  rw [image2_singleton_left, show f a = id from funext h, image_id]
+#align set.image2_left_identity Set.image2_left_identity
+
+/-- If `b` is a right identity for `f : α → β → α`, then `{b}` is a right identity for
+`Set.image2 f`. -/
+lemma image2_right_identity {f : α → β → α} {b : β} (h : ∀ a, f a b = a) (s : Set α) :
+    image2 f s {b} = s := by
+  rw [image2_singleton_right, funext h, image_id']
+#align set.image2_right_identity Set.image2_right_identity
+
 end Set
Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Floris van Doorn
 
 ! This file was ported from Lean 3 source module data.set.n_ary
-! leanprover-community/mathlib commit 4a1bf94891f08983bb49f7ac53b85ecf8c90250a
+! leanprover-community/mathlib commit 2ed7e4aec72395b6a7c3ac4ac7873a7a43ead17c
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
@@ -95,16 +95,20 @@ lemma image_prod : (fun x : α × β ↦ f x.1 x.2) '' s ×ˢ t = image2 f s t :
 ext $ fun a ↦
 ⟨ by rintro ⟨_, _, rfl⟩; exact ⟨_, _, (mem_prod.1 ‹_›).1, (mem_prod.1 ‹_›).2, rfl⟩,
   by rintro ⟨_, _, _, _, rfl⟩; exact ⟨(_, _), ⟨‹_›, ‹_›⟩, rfl⟩⟩
+#align set.image_prod Set.image_prod
 
 @[simp] lemma image_uncurry_prod (s : Set α) (t : Set β) : uncurry f '' s ×ˢ t = image2 f s t :=
 image_prod _
+#align set.image_uncurry_prod Set.image_uncurry_prod
 
 @[simp] lemma image2_mk_eq_prod : image2 Prod.mk s t = s ×ˢ t := ext $ by simp
+#align set.image2_mk_eq_prod Set.image2_mk_eq_prod
 
 -- Porting note: Removing `simp` - LHS does not simplify
 lemma image2_curry (f : α × β → γ) (s : Set α) (t : Set β) :
   image2 (fun a b ↦ f (a, b)) s t = f '' s ×ˢ t :=
 by simp [←image_uncurry_prod, uncurry]
+#align set.image2_curry Set.image2_curry
 
 variable {f}
 
@@ -126,9 +130,11 @@ theorem image2_union_right : image2 f s (t ∪ t') = image2 f s t ∪ image2 f s
 
 lemma image2_inter_left (hf : Injective2 f) : image2 f (s ∩ s') t = image2 f s t ∩ image2 f s' t :=
 by simp_rw [←image_uncurry_prod, inter_prod, image_inter hf.uncurry]
+#align set.image2_inter_left Set.image2_inter_left
 
 lemma image2_inter_right (hf : Injective2 f) : image2 f s (t ∩ t') = image2 f s t ∩ image2 f s t' :=
 by simp_rw [←image_uncurry_prod, prod_inter, image_inter hf.uncurry]
+#align set.image2_inter_right Set.image2_inter_right
 
 @[simp]
 theorem image2_empty_left : image2 f ∅ t = ∅ :=
chore: git sha bump for a trivial change in Data/Set/Intervals/Group (#1370)

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

Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Floris van Doorn
 
 ! This file was ported from Lean 3 source module data.set.n_ary
-! leanprover-community/mathlib commit d6aae1bcbd04b8de2022b9b83a5b5b10e10c777d
+! leanprover-community/mathlib commit 4a1bf94891f08983bb49f7ac53b85ecf8c90250a
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
chore: update SHA in porting header (#1306)

These files correspond to files flagged "The following files have been modified since the commit at which they were verified." by port_status.py but are in sync with mathlib3, so we can update the hash.

I only updated the easy ones, the others need a closer inspection.

Co-authored-by: Reid Barton <rwbarton@gmail.com>

Diff
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Floris van Doorn
 
 ! This file was ported from Lean 3 source module data.set.n_ary
-! leanprover-community/mathlib commit cf9386b56953fb40904843af98b7a80757bbe7f9
+! leanprover-community/mathlib commit d6aae1bcbd04b8de2022b9b83a5b5b10e10c777d
 ! Please do not edit these lines, except to modify the commit id
 ! if you have ported upstream changes.
 -/
chore: add source headers to ported theory files (#1094)

The script used to do this is included. The yaml file was obtained from https://raw.githubusercontent.com/wiki/leanprover-community/mathlib/mathlib4-port-status.md

Diff
@@ -2,6 +2,11 @@
 Copyright (c) 2020 Floris van Doorn. All rights reserved.
 Released under Apache 2.0 license as described in the file LICENSE.
 Authors: Floris van Doorn
+
+! This file was ported from Lean 3 source module data.set.n_ary
+! leanprover-community/mathlib commit cf9386b56953fb40904843af98b7a80757bbe7f9
+! Please do not edit these lines, except to modify the commit id
+! if you have ported upstream changes.
 -/
 import Mathlib.Data.Set.Prod
 

Dependencies 38

39 files ported (100.0%)
21752 lines ported (100.0%)

All dependencies are ported!