Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat(category_theory/opposites): Adds equivalences for functor categories. #7505

Closed
wants to merge 6 commits into from
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 92 additions & 7 deletions src/category_theory/opposites.lean
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ protected def unop (F : Cᵒᵖ ⥤ Dᵒᵖ) : C ⥤ D :=
map := λ X Y f, (F.map f.op).unop }

/-- The isomorphism between `F.op.unop` and `F`. -/
def op_unop_iso (F : C ⥤ D) : F.op.unop ≅ F :=
@[simp] def op_unop_iso (F : C ⥤ D) : F.op.unop ≅ F :=
b-mehta marked this conversation as resolved.
Show resolved Hide resolved
nat_iso.of_components (λ X, iso.refl _) (by tidy)

/-- The isomorphism between `F.unop.op` and `F`. -/
def unop_op_iso (F : Cᵒᵖ ⥤ Dᵒᵖ) : F.unop.op ≅ F :=
@[simp] def unop_op_iso (F : Cᵒᵖ ⥤ Dᵒᵖ) : F.unop.op ≅ F :=
nat_iso.of_components (λ X, iso.refl _) (by tidy)

variables (C D)
Expand All @@ -142,8 +142,6 @@ def op_inv : (Cᵒᵖ ⥤ Dᵒᵖ) ⥤ (C ⥤ D)ᵒᵖ :=
{ app := λ X, (α.app (op X)).unop,
naturality' := λ X Y f, quiver.hom.op_inj $ (α.naturality f.op).symm } }

-- TODO show these form an equivalence

variables {C D}

/--
Expand All @@ -164,8 +162,6 @@ protected def right_op (F : Cᵒᵖ ⥤ D) : C ⥤ Dᵒᵖ :=
{ obj := λ X, op (F.obj (op X)),
map := λ X Y f, (F.map f.op).op }

-- TODO show these form an equivalence

instance {F : C ⥤ D} [full F] : full F.op :=
{ preimage := λ X Y f, (F.preimage f.unop).op }

Expand All @@ -181,6 +177,14 @@ instance right_op_faithful {F : Cᵒᵖ ⥤ D} [faithful F] : faithful F.right_o
instance left_op_faithful {F : C ⥤ Dᵒᵖ} [faithful F] : faithful F.left_op :=
{ map_injective' := λ X Y f g h, quiver.hom.unop_inj (map_injective F (quiver.hom.unop_inj h)) }

@[simp]
def left_op_right_op_iso (F : C ⥤ Dᵒᵖ) : F ≅ F.left_op.right_op := nat_iso.of_components
(λ X, iso.refl _) (by tidy)
b-mehta marked this conversation as resolved.
Show resolved Hide resolved

@[simp]
def right_op_left_op_iso (F : Cᵒᵖ ⥤ D) : F ≅ F.right_op.left_op := nat_iso.of_components
(λ X, iso.refl _) (by tidy)

end

end functor
Expand Down Expand Up @@ -238,7 +242,12 @@ taking `unop` of each component gives a natural transformation `G.left_op ⟶ F.
-/
@[simps] protected def left_op (α : F ⟶ G) : G.left_op ⟶ F.left_op :=
{ app := λ X, (α.app (unop X)).unop,
naturality' := begin tidy, erw α.naturality, refl, end }
naturality' := begin
intros X Y f,
dsimp,
erw α.naturality,
refl,
end }

/--
Given a natural transformation `α : F.left_op ⟶ G.left_op`, for `F G : C ⥤ Dᵒᵖ`,
Expand All @@ -254,6 +263,39 @@ taking `op` of each component gives a natural transformation `G ⟶ F`.
erw this
end }

end

section
variables {F G : Cᵒᵖ ⥤ D}

local attribute [semireducible] quiver.opposite

/--
Given a natural transformation `α : F ⟶ G`, for `F G : Cᵒᵖ ⥤ D`,
taking `op` of each component gives a natural transformation `G.right_op ⟶ F.right_op`.
-/
@[simps] protected def right_op (α : F ⟶ G) : G.right_op ⟶ F.right_op :=
{ app := λ X, (α.app _).op,
naturality' := begin
intros X Y f,
dsimp,
erw α.naturality,
refl,
end }

/--
Given a natural transformation `α : F.right_op ⟶ G.right_op`, for `F G : Cᵒᵖ ⥤ D`,
taking `unop` of each component gives a natural transformation `G ⟶ F`.
-/
@[simps] protected def remove_right_op (α : F.right_op ⟶ G.right_op) : G ⟶ F :=
{ app := λ X, (α.app X.unop).unop,
naturality' := begin
intros X Y f,
have := congr_arg quiver.hom.unop (α.naturality f.unop),
dsimp at this,
erw this,
end }

end
end nat_trans

Expand Down Expand Up @@ -368,4 +410,47 @@ quiver.hom.op (hom_of_le h)
lemma le_of_op_hom {U V : αᵒᵖ} (h : U ⟶ V) : unop V ≤ unop U :=
le_of_hom (h.unop)

namespace functor

variables (C)
variables (D : Type u₂) [category.{v₂} D]

/--
The equivalence of functor categories induced by `op` and `unop`.
-/
@[simps]
def op_unop_equiv : (C ⥤ D)ᵒᵖ ≌ Cᵒᵖ ⥤ Dᵒᵖ :=
{ functor := op_hom _ _,
inverse := op_inv _ _,
unit_iso := nat_iso.of_components (λ F, F.unop.op_unop_iso.op) begin
intros F G f,
dsimp [op_unop_iso],
rw [(show f = f.unop.op, by simp), ← op_comp, ← op_comp],
congr' 1,
tidy,
end,
counit_iso := nat_iso.of_components (λ F, F.unop_op_iso) (by tidy) }.

/--
The equivalence of functor categories induced by `left_op` and `right_op`.
-/
@[simps]
def left_op_right_op_equiv : (Cᵒᵖ ⥤ D)ᵒᵖ ≌ (C ⥤ Dᵒᵖ) :=
{ functor :=
{ obj := λ F, F.unop.right_op,
map := λ F G η, η.unop.right_op },
inverse :=
{ obj := λ F, op F.left_op,
map := λ F G η, η.left_op.op },
unit_iso := nat_iso.of_components (λ F, F.unop.right_op_left_op_iso.symm.op) begin
intros F G η,
dsimp,
rw [(show η = η.unop.op, by simp), ← op_comp, ← op_comp],
congr' 1,
tidy,
end,
counit_iso := nat_iso.of_components (λ F, F.left_op_right_op_iso.symm) (by tidy) }

end functor

end category_theory