Lean4
/-- The category of commutative algebras over a commutative ring `R` is the same as commutative
rings under `R`. -/
@[simps]
def commAlgCatEquivUnder (R : CommRingCat) : CommAlgCat R ≌ Under R
where
functor.obj A := R.mkUnder A
functor.map {A B} f := f.hom.toUnder
inverse.obj A := .of _ A
inverse.map {A B} f := CommAlgCat.ofHom <| CommRingCat.toAlgHom f
unitIso := NatIso.ofComponents fun A ↦ CommAlgCat.isoMk { toRingEquiv := .refl A, commutes' _ := rfl }
counitIso :=
.refl
_
-- TODO: Generalize to `UnivLE.{u, v}` once `commAlgCatEquivUnder` is generalized.