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

Commit cd98967

Browse files
committed
feat(order/category/CompleteLattice): The category of complete lattices (#12348)
Define `CompleteLattice`, the category of complete lattices with complete lattice homomorphisms.
1 parent 37885e8 commit cd98967

File tree

2 files changed

+107
-1
lines changed

2 files changed

+107
-1
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
/-
2+
Copyright (c) 2022 Yaël Dillies. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Yaël Dillies
5+
-/
6+
import order.category.BoundedLattice
7+
import order.hom.complete_lattice
8+
9+
/-!
10+
# The category of complete lattices
11+
12+
This file defines `CompleteLattice`, the category of complete lattices.
13+
-/
14+
15+
universes u
16+
17+
open category_theory
18+
19+
/-- The category of complete lattices. -/
20+
def CompleteLattice := bundled complete_lattice
21+
22+
namespace CompleteLattice
23+
24+
instance : has_coe_to_sort CompleteLattice Type* := bundled.has_coe_to_sort
25+
instance (X : CompleteLattice) : complete_lattice X := X.str
26+
27+
/-- Construct a bundled `CompleteLattice` from a `complete_lattice`. -/
28+
def of (α : Type*) [complete_lattice α] : CompleteLattice := bundled.of α
29+
30+
instance : inhabited CompleteLattice := ⟨of punit⟩
31+
32+
instance : bundled_hom @complete_lattice_hom :=
33+
{ to_fun := λ _ _ _ _, coe_fn,
34+
id := @complete_lattice_hom.id,
35+
comp := @complete_lattice_hom.comp,
36+
hom_ext := λ X Y _ _, by exactI fun_like.coe_injective }
37+
instance : large_category.{u} CompleteLattice := bundled_hom.category complete_lattice_hom
38+
instance : concrete_category CompleteLattice := bundled_hom.concrete_category complete_lattice_hom
39+
40+
instance has_forget_to_BoundedLattice : has_forget₂ CompleteLattice BoundedLattice :=
41+
{ forget₂ := { obj := λ X, BoundedLattice.of X,
42+
map := λ X Y, complete_lattice_hom.to_bounded_lattice_hom },
43+
forget_comp := rfl }
44+
45+
/-- Constructs an isomorphism of complete lattices from an order isomorphism between them. -/
46+
@[simps] def iso.mk {α β : CompleteLattice.{u}} (e : α ≃o β) : α ≅ β :=
47+
{ hom := e,
48+
inv := e.symm,
49+
hom_inv_id' := by { ext, exact e.symm_apply_apply _ },
50+
inv_hom_id' := by { ext, exact e.apply_symm_apply _ } }
51+
52+
/-- `order_dual` as a functor. -/
53+
@[simps] def dual : CompleteLattice ⥤ CompleteLattice :=
54+
{ obj := λ X, of (order_dual X), map := λ X Y, complete_lattice_hom.dual }
55+
56+
/-- The equivalence between `CompleteLattice` and itself induced by `order_dual` both ways. -/
57+
@[simps functor inverse] def dual_equiv : CompleteLattice ≌ CompleteLattice :=
58+
equivalence.mk dual dual
59+
(nat_iso.of_components (λ X, iso.mk $ order_iso.dual_dual X) $ λ X Y f, rfl)
60+
(nat_iso.of_components (λ X, iso.mk $ order_iso.dual_dual X) $ λ X Y f, rfl)
61+
62+
end CompleteLattice
63+
64+
lemma CompleteLattice_dual_comp_forget_to_BoundedLattice :
65+
CompleteLattice.dual ⋙ forget₂ CompleteLattice BoundedLattice =
66+
forget₂ CompleteLattice BoundedLattice ⋙ BoundedLattice.dual := rfl

src/order/hom/complete_lattice.lean

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ be satisfied by itself and all stricter types.
2929
* `complete_lattice_hom_class`
3030
-/
3131

32-
open function
32+
open function order_dual
3333

3434
variables {F α β γ δ : Type*} {ι : Sort*} {κ : ι → Sort*}
3535

@@ -149,6 +149,13 @@ instance complete_lattice_hom_class.to_bounded_lattice_hom_class [complete_latti
149149
bounded_lattice_hom_class F α β :=
150150
{ ..Sup_hom_class.to_bot_hom_class, ..Inf_hom_class.to_top_hom_class }
151151

152+
@[priority 100] -- See note [lower instance priority]
153+
instance order_iso.complete_lattice_hom_class [complete_lattice α] [complete_lattice β] :
154+
complete_lattice_hom_class (α ≃o β) α β :=
155+
{ map_Sup := λ f s, (f.map_Sup s).trans Sup_image.symm,
156+
map_Inf := λ f s, (f.map_Inf s).trans Inf_image.symm,
157+
..rel_iso.rel_hom_class }
158+
152159
instance [has_Sup α] [has_Sup β] [Sup_hom_class F α β] : has_coe_t F (Sup_hom α β) :=
153160
⟨λ f, ⟨f, map_Sup f⟩⟩
154161

@@ -325,6 +332,26 @@ instance : order_top (Inf_hom α β) := ⟨⊤, λ f a, le_top⟩
325332

326333
end Inf_hom
327334

335+
/-- Reinterpret a `⨆`-homomorphism as an `⨅`-homomorphism between the dual orders. -/
336+
@[simps] protected def Sup_hom.dual [has_Sup α] [has_Sup β] :
337+
Sup_hom α β ≃ Inf_hom (order_dual α) (order_dual β) :=
338+
{ to_fun := λ f, { to_fun := to_dual ∘ f ∘ of_dual,
339+
map_Inf' := λ _, congr_arg to_dual (map_Sup f _) },
340+
inv_fun := λ f, { to_fun := of_dual ∘ f ∘ to_dual,
341+
map_Sup' := λ _, congr_arg of_dual (map_Inf f _) },
342+
left_inv := λ f, Sup_hom.ext $ λ a, rfl,
343+
right_inv := λ f, Inf_hom.ext $ λ a, rfl }
344+
345+
/-- Reinterpret an `⨅`-homomorphism as a `⨆`-homomorphism between the dual orders. -/
346+
@[simps] protected def Inf_hom.dual [has_Inf α] [has_Inf β] :
347+
Inf_hom α β ≃ Sup_hom (order_dual α) (order_dual β) :=
348+
{ to_fun := λ f, { to_fun := to_dual ∘ f ∘ of_dual,
349+
map_Sup' := λ _, congr_arg to_dual (map_Inf f _) },
350+
inv_fun := λ f, { to_fun := of_dual ∘ f ∘ to_dual,
351+
map_Inf' := λ _, congr_arg of_dual (map_Sup f _) },
352+
left_inv := λ f, Inf_hom.ext $ λ a, rfl,
353+
right_inv := λ f, Sup_hom.ext $ λ a, rfl }
354+
328355
/-! ### Frame homomorphisms -/
329356

330357
namespace frame_hom
@@ -413,6 +440,9 @@ instance : complete_lattice_hom_class (complete_lattice_hom α β) α β :=
413440
map_Sup := λ f, f.map_Sup',
414441
map_Inf := λ f, f.map_Inf' }
415442

443+
/-- Reinterpret a `complete_lattice_hom` as a `bounded_lattice_hom`. -/
444+
def to_bounded_lattice_hom (f : complete_lattice_hom α β) : bounded_lattice_hom α β := f
445+
416446
/-- Helper instance for when there's too many metavariables to apply `fun_like.has_coe_to_fun`
417447
directly. -/
418448
instance : has_coe_to_fun (complete_lattice_hom α β) (λ _, α → β) := ⟨λ f, f.to_fun⟩
@@ -466,4 +496,14 @@ lemma cancel_left {g : complete_lattice_hom β γ} {f₁ f₂ : complete_lattice
466496
g.comp f₁ = g.comp f₂ ↔ f₁ = f₂ :=
467497
⟨λ h, ext $ λ a, hg $ by rw [←comp_apply, h, comp_apply], congr_arg _⟩
468498

499+
/-- Reinterpret a lattice homomorphism as a lattice homomorphism between the dual lattices. -/
500+
@[simps] protected def dual :
501+
complete_lattice_hom α β ≃ complete_lattice_hom (order_dual α) (order_dual β) :=
502+
{ to_fun := λ f, { to_Sup_hom := f.to_Inf_hom.dual,
503+
map_Inf' := λ _, congr_arg to_dual (map_Sup f _) },
504+
inv_fun := λ f, { to_Sup_hom := f.to_Inf_hom.dual,
505+
map_Inf' := λ _, congr_arg of_dual (map_Sup f _) },
506+
left_inv := λ f, ext $ λ a, rfl,
507+
right_inv := λ f, ext $ λ a, rfl }
508+
469509
end complete_lattice_hom

0 commit comments

Comments
 (0)