Skip to content

Commit

Permalink
feat(Data/Set/Lattice): iUnion + insertion (#21322)
Browse files Browse the repository at this point in the history
Another distributivity lemma with iUnion and insertions, needed for #21172. 

This could maybe be `@[simp]`
  • Loading branch information
apnelson1 committed Feb 5, 2025
1 parent 8c7a687 commit 8827be0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Mathlib/Data/Set/Lattice.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1125,10 +1125,14 @@ theorem iUnion_subset_iUnion_const {s : Set α} (h : ι → ι₂) : ⋃ _ : ι,
iSup_const_mono (α := Set α) h

@[simp]
theorem iUnion_singleton_eq_range {α β : Type*} (f : α → β) : ⋃ x : α, {f x} = range f := by
theorem iUnion_singleton_eq_range (f : α → β) : ⋃ x : α, {f x} = range f := by
ext x
simp [@eq_comm _ x]

theorem iUnion_insert_eq_range_union_iUnion {ι : Type*} (x : ι → β) (t : ι → Set β) :
⋃ i, insert (x i) (t i) = range x ∪ ⋃ i, t i := by
simp_rw [← union_singleton, iUnion_union_distrib, union_comm, iUnion_singleton_eq_range]

theorem iUnion_of_singleton (α : Type*) : (⋃ x, {x} : Set α) = univ := by simp [Set.ext_iff]

theorem iUnion_of_singleton_coe (s : Set α) : ⋃ i : s, ({(i : α)} : Set α) = s := by simp
Expand Down

0 comments on commit 8827be0

Please sign in to comment.