Skip to content

wave 10a of 16 - #5009

Merged
phasetr merged 11 commits into
mainfrom
docs/4984-w10-specialcases-headers
Aug 9, 2026
Merged

wave 10a of 16#5009
phasetr merged 11 commits into
mainfrom
docs/4984-w10-specialcases-headers

Conversation

@phasetr

@phasetr phasetr commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Refs #4984

Wave 10a of 16 — AmbientLattice/SpecialCases/HighTemperature* + Mayer* header rewrite

COMPLETE. Split from wave 10 (was previously scaffolded as the full 149-file
SpecialCases/ wave — that exceeded the design report's less-than-or-equal-to 100-file/wave
and came within 1 declaration of the less-than-or-equal-to 300-declaration/wave guard rails,
design report section 3). Split along family boundaries into 10a (this PR,
HighTemperature*/Mayer*) and 10b (branch docs/4984-w10b-specialcases-headers, scaffolded
as PR #5010, the other 9 families, not yet implemented). Neither family is divided between the
two sub-waves. Overall campaign wave count stays 16 (this is two PRs replacing one, not a
renumbering of waves 11-16).

Scope frozen against main = 7ea1cbdd5549b566730db46d3192f26fc1468adb (wave 9 / PR #5006's
merge commit, unchanged since the original wave-10 freeze), recorded in the freeze comments:

Scope

metric value
files 74 (HighTemperature* 50 + Mayer* 24)
--findings rows (charged + telemetry) 132
charged population (the ratchet's authoritative figure) 90 (32 NARROW_CHILD + 58 RELOCATION)
declarations 168
MISSING_MODULE_DOC 0 (pure rewording)

Correction to the freeze figure (filed as new issue #5012): the freeze recorded "132
charges" for this sub-wave. 132 is the --findings row count, which mixes the ratchet's
90 charged rows with 42 rows the ratchet's own report prints under
# TELEMETRY (NON-AUTHORITATIVE) ... NOT part of the population, never pinned. The charged
population is 90, and the ratchet baseline (below) fell by exactly 90. This is a recurrence of
the wave 7/8 lesson already recorded in this PR's own standing checklist ("freeze-time charge
counts can conflate --findings rows with charges") — the freeze was written after that
lesson and conflated them anyway, so #5012 exists to fix the freeze procedure rather than
re-deriving the arithmetic by hand every wave.

Per-family subtotals (row counts, with the charged/telemetry split):

family (filename prefix) files --findings rows charged NARROW_CHILD RELOCATION telemetry declarations
HighTemperature* 50 94 69 25 44 25 85
Mayer* (all Mayer-prefixed variants) 24 38 21 7 14 17 83
total (74 files) 74 132 90 32 58 42 168

Frozen file set (74 files)

See the split freeze comment for the full list — not restated here to avoid a second copy that
can drift: #4984 (comment)

Acceptance criteria (AC1-AC8, carried forward from #4984 — all lessons from waves 1-9 apply)

  • AC1 — coverage. git diff --name-only 2b9cd775..HEAD = the 74 frozen files exactly,
    plus scripts/audit/header_claim_baseline.tsv (75 paths total, machine set-differenced
    against the frozen list; the baseline is the only non-frozen path). Intension-only
    conversion applied throughout: counts, exhaustive declaration enumerations,
    ## Moved:/## Removed: blocks, in-header PR provenance, and .lean path references
    were removed, not renumbered. Cardinality-idiom sweep: all draft occurrences of "Both
    statements ..." (6 files) rewritten to "Each statement ..."; 0 surviving bare-cardinality
    idioms about module inventory ("the two wrappers", "the three lemmas", "N theorems").
    Counts of named mathematical objects (two-sided bounds, two named trivial slices) are
    retained under the named-objects exception, not counted as defects.
  • AC2 — ratchet.
    • --check before (base 7ea1cbdd): baseline 453 charged / 362 keys.
    • --check after (head c913cca4): PASS, live == baseline at 363 charged / 277
      keys
      , all five conservation laws (K0-K4) PASS.
    • --findings on the 74 files after: 0 rows, charged or telemetry.
    • --check-baseline-drift: PASS ("the pin moved only where this diff explains it"),
      base commit 7ea1cbdd via origin/main.
    • --self-test: OK, 184 tests. Instrument unmodified in this PR (only the baseline TSV
      changed, -85 lines, nothing else).
    • Class split for this 74-file subset, re-derived at implementation time (not copied from
      the combined wave-10 freeze's 143/126 over the full 149): 32 NARROW_CHILD + 58
      RELOCATION = 90 charged
      , matching the per-family table above exactly.
  • AC3 — header truth, 100% of the wave, not a sample. Every one of the 74 files
    reviewed against its actual declaration list (identifiers, citation spans, strength
    words, universal words, binder-precision hypotheses, route verbs).
    • Zero/nonzero mathematical characterization sweep (wave 9 lesson). All 74 files
      scanned, not only files whose names suggest a closed-form claim. 26 sites make a
      vanishing/non-vanishing/positivity/strict-inequality claim; 25 are verbatim
      restatements of the pinned theorem (hypotheses included), 1 is derived and was derived
      in full
      (MayerEdgeCases: each zero-activity slice reduces Real.tanh applied to an
      argument that is exactly 0 by zero_mul/mul_zero/the hypothesis, admissible domain
      is all of for the remaining free parameter, so the claim is unconditional on that
      domain rather than a root-set statement). Independently re-derived by dev-review with a
      wider regex over all 74 headers: same 26-site set, no site outside it. No header
      asserts non-vanishing anywhere
      (0 hits for nonzero|non-zero|non-vanish|never,
      confirmed independently by dev-review).
    • Negative-provenance sweep (wave 9 lesson N1). Grepped the produced headers for
      rather than | not derived | NOT | neither | without | no hypothesis | unrestricted | instead of | as opposed | \bnot\b. 7 found in the first draft, all 7 eliminated
      before the first commit (e.g. "takes the stage volume's nonemptiness rather than
      0 < |Λ|" to "takes the stage volume's nonemptiness as a hypothesis"; "Without a
      hypothesis on |Λ|" to "Under 0 ≤ J and 0 < β alone"). A self-contradiction was
      caught in the same pass and fixed: a draft scope sentence claimed every statement in
      ...ExpansionLowerUpperConsistency carries DecidableEq V, immediately followed by "both
      statements additionally omit the DecidableEq V instance" — both theorems do carry
      omit [DecidableEq V] in, so the shared sentence was false; replaced with a file-local
      scope sentence.
      • Sweep-methodology correction (dev-review LOW-2, applied here): the implementer's
        grep pattern did not include the word "omit", so it could not have caught — and was
        never meant to catch — the one surviving sentence that legitimately uses "omits" as a
        positive deviation disclosure ("... and omits DecidableEq V",
        HighTemperatureBoundsExpansionLowerUpperConsistency.lean:8, verified true: it is the
        only file in the wave with an omit [DecidableEq V] in site). That sentence is
        correct and required, not a banned negative-provenance claim; the sweep's pattern
        description is stated here with that carve-out made explicit, rather than described as
        an unqualified "0 hits" that would misleadingly imply the pattern covers all
        negative-sounding vocabulary. dev-review's own wider regex (superset, includes
        omits?) found exactly this one additional hit and classified it correctly as a
        required disclosure, not a defect.
  • AC4 — zero Lean logic change. Two independent oracles, both confirming 0 differences
    over all 74 files:
    1. In-tool guard: nesting-aware comment-stripped line list recomputed before/after every
      file, aborts on any difference — 74/74 passed.
    2. Post-hoc, independently re-derived by dev-review with a stricter oracle written from
      scratch (comment-stripped byte-exact non-comment lines with indentation preserved, not
      the implementer's whitespace-collapsed token stream): 0 differences, all 74 files.
    3. Comment-aware per-file import-list equality (not git diff -G'^import'): 196 import
      lines across the 74 files, order included, 0 files changed — confirmed independently
      by dev-review.
      Every diff hunk lies inside a comment span. git diff --check: clean.
  • AC5 — gates, zero regressions.
    • lake build: exit 0, Build completed successfully (4944 jobs), wall 5:45. Zero
      warnings (grep -inE "warning|error|sorry" over the full log: 0 hits). Recompile cone:
      173 modules (74 edited + 99 downstream) = 9.0% of the 1916 tracked IsingModel
      modules, predicted from the import graph before building and confirmed after (173
      Built lines).
    • lake exe GKSTest: exit 0, all tests passed.
    • lake build test.IsingModel.SentinelProps: exit 0, 901 jobs, no warnings.
    • scripts/audit_gate.py --self-test: OK, 179 tests (1 skipped). --full: PASS (V1 0
      axiom decls / 1922 files; V2 0 sorry/admit/native_decide / 1922 files; V3 13 capstones,
      union {Classical.choice, Quot.sound, propext}; V4 0 Japanese / 1977 tracked files).
    • scripts/citation_audit.py: PASS, byte-identical before/after (verified against a
      detached git worktree at 2b9cd775): citations 2693 -> 2827 (+134); ratchet: OK -- 37 finding(s) cleared, 0 new. Zero net movement caused by this wave (inherited branch
      state).
    • scripts/import_dag_contract.py --check: PASS, 0 baseline entries, unchanged.
      scripts/test_import_dag_contract.py: OK, 77 tests. No import line added, removed, or
      moved (git diff -G'^import' and git diff -U0 | grep '^[+-]import ' both empty).
    • grep -rn "sorry" IsingModel/: 2 hits, both the literal words "no sorry" inside
      pre-existing doc comments outside this wave's files, both present verbatim on main.
      audit_gate.py V2 (the authoritative check) distinguishes these and is PASS.
    • Codepoint line length: exactly 1 line over 100 codepoints across the 74 files
      (HighTemperatureBoundsRatioLogFeFreeEnergyBoundOnly.lean:2, a 101-codepoint import
      line), byte-identical to 2b9cd775 and pre-existing/unbreakable, accepted by lake build under the repo's linter settings. Every line the implementer authored is <=92
      codepoints.
    • English only: 0 Japanese by audit_gate.py V4 and by an independent Unicode-class grep
      over the 74 files.
  • AC6 — review discipline + coverage attestation.
    • Round 1 (only round — clean on first pass), reviewed commit c913cca4:
      • dev-review verdict: APPROVE. H/H = 74/74 headers. D/D = 168/168 declarations
        (HighTemperature* 85/85, Mayer* 83/83, both independently machine-counted). A/A =
        0/0 (no newly authored headers, MISSING_MODULE_DOC = 0). ~40/74 files read in full
        depth (header + every statement); the remaining 34 covered by machine sweeps
        (hypothesis-disclosure coverage over all 74, identifier existence over 31 backticked
        candidates, instance-binder census over all 168, layer partition over 8 mixed-layer
        files, AC4). 3 LOW findings, all report/PR-body layer, none in code or headers (the 3
        corrections applied in this body). No High, no Medium.
      • Codex independent cross-review verdict: APPROVE ("No real defects found"), 27
        files read in depth. Report: .self-local/tmp/codex-w10a-out.txt.
      • Full report: .self-local/reports/dev-review-4984-w10a.md.
    • dev-issue-manager resolution verification: confirmed before this completion claim (no
      unresolved findings; the 3 LOW findings are report-accuracy corrections applied in this
      body, not code defects requiring further code rounds).
  • AC7 — falsification rule. Closed at round 1 — the first wave since wave 5 to
    reach a clean round from both reviewers on the first pass. Confirms the size premise at
    74 files / 168 declarations for pure rewording. New-authoring risk calibration
    caveat (wave 9 lesson, stated per AC7's requirement, not promoted further): this
    sub-wave carries 0 authoring files (MISSING_MODULE_DOC = 0), so the authoring-risk
    multiplier does not apply here
    — see the calibration note below for why this round-1
    result should not yet be read as confirming the broader "generative constraints
    prevent defects" methodology claim.
  • AC8 — pre-review checklist over 100% before round 1. Predicate noun phrases
    resolved against repo defs (polymerFreeEnergy, mayerPartialSum,
    mayerExpansionTerm, vdCompatiblePolymerFamilies, allPolymers, evenSubgraphs,
    ursellCoefficient, clusterSeqActivity, highTempExpRate, inducedGraph,
    Exhaustion, freeEnergyAlongExhaustion, partitionFunctionAlongExhaustion,
    correlationAlongExhaustion). Binder-level hypothesis scoping by machine telescope for
    all 168 declarations. Bare-cardinality idiom sweep: measured (see AC1). Same-file
    /-- <-> /-! consistency: no new header contradicts a declaration doc comment in its
    own file (two pre-existing /-- defects found and filed as Errata: a verbatim-duplicate _pow_two_lt_of_nonempty wrapper that takes no nonemptiness hypothesis, plus its doc comment (wave 10a scope) #5011 rather than fixed,
    since fixing them would be a deletion/rename AC4 forbids in a pure-rewording wave).
    Instance-binder census: all 168 declarations take
    [∀ n, Fintype (inducedGraph G (Λ.volume n)).edgeSet] (0 exceptions), all 74 files
    carry variable {V : Type*} [DecidableEq V], the single omit [DecidableEq V] site is
    disclosed in that file's own header. Mixed-layer scope: the 8 along-exhaustion-vs-Λ
    correlation files are split explicitly (0 misattributions, independently confirmed by
    dev-review). PR-body raw-HTML self-check: performed on this body before submission (no
    literal angle brackets, including inside inline code, per the wave 9 CI-trap lesson).
    Exclusivity claims enumeration: 5 (not 4 — corrected from the implementer's
    report): HighTemperatureBounds ("takes only the stage index n, the site set A,
    and the hypothesis Odd A.card"); ...Deviation ("under 0 ≤ β * J alone");
    ...DeviationFerro ("under 0 ≤ J and 0 < β alone"); ...RatioLogFeNonemptyZ ("the
    Prop-valued hypotheses are exactly 0 < β * J and 0 < |E|" — this disclosure is what
    exposed errata Errata: a verbatim-duplicate _pow_two_lt_of_nonempty wrapper that takes no nonemptiness hypothesis, plus its doc comment (wave 10a scope) #5011); and the 5th, found independently by dev-review and missing from
    the implementer's original count, HighTemperatureBoundsExpansion ("This module
    states nothing of its own" — verified: 0 comment-aware declarations, imports exactly
    the two named modules, 18 modules import it). AC5 evidence filled inline above with
    real numbers throughout, never left [PENDING].

Accumulated lessons carried forward from waves 1-9 (standing checklist)

  • Waves 1-4: predicate noun phrase must resolve against a repo def; binder-level hypothesis
    scoping; bare-cardinality idioms eliminated semantically, not regex-dodged; same-file /--
    <-> /-! consistency.
  • Wave 5/6: declaration counts must be comment-and-attribute-aware. AC5 evidence must be
    filled incrementally as gates actually run, never left as a stale scaffold.
  • Wave 7/8: per-item scope-qualifier check required on mixed-layer files; freeze-time charge
    counts can conflate --findings rows with charges — recount and correct in-body if the two
    diverge (recurred again this wave, see the scope-table correction above and Errata: #4984's per-wave "charges" figure counts the ratchet's non-authoritative TELEMETRY rows (wave 10a frozen at 132; the charged population was 90) #5012).
  • Wave 9: new-authoring risk calibration is not transferable; the zero/nonzero
    characterization defect class (closed form -> admissible domain -> root set -> sign, in
    that order); no negative provenance claims.
  • Wave 10a (this PR): a fourth lesson-class, disclosure-forcing vs. prohibition
    constraints.
    The one genuinely new defect surfaced this wave (Errata: a verbatim-duplicate _pow_two_lt_of_nonempty wrapper that takes no nonemptiness hypothesis, plus its doc comment (wave 10a scope) #5011, a verbatim-duplicate
    declaration with a misleading name) was not caught by either wave-9 prohibition sweep. It
    fell out of the exclusivity-disclosure discipline (forcing enumeration of the full
    hypothesis telescope), not out of a "do not say X" rule. See the calibration note below.

Calibration note (do not promote to a confirmed methodology finding yet)

This wave applied wave 9's zero/nonzero and negative-provenance lessons proactively and
closed at round 1 with zero code findings from both independent reviewers — the first wave
since wave 5 to do so. dev-review explicitly cautions this should not yet be promoted to a
confirmed campaign methodology finding
("generative pre-push constraints prevent defects
better than reactive review-round corrections"), for two compounding reasons specific to this
wave:

  1. 0 MISSING_MODULE_DOC. This wave contains no new-authoring activity at all — every
    one of the 74 files already had a header to rewrite. Waves 8/9's defects were generated
    specifically while authoring prose for modules that had none; that defect-generating
    activity is simply absent here, not prevented.
  2. Maximally homogeneous content. All 168/168 declarations share one instance binder
    pattern, all 74/74 files share one variable line, and nearly every statement is a thin
    pass-through to a Λ-level lemma — the easiest possible case for "restate the pinned
    statement, do not derive."

Because content difficulty moved in the easy direction between wave 9 and wave 10a, "fewer
defects" is confounded with "easier content," not isolated as an effect of the generative
constraints alone. The true test of whether generative constraints prevent defects is a
future wave that does include MISSING_MODULE_DOC (new-authoring) content; this
determination is explicitly deferred until re-tested on such a wave.

What the gates do not guarantee

Nothing mechanical in this repository checks header truth. The ratchet detects only
recognized legacy inventory syntax; lake build never reads comment content; audit_gate
V1-V4 are axiom/sorry/capstone/Japanese only; citation_audit has previously been shown
insensitive to citation-only diffs; import_dag_contract sees no prose. The truth guarantee
for this wave rests on the manual read (~40/74 files read in full depth by dev-review, 27 by
Codex) and the machine coverage sweeps over all 74 (hypothesis disclosure, identifier
existence, instance binder, layer partition, AC4).

Also filed (not fixed in this wave, by design)

Deliberate non-actions

Scaffold commit for wave 10; scope frozen in the issue comment, no file
edits yet.

Refs #4984
phasetr and others added 10 commits August 10, 2026 08:12
Rewrite the 8 `SpecialCases/MayerVdRegularity*` module headers to intension-only prose:
what each module states about continuity, differentiability and the derivative of the
Mayer partial sum, the Mayer expansion term and the vertex-disjoint compatible
polymer-family sum, in the activity and in `β`/`J`. Counted claims, declaration-name
enumerations, `## Moved:` blocks, in-header provenance and `.lean` path references are
dropped rather than renumbered.

Comment-only: the comment-stripped, whitespace-normalized token stream of every file is
byte-identical to `2b9cd775`.

Refs #4984

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Rewrite the 10 `SpecialCases/Mayer{EpsilonInfrastructure,ExpansionEdgeCases,
FilterConnected,RecurrenceHasSum}*` module headers to intension-only prose: the sign of
the order-1 and order-2 Mayer terms, the reduced polymer-family sum `ε` at and near zero
activity, the order-2 and truncation-order-2 closed forms, the triangle-inequality bound,
the connected-sequence sub-finset at small order, and the Mayer recurrence together with
the alternating logarithmic series for `polymerFreeEnergy`. Counted claims, declaration
enumerations, `## Moved:` blocks, in-header provenance and `.lean` path references are
dropped rather than renumbered.

Comment-only: the comment-stripped, whitespace-normalized token stream of every file is
byte-identical to `2b9cd775`.

Refs #4984

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Rewrite the 6 `SpecialCases/Mayer{EdgeCases,StrictPositivity,TanhFerromagneticIff,
TrivialCases,VdBounds,VdIff}` module headers to intension-only prose: the Mayer identity
at the zero-activity slices and on stage subgraphs with no polymer or no edge, the bounds
and equivalences for the vertex-disjoint compatible polymer-family sum `Ξ` and its reduced
form `ε`, and the strict positivity / strict monotonicity available once a polymer exists.
Every vanishing and non-vanishing claim is a restatement of the pinned theorem, hypotheses
included. Counted claims, declaration enumerations, `## Moved:` blocks, in-header
provenance and `.lean` path references are dropped rather than renumbered.

Comment-only: the comment-stripped, whitespace-normalized token stream of every file is
byte-identical to `2b9cd775`.

Refs #4984

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…4984)

Rewrite the 8 `SpecialCases/HighTemperatureBoundsExpansion*` module headers to
intension-only prose: the general-field product and subset expansions of the partition
function, the `Real.cosh` two-sided bounds and closed forms for `Z`, `log Z` and `f` at
zero field, the trivial-slice values `Z = 2 ^ |Λ|`, and the lower-le-upper consistency
statements (whose `omit [DecidableEq V]` is now disclosed instead of contradicted).
`HighTemperatureBoundsExpansion.lean` carries no declaration of its own and now says so.
Counted claims, declaration enumerations, `## Moved:` blocks, in-header provenance and
`.lean` path references are dropped rather than renumbered.

Comment-only: the comment-stripped, whitespace-normalized token stream of every file is
byte-identical to `2b9cd775`.

Refs #4984

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Rewrite the 7 `SpecialCases/HighTemperatureBoundsExpSharper*` module headers to
intension-only prose: the exponential upper bounds on `Z`, `log Z` and `f` at zero field,
their two-sided `Real.cosh`-to-`Real.exp` sandwich forms, and the packaged free-energy
summaries that add the trivial-slice values `f = Real.log 2`. Hypothesis sets are stated
per statement, so the `0 ≤ J` / `0 < β` variants no longer read as an unqualified
"ferromagnetic" label. Counted claims, declaration enumerations, `## Moved:` blocks,
in-header provenance and `.lean` path references are dropped rather than renumbered.

Comment-only: the comment-stripped, whitespace-normalized token stream of every file is
byte-identical to `2b9cd775`.

Refs #4984

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Rewrite the 7 `SpecialCases/HighTemperatureBoundsDeviation*` module headers to
intension-only prose: how far `f` and `log Z` at zero field may sit above `Real.log 2` and
`|Λ| * Real.log 2`, the quantitative continuity of `f` in `J` and in `β`, and the strict
forms of both once `0 < β * J` and the stage subgraph has an edge. Each header states its
own hypothesis set, including the `0 < |Λ|` that only some of the statements take.
Counted claims, declaration enumerations, `## Moved:` blocks, in-header provenance and
`.lean` path references are dropped rather than renumbered.

Comment-only: the comment-stripped, whitespace-normalized token stream of every file is
byte-identical to `2b9cd775`.

Refs #4984

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Rewrite the 12 `SpecialCases/HighTemperatureBounds{Ratio*,TripleRatio}` module headers to
intension-only prose: the two-sided and upper bounds on the zero-field partition-function
ratio and on the `log Z` / `f` differences against each trivial slice, and the packaged
triple form that carries all three at once. Each header names the ratio or difference it
is about and the hypothesis set of its statements. The header of
`HighTemperatureBoundsRatioLogFeNonemptyZ` now states that statement's hypotheses exactly
(`0 < β * J`, `0 < |E|`), which is what exposed the duplicate filed as #5011.
Counted claims, declaration enumerations, `## Moved:` / `## Removed:` blocks, in-header
provenance and `.lean` path references are dropped rather than renumbered.

Comment-only: the comment-stripped, whitespace-normalized token stream of every file is
byte-identical to `2b9cd775`.

Refs #4984

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
#4984)

Rewrite the 8 `SpecialCases/HighTemperatureBounds{Correlation*,DecayCapstones*}` module
headers to intension-only prose: the elementary and trivial-slice values of the zero-field
one- and two-site correlations along an exhaustion, the single-edge lower bound and strict
positivity across an edge, and the exponential distance decay at an arbitrary admissible
rate and at the named `highTempExpRate`. The headers now separate the along-exhaustion
correlations at ambient sites from the finite-volume correlations at stage sites, and say
where the `correlationAlongExhaustion` default value `0` carries a bound. Counted claims,
declaration enumerations, `## Moved:` blocks, in-header provenance and `.lean` path
references are dropped rather than renumbered.

Comment-only: the comment-stripped, whitespace-normalized token stream of every file is
byte-identical to `2b9cd775`.

Refs #4984

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…rs (#4984)

Rewrite the 8 remaining `SpecialCases/HighTemperature*` module headers to intension-only
prose: the cluster-expansion convergence regime `(1 + t) ^ |E| < 2` and its
`Real.tanh (β * J)` form, with the squeeze `0 ≤ F ≤ ε ≤ (1 + t) ^ |E| - 1 < 1` and the
alternating logarithmic series; the two-sided polymer-family bounds and the strict
free-energy bound in that regime; the zero-field free-energy sandwich and the odd-set
numerator; and the closed forms writing `Z` and `f` through the polymer sum.
Counted claims, declaration enumerations, `## Moved:` blocks, in-header provenance,
`.lean` path references and one change-history line comment are dropped rather than
renumbered.

Comment-only: the comment-stripped, whitespace-normalized token stream of every file is
byte-identical to `2b9cd775`.

Refs #4984

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The 74 frozen files carried 90 charged rows (32 `NARROW_CHILD`, 58 `RELOCATION`) plus 42
non-authoritative telemetry rows on `main` `7ea1cbdd`; all 132 are gone and none was added
elsewhere, so 85 keys fell below their pin. Baseline moves 453 charges / 362 keys ->
363 / 277. `--check` and `--check-baseline-drift` both PASS against `origin/main`.

The freeze comment sized this wave at "132 charges"; that figure counts the telemetry rows
the ratchet's own report calls non-authoritative. Filed as #5012 rather than silently
reconciled here.

Refs #4984

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@phasetr
phasetr marked this pull request as ready for review August 9, 2026 23:37
@phasetr
phasetr merged commit 9c21660 into main Aug 9, 2026
9 of 10 checks passed
@phasetr
phasetr deleted the docs/4984-w10-specialcases-headers branch August 9, 2026 23:38
phasetr added a commit that referenced this pull request Aug 10, 2026
Refs #4984

## Wave 10b of 16 — `AmbientLattice/SpecialCases/` header rewrite (remaining 9 families)

**Split from wave 10** (originally scaffolded as the full 149-file `SpecialCases/` wave in PR
#5009 — that exceeded the design report's ≤100-file/wave and came within 1 declaration of the
≤300-declaration/wave guard rails, §3). Split along family boundaries into 10a
(`docs/4984-w10-specialcases-headers`, PR #5009, `HighTemperature*`/`Mayer*`) and 10b (this PR,
the other 9 families). Neither family is divided between the two sub-waves. Overall campaign
wave count stays 16 (this is two PRs replacing one, not a renumbering of waves 11–16).

Scope frozen against `main` = `7ea1cbdd5549b566730db46d3192f26fc1468adb` (wave 9 / PR #5006's
merge commit, unchanged since the original wave-10 freeze), recorded in the freeze comments:
- Original wave-10 freeze (149-file measurement this sub-wave is drawn from):
  #4984 (comment)
- This sub-wave's split freeze (single source of truth for the exact 75-file set — this body
  does not restate it):
  #4984 (comment)

### Scope

| metric | value |
|---|---:|
| files | **75** (9 families other than `HighTemperature*`/`Mayer*`) |
| charges | **137** |
| declarations | **131** |
| `MISSING_MODULE_DOC` | **0** (pure rewording) |

Per-family subtotals:

| family (filename prefix) | files | charges | declarations |
|---|---:|---:|---:|
| `PolymerFreeEnergy*` | 26 | 49 | 46 |
| `PartitionFreeEnergy*` | 15 | 29 | 26 |
| `JointRegularity*` | 7 | 13 | 10 |
| `Susceptibility*` | 7 | 11 | 11 |
| `FreeEnergy*` | 6 | 10 | 12 |
| `JointAnalyticity*` | 5 | 10 | 10 |
| `PartitionFunction*` | 4 | 8 | 6 |
| `VdPolymerFamilies*` | 3 | 5 | 6 |
| `InfiniteVolume*` | 2 | 2 | 4 |
| **total** | **75** | **137** | **131** |

### Frozen file set (75 files)

See the split freeze comment for the full list — not restated here to avoid a second copy that
can drift: #4984 (comment)

## Acceptance criteria (AC1–AC8, carried forward from #4984 — all lessons from waves 1–9 apply)

- [x] **AC1 — coverage.** Exactly the 75 frozen files, only them; intension-only conversion
      (R1/R2: counts, exhaustive enumerations, `## Moved:` blocks, in-header PR provenance all
      removed, not just number-corrected). Cardinality-idiom sweep reported as measured hits with
      adjudications, never a blanket "0 hits".
  - `git diff --name-only origin/main...HEAD` = **76** paths: the 75 frozen files (set-differenced
    against the freeze list, empty both ways) plus `scripts/audit/header_claim_baseline.tsv`,
    the only non-frozen path. Diffstat 733 insertions(+), 1403 deletions(-). Cardinality-idiom
    sweep: **0 surviving hits**, one draft hit found and fixed before push.
- [x] **AC2 — ratchet.** `--findings` reports 0 charges on all 75 files; `--check` green with
      baseline ratcheted as a multiset; `--check-baseline-drift` green; `--self-test` green,
      **instrument unmodified in this PR**. Review on the `--findings` diff, never totals. Any
      deviation explained in this body, not absorbed silently. Re-derive the `NARROW_CHILD`/
      `RELOCATION` class split for this 75-file subset at implementation time (the wave-10
      freeze's combined 143/126 covers the full 149, not this sub-wave alone). This sub-wave
      lands **after** 10a if both are open concurrently — re-verify `--check` PASS on the current
      baseline before implementing (10a's merge moves the baseline; do not assume it is still at
      the freeze-time 453/362 figures).
  - `--check` before: baseline **363 charges / 277 keys**, live 363/277, K0–K4 PASS.
  - `--check` after: pre-re-pin live **262 / 190** ("87 baseline key(s) now below their pin",
    informational); after `--baseline` re-pin, **PASS**, live == baseline at **262 charges / 190
    keys**, K0–K4 PASS. Movement −101 charges (exactly the 75 files' charged population), −87
    keys; telemetry 39 → 3, not pinned.
  - `--findings` on the 75 files after: **0 rows, charged or telemetry.**
  - `--check-baseline-drift`: PASS, base `9c21660a` via `origin/main`. `--self-test`: OK, 184
    tests, instrument unmodified (`git diff origin/main --stat -- scripts/` = one file,
    `header_claim_baseline.tsv`, −87 lines).
- [x] **AC3 — header truth, 100% of the wave, not a sample.** Every file reviewed against its
      actual declaration list: identifiers in a statement/proof (not just a name); citation span
      covers every realized `§x.y`; strength words realized by an actual conclusion head;
      universal words true of every declaration; hypotheses at binder precision; route verbs
      match the actual tactic script.
  - **Zero/nonzero mathematical characterization defect class (wave 9 lesson, mandatory here).**
    Any header sentence giving a closed-form expression and asserting it vanishes / does not
    vanish / has a fixed sign states, in order: the closed form itself → the admissible domain
    of every free parameter under the file's own hypotheses → the exact root set of the
    expression restricted to that domain → the sign on each remaining sub-interval. Do not check
    only "the expression" in isolation from the hypothesis-admissible parameter range (wave 9's
    M1/M2 both failed exactly this way). This sub-wave carries closed-form-heavy families
    (`PartitionFunctionClosedForms*`) — sweep all zero/nonzero/vanishing/sign claims across the
    75 files explicitly, not just the files whose names suggest it.
  - **No negative provenance claims (wave 9 lesson, N1, mandatory here).** State only what a
    proof *is* (the positive fact, discharged by exhibiting the proof term or citing the exact
    upstream lemma it applies). Never state what a proof is *not* derived from, or that some
    fact does *not* follow from some other route — a negative claim requires exhausting the
    transitive proof chain, and wave 9 produced a false one on the first attempt.
- [x] **AC4 — zero Lean logic change.** Comment-stripped token stream + non-blank comment-stripped
      line list byte-identical to `main`; comment-aware per-file import-list equality (not
      `git diff -G'^import'`); every **non-blank** diff line inside a comment span, and every
      blank-line deletion counted and reported separately — blank lines are invisible to all three
      facets above, so the criterion states them rather than asserting them away.
  - `AC4: 75 file(s) compared against origin/main; PASS -- no Lean content changed`
    (`.self-local/tmp/w10b/ac4_check.py`, `--self-test` OK, 16 checks). Diff line census over the
    75 files: **1194 comment lines removed / 705 added; 94 blank lines removed / 0 added, in 35
    files, outside any comment span; 0 code-carrying lines touched.** The 94 blank lines are the
    separators that sat between a deleted `## Moved:` / section block and the following code.
    Net line movement 583 agrees with `git diff --stat` (1316 − 733 on the 75 Lean files) and with
    the reviewer's independent classifier.
- [x] **AC5 — gates, zero regressions**, evidence filled incrementally as each gate runs (not
      left as scaffold past the point real output exists):
  - `lake build`: **exit 0, 4944 jobs, 0 warnings, 0 errors**, 15 min 45 s wall; recompile cone
    **1096 modules** rebuilt of 4944 jobs. Independently re-run by review: token-identity (AC4)
    makes a build regression impossible in principle, and CI's `build` job on `4bfc5c9b` is
    **pass** (26m16s).
  - `lake exe GKSTest`: **exit 0**, "=== All tests passed ===".
  - `lake build test.IsingModel.SentinelProps`: **exit 0**, 901 jobs, 0 warnings.
  - `scripts/audit_gate.py --self-test` then `--full`: **OK, 179 tests (1 skipped)**, then
    **PASS** — V1 no `axiom` (1922 files), V2 no sorry/admit/native_decide (1922 files), V3 13
    capstones all ⊆ {propext, Classical.choice, Quot.sound}, V4 no Japanese (1977 tracked files).
    Independently re-run by review with the same result.
  - `scripts/citation_audit.py` (pre-registered expect 0 net movement): **PASS**, findings 694,
    self-refs 112, ratchet "37 cleared, 0 new" — byte-identical to the pre-edit run. Independently
    re-run by review with the same result.
  - `scripts/import_dag_contract.py --check` + `scripts/test_import_dag_contract.py`: **PASS**, 0
    baseline entries, unchanged; **OK, 77 tests**. Independently re-run by review with the same
    result.
  - `grep -rn "sorry" IsingModel/` = **2 hits, both the phrase "no `sorry`" inside doc comments of
    files this wave did not touch; 0 in code.**
  - codepoint line length ≤100 over every touched file: max **94** over every non-`import` line
    in the 75 files; **2 lines exceed 100**, both pre-existing `import` lines left byte-identical
    by this PR. Independently re-verified by review with an oracle written from scratch: same 2
    lines, same max 94.
  - all edited prose English only: **0 Japanese codepoints** in the 75 headers, confirmed
    independently by `audit_gate.py` V4 and by review's own sweep.
- [x] **AC6 — review discipline + coverage attestation.** `dev-review` + independent Codex
      cross-review to a clean round (zero findings both sides); sampling forbidden; full
      re-review after every fix; `dev-issue-manager` resolution verification before any
      completion claim. Each reviewer, each round, records: reviewed commit SHA; `H/H` module
      headers; `D/D` declarations (denominator 131, to be confirmed); `A/A` newly authored
      headers (denominator 0); **per-family `D/D` subtotals mandatory** — the 9 strata above, no
      blanket sentence spanning a family boundary unless independently substantiated in each
      family it touches.
  - **Round 1** (reviewed commit `4bfc5c9b`): `dev-review`'s own verdict on the Lean content is
    **APPROVE** — no defect in the diff, in any of the 75 headers, or in any of the 131
    declarations, verified against a from-scratch kernel telescope (`lake env lean` + `#check` on
    all 131) and independent AC4/zero-nonzero/negative-provenance/exclusivity/mixed-layer sweeps.
    Codex's independent cross-review returned **REQUEST CHANGES** (one BLOCKING on AC4 wording,
    one MEDIUM on issue #5013's census); `dev-review` reproduced both measurements exactly and
    **downgraded the BLOCKING finding to LOW (claim-precision, not code)** — nothing about "zero
    Lean logic change" was violated, only the comparator's PASS message asserted more than the
    three facets it actually compares (blind to blank-line-only deletions). Coverage attestation:
    **75/75** module headers, **131/131** declarations, **0/0** newly authored headers, both
    reviewer and implementer independently. Per-family `D/D` (both sides agree): `PolymerFreeEnergy*`
    46/46, `PartitionFreeEnergy*` 26/26, `FreeEnergy*` 12/12, `Susceptibility*` 11/11,
    `JointRegularity*` 10/10, `JointAnalyticity*` 10/10, `PartitionFunction*` 6/6,
    `VdPolymerFamilies*` 6/6, `InfiniteVolume*` 4/4.
    - **F1 (LOW, claim precision)** — fixed without touching Lean: `ac4_check.py`'s message and
      this body's AC4 criterion corrected to state "every **non-blank** diff line inside a
      comment span, and every blank-line deletion counted and reported separately"; the census
      (94 blank / 35 files / 0 code) is now printed and self-tested (16 checks, up from the
      original set).
    - **F2 (MED, errata accuracy, outside this PR's files)** — issue #5013's layer census was
      short by one layer (4 layers/8 declarations, correct figure 5 layers/10 declarations, both
      reviewer and implementer independently found the same fifth pair); fixed by rewriting
      #5013's body directly on GitHub (title, table, consumer census, completeness check) and
      posting a correction comment. No Lean file touched, as #5013 stays out of this wave's
      scope.
    - Round 1 is the only round — no second round was required (both findings were claim-layer,
      fixed without a Lean-content change, and re-verified against the same reviewed commit
      `4bfc5c9b`).
- [x] **AC7 — falsification rule.** ≤3 rounds confirms the size premise at 75 files / 131
      declarations for pure rewording (well within the 299-declaration/149-file anchor the
      un-split wave 10 would have tested); 4+ rounds falls back to the largest declaration count
      smaller than this one that has actually closed at ≤3 rounds. **New-authoring risk
      calibration caveat (wave 9 lesson, mandatory to state, not to apply here):** this sub-wave
      carries **0** authoring files (`MISSING_MODULE_DOC` = 0), so the authoring-risk multiplier
      does not apply.
  - **Result: 1 round**, with a minor claim-precision correction (F1) — matches wave 10a's
    clean-round-1 result on a 9-family, non-uniform-instance-telescope corpus (168/168 declarations
    shared one instance binder in 10a; here 3 of 131 deviate in three different ways, all found
    and correctly disclosed before review). The size premise is confirmed at 75 files / 131
    declarations.
- [x] **AC8 — pre-review checklist over 100% before round 1.** Predicate noun phrases resolved
      against repo `def`s; binder-level hypothesis scoping by machine telescope for all 131;
      bare-cardinality idiom sweep (measured, not assumed 0); same-file `/--` ↔ `/-!` consistency;
      page-scoped citation verification (`pdftotext -f N -l N`, never flat OCR nor another repo
      copy); per-item scope-qualifier check on any mixed-layer headers; instance-binder census;
      PR-body raw-HTML self-check; AC5 evidence inline with real numbers, never left `[PENDING]`
      past the point the gate has actually run.
  - Predicate noun phrases resolved against repo `def`s (e.g. "vertex-disjoint compatible polymer
    families" ↔ `vdCompatiblePolymerFamilies`, "polymer set" ↔ `allPolymers`, "bounded edge
    density" ↔ `BoundedEdgeDensity`).
  - Binder-level hypothesis scoping by machine telescope for all **131**: 76 declarations have an
    empty Prop-hypothesis list, 55 have a non-empty one; independently reproduced by review's own
    `lake env lean` telescope (131 entries, 0 errors), which additionally surveyed the instance
    list of all 131 (128 share `[DecidableEq V]` + one stagewise `Fintype`; the 3 deviations are
    exactly the 3 the implementer disclosed, all CONFIRMED).
  - Bare-cardinality idiom sweep: measured, **0 surviving hits** (implementer, adversarially
    self-tested regex); review's own wider sweep found 1 hit, adjudicated as the named-objects
    exception (a hypothesis list of 4 pairwise-distinct indices, "the six inequalities").
  - Same-file `/--` ↔ `/-!` consistency: machine probe, **0 flagged**; review independently
    confirmed all 131 `/--` blocks are byte-identical to `origin/main` (this PR modified no
    declaration doc).
  - Page-scoped citation verification: **not applicable** — no produced header carries a
    literature citation (citations live in the untouched `/--` docs), following wave 10a's
    established style; this also keeps the wave clear of #4998's `§18.x` mislabelling.
  - Mixed-layer scope check: 3 instance-mixed files (`FreeEnergy.lean`, `FreeEnergyTrivialSlicesJZero.lean`,
    `InfiniteVolume.lean`'s `inducedGraph_bot`) each state their per-declaration instance/Prop
    split rather than a blanket claim; review independently confirmed the `PolymerFreeEnergy*`
    stage-subgraph vs along-exhaustion distinction with 0 misattributions across all 26 files.
  - PR-body raw-HTML self-check: none present.
  - AC5 evidence inline with real numbers: see AC5 above.

## Accumulated lessons carried forward from waves 1–9 (standing checklist)

- Waves 1–4: predicate noun phrase must resolve against a repo `def`; binder-level hypothesis
  scoping; bare-cardinality idioms eliminated semantically, not regex-dodged; same-file `/--` ↔
  `/-!` consistency.
- Wave 5/6: declaration counts must be **comment-and-attribute-aware** (strip comments, then peel
  leading `@[...]` attribute groups and modifiers before matching a declaration keyword). AC5
  evidence must be filled incrementally as gates actually run, never left as a stale scaffold.
- Wave 7/8: per-item scope-qualifier check required on mixed-layer files; freeze-time charge
  counts can conflate `--findings` **rows** with **charges** — recount and correct in-body if the
  two diverge.
- **Wave 9 — three methodology lessons, carried into AC3/AC7 above:**
  1. New-authoring risk calibration is not transferable and does not apply here (0 authoring
     files).
  2. The "zero/nonzero mathematical characterization" defect class: closed form → admissible
     domain → root set → sign, always in that order.
  3. No negative provenance claims — state only positive facts about what a proof *is*.

## What the gates do not guarantee

Nothing mechanical in this repository checks header **truth**. The ratchet detects only
recognized legacy inventory syntax; `lake build` never reads comment content; `audit_gate` V1–V4
are axiom/sorry/capstone/Japanese only; `citation_audit` has previously been shown insensitive to
citation-only diffs; `import_dag_contract` sees no prose. The truth guarantee for this wave rests
on the manual read and on the independent review passes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant