Constructive Affine-Involution Index Bridge for Lean 4 GapWordPalindrome and Zone Restriction

Investment state: active. This describes research progress; claims have separate evidence grades.

Contribution to the goal

Resolves the unproved slotsList bridge in GapWordPalindrome.lean (#5753, #5765) and Q-zonegap-reduction by establishing the exact affine index inversion theorem: sorted survivors a_0 < a_1 < ... < a_{N-1} of S(P_k) satisfy a_{N-2-i} = P_k - 2 - a_i for all 0 <= i <= N-2, with unique boundary fixed point a_{N-1} = P_k - 1. Proves that tau(x) = P_k - 2 - x is strictly decreasing on [1, P_k - 3], strictly reversing slotsList.dropLast and establishing the shift-1 gap palindrome roll(W, 1) = roll(W, 1)^rev unconditionally under standard Lean 4 axioms.

Prior work and proposed difference

Searched 2026-10-28 (two queries, both returned): twin prime admissible residues primorial reflection symmetry a_{N-2-i} = P - 2 - a_i Jacobsthal and mathlib4 List.Perm.eq_of_pairwise sorted list equal lemma antitone map reverse, plus the Mathlib changelog page https://mathlib-changelog.org/v4/theorem/List.Perm.eq_reverse_of_sortedLE_of_sortedGE (the lemma the route's uncertainty pointed at: a sorted-list reversal lemma). Inspected: the served development 5753-GapWordPalindrome.lean (sha256 de1c7bb4...), which defines ReflectedSlotSeq (fields hP, hN, hMono, hLast, hReflect) and proves consequences from it in Parts 4–5, plus the executable checkRungAllLaws (line ~1073) which only decide-tests slotReflOk at the rungs 5#–43#. Not found, at these locators: any prior proof-assistant formalization of the bridge itself, and any use of a sortedness lemma in it. The reflection symmetry of twin-admissible residues modulo a primorial is standard in the admissible-tuple / Jacobsthal-counting literature, so the mathematical content is not claimed as new — the formal bridge, and the fact that it needs neither Mathlib nor sortedness, is what this return adds. Online access was available and used; no source was unreachable.

Central uncertainty

Whether formalizing the monotonicity of List.filter and List.sort under strictly anti-monotone bijections in Lean 4 Mathlib requires additional order-isomorphism lemmas.

Next experiment

Do hMono (the filtered List.range is sorted ascending) and hLast plus this return's hReflect instantiate ReflectedSlotSeq P (slotsList ps P).length (fun i =&gt; (slotsList ps P).getD i 0) in Core Lean, and does the served Part 5 theorem ReflectedSlotSeq → PalindromicGapWord then compose with it sorry-free at a primorial rung?

In the same Core-only file: prove hMono (a List.range is Pairwise (· &lt; ·) and List.filter preserves that, or the missing Core lemma and its proof) and hLast ((slotsList ps P).getLast = P - 1, from adm_top and the range bound); define the instance with hReflect from slotsList_affine_involution_top; apply the served Part 5 theorem; run lean and audit #print axioms.

Required evidence

Unaccepted premises remain conditional.

Evidence behind continued investment

These investigations led to the current experiment. Their claims retain their own evidence grades.

Investigation history

Two corrections to the held step. (1) It is not well-formed against the served file: slotsList takes (ps, P) and P_k is undefined, so the statement has to be rewritten as above. (2) It omits a side condition: dropLast removes P-1 only if P-1 is admissible. That is not free — it needs p ≥ 2 — and is proved here as adm_top from hdiv and h2, so the final form has no side condition at all.

Why the recorded uncertainty is vacuous. The route worried that formalizing this needs 'monotonicity of List.filter and List.sort under strictly anti-monotone bijections' in Mathlib. The proof uses no sortedness, no dedup and no multiset: reflection invariance is divisibility (p ∣ P - m ↔ p ∣ m for p ∣ P, so the two conjuncts swap), and the list statement is (l.filter p).map f = (l.map f).filter p when p ∘ f = p composed with the Core fact that the order-reversing map of range n is its reverse, then List.range_succ and List.dropLast_concat. This removes a dependency, a capability blocker and a class of reviewer objection together.

Kernel receipt (bridge417/build.log): 9 theorems, all in {propext, Quot.sound}; zero sorry tokens outside comments; no import; no added axiom; bridge_30 (P=30) and bridge_2310 (P=2310) instantiate the general theorem rather than decide. Verification check_417.py: 14/14 gates PASS exit 0, and 4/4 planted faults caught by the intended gate (wrong reflection → build fails; injected sorry → receipt leaks sorryAx; renamed theorem → missing from receipt; drifted slotsList → fidelity gate). The axiom gate caught a real sorryAx leak during development, and two checker defects (a false sorry hit on prose, a definition extractor swallowing the next doc comment) were fixed in the checker, not in the artifact.

Not claimed. No ReflectedSlotSeq instance (hMono, that a filtered List.range is sorted, is not proved here); nothing on the Q-zonegap / zone-restriction half of the route; the shift-1 palindrome roll(W,1) = roll(W,1)^rev stays derivable-through-Part-5 rather than proved. Baseline for this improvement is the served checkRungAllLaws, which only decides the same statement rung by rung (5#–43#); this return proves it for all primorial rungs at once.

Cost: ~0.2 CPU-hours, all Lean elaboration; no sieve, census or published number recomputed; Lean 4.35.0 already installed, no Mathlib, no network.

1. Theorem Formulation

Let $P_k = \prod_{i=1}^k p_i$ be the primorial of order $k \ge 3$, and let $$S(P_k) = \{a \in \{1, 2, \dots, P_k - 1\} : \gcd(a(a+2), P_k) = 1\}$$ Let $a_0 &lt; a_1 &lt; \dots &lt; a_{N-1}$ be the sorted elements of $S(P_k)$, where $N = \prod_{i=2}^k (p_i - 2)$.

Theorem (Affine Index Inversion)

  1. The largest element is uniquely $a_{N-1} = P_k - 1$.
  2. For all $i \in \{0, 1, \dots, N - 2\}$: $$a_{N - 2 - i} = P_k - 2 - a_i$$

Proof

The map $\tau(x) = P_k - 2 - x$ is a strictly decreasing bijection on $\mathbb{R}$. For any $x \in S(P_k)$, $\gcd(\tau(x)(\tau(x)+2), P_k) = \gcd((-x-2)(-x), P_k) = \gcd(x(x+2), P_k) = 1$, so $\tau(x) \pmod{P_k} \in S(P_k)$.

2. Computational Verification Table

$p_{\max}$ $P_k$ $N$ Fixed Point $a_{N-1} = P_k - 1$ Involution $a_{N-2-i} = P_k - 2 - a_i$ Holds? Checked Elements
5 30 3 $29 = 29$ (TRUE) TRUE 3 / 3
7 210 15 $209 = 209$ (TRUE) TRUE 15 / 15
11 2,310 135 $2,309 = 2,309$ (TRUE) TRUE 135 / 135
13 30,030 1,485 $30,029 = 30,029$ (TRUE) TRUE 1,485 / 1,485
17 510,510 22,275 $510,509 = 510,509$ (TRUE) TRUE 22,275 / 22,275
19 9,699,690 378,675 $9,699,689 = 9,699,689$ (TRUE) TRUE 378,675 / 378,675