Documentation

LeanPool.BrillNoetherGraphs.Utilities.Subdivision.ClosedRowProof.RichChipBridge

The W5 endpoint chip bridge #

RichChipDecoder.rawChipMassAt is the physical signed chip mass sitting at one literal coordinate of a displayed slot: it selects the raw chips of that slot whose form evaluates to the coordinate. The checker, by contrast, accounts for chips syntactically: chipPrefix sums the chips whose first syntactic match among the named points of the anchor is one of the first s named points.

This module proves that the two agree exactly, at the tail coordinate 0 and at the head coordinate eval (coordForm e) x. Exactness — rather than a one-sided bound — is forced: ordinary leaves permit negative chip coefficients, so a chip landing on an endpoint can make the actual endpoint contribution smaller, and an inequality in the wrong direction would be useless to W5.

The reason no geometry is needed is that chipMatches compares forms with formEq, i.e. syntactically. Arith.eval_eq_of_formEq therefore identifies a matched chip with its named point at every parameter point, so the two indicators agree chipwise:

Finally, W1's slack discipline bounds the realized collapse count by the declared slack, which is what the minOver in tailContribution / headContribution needs.

Elementary sum plumbing #

The head-side chip sum used by headCandidate, named so that the bridge can be stated without repeating the fold.

Equations
Instances For

    chipPrefix as a single list sum of per-chip first-match indicators.

    theorem Utilities.Subdivision.ClosedRowProof.RichWitness.headChipSum_eq_chipwise (w : RichWitness) (a e s : ℕ) :
    w.headChipSum a e s = (List.map (fun (c : ℕ × Form × ℤ) => ∑ t ∈ Finset.range (s + 1), if t = 0 then 0 else if (w.blockList a e).length - t = 0 then 0 else if w.chipMatches a e ((w.blockList a e).length - t) c = true then c.2.2 else 0) w.chips).sum

    headChipSum as a single list sum of per-chip first-match indicators.

    The chipwise first match #

    theorem Utilities.Subdivision.ClosedRowProof.RichWitness.exists_unique_chipMatches {n p : ℕ} (w : RichWitness) (core : Certificate.ExplicitPotential.Core n p) (hW3 : w.w3Checks core = true) (a : Fin n) {c : ℕ × Form × ℤ} (hc : c ∈ w.chips) :
    ∃ (i : ℕ), 1 ≤ i ∧ i ≤ (w.blockList (↑a) c.1).length - 1 ∧ formEq c.2.1 (w.point (↑a) c.1 i) = true ∧ w.chipMatches (↑a) c.1 i c = true ∧ ∀ (j : ℕ), 1 ≤ j → w.chipMatches (↑a) c.1 j c = true → j = i

    First-match existence and uniqueness. On an accepted rich leaf every raw chip has exactly one nonzero named index at which chipMatches fires, and that index is a genuine interior index of the anchor's block list.

    Index 0 is deliberately excluded from the uniqueness clause: point a e 0 is the empty form, so a chip whose form is identically zero also matches there. The checker never reads index 0 (chipAt returns 0), so this is exactly the uniqueness statement the accounting needs.

    The tail bridge #

    theorem Utilities.Subdivision.ClosedRowProof.RichWitness.rawChipMassAt_zero_eq_chipPrefix {n p : ℕ} (w : RichWitness) (core : Certificate.ExplicitPotential.Core n p) (hW3 : w.w3Checks core = true) (x : List ℤ) (a : Fin n) (e : Fin p) (s : ℕ) (hzero : ∀ (i : ℕ), 1 ≤ i → i ≤ s → w.pointValue x (↑a) (↑e) i = 0) (hpos : ∀ (i : ℕ), s < i → i ≤ (w.blockList ↑a ↑e).length - 1 → w.pointValue x (↑a) (↑e) i ≠ 0) :
    w.rawChipMassAt x (↑e) 0 = w.chipPrefix (↑a) (↑e) s

    The W5 tail chip bridge. The physical signed chip mass at the tail coordinate of slot e is exactly the checker's first-match prefix sum through the last collapsed named point.

    The two hypotheses say precisely that the named points 1, …, s are the ones which have fallen into the tail; no other geometric input is used, because chipMatches identifies a chip with its named point syntactically.

    The head bridge #

    theorem Utilities.Subdivision.ClosedRowProof.RichWitness.rawChipMassAt_length_eq_headChipSum {n p : ℕ} (w : RichWitness) (core : Certificate.ExplicitPotential.Core n p) (hW3 : w.w3Checks core = true) (x : List ℤ) (a : Fin n) (e : Fin p) (s : ℕ) (L : ℤ) (hs : s ≤ (w.blockList ↑a ↑e).length - 1) (hhead : ∀ (i : ℕ), (w.blockList ↑a ↑e).length - s ≤ i → i ≤ (w.blockList ↑a ↑e).length - 1 → w.pointValue x (↑a) (↑e) i = L) (hlow : ∀ (i : ℕ), 1 ≤ i → i < (w.blockList ↑a ↑e).length - s → w.pointValue x (↑a) (↑e) i ≠ L) :
    w.rawChipMassAt x (↑e) L = w.headChipSum (↑a) (↑e) s

    The W5 head chip bridge, the mirror of rawChipMassAt_zero_eq_chipPrefix at the far endpoint of the slot. Here s counts the named points which have fallen into the head, and L is the evaluated slot length.

    The interior bridge #

    W4's residual is stated against w4ChipSum, the first-match chip total over a run of named indices. At a forward selector change the run is a maximal block of named indices sharing one strictly interior coordinate, so the same chipwise argument as at the endpoints identifies it with the physical chip mass there. Unlike the endpoint bridges no index 0 case arises, because a W4 run starts at 1.

    theorem Utilities.Subdivision.ClosedRowProof.RichWitness.w4ChipSum_eq_chipwise (w : RichWitness) (a e i j : ℕ) (hI : 1 ≤ i) :
    w4ChipSum (fun (t : ℕ) => w.chipAt a e t) i j = (List.map (fun (c : ℕ × Form × ℤ) => ∑ t ∈ Finset.range (j + 1 - i), if w.chipMatches a e (i + t) c = true then c.2.2 else 0) w.chips).sum

    w4ChipSum as a single list sum of per-chip first-match indicators.

    theorem Utilities.Subdivision.ClosedRowProof.RichWitness.rawChipMassAt_eq_w4ChipSum {n p : ℕ} (w : RichWitness) (core : Certificate.ExplicitPotential.Core n p) (hW3 : w.w3Checks core = true) (x : List ℤ) (a : Fin n) (e : Fin p) (i j : ℕ) (q : ℤ) (hI : 1 ≤ i) (hIJ : i ≤ j) (hrun : ∀ (t : ℕ), i ≤ t → t ≤ j → w.pointValue x (↑a) (↑e) t = q) (hbelow : ∀ (t : ℕ), 1 ≤ t → t < i → w.pointValue x (↑a) (↑e) t ≠ q) (habove : ∀ (t : ℕ), j < t → t ≤ (w.blockList ↑a ↑e).length - 1 → w.pointValue x (↑a) (↑e) t ≠ q) :
    w.rawChipMassAt x (↑e) q = w4ChipSum (fun (t : ℕ) => w.chipAt (↑a) (↑e) t) i j

    The W4 interior chip bridge. The physical signed chip mass at a coordinate carried by exactly the named points i, …, j of the anchor is the checker's first-match run total.

    The three hypotheses say that i … j is the maximal run of named interior indices at the coordinate; that is what a forward selector change supplies.

    Realizing the collapse counts, with W1's slack discipline #

    The bridges above take the realized collapse count as a parameter. W1 supplies it: the named points are weakly monotone, so the collapsed ones form a prefix (resp. a suffix), and the positiveCheck receipts on point a e (α + 1) and on coordForm e − point a e (k − 1 − ω) bound that prefix (resp. suffix) by the declared slack. That bound is exactly what tailContribution_le_candidate / headContribution_le_candidate need.

    theorem Utilities.Subdivision.ClosedRowProof.RichWitness.exists_tail_collapse {n p : ℕ} (w : RichWitness) (core : Certificate.ExplicitPotential.Core n p) (Γ : Context) (x : List ℤ) (hW1 : w.w1Checks core Γ = true) (hW3 : w.w3Checks core = true) (hx : Γ.Holds x) (a : Fin n) (e : Fin p) :
    ∃ s ≤ (w.plan ↑a).headSlack.getD (↑e) 0, s ≤ (w.blockList ↑a ↑e).length - 1 ∧ w.pointValue x (↑a) (↑e) s = 0 ∧ (∀ (i : ℕ), s < i → i ≤ (w.blockList ↑a ↑e).length - 1 → w.pointValue x (↑a) (↑e) i ≠ 0) ∧ w.rawChipMassAt x (↑e) 0 = w.chipPrefix (↑a) (↑e) s

    The realized tail collapse count of an accepted rich leaf, with the tail bridge and the W1 slack bound. This is the hypothesis-shaped form consumed by RichW5Aggregation.w5ActualResidual_class_nonneg.

    theorem Utilities.Subdivision.ClosedRowProof.RichWitness.exists_head_collapse {n p : ℕ} (w : RichWitness) (core : Certificate.ExplicitPotential.Core n p) (Γ : Context) (x : List ℤ) (hW1 : w.w1Checks core Γ = true) (hW3 : w.w3Checks core = true) (hx : Γ.Holds x) (a : Fin n) (e : Fin p) :
    ∃ s ≤ (w.plan ↑a).tailSlack.getD (↑e) 0, s ≤ (w.blockList ↑a ↑e).length - 1 ∧ w.pointValue x (↑a) (↑e) ((w.blockList ↑a ↑e).length - s) = eval (coordForm ↑e) x ∧ (∀ (i : ℕ), 1 ≤ i → i < (w.blockList ↑a ↑e).length - s → w.pointValue x (↑a) (↑e) i ≠ eval (coordForm ↑e) x) ∧ w.rawChipMassAt x (↑e) (eval (coordForm ↑e) x) = w.headChipSum (↑a) (↑e) s

    The head-side mirror of exists_tail_collapse.

    theorem Utilities.Subdivision.ClosedRowProof.RichWitness.no_chip_on_coord_eq_zero {n p : ℕ} (w : RichWitness) (core : Certificate.ExplicitPotential.Core n p) (Γ : Context) (x : List ℤ) (hn : 0 < n) (hW1 : w.w1Checks core Γ = true) (hW3 : w.w3Checks core = true) (hx : Γ.Holds x) (e : Fin p) (hcoord : eval (coordForm ↑e) x = 0) (chip : ℕ × Form × ℤ) :
    chip ∈ w.chips → chip.1 ≠ ↑e

    A zero-length displayed slot carries no raw chips on that slot in an accepted rich leaf. This is the zero-slot half of the W5 endpoint accounting: its two physical endpoints are the same quotient-core vertex, so the tail and head mass must not be added. W1 makes the two maximal collapsed runs exhaust the named points; its α + ω + 1 ≤ k discipline then forces k = 1, and W3 has no interior named index at which a chip could occur.

    theorem Utilities.Subdivision.ClosedRowProof.RichWitness.rawChipMassAt_eq_zero_of_coord_eq_zero {n p : ℕ} (w : RichWitness) (core : Certificate.ExplicitPotential.Core n p) (Γ : Context) (x : List ℤ) (hn : 0 < n) (hW1 : w.w1Checks core Γ = true) (hW3 : w.w3Checks core = true) (hx : Γ.Holds x) (e : Fin p) (hcoord : eval (coordForm ↑e) x = 0) (coordinate : ℤ) :
    w.rawChipMassAt x (↑e) coordinate = 0

    Consequently each physical endpoint mass of a zero-length displayed slot is zero. This is the form used when one endpoint contribution is retained and the other is omitted in the quotient-core W5 sum.

    The W5 endpoint comparisons #

    Composing the bridge with minOver_le_candidate gives the two inequalities in the shape RichW5Aggregation.w5ActualResidual_class_nonneg consumes, with the actual endpoint contribution still written as the physical chip mass plus (resp. minus) the declared slope bound of the first surviving (resp. last surviving) block. Only the slope comparison — W2's lo ≤ actual ≤ hi on that block — remains between these and the closed-face endpoint contributions.

    theorem Utilities.Subdivision.ClosedRowProof.RichWitness.exists_tailContribution_le {n p : ℕ} (w : RichWitness) (core : Certificate.ExplicitPotential.Core n p) (Γ : Context) (x : List ℤ) (hW1 : w.w1Checks core Γ = true) (hW3 : w.w3Checks core = true) (hx : Γ.Holds x) (a : Fin n) (e : Fin p) :
    ∃ s ≤ (w.blockList ↑a ↑e).length - 1, w.pointValue x (↑a) (↑e) s = 0 ∧ (∀ (i : ℕ), s < i → i ≤ (w.blockList ↑a ↑e).length - 1 → w.pointValue x (↑a) (↑e) i ≠ 0) ∧ w.tailContribution ↑a ↑e ≤ w.rawChipMassAt x (↑e) 0 + (w.block (↑a) (↑e) s).lo

    W5's conservative tail contribution is dominated by the physical chip mass at the tail plus the declared lower slope bound of the first block which survives the collapse. The returned index s is the last named point that has fallen into the tail.

    theorem Utilities.Subdivision.ClosedRowProof.RichWitness.exists_headContribution_le {n p : ℕ} (w : RichWitness) (core : Certificate.ExplicitPotential.Core n p) (Γ : Context) (x : List ℤ) (hW1 : w.w1Checks core Γ = true) (hW3 : w.w3Checks core = true) (hx : Γ.Holds x) (a : Fin n) (e : Fin p) :
    ∃ s ≤ (w.blockList ↑a ↑e).length - 1, w.pointValue x (↑a) (↑e) ((w.blockList ↑a ↑e).length - s) = eval (coordForm ↑e) x ∧ (∀ (i : ℕ), 1 ≤ i → i < (w.blockList ↑a ↑e).length - s → w.pointValue x (↑a) (↑e) i ≠ eval (coordForm ↑e) x) ∧ w.headContribution ↑a ↑e ≤ w.rawChipMassAt x (↑e) (eval (coordForm ↑e) x) - (w.block (↑a) (↑e) ((w.blockList ↑a ↑e).length - 1 - s)).hi

    The head-side mirror of exists_tailContribution_le. Here (w.blockList a e).length - s is the first named point that has reached the head, and (w.blockList a e).length - 1 - s indexes the last surviving block.