Documentation

LeanPool.BrillNoetherGraphs.Utilities.Subdivision.AffinePositionMultiBreak

Multi-code divisors and multi-break slope scripts #

AffinePosition names a single point of a subdivided slot by an affine offset and decodes it to a typed vertex once the local cone is checked. Two row-independent constructions are built on top of it here.

Nothing here is row specific and nothing here is decidable-by-decide: the only Boolean checks are the fail-closed bound checks already introduced by AffinePosition.

Interior decoding #

theorem Utilities.Certificate.SubdivisionGraph.Spec.pathVertex_of_interior_val {n p : ℕ} (spec : Spec n p) (edge : Fin p) (position : spec.PathPosition edge) (hPositive : 0 < ↑position) (hStrict : ↑position < spec.length edge) :
spec.pathVertex edge position = spec.interiorVertex edge ⟨↑position - 1, ⋯⟩

A strictly interior path position names an interior vertex. This is the positional form of pathVertex's middle branch.

theorem MarkedGraphs.Certificate.AffinePosition.Code.decodeVertex_eq_interiorVertex {m n p : ℕ} (certificate : Utilities.Certificate.ExplicitPotential.CertificateData m n p) (code : Code m p) (point : Fin m → ℤ) (core_nonempty : 0 < n) {degree : ℤ} (hValid : certificate.Valid degree) (hBounds : BoundsCertified certificate code) (hCone : Utilities.Certificate.ExplicitPotential.FormsHold certificate.cone point) (hPositive : 0 < coordinate certificate code point) (hStrict : coordinate certificate code point < certificate.segmentNat point code.edge) :
decodeVertex certificate code point core_nonempty hValid hBounds hCone = (certificate.subdivisionSpec point core_nonempty hValid hCone).interiorVertex code.edge ⟨coordinate certificate code point - 1, ⋯⟩

An affine position code whose normalized coordinate is strictly interior decodes to the interior vertex one step below that coordinate.

Geometry-only certificate carriers #

ExplicitPotential.CertificateData.Valid bundles two unrelated things: the geometry of the length cone (a loopless core and a cone which forces every segment to be positive) and the interpolated-script rank-one data (alpha, beta, potential, and the endpoint inequalities). Only the geometry is needed to form subdivisionSpec, and hence to decode affine positions or to run a multi-break script.

A row whose pencil is not an interpolated script therefore should not have to invent interpolated-script witnesses. carrier packages a core, its segment forms and a cone with trivial witness data and the all-ones core divisor, and carrier_valid discharges Valid from the two geometric hypotheses alone.

