The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V03. Sets, finite structures and big operators

Mathlib.Data.Set.Prod

219 declarations and 2 deprecated aliases. Mathlib docs · Source

Sets in product and pi types

This file proves basic properties of product of sets in α × β and in Π i, α i, and of the diagonal of a type.

Main declarations

This file contains basic results on the following notions, which are defined in Set.Operations.

  • Set.prod: Binary product of sets. For s : Set α, t : Set β, we have s.prod t : Set (α × β). Denoted by s ×ˢ t.
  • Set.diagonal: Diagonal of a type. Set.diagonal α = {(x, x) | x : α}.
  • Set.offDiag: Off-diagonal. s ×ˢ s without the diagonal.
  • Set.pi: Arbitrary product of sets.

Cartesian binary product of sets

Diagonal

In this section we prove some lemmas about the diagonal set {p | p.1 = p.2} and the diagonal map fun x ↦ (x, x).

Cartesian set-indexed product of sets

Vertical line test

theorem Membership.mem.hcongr_5 E1 #

∀ (α α' : Type u),
  α = α' →
    ∀ (γ γ' : Type v),
      γ = γ' →
        ∀ (self : Membership α γ) (self' : Membership α' γ'),
          self ≍ self' → ∀ (a : γ) (a' : γ'), a ≍ a' → ∀ (a_1 : α) (a'_1 : α'), a_1 ≍ a'_1 → (a_1 ∈ a) ≍ (a'_1 ∈ a')

theorem Set.instMembership.hcongr_1 E1 #

∀ (α α' : Type u), α = α' → Set.instMembership ≍ Set.instMembership

theorem Set.Subsingleton.prod E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β}, s.Subsingleton → t.Subsingleton → (s ×ˢ t).Subsingleton

instance Set.decidableMemProd E0 #

{α : Type u_1} →
  {β : Type u_2} →
    {s : Set α} →
      {t : Set β} → [DecidablePred fun x ↦ x ∈ s] → [DecidablePred fun x ↦ x ∈ t] → DecidablePred fun x ↦ x ∈ s ×ˢ t

theorem Set.prod_mono E1 #

∀ {α : Type u_1} {β : Type u_2} {s₁ s₂ : Set α} {t₁ t₂ : Set β}, s₁ ⊆ s₂ → t₁ ⊆ t₂ → s₁ ×ˢ t₁ ⊆ s₂ ×ˢ t₂

theorem Set.prod_mono_left E1 #

∀ {α : Type u_1} {β : Type u_2} {s₁ s₂ : Set α} {t : Set β}, s₁ ⊆ s₂ → s₁ ×ˢ t ⊆ s₂ ×ˢ t

theorem Set.prod_subset_prod_left E1 #

∀ {α : Type u_1} {β : Type u_2} {s₁ s₂ : Set α} {t : Set β}, s₁ ⊆ s₂ → s₁ ×ˢ t ⊆ s₂ ×ˢ t

Alias of Set.prod_mono_left.

theorem Set.prod_mono_right E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t₁ t₂ : Set β}, t₁ ⊆ t₂ → s ×ˢ t₁ ⊆ s ×ˢ t₂

theorem Set.prod_subset_prod_right E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t₁ t₂ : Set β}, t₁ ⊆ t₂ → s ×ˢ t₁ ⊆ s ×ˢ t₂

Alias of Set.prod_mono_right.

theorem Set.prod_self_subset_prod_self E0 #

∀ {α : Type u_1} {s₁ s₂ : Set α}, s₁ ×ˢ s₁ ⊆ s₂ ×ˢ s₂ ↔ s₁ ⊆ s₂

theorem Set.prod_self_ssubset_prod_self E0 #

∀ {α : Type u_1} {s₁ s₂ : Set α}, s₁ ×ˢ s₁ ⊂ s₂ ×ˢ s₂ ↔ s₁ ⊂ s₂

theorem Set.prod_subset_iff E0 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β} {P : Set (α × β)}, s ×ˢ t ⊆ P ↔ ∀ x ∈ s, ∀ y ∈ t, (x, y) ∈ P

theorem Set.forall_prod_set E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β} {p : α × β → Prop},
  (∀ x ∈ s ×ˢ t, p x) ↔ ∀ x ∈ s, ∀ y ∈ t, p (x, y)

theorem Set.exists_prod_set E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β} {p : α × β → Prop},
  (∃ x ∈ s ×ˢ t, p x) ↔ ∃ x ∈ s, ∃ y ∈ t, p (x, y)

theorem Set.prod_empty E0 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α}, s ×ˢ ∅ = ∅

theorem Set.empty_prod E0 #

∀ {α : Type u_1} {β : Type u_2} {t : Set β}, ∅ ×ˢ t = ∅

theorem Set.univ_prod_univ E0 #

∀ {α : Type u_1} {β : Type u_2}, Set.univ ×ˢ Set.univ = Set.univ

theorem Set.univ_prod E1 #

∀ {α : Type u_1} {β : Type u_2} {t : Set β}, Set.univ ×ˢ t = Prod.snd ⁻¹' t

theorem Set.prod_univ E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α}, s ×ˢ Set.univ = Prod.fst ⁻¹' s

theorem Set.prod_eq_univ E0 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β} [Nonempty α] [Nonempty β],
  s ×ˢ t = Set.univ ↔ s = Set.univ ∧ t = Set.univ

theorem Set.singleton_prod E1 #

∀ {α : Type u_1} {β : Type u_2} {t : Set β} {a : α}, {a} ×ˢ t = Prod.mk a '' t

theorem Set.prod_singleton E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {b : β}, s ×ˢ {b} = (fun a ↦ (a, b)) '' s

theorem Set.singleton_prod_singleton E0 #

∀ {α : Type u_1} {β : Type u_2} {a : α} {b : β}, {a} ×ˢ {b} = {(a, b)}

theorem Set.union_prod E0 #

∀ {α : Type u_1} {β : Type u_2} {s₁ s₂ : Set α} {t : Set β}, (s₁ ∪ s₂) ×ˢ t = s₁ ×ˢ t ∪ s₂ ×ˢ t

theorem Set.prod_union E0 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t₁ t₂ : Set β}, s ×ˢ (t₁ ∪ t₂) = s ×ˢ t₁ ∪ s ×ˢ t₂

theorem Set.inter_prod E1 #

∀ {α : Type u_1} {β : Type u_2} {s₁ s₂ : Set α} {t : Set β}, (s₁ ∩ s₂) ×ˢ t = s₁ ×ˢ t ∩ s₂ ×ˢ t

theorem Set.prod_inter E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t₁ t₂ : Set β}, s ×ˢ (t₁ ∩ t₂) = s ×ˢ t₁ ∩ s ×ˢ t₂

theorem Set.prod_inter_prod E1 #

∀ {α : Type u_1} {β : Type u_2} {s₁ s₂ : Set α} {t₁ t₂ : Set β}, s₁ ×ˢ t₁ ∩ s₂ ×ˢ t₂ = (s₁ ∩ s₂) ×ˢ (t₁ ∩ t₂)

