|
| 1 | +/- |
| 2 | +Copyright (c) 2024 Amelia Livingston. All rights reserved. |
| 3 | +Released under Apache 2.0 license as described in the file LICENSE. |
| 4 | +Authors: Amelia Livingston |
| 5 | +-/ |
| 6 | +import Mathlib.Algebra.Category.BialgebraCat.Basic |
| 7 | +import Mathlib.RingTheory.HopfAlgebra |
| 8 | + |
| 9 | +/-! |
| 10 | +# The category of Hopf algebras over a commutative ring |
| 11 | +
|
| 12 | +We introduce the bundled category `HopfAlgebraCat` of Hopf algebras over a fixed commutative ring |
| 13 | +`R` along with the forgetful functor to `BialgebraCat`. |
| 14 | +
|
| 15 | +This file mimics `Mathlib.LinearAlgebra.QuadraticForm.QuadraticModuleCat`. |
| 16 | +
|
| 17 | +-/ |
| 18 | + |
| 19 | +open CategoryTheory |
| 20 | + |
| 21 | +universe v u |
| 22 | + |
| 23 | +variable (R : Type u) [CommRing R] |
| 24 | + |
| 25 | +/-- The category of `R`-Hopf algebras. -/ |
| 26 | +structure HopfAlgebraCat extends Bundled Ring.{v} where |
| 27 | + [instHopfAlgebra : HopfAlgebra R α] |
| 28 | + |
| 29 | +attribute [instance] HopfAlgebraCat.instHopfAlgebra |
| 30 | + |
| 31 | +variable {R} |
| 32 | + |
| 33 | +namespace HopfAlgebraCat |
| 34 | + |
| 35 | +open HopfAlgebra |
| 36 | + |
| 37 | +instance : CoeSort (HopfAlgebraCat.{v} R) (Type v) := |
| 38 | + ⟨(·.α)⟩ |
| 39 | + |
| 40 | +variable (R) |
| 41 | + |
| 42 | +/-- The object in the category of `R`-Hopf algebras associated to an `R`-Hopf algebra. -/ |
| 43 | +@[simps] |
| 44 | +def of (X : Type v) [Ring X] [HopfAlgebra R X] : |
| 45 | + HopfAlgebraCat R where |
| 46 | + instHopfAlgebra := (inferInstance : HopfAlgebra R X) |
| 47 | + |
| 48 | +variable {R} |
| 49 | + |
| 50 | +@[simp] |
| 51 | +lemma of_comul {X : Type v} [Ring X] [HopfAlgebra R X] : |
| 52 | + Coalgebra.comul (A := of R X) = Coalgebra.comul (R := R) (A := X) := rfl |
| 53 | + |
| 54 | +@[simp] |
| 55 | +lemma of_counit {X : Type v} [Ring X] [HopfAlgebra R X] : |
| 56 | + Coalgebra.counit (A := of R X) = Coalgebra.counit (R := R) (A := X) := rfl |
| 57 | + |
| 58 | +/-- A type alias for `BialgHom` to avoid confusion between the categorical and |
| 59 | +algebraic spellings of composition. -/ |
| 60 | +@[ext] |
| 61 | +structure Hom (V W : HopfAlgebraCat.{v} R) := |
| 62 | + /-- The underlying `BialgHom`. -/ |
| 63 | + toBialgHom : V →ₐc[R] W |
| 64 | + |
| 65 | +lemma Hom.toBialgHom_injective (V W : HopfAlgebraCat.{v} R) : |
| 66 | + Function.Injective (Hom.toBialgHom : Hom V W → _) := |
| 67 | + fun ⟨f⟩ ⟨g⟩ _ => by congr |
| 68 | + |
| 69 | +instance category : Category (HopfAlgebraCat.{v} R) where |
| 70 | + Hom X Y := Hom X Y |
| 71 | + id X := ⟨BialgHom.id R X⟩ |
| 72 | + comp f g := ⟨BialgHom.comp g.toBialgHom f.toBialgHom⟩ |
| 73 | + |
| 74 | +-- TODO: if `Quiver.Hom` and the instance above were `reducible`, this wouldn't be needed. |
| 75 | +@[ext] |
| 76 | +lemma hom_ext {X Y : HopfAlgebraCat.{v} R} (f g : X ⟶ Y) (h : f.toBialgHom = g.toBialgHom) : |
| 77 | + f = g := |
| 78 | + Hom.ext _ _ h |
| 79 | + |
| 80 | +/-- Typecheck a `BialgHom` as a morphism in `HopfAlgebraCat R`. -/ |
| 81 | +abbrev ofHom {X Y : Type v} [Ring X] [Ring Y] |
| 82 | + [HopfAlgebra R X] [HopfAlgebra R Y] (f : X →ₐc[R] Y) : |
| 83 | + of R X ⟶ of R Y := |
| 84 | + ⟨f⟩ |
| 85 | + |
| 86 | +@[simp] theorem toBialgHom_comp {X Y Z : HopfAlgebraCat.{v} R} (f : X ⟶ Y) (g : Y ⟶ Z) : |
| 87 | + (f ≫ g).toBialgHom = g.toBialgHom.comp f.toBialgHom := |
| 88 | + rfl |
| 89 | + |
| 90 | +@[simp] theorem toBialgHom_id {M : HopfAlgebraCat.{v} R} : |
| 91 | + Hom.toBialgHom (𝟙 M) = BialgHom.id _ _ := |
| 92 | + rfl |
| 93 | + |
| 94 | +instance concreteCategory : ConcreteCategory.{v} (HopfAlgebraCat.{v} R) where |
| 95 | + forget := |
| 96 | + { obj := fun M => M |
| 97 | + map := fun f => f.toBialgHom } |
| 98 | + forget_faithful := |
| 99 | + { map_injective := fun {M N} => DFunLike.coe_injective.comp <| Hom.toBialgHom_injective _ _ } |
| 100 | + |
| 101 | +instance hasForgetToBialgebra : HasForget₂ (HopfAlgebraCat R) (BialgebraCat R) where |
| 102 | + forget₂ := |
| 103 | + { obj := fun X => BialgebraCat.of R X |
| 104 | + map := fun {X Y} f => BialgebraCat.ofHom f.toBialgHom } |
| 105 | + |
| 106 | +@[simp] |
| 107 | +theorem forget₂_bialgebra_obj (X : HopfAlgebraCat R) : |
| 108 | + (forget₂ (HopfAlgebraCat R) (BialgebraCat R)).obj X = BialgebraCat.of R X := |
| 109 | + rfl |
| 110 | + |
| 111 | +@[simp] |
| 112 | +theorem forget₂_bialgebra_map (X Y : HopfAlgebraCat R) (f : X ⟶ Y) : |
| 113 | + (forget₂ (HopfAlgebraCat R) (BialgebraCat R)).map f = BialgebraCat.ofHom f.toBialgHom := |
| 114 | + rfl |
| 115 | + |
| 116 | +end HopfAlgebraCat |
| 117 | + |
| 118 | +namespace BialgEquiv |
| 119 | + |
| 120 | +open HopfAlgebraCat |
| 121 | + |
| 122 | +variable {X Y Z : Type v} |
| 123 | +variable [Ring X] [Ring Y] [Ring Z] |
| 124 | +variable [HopfAlgebra R X] [HopfAlgebra R Y] [HopfAlgebra R Z] |
| 125 | + |
| 126 | +/-- Build an isomorphism in the category `HopfAlgebraCat R` from a |
| 127 | +`BialgEquiv`. -/ |
| 128 | +@[simps] |
| 129 | +def toHopfAlgebraCatIso (e : X ≃ₐc[R] Y) : HopfAlgebraCat.of R X ≅ HopfAlgebraCat.of R Y where |
| 130 | + hom := HopfAlgebraCat.ofHom e |
| 131 | + inv := HopfAlgebraCat.ofHom e.symm |
| 132 | + hom_inv_id := Hom.ext _ _ <| DFunLike.ext _ _ e.left_inv |
| 133 | + inv_hom_id := Hom.ext _ _ <| DFunLike.ext _ _ e.right_inv |
| 134 | + |
| 135 | +@[simp] theorem toHopfAlgebraCatIso_refl : |
| 136 | + toHopfAlgebraCatIso (BialgEquiv.refl R X) = .refl _ := |
| 137 | + rfl |
| 138 | + |
| 139 | +@[simp] theorem toHopfAlgebraCatIso_symm (e : X ≃ₐc[R] Y) : |
| 140 | + toHopfAlgebraCatIso e.symm = (toHopfAlgebraCatIso e).symm := |
| 141 | + rfl |
| 142 | + |
| 143 | +@[simp] theorem toHopfAlgebraCatIso_trans (e : X ≃ₐc[R] Y) (f : Y ≃ₐc[R] Z) : |
| 144 | + toHopfAlgebraCatIso (e.trans f) = toHopfAlgebraCatIso e ≪≫ toHopfAlgebraCatIso f := |
| 145 | + rfl |
| 146 | + |
| 147 | +end BialgEquiv |
| 148 | + |
| 149 | +namespace CategoryTheory.Iso |
| 150 | + |
| 151 | +open HopfAlgebra |
| 152 | + |
| 153 | +variable {X Y Z : HopfAlgebraCat.{v} R} |
| 154 | + |
| 155 | +/-- Build a `BialgEquiv` from an isomorphism in the category |
| 156 | +`HopfAlgebraCat R`. -/ |
| 157 | +def toHopfAlgEquiv (i : X ≅ Y) : X ≃ₐc[R] Y := |
| 158 | + { i.hom.toBialgHom with |
| 159 | + invFun := i.inv.toBialgHom |
| 160 | + left_inv := fun x => BialgHom.congr_fun (congr_arg HopfAlgebraCat.Hom.toBialgHom i.3) x |
| 161 | + right_inv := fun x => BialgHom.congr_fun (congr_arg HopfAlgebraCat.Hom.toBialgHom i.4) x } |
| 162 | + |
| 163 | +@[simp] theorem toHopfAlgEquiv_toBialgHom (i : X ≅ Y) : |
| 164 | + (i.toHopfAlgEquiv : X →ₐc[R] Y) = i.hom.1 := rfl |
| 165 | + |
| 166 | +@[simp] theorem toHopfAlgEquiv_refl : toHopfAlgEquiv (.refl X) = .refl _ _ := |
| 167 | + rfl |
| 168 | + |
| 169 | +@[simp] theorem toHopfAlgEquiv_symm (e : X ≅ Y) : |
| 170 | + toHopfAlgEquiv e.symm = (toHopfAlgEquiv e).symm := |
| 171 | + rfl |
| 172 | + |
| 173 | +@[simp] theorem toHopfAlgEquiv_trans (e : X ≅ Y) (f : Y ≅ Z) : |
| 174 | + toHopfAlgEquiv (e ≪≫ f) = e.toHopfAlgEquiv.trans f.toHopfAlgEquiv := |
| 175 | + rfl |
| 176 | + |
| 177 | +end CategoryTheory.Iso |
| 178 | + |
| 179 | +instance HopfAlgebraCat.forget_reflects_isos : |
| 180 | + (forget (HopfAlgebraCat.{v} R)).ReflectsIsomorphisms where |
| 181 | + reflects {X Y} f _ := by |
| 182 | + let i := asIso ((forget (HopfAlgebraCat.{v} R)).map f) |
| 183 | + let e : X ≃ₐc[R] Y := { f.toBialgHom, i.toEquiv with } |
| 184 | + exact ⟨e.toHopfAlgebraCatIso.isIso_hom.1⟩ |
0 commit comments