File: Mathlib/Combinatorics/Quiver/Path.lean

full_name: Quiver.Path
code: /-- `Path a b` is the type of paths from `a` to `b` through the arrows of `G`. -/
inductive Path {V : Type u} [Quiver.{v} V] (a : V) : V → Sort max (u + 1) v
  | nil : Path a a
  | cons : ∀ {b c : V}, Path a b → (b ⟶ c) → Path a c
goal: V → Sort (max (u + 1) v)

full_name: Quiver.Path.nil
code: /-- `Path a b` is the type of paths from `a` to `b` through the arrows of `G`. -/
inductive Path {V : Type u} [Quiver.{v} V] (a : V) : V → Sort max (u + 1) v
  | nil : Path a a
  | cons : ∀ {b c : V}, Path a b → (b ⟶ c) → Path a c
goal: Quiver.Path a a

full_name: Quiver.Path.cons
code: /-- `Path a b` is the type of paths from `a` to `b` through the arrows of `G`. -/
inductive Path {V : Type u} [Quiver.{v} V] (a : V) : V → Sort max (u + 1) v
  | nil : Path a a
  | cons : ∀ {b c : V}, Path a b → (b ⟶ c) → Path a c
goal: Quiver.Path a b → (b ⟶ c) → Quiver.Path a c

full_name: Quiver.Hom.toPath
code: /-- An arrow viewed as a path of length one. -/
def Hom.toPath {V} [Quiver V] {a b : V} (e : a ⟶ b) : Path a b 
goal: Quiver.Path a b

full_name: Quiver.Path.nil_ne_cons
code: lemma nil_ne_cons (p : Path a b) (e : b ⟶ a) : Path.nil ≠ p.cons e 
goal: Quiver.Path.nil ≠ p.cons e

full_name: Quiver.Path.cons_ne_nil
code: lemma cons_ne_nil (p : Path a b) (e : b ⟶ a) : p.cons e ≠ Path.nil 
goal: p.cons e ≠ Quiver.Path.nil

