Boolean algebra of sets #
This file proves that Set α is a Boolean algebra, and proves results about set difference and
complement.
Notation #
sᶜfor the complement ofs
Tags #
set, sets, subset, subsets, complement
@[implicit_reducible]
See also Set.sdiff_inter_right_comm.
See also Set.inter_diff_assoc.
theorem
Set.diff_union_diff_cancel'
{α : Type u_1}
{s t u : Set α}
(hi : s ∩ u ⊆ t)
(hu : t ⊆ s ∪ u)
:
A version of diff_union_diff_cancel with more general hypotheses.
Lemmas about complement #
@[simp]
theorem
Set.subset_union_compl_iff_inter_subset
{α : Type u_1}
{s t u : Set α}
:
s ⊆ t ∪ uᶜ ↔ s ∩ u ⊆ t
Alias of the reverse direction of Set.subset_compl_iff_disjoint_right.
Alias of the reverse direction of Set.subset_compl_iff_disjoint_left.
Alias of the reverse direction of Set.disjoint_compl_left_iff_subset.
Alias of the reverse direction of Set.disjoint_compl_right_iff_subset.
@[simp]
@[simp]
@[simp]
Lemmas about set difference #
theorem
Set.union_diff_cancel'
{α : Type u_1}
{s t u : Set α}
(h₁ : s ⊆ t)
(h₂ : t ⊆ u)
:
t ∪ u \ s = u
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
Set.disjoint_of_subset_iff_left_eq_empty
{α : Type u_1}
{s t : Set α}
(h : s ⊆ t)
:
Disjoint s t ↔ s = ∅
@[simp]
theorem
HasSubset.Subset.diff_ssubset_of_nonempty
{α : Type u_1}
{s t : Set α}
(hst : s ⊆ t)
(hs : s.Nonempty)
:
t \ s ⊂ t
theorem
Set.diff_singleton_subset_iff
{α : Type u_1}
{s t : Set α}
{a : α}
:
s \ {a} ⊆ t ↔ s ⊆ insert a t
theorem
Set.subset_diff_singleton
{α : Type u_1}
{s t : Set α}
{a : α}
(h : s ⊆ t)
(ha : a ∉ s)
:
s ⊆ t \ {a}
@[simp]
theorem
Set.insert_diff_self_of_notMem
{α : Type u_1}
{s : Set α}
{a : α}
(h : a ∉ s)
:
insert a s \ {a} = s
@[simp]
theorem
Set.insert_diff_self_of_mem
{α : Type u_1}
{s : Set α}
{a : α}
(ha : a ∈ s)
:
insert a (s \ {a}) = s
@[simp]
@[simp]
theorem
Set.insert_diff_singleton
{α : Type u_1}
{s : Set α}
{a : α}
:
insert a (s \ {a}) = insert a s
@[simp]
theorem
Set.subset_insert_iff
{α : Type u_1}
{s t : Set α}
{a : α}
:
s ⊆ insert a t ↔ s ⊆ t ∨ a ∈ s ∧ s \ {a} ⊆ t
If-then-else for sets #
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
Set.ite_inter_of_inter_eq
{α : Type u_1}
(t : Set α)
{s₁ s₂ s : Set α}
(h : s₁ ∩ s = s₂ ∩ s)
:
t.ite s₁ s₂ ∩ s = s₁ ∩ s
theorem
Set.ite_eq_of_subset_right
{α : Type u_1}
(t : Set α)
{s₁ s₂ : Set α}
(h : s₂ ⊆ s₁)
:
t.ite s₁ s₂ = s₁ ∩ t ∪ s₂