Skip to content

Commit 38d84f1

Browse files
joelriouReemMelamed
authored andcommitted
feat(CategoryTheory): the κ-accessible category of κ-directed posets (leanprover-community#39655)
Given a regular cardinal `κ : Cardinal.{u}`, we show that the category `CardinalFilteredPoset κ` of `κ`-directed partially ordered types (with order embeddings as morphisms) is a `κ`-accessible category.
1 parent aededa1 commit 38d84f1

1 file changed

Lines changed: 189 additions & 2 deletions

File tree

Mathlib/CategoryTheory/Presentable/CardinalDirectedPoset.lean

Lines changed: 189 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@ public import Mathlib.Order.Category.PartOrdEmb
1414
1515
Given a regular cardinal `κ : Cardinal.{u}`, we define the
1616
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).
17+
types (with order embeddings as morphisms), and we show that it is
18+
a `κ`-accessible category.
19+
20+
If `κ ≤ κ'` where `κ'` is also a regular cardinal, we characterize
21+
the `κ'`-presentable objects of `CardinalFilteredPoset κ` as
22+
the objects `J` such that the underlying type `J.obj` has
23+
cardinality `< κ'`.
1924
2025
## References
2126
* [Adámek, J. and Rosický, J., *Locally presentable and accessible categories*][Adamek_Rosicky_1994]
@@ -105,6 +110,13 @@ abbrev of (J : PartOrdEmb.{u}) [IsCardinalFiltered J κ] : CardinalFilteredPoset
105110
obj := J
106111
property := inferInstance
107112

113+
lemma Hom.injective {J₁ J₂ : CardinalFilteredPoset κ} (f : J₁ ⟶ J₂) :
114+
Function.Injective f := f.hom.injective
115+
116+
lemma Hom.le_iff_le {J₁ J₂ : CardinalFilteredPoset κ} (f : J₁ ⟶ J₂) (x₁ x₂ : J₁.obj) :
117+
f x₁ ≤ f x₂ ↔ x₁ ≤ x₂ :=
118+
f.hom.hom.le_iff_le
119+
108120
instance (J : CardinalFilteredPoset κ) : IsCardinalFiltered J.obj κ := J.property
109121

110122
instance (J : CardinalFilteredPoset κ) : IsFiltered J.obj :=
@@ -170,6 +182,77 @@ noncomputable def isColimitCoconeOfPredicateSet
170182

171183
end
172184

