Lattice structure on finite sets #
This file puts a lattice structure on finite sets using the union and intersection operators.
For Finset α
, where α
is a lattice, see also Mathlib/Data/Finset/Lattice/Fold.lean
.
Main declarations #
There is a natural lattice structure on the subsets of a set.
In Lean, we use lattice notation to talk about things involving unions and intersections. See
Mathlib/Order/Lattice.lean
. For the lattice structure on finsets, ⊥
is called bot
with
⊥ = ∅
and ⊤
is called top
with ⊤ = univ
.
Finset.instHasSubsetFinset
: Lots of API about lattices, otherwise behaves as one would expect.Finset.instUnionFinset
: Definess ∪ t
(ors ⊔ t
) as the union ofs
andt
. SeeFinset.sup
/Finset.biUnion
for finite unions.Finset.instInterFinset
: Definess ∩ t
(ors ⊓ t
) as the intersection ofs
andt
. SeeFinset.inf
for finite intersections.
Operations on two or more finsets #
Finset.instUnionFinset
: see "The lattice structure on subsets of finsets"Finset.instInterFinset
: see "The lattice structure on subsets of finsets"
Tags #
finite sets, finset
Lattice structure #
s ∪ t
is the set such that a ∈ s ∪ t
iff a ∈ s
or a ∈ t
.
Equations
- Finset.instUnion = { union := fun (s t : Finset α) => { val := s.val.ndunion t.val, nodup := ⋯ } }
s ∩ t
is the set such that a ∈ s ∩ t
iff a ∈ s
and a ∈ t
.
Equations
- Finset.instInter = { inter := fun (s t : Finset α) => { val := s.val.ndinter t.val, nodup := ⋯ } }
Equations
- Finset.instLattice = Lattice.mk (fun (x1 x2 : Finset α) => x1 ∩ x2) ⋯ ⋯ ⋯
union #
@[simp]
theorem
Finset.mem_union_left
{α : Type u_1}
[DecidableEq α]
{s : Finset α}
{a : α}
(t : Finset α)
(h : a ∈ s)
:
theorem
Finset.mem_union_right
{α : Type u_1}
[DecidableEq α]
{t : Finset α}
{a : α}
(s : Finset α)
(h : a ∈ t)
:
@[simp]
@[simp]
@[simp]
theorem
Finset.union_subset_union
{α : Type u_1}
[DecidableEq α]
{s t u v : Finset α}
(hsu : s ⊆ u)
(htv : t ⊆ v)
:
theorem
Finset.union_subset_union_left
{α : Type u_1}
[DecidableEq α]
{s₁ s₂ t : Finset α}
(h : s₁ ⊆ s₂)
:
theorem
Finset.union_subset_union_right
{α : Type u_1}
[DecidableEq α]
{s t₁ t₂ : Finset α}
(h : t₁ ⊆ t₂)
:
instance
Finset.instCommutativeUnion
{α : Type u_1}
[DecidableEq α]
:
Std.Commutative fun (x1 x2 : Finset α) => x1 ∪ x2
@[simp]
instance
Finset.instAssociativeUnion
{α : Type u_1}
[DecidableEq α]
:
Std.Associative fun (x1 x2 : Finset α) => x1 ∪ x2
@[simp]
instance
Finset.instIdempotentOpUnion
{α : Type u_1}
[DecidableEq α]
:
Std.IdempotentOp fun (x1 x2 : Finset α) => x1 ∪ x2
theorem
Finset.union_subset_left
{α : Type u_1}
[DecidableEq α]
{s t u : Finset α}
(h : s ∪ t ⊆ u)
:
s ⊆ u
theorem
Finset.union_subset_right
{α : Type u_1}
[DecidableEq α]
{s t u : Finset α}
(h : s ∪ t ⊆ u)
:
t ⊆ u
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
Finset.mem_of_mem_inter_left
{α : Type u_1}
[DecidableEq α]
{a : α}
{s₁ s₂ : Finset α}
(h : a ∈ s₁ ∩ s₂)
:
a ∈ s₁
theorem
Finset.mem_of_mem_inter_right
{α : Type u_1}
[DecidableEq α]
{a : α}
{s₁ s₂ : Finset α}
(h : a ∈ s₁ ∩ s₂)
:
a ∈ s₂
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem
Finset.inter_subset_inter
{α : Type u_1}
[DecidableEq α]
{x y s t : Finset α}
(h : x ⊆ y)
(h' : s ⊆ t)
:
theorem
Finset.inter_subset_inter_left
{α : Type u_1}
[DecidableEq α]
{s t u : Finset α}
(h : t ⊆ u)
:
theorem
Finset.inter_subset_inter_right
{α : Type u_1}
[DecidableEq α]
{s t u : Finset α}
(h : s ⊆ t)
:
Equations
@[simp]
@[simp]
@[simp]
@[simp]
theorem
Finset.ite_subset_union
{α : Type u_1}
[DecidableEq α]
(s s' : Finset α)
(P : Prop)
[Decidable P]
:
theorem
Finset.inter_subset_ite
{α : Type u_1}
[DecidableEq α]
(s s' : Finset α)
(P : Prop)
[Decidable P]
: