Documentation

Mathlib.Data.Finset.BooleanAlgebra

Finsets are a boolean algebra #

This file provides the BooleanAlgebra (Finset α) instance, under the assumption that α is a Fintype.

Main results #

theorem Finset.Nonempty.eq_univ {α : Type u_1} {s : Finset α} [Fintype α] [Subsingleton α] :
s.Nonemptys = univ
@[simp]
theorem Finset.univ_nonempty {α : Type u_1} [Fintype α] [Nonempty α] :
@[simp]
theorem Finset.univ_eq_empty {α : Type u_1} [Fintype α] [IsEmpty α] :
@[simp]
theorem Finset.univ_unique {α : Type u_1} [Fintype α] [Unique α] :
@[simp]
theorem Finset.top_eq_univ {α : Type u_1} [Fintype α] :
theorem Finset.ssubset_univ_iff {α : Type u_1} [Fintype α] {s : Finset α} :
@[simp]
theorem Finset.univ_subset_iff {α : Type u_1} [Fintype α] {s : Finset α} :
theorem Finset.codisjoint_left {α : Type u_1} {s t : Finset α} [Fintype α] :
Codisjoint s t ∀ ⦃a : α⦄, asa t
theorem Finset.codisjoint_right {α : Type u_1} {s t : Finset α} [Fintype α] :
Codisjoint s t ∀ ⦃a : α⦄, ata s
theorem Finset.sdiff_eq_inter_compl {α : Type u_1} [Fintype α] [DecidableEq α] (s t : Finset α) :
s \ t = s t
theorem Finset.compl_eq_univ_sdiff {α : Type u_1} [Fintype α] [DecidableEq α] (s : Finset α) :
s = univ \ s
@[simp]
theorem Finset.mem_compl {α : Type u_1} {s : Finset α} [Fintype α] [DecidableEq α] {a : α} :
a s as
theorem Finset.not_mem_compl {α : Type u_1} {s : Finset α} [Fintype α] [DecidableEq α] {a : α} :
as a s
@[simp]
theorem Finset.coe_compl {α : Type u_1} [Fintype α] [DecidableEq α] (s : Finset α) :
s = (↑s)
@[simp]
theorem Finset.compl_subset_compl {α : Type u_1} {s t : Finset α} [Fintype α] [DecidableEq α] :
s t t s
@[simp]
theorem Finset.compl_ssubset_compl {α : Type u_1} {s t : Finset α} [Fintype α] [DecidableEq α] :
s t t s
theorem Finset.subset_compl_comm {α : Type u_1} {s t : Finset α} [Fintype α] [DecidableEq α] :
s t t s
@[simp]
theorem Finset.subset_compl_singleton {α : Type u_1} {s : Finset α} [Fintype α] [DecidableEq α] {a : α} :
s {a} as
@[simp]
theorem Finset.compl_empty {α : Type u_1} [Fintype α] [DecidableEq α] :
@[simp]
theorem Finset.compl_univ {α : Type u_1} [Fintype α] [DecidableEq α] :
@[simp]
theorem Finset.compl_eq_empty_iff {α : Type u_1} [Fintype α] [DecidableEq α] (s : Finset α) :
@[simp]
theorem Finset.compl_eq_univ_iff {α : Type u_1} [Fintype α] [DecidableEq α] (s : Finset α) :
@[simp]
theorem Finset.union_compl {α : Type u_1} [Fintype α] [DecidableEq α] (s : Finset α) :
@[simp]
theorem Finset.inter_compl {α : Type u_1} [Fintype α] [DecidableEq α] (s : Finset α) :
@[simp]
theorem Finset.compl_union {α : Type u_1} [Fintype α] [DecidableEq α] (s t : Finset α) :
(s t) = s t
@[simp]
theorem Finset.compl_inter {α : Type u_1} [Fintype α] [DecidableEq α] (s t : Finset α) :
(s t) = s t
@[simp]
theorem Finset.compl_erase {α : Type u_1} {s : Finset α} [Fintype α] [DecidableEq α] {a : α} :
(s.erase a) = insert a s
@[simp]
theorem Finset.compl_insert {α : Type u_1} {s : Finset α} [Fintype α] [DecidableEq α] {a : α} :
(insert a s) = s.erase a
theorem Finset.insert_compl_insert {α : Type u_1} {s : Finset α} [Fintype α] [DecidableEq α] {a : α} (ha : as) :
@[simp]
theorem Finset.insert_compl_self {α : Type u_1} [Fintype α] [DecidableEq α] (x : α) :
@[simp]
theorem Finset.compl_filter {α : Type u_1} [Fintype α] [DecidableEq α] (p : αProp) [DecidablePred p] [(x : α) → Decidable ¬p x] :
(filter p univ) = filter (fun (x : α) => ¬p x) univ
theorem Finset.compl_singleton {α : Type u_1} [Fintype α] [DecidableEq α] (a : α) :
theorem Finset.insert_inj_on' {α : Type u_1} [Fintype α] [DecidableEq α] (s : Finset α) :
Set.InjOn (fun (a : α) => insert a s) s
theorem Finset.image_univ_of_surjective {α : Type u_1} {β : Type u_2} [Fintype α] [DecidableEq α] [Fintype β] {f : βα} (hf : Function.Surjective f) :
@[simp]
theorem Finset.image_univ_equiv {α : Type u_1} {β : Type u_2} [Fintype α] [DecidableEq α] [Fintype β] (f : β α) :
image (⇑f) univ = univ
@[simp]
theorem Finset.univ_inter {α : Type u_1} [Fintype α] [DecidableEq α] (s : Finset α) :
univ s = s
@[simp]
theorem Finset.inter_univ {α : Type u_1} [Fintype α] [DecidableEq α] (s : Finset α) :
s univ = s
@[simp]
theorem Finset.inter_eq_univ {α : Type u_1} {s t : Finset α} [Fintype α] [DecidableEq α] :
s t = univ s = univ t = univ
theorem Finset.singleton_eq_univ {α : Type u_1} [Fintype α] [Subsingleton α] (a : α) :
theorem Finset.map_univ_of_surjective {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] {f : β α} (hf : Function.Surjective f) :
@[simp]
theorem Finset.map_univ_equiv {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] (f : β α) :
theorem Finset.univ_map_equiv_to_embedding {α : Type u_4} {β : Type u_5} [Fintype α] [Fintype β] (e : α β) :
@[simp]
theorem Finset.univ_filter_exists {α : Type u_1} {β : Type u_2} [Fintype α] (f : αβ) [Fintype β] [DecidablePred fun (y : β) => ∃ (x : α), f x = y] [DecidableEq β] :
filter (fun (y : β) => ∃ (x : α), f x = y) univ = image f univ
theorem Finset.univ_filter_mem_range {α : Type u_1} {β : Type u_2} [Fintype α] (f : αβ) [Fintype β] [DecidablePred fun (y : β) => y Set.range f] [DecidableEq β] :
filter (fun (y : β) => y Set.range f) univ = image f univ

Note this is a special case of (Finset.image_preimage f univ _).symm.

theorem Finset.coe_filter_univ {α : Type u_1} [Fintype α] (p : αProp) [DecidablePred p] :
(filter p univ) = {x : α | p x}
@[simp]
theorem Finset.subtype_eq_univ {α : Type u_1} {s : Finset α} {p : αProp} [DecidablePred p] [Fintype { a : α // p a }] :
Finset.subtype p s = univ ∀ ⦃a : α⦄, p aa s
@[simp]
theorem Finset.subtype_univ {α : Type u_1} [Fintype α] (p : αProp) [DecidablePred p] [Fintype { a : α // p a }] :
theorem Finset.univ_val_map_subtype_restrict {α : Type u_1} {β : Type u_2} [Fintype α] (f : αβ) (p : αProp) [DecidablePred p] [Fintype { a : α // p a }] :
@[simp]
theorem Finset.filter_univ_mem {α : Type u_1} [Fintype α] [DecidableEq α] (s : Finset α) :
filter (fun (x : α) => x s) univ = s
instance Finset.decidableCodisjoint {α : Type u_1} {s t : Finset α} [Fintype α] [DecidableEq α] :
Equations