Documentation

Mathlib.Data.Set.NAry

N-ary images of sets #

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 Data.Finset.NAry, to Order.Filter.NAry, and to Data.Option.NAry. Please keep them in sync.

theorem Set.mem_image2_iff {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {t : Set β} {a : α} {b : β} (hf : Function.Injective2 f) :
f a b Set.image2 f s t a s b t
theorem Set.image2_subset {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {s' : Set α} {t : Set β} {t' : Set β} (hs : s s') (ht : t t') :
Set.image2 f s t Set.image2 f s' t'

image2 is monotone with respect to .

theorem Set.image2_subset_left {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {t : Set β} {t' : Set β} (ht : t t') :
theorem Set.image2_subset_right {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {s' : Set α} {t : Set β} (hs : s s') :
theorem Set.image_subset_image2_left {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {t : Set β} {b : β} (hb : b t) :
(fun (a : α) => f a b) '' s Set.image2 f s t
theorem Set.image_subset_image2_right {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {t : Set β} {a : α} (ha : a s) :
f a '' t Set.image2 f s t
theorem Set.forall_image2_iff {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {t : Set β} {p : γProp} :
(∀ zSet.image2 f s t, p z) xs, yt, p (f x y)
@[simp]
theorem Set.image2_subset_iff {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {t : Set β} {u : Set γ} :
Set.image2 f s t u xs, yt, f x y u
theorem Set.image2_subset_iff_left {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {t : Set β} {u : Set γ} :
Set.image2 f s t u as, (fun (b : β) => f a b) '' t u
theorem Set.image2_subset_iff_right {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {t : Set β} {u : Set γ} :
Set.image2 f s t u bt, (fun (a : α) => f a b) '' s u
theorem Set.image_prod {α : Type u_1} {β : Type u_3} {γ : Type u_5} (f : αβγ) {s : Set α} {t : Set β} :
(fun (x : α × β) => f x.1 x.2) '' s ×ˢ t = Set.image2 f s t
@[simp]
theorem Set.image_uncurry_prod {α : Type u_1} {β : Type u_3} {γ : Type u_5} (f : αβγ) (s : Set α) (t : Set β) :
@[simp]
theorem Set.image2_mk_eq_prod {α : Type u_1} {β : Type u_3} {s : Set α} {t : Set β} :
Set.image2 Prod.mk s t = s ×ˢ t
theorem Set.image2_curry {α : Type u_1} {β : Type u_3} {γ : Type u_5} (f : α × βγ) (s : Set α) (t : Set β) :
Set.image2 (fun (a : α) (b : β) => f (a, b)) s t = f '' s ×ˢ t
theorem Set.image2_swap {α : Type u_1} {β : Type u_3} {γ : Type u_5} (f : αβγ) (s : Set α) (t : Set β) :
Set.image2 f s t = Set.image2 (fun (a : β) (b : α) => f b a) t s
theorem Set.image2_union_left {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {s' : Set α} {t : Set β} :
Set.image2 f (s s') t = Set.image2 f s t Set.image2 f s' t
theorem Set.image2_union_right {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {t : Set β} {t' : Set β} :
Set.image2 f s (t t') = Set.image2 f s t Set.image2 f s t'
theorem Set.image2_inter_left {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {s' : Set α} {t : Set β} (hf : Function.Injective2 f) :
Set.image2 f (s s') t = Set.image2 f s t Set.image2 f s' t
theorem Set.image2_inter_right {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {t : Set β} {t' : Set β} (hf : Function.Injective2 f) :
Set.image2 f s (t t') = Set.image2 f s t Set.image2 f s t'
@[simp]
theorem Set.image2_empty_left {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {t : Set β} :
@[simp]
theorem Set.image2_empty_right {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} :
theorem Set.Nonempty.image2 {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {t : Set β} :
s.Nonemptyt.Nonempty(Set.image2 f s t).Nonempty
@[simp]
theorem Set.image2_nonempty_iff {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {t : Set β} :
(Set.image2 f s t).Nonempty s.Nonempty t.Nonempty
theorem Set.Nonempty.of_image2_left {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {t : Set β} (h : (Set.image2 f s t).Nonempty) :
s.Nonempty
theorem Set.Nonempty.of_image2_right {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {t : Set β} (h : (Set.image2 f s t).Nonempty) :
t.Nonempty
@[simp]
theorem Set.image2_eq_empty_iff {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {t : Set β} :
theorem Set.Subsingleton.image2 {α : Type u_1} {β : Type u_3} {γ : Type u_5} {s : Set α} {t : Set β} (hs : s.Subsingleton) (ht : t.Subsingleton) (f : αβγ) :
(Set.image2 f s t).Subsingleton
theorem Set.image2_inter_subset_left {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {s' : Set α} {t : Set β} :
Set.image2 f (s s') t Set.image2 f s t Set.image2 f s' t
theorem Set.image2_inter_subset_right {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {t : Set β} {t' : Set β} :
Set.image2 f s (t t') Set.image2 f s t Set.image2 f s t'
@[simp]
theorem Set.image2_singleton_left {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {t : Set β} {a : α} :
Set.image2 f {a} t = f a '' t
@[simp]
theorem Set.image2_singleton_right {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {b : β} :
Set.image2 f s {b} = (fun (a : α) => f a b) '' s
theorem Set.image2_singleton {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {a : α} {b : β} :
Set.image2 f {a} {b} = {f a b}
@[simp]
theorem Set.image2_insert_left {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {t : Set β} {a : α} :
Set.image2 f (insert a s) t = (fun (b : β) => f a b) '' t Set.image2 f s t
@[simp]
theorem Set.image2_insert_right {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {t : Set β} {b : β} :
Set.image2 f s (insert b t) = (fun (a : α) => f a b) '' s Set.image2 f s t
theorem Set.image2_congr {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {f' : αβγ} {s : Set α} {t : Set β} (h : as, bt, f a b = f' a b) :
Set.image2 f s t = Set.image2 f' s t
theorem Set.image2_congr' {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {f' : αβγ} {s : Set α} {t : Set β} (h : ∀ (a : α) (b : β), f a b = f' a b) :
Set.image2 f s t = Set.image2 f' s t

A common special case of image2_congr

theorem Set.image_image2 {α : Type u_1} {β : Type u_3} {γ : Type u_5} {δ : Type u_7} {s : Set α} {t : Set β} (f : αβγ) (g : γδ) :
g '' Set.image2 f s t = Set.image2 (fun (a : α) (b : β) => g (f a b)) s t
theorem Set.image2_image_left {α : Type u_1} {β : Type u_3} {γ : Type u_5} {δ : Type u_7} {s : Set α} {t : Set β} (f : γβδ) (g : αγ) :
Set.image2 f (g '' s) t = Set.image2 (fun (a : α) (b : β) => f (g a) b) s t
theorem Set.image2_image_right {α : Type u_1} {β : Type u_3} {γ : Type u_5} {δ : Type u_7} {s : Set α} {t : Set β} (f : αγδ) (g : βγ) :
Set.image2 f s (g '' t) = Set.image2 (fun (a : α) (b : β) => f a (g b)) s t
@[simp]
theorem Set.image2_left {α : Type u_1} {β : Type u_3} {s : Set α} {t : Set β} (h : t.Nonempty) :
Set.image2 (fun (x : α) (x_1 : β) => x) s t = s
@[simp]
theorem Set.image2_right {α : Type u_1} {β : Type u_3} {s : Set α} {t : Set β} (h : s.Nonempty) :
Set.image2 (fun (x : α) (y : β) => y) s t = t
theorem Set.image2_range {α : Type u_1} {α' : Type u_2} {β : Type u_3} {β' : Type u_4} {γ : Type u_5} (f : α'β'γ) (g : αα') (h : ββ') :
Set.image2 f (Set.range g) (Set.range h) = Set.range fun (x : α × β) => f (g x.1) (h x.2)
theorem Set.image2_assoc {α : Type u_1} {β : Type u_3} {γ : Type u_5} {δ : Type u_7} {ε : Type u_9} {ε' : Type u_10} {s : Set α} {t : Set β} {u : Set γ} {f : δγε} {g : αβδ} {f' : αε'ε} {g' : βγε'} (h_assoc : ∀ (a : α) (b : β) (c : γ), f (g a b) c = f' a (g' b c)) :
Set.image2 f (Set.image2 g s t) u = Set.image2 f' s (Set.image2 g' t u)
theorem Set.image2_comm {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {t : Set β} {g : βαγ} (h_comm : ∀ (a : α) (b : β), f a b = g b a) :
Set.image2 f s t = Set.image2 g t s
theorem Set.image2_left_comm {α : Type u_1} {β : Type u_3} {γ : Type u_5} {δ : Type u_7} {δ' : Type u_8} {ε : Type u_9} {s : Set α} {t : Set β} {u : Set γ} {f : αδε} {g : βγδ} {f' : αγδ'} {g' : βδ'ε} (h_left_comm : ∀ (a : α) (b : β) (c : γ), f a (g b c) = g' b (f' a c)) :
Set.image2 f s (Set.image2 g t u) = Set.image2 g' t (Set.image2 f' s u)
theorem Set.image2_right_comm {α : Type u_1} {β : Type u_3} {γ : Type u_5} {δ : Type u_7} {δ' : Type u_8} {ε : Type u_9} {s : Set α} {t : Set β} {u : Set γ} {f : δγε} {g : αβδ} {f' : αγδ'} {g' : δ'βε} (h_right_comm : ∀ (a : α) (b : β) (c : γ), f (g a b) c = g' (f' a c) b) :
Set.image2 f (Set.image2 g s t) u = Set.image2 g' (Set.image2 f' s u) t
theorem Set.image2_image2_image2_comm {α : Type u_1} {β : Type u_3} {γ : Type u_5} {δ : Type u_7} {ε : Type u_9} {ε' : Type u_10} {ζ : Type u_11} {ζ' : Type u_12} {ν : Type u_13} {s : Set α} {t : Set β} {u : Set γ} {v : Set δ} {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)) :
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)
theorem Set.image_image2_distrib {α : Type u_1} {α' : Type u_2} {β : Type u_3} {β' : Type u_4} {γ : Type u_5} {δ : Type u_7} {f : αβγ} {s : Set α} {t : Set β} {g : γδ} {f' : α'β'δ} {g₁ : αα'} {g₂ : ββ'} (h_distrib : ∀ (a : α) (b : β), g (f a b) = f' (g₁ a) (g₂ b)) :
g '' Set.image2 f s t = Set.image2 f' (g₁ '' s) (g₂ '' t)
theorem Set.image_image2_distrib_left {α : Type u_1} {α' : Type u_2} {β : Type u_3} {γ : Type u_5} {δ : Type u_7} {f : αβγ} {s : Set α} {t : Set β} {g : γδ} {f' : α'βδ} {g' : αα'} (h_distrib : ∀ (a : α) (b : β), g (f a b) = f' (g' a) b) :
g '' Set.image2 f s t = Set.image2 f' (g' '' s) t

Symmetric statement to Set.image2_image_left_comm.

theorem Set.image_image2_distrib_right {α : Type u_1} {β : Type u_3} {β' : Type u_4} {γ : Type u_5} {δ : Type u_7} {f : αβγ} {s : Set α} {t : Set β} {g : γδ} {f' : αβ'δ} {g' : ββ'} (h_distrib : ∀ (a : α) (b : β), g (f a b) = f' a (g' b)) :
g '' Set.image2 f s t = Set.image2 f' s (g' '' t)

Symmetric statement to Set.image_image2_right_comm.

theorem Set.image2_image_left_comm {α : Type u_1} {α' : Type u_2} {β : Type u_3} {γ : Type u_5} {δ : Type u_7} {s : Set α} {t : Set β} {f : α'βγ} {g : αα'} {f' : αβδ} {g' : δγ} (h_left_comm : ∀ (a : α) (b : β), f (g a) b = g' (f' a b)) :
Set.image2 f (g '' s) t = g' '' Set.image2 f' s t

Symmetric statement to Set.image_image2_distrib_left.

theorem Set.image_image2_right_comm {α : Type u_1} {β : Type u_3} {β' : Type u_4} {γ : Type u_5} {δ : Type u_7} {s : Set α} {t : Set β} {f : αβ'γ} {g : ββ'} {f' : αβδ} {g' : δγ} (h_right_comm : ∀ (a : α) (b : β), f a (g b) = g' (f' a b)) :
Set.image2 f s (g '' t) = g' '' Set.image2 f' s t

Symmetric statement to Set.image_image2_distrib_right.

theorem Set.image2_distrib_subset_left {α : Type u_1} {β : Type u_3} {β' : Type u_4} {γ : Type u_5} {γ' : Type u_6} {δ : Type u_7} {ε : Type u_9} {s : Set α} {t : Set β} {u : Set γ} {f : αδε} {g : βγδ} {f₁ : αββ'} {f₂ : αγγ'} {g' : β'γ'ε} (h_distrib : ∀ (a : α) (b : β) (c : γ), f a (g b c) = g' (f₁ a b) (f₂ a c)) :
Set.image2 f s (Set.image2 g t u) Set.image2 g' (Set.image2 f₁ s t) (Set.image2 f₂ s u)

The other direction does not hold because of the s-s cross terms on the RHS.

theorem Set.image2_distrib_subset_right {α : Type u_1} {α' : Type u_2} {β : Type u_3} {β' : Type u_4} {γ : Type u_5} {δ : Type u_7} {ε : Type u_9} {s : Set α} {t : Set β} {u : Set γ} {f : δγε} {g : αβδ} {f₁ : αγα'} {f₂ : βγβ'} {g' : α'β'ε} (h_distrib : ∀ (a : α) (b : β) (c : γ), f (g a b) c = g' (f₁ a c) (f₂ b c)) :
Set.image2 f (Set.image2 g s t) u Set.image2 g' (Set.image2 f₁ s u) (Set.image2 f₂ t u)

The other direction does not hold because of the u-u cross terms on the RHS.

theorem Set.image_image2_antidistrib {α : Type u_1} {α' : Type u_2} {β : Type u_3} {β' : Type u_4} {γ : Type u_5} {δ : Type u_7} {f : αβγ} {s : Set α} {t : Set β} {g : γδ} {f' : β'α'δ} {g₁ : ββ'} {g₂ : αα'} (h_antidistrib : ∀ (a : α) (b : β), g (f a b) = f' (g₁ b) (g₂ a)) :
g '' Set.image2 f s t = Set.image2 f' (g₁ '' t) (g₂ '' s)
theorem Set.image_image2_antidistrib_left {α : Type u_1} {β : Type u_3} {β' : Type u_4} {γ : Type u_5} {δ : Type u_7} {f : αβγ} {s : Set α} {t : Set β} {g : γδ} {f' : β'αδ} {g' : ββ'} (h_antidistrib : ∀ (a : α) (b : β), g (f a b) = f' (g' b) a) :
g '' Set.image2 f s t = Set.image2 f' (g' '' t) s

Symmetric statement to Set.image2_image_left_anticomm.

theorem Set.image_image2_antidistrib_right {α : Type u_1} {α' : Type u_2} {β : Type u_3} {γ : Type u_5} {δ : Type u_7} {f : αβγ} {s : Set α} {t : Set β} {g : γδ} {f' : βα'δ} {g' : αα'} (h_antidistrib : ∀ (a : α) (b : β), g (f a b) = f' b (g' a)) :
g '' Set.image2 f s t = Set.image2 f' t (g' '' s)

Symmetric statement to Set.image_image2_right_anticomm.

theorem Set.image2_image_left_anticomm {α : Type u_1} {α' : Type u_2} {β : Type u_3} {γ : Type u_5} {δ : Type u_7} {s : Set α} {t : Set β} {f : α'βγ} {g : αα'} {f' : βαδ} {g' : δγ} (h_left_anticomm : ∀ (a : α) (b : β), f (g a) b = g' (f' b a)) :
Set.image2 f (g '' s) t = g' '' Set.image2 f' t s

Symmetric statement to Set.image_image2_antidistrib_left.

theorem Set.image_image2_right_anticomm {α : Type u_1} {β : Type u_3} {β' : Type u_4} {γ : Type u_5} {δ : Type u_7} {s : Set α} {t : Set β} {f : αβ'γ} {g : ββ'} {f' : βαδ} {g' : δγ} (h_right_anticomm : ∀ (a : α) (b : β), f a (g b) = g' (f' b a)) :
Set.image2 f s (g '' t) = g' '' Set.image2 f' t s

Symmetric statement to Set.image_image2_antidistrib_right.

theorem Set.image2_left_identity {α : Type u_1} {β : Type u_3} {f : αββ} {a : α} (h : ∀ (b : β), f a b = b) (t : Set β) :
Set.image2 f {a} t = t

If a is a left identity for f : α → β → β, then {a} is a left identity for Set.image2 f.

theorem Set.image2_right_identity {α : Type u_1} {β : Type u_3} {f : αβα} {b : β} (h : ∀ (a : α), f a b = a) (s : Set α) :
Set.image2 f s {b} = s

If b is a right identity for f : α → β → α, then {b} is a right identity for Set.image2 f.

theorem Set.image2_inter_union_subset_union {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {s' : Set α} {t : Set β} {t' : Set β} :
Set.image2 f (s s') (t t') Set.image2 f s t Set.image2 f s' t'
theorem Set.image2_union_inter_subset_union {α : Type u_1} {β : Type u_3} {γ : Type u_5} {f : αβγ} {s : Set α} {s' : Set α} {t : Set β} {t' : Set β} :
Set.image2 f (s s') (t t') Set.image2 f s t Set.image2 f s' t'
theorem Set.image2_inter_union_subset {α : Type u_1} {β : Type u_3} {f : ααβ} {s : Set α} {t : Set α} (hf : ∀ (a b : α), f a b = f b a) :
Set.image2 f (s t) (s t) Set.image2 f s t
theorem Set.image2_union_inter_subset {α : Type u_1} {β : Type u_3} {f : ααβ} {s : Set α} {t : Set α} (hf : ∀ (a b : α), f a b = f b a) :
Set.image2 f (s t) (s t) Set.image2 f s t