# From cuts to real roots — candidate v13 (open explorations)

An interactive investigation of Pedro M. M. de Castro, *Ehrhart h\*-polynomials of (132, 213)-avoiding permutation polytopes: A repair cone and eventual real-rootedness*, arXiv:2609.06096v1 [math.CO], 5 September 2026.

This folder is a local candidate built on the v12 baseline. It is not a deployment and nothing here has been published.

## What v13 changes

Every screen is now an **open exploration**. There are no quizzes, no Continue gates, no “Show me” answers and no “solved” marks; every exploration can be opened at any time from the map, the chapter tabs or a link. Each one follows the same pattern:

- the title is a real question;
- a small, complete object (a figure or a table) sits next to its controls, and the consequence of each action appears in place;
- where it makes sense the visitor types their own input, which is validated, and an invalid entry keeps the last valid object;
- when a claim is about “all” cases, every case is listed with a count line;
- a short paragraph separates **what the example shows** from **what the paper proves**, citing the theorem, lemma or equation;
- proofs and notation sit in collapsible notes, whose open state survives Undo/Redo.

In the investigation, Undo and Redo work per exploration (buttons, or Ctrl+Z and Ctrl+Shift+Z); in the laboratory, each of the three sections has its own “Undo edit” / “Redo edit” buttons (the inspected arrangement; the cut set and its size; the selected point and the dilation), and Ctrl+Z and Ctrl+Shift+Z (or Ctrl+Y) undo and redo the last change in the section that holds the focus. Decisions use exact arithmetic only: BigInt integers, exact rationals and integer pairs for x + y√3. Decimals appear only as labelled approximations.

## Routes

`index.html` is the **Chapter 1 laboratory**:

| Section | Route ids that open it | What you do |
|---|---|---|
| `#arrangements` | `avoid` | Enumerate the 6 or 24 arrangements; type your own permutation (3–6 values); read position, value and rank for every triple; see a witness or the absence of 132 and 213. |
| `#cuts` | `cuts` | Toggle cuts, watch the blocks fill, compare the complete dictionary of 4, 8 or 16 cut sets (Lemma 2.1). |
| `#polygon` | `deficits` | Select a vertex (labelled by its cut set) or the interior point, follow both prefix-deficit subtractions and the way back (eqs. (4)–(5)), dilate by m = 0…3 and count 1, 5, 13, 25 lattice points, each listed in both coordinate systems. |
| `#beyond` | — | Links to the cube explorations and to every later chapter; the scope of the paper’s results. |

Opening `investigation.html#avoid`, `#cuts` or `#deficits` leads to the matching laboratory section; the laboratory scrolls to that section and focuses its heading.

`investigation.html#<id>` holds the other 29 explorations:

1. **Lab & cube** — `faces` (What happens when some gaps are held fixed?), `affine` (Is it a cube in shape, or only in its connections?), `volume` (Does the order of the cuts change the volume?).
2. **Count points** — `maps`, `ehrhart`, `scores`, `burnside`, `blocks` (cycle blocks, K and exp K).
3. **Repair roots** — `basis` (with the Worpitzky transform), `obstruction`, `sharp`, `tails`.
4. **Verify exactly** — twelve verifier stages (eleven follow the lines of Algorithm 1; stage 10, H, is a consistency view outside it): `verify-input`, `verify-seed`, `verify-B`, `verify-assembly`, `verify-coordinate`, `verify-base`, `verify-endpoints`, `verify-tail-update`, `verify-tail-sign`, `verify-H` (a consistency view, not part of Algorithm 1), `verify-row`, `verify-receipt`. Each starts with a small example that needs no run, then compares it with a real run in a Web Worker on the bundled table, a damaged copy or a CSV you choose.
5. **What is proved?** — `coverage`, `marked`, `bernoulli`, `errors`, `scope`.

`notes.html` maps every result of the paper to the explorations that illustrate it and states sources, evidence types, data provenance and licences.

## Serve