theorem Set.compl_prod_eq_union E1 #

∀ {α : Type u_5} {β : Type u_6} (s : Set α) (t : Set β), (s ×ˢ t)ᶜ = sᶜ ×ˢ Set.univ ∪ Set.univ ×ˢ tᶜ

theorem Set.disjoint_prod E0 #

∀ {α : Type u_1} {β : Type u_2} {s₁ s₂ : Set α} {t₁ t₂ : Set β},
  Disjoint (s₁ ×ˢ t₁) (s₂ ×ˢ t₂) ↔ Disjoint s₁ s₂ ∨ Disjoint t₁ t₂

theorem Set.Disjoint.set_prod_left E1 #

∀ {α : Type u_1} {β : Type u_2} {s₁ s₂ : Set α}, Disjoint s₁ s₂ → ∀ (t₁ t₂ : Set β), Disjoint (s₁ ×ˢ t₁) (s₂ ×ˢ t₂)

theorem Set.Disjoint.set_prod_right E1 #

∀ {α : Type u_1} {β : Type u_2} {t₁ t₂ : Set β}, Disjoint t₁ t₂ → ∀ (s₁ s₂ : Set α), Disjoint (s₁ ×ˢ t₁) (s₂ ×ˢ t₂)

theorem Set.prodMap_image_prod E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} (f : α → β) (g : γ → δ) (s : Set α) (t : Set γ),
  Prod.map f g '' s ×ˢ t = (f '' s) ×ˢ (g '' t)

theorem Set.insert_prod E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β} {a : α}, insert a s ×ˢ t = Prod.mk a '' t ∪ s ×ˢ t

theorem Set.prod_insert E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β} {b : β}, s ×ˢ insert b t = (fun a ↦ (a, b)) '' s ∪ s ×ˢ t

theorem Set.prod_preimage_eq E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} {s : Set α} {t : Set β} {f : γ → α} {g : δ → β},
  (f ⁻¹' s) ×ˢ (g ⁻¹' t) = (fun p ↦ (f p.1, g p.2)) ⁻¹' s ×ˢ t

theorem Set.prod_preimage_left E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {s : Set α} {t : Set β} {f : γ → α},
  (f ⁻¹' s) ×ˢ t = (fun p ↦ (f p.1, p.2)) ⁻¹' s ×ˢ t

theorem Set.prod_preimage_right E1 #

∀ {α : Type u_1} {β : Type u_2} {δ : Type u_4} {s : Set α} {t : Set β} {g : δ → β},
  s ×ˢ (g ⁻¹' t) = (fun p ↦ (p.1, g p.2)) ⁻¹' s ×ˢ t

theorem Set.preimage_prod_map_prod E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} (f : α → β) (g : γ → δ) (s : Set β) (t : Set δ),
  Prod.map f g ⁻¹' s ×ˢ t = (f ⁻¹' s) ×ˢ (g ⁻¹' t)

theorem Set.mk_preimage_prod E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {s : Set α} {t : Set β} (f : γ → α) (g : γ → β),
  (fun x ↦ (f x, g x)) ⁻¹' s ×ˢ t = f ⁻¹' s ∩ g ⁻¹' t

theorem Set.mk_preimage_prod_left E0 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β} {b : β}, b ∈ t → (fun a ↦ (a, b)) ⁻¹' s ×ˢ t = s

theorem Set.mk_preimage_prod_right E0 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β} {a : α}, a ∈ s → Prod.mk a ⁻¹' s ×ˢ t = t

theorem Set.mk_preimage_prod_left_eq_empty E0 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β} {b : β}, b ∉ t → (fun a ↦ (a, b)) ⁻¹' s ×ˢ t = ∅

theorem Set.mk_preimage_prod_right_eq_empty E0 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β} {a : α}, a ∉ s → Prod.mk a ⁻¹' s ×ˢ t = ∅

theorem Set.mk_preimage_prod_left_eq_if E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β} {b : β} [inst : DecidablePred fun x ↦ x ∈ t],
  (fun a ↦ (a, b)) ⁻¹' s ×ˢ t = if b ∈ t then s else ∅

theorem Set.mk_preimage_prod_right_eq_if E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β} {a : α} [inst : DecidablePred fun x ↦ x ∈ s],
  Prod.mk a ⁻¹' s ×ˢ t = if a ∈ s then t else ∅

theorem Set.mk_preimage_prod_left_fn_eq_if E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {s : Set α} {t : Set β} {b : β} [inst : DecidablePred fun x ↦ x ∈ t]
  (f : γ → α), (fun a ↦ (f a, b)) ⁻¹' s ×ˢ t = if b ∈ t then f ⁻¹' s else ∅

theorem Set.mk_preimage_prod_right_fn_eq_if E1 #

∀ {α : Type u_1} {β : Type u_2} {δ : Type u_4} {s : Set α} {t : Set β} {a : α} [inst : DecidablePred fun x ↦ x ∈ s]
  (g : δ → β), (fun b ↦ (a, g b)) ⁻¹' s ×ˢ t = if a ∈ s then g ⁻¹' t else ∅

theorem Set.preimage_swap_prod E0 #

∀ {α : Type u_1} {β : Type u_2} (s : Set α) (t : Set β), Prod.swap ⁻¹' s ×ˢ t = t ×ˢ s

theorem Set.image_swap_prod E0 #

∀ {α : Type u_1} {β : Type u_2} (s : Set α) (t : Set β), Prod.swap '' s ×ˢ t = t ×ˢ s

theorem Set.mapsTo_swap_prod E1 #

∀ {α : Type u_1} {β : Type u_2} (s : Set α) (t : Set β), Set.MapsTo Prod.swap (s ×ˢ t) (t ×ˢ s)

theorem Set.prod_image_image_eq E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} {s : Set α} {t : Set β} {m₁ : α → γ} {m₂ : β → δ},
  (m₁ '' s) ×ˢ (m₂ '' t) = (fun p ↦ (m₁ p.1, m₂ p.2)) '' s ×ˢ t

theorem Set.prod_range_range_eq E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} {m₁ : α → γ} {m₂ : β → δ},
  Set.range m₁ ×ˢ Set.range m₂ = Set.range fun p ↦ (m₁ p.1, m₂ p.2)

theorem Set.range_prodMap E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} {m₁ : α → γ} {m₂ : β → δ},
  Set.range (Prod.map m₁ m₂) = Set.range m₁ ×ˢ Set.range m₂

theorem Set.prod_range_univ_eq E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {m₁ : α → γ}, Set.range m₁ ×ˢ Set.univ = Set.range fun p ↦ (m₁ p.1, p.2)

theorem Set.prod_univ_range_eq E0 #

∀ {α : Type u_1} {β : Type u_2} {δ : Type u_4} {m₂ : β → δ}, Set.univ ×ˢ Set.range m₂ = Set.range fun p ↦ (p.1, m₂ p.2)

theorem Set.range_pair_subset E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} (f : α → β) (g : α → γ),
  (Set.range fun x ↦ (f x, g x)) ⊆ Set.range f ×ˢ Set.range g

