Documentation

Mathlib.Combinatorics.Quiver.Basic

Quivers #

This module defines quivers. A quiver on a type V of vertices assigns to every pair a b : V of vertices a type a ⟶ b⟶ b of arrows from a to b. This is a very permissive notion of directed graph.

Implementation notes #

Currently Quiver is defined with arrow : V → V → Sort v→ V → Sort v→ Sort v. This is different from the category theory setup, where we insist that morphisms live in some Type. There's some balance here: it's nice to allow Prop to ensure there are no multiple arrows, but it is also results in error-prone universe signatures when constraints require a Type.

class Quiver (V : Type u) :
Type (maxuv)
  • The type of edges/arrows/morphisms between a given source and target.

    Hom : VVSort v

A quiver G on a type V of vertices assigns to every pair a b : V of vertices a type a ⟶ b⟶ b of arrows from a to b.

For graphs with no repeated edges, one can use Quiver.{0} V, which ensures a ⟶ b : Prop⟶ b : Prop. For multigraphs, one can use Quiver.{v+1} V, which ensures a ⟶ b : Type v⟶ b : Type v.

Because Category will later extend this class, we call the field hom. Except when constructing instances, you should rarely see this, and use the ⟶⟶ notation instead.

Instances

    Notation for the type of edges/arrows/morphisms between a given source and target in a quiver or category.

    Equations
    structure Prefunctor (V : Type u₁) [inst : Quiver V] (W : Type u₂) [inst : Quiver W] :
    Sort (max(max(max(u₁+1)(u₂+1))v₁)v₂)
    • The action of a (pre)functor on vertices/objects.

      obj : VW
    • The action of a (pre)functor on edges/arrows/morphisms.

      map : {X Y : V} → (X Y) → (obj X obj Y)

    A morphism of quivers. As we will later have categorical functors extend this structure, we call it a Prefunctor.

    Instances For
      theorem Prefunctor.ext {V : Type u} [inst : Quiver V] {W : Type u₂} [inst : Quiver W] {F : V ⥤q W} {G : V ⥤q W} (h_obj : ∀ (X : V), Prefunctor.obj F X = Prefunctor.obj G X) (h_map : ∀ (X Y : V) (f : X Y), Prefunctor.map F f = Eq.recOn (_ : Prefunctor.obj G Y = Prefunctor.obj F Y) (Eq.recOn (_ : Prefunctor.obj G X = Prefunctor.obj F X) (Prefunctor.map G f))) :
      F = G
      @[simp]
      theorem Prefunctor.id_obj (V : Type u_1) [inst : Quiver V] (X : V) :
      @[simp]
      theorem Prefunctor.id_map (V : Type u_1) [inst : Quiver V] :
      ∀ {X Y : V} (f : X Y), Prefunctor.map (𝟭q V) f = f
      def Prefunctor.id (V : Type u_1) [inst : Quiver V] :
      V ⥤q V

      The identity morphism between quivers.

      Equations
      • 𝟭q V = { obj := fun X => X, map := fun {X Y} f => f }
      instance Prefunctor.instInhabitedPrefunctor (V : Type u_1) [inst : Quiver V] :
      Equations
      @[simp]
      theorem Prefunctor.comp_obj {U : Type u_1} [inst : Quiver U] {V : Type u_3} [inst : Quiver V] {W : Type u_5} [inst : Quiver W] (F : U ⥤q V) (G : V ⥤q W) (X : U) :
      @[simp]
      theorem Prefunctor.comp_map {U : Type u_1} [inst : Quiver U] {V : Type u_3} [inst : Quiver V] {W : Type u_5} [inst : Quiver W] (F : U ⥤q V) (G : V ⥤q W) :
      ∀ {X Y : U} (f : X Y), Prefunctor.map (F ⋙q G) f = Prefunctor.map G (Prefunctor.map F f)
      def Prefunctor.comp {U : Type u_1} [inst : Quiver U] {V : Type u_3} [inst : Quiver V] {W : Type u_5} [inst : Quiver W] (F : U ⥤q V) (G : V ⥤q W) :
      U ⥤q W

      Composition of morphisms between quivers.

      Equations
      @[simp]
      theorem Prefunctor.comp_id {U : Type u_1} {V : Type u_2} [inst : Quiver U] [inst : Quiver V] (F : U ⥤q V) :
      F ⋙q 𝟭q V = F
      @[simp]
      theorem Prefunctor.id_comp {U : Type u_1} {V : Type u_2} [inst : Quiver U] [inst : Quiver V] (F : U ⥤q V) :
      𝟭q U ⋙q F = F
      @[simp]
      theorem Prefunctor.comp_assoc {U : Type u_1} {V : Type u_2} {W : Type u_3} {Z : Type u_4} [inst : Quiver U] [inst : Quiver V] [inst : Quiver W] [inst : Quiver Z] (F : U ⥤q V) (G : V ⥤q W) (H : W ⥤q Z) :
      F ⋙q G ⋙q H = F ⋙q (G ⋙q H)

      Notation for a prefunctor between quivers.

      Equations

      Notation for composition of prefunctors.

      Equations

      Notation for the identity prefunctor on a quiver.

      Equations
      instance Quiver.opposite {V : Type u_1} [inst : Quiver V] :

      Vᵒᵖ reverses the direction of all arrows of V.

      Equations
      def Quiver.Hom.op {V : Type u_1} [inst : Quiver V] {X : V} {Y : V} (f : X Y) :

      The opposite of an arrow in V.

      Equations
      def Quiver.Hom.unop {V : Type u_1} [inst : Quiver V] {X : Vᵒᵖ} {Y : Vᵒᵖ} (f : X Y) :

      Given an arrow in Vᵒᵖ, we can take the "unopposite" back in V.

      Equations
      def Quiver.Empty (V : Type u) :

      A type synonym for a quiver with no arrows.

      Equations
      Equations
      @[simp]
      theorem Quiver.empty_arrow {V : Type u} (a : Quiver.Empty V) (b : Quiver.Empty V) :
      (a b) = PEmpty
      def Quiver.IsThin (V : Type u) [inst : Quiver V] :

      A quiver is thin if it has no parallel arrows.

      Equations