Unions of compatible multigraphs #
This file constructs the union of two compatible Graphs. Its vertices and edges are the
set-theoretic unions, and an edge is linked exactly when it is linked in either input graph.
Compatibility is essential: a shared edge must not acquire two different pairs of endpoints.
The incident-edge, loop, and nonloop incident-edge sets at a vertex are likewise unions of the
corresponding sets in the two inputs, without any finiteness assumptions.
The union is the least common supergraph of its inputs. Compatible unions commute, and unions of three pairwise compatible graphs associate. These facts let graph constructions grow a subgraph one compatible piece at a time while retaining the original vertex and edge types.
The interface is the compatible fragment of the union design in Mathlib pull request #38337. Unlike that proposal, no choice of incidence is made for incompatible shared edges.
The union of compatible graphs. Its vertices, edges, and links are the corresponding unions.
Instances For
Incident edge identities in a compatible union are those incident in either input.
Loop identities in a compatible union are those that are loops in either input.
Compatibility ensures that a shared edge cannot be a loop in just one input. Consequently, nonloop incident edges also commute with union.
The left input is a subgraph of a compatible union.
The right input is a subgraph of a compatible union.
Compatible union is commutative.
The union of G and H is compatible with K when all three graphs are pairwise
compatible.
G is compatible with the union of H and K when all three graphs are pairwise
compatible.
Compatible union is associative for three pairwise compatible graphs.