theorem Set.Nonempty.prod E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β}, s.Nonempty → t.Nonempty → (s ×ˢ t).Nonempty

theorem Set.Nonempty.fst E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β}, (s ×ˢ t).Nonempty → s.Nonempty

theorem Set.Nonempty.snd E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β}, (s ×ˢ t).Nonempty → t.Nonempty

theorem Set.prod_nonempty_iff E0 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β}, (s ×ˢ t).Nonempty ↔ s.Nonempty ∧ t.Nonempty

theorem Set.prod_eq_empty_iff E0 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β}, s ×ˢ t = ∅ ↔ s = ∅ ∨ t = ∅

theorem Set.prod_sub_preimage_iff E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {s : Set α} {t : Set β} {W : Set γ} {f : α × β → γ},
  s ×ˢ t ⊆ f ⁻¹' W ↔ ∀ (a : α) (b : β), a ∈ s → b ∈ t → f (a, b) ∈ W

theorem Set.image_prodMk_subset_prod E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {f : α → β} {g : α → γ} {s : Set α},
  (fun x ↦ (f x, g x)) '' s ⊆ (f '' s) ×ˢ (g '' s)

theorem Set.image_prodMk_subset_prod_left E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β} {b : β}, b ∈ t → (fun a ↦ (a, b)) '' s ⊆ s ×ˢ t

theorem Set.image_prodMk_subset_prod_right E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β} {a : α}, a ∈ s → Prod.mk a '' t ⊆ s ×ˢ t

theorem Set.prod_subset_preimage_fst E1 #

∀ {α : Type u_1} {β : Type u_2} (s : Set α) (t : Set β), s ×ˢ t ⊆ Prod.fst ⁻¹' s

theorem Set.fst_image_prod_subset E1 #

∀ {α : Type u_1} {β : Type u_2} (s : Set α) (t : Set β), Prod.fst '' s ×ˢ t ⊆ s

theorem Set.fst_image_prod E1 #

∀ {α : Type u_1} {β : Type u_2} (s : Set β) {t : Set α}, t.Nonempty → Prod.fst '' s ×ˢ t = s

theorem Set.mapsTo_fst_prod E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β}, Set.MapsTo Prod.fst (s ×ˢ t) s

theorem Set.prod_subset_preimage_snd E1 #

∀ {α : Type u_1} {β : Type u_2} (s : Set α) (t : Set β), s ×ˢ t ⊆ Prod.snd ⁻¹' t

theorem Set.snd_image_prod_subset E1 #

∀ {α : Type u_1} {β : Type u_2} (s : Set α) (t : Set β), Prod.snd '' s ×ˢ t ⊆ t

theorem Set.snd_image_prod E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α}, s.Nonempty → ∀ (t : Set β), Prod.snd '' s ×ˢ t = t

theorem Set.subset_fst_image_prod_snd_image E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set (α × β)}, s ⊆ (Prod.fst '' s) ×ˢ (Prod.snd '' s)

theorem Set.mapsTo_snd_prod E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t : Set β}, Set.MapsTo Prod.snd (s ×ˢ t) t

theorem Set.prod_sdiff_prod E1 #

∀ {α : Type u_1} {β : Type u_2} {s s₁ : Set α} {t t₁ : Set β}, s ×ˢ t \ s₁ ×ˢ t₁ = s ×ˢ (t \ t₁) ∪ (s \ s₁) ×ˢ t

theorem Set.prod_subset_prod_iff E0 #

∀ {α : Type u_1} {β : Type u_2} {s s₁ : Set α} {t t₁ : Set β}, s ×ˢ t ⊆ s₁ ×ˢ t₁ ↔ s ⊆ s₁ ∧ t ⊆ t₁ ∨ s = ∅ ∨ t = ∅

A product set is included in a product set if and only factors are included, or a factor of the first set is empty.

theorem Set.prod_subset_prod_iff' E1 #

∀ {α : Type u_1} {β : Type u_2} {s s₁ : Set α} {t t₁ : Set β}, (s ×ˢ t).Nonempty → (s ×ˢ t ⊆ s₁ ×ˢ t₁ ↔ s ⊆ s₁ ∧ t ⊆ t₁)

theorem Set.prod_subset_prod_iff_left E1 #

∀ {α : Type u_1} {β : Type u_2} {s s₁ : Set α} {t : Set β}, t.Nonempty → (s ×ˢ t ⊆ s₁ ×ˢ t ↔ s ⊆ s₁)

theorem Set.prod_subset_prod_iff_right E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {t t₁ : Set β}, s.Nonempty → (s ×ˢ t ⊆ s ×ˢ t₁ ↔ t ⊆ t₁)

theorem Set.prod_eq_prod_iff_of_nonempty E1 #

∀ {α : Type u_1} {β : Type u_2} {s s₁ : Set α} {t t₁ : Set β}, (s ×ˢ t).Nonempty → (s ×ˢ t = s₁ ×ˢ t₁ ↔ s = s₁ ∧ t = t₁)

theorem Set.prod_eq_prod_iff E0 #

∀ {α : Type u_1} {β : Type u_2} {s s₁ : Set α} {t t₁ : Set β},
  s ×ˢ t = s₁ ×ˢ t₁ ↔ s = s₁ ∧ t = t₁ ∨ (s = ∅ ∨ t = ∅) ∧ (s₁ = ∅ ∨ t₁ = ∅)

theorem Set.prod_eq_iff_eq E0 #

∀ {α : Type u_1} {β : Type u_2} {s s₁ : Set α} {t : Set β}, t.Nonempty → (s ×ˢ t = s₁ ×ˢ t ↔ s = s₁)

theorem Set.subset_prod E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set (α × β)}, s ⊆ (Prod.fst '' s) ×ˢ (Prod.snd '' s)

theorem Monotone.set_prod E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Preorder α] {f : α → Set β} {g : α → Set γ},
  Monotone f → Monotone g → Monotone fun x ↦ f x ×ˢ g x

theorem Antitone.set_prod E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} [inst : Preorder α] {f : α → Set β} {g : α → Set γ},
  Antitone f → Antitone g → Antitone fun x ↦ f x ×ˢ g x

theorem MonotoneOn.set_prod E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {s : Set α} [inst : Preorder α] {f : α → Set β} {g : α → Set γ},
  MonotoneOn f s → MonotoneOn g s → MonotoneOn (fun x ↦ f x ×ˢ g x) s

theorem AntitoneOn.set_prod E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {s : Set α} [inst : Preorder α] {f : α → Set β} {g : α → Set γ},
  AntitoneOn f s → AntitoneOn g s → AntitoneOn (fun x ↦ f x ×ˢ g x) s

theorem Set.eqOn_prod_iff E0 #

∀ {α : Type u_1} {γ : Type u_3} {δ : Type u_4} {s : Set α} {a b : α → γ × δ},
  Set.EqOn a b s ↔ Set.EqOn (Prod.fst ∘ a) (Prod.fst ∘ b) s ∧ Set.EqOn (Prod.snd ∘ a) (Prod.snd ∘ b) s

