The Yoneda embedding #
THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.
The Yoneda embedding as a functor yoneda : C ⥤ (Cᵒᵖ ⥤ Type v₁)
,
along with an instance that it is fully_faithful
.
Also the Yoneda lemma, yoneda_lemma : (yoneda_pairing C) ≅ (yoneda_evaluation C)
.
References #
The Yoneda embedding, as a functor from C
into presheaves on C
.
See https://stacks.math.columbia.edu/tag/001O.
Equations
- category_theory.yoneda = {obj := λ (X : C), {obj := λ (Y : Cᵒᵖ), opposite.unop Y ⟶ X, map := λ (Y Y' : Cᵒᵖ) (f : Y ⟶ Y') (g : opposite.unop Y ⟶ X), f.unop ≫ g, map_id' := _, map_comp' := _}, map := λ (X X' : C) (f : X ⟶ X'), {app := λ (Y : Cᵒᵖ) (g : {obj := λ (Y : Cᵒᵖ), opposite.unop Y ⟶ X, map := λ (Y Y' : Cᵒᵖ) (f : Y ⟶ Y') (g : opposite.unop Y ⟶ X), f.unop ≫ g, map_id' := _, map_comp' := _}.obj Y), g ≫ f, naturality' := _}, map_id' := _, map_comp' := _}
The co-Yoneda embedding, as a functor from Cᵒᵖ
into co-presheaves on C
.
Equations
- category_theory.coyoneda = {obj := λ (X : Cᵒᵖ), {obj := λ (Y : C), opposite.unop X ⟶ Y, map := λ (Y Y' : C) (f : Y ⟶ Y') (g : opposite.unop X ⟶ Y), g ≫ f, map_id' := _, map_comp' := _}, map := λ (X X' : Cᵒᵖ) (f : X ⟶ X'), {app := λ (Y : C) (g : {obj := λ (Y : C), opposite.unop X ⟶ Y, map := λ (Y Y' : C) (f : Y ⟶ Y') (g : opposite.unop X ⟶ Y), g ≫ f, map_id' := _, map_comp' := _}.obj Y), f.unop ≫ g, naturality' := _}, map_id' := _, map_comp' := _}
The Yoneda embedding is full.
See https://stacks.math.columbia.edu/tag/001P.
Equations
- category_theory.yoneda.yoneda_full = {preimage := λ (X Y : C) (f : category_theory.yoneda.obj X ⟶ category_theory.yoneda.obj Y), f.app (opposite.op X) (𝟙 X), witness' := _}
The Yoneda embedding is faithful.
Extensionality via Yoneda. The typical usage would be
-- Goal is `X ≅ Y`
apply yoneda.ext,
-- Goals are now functions `(Z ⟶ X) → (Z ⟶ Y)`, `(Z ⟶ Y) → (Z ⟶ X)`, and the fact that these
functions are inverses and natural in `Z`.
Equations
- category_theory.yoneda.ext X Y p q h₁ h₂ n = category_theory.yoneda.preimage_iso (category_theory.nat_iso.of_components (λ (Z : Cᵒᵖ), {hom := p (opposite.unop Z), inv := q (opposite.unop Z), hom_inv_id' := _, inv_hom_id' := _}) _)
If yoneda.map f
is an isomorphism, so was f
.
Equations
- category_theory.coyoneda.coyoneda_full = {preimage := λ (X Y : Cᵒᵖ) (f : category_theory.coyoneda.obj X ⟶ category_theory.coyoneda.obj Y), quiver.hom.op (f.app (opposite.unop X) (𝟙 (opposite.unop X))), witness' := _}
If coyoneda.map f
is an isomorphism, so was f
.
The identity functor on Type
is isomorphic to the coyoneda functor coming from punit
.
Equations
- category_theory.coyoneda.punit_iso = category_theory.nat_iso.of_components (λ (X : Type v₁), {hom := λ (f : (category_theory.coyoneda.obj (opposite.op punit)).obj X), f punit.star, inv := λ (x : (𝟭 (Type v₁)).obj X) (_x : opposite.unop (opposite.op punit)), x, hom_inv_id' := _, inv_hom_id' := _}) category_theory.coyoneda.punit_iso._proof_3
Taking the unop
of morphisms is a natural isomorphism.
Equations
- category_theory.coyoneda.obj_op_op X = category_theory.nat_iso.of_components (λ (Y : Cᵒᵖ), (category_theory.op_equiv (opposite.unop (opposite.op (opposite.op X))) Y).to_iso) _
- has_representation : ∃ (X : C) (f : category_theory.yoneda.obj X ⟶ F), category_theory.is_iso f
A functor F : Cᵒᵖ ⥤ Type v₁
is representable if there is object X
so F ≅ yoneda.obj X
.
See https://stacks.math.columbia.edu/tag/001Q.
Instances of this typeclass
- has_corepresentation : ∃ (X : Cᵒᵖ) (f : category_theory.coyoneda.obj X ⟶ F), category_theory.is_iso f
A functor F : C ⥤ Type v₁
is corepresentable if there is object X
so F ≅ coyoneda.obj X
.
See https://stacks.math.columbia.edu/tag/001Q.
Instances of this typeclass
The representing object for the representable functor F
.
The (forward direction of the) isomorphism witnessing F
is representable.
Equations
- F.repr_f = Exists.some _
Instances for category_theory.functor.repr_f
The representing element for the representable functor F
, sometimes called the universal
element of the functor.
An isomorphism between F
and a functor of the form C(-, F.repr_X)
. Note the components
F.repr_w.app X
definitionally have type (X.unop ⟶ F.repr_X) ≅ F.obj X
.
Equations
The representing object for the corepresentable functor F
.
The (forward direction of the) isomorphism witnessing F
is corepresentable.
Equations
- F.corepr_f = Exists.some _
Instances for category_theory.functor.corepr_f
The representing element for the corepresentable functor F
, sometimes called the universal
element of the functor.
An isomorphism between F
and a functor of the form C(F.corepr X, -)
. Note the components
F.corepr_w.app X
definitionally have type F.corepr_X ⟶ X ≅ F.obj X
.
Equations
Equations
Equations
The "Yoneda evaluation" functor, which sends X : Cᵒᵖ
and F : Cᵒᵖ ⥤ Type
to F.obj X
, functorially in both X
and F
.
The "Yoneda pairing" functor, which sends X : Cᵒᵖ
and F : Cᵒᵖ ⥤ Type
to yoneda.op.obj X ⟶ F
, functorially in both X
and F
.
Equations
- category_theory.yoneda_pairing C = category_theory.yoneda.op.prod (𝟭 (Cᵒᵖ ⥤ Type v₁)) ⋙ category_theory.functor.hom (Cᵒᵖ ⥤ Type v₁)
The Yoneda lemma asserts that that the Yoneda pairing
(X : Cᵒᵖ, F : Cᵒᵖ ⥤ Type) ↦ (yoneda.obj (unop X) ⟶ F)
is naturally isomorphic to the evaluation (X, F) ↦ F.obj X
.
See https://stacks.math.columbia.edu/tag/001P.
Equations
- category_theory.yoneda_lemma C = {hom := {app := λ (F : Cᵒᵖ × (Cᵒᵖ ⥤ Type v₁)) (x : (category_theory.yoneda_pairing C).obj F), {down := x.app F.fst (𝟙 (opposite.unop F.fst))}, naturality' := _}, inv := {app := λ (F : Cᵒᵖ × (Cᵒᵖ ⥤ Type v₁)) (x : (category_theory.yoneda_evaluation C).obj F), {app := λ (X : Cᵒᵖ) (a : (opposite.unop ((category_theory.yoneda.op.prod (𝟭 (Cᵒᵖ ⥤ Type v₁))).obj F).fst).obj X), F.snd.map (quiver.hom.op a) x.down, naturality' := _}, naturality' := _}, hom_inv_id' := _, inv_hom_id' := _}
The isomorphism between yoneda.obj X ⟶ F
and F.obj (op X)
(we need to insert a ulift
to get the universes right!)
given by the Yoneda lemma.
Equations
- category_theory.yoneda_sections X F = (category_theory.yoneda_lemma C).app (opposite.op X, F)
We have a type-level equivalence between natural transformations from the yoneda embedding
and elements of F.obj X
, without any universe switching.
Equations
When C
is a small category, we can restate the isomorphism from yoneda_sections
without having to change universes.
Equations
The curried version of yoneda lemma when C
is small.
Equations
- category_theory.curried_yoneda_lemma = category_theory.eq_to_iso category_theory.curried_yoneda_lemma._proof_1 ≪≫ category_theory.curry.map_iso (category_theory.yoneda_lemma C ≪≫ category_theory.iso_whisker_left (category_theory.evaluation_uncurried Cᵒᵖ (Type u₁)) category_theory.ulift_functor_trivial) ≪≫ category_theory.eq_to_iso category_theory.curried_yoneda_lemma._proof_2
The curried version of yoneda lemma when C
is small.
Equations
- category_theory.curried_yoneda_lemma' = category_theory.eq_to_iso category_theory.curried_yoneda_lemma'._proof_1 ≪≫ category_theory.curry.map_iso (category_theory.iso_whisker_left (category_theory.prod.swap (Cᵒᵖ ⥤ Type u₁) Cᵒᵖ) (category_theory.yoneda_lemma C ≪≫ category_theory.iso_whisker_left (category_theory.evaluation_uncurried Cᵒᵖ (Type u₁)) category_theory.ulift_functor_trivial)) ≪≫ category_theory.eq_to_iso category_theory.curried_yoneda_lemma'._proof_2