Skip to content

Commit d5c9558

Browse files
committed
feat(CategoryTheory): HasCardinalLT for MorphismProperty and ObjectProperty (#31421)
This PR introduces abbreviations to say that the type of objects or morphisms satisfying a certain property is of cardinality `< κ`.
1 parent cf85478 commit d5c9558

File tree

4 files changed

+129
-0
lines changed

4 files changed

+129
-0
lines changed

Mathlib.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2775,6 +2775,7 @@ public import Mathlib.CategoryTheory.MorphismProperty.Concrete
27752775
public import Mathlib.CategoryTheory.MorphismProperty.Descent
27762776
public import Mathlib.CategoryTheory.MorphismProperty.Factorization
27772777
public import Mathlib.CategoryTheory.MorphismProperty.FunctorCategory
2778+
public import Mathlib.CategoryTheory.MorphismProperty.HasCardinalLT
27782779
public import Mathlib.CategoryTheory.MorphismProperty.Ind
27792780
public import Mathlib.CategoryTheory.MorphismProperty.IsInvertedBy
27802781
public import Mathlib.CategoryTheory.MorphismProperty.IsSmall
@@ -2801,6 +2802,7 @@ public import Mathlib.CategoryTheory.ObjectProperty.EpiMono
28012802
public import Mathlib.CategoryTheory.ObjectProperty.Extensions
28022803
public import Mathlib.CategoryTheory.ObjectProperty.FullSubcategory
28032804
public import Mathlib.CategoryTheory.ObjectProperty.FunctorCategory.PreservesLimits
2805+
public import Mathlib.CategoryTheory.ObjectProperty.HasCardinalLT
28042806
public import Mathlib.CategoryTheory.ObjectProperty.Ind
28052807
public import Mathlib.CategoryTheory.ObjectProperty.LimitsClosure
28062808
public import Mathlib.CategoryTheory.ObjectProperty.LimitsOfShape

Mathlib/CategoryTheory/MorphismProperty/Basic.lean

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,16 @@ variable (P : MorphismProperty C)
147147
/-- The set in `Set (Arrow C)` which corresponds to `P : MorphismProperty C`. -/
148148
def toSet : Set (Arrow C) := setOf (fun f ↦ P f.hom)
149149

150+
lemma mem_toSet_iff (f : Arrow C) : f ∈ P.toSet ↔ P f.hom := Iff.rfl
151+
152+
lemma toSet_iSup {ι : Type*} (W : ι → MorphismProperty C) :
153+
(⨆ i , W i).toSet = ⋃ i, (W i).toSet := by
154+
ext
155+
simp [mem_toSet_iff]
156+
157+
lemma toSet_max (W₁ W₂ : MorphismProperty C) :
158+
(W₁ ⊔ W₂).toSet = W₁.toSet ∪ W₂.toSet := rfl
159+
150160
/-- The family of morphisms indexed by `P.toSet` which corresponds
151161
to `P : MorphismProperty C`, see `MorphismProperty.ofHoms_homFamily`. -/
152162
def homFamily (f : P.toSet) : f.1.left ⟶ f.1.right := f.1.hom
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/-
2+
Copyright (c) 2025 Joël Riou. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Joël Riou
5+
-/
6+
module
7+
8+
public import Mathlib.SetTheory.Cardinal.HasCardinalLT
9+
public import Mathlib.CategoryTheory.MorphismProperty.Basic
10+
11+
/-!
12+
# Properties of morphisms that are bounded by a cardinal
13+
14+
Given `P : MorphismProperty C` and `κ : Cardinal`, we introduce a predicate
15+
`P.HasCardinalLT κ` saying that the cardinality of `P.toSet` is `< κ`.
16+
17+
-/
18+
19+
@[expose] public section
20+
21+
universe w v u
22+
23+
namespace CategoryTheory
24+
25+
variable {C : Type u} [Category.{v} C]
26+
27+
namespace MorphismProperty
28+
29+
/-- The property that the subtype of arrows satisfying a property `P : MorphismProperty C`
30+
is of cardinality `< κ`. -/
31+
protected abbrev HasCardinalLT (P : MorphismProperty C) (κ : Cardinal.{w}) :=
32+
_root_.HasCardinalLT P.toSet κ
33+
34+
lemma hasCardinalLT_ofHoms {C : Type*} [Category C]
35+
{ι : Type*} {X Y : ι → C} (f : ∀ i, X i ⟶ Y i) {κ : Cardinal}
36+
(h : HasCardinalLT ι κ) : (MorphismProperty.ofHoms f).HasCardinalLT κ :=
37+
h.of_surjective (fun i ↦ ⟨Arrow.mk (f i), ⟨i⟩⟩) (by
38+
rintro ⟨f, hf⟩
39+
rw [MorphismProperty.mem_toSet_iff, MorphismProperty.ofHoms_iff] at hf
40+
obtain ⟨i, hf⟩ := hf
41+
obtain rfl : f = _ := hf
42+
exact ⟨i, rfl⟩)
43+
44+
lemma HasCardinalLT.iSup
45+
{ι : Type*} {P : ι → MorphismProperty C} {κ : Cardinal.{w}} [Fact κ.IsRegular]
46+
(hP : ∀ i, (P i).HasCardinalLT κ) (hι : HasCardinalLT ι κ) :
47+
(⨆ i, P i).HasCardinalLT κ := by
48+
dsimp only [MorphismProperty.HasCardinalLT]
49+
rw [toSet_iSup]
50+
exact hasCardinalLT_iUnion _ hι hP
51+
52+
lemma HasCardinalLT.sup
53+
{P₁ P₂ : MorphismProperty C} {κ : Cardinal.{w}}
54+
(h₁ : P₁.HasCardinalLT κ) (h₂ : P₂.HasCardinalLT κ)
55+
(hκ : Cardinal.aleph0 ≤ κ) :
56+
(P₁ ⊔ P₂).HasCardinalLT κ := by
57+
dsimp only [MorphismProperty.HasCardinalLT]
58+
rw [MorphismProperty.toSet_max]
59+
exact hasCardinalLT_union hκ h₁ h₂
60+
61+
end MorphismProperty
62+
63+
end CategoryTheory
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/-
2+
Copyright (c) 2025 Joël Riou. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Joël Riou
5+
-/
6+
module
7+
8+
public import Mathlib.SetTheory.Cardinal.HasCardinalLT
9+
public import Mathlib.CategoryTheory.ObjectProperty.Basic
10+
11+
/-!
12+
# Properties of objects that are bounded by a cardinal
13+
14+
Given `P : ObjectProperty C` and `κ : Cardinal`, we introduce a predicate
15+
`P.HasCardinalLT κ` saying that the cardinality of `Subtype P` is `< κ`.
16+
17+
-/
18+
19+
@[expose] public section
20+
21+
universe w v u
22+
23+
namespace CategoryTheory
24+
25+
variable {C : Type u} [Category.{v} C]
26+
27+
namespace ObjectProperty
28+
29+
/-- The property that the subtype of objects satisfying a property `P : ObjectProperty C`
30+
is of cardinality `< κ`. -/
31+
protected abbrev HasCardinalLT (P : ObjectProperty C) (κ : Cardinal.{w}) :=
32+
_root_.HasCardinalLT (Subtype P) κ
33+
34+
lemma hasCardinalLT_subtype_ofObj
35+
{ι : Type*} (X : ι → C) {κ : Cardinal.{w}}
36+
(h : HasCardinalLT ι κ) : (ObjectProperty.ofObj X).HasCardinalLT κ :=
37+
h.of_surjective (fun i ↦ ⟨X i, by simp⟩) (by rintro ⟨_, ⟨i⟩⟩; exact ⟨i, rfl⟩)
38+
39+
lemma HasCardinalLT.iSup
40+
{ι : Type*} {P : ι → ObjectProperty C} {κ : Cardinal.{w}} [Fact κ.IsRegular]
41+
(hP : ∀ i, (P i).HasCardinalLT κ) (hι : HasCardinalLT ι κ) :
42+
(⨆ i, P i).HasCardinalLT κ :=
43+
hasCardinalLT_subtype_iSup _ hι hP
44+
45+
lemma HasCardinalLT.sup
46+
{P₁ P₂ : ObjectProperty C} {κ : Cardinal.{w}}
47+
(h₁ : P₁.HasCardinalLT κ) (h₂ : P₂.HasCardinalLT κ)
48+
(hκ : Cardinal.aleph0 ≤ κ) :
49+
(P₁ ⊔ P₂).HasCardinalLT κ :=
50+
hasCardinalLT_union hκ h₁ h₂
51+
52+
end ObjectProperty
53+
54+
end CategoryTheory

0 commit comments

Comments
 (0)