full_name: Quiver.Path.obj_eq_of_cons_eq_cons
code: lemma obj_eq_of_cons_eq_cons {p : Path a b} {p' : Path a c}
    {e : b ⟶ d} {e' : c ⟶ d} (h : p.cons e = p'.cons e') : b = c 
goal: b = c

full_name: Quiver.Path.heq_of_cons_eq_cons
code: lemma heq_of_cons_eq_cons {p : Path a b} {p' : Path a c}
    {e : b ⟶ d} {e' : c ⟶ d} (h : p.cons e = p'.cons e') : HEq p p' 
goal: HEq p p'

full_name: Quiver.Path.hom_heq_of_cons_eq_cons
code: lemma hom_heq_of_cons_eq_cons {p : Path a b} {p' : Path a c}
    {e : b ⟶ d} {e' : c ⟶ d} (h : p.cons e = p'.cons e') : HEq e e' 
goal: HEq e e'

full_name: Quiver.Path.length
code: /-- The length of a path is the number of arrows it uses. -/
def length {a : V} : ∀ {b : V}, Path a b → ℕ
  
goal: Quiver.Path a b → ℕ

full_name: Quiver.Path.instInhabited
code: instance {a : V} : Inhabited (Path a a) 
goal: Inhabited (Quiver.Path a a)

full_name: Quiver.Path.length_nil
code: @[simp]
theorem length_nil {a : V} : (nil : Path a a).length = 0 
goal: Quiver.Path.nil.length = 0

full_name: Quiver.Path.length_cons
code: @[simp]
theorem length_cons (a b c : V) (p : Path a b) (e : b ⟶ c) : (p.cons e).length = p.length + 1 
goal: (p.cons e).length = p.length + 1

full_name: Quiver.Path.eq_of_length_zero
code: theorem eq_of_length_zero (p : Path a b) (hzero : p.length = 0) : a = b 
goal: a = b

full_name: Quiver.Path.comp
code: /-- Composition of paths. -/
def comp {a b : V} : ∀ {c}, Path a b → Path b c → Path a c
  
goal: Quiver.Path a b → Quiver.Path b c → Quiver.Path a c

full_name: Quiver.Path.comp_cons
code: @[simp]
theorem comp_cons {a b c d : V} (p : Path a b) (q : Path b c) (e : c ⟶ d) :
    p.comp (q.cons e) = (p.comp q).cons e 
goal: p.comp (q.cons e) = (p.comp q).cons e

full_name: Quiver.Path.comp_nil
code: @[simp]
theorem comp_nil {a b : V} (p : Path a b) : p.comp Path.nil = p 
goal: p.comp Quiver.Path.nil = p

full_name: Quiver.Path.nil_comp
code: @[simp]
theorem nil_comp {a : V} : ∀ {b} (p : Path a b), Path.nil.comp p = p
  
goal: Quiver.Path.nil.comp p = p

full_name: Quiver.Path.comp_assoc
code: @[simp]
theorem comp_assoc {a b c : V} :
    ∀ {d} (p : Path a b) (q : Path b c) (r : Path c d), (p.comp q).comp r = p.comp (q.comp r)
  
goal: (p.comp q).comp r = p.comp (q.comp r)

full_name: Quiver.Path.length_comp
code: @[simp]
theorem length_comp (p : Path a b) : ∀ {c} (q : Path b c), (p.comp q).length = p.length + q.length
  
goal: (p.comp q).length = p.length + q.length

full_name: Quiver.Path.comp_inj
code: theorem comp_inj {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (hq : q₁.length = q₂.length) :
    p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ 
goal: p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂

full_name: Quiver.Path.comp_inj'
code: theorem comp_inj' {p₁ p₂ : Path a b} {q₁ q₂ : Path b c} (h : p₁.length = p₂.length) :
    p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂ 
goal: p₁.comp q₁ = p₂.comp q₂ ↔ p₁ = p₂ ∧ q₁ = q₂

full_name: Quiver.Path.comp_injective_left
code: theorem comp_injective_left (q : Path b c) : Injective fun p : Path a b => p.comp q 
goal: Function.Injective fun p => p.comp q

full_name: Quiver.Path.comp_injective_right
code: theorem comp_injective_right (p : Path a b) : Injective (p.comp : Path b c → Path a c) 
goal: Function.Injective p.comp

full_name: Quiver.Path.comp_inj_left
code: @[simp]
theorem comp_inj_left {p₁ p₂ : Path a b} {q : Path b c} : p₁.comp q = p₂.comp q ↔ p₁ = p₂ 
goal: p₁.comp q = p₂.comp q ↔ p₁ = p₂

full_name: Quiver.Path.comp_inj_right
code: @[simp]
theorem comp_inj_right {p : Path a b} {q₁ q₂ : Path b c} : p.comp q₁ = p.comp q₂ ↔ q₁ = q₂ 
goal: p.comp q₁ = p.comp q₂ ↔ q₁ = q₂

full_name: Quiver.Path.toList
code: /-- Turn a path into a list. The list contains `a` at its head, but not `b` a priori. -/
@[simp]
def toList : ∀ {b : V}, Path a b → List V
  
goal: Quiver.Path a b → List V

full_name: Quiver.Path.toList_comp
code: /-- `Quiver.Path.toList` is a contravariant functor. The inversion comes from `Quiver.Path` and
`List` having different preferred directions for adding elements. -/
@[simp]
theorem toList_comp (p : Path a b) : ∀ {c} (q : Path b c), (p.comp q).toList = q.toList ++ p.toList
  
goal: (p.comp q).toList = q.toList ++ p.toList

full_name: Quiver.Path.toList_chain_nonempty
code: theorem toList_chain_nonempty :
    ∀ {b} (p : Path a b), p.toList.Chain (fun x y => Nonempty (y ⟶ x)) b
  
goal: List.Chain (fun x y => Nonempty (y ⟶ x)) b p.toList

full_name: Quiver.Path.toList_injective
code: theorem toList_injective (a : V) : ∀ b, Injective (toList : Path a b → List V)
  
goal: Function.Injective Quiver.Path.toList

full_name: Quiver.Path.toList_inj
code: @[simp]
theorem toList_inj {p q : Path a b} : p.toList = q.toList ↔ p = q 
goal: p.toList = q.toList ↔ p = q

full_name: Prefunctor.mapPath
code: /-- The image of a path under a prefunctor. -/
def mapPath {a : V} : ∀ {b : V}, Path a b → Path (F.obj a) (F.obj b)
  
goal: Quiver.Path a b → Quiver.Path (F.obj a) (F.obj b)

full_name: Prefunctor.mapPath_nil
code: @[simp]
theorem mapPath_nil (a : V) : F.mapPath (Path.nil : Path a a) = Path.nil 
goal: F.mapPath Quiver.Path.nil = Quiver.Path.nil

full_name: Prefunctor.mapPath_cons
code: @[simp]
theorem mapPath_cons {a b c : V} (p : Path a b) (e : b ⟶ c) :
    F.mapPath (Path.cons p e) = Path.cons (F.mapPath p) (F.map e) 
goal: F.mapPath (p.cons e) = (F.mapPath p).cons (F.map e)

full_name: Prefunctor.mapPath_comp
code: @[simp]
theorem mapPath_comp {a b : V} (p : Path a b) :
    ∀ {c : V} (q : Path b c), F.mapPath (p.comp q) = (F.mapPath p).comp (F.mapPath q)
  
goal: F.mapPath (p.comp q) = (F.mapPath p).comp (F.mapPath q)

full_name: Prefunctor.mapPath_toPath
code: @[simp]
theorem mapPath_toPath {a b : V} (f : a ⟶ b) : F.mapPath f.toPath = (F.map f).toPath 
goal: F.mapPath f.toPath = (F.map f).toPath