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. Fors : set α
,t : set β
, we haves.prod t : set (α × β)
.set.diagonal
: Diagonal of a type.set.diagonal α = {(x, x) | x : α}
.set.off_diag
: Off-diagonal.s ×ˢ s
without 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)
.
@[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
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_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)