File: Mathlib/Data/Set/NAry.lean

full_name: Set.mem_image2_iff
code: theorem mem_image2_iff (hf : Injective2 f) : f a b ∈ image2 f s t ↔ a ∈ s ∧ b ∈ t 
goal: f a b ∈ Set.image2 f s t ↔ a ∈ s ∧ b ∈ t

full_name: Set.image2_subset
code: /-- image2 is monotone with respect to `⊆`. -/
theorem image2_subset (hs : s ⊆ s') (ht : t ⊆ t') : image2 f s t ⊆ image2 f s' t' 
goal: Set.image2 f s t ⊆ Set.image2 f s' t'

full_name: Set.image2_subset_left
code: theorem image2_subset_left (ht : t ⊆ t') : image2 f s t ⊆ image2 f s t' 
goal: Set.image2 f s t ⊆ Set.image2 f s t'

full_name: Set.image2_subset_right
code: theorem image2_subset_right (hs : s ⊆ s') : image2 f s t ⊆ image2 f s' t 
goal: Set.image2 f s t ⊆ Set.image2 f s' t

full_name: Set.image_subset_image2_left
code: theorem image_subset_image2_left (hb : b ∈ t) : (fun a => f a b) '' s ⊆ image2 f s t 
goal: (fun a => f a b) '' s ⊆ Set.image2 f s t

full_name: Set.image_subset_image2_right
code: theorem image_subset_image2_right (ha : a ∈ s) : f a '' t ⊆ image2 f s t 
goal: f a '' t ⊆ Set.image2 f s t

full_name: Set.forall_image2_iff
code: theorem forall_image2_iff {p : γ → Prop} :
    (∀ z ∈ image2 f s t, p z) ↔ ∀ x ∈ s, ∀ y ∈ t, p (f x y) 
goal: (∀ z ∈ Set.image2 f s t, p z) ↔ ∀ x ∈ s, ∀ y ∈ t, p (f x y)

full_name: Set.image2_subset_iff
code: @[simp]
theorem image2_subset_iff {u : Set γ} : image2 f s t ⊆ u ↔ ∀ x ∈ s, ∀ y ∈ t, f x y ∈ u 
goal: Set.image2 f s t ⊆ u ↔ ∀ x ∈ s, ∀ y ∈ t, f x y ∈ u

full_name: Set.image2_subset_iff_left
code: theorem image2_subset_iff_left : image2 f s t ⊆ u ↔ ∀ a ∈ s, (fun b => f a b) '' t ⊆ u 
goal: Set.image2 f s t ⊆ u ↔ ∀ a ∈ s, (fun b => f a b) '' t ⊆ u

full_name: Set.image2_subset_iff_right
code: theorem image2_subset_iff_right : image2 f s t ⊆ u ↔ ∀ b ∈ t, (fun a => f a b) '' s ⊆ u 
goal: Set.image2 f s t ⊆ u ↔ ∀ b ∈ t, (fun a => f a b) '' s ⊆ u

full_name: Set.image_prod
code: lemma image_prod : (fun x : α × β ↦ f x.1 x.2) '' s ×ˢ t = image2 f s t 
goal: (fun x => f x.1 x.2) '' s ×ˢ t = Set.image2 f s t

full_name: Set.image_uncurry_prod
code: @[simp] lemma image_uncurry_prod (s : Set α) (t : Set β) : uncurry f '' s ×ˢ t = image2 f s t 
goal: Function.uncurry f '' s ×ˢ t = Set.image2 f s t

full_name: Set.image2_mk_eq_prod
code: @[simp] lemma image2_mk_eq_prod : image2 Prod.mk s t = s ×ˢ t 
goal: Set.image2 Prod.mk s t = s ×ˢ t

full_name: Set.image2_curry
code: lemma image2_curry (f : α × β → γ) (s : Set α) (t : Set β) :
    image2 (fun a b ↦ f (a, b)) s t = f '' s ×ˢ t 
goal: Set.image2 (fun a b => f (a, b)) s t = f '' s ×ˢ t

full_name: Set.image2_swap
code: theorem image2_swap (s : Set α) (t : Set β) : image2 f s t = image2 (fun a b => f b a) t s 
goal: Set.image2 f s t = Set.image2 (fun a b => f b a) t s

full_name: Set.image2_union_left
code: theorem image2_union_left : image2 f (s ∪ s') t = image2 f s t ∪ image2 f s' t 
goal: Set.image2 f (s ∪ s') t = Set.image2 f s t ∪ Set.image2 f s' t

full_name: Set.image2_union_right
code: theorem image2_union_right : image2 f s (t ∪ t') = image2 f s t ∪ image2 f s t' 
goal: Set.image2 f s (t ∪ t') = Set.image2 f s t ∪ Set.image2 f s t'

full_name: Set.image2_inter_left
code: lemma image2_inter_left (hf : Injective2 f) :
    image2 f (s ∩ s') t = image2 f s t ∩ image2 f s' t 
goal: Set.image2 f (s ∩ s') t = Set.image2 f s t ∩ Set.image2 f s' t

full_name: Set.image2_inter_right
code: lemma image2_inter_right (hf : Injective2 f) :
    image2 f s (t ∩ t') = image2 f s t ∩ image2 f s t' 
goal: Set.image2 f s (t ∩ t') = Set.image2 f s t ∩ Set.image2 f s t'

full_name: Set.image2_empty_left
code: @[simp]
theorem image2_empty_left : image2 f ∅ t = ∅ 
goal: Set.image2 f ∅ t = ∅

full_name: Set.image2_empty_right
code: @[simp]
theorem image2_empty_right : image2 f s ∅ = ∅ 
goal: Set.image2 f s ∅ = ∅

full_name: Set.Nonempty.image2
code: theorem Nonempty.image2 : s.Nonempty → t.Nonempty → (image2 f s t).Nonempty 
goal: s.Nonempty → t.Nonempty → (Set.image2 f s t).Nonempty

full_name: Set.image2_nonempty_iff
code: @[simp]
theorem image2_nonempty_iff : (image2 f s t).Nonempty ↔ s.Nonempty ∧ t.Nonempty 
goal: (Set.image2 f s t).Nonempty ↔ s.Nonempty ∧ t.Nonempty

full_name: Set.Nonempty.of_image2_left
code: theorem Nonempty.of_image2_left (h : (Set.image2 f s t).Nonempty) : s.Nonempty 
goal: s.Nonempty

full_name: Set.Nonempty.of_image2_right
code: theorem Nonempty.of_image2_right (h : (Set.image2 f s t).Nonempty) : t.Nonempty 
goal: t.Nonempty

full_name: Set.image2_eq_empty_iff
code: @[simp]
theorem image2_eq_empty_iff : image2 f s t = ∅ ↔ s = ∅ ∨ t = ∅ 
goal: Set.image2 f s t = ∅ ↔ s = ∅ ∨ t = ∅

full_name: Set.Subsingleton.image2
code: theorem Subsingleton.image2 (hs : s.Subsingleton) (ht : t.Subsingleton) (f : α → β → γ) :
    (image2 f s t).Subsingleton 
goal: (Set.image2 f s t).Subsingleton

full_name: Set.image2_inter_subset_left
code: theorem image2_inter_subset_left : image2 f (s ∩ s') t ⊆ image2 f s t ∩ image2 f s' t 
goal: Set.image2 f (s ∩ s') t ⊆ Set.image2 f s t ∩ Set.image2 f s' t

full_name: Set.image2_inter_subset_right
code: theorem image2_inter_subset_right : image2 f s (t ∩ t') ⊆ image2 f s t ∩ image2 f s t' 
goal: Set.image2 f s (t ∩ t') ⊆ Set.image2 f s t ∩ Set.image2 f s t'

full_name: Set.image2_singleton_left
code: @[simp]
theorem image2_singleton_left : image2 f {a} t = f a '' t 
goal: Set.image2 f {a} t = f a '' t

full_name: Set.image2_singleton_right
code: @[simp]
theorem image2_singleton_right : image2 f s {b} = (fun a => f a b) '' s 
goal: Set.image2 f s {b} = (fun a => f a b) '' s

full_name: Set.image2_singleton
code: theorem image2_singleton : image2 f {a} {b} = {f a b} 
goal: Set.image2 f {a} {b} = {f a b}

full_name: Set.image2_insert_left
code: @[simp]
theorem image2_insert_left : image2 f (insert a s) t = (fun b => f a b) '' t ∪ image2 f s t 
goal: Set.image2 f (insert a s) t = (fun b => f a b) '' t ∪ Set.image2 f s t

full_name: Set.image2_insert_right
code: @[simp]
theorem image2_insert_right : image2 f s (insert b t) = (fun a => f a b) '' s ∪ image2 f s t 
goal: Set.image2 f s (insert b t) = (fun a => f a b) '' s ∪ Set.image2 f s t

full_name: Set.image2_congr
code: @[congr]
theorem image2_congr (h : ∀ a ∈ s, ∀ b ∈ t, f a b = f' a b) : image2 f s t = image2 f' s t 
goal: Set.image2 f s t = Set.image2 f' s t

full_name: Set.image2_congr'
code: /-- 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 
goal: Set.image2 f s t = Set.image2 f' s t

full_name: Set.image_image2
code: theorem image_image2 (f : α → β → γ) (g : γ → δ) :
    g '' image2 f s t = image2 (fun a b => g (f a b)) s t 
goal: g '' Set.image2 f s t = Set.image2 (fun a b => g (f a b)) s t

full_name: Set.image2_image_left
code: theorem image2_image_left (f : γ → β → δ) (g : α → γ) :
    image2 f (g '' s) t = image2 (fun a b => f (g a) b) s t 
goal: Set.image2 f (g '' s) t = Set.image2 (fun a b => f (g a) b) s t

full_name: Set.image2_image_right
code: theorem image2_image_right (f : α → γ → δ) (g : β → γ) :
    image2 f s (g '' t) = image2 (fun a b => f a (g b)) s t 
goal: Set.image2 f s (g '' t) = Set.image2 (fun a b => f a (g b)) s t

full_name: Set.image2_left
code: @[simp]
theorem image2_left (h : t.Nonempty) : image2 (fun x _ => x) s t = s 
goal: Set.image2 (fun x x_1 => x) s t = s

full_name: Set.image2_right
code: @[simp]
theorem image2_right (h : s.Nonempty) : image2 (fun _ y => y) s t = t 
goal: Set.image2 (fun x y => y) s t = t

full_name: Set.image2_range
code: lemma image2_range (f : α' → β' → γ) (g : α → α') (h : β → β') :
    image2 f (range g) (range h) = range fun x : α × β ↦ f (g x.1) (h x.2) 
goal: Set.image2 f (Set.range g) (Set.range h) = Set.range fun x => f (g x.1) (h x.2)

full_name: Set.image2_assoc
code: 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) 
goal: Set.image2 f (Set.image2 g s t) u = Set.image2 f' s (Set.image2 g' t u)

full_name: Set.image2_comm
code: theorem image2_comm {g : β → α → γ} (h_comm : ∀ a b, f a b = g b a) : image2 f s t = image2 g t s 
goal: Set.image2 f s t = Set.image2 g t s

full_name: Set.image2_left_comm
code: 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) 
goal: Set.image2 f s (Set.image2 g t u) = Set.image2 g' t (Set.image2 f' s u)

full_name: Set.image2_right_comm
code: 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 
goal: Set.image2 f (Set.image2 g s t) u = Set.image2 g' (Set.image2 f' s u) t

full_name: Set.image2_image2_image2_comm
code: 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) 
goal: Set.image2 f (Set.image2 g s t) (Set.image2 h u v) = Set.image2 f' (Set.image2 g' s u) (Set.image2 h' t v)

full_name: Set.image_image2_distrib
code: 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₂) 
goal: g '' Set.image2 f s t = Set.image2 f' (g₁ '' s) (g₂ '' t)

full_name: Set.image_image2_distrib_left
code: /-- 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 
goal: g '' Set.image2 f s t = Set.image2 f' (g' '' s) t

full_name: Set.image_image2_distrib_right
code: /-- 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') 
goal: g '' Set.image2 f s t = Set.image2 f' s (g' '' t)

full_name: Set.image2_image_left_comm
code: /-- 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' 
goal: Set.image2 f (g '' s) t = g' '' Set.image2 f' s t

full_name: Set.image_image2_right_comm
code: /-- 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' 
goal: Set.image2 f s (g '' t) = g' '' Set.image2 f' s t

full_name: Set.image2_distrib_subset_left
code: /-- 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)) :
    image2 f s (image2 g t u) ⊆ image2 g' (image2 f₁ s t) (image2 f₂ s u) 
goal: Set.image2 f s (Set.image2 g t u) ⊆ Set.image2 g' (Set.image2 f₁ s t) (Set.image2 f₂ s u)

full_name: Set.image2_distrib_subset_right
code: /-- 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)) :
    image2 f (image2 g s t) u ⊆ image2 g' (image2 f₁ s u) (image2 f₂ t u) 
goal: Set.image2 f (Set.image2 g s t) u ⊆ Set.image2 g' (Set.image2 f₁ s u) (Set.image2 f₂ t u)

full_name: Set.image_image2_antidistrib
code: 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₂) 
goal: g '' Set.image2 f s t = Set.image2 f' (g₁ '' t) (g₂ '' s)

full_name: Set.image_image2_antidistrib_left
code: /-- 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 
goal: g '' Set.image2 f s t = Set.image2 f' (g' '' t) s