The pages use ES modules, `fetch` and a Web Worker, so they must be served over HTTP; opening the files with `file://` does not work. From the folder that contains `demo/`:

```
python -m http.server 8987 --bind 127.0.0.1 --directory demo
```

Then open `http://127.0.0.1:8987/index.html`. Everything the pages need (KaTeX 0.19.0, fonts, brand icons, data) is in this folder; they make no requests to other sites.

## Tests

Node (checked with 24.19); no packages are installed. From this folder:

```
node run-tests.mjs
```

runs all 17 suites listed in its `suites` array and writes `test-results/summary.json`. Every suite can also be run on its own:

```
node test-core.mjs
node test-advanced-models.mjs
node test-scenes.mjs
node test-verifier.mjs
node test-lab.mjs
node test-lab-v13.mjs
node test-cube.mjs
node test-correspondence.mjs
node test-coordinate-teaching.mjs
node test-score-teaching.mjs
node test-triangle-counting.mjs
node test-blocks.mjs
node test-repair.mjs
node test-verify-intro.mjs
node test-verify-tails.mjs
node test-verify-results.mjs
node test-proof.mjs
```

Each prints a final JSON line such as `{"status":"pass","assertions":N}` and exits with status 1 on failure; most also write `test-results/<name>.json`. `test-support.mjs` is a helper (an in-process stand-in for the Worker), not a suite. The tests recompute the mathematics independently (brute-force enumeration, a different formula, or values printed in the paper) and check the open-exploration contract of every view.

Browser QA is not part of this folder. It lives in the workspace’s private QA area and drives installed Google Chrome through the DevTools Protocol with real mouse, touch and keyboard events at 1366 × 768 and 390 × 844; its screenshots and browser profiles stay there.

## Mathematics and scope

- H₁ = H₂ = 1 have no zeros; H₃ = (1 + t)².
- Theorem 1.3: for 3 ≤ d ≤ 1000 all zeros of H_d are real and negative, by Corollary 6.2 (a paper proof) plus an exact finite certificate: Algorithm 1 run on the author’s table checks the base rows d ≤ 3, the endpoints and 498 500 strict tail inequalities in Z[√3] (p. 20).
- Theorem 1.4: the same holds for every d ≥ 2^72, by analytic estimates.
- The interval 1001 ≤ d < 2^72 remains open in the arXiv paper (Conjecture 10.1).
- `data/reconstructed_small.csv` and `data/verified_small.json` are an independent reconstruction for d ≤ 30, computed for this demo from equations (22), (25), (26), (33) and Algorithm 1. They are **not** the author’s released d ≤ 1000 table, which is not redistributed here. A receipt from this demo certifies only the rows it checked.
- Finite enumerations illustrate general statements; they never prove them.

## Rights and licences

- Original code (JavaScript, CSS and HTML structure): Apache License 2.0 — see `LICENSE` and `NOTICE`.
- Original explanatory text and original figures, considered separately from the code that generates them: Creative Commons Attribution 4.0 International — see `licenses/CC-BY-4.0.txt`.
- The precise scopes are stated in `LICENSE-SCOPE.md`.
- Third-party materials keep their own terms and are not relicensed: KaTeX (MIT, `licenses/katex.txt`), Inter (SIL Open Font License 1.1, `licenses/inter.txt`), Latin Modern (GUST Font License, `licenses/latin-modern/GUST-FONT-LICENSE.TXT`), the CIn brand assets, the paper, and the author’s published data.
- The author’s full published CSV is not included.

Demo by Pedro M. M. de Castro. Tools for computational exploration and implementation: OpenAI Codex and Anthropic Claude.

## Earlier candidates

v2–v12 refined the laboratory (consequence visibility, counter wording, the open interval), replaced Chapter 2 with open experiments (v4), added the tournament path and named players (v5–v7), navigation feedback and the triangle count (v8), the Chapter 4 coordinate laboratory (v9–v10), the tournament-to-chamber dictionary and the symmetry slots without the elementary fraction aside (v11), and focus after Undo/Redo (v12). Their reports are in `../reports/`.