theorem Set.EqOn.left_of_eqOn_prodMap E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} {s : Set α} {t : Set β} {f f' : α → γ} {g g' : β → δ},
  Set.EqOn (Prod.map f g) (Prod.map f' g') (s ×ˢ t) → t.Nonempty → Set.EqOn f f' s

theorem Set.EqOn.right_of_eqOn_prodMap E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} {s : Set α} {t : Set β} {f f' : α → γ} {g g' : β → δ},
  Set.EqOn (Prod.map f g) (Prod.map f' g') (s ×ˢ t) → s.Nonempty → Set.EqOn g g' t

theorem Set.EqOn.prodMap E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} {s : Set α} {t : Set β} {f f' : α → γ} {g g' : β → δ},
  Set.EqOn f f' s → Set.EqOn g g' t → Set.EqOn (Prod.map f g) (Prod.map f' g') (s ×ˢ t)

theorem Set.eqOn_prodMap_iff E0 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} {f f' : α → γ} {g g' : β → δ} {s : Set α} {t : Set β},
  s.Nonempty → t.Nonempty → (Set.EqOn (Prod.map f g) (Prod.map f' g') (s ×ˢ t) ↔ Set.EqOn f f' s ∧ Set.EqOn g g' t)

theorem Set.diagonal_nonempty E1 #

∀ {α : Type u_1} [Nonempty α], (Set.diagonal α).Nonempty

instance Set.decidableMemDiagonal E0 #

{α : Type u_1} → [h : DecidableEq α] → (x : α × α) → Decidable (x ∈ Set.diagonal α)

theorem Set.preimage_coe_coe_diagonal E1 #

∀ {α : Type u_1} (s : Set α), (Prod.map (fun x ↦ ↑x) fun x ↦ ↑x) ⁻¹' Set.diagonal α = Set.diagonal ↑s

theorem Set.range_diag E0 #

∀ {α : Type u_1}, Set.range Function.diag = Set.diagonal α

theorem Set.diagonal_subset_iff E0 #

∀ {α : Type u_1} {s : Set (α × α)}, Set.diagonal α ⊆ s ↔ ∀ (x : α), (x, x) ∈ s

theorem Set.prod_subset_compl_diagonal_iff_disjoint E0 #

∀ {α : Type u_1} {s t : Set α}, s ×ˢ t ⊆ (Set.diagonal α)ᶜ ↔ Disjoint s t

theorem Set.diag_preimage_prod E0 #

∀ {α : Type u_1} (s t : Set α), Function.diag ⁻¹' s ×ˢ t = s ∩ t

theorem Set.diag_preimage_prod_self E1 #

∀ {α : Type u_1} (s : Set α), Function.diag ⁻¹' s ×ˢ s = s

theorem Set.diag_image E1 #

∀ {α : Type u_1} (s : Set α), Function.diag '' s = Set.diagonal α ∩ s ×ˢ s

theorem Set.diagonal_eq_univ_iff E0 #

∀ {α : Type u_1}, Set.diagonal α = Set.univ ↔ Subsingleton α

theorem Set.diagonal_eq_univ E1 #

∀ {α : Type u_1} [Subsingleton α], Set.diagonal α = Set.univ

theorem Set.range_const_eq_diagonal E1 #

∀ {α : Type u_1} {β : Type u_2} [hβ : Nonempty β], Set.range (Function.const α) = {f | ∀ (x y : α), f x = f y}

A function is Function.const α a for some a if and only if ∀ x y, f x = f y.

abbrev Function.Pullback E1 #

{X : Type u_1} → {Y : Sort u_2} → {Z : Type u_3} → (X → Y) → (Z → Y) → Type (max 0 u_3 u_1)

The fiber product $X \times_Y Z$.

abbrev Function.PullbackSelf E1 #

{X : Type u_1} → {Y : Sort u_2} → (X → Y) → Type u_1

The fiber product $X \times_Y X$.

def Function.Pullback.fst E1 #

{X : Type u_1} → {Y : Sort u_2} → {Z : Type u_3} → {f : X → Y} → {g : Z → Y} → Function.Pullback f g → X

The projection from the fiber product to the first factor.

def Function.Pullback.snd E1 #

{X : Type u_1} → {Y : Sort u_2} → {Z : Type u_3} → {f : X → Y} → {g : Z → Y} → Function.Pullback f g → Z

The projection from the fiber product to the second factor.

theorem Function.pullback_comm_sq E1 #

∀ {X : Type u_2} {Y : Sort u_3} {Z : Type u_1} (f : X → Y) (g : Z → Y),
  f ∘ Function.Pullback.fst = g ∘ Function.Pullback.snd

def toPullbackDiag E1 #

{X : Type u_1} → {Y : Sort u_2} → (f : X → Y) → X → Function.Pullback f f

The diagonal map $\Delta: X \to X \times_Y X$.

theorem toPullbackDiag_coe E0 #

∀ {X : Type u_1} {Y : Sort u_2} (f : X → Y) (x : X), ↑(toPullbackDiag f x) = (x, x)

def Function.pullbackDiagonal E1 #

{X : Type u_1} → {Y : Sort u_2} → (f : X → Y) → Set (Function.Pullback f f)

The diagonal $\Delta(X) \subseteq X \times_Y X$.

def Function.mapPullback E1 #

{X₁ : Type u_1} →
  {X₂ : Type u_2} →
    {Y₁ : Sort u_3} →
      {Y₂ : Sort u_4} →
        {Z₁ : Type u_5} →
          {Z₂ : Type u_6} →
            {f₁ : X₁ → Y₁} →
              {g₁ : Z₁ → Y₁} →
                {f₂ : X₂ → Y₂} →
                  {g₂ : Z₂ → Y₂} →
                    (mapX : X₁ → X₂) →
                      (mapY : Y₁ → Y₂) →
                        (mapZ : Z₁ → Z₂) →
                          f₂ ∘ mapX = mapY ∘ f₁ →
                            g₂ ∘ mapZ = mapY ∘ g₁ → Function.Pullback f₁ g₁ → Function.Pullback f₂ g₂

Three functions between the three pairs of spaces $X_i, Y_i, Z_i$ that are compatible induce a function $X_1 \times_{Y_1} Z_1 \to X_2 \times_{Y_2} Z_2$.

def Function.PullbackSelf.map_fst E0 #

{X : Type u_1} →
  {Y : Sort u_2} →
    {Z : Type u_3} → {f : X → Y} → {g : Z → Y} → Function.PullbackSelf Function.Pullback.snd → Function.PullbackSelf f

The projection $(X \times_Y Z) \times_Z (X \times_Y Z) \to X \times_Y X$.

def Function.PullbackSelf.map_snd E0 #

{X : Type u_1} →
  {Y : Sort u_2} →
    {Z : Type u_3} → {f : X → Y} → {g : Z → Y} → Function.PullbackSelf Function.Pullback.fst → Function.PullbackSelf g

