Documentation

Mathlib.Combinatorics.Quiver.ConnectedComponent

Weakly and strongly connected components #

For a quiver V, define the type WeaklyConnectedComponent V as the quotient of V by the relation which identifies a with b if there is a path from a to b in Symmetrify V. (These zigzags can be seen as a proof-relevant analogue of EqvGen.)

We define:

These concepts relate strong and weak connectivity and let us reason about strongly connected components in directed graphs.

@[implicit_reducible]
def Quiver.zigzagSetoid (V : Type u_1) [Quiver V] :
Setoid V

Two vertices are related in the zigzag setoid if there is a zigzag of arrows from one to the other.

Instances For

    The type of weakly connected components of a directed graph. Two vertices are in the same weakly connected component if there is a zigzag of arrows from one to the other.

    Instances For

      The weakly connected component corresponding to a vertex.

      Instances For
        @[implicit_reducible]
        instance Quiver.WeaklyConnectedComponent.instInhabited {V : Type u_1} [Quiver V] [Inhabited V] :

        A wide subquiver H of Symmetrify V determines a wide subquiver of V, containing an arrow e if either e or its reversal is in H.

        Instances For

          Strongly connected components (directed connectivity) #

          We define strong connectivity (IsStronglyConnected), its positive-length refinement (IsSStronglyConnected), and strongly connected components.

          Strong connectivity: every ordered pair of vertices is joined by a (possibly empty) directed path.

          Instances For

            Positive strong connectivity: every ordered pair of vertices is joined by a directed path of positive length.

            Instances For
              @[simp]
              theorem Quiver.isStronglyConnected_iff (V : Type u_2) [Quiver V] :
              IsStronglyConnected V ↔ βˆ€ (i j : V), Nonempty (Path i j)
              @[simp]
              theorem Quiver.isSStronglyConnected_iff (V : Type u_2) [Quiver V] :
              IsSStronglyConnected V ↔ βˆ€ (i j : V), βˆƒ (p : Path i j), 0 < p.length
              @[implicit_reducible]
              def Quiver.stronglyConnectedSetoid (V : Type u_2) [Quiver V] :
              Setoid V

              Equivalence relation identifying vertices connected by directed paths in both directions.

              Instances For

                The type of strongly connected components (bidirectional reachability classes).

                Instances For

                  The canonical map from a vertex to its strongly connected component.

                  Instances For
                    @[implicit_reducible]
                    theorem Quiver.StronglyConnectedComponent.eq {V : Type u_2} [Quiver V] (a b : V) :
                    StronglyConnectedComponent.mk a = StronglyConnectedComponent.mk b ↔ Nonempty (Path a b) ∧ Nonempty (Path b a)
                    @[simp]
                    theorem Quiver.StronglyConnectedComponent.mk_eq_mk {V : Type u_2} [Quiver V] {a b : V} :
                    StronglyConnectedComponent.mk a = StronglyConnectedComponent.mk b ↔ Nonempty (Path a b) ∧ Nonempty (Path b a)
                    theorem Quiver.stronglyConnectedComponent_eq_of_path {V : Type u_2} [Quiver V] {a b : V} (hab : Nonempty (Path a b)) (hba : Nonempty (Path b a)) :
                    theorem Quiver.stronglyConnectedComponent_singleton_iff {V : Type u_2} [Quiver V] (v : V) :
                    (βˆ€ (w : V), StronglyConnectedComponent.mk w = StronglyConnectedComponent.mk v β†’ w = v) ↔ βˆ€ (w : V), w β‰  v β†’ Β¬(Nonempty (Path v w) ∧ Nonempty (Path w v))
                    theorem Quiver.IsStronglyConnected.isSStronglyConnected_of_hom {V : Type u_2} [Quiver V] (h_sc : IsStronglyConnected V) {iβ‚€ jβ‚€ : V} (eβ‚€ : iβ‚€ ⟢ jβ‚€) :