Documentation

Mathlib.Combinatorics.SimpleGraph.Trails

Trails and Eulerian trails #

This module contains additional theory about trails, including Eulerian trails (also known as Eulerian circuits).

Main definitions #

Todo #

Tags #

Eulerian trails

@[reducible]
def SimpleGraph.Walk.IsTrail.edgesFinset {V : Type u_1} {G : SimpleGraph V} {u : V} {v : V} {p : SimpleGraph.Walk G u v} (h : SimpleGraph.Walk.IsTrail p) :

The edges of a trail as a finset, since each edge in a trail appears exactly once.

Equations
Instances For
    theorem SimpleGraph.Walk.IsTrail.even_countP_edges_iff {V : Type u_1} {G : SimpleGraph V} [DecidableEq V] {u : V} {v : V} {p : SimpleGraph.Walk G u v} (ht : SimpleGraph.Walk.IsTrail p) (x : V) :
    Even (List.countP (fun (e : Sym2 V) => decide (x e)) (SimpleGraph.Walk.edges p)) u vx u x v
    def SimpleGraph.Walk.IsEulerian {V : Type u_1} {G : SimpleGraph V} [DecidableEq V] {u : V} {v : V} (p : SimpleGraph.Walk G u v) :

    An Eulerian trail (also known as an "Eulerian path") is a walk p that visits every edge exactly once. The lemma SimpleGraph.Walk.IsEulerian.IsTrail shows that these are trails.

    Combine with p.IsCircuit to get an Eulerian circuit (also known as an "Eulerian cycle").

    Equations
    Instances For

      The edge set of an Eulerian graph is finite.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        theorem SimpleGraph.Walk.IsEulerian.even_degree_iff {V : Type u_1} {G : SimpleGraph V} [DecidableEq V] {x : V} {u : V} {v : V} {p : SimpleGraph.Walk G u v} (ht : SimpleGraph.Walk.IsEulerian p) [Fintype V] [DecidableRel G.Adj] :
        Even (SimpleGraph.degree G x) u vx u x v
        theorem SimpleGraph.Walk.IsEulerian.card_filter_odd_degree {V : Type u_1} {G : SimpleGraph V} [DecidableEq V] [Fintype V] [DecidableRel G.Adj] {u : V} {v : V} {p : SimpleGraph.Walk G u v} (ht : SimpleGraph.Walk.IsEulerian p) {s : Finset V} (h : s = Finset.filter (fun (v : V) => Odd (SimpleGraph.degree G v)) Finset.univ) :
        s.card = 0 s.card = 2