Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 4a8c38e

Browse files
committed
chore(category_theory/limits/lattice): cleanup (#4191)
Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
1 parent cd4a91f commit 4a8c38e

File tree

1 file changed

+57
-19
lines changed

1 file changed

+57
-19
lines changed

src/category_theory/limits/lattice.lean

Lines changed: 57 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ import order.complete_lattice
99
universes u
1010

1111
open category_theory
12+
open category_theory.limits
1213

13-
namespace category_theory.limits
14+
namespace category_theory.limits.complete_lattice
1415

1516
variables {α : Type u}
1617

@@ -34,30 +35,67 @@ instance has_finite_colimits_of_semilattice_sup_bot [semilattice_sup_bot α] :
3435
ι := { app := λ i, hom_of_le (finset.le_sup (fintype.complete _)) } },
3536
is_colimit := { desc := λ s, hom_of_le (finset.sup_le (λ j _, (s.ι.app j).down.down)) } } }
3637

38+
variables {J : Type u} [small_category J]
39+
40+
/--
41+
The limit cone over any functor into a complete lattice.
42+
-/
43+
def limit_cone [complete_lattice α] (F : J ⥤ α) : limit_cone F :=
44+
{ cone :=
45+
{ X := infi F.obj,
46+
π :=
47+
{ app := λ j, hom_of_le (complete_lattice.Inf_le _ _ (set.mem_range_self _)) } },
48+
is_limit :=
49+
{ lift := λ s, hom_of_le (complete_lattice.le_Inf _ _
50+
begin rintros _ ⟨j, rfl⟩, exact le_of_hom (s.π.app j), end) } }
51+
52+
/--
53+
The colimit cocone over any functor into a complete lattice.
54+
-/
55+
def colimit_cocone [complete_lattice α] (F : J ⥤ α) : colimit_cocone F :=
56+
{ cocone :=
57+
{ X := supr F.obj,
58+
ι :=
59+
{ app := λ j, hom_of_le (complete_lattice.le_Sup _ _ (set.mem_range_self _)) } },
60+
is_colimit :=
61+
{ desc := λ s, hom_of_le (complete_lattice.Sup_le _ _
62+
begin rintros _ ⟨j, rfl⟩, exact le_of_hom (s.ι.app j), end) } }
63+
3764
-- It would be nice to only use the `Inf` half of the complete lattice, but
3865
-- this seems not to have been described separately.
3966
@[priority 100] -- see Note [lower instance priority]
4067
instance has_limits_of_complete_lattice [complete_lattice α] : has_limits α :=
4168
{ has_limits_of_shape := λ J 𝒥, by exactI
42-
{ has_limit := λ F, has_limit.mk
43-
{ cone :=
44-
{ X := Inf (set.range F.obj),
45-
π :=
46-
{ app := λ j, hom_of_le (complete_lattice.Inf_le _ _ (set.mem_range_self _)) } },
47-
is_limit :=
48-
{ lift := λ s, hom_of_le (complete_lattice.le_Inf _ _
49-
begin rintros _ ⟨j, rfl⟩, exact le_of_hom (s.π.app j), end) } } } }
69+
{ has_limit := λ F, has_limit.mk (limit_cone F) } }
5070

5171
@[priority 100] -- see Note [lower instance priority]
5272
instance has_colimits_of_complete_lattice [complete_lattice α] : has_colimits α :=
5373
{ has_colimits_of_shape := λ J 𝒥, by exactI
54-
{ has_colimit := λ F, has_colimit.mk
55-
{ cocone :=
56-
{ X := Sup (set.range F.obj),
57-
ι :=
58-
{ app := λ j, hom_of_le (complete_lattice.le_Sup _ _ (set.mem_range_self _)) } },
59-
is_colimit :=
60-
{ desc := λ s, hom_of_le (complete_lattice.Sup_le _ _
61-
begin rintros _ ⟨j, rfl⟩, exact le_of_hom (s.ι.app j), end) } } } }
62-
63-
end category_theory.limits
74+
{ has_colimit := λ F, has_colimit.mk (colimit_cocone F) } }
75+
76+
noncomputable theory
77+
variables [complete_lattice α] (F : J ⥤ α)
78+
79+
/--
80+
The limit of a functor into a complete lattice is the infimum of the objects in the image.
81+
-/
82+
def limit_iso_infi : limit F ≅ infi F.obj :=
83+
is_limit.cone_point_unique_up_to_iso (limit.is_limit F) (limit_cone F).is_limit
84+
85+
@[simp] lemma limit_iso_infi_hom (j : J) :
86+
(limit_iso_infi F).hom ≫ hom_of_le (infi_le _ j) = limit.π F j := by tidy
87+
@[simp] lemma limit_iso_infi_inv (j : J) :
88+
(limit_iso_infi F).inv ≫ limit.π F j = hom_of_le (infi_le _ j) := rfl
89+
90+
/--
91+
The colimit of a functor into a complete lattice is the supremum of the objects in the image.
92+
-/
93+
def colimit_iso_supr : colimit F ≅ supr F.obj :=
94+
is_colimit.cocone_point_unique_up_to_iso (colimit.is_colimit F) (colimit_cocone F).is_colimit
95+
96+
@[simp] lemma colimit_iso_supr_hom (j : J) :
97+
colimit.ι F j ≫ (colimit_iso_supr F).hom = hom_of_le (le_supr _ j) := rfl
98+
@[simp] lemma colimit_iso_supr_inv (j : J) :
99+
hom_of_le (le_supr _ j) ≫ (colimit_iso_supr F).inv = colimit.ι F j := by tidy
100+
101+
end category_theory.limits.complete_lattice

0 commit comments

Comments
 (0)