The areas / V24. Category theory
Mathlib.Combinatorics.Quiver.Path.Vertices
29 declarations. Mathlib docs · Source
Path Vertices
This file provides lemmas for reasoning about the vertices of a path.
Path vertices decomposition
def Quiver.Path.end E1 #
{V : Type u_1} → [inst : Quiver V] → {a b : V} → Quiver.Path a b → V
The end vertex of a path. A path p : Path a b has p.end = b.
theorem Quiver.Path.end_cons E0 #
∀ {V : Type u_1} [inst : Quiver V] {a b c : V} (p : Quiver.Path a b) (e : b ⟶ c), (p.cons e).end = c
def Quiver.Path.vertices E1 #
{V : Type u_1} → [inst : Quiver V] → {a b : V} → Quiver.Path a b → List V
The list of vertices in a path, including the start and end vertices.
theorem Quiver.Path.vertices_nil E0 #
∀ {V : Type u_1} [inst : Quiver V] (a : V), Quiver.Path.nil.vertices = [a]
theorem Quiver.Path.vertices_cons E0 #
∀ {V : Type u_1} [inst : Quiver V] {a b c : V} (p : Quiver.Path a b) (e : b ⟶ c),
(p.cons e).vertices = p.vertices.concat c
theorem Quiver.Path.mem_vertices_cons E0 #
∀ {V : Type u_1} [inst : Quiver V] {a b c : V} (p : Quiver.Path a b) (e : b ⟶ c) {x : V},
x ∈ (p.cons e).vertices ↔ x ∈ p.vertices ∨ x = c
The vertex list of cons — convenient simp form.
theorem Quiver.Path.verticesSet_nil E1 #
∀ {V : Type u_1} [inst : Quiver V] {a : V}, {v | v ∈ Quiver.Path.nil.vertices} = {a}
theorem Quiver.Path.vertices_length E0 #
∀ {V : Type u_2} [inst : Quiver V] {a b : V} (p : Quiver.Path a b), p.vertices.length = p.length + 1
The length of vertices list equals path length plus one
theorem Quiver.Path.length_vertices_pos E1 #
∀ {V : Type u_1} [inst : Quiver V] {a b : V} (p : Quiver.Path a b), 0 < p.vertices.length
theorem Quiver.Path.vertices_ne_nil E1 #
∀ {V : Type u_1} [inst : Quiver V] {a b : V} (p : Quiver.Path a b), p.vertices ≠ []
theorem Quiver.Path.start_mem_vertices E1 #
∀ {V : Type u_1} [inst : Quiver V] {a b : V} (p : Quiver.Path a b), a ∈ p.vertices
theorem Quiver.Path.vertices_head? E0 #
∀ {V : Type u_1} [inst : Quiver V] {a b : V} (p : Quiver.Path a b), p.vertices.head? = some a
The head of the vertices list is the start vertex
theorem Quiver.Path.vertices_head_eq E0 #
∀ {V : Type u_1} [inst : Quiver V] {a b : V} (p : Quiver.Path a b) (h : optParam (p.vertices ≠ []) ⋯),
p.vertices.head h = a
The head of the vertices list is the start vertex.
theorem Quiver.Path.getElem_vertices_zero E0 #
∀ {V : Type u_1} [inst : Quiver V] {a b : V} (p : Quiver.Path a b), p.vertices[0] = a
theorem Quiver.Path.vertices_getLast E0 #
∀ {V : Type u_1} [inst : Quiver V] {a b : V} (p : Quiver.Path a b) (h : optParam (p.vertices ≠ []) ⋯),
p.vertices.getLast h = b
theorem Quiver.Path.dropLast_append_end_eq E0 #
∀ {V : Type u_1} [inst : Quiver V] {a b : V} (p : Quiver.Path a b), p.vertices.dropLast ++ [b] = p.vertices
theorem Quiver.Path.vertices_comp E0 #
∀ {V : Type u_1} [inst : Quiver V] {a b c : V} (p : Quiver.Path a b) (q : Quiver.Path b c),
(p.comp q).vertices = p.vertices.dropLast ++ q.vertices
theorem Quiver.Path.length_eq_zero_iff E0 #
∀ {V : Type u_1} [inst : Quiver V] {a : V} (p : Quiver.Path a a), p.length = 0 ↔ p = Quiver.Path.nil
theorem Quiver.Path.vertices_comp_get_length_eq E0 #
∀ {V : Type u_1} [inst : Quiver V] {a b c : V} (p₁ : Quiver.Path a c) (p₂ : Quiver.Path c b)
(h : autoParam (p₁.length < (p₁.comp p₂).vertices.length) Quiver.Path.vertices_comp_get_length_eq._auto_1),
(p₁.comp p₂).vertices.get ⟨p₁.length, h⟩ = c
theorem Quiver.Path.vertices_toPath E0 #
∀ {V : Type u_1} [inst : Quiver V] {i j : V} (e : i ⟶ j), e.toPath.vertices = [i, j]
theorem Quiver.Path.vertices_toPath_tail E1 #
∀ {V : Type u_1} [inst : Quiver V] {i j : V} (e : i ⟶ j), e.toPath.vertices.tail = [j]
theorem Quiver.Path.nil_of_comp_eq_nil_left E1 #
∀ {V : Type u_1} [inst : Quiver V] {a b : V} {p : Quiver.Path a b} {q : Quiver.Path b a},
p.comp q = Quiver.Path.nil → p.length = 0
If a composition is nil, the left component must be nil
(proved via lengths, avoiding dependent pattern-matching).
theorem Quiver.Path.nil_of_comp_eq_nil_right E1 #
∀ {V : Type u_1} [inst : Quiver V] {a b : V} {p : Quiver.Path a b} {q : Quiver.Path b a},
p.comp q = Quiver.Path.nil → q.length = 0
If a composition is nil, the right component must be nil
theorem Quiver.Path.comp_eq_nil_iff E0 #
∀ {V : Type u_1} [inst : Quiver V] {a b : V} {p : Quiver.Path a b} {q : Quiver.Path b a},
p.comp q = Quiver.Path.nil ↔ p.length = 0 ∧ q.length = 0
theorem Quiver.Path.end_mem_vertices E0 #
∀ {V : Type u_1} [inst : Quiver V] {a b : V} (p : Quiver.Path a b), b ∈ p.vertices
theorem Quiver.Path.exists_eq_comp_of_le_length E1 #
∀ {V : Type u_1} [inst : Quiver V] {a b : V} (p : Quiver.Path a b) {n : ℕ},
n ≤ p.length → ∃ v p₁ p₂, p = p₁.comp p₂ ∧ p₁.length = n
Given a path p : Path a b and an index n ≤ p.length,
we can split p = p₁.comp p₂ with p₁.length = n.
theorem Quiver.Path.exists_eq_comp_and_length_eq_of_lt_length E1 #
∀ {V : Type u_1} [inst : Quiver V] {a b : V} (p : Quiver.Path a b) (n : ℕ) (hn : n < p.vertices.length),
∃ v p₁ p₂, p = p₁.comp p₂ ∧ p₁.length = n ∧ v = p.vertices[n]
split_at_vertex decomposes a path p at the vertex sitting in
position i of its vertices
theorem Quiver.Path.exists_eq_comp_of_mem_vertices E1 #
∀ {V : Type u_1} [inst : Quiver V] {a b : V} (p : Quiver.Path a b) {v : V}, v ∈ p.vertices → ∃ p₁ p₂, p = p₁.comp p₂
If a vertex v occurs in the list of vertices of a path p : Path a b, then p can be
decomposed as a concatenation of a subpath from a to v and a subpath from v to b.
theorem Quiver.Path.exists_eq_comp_and_notMem_tail_of_mem_vertices E1 #
∀ {V : Type u_1} [inst : Quiver V] {a b : V} (p : Quiver.Path a b) {v : V},
v ∈ p.vertices → ∃ p₁ p₂, p = p₁.comp p₂ ∧ v ∉ p₂.vertices.tail
Split a path at the last occurrence of a vertex.