|
| 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.BddOrd |
| 7 | +import order.category.Lat |
| 8 | +import order.category.Semilat |
| 9 | + |
| 10 | +/-! |
| 11 | +# The category of bounded lattices |
| 12 | +
|
| 13 | +This file defines `BddLat`, the category of bounded lattices. |
| 14 | +
|
| 15 | +In literature, this is sometimes called `Lat`, the category of lattices, because being a lattice is |
| 16 | +understood to entail having a bottom and a top element. |
| 17 | +-/ |
| 18 | + |
| 19 | +universes u |
| 20 | + |
| 21 | +open category_theory |
| 22 | + |
| 23 | +/-- The category of bounded lattices with bounded lattice morphisms. -/ |
| 24 | +structure BddLat := |
| 25 | +(to_Lat : Lat) |
| 26 | +[is_bounded_order : bounded_order to_Lat] |
| 27 | + |
| 28 | +namespace BddLat |
| 29 | + |
| 30 | +instance : has_coe_to_sort BddLat Type* := ⟨λ X, X.to_Lat⟩ |
| 31 | +instance (X : BddLat) : lattice X := X.to_Lat.str |
| 32 | + |
| 33 | +attribute [instance] BddLat.is_bounded_order |
| 34 | + |
| 35 | +/-- Construct a bundled `BddLat` from `lattice` + `bounded_order`. -/ |
| 36 | +def of (α : Type*) [lattice α] [bounded_order α] : BddLat := ⟨⟨α⟩⟩ |
| 37 | + |
| 38 | +@[simp] lemma coe_of (α : Type*) [lattice α] [bounded_order α] : ↥(of α) = α := rfl |
| 39 | + |
| 40 | +instance : inhabited BddLat := ⟨of punit⟩ |
| 41 | + |
| 42 | +instance : large_category.{u} BddLat := |
| 43 | +{ hom := λ X Y, bounded_lattice_hom X Y, |
| 44 | + id := λ X, bounded_lattice_hom.id X, |
| 45 | + comp := λ X Y Z f g, g.comp f, |
| 46 | + id_comp' := λ X Y, bounded_lattice_hom.comp_id, |
| 47 | + comp_id' := λ X Y, bounded_lattice_hom.id_comp, |
| 48 | + assoc' := λ W X Y Z _ _ _, bounded_lattice_hom.comp_assoc _ _ _ } |
| 49 | + |
| 50 | +instance : concrete_category BddLat := |
| 51 | +{ forget := ⟨coe_sort, λ X Y, coe_fn, λ X, rfl, λ X Y Z f g, rfl⟩, |
| 52 | + forget_faithful := ⟨λ X Y, by convert fun_like.coe_injective⟩ } |
| 53 | + |
| 54 | +instance has_forget_to_BddOrd : has_forget₂ BddLat BddOrd := |
| 55 | +{ forget₂ := { obj := λ X, BddOrd.of X, |
| 56 | + map := λ X Y, bounded_lattice_hom.to_bounded_order_hom } } |
| 57 | + |
| 58 | +instance has_forget_to_Lat : has_forget₂ BddLat Lat := |
| 59 | +{ forget₂ := { obj := λ X, ⟨X⟩, map := λ X Y, bounded_lattice_hom.to_lattice_hom } } |
| 60 | + |
| 61 | +instance has_forget_to_SemilatSup : has_forget₂ BddLat SemilatSup := |
| 62 | +{ forget₂ := { obj := λ X, ⟨X⟩, map := λ X Y, bounded_lattice_hom.to_sup_bot_hom } } |
| 63 | + |
| 64 | +instance has_forget_to_SemilatInf : has_forget₂ BddLat SemilatInf := |
| 65 | +{ forget₂ := { obj := λ X, ⟨X⟩, map := λ X Y, bounded_lattice_hom.to_inf_top_hom } } |
| 66 | + |
| 67 | +@[simp] lemma coe_forget_to_BddOrd (X : BddLat) : |
| 68 | + ↥((forget₂ BddLat BddOrd).obj X) = ↥X := rfl |
| 69 | + |
| 70 | +@[simp] lemma coe_forget_to_Lat (X : BddLat) : |
| 71 | + ↥((forget₂ BddLat Lat).obj X) = ↥X := rfl |
| 72 | + |
| 73 | +@[simp] lemma coe_forget_to_SemilatSup (X : BddLat) : |
| 74 | + ↥((forget₂ BddLat SemilatSup).obj X) = ↥X := rfl |
| 75 | + |
| 76 | +@[simp] lemma coe_forget_to_SemilatInf (X : BddLat) : |
| 77 | + ↥((forget₂ BddLat SemilatInf).obj X) = ↥X := rfl |
| 78 | + |
| 79 | +lemma forget_Lat_PartOrd_eq_forget_BddOrd_PartOrd : |
| 80 | + forget₂ BddLat Lat ⋙ forget₂ Lat PartOrd = |
| 81 | + forget₂ BddLat BddOrd ⋙ forget₂ BddOrd PartOrd := rfl |
| 82 | + |
| 83 | +lemma forget_SemilatSup_PartOrd_eq_forget_BddOrd_PartOrd : |
| 84 | + forget₂ BddLat SemilatSup ⋙ forget₂ SemilatSup PartOrd = |
| 85 | + forget₂ BddLat BddOrd ⋙ forget₂ BddOrd PartOrd := rfl |
| 86 | + |
| 87 | +lemma forget_SemilatInf_PartOrd_eq_forget_BddOrd_PartOrd : |
| 88 | + forget₂ BddLat SemilatInf ⋙ forget₂ SemilatInf PartOrd = |
| 89 | + forget₂ BddLat BddOrd ⋙ forget₂ BddOrd PartOrd := rfl |
| 90 | + |
| 91 | +/-- Constructs an equivalence between bounded lattices from an order isomorphism |
| 92 | +between them. -/ |
| 93 | +@[simps] def iso.mk {α β : BddLat.{u}} (e : α ≃o β) : α ≅ β := |
| 94 | +{ hom := e, |
| 95 | + inv := e.symm, |
| 96 | + hom_inv_id' := by { ext, exact e.symm_apply_apply _ }, |
| 97 | + inv_hom_id' := by { ext, exact e.apply_symm_apply _ } } |
| 98 | + |
| 99 | +/-- `order_dual` as a functor. -/ |
| 100 | +@[simps] def dual : BddLat ⥤ BddLat := |
| 101 | +{ obj := λ X, of Xᵒᵈ, map := λ X Y, bounded_lattice_hom.dual } |
| 102 | + |
| 103 | +/-- The equivalence between `BddLat` and itself induced by `order_dual` both ways. -/ |
| 104 | +@[simps functor inverse] def dual_equiv : BddLat ≌ BddLat := |
| 105 | +equivalence.mk dual dual |
| 106 | + (nat_iso.of_components (λ X, iso.mk $ order_iso.dual_dual X) $ λ X Y f, rfl) |
| 107 | + (nat_iso.of_components (λ X, iso.mk $ order_iso.dual_dual X) $ λ X Y f, rfl) |
| 108 | + |
| 109 | +end BddLat |
| 110 | + |
| 111 | +lemma BddLat_dual_comp_forget_to_BddOrd : |
| 112 | + BddLat.dual ⋙ forget₂ BddLat BddOrd = |
| 113 | + forget₂ BddLat BddOrd ⋙ BddOrd.dual := rfl |
| 114 | + |
| 115 | +lemma BddLat_dual_comp_forget_to_Lat : |
| 116 | + BddLat.dual ⋙ forget₂ BddLat Lat = |
| 117 | + forget₂ BddLat Lat ⋙ Lat.dual := rfl |
| 118 | + |
| 119 | +lemma BddLat_dual_comp_forget_to_SemilatSup : |
| 120 | + BddLat.dual ⋙ forget₂ BddLat SemilatSup = |
| 121 | + forget₂ BddLat SemilatInf ⋙ SemilatInf.dual := rfl |
| 122 | + |
| 123 | +lemma BddLat_dual_comp_forget_to_SemilatInf : |
| 124 | + BddLat.dual ⋙ forget₂ BddLat SemilatInf = |
| 125 | + forget₂ BddLat SemilatSup ⋙ SemilatSup.dual := rfl |
0 commit comments