A certificate carrying only length geometry. Its divisor and witness fields are placeholders: the real pencil is a MultiCode and the real firing scripts are multi-break scripts.

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    theorem MarkedGraphs.Certificate.AffinePosition.Carrier.certificate_valid {m n p : ℕ} (core : Utilities.Certificate.ExplicitPotential.Core n p) (segment : Fin p → Utilities.Certificate.ExplicitPotential.AffineForm m) (cone : List (Utilities.Certificate.ExplicitPotential.AffineForm m)) (hLoopless : ∀ (edge : Fin p), core.tail edge ≠ core.head edge) (hPositive : ∀ (edge : Fin p), (segment edge).positive ∈ cone) :
    (certificate core segment cone).Valid ↑n

    A geometry-only carrier is valid as soon as its core is loopless and its cone literally contains the positivity row of every segment. No interpolated-script data is required.

    Multi-code divisors #

    A finite family of affine position codes. Repetitions are allowed and become chip multiplicities in divisorOf.

    • code : Fin d → Code m p

      The indexed family of affine positions; repeated positions contribute repeated chips to its divisor.

    Instances For

      Every code of the family has its two bound rows in the local cone.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        Fail-closed executable bounds check for a whole family.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          def MarkedGraphs.Certificate.AffinePosition.MultiCode.vertex {m n p d : ℕ} (certificate : Utilities.Certificate.ExplicitPotential.CertificateData m n p) (family : MultiCode m p d) (point : Fin m → ℤ) (core_nonempty : 0 < n) {degree : ℤ} (hValid : certificate.Valid degree) (hBounds : BoundsCertified certificate family) (hCone : Utilities.Certificate.ExplicitPotential.FormsHold certificate.cone point) (index : Fin d) :
          (certificate.subdivisionSpec point core_nonempty hValid hCone).Vertex

          The decoded subdivision vertex of one member of the family.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            def MarkedGraphs.Certificate.AffinePosition.MultiCode.divisorOf {m n p d : ℕ} (certificate : Utilities.Certificate.ExplicitPotential.CertificateData m n p) (family : MultiCode m p d) (point : Fin m → ℤ) (core_nonempty : 0 < n) {degree : ℤ} (hValid : certificate.Valid degree) (hBounds : BoundsCertified certificate family) (hCone : Utilities.Certificate.ExplicitPotential.FormsHold certificate.cone point) :
            CFDiv (certificate.subdivisionSpec point core_nonempty hValid hCone).graph

            The divisor named by a family of affine position codes.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              theorem MarkedGraphs.Certificate.AffinePosition.MultiCode.divisorOf_apply {m n p d : ℕ} (certificate : Utilities.Certificate.ExplicitPotential.CertificateData m n p) (family : MultiCode m p d) (point : Fin m → ℤ) (core_nonempty : 0 < n) {degree : ℤ} (hValid : certificate.Valid degree) (hBounds : BoundsCertified certificate family) (hCone : Utilities.Certificate.ExplicitPotential.FormsHold certificate.cone point) (target : (certificate.subdivisionSpec point core_nonempty hValid hCone).Vertex) :
              divisorOf certificate family point core_nonempty hValid hBounds hCone target = ↑{index : Fin d | vertex certificate family point core_nonempty hValid hBounds hCone index = target}.card
              @[simp]
              theorem MarkedGraphs.Certificate.AffinePosition.MultiCode.deg_divisorOf {m n p d : ℕ} (certificate : Utilities.Certificate.ExplicitPotential.CertificateData m n p) (family : MultiCode m p d) (point : Fin m → ℤ) (core_nonempty : 0 < n) {degree : ℤ} (hValid : certificate.Valid degree) (hBounds : BoundsCertified certificate family) (hCone : Utilities.Certificate.ExplicitPotential.FormsHold certificate.cone point) :
              CFDiv.degree (divisorOf certificate family point core_nonempty hValid hBounds hCone) = ↑d

              The degree of a multi-code divisor is the number of codes.

              theorem MarkedGraphs.Certificate.AffinePosition.MultiCode.effective_divisorOf {m n p d : ℕ} (certificate : Utilities.Certificate.ExplicitPotential.CertificateData m n p) (family : MultiCode m p d) (point : Fin m → ℤ) (core_nonempty : 0 < n) {degree : ℤ} (hValid : certificate.Valid degree) (hBounds : BoundsCertified certificate family) (hCone : Utilities.Certificate.ExplicitPotential.FormsHold certificate.cone point) :
              effective (divisorOf certificate family point core_nonempty hValid hBounds hCone)

              A multi-code divisor is effective.

              theorem MarkedGraphs.Certificate.AffinePosition.MultiCode.divisorOf_apply_eq_zero {m n p d : ℕ} (certificate : Utilities.Certificate.ExplicitPotential.CertificateData m n p) (family : MultiCode m p d) (point : Fin m → ℤ) (core_nonempty : 0 < n) {degree : ℤ} (hValid : certificate.Valid degree) (hBounds : BoundsCertified certificate family) (hCone : Utilities.Certificate.ExplicitPotential.FormsHold certificate.cone point) (target : (certificate.subdivisionSpec point core_nonempty hValid hCone).Vertex) (hMissing : ∀ (index : Fin d), vertex certificate family point core_nonempty hValid hBounds hCone index ≠ target) :
              divisorOf certificate family point core_nonempty hValid hBounds hCone target = 0

              A multi-code divisor vanishes at every vertex named by no code.

              theorem MarkedGraphs.Certificate.AffinePosition.MultiCode.divisorOf_apply_eq_one {m n p d : ℕ} (certificate : Utilities.Certificate.ExplicitPotential.CertificateData m n p) (family : MultiCode m p d) (point : Fin m → ℤ) (core_nonempty : 0 < n) {degree : ℤ} (hValid : certificate.Valid degree) (hBounds : BoundsCertified certificate family) (hCone : Utilities.Certificate.ExplicitPotential.FormsHold certificate.cone point) (target : (certificate.subdivisionSpec point core_nonempty hValid hCone).Vertex) (witness : Fin d) (hWitness : vertex certificate family point core_nonempty hValid hBounds hCone witness = target) (hUnique : ∀ (index : Fin d), vertex certificate family point core_nonempty hValid hBounds hCone index = target → index = witness) :
              divisorOf certificate family point core_nonempty hValid hBounds hCone target = 1

              A multi-code divisor carries exactly one chip at a vertex named by a single code.

              theorem MarkedGraphs.Certificate.AffinePosition.MultiCode.bnExists_of_reaches_coreVertices {m n p d : ℕ} (certificate : Utilities.Certificate.ExplicitPotential.CertificateData m n p) (family : MultiCode m p d) (point : Fin m → ℤ) (core_nonempty : 0 < n) {degree : ℤ} (hValid : certificate.Valid degree) (hBounds : BoundsCertified certificate family) (hCone : Utilities.Certificate.ExplicitPotential.FormsHold certificate.cone point) (hConnected : graphConnected (certificate.subdivisionSpec point core_nonempty hValid hCone).graph) (hReaches : ∀ (vertex : Fin n), Utilities.Certificate.StrongSeparator.Reaches (certificate.subdivisionSpec point core_nonempty hValid hCone).graph (divisorOf certificate family point core_nonempty hValid hBounds hCone) ((certificate.subdivisionSpec point core_nonempty hValid hCone).coreVertex vertex)) :
              Utilities.BNExists (certificate.subdivisionSpec point core_nonempty hValid hCone).graph 1 ↑d

              A multi-code divisor which reaches every embedded core vertex has rank at least one. This is the unmarked end-to-end entry point for affine-positioned pencils: MultiBreakScript supplies the individual Reaches witnesses, and the public core-vertex strong-separator theorem supplies all remaining subdivision vertices. No stability hypothesis on the core is needed.

              Break lists and their piecewise-constant slopes #

              Scan a break list left to right, keeping the value of the last entry whose start index is at most k. initial is the slope in force before the list begins.

              Equations
              Instances For

                The slope named by a break list at unit step k: the value of the last entry whose start is at most k, and 0 before every entry.

                Equations
                Instances For
                  @[simp]
                  theorem Utilities.Certificate.SubdivisionGraph.Spec.breakSlopeFrom_cons (initial : ℤ) (entry : ℕ × ℤ) (rest : List (ℕ × ℤ)) (k : ℕ) :
                  breakSlopeFrom initial (entry :: rest) k = breakSlopeFrom (if entry.1 ≤ k then entry.2 else initial) rest k
                  theorem Utilities.Certificate.SubdivisionGraph.Spec.breakSlopeFrom_congr (breaks : List (ℕ × ℤ)) {k l : ℕ} (hSame : ∀ entry ∈ breaks, entry.1 ≤ k ↔ entry.1 ≤ l) (initial : ℤ) :
                  breakSlopeFrom initial breaks k = breakSlopeFrom initial breaks l

                  Two step indices separated by no break start receive the same slope.

                  theorem Utilities.Certificate.SubdivisionGraph.Spec.breakSlope_succ_of_notMem (breaks : List (ℕ × ℤ)) (k : ℕ) (hNoBreak : ∀ entry ∈ breaks, entry.1 ≠ k + 1) :
                  breakSlope breaks (k + 1) = breakSlope breaks k

                  The slope is unchanged across a step which is not a break start.

                  def Utilities.Certificate.SubdivisionGraph.Spec.breakValue {n p : ℕ} (spec : Spec n p) (potential : Fin n → ℤ) (breaks : Fin p → List (ℕ × ℤ)) :
                  Fin p → ℕ → ℤ

                  Path values of a multi-break script: the core potential at the tail plus the accumulated break slopes.

                  Equations
                  Instances For
                    def Utilities.Certificate.SubdivisionGraph.Spec.breakScript {n p : ℕ} (spec : Spec n p) (potential : Fin n → ℤ) (breaks : Fin p → List (ℕ × ℤ)) :

                    The multi-break firing script.

                    Equations
                    Instances For
                      structure Utilities.Certificate.SubdivisionGraph.Spec.BreakData {n p : ℕ} (spec : Spec n p) (potential : Fin n → ℤ) (breaks : Fin p → List (ℕ × ℤ)) :

                      The single closing condition on multi-break data: on every slot the total accumulated rise is the core potential difference.

                      Instances For
                        @[simp]
                        theorem Utilities.Certificate.SubdivisionGraph.Spec.breakValue_zero {n p : ℕ} {spec : Spec n p} {potential : Fin n → ℤ} {breaks : Fin p → List (ℕ × ℤ)} (edge : Fin p) :
                        spec.breakValue potential breaks edge 0 = potential (spec.core.tail edge)
                        theorem Utilities.Certificate.SubdivisionGraph.Spec.slotValueCompatible_breakValue {n p : ℕ} {spec : Spec n p} {potential : Fin n → ℤ} {breaks : Fin p → List (ℕ × ℤ)} (hData : spec.BreakData potential breaks) :
                        spec.SlotValueCompatible potential (spec.breakValue potential breaks)
                        theorem Utilities.Certificate.SubdivisionGraph.Spec.isStepSlope_breakScript {n p : ℕ} {spec : Spec n p} {potential : Fin n → ℤ} {breaks : Fin p → List (ℕ × ℤ)} (hData : spec.BreakData potential breaks) :
                        spec.IsStepSlope (spec.breakScript potential breaks) fun (edge : Fin p) (k : ℕ) => breakSlope (breaks edge) k

                        The unit-step slopes of a multi-break script are exactly its break list slopes.

                        theorem Utilities.Certificate.SubdivisionGraph.Spec.prin_breakScript_coreVertex {n p : ℕ} {spec : Spec n p} {potential : Fin n → ℤ} {breaks : Fin p → List (ℕ × ℤ)} (hData : spec.BreakData potential breaks) (vertex : Fin n) :
                        (prin spec.graph) (spec.breakScript potential breaks) (spec.coreVertex vertex) = ∑ edge : Fin p, ((if spec.core.tail edge = vertex then breakSlope (breaks edge) 0 else 0) + if spec.core.head edge = vertex then -breakSlope (breaks edge) (spec.length edge - 1) else 0)

                        At a core vertex the Laplacian of a multi-break script is the sum of the outgoing break slopes at each incident endpoint.

                        theorem Utilities.Certificate.SubdivisionGraph.Spec.prin_breakScript_interiorVertex {n p : ℕ} {spec : Spec n p} {potential : Fin n → ℤ} {breaks : Fin p → List (ℕ × ℤ)} (hData : spec.BreakData potential breaks) (edge : Fin p) (offset : Fin (spec.length edge - 1)) :
                        (prin spec.graph) (spec.breakScript potential breaks) (spec.interiorVertex edge offset) = breakSlope (breaks edge) (↑offset + 1) - breakSlope (breaks edge) ↑offset

                        At an interior vertex the Laplacian of a multi-break script is the jump of its break list at that coordinate.

                        theorem Utilities.Certificate.SubdivisionGraph.Spec.prin_breakScript_interiorVertex_eq_zero {n p : ℕ} {spec : Spec n p} {potential : Fin n → ℤ} {breaks : Fin p → List (ℕ × ℤ)} (hData : spec.BreakData potential breaks) (edge : Fin p) (offset : Fin (spec.length edge - 1)) (hNoBreak : ∀ entry ∈ breaks edge, entry.1 ≠ ↑offset + 1) :
                        (prin spec.graph) (spec.breakScript potential breaks) (spec.interiorVertex edge offset) = 0

                        A multi-break script has trivial Laplacian at every interior vertex which is not a break position. This is the reason for the format: the principal divisor of a multi-break script is supported on the core together with the finitely many named break points.

                        Affine-positioned multi-break scripts #

                        One affine-positioned break: a position code together with the slope in force from that position onwards along its slot.

                        • position : Code m p

                          The affine-coded position at which this change of slope starts.

                        • slope : ℤ

                          The integer slope prescribed from this break onward along its slot.

                        Instances For

                          A passive multi-break script: an ordered family of affine-positioned breaks. Order matters, exactly as in a break list: a later entry on the same slot overrides an earlier one from its start index onwards.

                          • entry : Fin b → BreakPoint m p

                            The ordered break entries; a later entry on the same slot overrides an earlier one from its starting position onward.

                          Instances For

                            Every break position of the script has its bound rows in the local cone.

                            Equations
                            • One or more equations did not get rendered due to their size.
                            Instances For

                              Fail-closed executable bounds check for a multi-break script.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For

                                The concrete per-slot break list obtained by evaluating every affine break position at a length point.

                                Equations
                                • One or more equations did not get rendered due to their size.
                                Instances For
                                  theorem MarkedGraphs.Certificate.AffinePosition.SlopeScript.exists_of_mem_breaks {m n p b : ℕ} (certificate : Utilities.Certificate.ExplicitPotential.CertificateData m n p) (script : SlopeScript m p b) (point : Fin m → ℤ) (edge : Fin p) {pair : ℕ × ℤ} (hMem : pair ∈ breaks certificate script point edge) :
                                  ∃ (index : Fin b), (script.entry index).position.edge = edge ∧ pair.1 = Code.coordinate certificate (script.entry index).position point

                                  Every entry of a decoded break list comes from a named break of the script, on the named slot and at its decoded coordinate.

                                  theorem MarkedGraphs.Certificate.AffinePosition.SlopeScript.notMem_start_of_no_break {m n p b : ℕ} (certificate : Utilities.Certificate.ExplicitPotential.CertificateData m n p) (script : SlopeScript m p b) (point : Fin m → ℤ) (edge : Fin p) (coordinate : ℕ) (hAvoid : ∀ (index : Fin b), (script.entry index).position.edge = edge → Code.coordinate certificate (script.entry index).position point ≠ coordinate) (pair : ℕ × ℤ) :
                                  pair ∈ breaks certificate script point edge → pair.1 ≠ coordinate

                                  If no break of the script sits on edge at coordinate coordinate, then the decoded break list has no entry starting there.

                                  def MarkedGraphs.Certificate.AffinePosition.SlopeScript.firingScript {m n p b : ℕ} (certificate : Utilities.Certificate.ExplicitPotential.CertificateData m n p) (script : SlopeScript m p b) (potential : Fin n → ℤ) (point : Fin m → ℤ) (core_nonempty : 0 < n) {degree : ℤ} (hValid : certificate.Valid degree) (hCone : Utilities.Certificate.ExplicitPotential.FormsHold certificate.cone point) :
                                  _root_.firingScript (certificate.subdivisionSpec point core_nonempty hValid hCone).graph

                                  The multi-break firing script on the concrete subdivision named by a length point.

                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    def MarkedGraphs.Certificate.AffinePosition.SlopeScript.Balanced {m n p b : ℕ} (certificate : Utilities.Certificate.ExplicitPotential.CertificateData m n p) (script : SlopeScript m p b) (potential : Fin n → ℤ) (point : Fin m → ℤ) (core_nonempty : 0 < n) {degree : ℤ} (hValid : certificate.Valid degree) (hCone : Utilities.Certificate.ExplicitPotential.FormsHold certificate.cone point) :

                                    The closing condition for a multi-break script at one length point.

                                    Equations
                                    • One or more equations did not get rendered due to their size.
                                    Instances For
                                      theorem MarkedGraphs.Certificate.AffinePosition.SlopeScript.prin_firingScript_interiorVertex {m n p b : ℕ} (certificate : Utilities.Certificate.ExplicitPotential.CertificateData m n p) (script : SlopeScript m p b) (potential : Fin n → ℤ) (point : Fin m → ℤ) (core_nonempty : 0 < n) {degree : ℤ} (hValid : certificate.Valid degree) (hCone : Utilities.Certificate.ExplicitPotential.FormsHold certificate.cone point) (hBalanced : Balanced certificate script potential point core_nonempty hValid hCone) (edge : Fin p) (offset : Fin ((certificate.subdivisionSpec point core_nonempty hValid hCone).length edge - 1)) :
                                      (prin (certificate.subdivisionSpec point core_nonempty hValid hCone).graph) (firingScript certificate script potential point core_nonempty hValid hCone) ((certificate.subdivisionSpec point core_nonempty hValid hCone).interiorVertex edge offset) = Utilities.Certificate.SubdivisionGraph.Spec.breakSlope (breaks certificate script point edge) (↑offset + 1) - Utilities.Certificate.SubdivisionGraph.Spec.breakSlope (breaks certificate script point edge) ↑offset

                                      The Laplacian of an affine-positioned multi-break script at an interior vertex is the jump of the decoded break list there.

                                      theorem MarkedGraphs.Certificate.AffinePosition.SlopeScript.prin_firingScript_interiorVertex_eq_zero {m n p b : ℕ} (certificate : Utilities.Certificate.ExplicitPotential.CertificateData m n p) (script : SlopeScript m p b) (potential : Fin n → ℤ) (point : Fin m → ℤ) (core_nonempty : 0 < n) {degree : ℤ} (hValid : certificate.Valid degree) (hCone : Utilities.Certificate.ExplicitPotential.FormsHold certificate.cone point) (hBalanced : Balanced certificate script potential point core_nonempty hValid hCone) (edge : Fin p) (offset : Fin ((certificate.subdivisionSpec point core_nonempty hValid hCone).length edge - 1)) (hAvoid : ∀ (index : Fin b), (script.entry index).position.edge = edge → Code.coordinate certificate (script.entry index).position point ≠ ↑offset + 1) :
                                      (prin (certificate.subdivisionSpec point core_nonempty hValid hCone).graph) (firingScript certificate script potential point core_nonempty hValid hCone) ((certificate.subdivisionSpec point core_nonempty hValid hCone).interiorVertex edge offset) = 0

                                      The principal divisor of an affine-positioned multi-break script vanishes at every interior vertex which no break of the script names. Together with MultiCode.divisorOf_apply_eq_zero this is the row-independent statement that lets a residual be checked at the finitely many named positions only.

                                      theorem MarkedGraphs.Certificate.AffinePosition.SlopeScript.prin_firingScript_coreVertex {m n p b : ℕ} (certificate : Utilities.Certificate.ExplicitPotential.CertificateData m n p) (script : SlopeScript m p b) (potential : Fin n → ℤ) (point : Fin m → ℤ) (core_nonempty : 0 < n) {degree : ℤ} (hValid : certificate.Valid degree) (hCone : Utilities.Certificate.ExplicitPotential.FormsHold certificate.cone point) (hBalanced : Balanced certificate script potential point core_nonempty hValid hCone) (vertex : Fin n) :
                                      (prin (certificate.subdivisionSpec point core_nonempty hValid hCone).graph) (firingScript certificate script potential point core_nonempty hValid hCone) ((certificate.subdivisionSpec point core_nonempty hValid hCone).coreVertex vertex) = ∑ edge : Fin p, ((if certificate.core.tail edge = vertex then Utilities.Certificate.SubdivisionGraph.Spec.breakSlope (breaks certificate script point edge) 0 else 0) + if certificate.core.head edge = vertex then -Utilities.Certificate.SubdivisionGraph.Spec.breakSlope (breaks certificate script point edge) (certificate.segmentNat point edge - 1) else 0)

                                      The Laplacian of an affine-positioned multi-break script at a core vertex is the usual endpoint-slope sum.