The areas / V03. Sets, finite structures and big operators
Mathlib.Data.Set.Finite.Lattice
64 declarations and 2 deprecated aliases. Mathlib docs · Source
Finiteness of unions and intersections
Implementation notes
Each result in this file should come in three forms: a Fintype instance, a Finite instance
and a Set.Finite constructor.
Tags
finite sets
Fintype instances
Every instance here should have a corresponding Set.Finite constructor in the next section.
Finite instances
There is seemingly some overlap between the following instances and the Fintype instances
in Data.Set.Finite. While every Fintype instance gives a Finite instance, those
instances that depend on Fintype or Decidable instances need an additional Finite instance
to be able to generally apply.
Some set instances do not appear here since they are consequences of others, for example
Subtype.Finite for subsets of a finite type.
Constructors for Set.Finite
Every constructor here should have a corresponding Fintype instance in the previous section
(or in the Fintype module).
The implementation of these constructors ideally should be no more than Set.toFinite,
after possibly setting up some Fintype and classical Decidable instances.
Properties
Infinite sets
Order properties
instance Set.fintypeiUnion E0 #
{α : Type u} →
{ι : Sort w} →
[DecidableEq α] → [Fintype (PLift ι)] → (f : ι → Set α) → [(i : ι) → Fintype ↑(f i)] → Fintype ↑(⋃ i, f i)
instance Set.fintypesUnion E0 #
{α : Type u} → [DecidableEq α] → {s : Set (Set α)} → [Fintype ↑s] → [H : (t : ↑s) → Fintype ↑↑t] → Fintype ↑(⋃₀ s)
theorem Set.toFinset_iUnion E1 #
∀ {α : Type u} {β : Type v} [inst : Fintype β] [inst_1 : DecidableEq α] (f : β → Set α)
[inst_2 : (w : β) → Fintype ↑(f w)], (⋃ x, f x).toFinset = Finset.univ.biUnion fun x ↦ (f x).toFinset
def Set.fintypeBiUnion E1 #
{α : Type u} →
[DecidableEq α] →
{ι : Type u_1} →
(s : Set ι) → [Fintype ↑s] → (t : ι → Set α) → ((i : ι) → i ∈ s → Fintype ↑(t i)) → Fintype ↑(⋃ x ∈ s, t x)
A union of sets with Fintype structure over a set with Fintype structure has a Fintype
structure.
instance Set.fintypeBiUnion' E0 #
{α : Type u} →
[DecidableEq α] →
{ι : Type u_1} → (s : Set ι) → [Fintype ↑s] → (t : ι → Set α) → [(i : ι) → Fintype ↑(t i)] → Fintype ↑(⋃ x ∈ s, t x)
instance Finite.Set.finite_iUnion E0 #
∀ {α : Type u} {ι : Sort w} [Finite ι] (f : ι → Set α) [∀ (i : ι), Finite ↑(f i)], Finite ↑(⋃ i, f i)
instance Finite.Set.finite_sUnion E0 #
∀ {α : Type u} {s : Set (Set α)} [Finite ↑s] [H : ∀ (t : ↑s), Finite ↑↑t], Finite ↑(⋃₀ s)
theorem Finite.Set.finite_biUnion E1 #
∀ {α : Type u} {ι : Type u_1} (s : Set ι) [Finite ↑s] (t : ι → Set α), (∀ i ∈ s, Finite ↑(t i)) → Finite ↑(⋃ x ∈ s, t x)
instance Finite.Set.finite_biUnion' E0 #
∀ {α : Type u} {ι : Type u_1} (s : Set ι) [Finite ↑s] (t : ι → Set α) [∀ (i : ι), Finite ↑(t i)], Finite ↑(⋃ x ∈ s, t x)
instance Finite.Set.finite_biUnion'' E0 #
∀ {α : Type u} {ι : Type u_1} (p : ι → Prop) [h : Finite ↑{x | p x}] (t : ι → Set α) [∀ (i : ι), Finite ↑(t i)],
Finite ↑(⋃ x, ⋃ (_ : p x), t x)
Example: Finite (⋃ (i < n), f i) where f : ℕ → Set α and [∀ i, Finite (f i)]
(when given instances from Order.Interval.Finset.Nat).
instance Finite.Set.finite_iInter E0 #
∀ {α : Type u} {ι : Sort u_1} [Nonempty ι] (t : ι → Set α) [∀ (i : ι), Finite ↑(t i)], Finite ↑(⋂ i, t i)
theorem Set.finite_iUnion E1 #
∀ {α : Type u} {ι : Sort w} [Finite ι] {f : ι → Set α}, (∀ (i : ι), (f i).Finite) → (⋃ i, f i).Finite
theorem Set.Finite.biUnion' E1 #
∀ {α : Type u} {ι : Type u_1} {s : Set ι},
s.Finite →
∀ {t : (i : ι) → i ∈ s → Set α}, (∀ (i : ι) (hi : i ∈ s), (t i hi).Finite) → (⋃ i, ⋃ (h : i ∈ s), t i h).Finite
Dependent version of Finite.biUnion.
theorem Set.Finite.biUnion E1 #
∀ {α : Type u} {ι : Type u_1} {s : Set ι}, s.Finite → ∀ {t : ι → Set α}, (∀ i ∈ s, (t i).Finite) → (⋃ i ∈ s, t i).Finite
theorem Set.Finite.sUnion E1 #
∀ {α : Type u} {s : Set (Set α)}, s.Finite → (∀ t ∈ s, t.Finite) → (⋃₀ s).Finite
theorem Set.Finite.sInter E1 #
∀ {α : Type u_1} {s : Set (Set α)} {t : Set α}, t ∈ s → t.Finite → (⋂₀ s).Finite
theorem Set.Finite.iUnion E1 #
∀ {α : Type u} {ι : Type u_1} {s : ι → Set α} {t : Set ι},
t.Finite → (∀ i ∈ t, (s i).Finite) → (∀ i ∉ t, s i = ∅) → (⋃ i, s i).Finite
If sets s i are finite for all i from a finite set t and are empty for i ∉ t, then the
union ⋃ i, s i is a finite set.
theorem Set.finite_iUnion_iff E0 #
∀ {α : Type u} {ι : Type u_1} {s : ι → Set α},
(Pairwise fun i j ↦ Disjoint (s i) (s j)) →
((⋃ i, s i).Finite ↔ (∀ (i : ι), (s i).Finite) ∧ {i | (s i).Nonempty}.Finite)
An indexed union of pairwise disjoint sets is finite iff all sets are finite, and all but finitely many are empty.
theorem Set.Infinite.iUnion E1 #
∀ {α : Type u} {ι : Sort u_1} {s : ι → Set α} (i : ι), (s i).Infinite → (⋃ i, s i).Infinite
theorem Set.Infinite.iUnion₂ E1 #
∀ {α : Type u} {ι : Sort u_1} {κ : ι → Sort u_2} {s : (i : ι) → κ i → Set α} (i : ι) (j : κ i),
(s i j).Infinite → (⋃ i, ⋃ j, s i j).Infinite
theorem Set.finite_iUnion_of_subsingleton E0 #
∀ {α : Type u} {ι : Sort u_1} [Subsingleton ι] {s : ι → Set α}, (⋃ i, s i).Finite ↔ ∀ (i : ι), (s i).Finite
theorem Set.PairwiseDisjoint.finite_biUnion_iff E0 #
∀ {α : Type u} {β : Type v} {f : β → Set α} {s : Set β},
s.PairwiseDisjoint f → ((⋃ i ∈ s, f i).Finite ↔ (∀ i ∈ s, (f i).Finite) ∧ {i | i ∈ s ∧ (f i).Nonempty}.Finite)
An indexed union of pairwise disjoint sets is finite iff all sets are finite, and all but finitely many are empty.
theorem Set.Finite.preimage' E1 #
∀ {α : Type u} {β : Type v} {f : α → β} {s : Set β}, s.Finite → (∀ b ∈ s, (f ⁻¹' {b}).Finite) → (f ⁻¹' s).Finite
theorem Set.union_finset_finite_of_range_finite E1 #
∀ {α : Type u} {β : Type v} (f : α → Finset β), (Set.range f).Finite → (⋃ a, ↑(f a)).Finite
A finite union of finsets is finite.
theorem Set.Finite.of_finite_fibers E1 #
∀ {α : Type u} {β : Type v} (f : α → β) {s : Set α}, (f '' s).Finite → (∀ x ∈ f '' s, (s ∩ f ⁻¹' {x}).Finite) → s.Finite
If the image of s under f is finite, and each fiber of f has a finite intersection
with s, then s is itself finite.
It is useful to give f explicitly here so this can be used with apply.
theorem Set.finite_subset_iUnion E1 #
∀ {α : Type u} {s : Set α}, s.Finite → ∀ {ι : Type u_1} {t : ι → Set α}, s ⊆ ⋃ i, t i → ∃ I, I.Finite ∧ s ⊆ ⋃ i ∈ I, t i
theorem Set.infinite_iUnion E1 #
∀ {α : Type u} {ι : Type u_1} [Infinite ι] {s : ι → Set α}, Function.Injective s → (⋃ i, s i).Infinite
theorem Set.Infinite.biUnion E1 #
∀ {α : Type u} {ι : Type u_1} {s : ι → Set α} {a : Set ι}, a.Infinite → Set.InjOn s a → (⋃ i ∈ a, s i).Infinite
theorem Set.Infinite.sUnion E1 #
∀ {α : Type u} {s : Set (Set α)}, s.Infinite → (⋃₀ s).Infinite
theorem Set.map_finite_biSup E0 #
∀ {α : Type u} {β : Type v} {F : Type u_1} {ι : Type u_2} [inst : CompleteLattice α] [inst_1 : CompleteLattice β]
[inst_2 : FunLike F α β] [SupBotHomClass F α β] {s : Set ι},
s.Finite → ∀ (f : F) (g : ι → α), f (⨆ x ∈ s, g x) = ⨆ x ∈ s, f (g x)
theorem Set.map_finite_biInf E0 #
∀ {α : Type u} {β : Type v} {F : Type u_1} {ι : Type u_2} [inst : CompleteLattice α] [inst_1 : CompleteLattice β]
[inst_2 : FunLike F α β] [InfTopHomClass F α β] {s : Set ι},
s.Finite → ∀ (f : F) (g : ι → α), f (⨅ x ∈ s, g x) = ⨅ x ∈ s, f (g x)
theorem Set.map_finite_iInf E0 #
∀ {α : Type u} {β : Type v} {F : Type u_1} {ι : Type u_2} [inst : CompleteLattice α] [inst_1 : CompleteLattice β]
[inst_2 : FunLike F α β] [InfTopHomClass F α β] [Finite ι] (f : F) (g : ι → α), f (⨅ i, g i) = ⨅ i, f (g i)
theorem Set.map_finite_iSup E0 #
∀ {α : Type u} {β : Type v} {F : Type u_1} {ι : Type u_2} [inst : CompleteLattice α] [inst_1 : CompleteLattice β]
[inst_2 : FunLike F α β] [SupBotHomClass F α β] [Finite ι] (f : F) (g : ι → α), f (⨆ i, g i) = ⨆ i, f (g i)
theorem Set.Finite.iSup_biInf_of_monotone E1 #
∀ {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [inst : Preorder ι'] [Nonempty ι'] [IsDirectedOrder ι']
[inst_3 : Order.Frame α] {s : Set ι},
s.Finite → ∀ {f : ι → ι' → α}, (∀ i ∈ s, Monotone (f i)) → ⨆ j, ⨅ i ∈ s, f i j = ⨅ i ∈ s, ⨆ j, f i j
theorem Set.Finite.iInf_biSup_of_monotone E1 #
∀ {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [inst : Preorder ι'] [Nonempty ι'] [IsCodirectedOrder ι']
[inst_3 : Order.Coframe α] {s : Set ι},
s.Finite → ∀ {f : ι → ι' → α}, (∀ i ∈ s, Monotone (f i)) → ⨅ j, ⨆ i ∈ s, f i j = ⨆ i ∈ s, ⨅ j, f i j
theorem Set.Finite.iSup_biInf_of_antitone E1 #
∀ {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [inst : Preorder ι'] [Nonempty ι'] [IsCodirectedOrder ι']
[inst_3 : Order.Frame α] {s : Set ι},
s.Finite → ∀ {f : ι → ι' → α}, (∀ i ∈ s, Antitone (f i)) → ⨆ j, ⨅ i ∈ s, f i j = ⨅ i ∈ s, ⨆ j, f i j
theorem Set.Finite.iInf_biSup_of_antitone E1 #
∀ {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [inst : Preorder ι'] [Nonempty ι'] [IsDirectedOrder ι']
[inst_3 : Order.Coframe α] {s : Set ι},
s.Finite → ∀ {f : ι → ι' → α}, (∀ i ∈ s, Antitone (f i)) → ⨅ j, ⨆ i ∈ s, f i j = ⨆ i ∈ s, ⨅ j, f i j
theorem iSup_iInf_of_monotone E1 #
∀ {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [Finite ι] [inst : Preorder ι'] [Nonempty ι'] [IsDirectedOrder ι']
[inst_3 : Order.Frame α] {f : ι → ι' → α}, (∀ (i : ι), Monotone (f i)) → ⨆ j, ⨅ i, f i j = ⨅ i, ⨆ j, f i j
theorem iInf_iSup_of_monotone E1 #
∀ {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [Finite ι] [inst : Preorder ι'] [Nonempty ι'] [IsCodirectedOrder ι']
[inst_3 : Order.Coframe α] {f : ι → ι' → α}, (∀ (i : ι), Monotone (f i)) → ⨅ j, ⨆ i, f i j = ⨆ i, ⨅ j, f i j
theorem iInf_iSup_of_antitone E1 #
∀ {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [Finite ι] [inst : Preorder ι'] [Nonempty ι'] [IsDirectedOrder ι']
[inst_3 : Order.Coframe α] {f : ι → ι' → α}, (∀ (i : ι), Antitone (f i)) → ⨅ j, ⨆ i, f i j = ⨆ i, ⨅ j, f i j
theorem iSup_iInf_of_antitone E1 #
∀ {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [Finite ι] [inst : Preorder ι'] [Nonempty ι'] [IsCodirectedOrder ι']
[inst_3 : Order.Frame α] {f : ι → ι' → α}, (∀ (i : ι), Antitone (f i)) → ⨆ j, ⨅ i, f i j = ⨅ i, ⨆ j, f i j
theorem Set.iUnion_iInter_of_monotone E1 #
∀ {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [Finite ι] [inst : Preorder ι'] [IsDirectedOrder ι'] [Nonempty ι']
{s : ι → ι' → Set α}, (∀ (i : ι), Monotone (s i)) → ⋃ j, ⋂ i, s i j = ⋂ i, ⋃ j, s i j
An increasing union distributes over finite intersection.
theorem Set.iUnion_iInter_of_antitone E1 #
∀ {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [Finite ι] [inst : Preorder ι'] [IsCodirectedOrder ι'] [Nonempty ι']
{s : ι → ι' → Set α}, (∀ (i : ι), Antitone (s i)) → ⋃ j, ⋂ i, s i j = ⋂ i, ⋃ j, s i j
A decreasing union distributes over finite intersection.
theorem Set.iInter_iUnion_of_monotone E1 #
∀ {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [Finite ι] [inst : Preorder ι'] [IsCodirectedOrder ι'] [Nonempty ι']
{s : ι → ι' → Set α}, (∀ (i : ι), Monotone (s i)) → ⋂ j, ⋃ i, s i j = ⋃ i, ⋂ j, s i j
An increasing intersection distributes over finite union.
theorem Set.iInter_iUnion_of_antitone E1 #
∀ {ι : Type u_1} {ι' : Type u_2} {α : Type u_3} [Finite ι] [inst : Preorder ι'] [IsDirectedOrder ι'] [Nonempty ι']
{s : ι → ι' → Set α}, (∀ (i : ι), Antitone (s i)) → ⋂ j, ⋃ i, s i j = ⋃ i, ⋂ j, s i j
A decreasing intersection distributes over finite union.
theorem Set.iUnion_pi_of_monotone E1 #
∀ {ι : Type u_1} {ι' : Type u_2} [inst : LinearOrder ι'] [Nonempty ι'] {α : ι → Type u_3} {I : Set ι}
{s : (i : ι) → ι' → Set (α i)},
I.Finite → (∀ i ∈ I, Monotone (s i)) → (⋃ j, I.pi fun i ↦ s i j) = I.pi fun i ↦ ⋃ j, s i j
theorem Set.iUnion_univ_pi_of_monotone E1 #
∀ {ι : Type u_1} {ι' : Type u_2} [inst : LinearOrder ι'] [Nonempty ι'] [Finite ι] {α : ι → Type u_3}
{s : (i : ι) → ι' → Set (α i)},
(∀ (i : ι), Monotone (s i)) → (⋃ j, Set.univ.pi fun i ↦ s i j) = Set.univ.pi fun i ↦ ⋃ j, s i j
theorem iInf_iSup_eq_of_finite E1 #
∀ {α : Type u} {ι : Sort v} {κ : ι → Sort w} [inst : Order.Frame α] [Finite ι] {f : (a : ι) → κ a → α},
⨅ a, ⨆ b, f a b = ⨆ g, ⨅ a, f a (g a)
theorem iSup_iInf_eq_of_finite E1 #
∀ {α : Type u} {ι : Sort v} {κ : ι → Sort w} [inst : Order.Coframe α] [Finite ι] {f : (a : ι) → κ a → α},
⨆ a, ⨅ b, f a b = ⨅ g, ⨆ a, f a (g a)
theorem Set.Finite.biInf_iSup_eq E0 #
∀ {α : Type u} {ι : Type v} {κ : ι → Sort w} [Nonempty ((a : ι) → κ a)] [inst : Order.Frame α] {s : Set ι},
s.Finite → ∀ {f : (a : ι) → κ a → α}, ⨅ a ∈ s, ⨆ b, f a b = ⨆ g, ⨅ a ∈ s, f a (g a)
theorem Set.Finite.biSup_iInf_eq E0 #
∀ {α : Type u} {ι : Type v} {κ : ι → Sort w} [Nonempty ((a : ι) → κ a)] [inst : Order.Coframe α] {s : Set ι},
s.Finite → ∀ {f : (a : ι) → κ a → α}, ⨆ a ∈ s, ⨅ b, f a b = ⨅ g, ⨆ a ∈ s, f a (g a)
theorem Set.Finite.bddAbove E1 #
∀ {α : Type u} [inst : Preorder α] [IsDirectedOrder α] [Nonempty α] {s : Set α}, s.Finite → BddAbove s
A finite set is bounded above.
theorem Set.Finite.bddBelow E1 #
∀ {α : Type u} [inst : Preorder α] [IsCodirectedOrder α] [Nonempty α] {s : Set α}, s.Finite → BddBelow s
A finite set is bounded below.
theorem Set.Finite.bddAbove_biUnion E1 #
∀ {α : Type u} {β : Type v} [inst : Preorder α] [IsDirectedOrder α] [Nonempty α] {I : Set β} {S : β → Set α},
I.Finite → (BddAbove (⋃ i ∈ I, S i) ↔ ∀ i ∈ I, BddAbove (S i))
A finite union of sets which are all bounded above is still bounded above.
theorem Set.Finite.bddBelow_biUnion E1 #
∀ {α : Type u} {β : Type v} [inst : Preorder α] [IsCodirectedOrder α] [Nonempty α] {I : Set β} {S : β → Set α},
I.Finite → (BddBelow (⋃ i ∈ I, S i) ↔ ∀ i ∈ I, BddBelow (S i))
A finite union of sets which are all bounded below is still bounded below.
theorem Set.infinite_of_not_bddAbove E1 #
∀ {α : Type u} [inst : Preorder α] [IsDirectedOrder α] [Nonempty α] {s : Set α}, ¬BddAbove s → s.Infinite
theorem Set.infinite_of_not_bddBelow E1 #
∀ {α : Type u} [inst : Preorder α] [IsCodirectedOrder α] [Nonempty α] {s : Set α}, ¬BddBelow s → s.Infinite
theorem Finset.bddAbove E1 #
∀ {α : Type u} [inst : SemilatticeSup α] [Nonempty α] (s : Finset α), BddAbove ↑s
A finset is bounded above.
theorem Finset.bddBelow E1 #
∀ {α : Type u} [inst : SemilatticeInf α] [Nonempty α] (s : Finset α), BddBelow ↑s
A finset is bounded below.
theorem Set.finite_sdiff_iUnion_Ioo E1 #
∀ {α : Type u} [inst : LinearOrder α] (s : Set α), (s \ ⋃ x ∈ s, ⋃ y ∈ s, Set.Ioo x y).Finite
theorem Set.finite_sdiff_iUnion_Ioo' E1 #
∀ {α : Type u} [inst : LinearOrder α] (s : Set α), (s \ ⋃ x, Set.Ioo ↑x.1 ↑x.2).Finite
theorem Directed.exists_mem_subset_of_finset_subset_biUnion E1 #
∀ {α : Type u_1} {ι : Type u_2} [Nonempty ι] {f : ι → Set α},
Directed (fun x1 x2 ↦ x1 ⊆ x2) f → ∀ {s : Finset α}, ↑s ⊆ ⋃ i, f i → ∃ i, ↑s ⊆ f i
theorem DirectedOn.exists_mem_subset_of_finset_subset_biUnion E1 #
∀ {α : Type u_1} {ι : Type u_2} {f : ι → Set α} {c : Set ι},
c.Nonempty → DirectedOn (fun i j ↦ f i ⊆ f j) c → ∀ {s : Finset α}, ↑s ⊆ ⋃ i ∈ c, f i → ∃ i ∈ c, ↑s ⊆ f i
theorem DirectedOn.exists_mem_subset_of_finite_of_subset_sUnion E1 #
∀ {α : Type u_1} {c : Set (Set α)},
c.Nonempty → DirectedOn (fun x1 x2 ↦ x1 ⊆ x2) c → ∀ {s : Set α}, s.Finite → s ⊆ ⋃₀ c → ∃ t ∈ c, s ⊆ t
Deprecated aliases
| Name | New name | Since |
|---|---|---|
Set.finite_diff_iUnion_Ioo | Set.finite_sdiff_iUnion_Ioo | 2026-06-03 |
Set.finite_diff_iUnion_Ioo' | Set.finite_sdiff_iUnion_Ioo' | 2026-06-03 |