Sets in product and pi types #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
This file defines the product of sets in α × β and in Π i, α i along with the diagonal of a
type.
Main declarations #
- set.prod: Binary product of sets. For- s : set α,- t : set β, we have- s.prod t : set (α × β).
- set.diagonal: Diagonal of a type.- set.diagonal α = {(x, x) | x : α}.
- set.off_diag: Off-diagonal.- s ×ˢ swithout the diagonal.
- set.pi: Arbitrary product of sets.
Cartesian binary product of sets #
@[protected, instance]
    
def
set.decidable_mem_prod
    {α : Type u_1}
    {β : Type u_2}
    {s : set α}
    {t : set β}
    [hs : decidable_pred (λ (_x : α), _x ∈ s)]
    [ht : decidable_pred (λ (_x : β), _x ∈ t)] :
    decidable_pred (λ (_x : α × β), _x ∈ s ×ˢ t)
Equations
- set.decidable_mem_prod = λ (_x : α × β), and.decidable
    
theorem
monotone_on.set_prod
    {α : Type u_1}
    {β : Type u_2}
    {γ : Type u_3}
    {s : set α}
    [preorder α]
    {f : α → set β}
    {g : α → set γ}
    (hf : monotone_on f s)
    (hg : monotone_on g s) :
monotone_on (λ (x : α), f x ×ˢ g x) s
    
theorem
antitone_on.set_prod
    {α : Type u_1}
    {β : Type u_2}
    {γ : Type u_3}
    {s : set α}
    [preorder α]
    {f : α → set β}
    {g : α → set γ}
    (hf : antitone_on f s)
    (hg : antitone_on g s) :
antitone_on (λ (x : α), f x ×ˢ g x) s
Diagonal #
In this section we prove some lemmas about the diagonal set {p | p.1 = p.2} and the diagonal map
λ x, (x, x).
diagonal α is the set of α × α consisting of all pairs of the form (a, a).
@[simp]
@[protected, instance]
    
def
set.decidable_mem_diagonal
    {α : Type u_1}
    [h : decidable_eq α]
    (x : α × α) :
    decidable (x ∈ set.diagonal α)
Equations
- set.decidable_mem_diagonal x = h x.fst x.snd
@[simp]
    
theorem
set.diagonal_subset_iff
    {α : Type u_1}
    {s : set (α × α)} :
set.diagonal α ⊆ s ↔ ∀ (x : α), (x, x) ∈ s
@[simp]
    
theorem
set.diag_image
    {α : Type u_1}
    (s : set α) :
(λ (x : α), (x, x)) '' s = set.diagonal α ∩ s ×ˢ s
@[simp]
@[simp]
    
theorem
set.nontrivial.off_diag_nonempty
    {α : Type u_1}
    {s : set α} :
s.nontrivial → s.off_diag.nonempty
Alias of the reverse direction of set.off_diag_nonempty.
    
theorem
set.subsingleton.off_diag_eq_empty
    {α : Type u_1}
    {s : set α} :
s.nontrivial → s.off_diag.nonempty
Alias of the reverse direction of set.off_diag_nonempty.
@[simp]
@[simp]
    
theorem
set.disjoint_diagonal_off_diag
    {α : Type u_1}
    (s : set α) :
disjoint (set.diagonal α) s.off_diag
Cartesian set-indexed product of sets #
@[simp]
    
theorem
set.insert_pi
    {ι : Type u_1}
    {α : ι → Type u_2}
    (i : ι)
    (s : set ι)
    (t : Π (i : ι), set (α i)) :
(has_insert.insert i s).pi t = function.eval i ⁻¹' t i ∩ s.pi t
@[simp]
    
theorem
set.singleton_pi
    {ι : Type u_1}
    {α : ι → Type u_2}
    (i : ι)
    (t : Π (i : ι), set (α i)) :
{i}.pi t = function.eval i ⁻¹' t i
    
theorem
set.pi_update_of_not_mem
    {ι : Type u_1}
    {α : ι → Type u_2}
    {β : ι → Type u_3}
    {s : set ι}
    {i : ι}
    [decidable_eq ι]
    (hi : i ∉ s)
    (f : Π (j : ι), α j)
    (a : α i)
    (t : Π (j : ι), α j → set (β j)) :
s.pi (λ (j : ι), t j (function.update f i a j)) = s.pi (λ (j : ι), t j (f j))
    
theorem
set.pi_update_of_mem
    {ι : Type u_1}
    {α : ι → Type u_2}
    {β : ι → Type u_3}
    {s : set ι}
    {i : ι}
    [decidable_eq ι]
    (hi : i ∈ s)
    (f : Π (j : ι), α j)
    (a : α i)
    (t : Π (j : ι), α j → set (β j)) :
    
theorem
set.univ_pi_update
    {ι : Type u_1}
    {α : ι → Type u_2}
    [decidable_eq ι]
    {β : ι → Type u_3}
    (i : ι)
    (f : Π (j : ι), α j)
    (a : α i)
    (t : Π (j : ι), α j → set (β j)) :
    
theorem
set.univ_pi_update_univ
    {ι : Type u_1}
    {α : ι → Type u_2}
    [decidable_eq ι]
    (i : ι)
    (s : set (α i)) :
set.univ.pi (function.update (λ (j : ι), set.univ) i s) = function.eval i ⁻¹' s
    
theorem
set.eval_image_pi_subset
    {ι : Type u_1}
    {α : ι → Type u_2}
    {s : set ι}
    {t : Π (i : ι), set (α i)}
    {i : ι}
    (hs : i ∈ s) :
function.eval i '' s.pi t ⊆ t i
    
theorem
set.eval_image_univ_pi_subset
    {ι : 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
    {ι : Type u_1}
    {α : ι → Type u_2}
    {s : set ι}
    {t : Π (i : ι), set (α i)}
    (ht : (s.pi t).nonempty)
    (i : ι) :
t i ⊆ function.eval i '' s.pi t
    
theorem
set.eval_preimage
    {ι : Type u_1}
    {α : ι → Type u_2}
    {i : ι}
    [decidable_eq ι]
    {s : set (α i)} :
function.eval i ⁻¹' s = set.univ.pi (function.update (λ (i : ι), set.univ) i s)
    
theorem
set.eval_preimage'
    {ι : Type u_1}
    {α : ι → Type u_2}
    {i : ι}
    [decidable_eq ι]
    {s : set (α i)} :
function.eval i ⁻¹' s = {i}.pi (function.update (λ (i : ι), set.univ) i s)
    
theorem
set.update_preimage_pi
    {ι : Type u_1}
    {α : ι → Type u_2}
    {s : set ι}
    {t : Π (i : ι), set (α i)}
    {i : ι}
    [decidable_eq ι]
    {f : Π (i : ι), α i}
    (hi : i ∈ s)
    (hf : ∀ (j : ι), j ∈ s → j ≠ i → f j ∈ t j) :
function.update f i ⁻¹' s.pi t = t i
    
theorem
set.update_preimage_univ_pi
    {ι : Type u_1}
    {α : ι → Type u_2}
    {t : Π (i : ι), set (α i)}
    {i : ι}
    [decidable_eq ι]
    {f : Π (i : ι), α i}
    (hf : ∀ (j : ι), j ≠ i → f j ∈ t j) :
function.update f i ⁻¹' set.univ.pi t = t i
    
theorem
set.subset_pi_eval_image
    {ι : Type u_1}
    {α : ι → Type u_2}
    (s : set ι)
    (u : set (Π (i : ι), α i)) :
u ⊆ s.pi (λ (i : ι), function.eval i '' u)