Documentation

HexGraphIso.Colored

structure Hex.GraphIso.Coloring (n k : Nat) :

An ordered vertex colouring of Fin n by colours Fin k in which every colour is used.

Instances For
    theorem Hex.Vector.get_eq_getElem {α : Type u} {m : Nat} (v : Vector α m) (i : Fin m) :
    v.get i = v[i]

    Vector.get agrees with element access. The Lean standard library states its Vector lemmas about getElem rather than about Vector.get, so uses of the onto field rewrite with this equation first.

    theorem Hex.GraphIso.Coloring.ext_cells {n k : Nat} {c d : Coloring n k} (h : c.cells = d.cells) :
    c = d
    theorem Hex.GraphIso.Coloring.ext {n k : Nat} {c d : Coloring n k} (h : ∀ (i : Fin n), c.cells[i] = d.cells[i]) :
    c = d
    theorem Hex.GraphIso.Coloring.ext_iff {n k : Nat} {c d : Coloring n k} :
    c = d ∀ (i : Fin n), c.cells[i] = d.cells[i]
    @[instance_reducible]
    Equations

    Checked construction: accepts exactly the colour vectors using every colour.

    Equations
    Instances For
      theorem Hex.GraphIso.Coloring.isSome_ofVector? {n k : Nat} (v : Vector (Fin k) n) :
      (ofVector? v).isSome = true ∀ (c : Fin k), (i : Fin n), v.get i = c
      def Hex.GraphIso.Coloring.trivial (n : Nat) (h : 0 < n := by first | decide | omega) :

      The constant zero colouring: the one-cell colouring of a nonempty vertex set.

      Equations
      Instances For
        @[simp]
        theorem Hex.GraphIso.Coloring.cells_eq_zero {n : Nat} (c : Coloring n 1) {i : Nat} (hi : i < n) :
        c.cells[i] = 0

        Colour vectors into Fin 1 are constant, so a one-cell colouring carries no information beyond its existence.

        def Hex.GraphIso.Coloring.mod (n k : Nat) (hk : 0 < k := by first | decide | omega) (hkn : k n := by first | decide | omega) :

        The colouring i ↦ i % k, onto whenever k ≤ n.

        Equations
        Instances For

          The number of vertices with each colour.

          Equations
          Instances For
            structure Hex.GraphIso.Colored (n k : Nat) :

            A coloured graph: a simple undirected graph on Fin n together with an ordered onto colouring by Fin k.

            • graph : Graph n

              The underlying simple graph.

            • coloring : Coloring n k

              The ordered vertex colouring.

            Instances For
              @[instance_reducible]
              Equations
              theorem Hex.GraphIso.Colored.ext {n k : Nat} {G H : Colored n k} (hg : ∀ (i j : Fin n), G.graph.adj i j = H.graph.adj i j) (hc : ∀ (i : Fin n), G.coloring.cells[i] = H.coloring.cells[i]) :
              G = H
              theorem Hex.GraphIso.Colored.ext_iff {n k : Nat} {G H : Colored n k} :
              G = H (∀ (i j : Fin n), G.graph.adj i j = H.graph.adj i j) ∀ (i : Fin n), G.coloring.cells[i] = H.coloring.cells[i]
              def Hex.GraphIso.Colored.relabel {n k : Nat} (G : Colored n k) (l : Label n) :

              Relabel a coloured graph by a labelling l: new vertex i is old vertex l[i], so (relabel G l).graph.adj i j = G.graph.adj l[i] l[j] and (relabel G l).coloring.cells[i] = G.coloring.cells[l[i]].

              Equations
              Instances For
                @[simp]
                theorem Hex.GraphIso.Colored.adj_relabel {n k : Nat} (G : Colored n k) (l : Label n) (i j : Fin n) :
                (G.relabel l).graph.adj i j = G.graph.adj (l.get i) (l.get j)
                @[simp]
                theorem Hex.GraphIso.Colored.cells_relabel {n k : Nat} (G : Colored n k) (l : Label n) (i : Nat) (hi : i < n) :
                @[simp]
                theorem Hex.GraphIso.Colored.relabel_id {n k : Nat} (G : Colored n k) :
                theorem Hex.GraphIso.Colored.relabel_relabel {n k : Nat} (G : Colored n k) (l m : Label n) :
                (G.relabel l).relabel m = G.relabel (l.comp m)
                def Hex.Graph.singleColor {n : Nat} (G : Graph n) (h : 0 < n := by first | decide | omega) :

                The one-cell coloured graph of a bare graph: every vertex takes the single colour zero, so a coloured isomorphism is exactly a graph isomorphism. n = 0 would force k = 0, so this is defined for positive n.

                Equations
                Instances For
                  @[simp]
                  theorem Hex.Graph.graph_singleColor {n : Nat} (G : Graph n) (h : 0 < n) :
                  structure Hex.GraphIso.CanonResult (n k : Nat) :

                  A canonical form and the label producing it, kept together.

                  Instances For
                    def Hex.GraphIso.instDecidableEqCanonResult.decEq {n✝ k✝ : Nat} (x✝ x✝¹ : CanonResult n✝ k✝) :
                    Decidable (x✝ = x✝¹)
                    Equations
                    Instances For
                      def Hex.GraphIso.ColorSorted {n k : Nat} (K : Colored n k) :

                      A coloured graph whose colour classes are contiguous in vertex order: the first cell occupies the least vertices, and so on. Every canonical form satisfies this.

                      Equations
                      Instances For

                        Executable check for ColorSorted, a plain Boolean fold so the kernel replays it without unfolding quantifier instances.

                        Equations
                        Instances For