The Mathlib Handbook

The volumes of the handbook are not written yet. This site shows the map of Mathlib that they will follow, at Mathlib 4472534b60.

The areas / V24. Category theory

Mathlib.Combinatorics.Quiver.Arborescence

16 declarations. Mathlib docs · Source

Arborescences

A quiver V is an arborescence (or directed rooted tree) when we have a root vertex root : V such that for every b : V there is a unique path from root to b.

Main definitions

  • Quiver.Arborescence V: a typeclass asserting that V is an arborescence
  • arborescenceMk: a convenient way of proving that a quiver is an arborescence
  • RootedConnected r: a typeclass asserting that there is at least one path from r to b for every b.
  • geodesicSubtree r: given [RootedConnected r], this is a subquiver of V which contains just enough edges to include a shortest path from r to b for every b.
  • geodesicArborescence : Arborescence (geodesicSubtree r): an instance saying that the geodesic subtree is an arborescence. This proves the directed analogue of 'every connected graph has a spanning tree'. This proof avoids the use of Zorn's lemma.

theorem Quiver.shortestPath.congr_simp E1 #

∀ {V : Type u} [inst : Quiver V] (r : V) [inst_1 : Quiver.RootedConnected r] (b : V),
  Quiver.shortestPath r b = Quiver.shortestPath r b

def Quiver.Arborescence.ctorIdx E1 #

{V : Type u} → {inst : Quiver V} → Quiver.Arborescence V → ℕ

class Quiver.Arborescence E1 #

(V : Type u) → [Quiver V] → Type (max u v)

A quiver is an arborescence when there is a unique path from the default vertex to every other vertex.

ctor Quiver.Arborescence.mk E0 #

{V : Type u} → [inst : Quiver V] → (root : V) → ((b : V) → Unique (Quiver.Path root b)) → Quiver.Arborescence V

abbrev Quiver.Arborescence.root E1 #

{V : Type u} → {inst : Quiver V} → [self : Quiver.Arborescence V] → V

The root of the arborescence.

abbrev Quiver.Arborescence.uniquePath E1 #

{V : Type u} →
  {inst : Quiver V} → [self : Quiver.Arborescence V] → (b : V) → Unique (Quiver.Path Quiver.Arborescence.root b)

There is a unique path from the root to any other vertex.

def Quiver.root E1 #

(V : Type u) → [inst : Quiver V] → [Quiver.Arborescence V] → V

The root of an arborescence.

instance Quiver.instUniquePathRoot E0 #

{V : Type u} → [inst : Quiver V] → [inst_1 : Quiver.Arborescence V] → (b : V) → Unique (Quiver.Path (Quiver.root V) b)

def Quiver.arborescenceMk E3 #

{V : Type u} →
  [inst : Quiver V] →
    (r : V) →
      (height : V → ℕ) →
        (∀ ⦃a b : V⦄ (a_1 : a ⟶ b), height a < height b) →
          (∀ ⦃a b c : V⦄ (e : a ⟶ c) (f : b ⟶ c), a = b ∧ e ≍ f) →
            (∀ (b : V), b = r ∨ ∃ a, Nonempty (a ⟶ b)) → Quiver.Arborescence V

To show that [Quiver V] is an arborescence with root r : V, it suffices to

  • provide a height function V → ℕ such that every arrow goes from a lower vertex to a higher vertex,
  • show that every vertex has at most one arrow to it, and
  • show that every vertex other than r has an arrow to it.

class Quiver.RootedConnected E1 #

{V : Type u} → [Quiver V] → V → Prop

RootedConnected r means that there is a path from r to any other vertex.

ctor Quiver.RootedConnected.mk E0 #

∀ {V : Type u} [inst : Quiver V] {r : V}, (∀ (b : V), Nonempty (Quiver.Path r b)) → Quiver.RootedConnected r

instance Quiver.RootedConnected.nonempty_path E0 #

∀ {V : Type u} {inst : Quiver V} {r : V} [self : Quiver.RootedConnected r] (b : V), Nonempty (Quiver.Path r b)

def Quiver.shortestPath E1 #

{V : Type u} → [inst : Quiver V] → (r : V) → [Quiver.RootedConnected r] → (b : V) → Quiver.Path r b

A path from r of minimal length.

theorem Quiver.shortest_path_spec E1 #

∀ {V : Type u} [inst : Quiver V] (r : V) [inst_1 : Quiver.RootedConnected r] {a : V} (p : Quiver.Path r a),
  (Quiver.shortestPath r a).length ≤ p.length

The length of a path is at least the length of the shortest path

def Quiver.geodesicSubtree E1 #

{V : Type u} → [inst : Quiver V] → (r : V) → [Quiver.RootedConnected r] → WideSubquiver V

A subquiver which by construction is an arborescence.

instance Quiver.geodesicArborescence E0 #

{V : Type u} →
  [inst : Quiver V] →
    (r : V) →
      [inst_1 : Quiver.RootedConnected r] → Quiver.Arborescence (WideSubquiver.toType V (Quiver.geodesicSubtree r))