Acyclic graphs and trees #
This module introduces acyclic graphs (a.k.a. forests) and trees.
Main definitions #
SimpleGraph.IsAcyclicis a predicate for a graph having no cyclic walks.SimpleGraph.IsTreeis a predicate for a graph being a tree (a connected acyclic graph).
Main statements #
SimpleGraph.isAcyclic_iff_path_uniquecharacterizes acyclicity in terms of uniqueness of paths between pairs of vertices.SimpleGraph.isAcyclic_iff_forall_edge_isBridgecharacterizes acyclicity in terms of every edge being a bridge edge.SimpleGraph.isTree_iff_existsUnique_pathcharacterizes trees in terms of existence and uniqueness of paths between pairs of vertices from a nonempty vertex type.
References #
The structure of the proofs for SimpleGraph.IsAcyclic and SimpleGraph.IsTree, including
supporting lemmas about SimpleGraph.IsBridge, generally follows the high-level description
for these theorems for multigraphs from [Cho94].
Tags #
acyclic graphs, trees
A graph is acyclic (or a forest) if it has no cycles.
Instances For
A tree is a connected acyclic graph.
Instances For
A graph that has an injective homomorphism to an acyclic graph is acyclic.
Isomorphic graphs are acyclic together.
Isomorphic graphs are trees together.
A graph induced from an acyclic graph is acyclic.
A subgraph of an acyclic graph is acyclic.
A spanning subgraph of an acyclic graph is acyclic.
The directed supremum of acyclic graphs is acylic.
Every acyclic subgraph H ≤ G is contained in a maximal such subgraph.
A connected component of an acyclic graph is a tree.
A minimally connected graph is a tree.
Connecting two unreachable vertices by an edge preserves acyclicity.
Adding an edge results in an acyclic graph iff the original graph was acyclic and the edge connects vertices that previously had no path between them.
The reachability relation of a maximal acyclic subgraph agrees with that of the larger graph.
A subgraph is maximal acyclic iff its reachability relation agrees with the larger graph.
A subgraph of a connected graph is maximal acyclic iff it is a tree.
A maximally acyclic graph is a tree. This is similar to maximal_isAcyclic_iff_isTree except
with Nonempty V as part of the iff rather than an assumption.
Every graph has a spanning forest.
Every acyclic subgraph of a connected graph can be extended to a spanning tree.
Every connected graph has a spanning tree.
Every connected graph on n vertices has at least n-1 edges.
The minimum degree of all vertices in a nontrivial tree is one.
A nontrivial tree has a vertex of degree one.
The graph resulting from removing a vertex of degree one from a connected graph is connected.
A finite nontrivial connected graph contains a vertex that leaves the graph connected if removed.
A finite connected graph contains a vertex that leaves the graph preconnected if removed.
The unique two-coloring of a tree that colors the given vertex with zero
Equations
- hG.coloringTwoOfVert u = SimpleGraph.Coloring.mk (fun (v : V) => ⟨G.dist u v % 2, ⋯⟩) ⋯
Instances For
Arbitrary coloring with two colors for a tree
Equations
- hG.coloringTwo = hG.coloringTwoOfVert ⋯.some
Instances For
The unique two-coloring of a forest that colors the given vertices with zero
Equations
- hG.coloringTwoOfVerts verts h = { toFun := fun (v : V) => let u := verts (G.connectedComponentMk v); ⟨G.dist u v % 2, ⋯⟩, map_rel' := ⋯ }
Instances For
Arbitrary coloring with two colors for a forest
Equations
- hG.coloringTwo = hG.coloringTwoOfVerts (fun (x : G.ConnectedComponent) => ⋯.some) ⋯
Instances For
An acyclic graph (forest) is 2-colorable.
A tree is 2-colorable.
The chromatic number of an acyclic graph (forest) is at most 2.
The chromatic number of a tree is at most 2.