The projection $(X \times_Y Z) \times_X (X \times_Y Z) \to Z \times_Y Z$.

theorem preimage_map_fst_pullbackDiagonal E1 #

∀ {X : Type u_2} {Y : Sort u_3} {Z : Type u_1} {f : X → Y} {g : Z → Y},
  Function.PullbackSelf.map_fst ⁻¹' Function.pullbackDiagonal f = Function.pullbackDiagonal Function.Pullback.snd

theorem Function.Injective.preimage_pullbackDiagonal E1 #

∀ {X : Type u_2} {Y : Sort u_3} {Z : Type u_1} {f : X → Y} {g : Z → X},
  Function.Injective g →
    Function.mapPullback g id g ⋯ ⋯ ⁻¹' Function.pullbackDiagonal f = Function.pullbackDiagonal (f ∘ g)

theorem image_toPullbackDiag E1 #

∀ {X : Type u_1} {Y : Sort u_2} (f : X → Y) (s : Set X),
  toPullbackDiag f '' s = Function.pullbackDiagonal f ∩ Subtype.val ⁻¹' s ×ˢ s

theorem range_toPullbackDiag E1 #

∀ {X : Type u_1} {Y : Sort u_2} (f : X → Y), Set.range (toPullbackDiag f) = Function.pullbackDiagonal f

theorem injective_toPullbackDiag E1 #

∀ {X : Type u_1} {Y : Sort u_2} (f : X → Y), Function.Injective (toPullbackDiag f)

theorem Set.offDiag_mono E1 #

∀ {α : Type u_1}, Monotone Set.offDiag

theorem Set.offDiag_nonempty E0 #

∀ {α : Type u_1} {s : Set α}, s.offDiag.Nonempty ↔ s.Nontrivial

theorem Set.offDiag_eq_empty E0 #

∀ {α : Type u_1} {s : Set α}, s.offDiag = ∅ ↔ s.Subsingleton

theorem Set.Nontrivial.offDiag_nonempty E1 #

∀ {α : Type u_1} {s : Set α}, s.Nontrivial → s.offDiag.Nonempty

Alias of the reverse direction of Set.offDiag_nonempty.

theorem Set.Subsingleton.offDiag_eq_empty E1 #

∀ {α : Type u_1} {s : Set α}, s.Subsingleton → s.offDiag = ∅

Alias of the reverse direction of Set.offDiag_eq_empty.

theorem Set.offDiag_subset_prod E1 #

∀ {α : Type u_1} (s : Set α), s.offDiag ⊆ s ×ˢ s

theorem Set.offDiag_eq_sep_prod E1 #

∀ {α : Type u_1} (s : Set α), s.offDiag = {x | x ∈ s ×ˢ s ∧ x.1 ≠ x.2}

theorem Set.offDiag_empty E0 #

∀ {α : Type u_1}, ∅.offDiag = ∅

theorem Set.offDiag_singleton E0 #

∀ {α : Type u_1} (a : α), {a}.offDiag = ∅

theorem Set.offDiag_univ E0 #

∀ {α : Type u_1}, Set.univ.offDiag = (Set.diagonal α)ᶜ

theorem Set.prod_sdiff_diagonal E0 #

∀ {α : Type u_1} (s : Set α), s ×ˢ s \ Set.diagonal α = s.offDiag

theorem Set.disjoint_diagonal_offDiag E0 #

∀ {α : Type u_1} (s : Set α), Disjoint (Set.diagonal α) s.offDiag

theorem Set.offDiag_inter E1 #

∀ {α : Type u_1} (s t : Set α), (s ∩ t).offDiag = s.offDiag ∩ t.offDiag

theorem Set.offDiag_union E1 #

∀ {α : Type u_1} {s t : Set α}, Disjoint s t → (s ∪ t).offDiag = s.offDiag ∪ t.offDiag ∪ s ×ˢ t ∪ t ×ˢ s

theorem Set.offDiag_insert E1 #

∀ {α : Type u_1} {s : Set α} {a : α}, a ∉ s → (insert a s).offDiag = s.offDiag ∪ {a} ×ˢ s ∪ s ×ˢ {a}

theorem Set.empty_pi E0 #

∀ {ι : Type u_1} {α : ι → Type u_2} (s : (i : ι) → Set (α i)), ∅.pi s = Set.univ

theorem Set.subsingleton_univ_pi E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {t : (i : ι) → Set (α i)},
  (∀ (i : ι), (t i).Subsingleton) → (Set.univ.pi t).Subsingleton

theorem Set.pi_univ E0 #

∀ {ι : Type u_1} {α : ι → Type u_2} (s : Set ι), (s.pi fun i ↦ Set.univ) = Set.univ

theorem Set.pi_univ_ite E0 #

∀ {ι : Type u_1} {α : ι → Type u_2} (s : Set ι) [inst : DecidablePred fun x ↦ x ∈ s] (t : (i : ι) → Set (α i)),
  (Set.univ.pi fun i ↦ if i ∈ s then t i else Set.univ) = s.pi t

theorem Set.pi_mono' E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {s₁ s₂ : Set ι} {t₁ t₂ : (i : ι) → Set (α i)},
  (∀ i ∈ s₂, t₁ i ⊆ t₂ i) → s₂ ⊆ s₁ → s₁.pi t₁ ⊆ s₂.pi t₂

theorem Set.pi_mono E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {s : Set ι} {t₁ t₂ : (i : ι) → Set (α i)},
  (∀ i ∈ s, t₁ i ⊆ t₂ i) → s.pi t₁ ⊆ s.pi t₂

theorem Set.pi_inter_distrib E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {s : Set ι} {t t₁ : (i : ι) → Set (α i)},
  (s.pi fun i ↦ t i ∩ t₁ i) = s.pi t ∩ s.pi t₁

theorem Set.pi_congr E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {s₁ s₂ : Set ι} {t₁ t₂ : (i : ι) → Set (α i)},
  s₁ = s₂ → (∀ i ∈ s₁, t₁ i = t₂ i) → s₁.pi t₁ = s₂.pi t₂

theorem Set.pi_eq_empty E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {s : Set ι} {t : (i : ι) → Set (α i)} {i : ι}, i ∈ s → t i = ∅ → s.pi t = ∅

theorem Set.univ_pi_eq_empty E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {t : (i : ι) → Set (α i)} {i : ι}, t i = ∅ → Set.univ.pi t = ∅

theorem Set.pi_nonempty_iff E0 #

∀ {ι : Type u_1} {α : ι → Type u_2} {s : Set ι} {t : (i : ι) → Set (α i)},
  (s.pi t).Nonempty ↔ ∀ (i : ι), ∃ x, i ∈ s → x ∈ t i

theorem Set.univ_pi_nonempty_iff E0 #

∀ {ι : Type u_1} {α : ι → Type u_2} {t : (i : ι) → Set (α i)}, (Set.univ.pi t).Nonempty ↔ ∀ (i : ι), (t i).Nonempty

theorem Set.pi_eq_empty_iff E0 #

