Module docstring
{"# Morphisms of quivers "}
{"# Morphisms of quivers "}
Prefunctor
structure
(V : Type u₁) [Quiver.{v₁} V] (W : Type u₂) [Quiver.{v₂} W]
/-- A morphism of quivers. As we will later have categorical functors extend this structure,
we call it a `Prefunctor`. -/
structure Prefunctor (V : Type u₁) [Quiver.{v₁} V] (W : Type u₂) [Quiver.{v₂} W] where
/-- The action of a (pre)functor on vertices/objects. -/
obj : V → W
/-- The action of a (pre)functor on edges/arrows/morphisms. -/
map : ∀ {X Y : V}, (X ⟶ Y) → (obj X ⟶ obj Y)
Prefunctor.mk_obj
theorem
{V W : Type*} [Quiver V] [Quiver W] {obj : V → W} {map} {X : V} : (Prefunctor.mk obj map).obj X = obj X
Prefunctor.mk_map
theorem
{V W : Type*} [Quiver V] [Quiver W] {obj : V → W} {map} {X Y : V} {f : X ⟶ Y} : (Prefunctor.mk obj map).map f = map f
Prefunctor.ext
theorem
{V : Type u} [Quiver.{v₁} V] {W : Type u₂} [Quiver.{v₂} W] {F G : Prefunctor V W} (h_obj : ∀ X, F.obj X = G.obj X)
(h_map : ∀ (X Y : V) (f : X ⟶ Y), F.map f = Eq.recOn (h_obj Y).symm (Eq.recOn (h_obj X).symm (G.map f))) : F = G
@[ext (iff := false)]
theorem ext {V : Type u} [Quiver.{v₁} V] {W : Type u₂} [Quiver.{v₂} W] {F G : Prefunctor V W}
(h_obj : ∀ X, F.obj X = G.obj X)
(h_map : ∀ (X Y : V) (f : X ⟶ Y),
F.map f = Eq.recOn (h_obj Y).symm (Eq.recOn (h_obj X).symm (G.map f))) : F = G := by
obtain ⟨F_obj, _⟩ := F
obtain ⟨G_obj, _⟩ := G
obtain rfl : F_obj = G_obj := by
ext X
apply h_obj
congr
funext X Y f
simpa using h_map X Y f
Prefunctor.ext'
theorem
{V W : Type u} [Quiver V] [Quiver W] {F G : Prefunctor V W} (h_obj : ∀ X, F.obj X = G.obj X)
(h_map : ∀ (X Y : V) (f : X ⟶ Y), F.map f = Quiver.homOfEq (G.map f) (h_obj _).symm (h_obj _).symm) : F = G
/-- This may be a more useful form of `Prefunctor.ext`. -/
theorem ext' {V W : Type u} [Quiver V] [Quiver W] {F G : Prefunctor V W}
(h_obj : ∀ X, F.obj X = G.obj X)
(h_map : ∀ (X Y : V) (f : X ⟶ Y),
F.map f = Quiver.homOfEq (G.map f) (h_obj _).symm (h_obj _).symm) : F = G := by
obtain ⟨Fobj, Fmap⟩ := F
obtain ⟨Gobj, Gmap⟩ := G
obtain rfl : Fobj = Gobj := funext h_obj
simp only [mk.injEq, heq_eq_eq, true_and]
ext X Y f
simpa only [Quiver.homOfEq_rfl] using h_map X Y f
Prefunctor.id
definition
(V : Type*) [Quiver V] : Prefunctor V V
/-- The identity morphism between quivers. -/
@[simps]
def id (V : Type*) [Quiver V] : Prefunctor V V where
obj := fun X => X
map f := f
Prefunctor.instInhabited
instance
(V : Type*) [Quiver V] : Inhabited (Prefunctor V V)
instance (V : Type*) [Quiver V] : Inhabited (Prefunctor V V) :=
⟨id V⟩
Prefunctor.comp
definition
{U : Type*} [Quiver U] {V : Type*} [Quiver V] {W : Type*} [Quiver W] (F : Prefunctor U V) (G : Prefunctor V W) :
Prefunctor U W
/-- Composition of morphisms between quivers. -/
@[simps]
def comp {U : Type*} [Quiver U] {V : Type*} [Quiver V] {W : Type*} [Quiver W]
(F : Prefunctor U V) (G : Prefunctor V W) : Prefunctor U W where
obj X := G.obj (F.obj X)
map f := G.map (F.map f)
Prefunctor.comp_id
theorem
{U V : Type*} [Quiver U] [Quiver V] (F : Prefunctor U V) : F.comp (id _) = F
Prefunctor.id_comp
theorem
{U V : Type*} [Quiver U] [Quiver V] (F : Prefunctor U V) : (id _).comp F = F
Prefunctor.comp_assoc
theorem
{U V W Z : Type*} [Quiver U] [Quiver V] [Quiver W] [Quiver Z] (F : Prefunctor U V) (G : Prefunctor V W)
(H : Prefunctor W Z) : (F.comp G).comp H = F.comp (G.comp H)
@[simp]
theorem comp_assoc {U V W Z : Type*} [Quiver U] [Quiver V] [Quiver W] [Quiver Z]
(F : Prefunctor U V) (G : Prefunctor V W) (H : Prefunctor W Z) :
(F.comp G).comp H = F.comp (G.comp H) :=
rfl
Prefunctor.term_⥤q_
definition
: Lean.TrailingParserDescr✝
Prefunctor.term_⋙q_
definition
: Lean.TrailingParserDescr✝
Prefunctor.term𝟭q
definition
: Lean.ParserDescr✝
Prefunctor.congr_map
theorem
{U V : Type*} [Quiver U] [Quiver V] (F : U ⥤q V) {X Y : U} {f g : X ⟶ Y} (h : f = g) : F.map f = F.map g
Prefunctor.congr_obj
theorem
{U V : Type*} [Quiver U] [Quiver V] {F G : U ⥤q V} (e : F = G) (X : U) : F.obj X = G.obj X
Prefunctor.congr_hom
theorem
{U V : Type*} [Quiver U] [Quiver V] {F G : U ⥤q V} (e : F = G) {X Y : U} (f : X ⟶ Y) :
Quiver.homOfEq (F.map f) (congr_obj e X) (congr_obj e Y) = G.map f
Prefunctor.homOfEq_map
theorem
{U V : Type*} [Quiver U] [Quiver V] (F : U ⥤q V) {X Y : U} (f : X ⟶ Y) {X' Y' : U} (hX : X = X') (hY : Y = Y') :
F.map (Quiver.homOfEq f hX hY) = Quiver.homOfEq (F.map f) (congr_arg F.obj hX) (congr_arg F.obj hY)
/-- Prefunctors commute with `homOfEq`. -/
@[simp]
theorem homOfEq_map {U V : Type*} [Quiver U] [Quiver V] (F : U ⥤q V) {X Y : U} (f : X ⟶ Y)
{X' Y' : U} (hX : X = X') (hY : Y = Y') :
F.map (Quiver.homOfEq f hX hY) =
Quiver.homOfEq (F.map f) (congr_arg F.obj hX) (congr_arg F.obj hY) := by subst hX hY; simp