Documentation

LeanPool.BrillNoetherGraphs.Utilities.Subdivision.SubdivisionGraph

Subdivision graphs from finite edge slots #

This module turns a loopless finite core with positive integral edge lengths into an actual CFGraph. Edge slots, rather than endpoint pairs, are the primary objects. Consequently parallel core edges remain distinct throughout the construction.

For an edge slot of length L, its interior vertices are indexed by Fin (L - 1): index j denotes offset j + 1 from the tail. Its unit steps are indexed by Fin L. The graph edge multiset is the image of the finite type of all unit steps, so every unit edge is emitted exactly once even when several emitted pairs coincide.

Complete input data for subdividing a finite loopless core.

  • The finite nonempty loopless core whose slots are subdivided.

  • length : Fin p → ℕ

    The positive number of unit edges replacing each core slot.

  • core_nonempty : 0 < n
  • core_loopless (edge : Fin p) : self.core.tail edge ≠ self.core.head edge
  • length_pos (edge : Fin p) : 0 < self.length edge
Instances For
    def Utilities.Certificate.SubdivisionGraph.Spec.ofCore {n p : ℕ} (core : ExplicitPotential.Core n p) (core_nonempty : 0 < n) (core_loopless : ∀ (edge : Fin p), core.tail edge ≠ core.head edge) (length : Fin p → ℕ) (length_pos : ∀ (edge : Fin p), 0 < length edge) :
    Spec n p

    Package a positive length assignment on a fixed finite loopless core as a subdivision specification, without repeating the structure fields.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[reducible, inline]

      An interior vertex remembers its edge slot. Its Fin (L - 1) coordinate j represents path offset j + 1.

      Equations
      Instances For
        @[reducible, inline]

        Vertices of the subdivision are core vertices together with the disjoint interiors of all edge slots.

        Equations
        Instances For
          @[reducible, inline]

          A unit step remembers its edge slot and its zero-based step offset.

          Equations
          Instances For
            def Utilities.Certificate.SubdivisionGraph.Spec.coreVertex {n p : ℕ} (spec : Spec n p) (vertex : Fin n) :
            spec.Vertex

            Injection of a core vertex into the subdivision.

            Equations
            Instances For
              def Utilities.Certificate.SubdivisionGraph.Spec.interiorVertex {n p : ℕ} (spec : Spec n p) (edge : Fin p) (offset : Fin (spec.length edge - 1)) :
              spec.Vertex

              Injection of an edge-interior coordinate into the subdivision.

              Equations
              Instances For
                def Utilities.Certificate.SubdivisionGraph.Spec.stepLeft {n p : ℕ} (spec : Spec n p) (edge : Fin p) (offset : Fin (spec.length edge)) :
                spec.Vertex

                The left endpoint of a unit step.

                Equations
                Instances For
                  def Utilities.Certificate.SubdivisionGraph.Spec.stepRight {n p : ℕ} (spec : Spec n p) (edge : Fin p) (offset : Fin (spec.length edge)) :
                  spec.Vertex

                  The right endpoint of a unit step.

                  Equations
                  Instances For
                    def Utilities.Certificate.SubdivisionGraph.Spec.unitEdge {n p : ℕ} (spec : Spec n p) (step : spec.Step) :
                    spec.Vertex × spec.Vertex

                    The ordered pair emitted by one unit step. Its orientation is only a storage convention; numEdges treats it as undirected.

                    Equations
                    Instances For
                      @[simp]
                      theorem Utilities.Certificate.SubdivisionGraph.Spec.stepLeft_zero {n p : ℕ} (spec : Spec n p) (edge : Fin p) :
                      spec.stepLeft edge ⟨0, ⋯⟩ = spec.coreVertex (spec.core.tail edge)
                      @[simp]
                      theorem Utilities.Certificate.SubdivisionGraph.Spec.stepRight_last {n p : ℕ} (spec : Spec n p) (edge : Fin p) :
                      spec.stepRight edge ⟨spec.length edge - 1, ⋯⟩ = spec.coreVertex (spec.core.head edge)
                      @[simp]
                      theorem Utilities.Certificate.SubdivisionGraph.Spec.stepRight_before_last {n p : ℕ} (spec : Spec n p) (edge : Fin p) (offset : Fin (spec.length edge - 1)) :
                      spec.stepRight edge ⟨↑offset, ⋯⟩ = spec.interiorVertex edge offset
                      @[simp]
                      theorem Utilities.Certificate.SubdivisionGraph.Spec.stepLeft_after_zero {n p : ℕ} (spec : Spec n p) (edge : Fin p) (offset : Fin (spec.length edge - 1)) :
                      spec.stepLeft edge ⟨↑offset + 1, ⋯⟩ = spec.interiorVertex edge offset
                      theorem Utilities.Certificate.SubdivisionGraph.Spec.stepLeft_ne_stepRight {n p : ℕ} (spec : Spec n p) (edge : Fin p) (offset : Fin (spec.length edge)) :
                      spec.stepLeft edge offset ≠ spec.stepRight edge offset

                      Consecutive path positions are always distinct. In the length-one case this is exactly the looplessness assumption on the core slot.

                      @[reducible, inline]

                      The subdivided graph. The underlying multiset is the image of all unit steps, retaining multiplicity when distinct slots emit the same pair.

                      Equations
                      • One or more equations did not get rendered due to their size.
                      Instances For
                        theorem Utilities.Certificate.SubdivisionGraph.Spec.card_edges {n p : ℕ} (spec : Spec n p) :
                        spec.graph.edges.card = ∑ edge : Fin p, spec.length edge

                        Exact edge count: subdividing a slot of length L emits L edges.

                        theorem Utilities.Certificate.SubdivisionGraph.Spec.card_vertices {n p : ℕ} (spec : Spec n p) :
                        Fintype.card spec.graph.V = n + ∑ edge : Fin p, (spec.length edge - 1)

                        Exact vertex count: each slot of length L contributes L - 1 interior vertices.

                        @[simp]
                        theorem Utilities.Certificate.SubdivisionGraph.Spec.genus_graph {n p : ℕ} (spec : Spec n p) :
                        spec.graph.genus = ↑p - ↑n + 1

                        Subdivision preserves cyclomatic genus. The right side is the genus of the abstract core with p edge slots and n vertices.

                        theorem Utilities.Certificate.SubdivisionGraph.Spec.num_edges_eq_card_filter_steps {n p : ℕ} (spec : Spec n p) (x y : spec.Vertex) :
                        numEdges spec.graph x y = {step : spec.Step | spec.unitEdge step = (x, y) ∨ spec.unitEdge step = (y, x)}.card

                        Exact multiplicity formula, expressed directly as a finite filter of unit steps. This is often the most convenient interface for executable proofs.

                        theorem Utilities.Certificate.SubdivisionGraph.Spec.num_edges_eq_sum_steps {n p : ℕ} (spec : Spec n p) (x y : spec.Vertex) :
                        numEdges spec.graph x y = ∑ step : spec.Step, if spec.unitEdge step = (x, y) ∨ spec.unitEdge step = (y, x) then 1 else 0

                        Expanded indicator-sum form of the exact edge multiplicity.

                        theorem Utilities.Certificate.SubdivisionGraph.Spec.num_edges_pos_iff {n p : ℕ} (spec : Spec n p) (x y : spec.Vertex) :
                        0 < numEdges spec.graph x y ↔ ∃ (step : spec.Step), spec.unitEdge step = (x, y) ∨ spec.unitEdge step = (y, x)

                        Positive multiplicity is equivalent to the existence of an emitted unit step with the requested unordered endpoints.

                        theorem Utilities.Certificate.SubdivisionGraph.Spec.unitStep_num_edges_pos {n p : ℕ} (spec : Spec n p) (edge : Fin p) (offset : Fin (spec.length edge)) :
                        0 < numEdges spec.graph (spec.stepLeft edge offset) (spec.stepRight edge offset)

                        Every emitted unit step really is present, with multiplicity at least one. Parallel slots may make the inequality strict.

                        The neighbor of a core tail on its first unit step.

                        Equations
                        Instances For

                          The neighbor of a core head on its final unit step.

                          Equations
                          Instances For
                            theorem Utilities.Certificate.SubdivisionGraph.Spec.tail_num_edges_pos {n p : ℕ} (spec : Spec n p) (edge : Fin p) :
                            0 < numEdges spec.graph (spec.coreVertex (spec.core.tail edge)) (spec.tailNeighbor edge)
                            theorem Utilities.Certificate.SubdivisionGraph.Spec.head_num_edges_pos {n p : ℕ} (spec : Spec n p) (edge : Fin p) :
                            0 < numEdges spec.graph (spec.coreVertex (spec.core.head edge)) (spec.headNeighbor edge)
                            def Utilities.Certificate.SubdivisionGraph.Spec.previousStep {n p : ℕ} (spec : Spec n p) (edge : Fin p) (offset : Fin (spec.length edge - 1)) :
                            Fin (spec.length edge)

                            The step immediately before the interior vertex with coordinate j.

                            Equations
                            Instances For
                              def Utilities.Certificate.SubdivisionGraph.Spec.nextStep {n p : ℕ} (spec : Spec n p) (edge : Fin p) (offset : Fin (spec.length edge - 1)) :
                              Fin (spec.length edge)

                              The step immediately after the interior vertex with coordinate j.

                              Equations
                              Instances For
                                def Utilities.Certificate.SubdivisionGraph.Spec.previousVertex {n p : ℕ} (spec : Spec n p) (edge : Fin p) (offset : Fin (spec.length edge - 1)) :
                                spec.Vertex

                                The preceding path vertex of an interior vertex.

                                Equations
                                Instances For
                                  def Utilities.Certificate.SubdivisionGraph.Spec.nextVertex {n p : ℕ} (spec : Spec n p) (edge : Fin p) (offset : Fin (spec.length edge - 1)) :
                                  spec.Vertex

                                  The following path vertex of an interior vertex.

                                  Equations
                                  Instances For
                                    @[simp]
                                    theorem Utilities.Certificate.SubdivisionGraph.Spec.stepRight_previousStep {n p : ℕ} (spec : Spec n p) (edge : Fin p) (offset : Fin (spec.length edge - 1)) :
                                    spec.stepRight edge (spec.previousStep edge offset) = spec.interiorVertex edge offset
                                    @[simp]
                                    theorem Utilities.Certificate.SubdivisionGraph.Spec.stepLeft_nextStep {n p : ℕ} (spec : Spec n p) (edge : Fin p) (offset : Fin (spec.length edge - 1)) :
                                    spec.stepLeft edge (spec.nextStep edge offset) = spec.interiorVertex edge offset
                                    theorem Utilities.Certificate.SubdivisionGraph.Spec.stepRight_eq_interiorVertex_iff {n p : ℕ} (spec : Spec n p) (step : spec.Step) (edge : Fin p) (offset : Fin (spec.length edge - 1)) :
                                    spec.stepRight step.fst step.snd = spec.interiorVertex edge offset ↔ step = ⟨edge, spec.previousStep edge offset⟩

                                    An interior vertex is the right endpoint of exactly its preceding unit step. Packaging the edge and offset as one sigma value avoids any transport ambiguity in the dependent indices.

                                    theorem Utilities.Certificate.SubdivisionGraph.Spec.stepLeft_eq_interiorVertex_iff {n p : ℕ} (spec : Spec n p) (step : spec.Step) (edge : Fin p) (offset : Fin (spec.length edge - 1)) :
                                    spec.stepLeft step.fst step.snd = spec.interiorVertex edge offset ↔ step = ⟨edge, spec.nextStep edge offset⟩

                                    An interior vertex is the left endpoint of exactly its following unit step.

                                    theorem Utilities.Certificate.SubdivisionGraph.Spec.previous_num_edges_pos {n p : ℕ} (spec : Spec n p) (edge : Fin p) (offset : Fin (spec.length edge - 1)) :
                                    0 < numEdges spec.graph (spec.interiorVertex edge offset) (spec.previousVertex edge offset)
                                    theorem Utilities.Certificate.SubdivisionGraph.Spec.next_num_edges_pos {n p : ℕ} (spec : Spec n p) (edge : Fin p) (offset : Fin (spec.length edge - 1)) :
                                    0 < numEdges spec.graph (spec.interiorVertex edge offset) (spec.nextVertex edge offset)
                                    theorem Utilities.Certificate.SubdivisionGraph.Spec.prin_eq_sum_steps {n p : ℕ} (spec : Spec n p) (script : firingScript spec.graph) (vertex : spec.Vertex) :
                                    (prin spec.graph) script vertex = ∑ step : spec.Step, ((if spec.stepLeft step.fst step.snd = vertex then script (spec.stepRight step.fst step.snd) - script vertex else 0) + if spec.stepRight step.fst step.snd = vertex then script (spec.stepLeft step.fst step.snd) - script vertex else 0)

                                    A principal-divisor coefficient is the sum of the contributions of the individual emitted unit steps incident to the vertex.

                                    theorem Utilities.Certificate.SubdivisionGraph.Spec.prin_eq_sum_step_differences {n p : ℕ} (spec : Spec n p) (script : firingScript spec.graph) (vertex : spec.Vertex) :
                                    (prin spec.graph) script vertex = ∑ step : spec.Step, ((if spec.stepLeft step.fst step.snd = vertex then script (spec.stepRight step.fst step.snd) - script (spec.stepLeft step.fst step.snd) else 0) + if spec.stepRight step.fst step.snd = vertex then -(script (spec.stepRight step.fst step.snd) - script (spec.stepLeft step.fst step.snd)) else 0)

                                    A principal-divisor coefficient depends only on the oriented difference of the firing script along each emitted unit step. This form is convenient for scripts described by slopes rather than by vertex values.

                                    Canonical integer interpolation on the constructed graph #

                                    def Utilities.Certificate.SubdivisionGraph.Spec.coreRise {n p : ℕ} (spec : Spec n p) (potential : Fin n → ℤ) (edge : Fin p) :

                                    Rise of a core potential along an oriented edge slot.

                                    Equations
                                    Instances For
                                      def Utilities.Certificate.SubdivisionGraph.Spec.pathValue {n p : ℕ} (spec : Spec n p) (potential : Fin n → ℤ) (edge : Fin p) (offset : ℕ) :

                                      Value at a numerical path offset, normalized by the tail potential.

                                      Equations
                                      Instances For

                                        Extend an integral core potential over every subdivided slot by the canonical convex interpolation from SubdivisionArithmetic.

                                        Equations
                                        Instances For
                                          @[simp]
                                          theorem Utilities.Certificate.SubdivisionGraph.Spec.interpolatedScript_core {n p : ℕ} (spec : Spec n p) (potential : Fin n → ℤ) (vertex : Fin n) :
                                          spec.interpolatedScript potential (spec.coreVertex vertex) = potential vertex
                                          @[simp]
                                          theorem Utilities.Certificate.SubdivisionGraph.Spec.interpolatedScript_interior {n p : ℕ} (spec : Spec n p) (potential : Fin n → ℤ) (edge : Fin p) (offset : Fin (spec.length edge - 1)) :
                                          spec.interpolatedScript potential (spec.interiorVertex edge offset) = spec.pathValue potential edge (↑offset + 1)
                                          theorem Utilities.Certificate.SubdivisionGraph.Spec.interpolatedScript_stepLeft {n p : ℕ} (spec : Spec n p) (potential : Fin n → ℤ) (edge : Fin p) (offset : Fin (spec.length edge)) :
                                          spec.interpolatedScript potential (spec.stepLeft edge offset) = spec.pathValue potential edge ↑offset

                                          On the left endpoint of step i, the interpolated script has path value at offset i.

                                          theorem Utilities.Certificate.SubdivisionGraph.Spec.interpolatedScript_stepRight {n p : ℕ} (spec : Spec n p) (potential : Fin n → ℤ) (edge : Fin p) (offset : Fin (spec.length edge)) :
                                          spec.interpolatedScript potential (spec.stepRight edge offset) = spec.pathValue potential edge (↑offset + 1)

                                          On the right endpoint of step i, the interpolated script has path value at offset i + 1.

                                          theorem Utilities.Certificate.SubdivisionGraph.Spec.interpolatedScript_stepDifference {n p : ℕ} (spec : Spec n p) (potential : Fin n → ℤ) (edge : Fin p) (offset : Fin (spec.length edge)) :
                                          spec.interpolatedScript potential (spec.stepRight edge offset) - spec.interpolatedScript potential (spec.stepLeft edge offset) = SubdivisionArithmetic.step (spec.length edge) (spec.coreRise potential edge) ↑offset

                                          The script difference across a unit edge is exactly the arithmetic interpolator's step slope.

                                          theorem Utilities.Certificate.SubdivisionGraph.Spec.prin_interpolatedScript_eq_sum_steps {n p : ℕ} (spec : Spec n p) (potential : Fin n → ℤ) (vertex : spec.Vertex) :
                                          (prin spec.graph) (spec.interpolatedScript potential) vertex = ∑ step : spec.Step, ((if spec.stepLeft step.fst step.snd = vertex then SubdivisionArithmetic.step (spec.length step.fst) (spec.coreRise potential step.fst) ↑step.snd else 0) + if spec.stepRight step.fst step.snd = vertex then -SubdivisionArithmetic.step (spec.length step.fst) (spec.coreRise potential step.fst) ↑step.snd else 0)

                                          Exact principal divisor of the interpolated script, written entirely in terms of the certified unit-step slopes. This is the direct bridge from the arithmetic certificate to the graph Laplacian.

                                          theorem Utilities.Certificate.SubdivisionGraph.Spec.prin_interpolatedScript_core {n p : ℕ} (spec : Spec n p) (potential : Fin n → ℤ) (vertex : Fin n) :
                                          (prin spec.graph) (spec.interpolatedScript potential) (spec.coreVertex vertex) = ∑ step : spec.Step, ((if spec.stepLeft step.fst step.snd = spec.coreVertex vertex then SubdivisionArithmetic.step (spec.length step.fst) (spec.coreRise potential step.fst) ↑step.snd else 0) + if spec.stepRight step.fst step.snd = spec.coreVertex vertex then -SubdivisionArithmetic.step (spec.length step.fst) (spec.coreRise potential step.fst) ↑step.snd else 0)

                                          Core-vertex specialization of the exact interpolated Laplacian formula.

                                          theorem Utilities.Certificate.SubdivisionGraph.Spec.prin_interpolatedScript_interior {n p : ℕ} (spec : Spec n p) (potential : Fin n → ℤ) (edge : Fin p) (offset : Fin (spec.length edge - 1)) :
                                          (prin spec.graph) (spec.interpolatedScript potential) (spec.interiorVertex edge offset) = ∑ step : spec.Step, ((if spec.stepLeft step.fst step.snd = spec.interiorVertex edge offset then SubdivisionArithmetic.step (spec.length step.fst) (spec.coreRise potential step.fst) ↑step.snd else 0) + if spec.stepRight step.fst step.snd = spec.interiorVertex edge offset then -SubdivisionArithmetic.step (spec.length step.fst) (spec.coreRise potential step.fst) ↑step.snd else 0)

                                          Interior-vertex specialization of the exact interpolated Laplacian formula.