∀ {ι : Type u_1} {α : ι → Type u_2} {s : Set ι} {t : (i : ι) → Set (α i)},
  s.pi t = ∅ ↔ ∃ i, IsEmpty (α i) ∨ i ∈ s ∧ t i = ∅

theorem Set.univ_pi_eq_empty_iff E0 #

∀ {ι : Type u_1} {α : ι → Type u_2} {t : (i : ι) → Set (α i)}, Set.univ.pi t = ∅ ↔ ∃ i, t i = ∅

theorem Set.univ_pi_empty E0 #

∀ {ι : Type u_1} {α : ι → Type u_2} [h : Nonempty ι], (Set.univ.pi fun x ↦ ∅) = ∅

theorem Set.disjoint_univ_pi E0 #

∀ {ι : Type u_1} {α : ι → Type u_2} {t₁ t₂ : (i : ι) → Set (α i)},
  Disjoint (Set.univ.pi t₁) (Set.univ.pi t₂) ↔ ∃ i, Disjoint (t₁ i) (t₂ i)

theorem Set.Disjoint.set_pi E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {s : Set ι} {t₁ t₂ : (i : ι) → Set (α i)} {i : ι},
  i ∈ s → Disjoint (t₁ i) (t₂ i) → Disjoint (s.pi t₁) (s.pi t₂)

theorem Set.uniqueElim_preimage E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} [inst : Unique ι] (t : (i : ι) → Set (α i)),
  uniqueElim ⁻¹' Set.univ.pi t = t default

theorem Set.pi_image_pi_of_subset E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {s₁ s₂ : Set ι} {C : (i : ι) → Set (Set (α i))},
  (∀ (i : ι), (C i).Nonempty) → s₁ ⊆ s₂ → s₁.pi '' s₁.pi C = s₁.pi '' s₂.pi C

theorem Set.pi_eq_empty_iff' E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {s : Set ι} {t : (i : ι) → Set (α i)} [∀ (i : ι), Nonempty (α i)],
  s.pi t = ∅ ↔ ∃ i ∈ s, t i = ∅

theorem Set.disjoint_pi E0 #

∀ {ι : Type u_1} {α : ι → Type u_2} {s : Set ι} {t₁ t₂ : (i : ι) → Set (α i)} [∀ (i : ι), Nonempty (α i)],
  Disjoint (s.pi t₁) (s.pi t₂) ↔ ∃ i ∈ s, Disjoint (t₁ i) (t₂ i)

theorem Set.insert_pi E0 #

∀ {ι : Type u_1} {α : ι → Type u_2} (i : ι) (s : Set ι) (t : (i : ι) → Set (α i)),
  (insert i s).pi t = Function.eval i ⁻¹' t i ∩ s.pi t

theorem Set.singleton_pi E0 #

∀ {ι : Type u_1} {α : ι → Type u_2} (i : ι) (t : (i : ι) → Set (α i)), {i}.pi t = Function.eval i ⁻¹' t i

theorem Set.singleton_pi' E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} (i : ι) (t : (i : ι) → Set (α i)), {i}.pi t = {x | x i ∈ t i}

theorem Set.univ_pi_singleton E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} (f : (i : ι) → α i), (Set.univ.pi fun i ↦ {f i}) = {f}

theorem Set.preimage_pi E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {β : ι → Type u_3} (s : Set ι) (t : (i : ι) → Set (β i)) (f : (i : ι) → α i → β i),
  (fun g i ↦ f i (g i)) ⁻¹' s.pi t = s.pi fun i ↦ f i ⁻¹' t i

theorem Set.pi_if E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {p : ι → Prop} [h : DecidablePred p] (s : Set ι) (t₁ t₂ : (i : ι) → Set (α i)),
  (s.pi fun i ↦ if p i then t₁ i else t₂ i) = {i | i ∈ s ∧ p i}.pi t₁ ∩ {i | i ∈ s ∧ ¬p i}.pi t₂

theorem Set.union_pi E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {s₁ s₂ : Set ι} {t : (i : ι) → Set (α i)}, (s₁ ∪ s₂).pi t = s₁.pi t ∩ s₂.pi t

theorem Set.union_pi_inter E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {s₁ s₂ : Set ι} {t₁ t₂ : (i : ι) → Set (α i)},
  (∀ i ∉ s₁, t₁ i = Set.univ) → (∀ i ∉ s₂, t₂ i = Set.univ) → ((s₁ ∪ s₂).pi fun i ↦ t₁ i ∩ t₂ i) = s₁.pi t₁ ∩ s₂.pi t₂

theorem Set.pi_inter_compl E0 #

∀ {ι : Type u_1} {α : ι → Type u_2} {t : (i : ι) → Set (α i)} (s : Set ι), s.pi t ∩ sᶜ.pi t = Set.univ.pi t

theorem Set.pi_update_of_notMem E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {β : ι → Type u_3} {s : Set ι} {i : ι} [inst : DecidableEq ι],
  i ∉ s →
    ∀ (f : (j : ι) → α j) (a : α i) (t : (j : ι) → α j → Set (β j)),
      (s.pi fun j ↦ t j (Function.update f i a j)) = s.pi fun j ↦ t j (f j)

theorem Set.pi_update_of_mem E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {β : ι → Type u_3} {s : Set ι} {i : ι} [inst : DecidableEq ι],
  i ∈ s →
    ∀ (f : (j : ι) → α j) (a : α i) (t : (j : ι) → α j → Set (β j)),
      (s.pi fun j ↦ t j (Function.update f i a j)) = {x | x i ∈ t i a} ∩ (s \ {i}).pi fun j ↦ t j (f j)

theorem Set.univ_pi_update E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} [inst : DecidableEq ι] {β : ι → Type u_4} (i : ι) (f : (j : ι) → α j) (a : α i)
  (t : (j : ι) → α j → Set (β j)),
  (Set.univ.pi fun j ↦ t j (Function.update f i a j)) = {x | x i ∈ t i a} ∩ {i}ᶜ.pi fun j ↦ t j (f j)

theorem Set.univ_pi_update_univ E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} [inst : DecidableEq ι] (i : ι) (s : Set (α i)),
  Set.univ.pi (Function.update (fun j ↦ Set.univ) i s) = Function.eval i ⁻¹' s

theorem Set.eval_image_pi_subset E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {s : Set ι} {t : (i : ι) → Set (α i)} {i : ι},
  i ∈ s → Function.eval i '' s.pi t ⊆ t i

theorem Set.eval_image_univ_pi_subset E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {t : (i : ι) → Set (α i)} {i : ι}, Function.eval i '' Set.univ.pi t ⊆ t i

theorem Set.subset_eval_image_pi E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {s : Set ι} {t : (i : ι) → Set (α i)},
  (s.pi t).Nonempty → ∀ (i : ι), t i ⊆ Function.eval i '' s.pi t

theorem Set.eval_image_pi E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {s : Set ι} {t : (i : ι) → Set (α i)} {i : ι},
  i ∈ s → (s.pi t).Nonempty → Function.eval i '' s.pi t = t i

