Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat: small_iUnion and small_sUnion #10921

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Mathlib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -2666,6 +2666,7 @@ import Mathlib.Logic.Small.Group
import Mathlib.Logic.Small.List
import Mathlib.Logic.Small.Module
import Mathlib.Logic.Small.Ring
import Mathlib.Logic.Small.Set
import Mathlib.Logic.Unique
import Mathlib.Logic.UnivLE
import Mathlib.Mathport.Attributes
Expand Down
5 changes: 5 additions & 0 deletions Mathlib/Logic/Small/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,9 @@ instance small_image {α : Type v} {β : Type w} (f : α → β) (S : Set α) [S
small_of_surjective Set.surjective_onto_image
#align small_image small_image

instance small_union {α : Type v} (s t : Set α) [Small.{u} s] [Small.{u} t] :
Small.{u} (s ∪ t : Set α) := by
rw [← Subtype.range_val (s := s), ← Subtype.range_val (s := t), ← Set.Sum.elim_range]
infer_instance
TwoFX marked this conversation as resolved.
Show resolved Hide resolved

end
21 changes: 21 additions & 0 deletions Mathlib/Logic/Small/Set.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/-
Copyright (c) 2024 Markus Himmel. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Markus Himmel
-/
import Mathlib.Data.Set.Lattice
import Mathlib.Logic.Small.Basic

/-!
# Additional results about `Small` on coerced sets
-/

universe u v w

instance small_iUnion {α : Type v} {ι : Type w} [Small.{u} ι] (s : ι → Set α)
[∀ i, Small.{u} (s i)] : Small.{u} (⋃ i, s i) :=
small_of_surjective <| Set.sigmaToiUnion_surjective _

instance small_sUnion {α : Type v} (s : Set (Set α)) [Small.{u} s] [∀ t : s, Small.{u} t] :
Small.{u} (⋃₀ s) :=
Set.sUnion_eq_iUnion ▸ small_iUnion _
Loading