Zulip Chat Archive

Stream: Is there code for X?

Topic: Moving a CategoryTheory.Equivalence across a Hom


Eric Wieser (Sep 15 2023 at 22:15):

Do we have something like

def Equivalence.homEquiv {C D : Type u} [Category.{v, u} C] [Category.{v, u} D]
    (e : C  D) (c : C) (d : D) :
    (e.functor.obj c  d)  (c  e.inverse.obj d) where
  toFun fd := e.unit.app _  e.inverse.map fd
  invFun fc := e.functor.map fc  e.counit.app _
  left_inv fd := by
    dsimp only
    simp_rw [Functor.map_comp, Equivalence.fun_inv_map, Functor.id_obj, Category.assoc,
      Equivalence.counit_app_functor, Functor.map_comp_assoc, Iso.inv_hom_id_app,
      Functor.id_obj, Functor.comp_obj, Category.comp_id, Iso.hom_inv_id_app, Functor.id_obj,
      Functor.map_id, Category.id_comp]
  right_inv fc := by
    simp_rw [Functor.map_comp, Equivalence.inv_fun_map, Functor.id_obj, Category.assoc,
      Equivalence.unit_inverse_comp, Iso.hom_inv_id_app_assoc, Category.comp_id]

for docs#CategoryTheory.Equivalence ?

Eric Wieser (Sep 15 2023 at 22:15):

(I'm sure the second sorry is easy enough, but I suspect my approach is suboptimal so didn't want to waste time on it)

Kevin Buzzard (Sep 15 2023 at 22:18):

@loogle Equivalence, adjoint

loogle (Sep 15 2023 at 22:18):

:exclamation: unknown identifier 'adjoint'

Kevin Buzzard (Sep 15 2023 at 22:19):

You're asking why an equivalence is an adjunction

Adam Topaz (Sep 15 2023 at 22:49):

:magnifying_glass: docs#CategoryTheory.Equivalence.toAdjunction

Adam Topaz (Sep 15 2023 at 22:52):

That plus docs#CategoryTheory.Adjunction.homEquiv

Eric Wieser (Sep 15 2023 at 22:54):

Darn, I didn't think of looking in a different file!

Eric Wieser (Sep 15 2023 at 22:56):

As a follow up, is this proof sensible?

/-- Transport `Limits.IsZero` along an equivalence. -/
theorem Limits.IsZero.transport (e : C  D) {x : C} (hx : IsZero x) : IsZero (e.functor.obj x) where
  unique_to X := hx.unique_to (e.inverse.obj X) |>.map <|
    fun u => @Equiv.unique _ _ u (e.toAdjunction.homEquiv _ _)
  unique_from X := hx.unique_from (e.inverse.obj X) |>.map <|
    fun u => @Equiv.unique _ _ u (e.symm.toAdjunction.homEquiv _ _).symm

Eric Wieser (Sep 15 2023 at 22:57):

Or am I missing some more obvious API

Adam Topaz (Sep 15 2023 at 22:57):

We may have this already?

Adam Topaz (Sep 15 2023 at 22:57):

My loogle-foo is subpar… I’ll have to look the old-fashioned way

Arend Mellendijk (Sep 15 2023 at 23:16):

(deleted)

Arend Mellendijk (Sep 15 2023 at 23:16):

@loogle CategoryTheory.Limits.IsZero, CategoryTheory.Equivalence

loogle (Sep 15 2023 at 23:16):

:shrug: nothing found

Eric Wieser (Sep 15 2023 at 23:18):

@loogle CategoryTheory.Limits.IsZero, CategoryTheory.IsEquivalence

loogle (Sep 15 2023 at 23:18):

:shrug: nothing found

Adam Topaz (Sep 15 2023 at 23:18):

Yeah, I couldn't find it either... Here's how I would do it:

import Mathlib.CategoryTheory.Limits.Shapes.ZeroObjects
import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Terminal
import Mathlib.CategoryTheory.Adjunction.Limits

open CategoryTheory Limits

variable {C D : Type*} [Category C] [Category D] (e : C  D)
  {X : C} (hX : IsZero X)

def IsZero.ofIinitialOfTerminal (Y : C) (h1 : IsInitial Y) (h2 : IsTerminal Y) :
    IsZero Y where
  unique_to _ := .intro <| .mk (.mk <| h1.to _) fun _ => h1.hom_ext _ _
  unique_from _ := .intro <| .mk (.mk <| h2.from _) fun _ => h2.hom_ext _ _

example : IsZero (e.functor.obj X) :=
  IsZero.ofIinitialOfTerminal _
    (hX.isInitial.isInitialObj e.functor)
    (hX.isTerminal.isTerminalObj e.functor)

Adam Topaz (Sep 15 2023 at 23:19):

I'm surprised we don't have IsZero.ofIinitialOfTerminal... maybe I missed it?

Arend Mellendijk (Sep 15 2023 at 23:19):

@loogle |- CategoryTheory.Limits.IsZero _

loogle (Sep 15 2023 at 23:19):

:search: CategoryTheory.Functor.isZero, CategoryTheory.Limits.isZero_zero, and 20 more

Eric Wieser (Sep 15 2023 at 23:29):

Note IsZero carries no data so that naming is wrong

Adam Topaz (Sep 15 2023 at 23:31):

Yeah, I was also careless with making the correct variables implicit.

Arend Mellendijk (Sep 15 2023 at 23:38):

Isn't it that way to avoid clashes with docs#Zero? I'd assumed that's why docs#Nat.ArithmeticFunction.IsMultiplicative is like that.

Eric Wieser (Sep 15 2023 at 23:48):

I'm talking about the names in Adam's message not the ones in the docs


Last updated: Dec 20 2023 at 11:08 UTC