Lemmas about insertion, singleton, and pairs #
This file provides extra lemmas about insert, singleton, and pair.
Tags #
insert, singleton
Set coercion to a type #
Lemmas about insert #
insert a s is the set {a} ∪ s.
@[simp]
theorem
Set.eq_or_mem_of_mem_insert
{α : Type u_1}
{x a : α}
{s : Set α}
:
x ∈ insert a s → x = a ∨ x ∈ s
theorem
Set.mem_of_mem_insert_of_ne
{α : Type u_1}
{s : Set α}
{a b : α}
:
b ∈ insert a s → b ≠ a → b ∈ s
theorem
Set.eq_of_mem_insert_of_notMem
{α : Type u_1}
{s : Set α}
{a b : α}
:
b ∈ insert a s → b ∉ s → b = a
@[simp]
@[simp]
theorem
Set.ne_insert_of_notMem
{α : Type u_1}
{s : Set α}
(t : Set α)
{a : α}
:
a ∉ s → s ≠ insert a t
@[simp]
theorem
Set.insert_subset
{α : Type u_1}
{s t : Set α}
{a : α}
(ha : a ∈ t)
(hs : s ⊆ t)
:
insert a s ⊆ t
theorem
Set.insert_subset_insert
{α : Type u_1}
{s t : Set α}
{a : α}
(h : s ⊆ t)
:
insert a s ⊆ insert a t
@[simp]
theorem
Set.insert_subset_insert_iff
{α : Type u_1}
{s t : Set α}
{a : α}
(ha : a ∉ s)
:
insert a s ⊆ insert a t ↔ s ⊆ t
theorem
Set.subset_insert_iff_of_notMem
{α : Type u_1}
{s t : Set α}
{a : α}
(ha : a ∉ s)
:
s ⊆ insert a t ↔ s ⊆ t
theorem
HasSubset.Subset.ssubset_of_mem_notMem
{α : Type u_1}
{s t : Set α}
{a : α}
(hst : s ⊆ t)
(hat : a ∈ t)
(has : a ∉ s)
:
s ⊂ t
theorem
Set.insert_comm
{α : Type u_1}
(a b : α)
(s : Set α)
:
insert a (insert b s) = insert b (insert a s)
@[simp]
@[simp]
theorem
Set.insert_inter_distrib
{α : Type u_1}
(a : α)
(s t : Set α)
:
insert a (s ∩ t) = insert a s ∩ insert a t
theorem
Set.insert_union_distrib
{α : Type u_1}
(a : α)
(s t : Set α)
:
insert a (s ∪ t) = insert a s ∪ insert a t
theorem
Set.forall_of_forall_insert
{α : Type u_1}
{P : α → Prop}
{a : α}
{s : Set α}
(H : ∀ x ∈ insert a s, P x)
(x : α)
(h : x ∈ s)
:
P x
theorem
Set.forall_insert_of_forall
{α : Type u_1}
{P : α → Prop}
{a : α}
{s : Set α}
(H : ∀ x ∈ s, P x)
(ha : P a)
(x : α)
(h : x ∈ insert a s)
:
P x
theorem
Set.exists_mem_insert
{α : Type u_1}
{P : α → Prop}
{a : α}
{s : Set α}
:
(∃ x ∈ insert a s, P x) ↔ P a ∨ ∃ x ∈ s, P x
theorem
Set.forall_mem_insert
{α : Type u_1}
{P : α → Prop}
{a : α}
{s : Set α}
:
(∀ x ∈ insert a s, P x) ↔ P a ∧ ∀ x ∈ s, P x
Inserting an element to a set is equivalent to the option type.
Instances For
Lemmas about singletons #
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
Alias of the reverse direction of Set.singleton_inter_eq_empty.
@[simp]
Alias of the reverse direction of Set.inter_singleton_eq_empty.
@[simp]
@[simp]
@[implicit_reducible]
theorem
Set.eq_singleton_iff_unique_mem
{α : Type u_1}
{s : Set α}
{a : α}
:
s = {a} ↔ a ∈ s ∧ ∀ x ∈ s, x = a
theorem
Set.eq_singleton_iff_nonempty_unique_mem
{α : Type u_1}
{s : Set α}
{a : α}
:
s = {a} ↔ s.Nonempty ∧ ∀ x ∈ s, x = a
@[simp]
@[simp]
theorem
Set.Nonempty.subset_singleton_iff
{α : Type u_1}
{s : Set α}
{a : α}
(h : s.Nonempty)
:
s ⊆ {a} ↔ s = {a}
theorem
Set.eq_of_nonempty_of_subsingleton
{α : Type u_3}
[Subsingleton α]
(s t : Set α)
[Nonempty ↑s]
[Nonempty ↑t]
:
s = t
theorem
Set.Nonempty.eq_zero
{α : Type u_1}
[Subsingleton α]
[Zero α]
{s : Set α}
(h : s.Nonempty)
:
s = {0}
theorem
Set.Nonempty.eq_one
{α : Type u_1}
[Subsingleton α]
[One α]
{s : Set α}
(h : s.Nonempty)
:
s = {1}
Disjointness #
@[simp]
@[simp]
@[simp]
@[simp]
theorem
Set.insert_inj
{α : Type u_1}
{s : Set α}
{a b : α}
(ha : a ∉ s)
:
insert a s = insert b s ↔ a = b
@[simp]
theorem
Set.insert_diff_eq_singleton
{α : Type u_1}
{a : α}
{s : Set α}
(h : a ∉ s)
:
insert a s \ s = {a}
theorem
Set.inter_insert_of_mem
{α : Type u_1}
{s t : Set α}
{a : α}
(h : a ∈ s)
:
s ∩ insert a t = insert a (s ∩ t)
theorem
Set.insert_inter_of_mem
{α : Type u_1}
{s t : Set α}
{a : α}
(h : a ∈ t)
:
insert a s ∩ t = insert a (s ∩ t)
theorem
Set.inter_insert_of_notMem
{α : Type u_1}
{s t : Set α}
{a : α}
(h : a ∉ s)
:
s ∩ insert a t = s ∩ t
theorem
Set.insert_inter_of_notMem
{α : Type u_1}
{s t : Set α}
{a : α}
(h : a ∉ t)
:
insert a s ∩ t = s ∩ t
Lemmas about pairs #
theorem
Set.pair_eq_pair_iff
{α : Type u_1}
{x y z w : α}
:
{x, y} = {z, w} ↔ x = z ∧ y = w ∨ x = w ∧ y = z
theorem
Set.subset_pair_iff
{α : Type u_1}
{s : Set α}
{a b : α}
:
s ⊆ {a, b} ↔ ∀ x ∈ s, x = a ∨ x = b
theorem
Set.subset_pair_iff_eq
{α : Type u_1}
{s : Set α}
{x y : α}
:
s ⊆ {x, y} ↔ s = ∅ ∨ s = {x} ∨ s = {y} ∨ s = {x, y}
theorem
Set.Nonempty.subset_pair_iff_eq
{α : Type u_1}
{s : Set α}
{a b : α}
(hs : s.Nonempty)
:
s ⊆ {a, b} ↔ s = {a} ∨ s = {b} ∨ s = {a, b}
theorem
Set.range_ite_const
{α : Type u_1}
{β : Type u_2}
{p : α → Prop}
[DecidablePred p]
{x y : β}
(hp : ∃ (a : α), p a)
(hn : ∃ (a : α), ¬p a)
:
(range fun (a : α) => if p a then x else y) = {x, y}
Powerset #
The powerset of a singleton contains only ∅ and the singleton itself.
Lemmas about inclusion, the injection of subtypes induced by ⊆ #
Decidability instances for sets #
@[implicit_reducible]