# mathlibdocumentation

mathlib-archive / 100-theorems-list.54_konigsberg

# The Königsberg bridges problem #

We show that a graph that represents the islands and mainlands of Königsberg and seven bridges between them has no Eulerian trail.

@[protected, instance]
@[protected, instance]
@[nolint]
inductive konigsberg.verts  :

The vertices for the Königsberg graph; four vertices for the bodies of land and seven vertices for the bridges.

Instances for konigsberg.verts

Each of the connections between the islands/mainlands and the bridges. These are ordered pairs, but the data becomes symmetric in konigsberg.adj.

Equations

The adjacency relation for the Königsberg graph.

Equations

The Königsberg graph structure. While the Königsberg bridge problem is usually described using a multigraph, the we use a "mediant" construction to transform it into a simple graph -- every edge in the multigraph is subdivided into a path of two edges. This construction preserves whether a graph is Eulerian.

(TODO: once mathlib has multigraphs, either prove the mediant construction preserves the Eulerian property or switch this file to use multigraphs.

Equations
@[simp]
theorem konigsberg.graph_adj (v w : konigsberg.verts) :
= w)
@[protected, instance]
Equations
@[simp]

To speed up the proof, this is a cache of all the degrees of each vertex, proved in konigsberg.degree_eq_degree.

Equations
theorem konigsberg.not_is_eulerian {u v : konigsberg.verts} (p : v) (h : p.is_eulerian) :

The Königsberg graph is not Eulerian.