full_name: Set.image_image2_antidistrib_right
code: /-- 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') 
goal: g '' Set.image2 f s t = Set.image2 f' t (g' '' s)

full_name: Set.image2_image_left_anticomm
code: /-- 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' 
goal: Set.image2 f (g '' s) t = g' '' Set.image2 f' t s

full_name: Set.image_image2_right_anticomm
code: /-- 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' 
goal: Set.image2 f s (g '' t) = g' '' Set.image2 f' t s

full_name: Set.image2_left_identity
code: /-- 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 
goal: Set.image2 f {a} t = t

full_name: Set.image2_right_identity
code: /-- 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 
goal: Set.image2 f s {b} = s

full_name: Set.image2_inter_union_subset_union
code: theorem image2_inter_union_subset_union :
    image2 f (s ∩ s') (t ∪ t') ⊆ image2 f s t ∪ image2 f s' t' 
goal: Set.image2 f (s ∩ s') (t ∪ t') ⊆ Set.image2 f s t ∪ Set.image2 f s' t'

full_name: Set.image2_union_inter_subset_union
code: theorem image2_union_inter_subset_union :
    image2 f (s ∪ s') (t ∩ t') ⊆ image2 f s t ∪ image2 f s' t' 
goal: Set.image2 f (s ∪ s') (t ∩ t') ⊆ Set.image2 f s t ∪ Set.image2 f s' t'

full_name: Set.image2_inter_union_subset
code: 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 
goal: Set.image2 f (s ∩ t) (s ∪ t) ⊆ Set.image2 f s t

full_name: Set.image2_union_inter_subset
code: 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 
goal: Set.image2 f (s ∪ t) (s ∩ t) ⊆ Set.image2 f s t