Module docstring
{"# Paths in quivers
Given a quiver V, we define the type of paths from a : V to b : V as an inductive
family. We define composition of paths and the action of prefunctors on paths.
"}
{"# Paths in quivers
Given a quiver V, we define the type of paths from a : V to b : V as an inductive
family. We define composition of paths and the action of prefunctors on paths.
"}
Quiver.Path
inductive
{V : Type u} [Quiver.{v} V] (a : V) : V → Sort max (u + 1) v
Quiver.Hom.toPath
definition
{V} [Quiver V] {a b : V} (e : a ⟶ b) : Path a b
Quiver.Path.nil_ne_cons
theorem
(p : Path a b) (e : b ⟶ a) : Path.nil ≠ p.cons e
lemma nil_ne_cons (p : Path a b) (e : b ⟶ a) : Path.nilPath.nil ≠ p.cons e :=
fun h => by injection h
Quiver.Path.cons_ne_nil
theorem
(p : Path a b) (e : b ⟶ a) : p.cons e ≠ Path.nil
lemma cons_ne_nil (p : Path a b) (e : b ⟶ a) : p.cons e ≠ Path.nil :=
fun h => by injection h
Quiver.Path.obj_eq_of_cons_eq_cons
theorem
{p : Path a b} {p' : Path a c} {e : b ⟶ d} {e' : c ⟶ d} (h : p.cons e = p'.cons e') : b = c
Quiver.Path.heq_of_cons_eq_cons
theorem
{p : Path a b} {p' : Path a c} {e : b ⟶ d} {e' : c ⟶ d} (h : p.cons e = p'.cons e') : HEq p p'
Quiver.Path.hom_heq_of_cons_eq_cons
theorem
{p : Path a b} {p' : Path a c} {e : b ⟶ d} {e' : c ⟶ d} (h : p.cons e = p'.cons e') : HEq e e'
Quiver.Path.length
definition
{a : V} : ∀ {b : V}, Path a b → ℕ
Quiver.Path.instInhabited
instance
{a : V} : Inhabited (Path a a)
Quiver.Path.length_nil
theorem
{a : V} : (nil : Path a a).length = 0
@[simp]
theorem length_nil {a : V} : (nil : Path a a).length = 0 :=
rfl
Quiver.Path.length_cons
theorem
(a b c : V) (p : Path a b) (e : b ⟶ c) : (p.cons e).length = p.length + 1
Quiver.Path.comp
definition
{a b : V} : ∀ {c}, Path a b → Path b c → Path a c
Quiver.Path.comp_cons
theorem
{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
Quiver.Path.comp_nil
theorem
{a b : V} (p : Path a b) : p.comp Path.nil = p
Quiver.Path.nil_comp
theorem
{a : V} : ∀ {b} (p : Path a b), Path.nil.comp p = p
Quiver.Path.comp_assoc
theorem
{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)
Quiver.Path.length_comp
theorem
(p : Path a b) : ∀ {c} (q : Path b c), (p.comp q).length = p.length + q.length
Quiver.Path.comp_inj
theorem
{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₂
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₂ := by
refine ⟨fun h => ?_, by rintro ⟨rfl, rfl⟩; rfl⟩
induction q₁ with
| nil =>
rcases q₂ with _ | ⟨q₂, f₂⟩
· exact ⟨h, rfl⟩
· cases hq
| cons q₁ f₁ ih =>
rcases q₂ with _ | ⟨q₂, f₂⟩
· cases hq
· simp only [comp_cons, cons.injEq] at h
obtain rfl := h.1
obtain ⟨rfl, rfl⟩ := ih (Nat.succ.inj hq) h.2.1.eq
rw [h.2.2.eq]
exact ⟨rfl, rfl⟩
Quiver.Path.comp_inj'
theorem
{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₂
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₂ :=
⟨fun h_eq => (comp_inj <| Nat.add_left_cancel (n := p₂.length) <|
by simpa [h] using congr_arg length h_eq).1 h_eq,
by rintro ⟨rfl, rfl⟩; rfl⟩
Quiver.Path.comp_injective_left
theorem
(q : Path b c) : Injective fun p : Path a b => p.comp q
Quiver.Path.comp_injective_right
theorem
(p : Path a b) : Injective (p.comp : Path b c → Path a c)
Quiver.Path.comp_inj_left
theorem
{p₁ p₂ : Path a b} {q : Path b c} : p₁.comp q = p₂.comp q ↔ p₁ = p₂
@[simp]
theorem comp_inj_left {p₁ p₂ : Path a b} {q : Path b c} : p₁.comp q = p₂.comp q ↔ p₁ = p₂ :=
q.comp_injective_left.eq_iff
Quiver.Path.comp_inj_right
theorem
{p : Path a b} {q₁ q₂ : Path b c} : p.comp q₁ = p.comp q₂ ↔ q₁ = q₂
@[simp]
theorem comp_inj_right {p : Path a b} {q₁ q₂ : Path b c} : p.comp q₁ = p.comp q₂ ↔ q₁ = q₂ :=
p.comp_injective_right.eq_iff
Quiver.Path.toList
definition
: ∀ {b : V}, Path a b → List V
Quiver.Path.toList_comp
theorem
(p : Path a b) : ∀ {c} (q : Path b c), (p.comp q).toList = q.toList ++ p.toList
/-- `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
| _, nil => by simp
| _, @cons _ _ _ d _ q _ => by simp [toList_comp]
Quiver.Path.toList_chain_nonempty
theorem
: ∀ {b} (p : Path a b), p.toList.Chain (fun x y => Nonempty (y ⟶ x)) b
Quiver.Path.toList_injective
theorem
(a : V) : ∀ b, Injective (toList : Path a b → List V)
theorem toList_injective (a : V) : ∀ b, Injective (toList : Path a b → List V)
| _, nil, nil, _ => rfl
| _, nil, @cons _ _ _ c _ p f, h => by cases h
| _, @cons _ _ _ c _ p f, nil, h => by cases h
| _, @cons _ _ _ c _ p f, @cons _ _ _ t _ C D, h => by
simp only [toList, List.cons.injEq] at h
obtain ⟨rfl, hAC⟩ := h
simp [toList_injective _ _ hAC, eq_iff_true_of_subsingleton]
Quiver.Path.toList_inj
theorem
{p q : Path a b} : p.toList = q.toList ↔ p = q
@[simp]
theorem toList_inj {p q : Path a b} : p.toList = q.toList ↔ p = q :=
(toList_injective _ _).eq_iff
Prefunctor.mapPath
definition
{a : V} : ∀ {b : V}, Path a b → Path (F.obj a) (F.obj b)
Prefunctor.mapPath_nil
theorem
(a : V) : F.mapPath (Path.nil : Path a a) = Path.nil
Prefunctor.mapPath_cons
theorem
{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)
Prefunctor.mapPath_comp
theorem
{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)
Prefunctor.mapPath_toPath
theorem
{a b : V} (f : a ⟶ b) : F.mapPath f.toPath = (F.map f).toPath
Prefunctor.mapPath_id
theorem
{a b : V} : (p : Path a b) → (𝟭q V).mapPath p = p
Prefunctor.mapPath_comp_apply
theorem
{a b : V} (p : Path a b) : (F ⋙q G).mapPath p = G.mapPath (F.mapPath p)