|
| 1 | +/- |
| 2 | +Copyright (c) 2026 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.CategoryTheory.Limits.Preorder |
| 9 | +public import Mathlib.CategoryTheory.Presentable.LocallyPresentable |
| 10 | +public import Mathlib.Order.Category.PartOrdEmb |
| 11 | + |
| 12 | +/-! |
| 13 | +# The κ-accessible category of κ-directed posets |
| 14 | +
|
| 15 | +Given a regular cardinal `κ : Cardinal.{u}`, we define the |
| 16 | +category `CardinalFilteredPoset κ` of `κ`-directed partially ordered |
| 17 | +types (with order embeddings as morphisms). We shall show that it is |
| 18 | +a `κ`-accessible category (TODO @joelriou). |
| 19 | +
|
| 20 | +## References |
| 21 | +* [Adámek, J. and Rosický, J., *Locally presentable and accessible categories*][Adamek_Rosicky_1994] |
| 22 | +
|
| 23 | +-/ |
| 24 | + |
| 25 | +@[expose] public section |
| 26 | + |
| 27 | +universe u |
| 28 | + |
| 29 | +open CategoryTheory Limits |
| 30 | + |
| 31 | +namespace PartOrdEmb |
| 32 | + |
| 33 | +variable (κ : Cardinal.{u}) [Fact κ.IsRegular] |
| 34 | + |
| 35 | +/-- The property of objects in `PartOrdEmb` that are |
| 36 | +satisfied by partially ordered types of cardinality `< κ`. -/ |
| 37 | +abbrev isCardinalFiltered : ObjectProperty PartOrdEmb.{u} := |
| 38 | + fun X ↦ IsCardinalFiltered X κ |
| 39 | + |
| 40 | +@[simp] |
| 41 | +lemma isCardinalFiltered_iff (X : PartOrdEmb.{u}) : |
| 42 | + isCardinalFiltered κ X ↔ IsCardinalFiltered X κ := Iff.rfl |
| 43 | + |
| 44 | +instance : (isCardinalFiltered κ).IsClosedUnderIsomorphisms where |
| 45 | + of_iso e _ := .of_equivalence κ (orderIsoOfIso e).equivalence |
| 46 | + |
| 47 | +namespace Limits.CoconePt |
| 48 | + |
| 49 | +variable {κ} {J : Type u} [SmallCategory J] [IsCardinalFiltered J κ] |
| 50 | + {F : J ⥤ PartOrdEmb.{u}} {c : Cocone (F ⋙ forget _)} (hc : IsColimit c) |
| 51 | + |
| 52 | +lemma isCardinalFiltered_pt (hF : ∀ j, IsCardinalFiltered (F.obj j) κ) : |
| 53 | + haveI := isFiltered_of_isCardinalFiltered J κ |
| 54 | + IsCardinalFiltered (CoconePt hc) κ := by |
| 55 | + haveI := isFiltered_of_isCardinalFiltered J κ |
| 56 | + refine isCardinalFiltered_preorder _ _ (fun K f hK ↦ ?_) |
| 57 | + rw [← hasCardinalLT_iff_cardinal_mk_lt] at hK |
| 58 | + choose j₀ x₀ hx₀ using fun k ↦ Types.jointly_surjective_of_isColimit hc (f k) |
| 59 | + let j := IsCardinalFiltered.max j₀ hK |
| 60 | + let x₁ (k : K) : F.obj j := F.map (IsCardinalFiltered.toMax j₀ hK k) (x₀ k) |
| 61 | + have hx₁ (k : K) : c.ι.app j (x₁ k) = c.ι.app (j₀ k) (x₀ k) := |
| 62 | + ConcreteCategory.congr_hom (c.w (IsCardinalFiltered.toMax j₀ hK k)) _ |
| 63 | + refine ⟨(cocone hc).ι.app j (IsCardinalFiltered.max x₁ hK), |
| 64 | + fun k ↦ ?_⟩ |
| 65 | + rw [← hx₀, ← hx₁] |
| 66 | + exact ((cocone hc).ι.app j).hom.monotone |
| 67 | + (leOfHom (IsCardinalFiltered.toMax x₁ hK k)) |
| 68 | + |
| 69 | +end Limits.CoconePt |
| 70 | + |
| 71 | +instance (J : Type u) [SmallCategory J] [IsCardinalFiltered J κ] : |
| 72 | + (isCardinalFiltered κ).IsClosedUnderColimitsOfShape J where |
| 73 | + colimitsOfShape_le := by |
| 74 | + have := isFiltered_of_isCardinalFiltered J κ |
| 75 | + rintro X ⟨p⟩ |
| 76 | + simp only [(isCardinalFiltered κ).prop_iff_of_iso |
| 77 | + (p.isColimit.coconePointUniqueUpToIso |
| 78 | + (Limits.isColimitCocone (colimit.isColimit (p.diag ⋙ forget PartOrdEmb)))), |
| 79 | + isCardinalFiltered_iff, Limits.cocone_pt_coe] |
| 80 | + exact Limits.CoconePt.isCardinalFiltered_pt _ p.prop_diag_obj |
| 81 | + |
| 82 | +end PartOrdEmb |
| 83 | + |
| 84 | +namespace CategoryTheory |
| 85 | + |
| 86 | +variable (κ : Cardinal.{u}) [Fact κ.IsRegular] |
| 87 | + |
| 88 | +/-- The category of `κ`-filtered partially ordered types, |
| 89 | +with morphisms given by order embeddings. -/ |
| 90 | +abbrev CardinalFilteredPoset := |
| 91 | + (PartOrdEmb.isCardinalFiltered κ).FullSubcategory |
| 92 | + |
| 93 | +variable {κ} |
| 94 | + |
| 95 | +/-- The embedding of the category of `κ`-filtered |
| 96 | +partially ordered types in the category of partially |
| 97 | +ordered types. -/ |
| 98 | +abbrev CardinalFilteredPoset.ι : CardinalFilteredPoset κ ⥤ PartOrdEmb := |
| 99 | + ObjectProperty.ι _ |
| 100 | + |
| 101 | +namespace CardinalFilteredPoset |
| 102 | + |
| 103 | +/-- Constructor for objects in `CardinalFilteredPoset κ`. -/ |
| 104 | +abbrev of (J : PartOrdEmb.{u}) [IsCardinalFiltered J κ] : CardinalFilteredPoset κ where |
| 105 | + obj := J |
| 106 | + property := inferInstance |
| 107 | + |
| 108 | +instance (J : CardinalFilteredPoset κ) : IsCardinalFiltered J.obj κ := J.property |
| 109 | + |
| 110 | +instance (J : CardinalFilteredPoset κ) : IsFiltered J.obj := |
| 111 | + isFiltered_of_isCardinalFiltered _ κ |
| 112 | + |
| 113 | +instance (J : CardinalFilteredPoset κ) : Nonempty J.obj := IsFiltered.nonempty |
| 114 | + |
| 115 | +instance : HasCardinalFilteredColimits (CardinalFilteredPoset κ) κ where |
| 116 | + hasColimitsOfShape J _ _ := by |
| 117 | + have := isFiltered_of_isCardinalFiltered J κ |
| 118 | + infer_instance |
| 119 | + |
| 120 | +instance (A : Type u) [SmallCategory A] [IsCardinalFiltered A κ] : |
| 121 | + PreservesColimitsOfShape A (forget (CardinalFilteredPoset κ)) := by |
| 122 | + have := isFiltered_of_isCardinalFiltered A κ |
| 123 | + change PreservesColimitsOfShape A (CardinalFilteredPoset.ι ⋙ forget _) |
| 124 | + infer_instance |
| 125 | + |
| 126 | +instance (J : CardinalFilteredPoset κ) (κ' : Cardinal.{u}) [Fact κ'.IsRegular] : |
| 127 | + IsCardinalFiltered (WithTop (J.obj)) κ' := |
| 128 | + isCardinalFiltered_of_hasTerminal _ _ |
| 129 | + |
| 130 | +/-- The map `CardinalFilteredPoset κ → CardinalFilteredPoset κ` which sends |
| 131 | +a partially ordered `κ`-filtered type `J` to `WithTop J`. -/ |
| 132 | +abbrev withTop (J : CardinalFilteredPoset κ) : CardinalFilteredPoset κ := |
| 133 | + .of (.of (WithTop J.obj)) |
| 134 | + |
| 135 | +section |
| 136 | + |
| 137 | +variable {J : CardinalFilteredPoset κ} (P : Set J.obj → Prop) |
| 138 | + [IsDirectedOrder (Subtype P)] [Nonempty (Subtype P)] |
| 139 | + [∀ (S : Subtype P), IsCardinalFiltered S.val κ] |
| 140 | + |
| 141 | +/-- Given a predicate `P : Set J.obj → Prop` on the underlying type |
| 142 | +of `J : CardinalFilteredPoset κ` such that all the subsets satisfying `P` |
| 143 | +are `κ`-filtered, this is the functor `Subtype P ⥤ CardinalFilteredPoset κ` |
| 144 | +which sends a subset `S` of `J` satisfying `P` to the induced |
| 145 | +partially ordered type `J`, as an object in `CardinalFilteredPoset κ`. -/ |
| 146 | +@[simps!] |
| 147 | +def functorOfPredicateSet : Subtype P ⥤ CardinalFilteredPoset κ := |
| 148 | + ObjectProperty.lift _ (PartOrdEmb.functorOfPredicateSet P) |
| 149 | + (fun S ↦ by dsimp; infer_instance) |
| 150 | + |
| 151 | +/-- Given a predicate `P : Set J.obj → Prop` on the underlying type |
| 152 | +of `J : CardinalFilteredPoset κ` such that all the subsets satisfying `P` |
| 153 | +are `κ`-filtered, this is the cocone with point `J` given |
| 154 | +by all the inclusions of the subsets satisfying `P`. -/ |
| 155 | +@[simps] |
| 156 | +def coconeOfPredicateSet : Cocone (functorOfPredicateSet P) where |
| 157 | + pt := J |
| 158 | + ι.app j := ObjectProperty.homMk ((PartOrdEmb.coconeOfPredicateSet P).ι.app j) |
| 159 | + |
| 160 | +/-- Let `P` be a predicate on `Set J.obj` where `J : CardinalFilteredPoset κ`. |
| 161 | +We assume that `Subtype P` is directed and nonempty, and that any `a : J.obj` |
| 162 | +belongs to some `S : Set J.obj` satisfying `P`. Then, `J` is the colimit in the |
| 163 | +category `CardinalFilteredPoset κ` of these subsets. -/ |
| 164 | +noncomputable def isColimitCoconeOfPredicateSet |
| 165 | + (hP : ∀ (a : J.obj), ∃ (S : Set J.obj), P S ∧ a ∈ S) : |
| 166 | + IsColimit (coconeOfPredicateSet P) := |
| 167 | + isColimitOfReflects CardinalFilteredPoset.ι |
| 168 | + (PartOrdEmb.isColimitOfPredicateSet P hP) |
| 169 | + |
| 170 | +end |
| 171 | + |
| 172 | +section |
| 173 | + |
| 174 | +variable (J : CardinalFilteredPoset κ) |
| 175 | + |
| 176 | +-- `@[nolint unusedArguments]` allows to setup some instances which uses |
| 177 | +-- the fact that `κ'` is regular. |
| 178 | +/-- Given `J : CardinalFilteredPoset κ` and a regular cardinal `κ'`, |
| 179 | +this is the predicate on `Set J.withTop.obj` that is satisfied by |
| 180 | +subsets that are of cardinality `< κ'` and contain `⊤`. -/ |
| 181 | +@[nolint unusedArguments] |
| 182 | +def PropSetWithTop (κ' : Cardinal.{u}) [Fact κ'.IsRegular] |
| 183 | + (S : Set J.withTop.obj) : Prop := |
| 184 | + HasCardinalLT S κ' ∧ ⊤ ∈ S |
| 185 | + |
| 186 | +variable (κ' : Cardinal.{u}) [Fact κ'.IsRegular] |
| 187 | + |
| 188 | +instance (S : Subtype (J.PropSetWithTop κ')) : HasTerminal S := |
| 189 | + IsTerminal.hasTerminal (X := ⟨⊤, S.2.2⟩) |
| 190 | + (IsTerminal.ofUniqueHom (fun _ ↦ homOfLE (by rw [Subtype.mk_le_mk]; exact le_top)) |
| 191 | + (fun _ _ ↦ rfl)) |
| 192 | + |
| 193 | +instance (S : Subtype (J.PropSetWithTop κ')) : IsCardinalFiltered S κ := |
| 194 | + isCardinalFiltered_of_hasTerminal _ _ |
| 195 | + |
| 196 | +instance : IsCardinalFiltered (Subtype (J.PropSetWithTop κ')) κ' := |
| 197 | + isCardinalFiltered_preorder _ _ (fun K α hK ↦ by |
| 198 | + rw [← hasCardinalLT_iff_cardinal_mk_lt] at hK |
| 199 | + have hκ' : Cardinal.aleph0 ≤ κ' := Cardinal.IsRegular.aleph0_le Fact.out |
| 200 | + refine ⟨⟨(⋃ (k : K), α k) ∪ {⊤}, |
| 201 | + hasCardinalLT_union hκ' (hasCardinalLT_iUnion _ hK (fun k ↦ (α k).property.left)) |
| 202 | + (hasCardinalLT_of_finite _ _ hκ'), by simp⟩, fun k ↦ ?_⟩ |
| 203 | + rw [Subtype.mk_le_mk] |
| 204 | + simp only [Set.le_eq_subset] |
| 205 | + exact subset_trans (Set.subset_iUnion (fun i ↦ (α i).1) k) Set.subset_union_left) |
| 206 | + |
| 207 | +instance : IsFiltered (Subtype (J.PropSetWithTop κ')) := |
| 208 | + isFiltered_of_isCardinalFiltered _ κ' |
| 209 | + |
| 210 | +instance : IsDirectedOrder (Subtype (J.PropSetWithTop κ')) := |
| 211 | + IsFiltered.isDirectedOrder _ |
| 212 | + |
| 213 | +instance : Nonempty (Subtype (J.PropSetWithTop κ')) := |
| 214 | + IsFiltered.nonempty |
| 215 | + |
| 216 | +variable {J} in |
| 217 | +lemma propSetWithTop_pair (j : J.obj) : J.PropSetWithTop κ' {WithTop.some j, ⊤} := |
| 218 | + ⟨hasCardinalLT_of_finite _ _ (Cardinal.IsRegular.aleph0_le Fact.out), |
| 219 | + Set.mem_insert_of_mem _ (by simp)⟩ |
| 220 | + |
| 221 | +lemma exists_mem_propSetWithTop (a : J.withTop.obj) : |
| 222 | + ∃ S, J.PropSetWithTop κ' S ∧ a ∈ S := by |
| 223 | + induction a with |
| 224 | + | some a => exact ⟨_, propSetWithTop_pair _ a, by aesop⟩ |
| 225 | + | none => exact ⟨_, propSetWithTop_pair _ (Classical.arbitrary _), by aesop⟩ |
| 226 | + |
| 227 | +/-- If `J : CardinalFilteredPoset κ` and `κ'` is any regular cardinal, |
| 228 | +this is a colimit cocone which exhibits `J.withTop` as the `κ'`-filtered |
| 229 | +colimit of its subsets that are of cardinality `< κ'` and contain `⊤`. -/ |
| 230 | +abbrev coconeWithTop : Cocone (functorOfPredicateSet (J.PropSetWithTop κ')) := |
| 231 | + coconeOfPredicateSet (PropSetWithTop J κ') |
| 232 | + |
| 233 | +/-- If `J : CardinalFilteredPoset κ` and `κ'` is any regular cardinal, |
| 234 | +then `J.withTop` is the `κ'`-filtered colimit of its subsets that are of |
| 235 | +cardinality `< κ'` and contain `⊤`. -/ |
| 236 | +noncomputable def isColimitCoconeWithTop : IsColimit (coconeWithTop J κ') := |
| 237 | + isColimitCoconeOfPredicateSet _ (fun a ↦ by |
| 238 | + induction a with |
| 239 | + | some a => exact ⟨_, propSetWithTop_pair _ a, by aesop⟩ |
| 240 | + | none => exact ⟨_, propSetWithTop_pair _ (Classical.arbitrary _), by aesop⟩) |
| 241 | + |
| 242 | +end |
| 243 | + |
| 244 | +end CardinalFilteredPoset |
| 245 | + |
| 246 | +end CategoryTheory |
0 commit comments