theorem Set.eval_image_pi_of_notMem E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {s : Set ι} {t : (i : ι) → Set (α i)} {i : ι} [inst : Decidable (s.pi t).Nonempty],
  i ∉ s → Function.eval i '' s.pi t = if (s.pi t).Nonempty then Set.univ else ∅

theorem Set.eval_image_univ_pi E0 #

∀ {ι : Type u_1} {α : ι → Type u_2} {t : (i : ι) → Set (α i)} {i : ι},
  (Set.univ.pi t).Nonempty → (fun f ↦ f i) '' Set.univ.pi t = t i

theorem Set.piMap_mapsTo_pi E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {β : ι → Type u_3} {I : Set ι} {f : (i : ι) → α i → β i} {s : (i : ι) → Set (α i)}
  {t : (i : ι) → Set (β i)}, (∀ i ∈ I, Set.MapsTo (f i) (s i) (t i)) → Set.MapsTo (Pi.map f) (I.pi s) (I.pi t)

theorem Set.piMap_image_pi_subset E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {β : ι → Type u_3} {s : Set ι} {f : (i : ι) → α i → β i} (t : (i : ι) → Set (α i)),
  Pi.map f '' s.pi t ⊆ s.pi fun i ↦ f i '' t i

theorem Set.piMap_image_pi E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {β : ι → Type u_3} {s : Set ι} {f : (i : ι) → α i → β i},
  (∀ i ∉ s, Function.Surjective (f i)) → ∀ (t : (i : ι) → Set (α i)), Pi.map f '' s.pi t = s.pi fun i ↦ f i '' t i

theorem Set.piMap_image_univ_pi E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {β : ι → Type u_3} (f : (i : ι) → α i → β i) (t : (i : ι) → Set (α i)),
  Pi.map f '' Set.univ.pi t = Set.univ.pi fun i ↦ f i '' t i

theorem Set.range_piMap E0 #

∀ {ι : Type u_1} {α : ι → Type u_2} {β : ι → Type u_3} (f : (i : ι) → α i → β i),
  Set.range (Pi.map f) = Set.univ.pi fun i ↦ Set.range (f i)

theorem Set.subset_pi_iff E0 #

∀ {ι : Type u_1} {α : ι → Type u_2} {s : Set ι} {t : (i : ι) → Set (α i)} {s' : Set ((i : ι) → α i)},
  s' ⊆ s.pi t ↔ ∀ i ∈ s, s' ⊆ (fun x ↦ x i) ⁻¹' t i

theorem Set.update_mem_pi_iff E0 #

∀ {ι : Type u_1} {α : ι → Type u_2} {s : Set ι} {t : (i : ι) → Set (α i)} [inst : DecidableEq ι] {a : (i : ι) → α i}
  {i : ι} {b : α i}, Function.update a i b ∈ s.pi t ↔ a ∈ (s \ {i}).pi t ∧ (i ∈ s → b ∈ t i)

theorem Set.update_mem_pi_iff_of_mem E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {s : Set ι} {t : (i : ι) → Set (α i)} [inst : DecidableEq ι] {a : (i : ι) → α i}
  {i : ι} {b : α i}, a ∈ s.pi t → (Function.update a i b ∈ s.pi t ↔ i ∈ s → b ∈ t i)

theorem Set.univ_pi_eq_singleton_iff E0 #

∀ {ι : Type u_1} {α : ι → Type u_2} {t : (i : ι) → Set (α i)} {a : (i : ι) → α i},
  Set.univ.pi t = {a} ↔ ∀ (i : ι), t i = {a i}

theorem Set.pi_subset_pi_iff E0 #

∀ {ι : Type u_1} {α : ι → Type u_2} {s : Set ι} {t₁ t₂ : (i : ι) → Set (α i)},
  s.pi t₁ ⊆ s.pi t₂ ↔ (∀ i ∈ s, t₁ i ⊆ t₂ i) ∨ s.pi t₁ = ∅

theorem Set.univ_pi_subset_univ_pi_iff E0 #

∀ {ι : Type u_1} {α : ι → Type u_2} {t₁ t₂ : (i : ι) → Set (α i)},
  Set.univ.pi t₁ ⊆ Set.univ.pi t₂ ↔ (∀ (i : ι), t₁ i ⊆ t₂ i) ∨ ∃ i, t₁ i = ∅

theorem Set.eval_preimage E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {i : ι} [inst : DecidableEq ι] {s : Set (α i)},
  Function.eval i ⁻¹' s = Set.univ.pi (Function.update (fun x ↦ Set.univ) i s)

theorem Set.eval_preimage' E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {i : ι} [inst : DecidableEq ι] {s : Set (α i)},
  Function.eval i ⁻¹' s = {i}.pi (Function.update (fun x ↦ Set.univ) i s)

theorem Set.update_preimage_pi E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {s : Set ι} {t : (i : ι) → Set (α i)} {i : ι} [inst : DecidableEq ι]
  {f : (i : ι) → α i}, i ∈ s → (∀ j ∈ s, j ≠ i → f j ∈ t j) → Function.update f i ⁻¹' s.pi t = t i

theorem Set.update_image E1 #

∀ {ι : Type u_1} {β : ι → Type u_3} [inst : DecidableEq ι] (x : (i : ι) → β i) (i : ι) (s : Set (β i)),
  Function.update x i '' s = Set.univ.pi (Function.update (fun j ↦ {x j}) i s)

theorem Set.update_preimage_univ_pi E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} {t : (i : ι) → Set (α i)} {i : ι} [inst : DecidableEq ι] {f : (i : ι) → α i},
  (∀ (j : ι), j ≠ i → f j ∈ t j) → Function.update f i ⁻¹' Set.univ.pi t = t i

theorem Set.subset_pi_eval_image E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} (s : Set ι) (u : Set ((i : ι) → α i)), u ⊆ s.pi fun i ↦ Function.eval i '' u

theorem Set.univ_pi_ite E1 #

∀ {ι : Type u_1} {α : ι → Type u_2} (s : Set ι) [inst : DecidablePred fun x ↦ x ∈ s] (t : (i : ι) → Set (α i)),
  (Set.univ.pi fun i ↦ if i ∈ s then t i else Set.univ) = s.pi t

theorem Set.uncurry_preimage_prod_pi E1 #

∀ {ι : Type u_1} {κ : Type u_4} {α : Type u_5} (s : Set ι) (t : Set κ) (u : ι × κ → Set α),
  Function.uncurry ⁻¹' (s ×ˢ t).pi u = s.pi fun i ↦ t.pi fun j ↦ u (i, j)

theorem Equiv.piCongrLeft_symm_preimage_pi E1 #

