Documentation

ChipFiringWithLean.Orientation

Orientations of chip-firing graphs #

This file defines orientations of chip-firing graphs and establishes their relationship to divisors, configurations, and the Riemann-Roch theorem.

An orientation (CFOrientation G) assigns a direction to each edge of G. The key objects are:

The main results are:

structure CFOrientation (G : CFGraph) :
Type u_1

An orientation of G assigns a direction to each edge: directed_edges is a multiset of directed pairs summing to G.edges (with each undirected edge directed exactly one way). The count_preserving field ensures total flow on each edge equals its multiplicity, and no_bidirectional ensures no edge is directed both ways.

Instances For
    @[reducible, inline]
    abbrev flow {G : CFGraph} (O : CFOrientation G) (u v : G.V) :

    The flow from u to v under orientation O: the multiplicity of the directed edge (u,v).

    Equations
    Instances For
      def indeg (G : CFGraph) (O : CFOrientation G) (v : G.V) :

      Number of edges directed into a vertex under an orientation

      Equations
      Instances For
        def outdeg (G : CFGraph) (O : CFOrientation G) (v : G.V) :

        Number of edges directed out of a vertex under an orientation

        Equations
        Instances For
          def is_source (G : CFGraph) (O : CFOrientation G) (v : G.V) :

          A vertex is a source if it has no incoming edges (indegree = 0)

          Equations
          Instances For
            def is_sink (G : CFGraph) (O : CFOrientation G) (v : G.V) :

            A vertex is a sink if it has no outgoing edges (outdegree = 0)

            Equations
            Instances For
              def directed_edge (G : CFGraph) (O : CFOrientation G) (u v : G.V) :

              directed_edge G O u v holds when there is a directed edge from u to v in orientation O.

              Equations
              Instances For
                def list_get_safe {α : Type} (l : List α) (i : ) :

                Helper function for safe list access

                Equations
                Instances For
                  structure DirectedPath {G : CFGraph} (O : CFOrientation G) :
                  Type u_1

                  A directed path in a graph under an orientation

                  Instances For

                    A directed path is non-repeating if its vertex list has no duplicates.

                    Equations
                    Instances For

                      An orientation is acyclic if it has no directed cycles and maintains consistent edge directions between vertices

                      Equations
                      Instances For
                        noncomputable def ancestors (G : CFGraph) (O : CFOrientation G) (v : G.V) :

                        The set of ancestors of a vertex v (nodes x such that there is a path x -> ... -> v)

                        Equations
                        Instances For
                          noncomputable def vertexLevelMeasure (G : CFGraph) (O : CFOrientation G) (v : G.V) :

                          Measure for vertex_level termination: number of ancestors.

                          Equations
                          Instances For

                            acyclic_with_unique_source G O q means that O is acyclic and every source of O is equal to q.

                            Equations
                            Instances For
                              def config_of_source {G : CFGraph} {O : CFOrientation G} {q : G.V} (hO : acyclic_with_unique_source G O q) :
                              Config G q

                              The configuration associated to an acyclic orientation with unique source q: assigns $\mathrm{indeg}(v) - 1$ chips to each vertex $v \neq q$, and $0$ at $q$.

                              Equations
                              Instances For

                                Orientation divisors and configurations #

                                For an orientation $\mathcal{O}$ of $G$, the orientation divisor ordiv G O is $D(\mathcal{O})(v) = \mathrm{indeg}_{\mathcal{O}}(v) - 1$ ([Corry-Perkinson], Definition 4.7).

                                For an acyclic orientation $\mathcal{O}$ with unique source $q$, the associated configuration orientation_to_config G O q assigns $\mathrm{indeg}(v) - 1$ chips to each non-$q$ vertex. An acyclic orientation is uniquely determined by its in-degree sequence (orientation_determined_by_indegrees), and the divisor of an acyclic orientation is always $q$-reduced and unwinnable.

                                def ordiv (G : CFGraph) (O : CFOrientation G) :

                                The divisor associated with an orientation assigns indegree - 1 to each vertex [Corry-Perkinson], Definition 4.7, part 1; written D(O) there.

                                Equations
                                Instances For
                                  def orqed {G : CFGraph} (O : CFOrientation G) {q : G.V} (hO : acyclic_with_unique_source G O q) :

                                  The orientation divisor ordiv G O bundled as a q_eff_div, using acyclicity to prove $q$-effectivity.

                                  Equations
                                  Instances For

                                    The configuration c(O) associated to an acyclic orientation O. [Corry-Perkinson], Definition 4.7 (part 2)

                                    Equations
                                    Instances For

                                      Compatibility between configurations and divisors from an orientation

                                      theorem orientation_determined_by_indegrees {G : CFGraph} (O O' : CFOrientation G) :
                                      is_acyclic G Ois_acyclic G O'(∀ (v : G.V), indeg G O v = indeg G O' v)O = O'

                                      An acyclic orientation is uniquely determined by its indegree sequence. See [Corry-Perkinson], Lemma 4.3.

                                      theorem degree_ordiv {G : CFGraph} (O : CFOrientation G) :
                                      deg (ordiv G O) = genus G - 1

                                      The degree of an orientation divisor equals $g - 1$, where $g$ is the genus of $G$.

                                      The configuration degree of an acyclic orientation with unique source equals the genus.

                                      theorem ordiv_unwinnable (G : CFGraph) (O : CFOrientation G) :
                                      is_acyclic G O¬winnable G (ordiv G O)

                                      The orientation divisor $D(\mathcal{O})$ of an acyclic orientation $\mathcal{O}$ is not winnable. This is part of [Corry-Perkinson], Proposition 4.11.

                                      The canonical divisor and reverse orientations #

                                      The canonical divisor of $G$ is $K_G(v) = \deg(v) - 2$ for each vertex $v$ ([Corry-Perkinson], Definition 4.7). The reverse orientation $\overline{\mathcal{O}}$ of an orientation $\mathcal{O}$ is obtained by reversing all edge directions. The key identity is $D(\mathcal{O}) + D(\overline{\mathcal{O}}) = K_G$ (divisor_reverse_orientation).

                                      This section also contains the handshaking theorem (helper_sum_vertex_degrees): $\sum_{v \in G.V} \deg(v) = 2|E|$, and its corollary that $\deg(K_G) = 2g - 2$ (degree_of_canonical_divisor).

                                      The canonical divisor assigns degree - 2 to each vertex. This is independent of orientation and equals D(O) + D(reverse(O))

                                      Equations
                                      Instances For

                                        The reverse orientation $\overline{\mathcal{O}}$ obtained by reversing all edge directions. See [Corry-Perkinson], Definition 5.7.

                                        Equations
                                        Instances For

                                          The reverse of an acyclic orientation is also acyclic.

                                          The orientation divisors of $\mathcal{O}$ and its reverse sum to the canonical divisor: $D(\mathcal{O}) + D(\overline{\mathcal{O}}) = K_G$.

                                          The degree of the canonical divisor is $2g - 2$, where $g$ is the genus of $G$. This is [Corry-Perkinson], Exercise 5.8.

                                          Orientations from burn lists #

                                          Given a complete burn list L for a superstable configuration c, the function burn_orientation L h_full constructs an acyclic orientation of G with unique source q (burn_acyclic, burn_unique_source). Acyclicity is proved by showing that position in the burn list gives a strictly decreasing labeling along any directed path (dp_dec).

                                          The key lemma dp_dec formalizes this as a strict chain of natural numbers, and orientation_from_flow constructs a CFOrientation from an explicit flow function.

                                          def multiset_of_count {T : Type u_1} [DecidableEq T] [Fintype T] (f : T) :

                                          Create a multiset with a given count function. This is a thin wrapper around DFinsupp.toMultiset specialized to a finite type.

                                          Equations
                                          Instances For
                                            def orientation_from_flow {G : CFGraph} (f : G.V × G.V) (h_count_preserving : ∀ (v w : G.V), f (v, w) + f (w, v) = num_edges G v w) (h_no_bidirectional : ∀ (v w : G.V), f (v, w) = 0 f (w, v) = 0) :

                                            Construct a CFOrientation from an explicit flow function, given proofs that it respects edge multiplicities and has no bidirectional edges.

                                            Equations
                                            Instances For
                                              def burn_orientation {G : CFGraph} {q : G.V} {c : Config G q} (L : burn_list G c) (h_full : ∀ (v : G.V), v L.list) :

                                              The orientation constructed from a complete burn list L for a superstable configuration, via burn_flow. This is shown to be acyclic with unique source $q$ by burn_acyclic and burn_unique_source.

                                              Equations
                                              Instances For

                                                The bijection between orientations and maximal superstable configurations #

                                                This section establishes [Corry-Perkinson], Theorem 4.8: there is a bijection between acyclic orientations with unique source $q$ and maximal superstable configurations.

                                                theorem superstable_dhar {G : CFGraph} {q : G.V} {c : Config G q} (h_ss : superstable G q c) :

                                                Theorem: Dhar's burning algorithm produces, from a superstable configuration, an orientation giving a maximal superstable above it.

                                                The configuration asssociated to an acyclic orientation with unique source is maximal superstable. [Corry-Perkinson], Theorem 4.8, part 1 (c(O) is maximal superstable)

                                                theorem maximal_superstable_exists (G : CFGraph) (q : G.V) (c : Config G q) (h_super : superstable G q c) :
                                                ∃ (c' : Config G q), maximal_superstable G c' c c'

                                                Every superstable configuration extends to a maximal superstable configuration

                                                theorem maximal_superstable_orientation (G : CFGraph) (q : G.V) (c : Config G q) (h_max : maximal_superstable G c) :

                                                Every maximal superstable configuration comes from an acyclic orientation [Corry-Perkinson], Theorem 4.8, part 2 (surjectivity)

                                                theorem orientation_superstable_bijection (G : CFGraph) (q : G.V) :
                                                let α := { O : CFOrientation G // acyclic_with_unique_source G O q }; let β := { c : Config G q // maximal_superstable G c }; let f_raw := fun (O_sub : α) => orientation_to_config G (↑O_sub) q ; have f := fun (O_sub : α) => f_raw O_sub, ; Function.Bijective f

                                                Bijection between acyclic orientations with source q and maximal superstable configurations Corry-Perkinson], Theorem 4.8, part 3 (bijection)