Skip to content

Commit 89415b3

Browse files
committed
feat: small_iUnion and small_sUnion (#10921)
Also moves the other results about `Small` on sets to their own file.
1 parent dc217ae commit 89415b3

File tree

5 files changed

+44
-16
lines changed

5 files changed

+44
-16
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2666,6 +2666,7 @@ import Mathlib.Logic.Small.Group
26662666
import Mathlib.Logic.Small.List
26672667
import Mathlib.Logic.Small.Module
26682668
import Mathlib.Logic.Small.Ring
2669+
import Mathlib.Logic.Small.Set
26692670
import Mathlib.Logic.Unique
26702671
import Mathlib.Logic.UnivLE
26712672
import Mathlib.Mathport.Attributes

Mathlib/CategoryTheory/Comma/StructuredArrow.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Mathlib.CategoryTheory.Comma.Basic
77
import Mathlib.CategoryTheory.PUnit
88
import Mathlib.CategoryTheory.Limits.Shapes.Terminal
99
import Mathlib.CategoryTheory.EssentiallySmall
10+
import Mathlib.Logic.Small.Set
1011

1112
#align_import category_theory.structured_arrow from "leanprover-community/mathlib"@"8a318021995877a44630c898d0b2bc376fceef3b"
1213

Mathlib/Logic/Small/Basic.lean

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ theorem small_of_surjective {α : Type v} {β : Type w} [Small.{u} α] {f : α
3737
small_of_injective (Function.injective_surjInv hf)
3838
#align small_of_surjective small_of_surjective
3939

40-
theorem small_subset {α : Type v} {s t : Set α} (hts : t ⊆ s) [Small.{u} s] : Small.{u} t :=
41-
let f : t → s := fun x => ⟨x, hts x.prop⟩
42-
@small_of_injective _ _ _ f fun _ _ hxy => Subtype.ext (Subtype.mk.inj hxy)
43-
#align small_subset small_subset
44-
4540
instance (priority := 100) small_subsingleton (α : Type v) [Subsingleton α] : Small.{w} α := by
4641
rcases isEmpty_or_nonempty α with ⟨⟩ <;> skip
4742
· apply small_map (Equiv.equivPEmpty α)
@@ -84,14 +79,4 @@ instance small_set {α} [Small.{w} α] : Small.{w} (Set α) :=
8479
⟨⟨Set (Shrink α), ⟨Equiv.Set.congr (equivShrink α)⟩⟩⟩
8580
#align small_set small_set
8681

87-
instance small_range {α : Type v} {β : Type w} (f : α → β) [Small.{u} α] :
88-
Small.{u} (Set.range f) :=
89-
small_of_surjective Set.surjective_onto_range
90-
#align small_range small_range
91-
92-
instance small_image {α : Type v} {β : Type w} (f : α → β) (S : Set α) [Small.{u} S] :
93-
Small.{u} (f '' S) :=
94-
small_of_surjective Set.surjective_onto_image
95-
#align small_image small_image
96-
9782
end

Mathlib/Logic/Small/Set.lean

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/-
2+
Copyright (c) 2024 Markus Himmel. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Markus Himmel
5+
-/
6+
import Mathlib.Data.Set.Lattice
7+
import Mathlib.Logic.Small.Basic
8+
9+
/-!
10+
# Results about `Small` on coerced sets
11+
-/
12+
13+
universe u v w
14+
15+
theorem small_subset {α : Type v} {s t : Set α} (hts : t ⊆ s) [Small.{u} s] : Small.{u} t :=
16+
let f : t → s := fun x => ⟨x, hts x.prop⟩
17+
@small_of_injective _ _ _ f fun _ _ hxy => Subtype.ext (Subtype.mk.inj hxy)
18+
#align small_subset small_subset
19+
20+
instance small_range {α : Type v} {β : Type w} (f : α → β) [Small.{u} α] :
21+
Small.{u} (Set.range f) :=
22+
small_of_surjective Set.surjective_onto_range
23+
#align small_range small_range
24+
25+
instance small_image {α : Type v} {β : Type w} (f : α → β) (S : Set α) [Small.{u} S] :
26+
Small.{u} (f '' S) :=
27+
small_of_surjective Set.surjective_onto_image
28+
#align small_image small_image
29+
30+
instance small_union {α : Type v} (s t : Set α) [Small.{u} s] [Small.{u} t] :
31+
Small.{u} (s ∪ t : Set α) := by
32+
rw [← Subtype.range_val (s := s), ← Subtype.range_val (s := t), ← Set.Sum.elim_range]
33+
infer_instance
34+
35+
instance small_iUnion {α : Type v} {ι : Type w} [Small.{u} ι] (s : ι → Set α)
36+
[∀ i, Small.{u} (s i)] : Small.{u} (⋃ i, s i) :=
37+
small_of_surjective <| Set.sigmaToiUnion_surjective _
38+
39+
instance small_sUnion {α : Type v} (s : Set (Set α)) [Small.{u} s] [∀ t : s, Small.{u} t] :
40+
Small.{u} (⋃₀ s) :=
41+
Set.sUnion_eq_iUnion ▸ small_iUnion _

Mathlib/SetTheory/Cardinal/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Mathlib.Algebra.Module.Basic
77
import Mathlib.Data.Fintype.BigOperators
88
import Mathlib.Data.Finsupp.Defs
99
import Mathlib.Data.Set.Countable
10-
import Mathlib.Logic.Small.Basic
10+
import Mathlib.Logic.Small.Set
1111
import Mathlib.Order.ConditionallyCompleteLattice.Basic
1212
import Mathlib.Order.SuccPred.CompleteLinearOrder
1313
import Mathlib.SetTheory.Cardinal.SchroederBernstein

0 commit comments

Comments
 (0)