"""Unit 101: harvest of the B8 family ((2,2,2) period-line class) and its codim-2 neighbours. Lift-level W88 Thm 4.1 count (lambda = rk Gamma/(Gamma cap G'), UNIT95 sec. 1), generalising unit95/u95_exclude.py. CELL (line V = C.P in C^k, k = 3; codim 2): column j has a period slot sigma_j (Gm: period 2 pi i ~ pi; Ec: period Omega_c; c = 1, 2, 3 = CM curves with pairwise distinct CM fields) and the slots receiving the entries. Slots: Gm (wt 1), Ga (wt 0), E1, E2, E3 (wt 1 each). Two real data x_1, x_2 (rows); row type = slot of its column-1 entry x_i P_1: L : log alpha (alpha not a root of unity) in Gm T : 2 pi i (lambda = 2 pi i) in Gm (a period) B : beta in Qbar^x in Ga Uc: u in L_{E_c}, non-torsion in Ec For j >= 2 the entry x_i P_j is placed in one slot of column j (the hypothesis: entry in that slot's Lambda). Period datum x_0 = 1 (kappa = n). Monomials: tuples (pi, O1, O2, O3) up to Qbar^x. COUNT (per n): G = prod over columns of (Gm^n x Ga x prod Ec^{n/2}); A = weight; d - N = k - 1; delta - tau = k - dim U. G' = H0 x T_M x B (product; graphs allowed between slots of the same curve in two columns). Dead slot s (G' has no component there): every combination c.x (c in Q^2) must have its slot-s component in Q.periods(s). Constraint space in a dead slot holding data S_s: {c : c|S_s = 0} or, if a relation is allowed, {c|S_s in line z}. RELATION RULE (adversarial unless provably excluded): z.x . P_j in Qbar per(s) <=> sum z_i e_i in Qbar T(s), e_i = column-1 entries, T(s) = per(s) P_1 / P_j. T ~ 1 : only z = axis of a B-row (sum z_i e_i algebraic) [Wustholz / Baker otherwise] T ~ pi : only z = axis of a T-row [Gelfond-Schneider, Wustholz] T ~ Omega_c or pi/Omega_c : never [Wustholz: 1-motive periods] Ga slot : never (the component must vanish) otherwise : any line (a quadratic-or-higher period relation, not excludable unconditionally) Cross-slot: the same combination z related in two dead slots s, s' forces T(s)/T(s') in Qbar; forbidden when that monomial is provably transcendental: pi alone, pi with one Omega_c (Chudnovsky), (Omega_c/Omega_d)^a (Wustholz). lambda >= 2 - max dim of the intersection of dead-slot constraints (computed exactly per dead-slot set). Obstruction iff dim U < k and (lambda + A - wt)(k - 1) <= (k - dim U)(A - kappa). Positive ("(*)-positive") iff no obstruction for any G' type; slack = min margin (lhs - rhs, per n). Then SORTING (recognizers) and C^2 / one-row sub-cells. Exact integer/rational arithmetic throughout. Run: python -I u101_enum.py (writes u101_enum_out.txt and u101_cells.json) """ import sys, itertools, time, json from fractions import Fraction as F sys.stdout.reconfigure(encoding='utf-8') T0 = time.time(); LIMIT = 19 * 60 def tick(): if time.time() - T0 > LIMIT: raise SystemExit('TIME LIMIT HIT') CURVES = (1, 2, 3) PI = (1, 0, 0, 0) def om(c): return tuple(1 if i == c else 0 for i in range(4)) ZERO = (0, 0, 0, 0) def add(a, b): return tuple(x + y for x, y in zip(a, b)) def sub(a, b): return tuple(x - y for x, y in zip(a, b)) def per(s): if s == 'Gm': return PI if s == 'Ga': return None return om(int(s[1])) def wt(s): return 0 if s == 'Ga' else 1 def mfmt(m): nm = ['pi', 'O1', 'O2', 'O3']; out = [] for g, e in zip(nm, m): if e == 1: out.append(g) elif e: out.append('%s^%d' % (g, e)) return '*'.join(out) or '1' def Ttype(T): if T == ZERO: return '1' if T == PI: return 'pi' for c in CURVES: if T == om(c) or T == sub(PI, om(c)): return 'per' return 'gen' def prov(Q): """monomial Q (nonzero) provably not in Qbar""" if Q == ZERO: return False cs = [c for c in CURVES if Q[c]] if len(cs) <= 1: return True # Lindemann / Chudnovsky if len(cs) == 2 and Q[0] == 0 and Q[cs[0]] == -Q[cs[1]]: return True # Wustholz return False def rank(rows): M = [[F(x) for x in r] for r in rows if any(r)]; rk = 0 if not M: return 0 for c in range(len(M[0])): p = next((i for i in range(rk, len(M)) if M[i][c] != 0), None) if p is None: continue M[rk], M[p] = M[p], M[rk] for i in range(len(M)): if i != rk and M[i][c] != 0: f = M[i][c] / M[rk][c]; M[i] = [a - f * b for a, b in zip(M[i], M[rk])] rk += 1 return rk def row_slot(t): return {'L': 'Gm', 'T': 'Gm', 'B': 'Ga'}.get(t, 'E' + t[1:] if t[0] == 'U' else None) # -------------------------------------------------------------------------------------------------------------- def build(sig, rows, plc, cols=None): """sig: period slots per column (tuple, column 0 = defining column); rows: tuple of row types; plc[i][j] slot of entry (i, j) for j >= 1 (plc[i][0] = row slot). cols: subset of column indices kept (sub-cells).""" k_all = len(sig) cols = list(range(k_all)) if cols is None else list(cols) P = [per(s) for s in sig] colslots = []; dslots = [] # dslots: (col position, slot, tuple of data indices, T) for pos, j in enumerate(cols): ss = {sig[j]} for i in range(len(rows)): ss.add(plc[i][j]) colslots.append(sorted(ss)) for s in sorted(ss): S = tuple(i for i in range(len(rows)) if plc[i][j] == s) if not S: continue T = None if per(s) is None else sub(add(per(s), P[0]), P[j]) dslots.append((pos, s, S, T)) A = sum(wt(s) for cs in colslots for s in cs) return dict(cols=cols, colslots=colslots, dslots=dslots, A=A, k=len(cols), P=P, rows=rows) def allowed(ds, z, rows): """is a relation with combination z (tuple over data, restricted to S) allowed in data slot ds?""" pos, s, S, T = ds if T is None: return False tt = Ttype(T) supp = [i for i in S if z[i]] if tt == 'gen': return True if tt == '1': return len(supp) == 1 and rows[supp[0]] == 'B' if tt == 'pi': return len(supp) == 1 and rows[supp[0]] == 'T' return False def lam_min(cell, dead): """dead: list of data-slot indices that are dead. returns minimal lambda (in units of n) over allowed patterns.""" rows = cell['rows']; m = len(rows); ds = cell['dslots'] if not dead: return 0 E = [tuple(1 if i == a else 0 for i in range(m)) for a in range(m)] def ok_coinc(idx_z): # list of (slot index, combo); pairwise check same combo for (a, za), (b, zb) in itertools.combinations(idx_z, 2): if rank([za, zb]) == 1: Ta, Tb = ds[a][3], ds[b][3] if prov(sub(Ta, Tb)): return False return True best = 0 # dim 2 (only possible if every dead slot is single-datum with an allowed relation) if all(len(ds[a][2]) == 1 and allowed(ds[a], E[ds[a][2][0]], rows) for a in dead): if ok_coinc([(a, E[ds[a][2][0]]) for a in dead]): return m - m if m == 1: return 1 # dim 1: common line L cands = [E[0], E[1], (1, 1)] for L in cands: used = []; good = True for a in dead: S = ds[a][2] if len(S) == 1: i = S[0]; other = 1 - i if L == E[other]: continue # constraint c_i = 0 contains L if allowed(ds[a], E[i], rows): used.append((a, E[i])); continue good = False; break else: if allowed(ds[a], L, rows): used.append((a, L)); continue good = False; break if good and ok_coinc(used): best = max(best, 1) return m - best def cand_U(k): """finite list of subspaces of Q^k realising every support/intersection pattern needed (dim < k)""" e = lambda j: [1 if i == j else 0 for i in range(k)] out = [[]] if k == 2: out += [[e(0)], [e(1)], [[1, 2]]] else: out += [[e(j)] for j in range(3)] for a, b in itertools.combinations(range(3), 2): v = [0, 0, 0]; v[a] = 1; v[b] = 2; out.append([v]) out.append([[1, 2, 5]]) for a, b in itertools.combinations(range(3), 2): out.append([e(a), e(b)]) for j in range(3): o = [x for x in range(3) if x != j]; v = [0, 0, 0]; v[o[0]] = 1; v[o[1]] = 3 out.append([e(j), v]) out.append([[1, 1, 0], [0, 1, 7]]) # generic plane for j in range(3): # plane containing a generic line of plane {a,b} and a full line o = [x for x in range(3) if x != j]; v = [0, 0, 0]; v[o[0]] = 1; v[o[1]] = 2 out.append([v, [1, 3, 11]]) return out _CU = {2: cand_U(2), 3: cand_U(3)} def sub_info(U, S, k): """dim of X = U cap span(S) and whether X has full support on S""" dU = rank(U) if U else 0 Sv = [[1 if i == p else 0 for i in range(k)] for p in S] dX = dU + len(Sv) - rank(U + Sv) if U else 0 if dX == 0: return 0, False for p in S: Sp = [v for q, v in zip(S, Sv) if q != p] dXp = (dU + len(Sp) - rank(U + Sp)) if (U and Sp) else 0 if dXp >= dX: return dX, False return dX, True def gprime_types(cell): """v2: yield (dead data-slot frozenset, wt, dimU, desc). G' = H0 x T_M x prod_c B_c; each component given by its support; image U from the candidate list; feasibility and maximal weight by exact ranks.""" k = cell['k']; cs = cell['colslots']; ds = cell['dslots'] gm_cols = [p for p in range(k) if 'Gm' in cs[p]] ga_cols = [p for p in range(k) if 'Ga' in cs[p]] ecs = {} for p in range(k): for s in cs[p]: if s[0] == 'E': ecs.setdefault(s, []).append(p) curves = sorted(ecs.items()) Us = [(U, rank(U) if U else 0) for U in _CU[k]] info = {} def si(ui, S): key = (ui, S) if key not in info: info[key] = sub_info(Us[ui][0], list(S), k) return info[key] sub_lists = [[tuple(c) for r in range(len(ps) + 1) for c in itertools.combinations(ps, r)] for s, ps in curves] for sT in [tuple(c) for r in range(len(gm_cols) + 1) for c in itertools.combinations(gm_cols, r)]: for ga_live in [tuple(c) for r in range(len(ga_cols) + 1) for c in itertools.combinations(ga_cols, r)]: for supp in itertools.product(*sub_lists) if curves else [()]: tick() live = set(('Gm', p) for p in sT) | set(('Ga', p) for p in ga_live) for (s, ps), S in zip(curves, supp): for p in S: live.add((s, p)) dead = frozenset(a for a, (p, s, S_, T) in enumerate(ds) if (s, p) not in live) best = None for ui, (U, dU) in enumerate(Us): if any(si(ui, (p,))[0] == 0 for p in ga_live): continue w = 0; ok = True for S in ([sT] if sT else []) + [S for S in supp if S]: dX, full = si(ui, S) if not full: ok = False; break w += dX if not ok: continue # keep the worst (largest (k-dU)(A-kap) - (A-w)(k-1)): prefer small dU, large w if best is None or (dU, -w) < (best[0], -best[1]): best = (dU, w, ui) # also yield all feasible (different dU/w trade-offs) yield dead, w, dU, (sT, ga_live, supp, ui) def gprime_types_v1(cell): """yield (dead data-slot frozenset, wt, dimU, desc)""" k = cell['k']; cs = cell['colslots']; ds = cell['dslots'] gm_cols = [p for p in range(k) if 'Gm' in cs[p]] ga_cols = [p for p in range(k) if 'Ga' in cs[p]] ecs = {} for p in range(k): for s in cs[p]: if s[0] == 'E': ecs.setdefault(s, []).append(p) # abelian options per curve curve_opts = [] for s, ps in sorted(ecs.items()): opts = [] for live in itertools.product([0, 1], repeat=len(ps)): opts.append(([(s, p) for p, l in zip(ps, live) if l], [])) for a, b in itertools.combinations(ps, 2): rest = [p for p in ps if p not in (a, b)] for live in itertools.product([0, 1], repeat=len(rest)): opts.append(([(s, p) for p, l in zip(rest, live) if l], [(s, a, b)])) curve_opts.append(opts) primes = [2, 3, 5, 7, 11, 13] for sT_bits in itertools.product([0, 1], repeat=len(gm_cols)): sT = [p for p, b in zip(gm_cols, sT_bits) if b] for r in ([0] if not sT else range(1, len(sT) + 1)): for ga_bits in itertools.product([0, 1], repeat=len(ga_cols)): ga_live = [p for p, b in zip(ga_cols, ga_bits) if b] for combo in itertools.product(*curve_opts) if curve_opts else [()]: tick() axes = set(ga_live); live_slots = set(('Ga', p) for p in ga_live) wtv = r; vecs = [] for ax, gr in combo: for (s, p) in ax: axes.add(p); live_slots.add((s, p)); wtv += 1 for gi, (s, a, b) in enumerate(gr): live_slots.add((s, a)); live_slots.add((s, b)); wtv += 1 v = [0] * k; v[a] = 1; v[b] = primes[gi % 6]; vecs.append(v) for p in sT: live_slots.add(('Gm', p)) J = [[1 if i == p else 0 for i in range(k)] for p in sorted(axes)] + vecs dJ = rank(J) if sT: S = [[1 if i == p else 0 for i in range(k)] for p in sT] dX = dJ + len(sT) - rank(J + S) full = True for p in sT: Sp = [[1 if i == q else 0 for i in range(k)] for q in sT if q != p] dXp = dJ + len(Sp) - rank(J + Sp) if Sp else 0 if dXp >= dX: full = False ov = min(r, dX) if full else min(r - 1, dX) dU = dJ + r - ov else: dU = dJ dead = frozenset(a for a, (p, s, S_, T) in enumerate(ds) if (s, p) not in live_slots) yield dead, wtv, dU, (tuple(sT), r, tuple(ga_live), combo) _MEMO = {} def evaluate(cell, kappa=1): mk = (repr(cell['colslots']), repr(cell['dslots']), cell['rows'], kappa) if mk in _MEMO: return _MEMO[mk] _MEMO[mk] = r = evaluate0(cell, kappa) return r def evaluate0(cell, kappa=1): k = cell['k']; A = cell['A'] groups = {} for dead, wtv, dU, desc in gprime_types(cell): if dU >= k: continue off = (A - wtv) * (k - 1) - (k - dU) * (A - kappa) if dead not in groups or off < groups[dead][0]: groups[dead] = (off, wtv, dU, desc) worst = None for dead, (off, wtv, dU, desc) in groups.items(): lam = lam_min(cell, sorted(dead)) mg = lam * (k - 1) + off if worst is None or mg < worst[0]: worst = (mg, lam, wtv, dU, desc) return worst # -------------------------------------------------------------------------------------------------------------- def kappa_of(sig, cslots): """kappa = 1 + [a second period datum exists]: mu with per(s_j)/P_j = mu (mu != 1) for slots in every column""" P = [per(s) for s in sig] sets = [] for j, cs in enumerate(cslots): sets.append({sub(per(s), P[j]) for s in cs if per(s) is not None}) common = set.intersection(*sets) - {ZERO} return 1 + (1 if common else 0) def entry_status(t, r, s): """single entry (row type t, multiplier r = P_j/P_1, slot s): 'impossible:', 'period', 'unknown'""" if t == 'L': if s == 'Ga': Ti = tuple(-x for x in r) return 'impossible:Baker/Wustholz' if Ttype(Ti) != 'gen' else 'unknown' if s == 'Gm': return 'unknown' c = int(s[1]) if r == ZERO: return 'impossible:(W)' if r == sub(om(c), PI): return 'impossible:Thm M (M2)' return 'unknown' if t[0] == 'U': d = int(t[1]) if s == 'Ga': Ti = tuple(-x for x in r) return 'impossible:Schneider/Wustholz' if Ttype(Ti) != 'gen' else 'unknown' if s == 'Gm': if r == ZERO: return 'impossible:(W)' if r == sub(PI, om(d)): return 'impossible:Thm M' return 'unknown' c = int(s[1]) if c != d and r == ZERO: return 'impossible:Wustholz (Hom=0)' if c != d and r == sub(om(c), om(d)): return 'impossible:Schneider-Lang' return 'unknown' if t == 'B': if s == 'Ga': return 'impossible:transcendence of r' if prov(r) else 'unknown' if s == 'Gm': if r == ZERO: return 'impossible:Hermite-Lindemann' if Ttype(r) == 'per': return 'impossible:Wustholz (periods not in L~)' return 'unknown' c = int(s[1]) if r == ZERO: return 'impossible:Schneider' if r == om(c): return 'period' if Ttype(r) in ('pi', 'per'): return 'impossible:Wustholz (not in L~_E)' if r == sub(om(c), PI): return 'impossible:Thm M (M1)' return 'unknown' if t == 'T': v = add(PI, r) if s == 'Ga': return 'impossible:transcendence' if prov(v) else 'unknown' if s == 'Gm': if Ttype(v) == 'per': return 'impossible:Wustholz (periods not in L~)' return 'unknown' c = int(s[1]) if v == om(c): return 'period' if v == ZERO or Ttype(v) in ('pi', 'per'): return 'impossible:Schneider/Wustholz' if v == sub(om(c), PI): return 'impossible:Thm M (M1)' return 'unknown' def own_count(sig, rows, plc, i): n = 0 for j in range(len(sig)): s = plc[i][j] if s == sig[j] and s != 'Ga': if j == 0 and rows[i] == 'T': continue n += 1 return n def statement(sig, rows, plc): P = [per(s) for s in sig] xn = {'L': 'log a', 'T': '2 pi i', 'B': 'b'} out = [] for i, t in enumerate(rows): x = xn.get(t, 'u%s' % t[1:]) for j in range(1, len(sig)): r = sub(P[j], P[0]); s = plc[i][j] arg = '(%s)*%s' % (mfmt(r), x) f = {'Gm': 'exp', 'Ga': 'id'}.get(s, 'wp%s' % s[1:] if s[0] == 'E' else s) out.append('%s(%s)' % (f, arg)) return out # -------------------------------------------------------------------------------------------------------------- # paper_cm recognizers for a C^2 cell (columns a, b): rows' slots Sa, Sb; period slots sa, sb; r = P_b/P_a def class_A(r): # Qbar^x {Om^{+-1}, (Om/pi)^{+-1}} with one curve cs = [c for c in CURVES if r[c]] if len(cs) != 1: return False c = cs[0] return (abs(r[c]) == 1) and ((r[0] == 0) or (r[0] == -r[c])) def recog_c2(sa, sb, Sa, Sb, r, rowtypes_a): names = [] for (s1, s2, X, Y, rr) in ((sa, sb, Sa, Sb, r), (sb, sa, Sb, Sa, tuple(-x for x in r))): # MGgen family: rows in the period slot s1 of column 1, column 2 entries in <= 2 slots incl. s2 (no Ga) if X == {s1} and s1 != 'Ga' and 'Ga' not in Y and len(Y | {s2}) <= 2: names.append('paper_cm MG family (MGgen; MG/MG-nat/SE/C42/SE4 cases) at r=%s' % mfmt(rr)) # Theorem A / S (pure Gm / Ga rows and targets, class r) if X <= {'Gm', 'Ga'} and Y <= {'Gm', 'Ga'} and class_A(rr): names.append('paper_cm Theorem %s at r=%s' % ('A' if X == Y == {'Gm'} else 'S', mfmt(rr))) # SMG: X <= {Ga, Gm}, s1 = Gm, r = Om/pi, Y <= {Ga, Gm, Ec} cs = [c for c in CURVES if rr[c]] if s1 == 'Gm' and X <= {'Ga', 'Gm'} and len(cs) == 1 and rr[0] == -1 and rr[cs[0]] == 1 \ and Y <= {'Ga', 'Gm', 'E%d' % cs[0]}: names.append('paper_cm SMG at r=%s' % mfmt(rr)) # SE: X <= {Ga, Ec}, s1 = Ec, r = Od/Oc, Y <= {Ga, Ec, Ed} if s1[0] == 'E': c = int(s1[1]) if X <= {'Ga', s1} and len(cs) == 2 and rr[0] == 0 and rr[c] == -1: d = [x for x in cs if x != c][0] if rr[d] == 1 and Y <= {'Ga', s1, 'E%d' % d}: names.append('paper_cm SE at r=%s' % mfmt(rr)) return names # -------------------------------------------------------------------------------------------------------------- def canon(sig, rows, plc): best = None for rp in itertools.permutations(range(2)): for cp in itertools.permutations(range(1, len(sig))): order = [0] + list(cp) s2 = [sig[j] for j in order]; r2 = [rows[i] for i in rp] p2 = [[plc[i][j] for j in order] for i in rp] # relabel curves by first occurrence seq = s2 + [row_slot(t) for t in r2] + [x for row in p2 for x in row[1:]] mp = {} for x in seq: if x and x[0] == 'E' and x not in mp: mp[x] = 'E%d' % (len(mp) + 1) f = lambda x: mp.get(x, x) if x else x ft = lambda t: ('U' + mp['E' + t[1:]][1:]) if t[0] == 'U' else t key = (tuple(f(x) for x in s2), tuple(ft(t) for t in r2), tuple(tuple(f(x) for x in row) for row in p2)) if best is None or key < best: best = key return best ROWTYPES = ['L', 'T', 'B', 'U1', 'U2', 'U3'] PSLOTS = ['Gm', 'E1', 'E2', 'E3'] ESLOTS = ['Gm', 'Ga', 'E1', 'E2', 'E3'] def run(): seen = set(); cells = [] stats = dict(raw=0, canon=0, degenerate=0, overweight=0) for sig in itertools.product(PSLOTS, repeat=3): Pm = [per(s) for s in sig] if len(set(Pm)) < 3: continue # coincident periods: GS/(W)-trivial or degenerate for rows in itertools.combinations_with_replacement(ROWTYPES, 2): if rows[0] == rows[1] and rows[0] in ('T', 'B'): continue if 'T' in rows and sig[0] == 'Gm': continue # T-row = period datum for pl in itertools.product(ESLOTS, repeat=4): tick(); stats['raw'] += 1 plc = [[row_slot(rows[0]), pl[0], pl[1]], [row_slot(rows[1]), pl[2], pl[3]]] key = canon(sig, rows, plc) if key in seen: continue seen.add(key); stats['canon'] += 1 cells.append(key) return cells, stats def analyse(key): sig, rows, plc = key plc = [list(r) for r in plc] cell = build(sig, rows, plc) if cell['A'] > 8: return None kap = kappa_of(sig, cell['colslots']) w = evaluate(cell, kap) res = dict(sig=sig, rows=rows, plc=plc, A=cell['A'], kappa=kap, margin=w[0], lam=w[1], wt=w[2], dU=w[3], gp=str(w[4]), weights=[sum(wt(s) for s in cs) for cs in cell['colslots']], stmt=statement(sig, rows, plc)) return res def sort_cell(res): sig, rows, plc = res['sig'], res['rows'], res['plc'] P = [per(s) for s in sig] notes = [] # single entries for i, t in enumerate(rows): for j in range(1, 3): st = entry_status(t, sub(P[j], P[0]), plc[i][j]) if st.startswith('impossible'): return 'SL', 'single entry (%d,%d) impossible: %s' % (i, j, st.split(':', 1)[1]) if st == 'period': notes.append('entry (%d,%d) automatic (period)' % (i, j)) for i in range(2): if own_count(sig, rows, plc, i) >= 2: return 'SL', 'row %d has two own-period-slot entries (Schneider-Lang)' % i allslots = {x for row in plc for x in row[1:]} if set(rows) <= {'L', 'T', 'B'} and allslots <= {'Gm', 'Ga'}: if set(rows) <= {'L', 'T'} and allslots == {'Gm'}: return '6E', 'classical six exponentials (columns 1, t, t\' Q-independent)' return 'S6E', 'strong six exponentials (Roy; 1, t, t\' Qbar-independent)' # T94' if sorted(r[0] for r in rows) in (['L', 'U'], ['T', 'U']) and allslots == {'Gm'} and all(s[0] == 'E' for s in sig): iu = 0 if rows[0][0] == 'U' else 1 if 'E' + rows[iu][1:] == sig[0]: return "T94'", "T94' (sec. 5.5 of UNIT95)" + ('; case B' if 'T' in rows else '') # C^2 projections c2 = [] for (a, b) in ((0, 1), (0, 2), (1, 2)): sub_ = build(sig, rows, plc, cols=(a, b)) kap = kappa_of([sig[a], sig[b]], sub_['colslots']) w = evaluate(sub_, kap) if w[0] > 0: Sa = {plc[i][a] for i in range(2)}; Sb = {plc[i][b] for i in range(2)} nm = recog_c2(sig[a], sig[b], Sa, Sb, sub(P[b], P[a]), None) c2.append(((a, b), w[0], nm)) known = [x for x in c2 if x[2]] if known: return 'PCM', 'C^2 cell %s positive and in paper_cm: %s' % (known[0][0], known[0][2][0]) if c2: return 'C2NEW', 'C^2 cell(s) %s positive (hyperplane count), not a paper_cm statement' % [x[0] for x in c2] # one-row sub-cells for i in range(2): rows1 = (rows[i],); plc1 = [plc[i]] sub_ = build(sig, rows1, plc1) kap = kappa_of(sig, sub_['colslots']) w = evaluate(sub_, kap) if w[0] > 0: return 'ROW', 'one-row sub-cell (row %d) positive' % i return 'NEW', '; '.join(notes) if __name__ == '__main__': out = open('u101_enum_out.txt', 'w', encoding='utf-8') def pr(*a): s = ' '.join(str(x) for x in a); print(s); out.write(s + '\n'); out.flush() # controls first pr('== controls') ctrl = { 'T94 main': (('E1', 'E2', 'E3'), ('L', 'U1'), [['Gm', 'Gm', 'Gm'], ['E1', 'Gm', 'Gm']]), 'T94 case B': (('E1', 'E2', 'E3'), ('T', 'U1'), [['Gm', 'Gm', 'Gm'], ['E1', 'Gm', 'Gm']]), 'log row (6E)': (('E1', 'E2', 'E3'), ('L', 'L'), [['Gm', 'Gm', 'Gm'], ['Gm', 'Gm', 'Gm']]), 'x1 alone': (('E1', 'E2', 'E3'), ('L',), [['Gm', 'Gm', 'Gm']]), 'x2 alone': (('E1', 'E2', 'E3'), ('U1',), [['E1', 'Gm', 'Gm']]), 'u on E1, P1 = Omega_2-curve': (('E2', 'E1', 'E3'), ('L', 'U1'), [['Gm', 'Gm', 'Gm'], ['E1', 'Gm', 'Gm']]), } for nm, (sig, rows, plc) in ctrl.items(): cell = build(sig, rows, plc) w = evaluate(cell, kappa_of(sig, cell['colslots'])) pr(' %-30s A=%d margin=%s lam=%s wt=%s dimU=%s G\'=%s' % (nm, cell['A'], w[0], w[1], w[2], w[3], w[4])) cells, stats = run() pr('== enumeration:', stats, 'elapsed', round(time.time() - T0, 1)) results = []; npos = 0; nA = 0 from collections import Counter cnt = Counter(); slack = Counter() for key in cells: res = analyse(key) if res is None: continue nA += 1 if res['margin'] > 0: npos += 1 cls, why = sort_cell(res) res['cls'] = cls; res['why'] = why cnt[cls] += 1; slack[(cls, res['margin'])] += 1 results.append(res) pr('cells with A <= 8:', nA, ' (*)-positive:', npos, 'elapsed', round(time.time() - T0, 1)) pr('sorting counts:', dict(cnt)) pr('by (class, slack):', sorted(slack.items())) json.dump(results, open('u101_cells.json', 'w'), indent=0) for cls in ('NEW', 'ROW', 'C2NEW'): sel = [r for r in results if r['cls'] == cls] pr('\n== class %s: %d cells' % (cls, len(sel))) for r in sorted(sel, key=lambda r: (-r['margin'], r['A']))[:400]: pr(' slack=%s A=%s w=%s kappa=%s sig=%s rows=%s plc=%s | %s | %s' % (r['margin'], r['A'], r['weights'], r['kappa'], r['sig'], r['rows'], r['plc'], ', '.join(r['stmt']), r['why'])) pr('elapsed', round(time.time() - T0, 1), 's')