Advertisement
Guest User

Untitled

a guest
Sep 1st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 3.07 KB | None | 0 0
  1. From 8b1fd0f4dffc46e27d13c13d1970f8487cc5007a Mon Sep 17 00:00:00 2001
  2. From: hoteluser <hoteluser@room-835.local>
  3. Date: Sat, 1 Sep 2018 22:53:40 +0200
  4. Subject: [PATCH] (co)limits in Type u; small & filtered categories
  5.  
  6. ---
  7. src/category_theory/small.lean           | 24 +++++++++++++++++++++++
  8.  src/category_theory/universal/types.lean | 33 ++++++++++++++++++++++++++++++++
  9.  2 files changed, 57 insertions(+)
  10.  create mode 100644 src/category_theory/small.lean
  11.  
  12. diff --git a/src/category_theory/small.lean b/src/category_theory/small.lean
  13. new file mode 100644
  14. index 0000000..3d29256
  15. --- /dev/null
  16. +++ b/src/category_theory/small.lean
  17. @@ -0,0 +1,24 @@
  18. +/- Categories which are small relative to a cardinal κ.
  19. +   κ-filtered categories.
  20. +   Normally we care about these concepts for categories which are
  21. +   used to index (co)limits, so we work with small_categories. -/
  22. +
  23. +import category_theory.category
  24. +import category_theory.functor
  25. +import category_theory.universal.colimits -- for cocone
  26. +import set_theory.cardinal
  27. +
  28. +universe u
  29. +
  30. +namespace category_theory
  31. +
  32. +variables (κ : cardinal.{u})
  33. +
  34. +def is_kappa_small (I : Type u) [small_category.{u} I] : Prop :=
  35. +cardinal.mk (Σ (a b : I), a ⟶ b) < κ
  36. +
  37. +structure kappa_filtered (C : Type u) [small_category.{u} C] : Prop :=
  38. +(has_cocones : ∀ (I : Type u) [small_category.{u} I] (hI : is_kappa_small κ I) (F : I ↝ C),
  39. +  nonempty (universal.cocone F))
  40. +
  41. +end category_theory
  42. diff --git a/src/category_theory/universal/types.lean b/src/category_theory/universal/types.lean
  43. index ba8791d..db84ecd 100644
  44. --- a/src/category_theory/universal/types.lean
  45. +++ b/src/category_theory/universal/types.lean
  46. @@ -1,3 +1,4 @@
  47. +import category_theory.functor
  48.  import .limits
  49.  import .colimits
  50.  
  51. @@ -43,6 +44,38 @@ instance : has_coequalizers.{u+1 u} (Type u) :=
  52.      end,
  53.    is_coequalizer := sorry }
  54.  
  55. +namespace types
  56. +open category_theory
  57. +
  58. +variables {J : Type u} [𝒥 : small_category J]
  59. +include 𝒥
  60. +
  61. +def limit (F : J ↝ Type u) : cone F :=
  62. +{ X := {u : Π j, F j // ∀ (j j' : J) (f : j ⟶ j'), F.map f (u j) = u j'},
  63. +  π := λ j u, u.val j }
  64. +
  65. +def limit_is_limit (F : J ↝ Type u) : is_limit (limit F) :=
  66. +{ lift := λ s v, ⟨λ j, s.π j v, λ j j' f, congr_fun (s.w f) _⟩ }
  67. +
  68. +instance : has_limits.{u+1 u} (Type u) :=
  69. +{ limit := @limit, is_limit := @limit_is_limit }
  70. +
  71. +def colimit (F : J ↝ Type u) : cocone F :=
  72. +{ X := @quot (Σ j, F j) (λ p p', ∃ f : p.1 ⟶ p'.1, p'.2 = F.map f p.2),
  73. +  ι := λ j x, quot.mk _ ⟨j, x⟩,
  74. +  w := λ j j' f, funext $ λ x, eq.symm (quot.sound ⟨f, rfl⟩) }
  75. +
  76. +local attribute [elab_with_expected_type] quot.lift
  77. +def colimit_is_colimit (F : J ↝ Type u) : is_colimit (colimit F) :=
  78. +{ desc := λ s, quot.lift (λ (p : Σ j, F j), s.ι p.1 p.2)
  79. +    (assume ⟨j, x⟩ ⟨j', x'⟩ ⟨f, hf⟩,
  80. +      by rw hf; exact (congr_fun (s.w f) x).symm) }
  81. +
  82. +instance : has_colimits.{u+1 u} (Type u) :=
  83. +{ colimit := @colimit, is_colimit := @colimit_is_colimit }
  84. +
  85. +end types
  86. +
  87.  end category_theory.universal
  88.  
  89.  
  90. --
  91. 2.5.4 (Apple Git-61)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement