Sets in product and pi types #
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.offDiag
: Off-diagonal.s ×ˢ s
without the diagonal.Set.pi
: Arbitrary product of sets.
Cartesian binary product of sets #
theorem
Set.Subsingleton.prod
{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
(hs : Set.Subsingleton s)
(ht : Set.Subsingleton t)
:
Set.Subsingleton (s ×ˢ t)
noncomputable instance
Set.decidableMemProd
{α : 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
Equations
- Set.decidableMemProd x = And.decidable
theorem
Set.Nonempty.prod
{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
:
Set.Nonempty s → Set.Nonempty t → Set.Nonempty (s ×ˢ t)
theorem
Set.Nonempty.fst
{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
:
Set.Nonempty (s ×ˢ t) → Set.Nonempty s
theorem
Set.Nonempty.snd
{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
:
Set.Nonempty (s ×ˢ t) → Set.Nonempty t
@[simp]
theorem
Set.prod_nonempty_iff
{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
:
Set.Nonempty (s ×ˢ t) ↔ Set.Nonempty s ∧ Set.Nonempty t
theorem
Set.fst_image_prod
{α : Type u_1}
{β : Type u_2}
(s : Set β)
{t : Set α}
(ht : Set.Nonempty t)
:
theorem
Set.snd_image_prod
{α : Type u_1}
{β : Type u_2}
{s : Set α}
(hs : Set.Nonempty s)
(t : Set β)
:
theorem
MonotoneOn.set_prod
{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{s : Set α}
[Preorder α]
{f : α → Set β}
{g : α → Set γ}
(hf : MonotoneOn f s)
(hg : MonotoneOn g s)
:
MonotoneOn (fun x => f x ×ˢ g x) s
theorem
AntitoneOn.set_prod
{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{s : Set α}
[Preorder α]
{f : α → Set β}
{g : α → Set γ}
(hf : AntitoneOn f s)
(hg : AntitoneOn g s)
:
AntitoneOn (fun 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
fun x ↦ (x, x)
.
diagonal α
is the set of α × α
consisting of all pairs of the form (a, a)
.
Equations
- Set.diagonal α = {p | p.fst = p.snd}
Instances For
@[simp]
instance
Set.decidableMemDiagonal
{α : Type u_1}
[h : DecidableEq α]
(x : α × α)
:
Decidable (x ∈ Set.diagonal α)
Equations
- Set.decidableMemDiagonal x = h x.fst x.snd
theorem
Set.preimage_coe_coe_diagonal
{α : Type u_1}
(s : Set α)
:
(Prod.map (fun x => ↑x) fun x => ↑x) ⁻¹' Set.diagonal α = Set.diagonal ↑s
theorem
Set.diagonal_subset_iff
{α : Type u_1}
{s : Set (α × α)}
:
Set.diagonal α ⊆ s ↔ ∀ (x : α), (x, x) ∈ s
theorem
Set.diag_image
{α : Type u_1}
(s : Set α)
:
(fun x => (x, x)) '' s = Set.diagonal α ∩ s ×ˢ s
@[simp]
@[simp]
theorem
Set.Nontrivial.offDiag_nonempty
{α : Type u_1}
{s : Set α}
:
Set.Nontrivial s → Set.Nonempty (Set.offDiag s)
Alias of the reverse direction of Set.offDiag_nonempty
.
theorem
Set.Subsingleton.offDiag_eq_empty
{α : Type u_1}
{s : Set α}
:
Set.Nontrivial s → Set.Nonempty (Set.offDiag s)
Alias of the reverse direction of Set.offDiag_nonempty
.
@[simp]
@[simp]
theorem
Set.disjoint_diagonal_offDiag
{α : Type u_1}
(s : Set α)
:
Disjoint (Set.diagonal α) (Set.offDiag s)
theorem
Set.offDiag_inter
{α : Type u_1}
(s : Set α)
(t : Set α)
:
Set.offDiag (s ∩ t) = Set.offDiag s ∩ Set.offDiag t
theorem
Set.offDiag_union
{α : Type u_1}
{s : Set α}
{t : Set α}
(h : Disjoint s t)
:
Set.offDiag (s ∪ t) = Set.offDiag s ∪ Set.offDiag t ∪ s ×ˢ t ∪ t ×ˢ s
theorem
Set.offDiag_insert
{α : Type u_1}
{s : Set α}
{a : α}
(ha : ¬a ∈ s)
:
Set.offDiag (insert a s) = Set.offDiag s ∪ {a} ×ˢ s ∪ s ×ˢ {a}
Cartesian set-indexed product of sets #
theorem
Set.subsingleton_univ_pi
{ι : Type u_1}
{α : ι → Type u_2}
{t : (i : ι) → Set (α i)}
(ht : ∀ (i : ι), Set.Subsingleton (t i))
:
Set.Subsingleton (Set.pi Set.univ t)
theorem
Set.univ_pi_nonempty_iff
{ι : Type u_1}
{α : ι → Type u_2}
{t : (i : ι) → Set (α i)}
:
Set.Nonempty (Set.pi Set.univ t) ↔ ∀ (i : ι), Set.Nonempty (t i)
@[simp]
theorem
Set.singleton_pi
{ι : Type u_1}
{α : ι → Type u_2}
(i : ι)
(t : (i : ι) → Set (α i))
:
Set.pi {i} 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 : ι}
[DecidableEq ι]
(hi : ¬i ∈ s)
(f : (j : ι) → α j)
(a : α i)
(t : (j : ι) → α j → Set (β j))
:
(Set.pi s fun j => t j (Function.update f i a j)) = Set.pi s fun j => t j (f j)
theorem
Set.pi_update_of_mem
{ι : Type u_1}
{α : ι → Type u_2}
{β : ι → Type u_3}
{s : Set ι}
{i : ι}
[DecidableEq ι]
(hi : i ∈ s)
(f : (j : ι) → α j)
(a : α i)
(t : (j : ι) → α j → Set (β j))
:
theorem
Set.univ_pi_update
{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
{β : ι → Type u_4}
(i : ι)
(f : (j : ι) → α j)
(a : α i)
(t : (j : ι) → α j → Set (β j))
:
theorem
Set.univ_pi_update_univ
{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
(i : ι)
(s : Set (α i))
:
Set.pi Set.univ (Function.update (fun j => Set.univ) i s) = Function.eval i ⁻¹' s
theorem
Set.eval_image_univ_pi_subset
{ι : Type u_1}
{α : ι → Type u_2}
{t : (i : ι) → Set (α i)}
{i : ι}
:
Function.eval i '' Set.pi Set.univ t ⊆ t i
theorem
Set.subset_eval_image_pi
{ι : Type u_1}
{α : ι → Type u_2}
{s : Set ι}
{t : (i : ι) → Set (α i)}
(ht : Set.Nonempty (Set.pi s t))
(i : ι)
:
t i ⊆ Function.eval i '' Set.pi s t
theorem
Set.eval_image_pi
{ι : Type u_1}
{α : ι → Type u_2}
{s : Set ι}
{t : (i : ι) → Set (α i)}
{i : ι}
(hs : i ∈ s)
(ht : Set.Nonempty (Set.pi s t))
:
Function.eval i '' Set.pi s t = t i
@[simp]
theorem
Set.eval_image_univ_pi
{ι : Type u_1}
{α : ι → Type u_2}
{t : (i : ι) → Set (α i)}
{i : ι}
(ht : Set.Nonempty (Set.pi Set.univ t))
:
theorem
Set.eval_preimage
{ι : Type u_1}
{α : ι → Type u_2}
{i : ι}
[DecidableEq ι]
{s : Set (α i)}
:
Function.eval i ⁻¹' s = Set.pi Set.univ (Function.update (fun i => Set.univ) i s)
theorem
Set.eval_preimage'
{ι : Type u_1}
{α : ι → Type u_2}
{i : ι}
[DecidableEq ι]
{s : Set (α i)}
:
Function.eval i ⁻¹' s = Set.pi {i} (Function.update (fun i => Set.univ) i s)
theorem
Set.update_preimage_pi
{ι : Type u_1}
{α : ι → Type u_2}
{s : Set ι}
{t : (i : ι) → Set (α i)}
{i : ι}
[DecidableEq ι]
{f : (i : ι) → α i}
(hi : i ∈ s)
(hf : ∀ (j : ι), j ∈ s → j ≠ i → f j ∈ t j)
:
Function.update f i ⁻¹' Set.pi s t = t i
theorem
Set.update_preimage_univ_pi
{ι : Type u_1}
{α : ι → Type u_2}
{t : (i : ι) → Set (α i)}
{i : ι}
[DecidableEq ι]
{f : (i : ι) → α i}
(hf : ∀ (j : ι), j ≠ i → f j ∈ t j)
:
Function.update f i ⁻¹' Set.pi Set.univ t = t i
theorem
Set.subset_pi_eval_image
{ι : Type u_1}
{α : ι → Type u_2}
(s : Set ι)
(u : Set ((i : ι) → α i))
:
u ⊆ Set.pi s fun i => Function.eval i '' u