Simple graphs #
This module defines simple graphs on a vertex type V as an irreflexive symmetric relation.
Main definitions #
SimpleGraphis a structure for symmetric, irreflexive relations.SimpleGraph.neighborSetis theSetof vertices adjacent to a given vertex.SimpleGraph.commonNeighborsis the intersection of the neighbor sets of two given vertices.SimpleGraph.incidenceSetis theSetof edges containing a given vertex.CompleteAtomicBooleanAlgebrainstance: Under the subgraph relation,SimpleGraphforms aCompleteAtomicBooleanAlgebra. In other words, this is the complete lattice of spanning subgraphs of the complete graph.
TODO #
- This is the simplest notion of an unoriented graph. This should eventually fit into a more complete combinatorics hierarchy which includes multigraphs and directed graphs. We begin with simple graphs in order to start learning what the combinatorics hierarchy should look like.
A variant of the aesop tactic for use in the graph library. Changes relative
to standard aesop:
- We use the
SimpleGraphrule set in addition to the default rule sets. - We instruct Aesop's
introrule to unfold withdefaulttransparency. - We instruct Aesop to fail if it can't fully solve the goal. This allows us to
use
aesop_graphfor auto-params.
Instances For
Use aesop_graph? to pass along a Try this suggestion when using aesop_graph
Instances For
A variant of aesop_graph which does not fail if it is unable to solve the goal.
Use this only for exploration! Nonterminal Aesop is even worse than nonterminal simp.
Instances For
A simple graph is an irreflexive symmetric relation Adj on a vertex type V.
The relation describes which pairs of vertices are adjacent.
There is exactly one edge for every pair of adjacent vertices;
see SimpleGraph.edgeSet for the corresponding edge set.
Instances For
Constructor for simple graphs using a symmetric irreflexive Boolean function.
Instances For
We can enumerate simple graphs by enumerating all functions V โ V โ Bool
and filtering on whether they are symmetric and irreflexive.
There are finitely many simple graphs on a given finite type.
Construct the simple graph induced by the given relation. It symmetrizes the relation and makes it irreflexive.
Instances For
Two vertices are adjacent in the complete bipartite graph on two vertex types if and only if they are not from the same side. Any bipartite graph may be regarded as a subgraph of one of these.
Instances For
The relation that one SimpleGraph is a subgraph of another.
Note that this should be spelled โค.
Instances For
The supremum of two graphs x โ y has edges where either x or y have edges.
The infimum of two graphs x โ y has edges where both x and y have edges.
We define Gแถ to be the SimpleGraph V such that no two adjacent vertices in G
are adjacent in the complement, and every nonadjacent pair of vertices is adjacent
(still ensuring that vertices are not adjacent to themselves).
The difference of two graphs x \ y has the edges of x with the edges of y removed.
The complete graph on a type V is the simple graph with all pairs of distinct vertices.
Instances For
The graph with no edges on a given vertex type V.
Instances For
G.support is the set of vertices that form edges in G.
Instances For
All vertices are in the support of the complete graph if there is more than one vertex.
The support of the empty graph is empty.
Only the empty graph has empty support.
The support of a graph is empty if there at most one vertex.
G.neighborSet v is the set of vertices adjacent to v in G.
Instances For
The edges of G consist of the unordered pairs of vertices related by
G.Adj. This is the order embedding; for the edge set of a particular graph, see
SimpleGraph.edgeSet.
The way edgeSet is defined is such that mem_edgeSet is proved by Iff.rfl.
(That is, s(v, w) โ G.edgeSet is definitionally equal to G.Adj v w.)
Instances For
G.edgeSet is the edge set for G.
This is an abbreviation for edgeSetEmbedding G that permits dot notation.
Instances For
Alias of SimpleGraph.not_mem_edgeSet_of_isDiag.
Alias of the reverse direction of SimpleGraph.edgeSet_subset_edgeSet.
Alias of the reverse direction of SimpleGraph.edgeSet_ssubset_edgeSet.
Alias of SimpleGraph.edgeSet_subset_compl_diagSet.
This lemma, combined with edgeSet_sdiff and edgeSet_fromEdgeSet,
allows proving (G \ fromEdgeSet s).edgeSet = G.edgeSet \ s by simp.
Two vertices are adjacent iff there is an edge between them. The
condition v โ w ensures they are different endpoints of the edge,
which is necessary since when v = w the existential
โ (e โ G.edgeSet), v โ e โง w โ e is satisfied by every edge
incident to v.
fromEdgeSet constructs a SimpleGraph from a set of edges, without loops.
Instances For
Incidence set #
Set of edges incident to a given vertex, aka incidence set.
Instances For
The set of common neighbors between two vertices v and w in a graph G is the
intersection of the neighbor sets of v and w.
Instances For
Given an edge incident to a particular vertex, get the other vertex on the edge.
Instances For
There is an equivalence between the set of edges incident to a given vertex and the set of vertices adjacent to the vertex.
Instances For
The condition that the portion of the simple graph G between s and t is complete, that
is, every vertex in s is adjacent to every vertex in t, and vice versa.
Instances For
Alias of the forward direction of SimpleGraph.isCompleteBetween_comm.