∀ {ι : Type u_1} {ι' : Type u_2} {α : ι → Type u_3} (f : ι' ≃ ι) (s : Set ι') (t : (i : ι) → Set (α i)),
  (⇑(Equiv.piCongrLeft α f).symm ⁻¹' s.pi fun i' ↦ t (f i')) = (⇑f '' s).pi t

theorem Equiv.piCongrLeft_symm_preimage_univ_pi E1 #

∀ {ι : Type u_1} {ι' : Type u_2} {α : ι → Type u_3} (f : ι' ≃ ι) (t : (i : ι) → Set (α i)),
  (⇑(Equiv.piCongrLeft α f).symm ⁻¹' Set.univ.pi fun i' ↦ t (f i')) = Set.univ.pi t

theorem Equiv.piCongrLeft_preimage_pi E1 #

∀ {ι : Type u_1} {ι' : Type u_2} {α : ι → Type u_3} (f : ι' ≃ ι) (s : Set ι') (t : (i : ι) → Set (α i)),
  ⇑(Equiv.piCongrLeft α f) ⁻¹' (⇑f '' s).pi t = s.pi fun i ↦ t (f i)

theorem Equiv.piCongrLeft_preimage_univ_pi E1 #

∀ {ι : Type u_1} {ι' : Type u_2} {α : ι → Type u_3} (f : ι' ≃ ι) (t : (i : ι) → Set (α i)),
  ⇑(Equiv.piCongrLeft α f) ⁻¹' Set.univ.pi t = Set.univ.pi fun i ↦ t (f i)

theorem Equiv.sumPiEquivProdPi_symm_preimage_univ_pi E1 #

∀ {ι : Type u_1} {ι' : Type u_2} (π : ι ⊕ ι' → Type u_4) (t : (i : ι ⊕ ι') → Set (π i)),
  ⇑(Equiv.sumPiEquivProdPi π).symm ⁻¹' Set.univ.pi t =
    (Set.univ.pi fun i ↦ t (Sum.inl i)) ×ˢ Set.univ.pi fun i ↦ t (Sum.inr i)

theorem Set.mem_graphOn E0 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {f : α → β} {x : α × β}, x ∈ Set.graphOn f s ↔ x.1 ∈ s ∧ f x.1 = x.2

theorem Set.graphOn_empty E0 #

∀ {α : Type u_1} {β : Type u_2} (f : α → β), Set.graphOn f ∅ = ∅

theorem Set.graphOn_eq_empty E0 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {f : α → β}, Set.graphOn f s = ∅ ↔ s = ∅

theorem Set.graphOn_nonempty E0 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {f : α → β}, (Set.graphOn f s).Nonempty ↔ s.Nonempty

theorem Set.Nonempty.graphOn E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {f : α → β}, s.Nonempty → (Set.graphOn f s).Nonempty

Alias of the reverse direction of Set.graphOn_nonempty.

theorem Set.graphOn_union E0 #

∀ {α : Type u_1} {β : Type u_2} (f : α → β) (s t : Set α), Set.graphOn f (s ∪ t) = Set.graphOn f s ∪ Set.graphOn f t

theorem Set.graphOn_singleton E0 #

∀ {α : Type u_1} {β : Type u_2} (f : α → β) (x : α), Set.graphOn f {x} = {(x, f x)}

theorem Set.graphOn_insert E0 #

∀ {α : Type u_1} {β : Type u_2} (f : α → β) (x : α) (s : Set α),
  Set.graphOn f (insert x s) = insert (x, f x) (Set.graphOn f s)

theorem Set.image_fst_graphOn E0 #

∀ {α : Type u_1} {β : Type u_2} (f : α → β) (s : Set α), Prod.fst '' Set.graphOn f s = s

theorem Set.image_snd_graphOn E0 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} (f : α → β), Prod.snd '' Set.graphOn f s = f '' s

theorem Set.fst_injOn_graph E1 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {f : α → β}, Set.InjOn Prod.fst (Set.graphOn f s)

theorem Set.graphOn_comp E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} (s : Set α) (f : α → β) (g : β → γ),
  Set.graphOn (g ∘ f) s = (fun x ↦ (x.1, g x.2)) '' Set.graphOn f s

theorem Set.graphOn_univ_eq_range E1 #

∀ {α : Type u_1} {β : Type u_2} {f : α → β}, Set.graphOn f Set.univ = Set.range fun x ↦ (x, f x)

theorem Set.graphOn_inj E0 #

∀ {α : Type u_1} {β : Type u_2} {s : Set α} {f g : α → β}, Set.graphOn f s = Set.graphOn g s ↔ Set.EqOn f g s

theorem Set.graphOn_prod_graphOn E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} (s : Set α) (t : Set β) (f : α → γ) (g : β → δ),
  Set.graphOn f s ×ˢ Set.graphOn g t = ⇑(Equiv.prodProdProdComm α γ β δ) ⁻¹' Set.graphOn (Prod.map f g) (s ×ˢ t)

theorem Set.graphOn_prod_prodMap E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {δ : Type u_4} (s : Set α) (t : Set β) (f : α → γ) (g : β → δ),
  Set.graphOn (Prod.map f g) (s ×ˢ t) = ⇑(Equiv.prodProdProdComm α β γ δ) ⁻¹' Set.graphOn f s ×ˢ Set.graphOn g t

theorem Set.exists_range_eq_graphOn_univ E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {f : α → β × γ},
  Function.Surjective (Prod.fst ∘ f) →
    (∀ (g₁ g₂ : α), (f g₁).1 = (f g₂).1 → (f g₁).2 = (f g₂).2) → ∃ f', Set.range f = Set.graphOn f' Set.univ

Vertical line test for functions.

Let f : α → β × γ be a function to a product. Assume that f is surjective on the first factor and that the image of f intersects every "vertical line" {(b, c) | c : γ} at most once. Then the image of f is the graph of some monoid homomorphism f' : β → γ.

theorem Set.exists_equiv_range_eq_graphOn_univ E1 #

∀ {α : Type u_1} {β : Type u_2} {γ : Type u_3} {f : α → β × γ},
  Function.Surjective (Prod.fst ∘ f) →
    Function.Surjective (Prod.snd ∘ f) →
      (∀ (g₁ g₂ : α), (f g₁).1 = (f g₂).1 ↔ (f g₁).2 = (f g₂).2) → ∃ e, Set.range f = Set.graphOn (⇑e) Set.univ

Line test for equivalences.

Let f : α → β × γ be a homomorphism to a product of monoids. Assume that f is surjective on both factors and that the image of f intersects every "vertical line" {(b, c) | c : γ} and every "horizontal line" {(b, c) | b : β} at most once. Then the image of f is the graph of some equivalence f' : β ≃ γ.

theorem Set.exists_eq_graphOn_univ E1 #

∀ {β : Type u_2} {γ : Type u_3} {s : Set (β × γ)},
  Function.Bijective (Prod.fst ∘ Subtype.val) → ∃ f, s = Set.graphOn f Set.univ

Vertical line test for functions.

Let s : Set (β × γ) be a set in a product. Assume that s maps bijectively to the first factor. Then s is the graph of some function f : β → γ.

Deprecated aliases

NameNew nameSince
Set.exists_eq_mgraphOn_univSet.exists_eq_graphOn_univ2026-09-17
Set.prod_diff_prodSet.prod_sdiff_prod2026-06-03