Documentation

Mathlib.CategoryTheory.Functor.Basic

Functors #

Defines a functor between categories, extending a Prefunctor between quivers.

Introduces, in the CategoryTheory scope, notations C ā„¤ D for the type of all functors from C to D, šŸ­ for the identity functor and ā‹™ for functor composition.

TODO: Switch to using the ā‡’ arrow.

structure CategoryTheory.Functor (C : Type uā‚) [CategoryTheory.Category.{vā‚, uā‚} C] (D : Type uā‚‚) [CategoryTheory.Category.{vā‚‚, uā‚‚} D] extends Prefunctor :
Type (max vā‚ vā‚‚ uā‚ uā‚‚)

Functor C D represents a functor between categories C and D.

To apply a functor F to an object use F.obj X, and to a morphism use F.map f.

The axiom map_id expresses preservation of identities, and map_comp expresses functoriality.

See https://stacks.math.columbia.edu/tag/001B.

Instances For
    @[simp]

    A functor preserves identity morphisms.

    @[simp]
    theorem CategoryTheory.Functor.map_comp {C : Type uā‚} [CategoryTheory.Category.{vā‚, uā‚} C] {D : Type uā‚‚} [CategoryTheory.Category.{vā‚‚, uā‚‚} D] (self : CategoryTheory.Functor C D) {X : C} {Y : C} {Z : C} (f : X āŸ¶ Y) (g : Y āŸ¶ Z) :

    A functor preserves composition.

    šŸ­ C is the identity functor on a category C.

    Equations
    Instances For
      @[simp]

      F ā‹™ G is the composition of a functor F and a functor G (F first, then G).

      Equations
      • F.comp G = { obj := fun (X : C) => G.obj (F.obj X), map := fun {X Y : C} (f : X āŸ¶ Y) => G.map (F.map f), map_id := ā‹Æ, map_comp := ā‹Æ }
      Instances For
        @[simp]
        theorem CategoryTheory.Functor.comp_map {C : Type uā‚} [CategoryTheory.Category.{vā‚, uā‚} C] {D : Type uā‚‚} [CategoryTheory.Category.{vā‚‚, uā‚‚} D] {E : Type uā‚ƒ} [CategoryTheory.Category.{vā‚ƒ, uā‚ƒ} E] (F : CategoryTheory.Functor C D) (G : CategoryTheory.Functor D E) {X : C} {Y : C} (f : X āŸ¶ Y) :
        (F.comp G).map f = G.map (F.map f)
        @[simp]
        theorem CategoryTheory.Functor.map_dite {C : Type uā‚} [CategoryTheory.Category.{vā‚, uā‚} C] {D : Type uā‚‚} [CategoryTheory.Category.{vā‚‚, uā‚‚} D] (F : CategoryTheory.Functor C D) {X : C} {Y : C} {P : Prop} [Decidable P] (f : P ā†’ (X āŸ¶ Y)) (g : Ā¬P ā†’ (X āŸ¶ Y)) :
        F.map (if h : P then f h else g h) = if h : P then F.map (f h) else F.map (g h)