185+
variable (κ) in
186+
/-- The property of posets in `CardinalFilteredPoset κ` that are
187+
of cardinality `< κ` and have terminal object. -/
188+
def hasCardinalLTWithTerminal : ObjectProperty (CardinalFilteredPoset κ) :=
189+
fun J ↦ HasCardinalLT J.obj κ ∧ HasTerminal J.obj
190+
191+
instance : ObjectProperty.EssentiallySmall.{u} (hasCardinalLTWithTerminal κ) where
192+
exists_small_le' := by
193+
obtain ⟨X, hX⟩ : ∃ (X : Type u), Cardinal.mk X = κ := ⟨κ.ord.ToType, by simp⟩
194+
let α : Type u := Σ (S : Set X) (_ : PartialOrder S),
195+
ULift.{u} (PLift (IsCardinalFiltered S κ))
196+
let (a : α) : PartialOrder a.1 := a.2.1
197+
let ι (a : α) : CardinalFilteredPoset κ :=
198+
{ obj := .of a.1
199+
property := a.2.2.down.down }
200+
refine ⟨.ofObj ι, inferInstance, fun J ⟨hJ, _⟩ ↦ ?_⟩
201+
obtain ⟨f⟩ : Cardinal.mk J.obj ≤ Cardinal.mk X := by
202+
simpa [hX] using ((hasCardinalLT_iff_cardinal_mk_lt _ _).1 hJ).le
203+
let e := Equiv.ofInjective _ f.injective
204+
letI : PartialOrder (Set.range f) := PartialOrder.lift _ e.symm.injective
205+
let e' : Set.range f ≃o J.obj := { toEquiv := e.symm, map_rel_iff' := by rfl }
206+
exact ⟨_, ⟨⟨Set.range f, inferInstance,
207+
⟨⟨IsCardinalFiltered.of_equivalence κ e'.symm.equivalence⟩⟩⟩⟩,
208+
⟨CardinalFilteredPoset.ι.preimageIso (PartOrdEmb.Iso.mk (by exact e'.symm))⟩⟩
209+
210+
set_option backward.defeqAttrib.useBackward true in
211+
set_option backward.isDefEq.respectTransparency false in
212+
lemma isCardinalPresentable_of_hasCardinalLT_of_le (J : CardinalFilteredPoset κ)
213+
{κ' : Cardinal.{u}} [Fact κ'.IsRegular] (hJ : HasCardinalLT J.obj κ') (h : κ ≤ κ') :
214+
IsCardinalPresentable J κ' where
215+
preservesColimitOfShape A _ _ := ⟨fun {F} ↦ ⟨fun {c} hc ↦ ⟨by
216+
· have := isFiltered_of_isCardinalFiltered A κ'
217+
have := IsCardinalFiltered.of_le A h
218+
replace hc := isColimitOfPreserves (forget _) hc
219+
refine Types.FilteredColimit.isColimitOf' _ _ (fun f ↦ ?_) (fun j f g h ↦ ?_)
220+
· dsimp at f
221+
choose j g hg using fun (x : J.obj) ↦ Types.jointly_surjective_of_isColimit hc (f x)
222+
let m := IsCardinalFiltered.max j hJ
223+
let φ (x : J.obj) : (F.obj m).obj := F.map (IsCardinalFiltered.toMax j hJ x) (g x)
224+
have hφ (x : J.obj) : f x = c.ι.app _ (φ x) := by
225+
dsimp [φ]
226+
rw [← hg, ← ConcreteCategory.comp_apply, c.w]
227+
rfl
228+
refine ⟨m,
229+
ObjectProperty.homMk (PartOrdEmb.ofHom
230+
{ toFun := φ
231+
inj' x y h := Hom.injective f (by simpa [hφ])
232+
map_rel_iff' {x y} := ?_ }), ?_⟩
233+
· simp [← Hom.le_iff_le f, hφ]
234+
· dsimp
235+
ext x
236+
trans c.ι.app (j x) (g x)
237+
· exact (hg x).symm
238+
· exact (ConcreteCategory.congr_hom (c.w (IsCardinalFiltered.toMax j hJ x)).symm (g x))
239+
· choose k a hk using fun (x : J.obj) ↦
240+
(Types.FilteredColimit.isColimit_eq_iff' hc _ _).1 (ConcreteCategory.congr_hom h x)
241+
dsimp at f g h k a hk ⊢
242+
obtain ⟨l, b, c, hl⟩ : ∃ (l : A) (c : j ⟶ l) (b : ∀ x, k x ⟶ l),
243+
∀ x, a x ≫ b x = c := by
244+
let φ (x : J.obj) : j ⟶ IsCardinalFiltered.max k hJ :=
245+
a x ≫ IsCardinalFiltered.toMax k hJ x
246+
exact ⟨IsCardinalFiltered.coeq φ hJ,
247+
IsCardinalFiltered.toCoeq φ hJ,
248+
fun x ↦ IsCardinalFiltered.toMax k hJ x ≫ IsCardinalFiltered.coeqHom φ hJ,
249+
fun x ↦ by simpa [φ] using IsCardinalFiltered.coeq_condition φ hJ x⟩
250+
refine ⟨l, b, ?_⟩
251+
ext x
252+
simpa only [← hl x, Functor.map_comp, ObjectProperty.FullSubcategory.comp_hom,
253+
PartOrdEmb.hom_comp, RelEmbedding.coe_trans, Function.comp_apply]
254+
using! congr_arg _ (hk x)⟩⟩⟩
255+
173256
section
174257

175258
variable (J : CardinalFilteredPoset κ)
@@ -240,8 +323,112 @@ noncomputable def isColimitCoconeWithTop : IsColimit (coconeWithTop J κ') :=
240323
| some a => exact ⟨_, propSetWithTop_pair _ a, by aesop⟩
241324
| none => exact ⟨_, propSetWithTop_pair _ (Classical.arbitrary _), by aesop⟩)
242325

326+
variable {κ'} in
327+
protected lemma isCardinalPresentable_iff (h : κ ≤ κ') :
328+
IsCardinalPresentable J κ' ↔ HasCardinalLT J.obj κ' := by
329+
refine ⟨fun _ ↦ ?_, fun hJ ↦ isCardinalPresentable_of_hasCardinalLT_of_le _ hJ h⟩
330+
obtain ⟨X, f, hf⟩ :=
331+
IsCardinalPresentable.exists_hom_of_isColimit κ' (isColimitCoconeWithTop J κ')
332+
(ObjectProperty.homMk (PartOrdEmb.ofHom WithTop.coeOrderHom))
333+
replace hf : OrderEmbedding.subtype X.1 ∘ f = WithTop.coeOrderHom := by
334+
ext x
335+
exact ConcreteCategory.congr_hom hf x
336+
refine X.2.1.of_injective f (Function.Injective.of_comp
337+
(f := OrderEmbedding.subtype X.1) ?_)
338+
dsimp at hf ⊢
339+
rw [hf]
340+
exact WithTop.coe_injective
341+
243342
end
244343

344+
protected lemma isCardinalPresentable_iff' (J : CardinalFilteredPoset κ) :
345+
IsCardinalPresentable J κ ↔ HasCardinalLT J.obj κ :=
346+
CardinalFilteredPoset.isCardinalPresentable_iff _ (le_refl _)
347+
348+
section
349+
350+
variable (J : CardinalFilteredPoset κ)
351+
352+
/-- Given `J : CardinalFilteredPoset κ`, this is the predicate
353+
on `Set J.obj` that is satisfied by subsets that are of
354+
cardinality `< κ` and have a terminal object. -/
355+
def PropSet (S : Set J.obj) : Prop :=
356+
HasCardinalLT S κ ∧ HasTerminal S
357+
358+
instance (S : Subtype J.PropSet) : HasTerminal S := S.prop.2
359+
360+
instance (S : Subtype J.PropSet) : IsCardinalFiltered S κ :=
361+
isCardinalFiltered_of_hasTerminal _ _
362+
363+
variable {J} in
364+
lemma propSet_singleton (j : J.obj) : J.PropSet {j} :=
365+
⟨hasCardinalLT_of_finite _ _ (Cardinal.IsRegular.aleph0_le Fact.out), by
366+
let : OrderTop ({j} : Set J.obj) := { top := ⟨j, rfl⟩, le_top := by simp }
367+
exact isTerminalTop.hasTerminal⟩
368+
369+
instance : IsCardinalFiltered (Subtype J.PropSet) κ :=
370+
isCardinalFiltered_preorder _ _ (fun K α hK ↦ by
371+
rw [← hasCardinalLT_iff_cardinal_mk_lt] at hK
372+
let t (k : K) : (α k).val := ⊤_ _
373+
let m := IsCardinalFiltered.max (fun k ↦ (t k).val) hK
374+
let S : Set J.obj := (⋃ (k : K), α k) ∪ {m}
375+
let : OrderTop S :=
376+
{ top := ⟨m, by simp [S]⟩
377+
le_top := by
378+
rintro ⟨s, hs⟩
379+
simp only [Set.union_singleton, Set.mem_insert_iff, Set.mem_iUnion, S] at hs
380+
obtain rfl | ⟨k, hs⟩ := hs
381+
· simp
382+
· simp only [Subtype.mk_le_mk]
383+
exact leOfHom ((by exact terminal.from (C := (α k).val) ⟨_, hs⟩) ≫
384+
IsCardinalFiltered.toMax _ hK k) }
385+
refine ⟨⟨S, ?_, isTerminalTop.hasTerminal⟩, fun k ↦ ?_⟩
386+
· have hκ : Cardinal.aleph0 ≤ κ := Cardinal.IsRegular.aleph0_le Fact.out
387+
exact hasCardinalLT_union hκ (hasCardinalLT_iUnion _ hK (fun k ↦ (α k).2.1))
388+
(hasCardinalLT_of_finite _ _ hκ)
389+
· simp only [← Subtype.coe_le_coe, Set.le_eq_subset]
390+
exact subset_trans (Set.subset_iUnion_of_subset k (subset_refl _)) Set.subset_union_left )
391+
392+
instance : IsFiltered (Subtype J.PropSet) := isFiltered_of_isCardinalFiltered _ κ
393+
394+
instance : IsDirectedOrder (Subtype J.PropSet) :=
395+
IsFiltered.isDirectedOrder _
396+
397+
instance : Nonempty (Subtype J.PropSet) :=
398+
IsFiltered.nonempty
399+
400+
/-- For any object `J : CardinalFilteredPoset κ`, this is a colimit
401+
cocone exhibiting `J` as the colimit of its subsets
402+
that are of cardinality `< κ` and have a terminal object. -/
403+
abbrev cocone : Cocone (functorOfPredicateSet J.PropSet) :=
404+
coconeOfPredicateSet J.PropSet
405+
406+
/-- Any object `J : CardinalFilteredPoset κ` is a colimit
407+
of its subsets that are of cardinality `< κ` and have a terminal object. -/
408+
noncomputable def isColimitCocone (J : CardinalFilteredPoset κ) :
409+
IsColimit (cocone J) :=
410+
isColimitCoconeOfPredicateSet _ (fun a ↦ ⟨_, propSet_singleton a, by simp⟩)
411+
412+
end
413+
414+
variable (κ) in
415+
lemma isCardinalFilteredGenerator_hasCardinalLTWithTerminal :
416+
(hasCardinalLTWithTerminal κ).IsCardinalFilteredGenerator κ where
417+
le_isCardinalPresentable := by
418+
rintro J ⟨_, _⟩
419+
rwa [isCardinalPresentable_iff, J.isCardinalPresentable_iff']
420+
exists_colimitsOfShape J :=
421+
⟨_, inferInstance, inferInstance, ⟨{
422+
diag := _
423+
ι := _
424+
isColimit := isColimitCocone J
425+
prop_diag_obj j := j.prop }⟩⟩
426+
427+
instance : IsCardinalAccessibleCategory (CardinalFilteredPoset κ) κ where
428+
exists_generator :=
429+
⟨hasCardinalLTWithTerminal κ, inferInstance,
430+
isCardinalFilteredGenerator_hasCardinalLTWithTerminal κ⟩
431+
245432
end CardinalFilteredPoset
246433

247434
end CategoryTheory

0 commit comments

Comments
 (0)