"""Verify the terminal Laurent support of the 16-step E7 root string. The optional argument selects the directory containing the E7 data. Requires Python 3.9+ and NumPy. This check uses the submitted initial matrix and words, but does not use its expected endpoint coefficient or any precomputed Jacobian. The endpoint variable is read only after the support has been reconstructed. A value consists of the lexicographic multidegree in the 16 flow parameters, followed by 152 secondary degrees (the two coordinate directions for each of the 76 initial values in the endpoint seed). Positive sums take the maximum. Multiplication and division add and subtract. Object arrays use arbitrary-precision integers. """ import argparse import json import sys from pathlib import Path import numpy as np LOWERING = (1, 3, 4, 5, 6, 2, 4, 5, 3, 4, 1, 3, 2, 4, 5, 6) ZERO = (0,) * len(LOWERING) def multiply(left, right): weights = tuple(a + b for a, b in zip(left[0], right[0])) return weights, left[1] + right[1] def power(value, exponent): weights = tuple(exponent * a for a in value[0]) return weights, exponent * value[1] def add(left, right): if left[0] > right[0]: return left if right[0] > left[0]: return right return left[0], np.maximum(left[1], right[1]) def instructions(initial_matrix, word): """Record the two exchange monomials along a mutation path.""" matrix = initial_matrix.copy() result = [] for pivot in word: row = matrix[pivot].copy() column = matrix[:, pivot].copy() positive = [(int(j), int(row[j])) for j in np.flatnonzero(row > 0)] negative = [(int(j), int(-row[j])) for j in np.flatnonzero(row < 0)] result.append((pivot, positive, negative)) matrix += np.outer(np.maximum(column, 0), np.maximum(row, 0)) matrix -= np.outer(np.maximum(-column, 0), np.maximum(-row, 0)) matrix[pivot] = -row matrix[:, pivot] = -column return result, matrix def mutate(values, instruction): pivot, positive, negative = instruction def monomial(exponents): result = (ZERO, np.zeros_like(values[pivot][1])) for index, exponent in exponents: result = multiply(result, power(values[index], exponent)) return result numerator = add(monomial(positive), monomial(negative)) values[pivot] = multiply(numerator, power(values[pivot], -1)) def main(e7_directory): sys.path.insert(0, str(e7_directory)) from seed import seed def read(filename): return json.loads((e7_directory / "data" / filename).read_text()) initial_matrix, labels, _ = seed() nmutable = len(labels) - 8 matrix = initial_matrix[:nmutable].astype(object) n = len(labels) pure = read("pure_minuscule_word.json") terminal, end_matrix = instructions(matrix, pure["word_zero_based"]) eye = np.eye(n, dtype=object) values = [(ZERO, np.concatenate((e, -e))) for e in eye] for step in reversed(terminal): mutate(values, step) lowerings = {} for item in read("finite_words.json"): name, = item["operator_candidates"] if name not in {"F" + str(i) for i in LOWERING}: continue steps, end = instructions(matrix, item["word_slots"]) frozen = item["frozen_slot"] active, = np.flatnonzero(end[:, frozen]) assert abs(end[active, frozen]) == 1 lowerings[name] = steps, frozen, active for j in reversed(range(len(LOWERING))): steps, frozen, active = lowerings["F" + str(LOWERING[j])] for step in steps: mutate(values, step) weights = list(values[active][0]) weights[j] += 1 values[frozen] = add(values[frozen], (tuple(weights), values[active][1])) for step in reversed(steps): mutate(values, step) shared = labels.index("F7") shared_steps, _ = instructions(matrix, [shared]) mutate(values, shared_steps[0]) multidegree, extrema = values[shared] maximum, minimum = extrema[:n], -extrema[n:] assert multidegree == (1,) * len(LOWERING) assert np.array_equal(maximum, minimum) active, = np.flatnonzero(maximum) assert maximum[active] == 1 target, = np.flatnonzero(end_matrix[:, 75]) assert active == target == pure["target_slot"] print(f"Maximal flow exponent: {multidegree}") print(f"All {2*n} Laurent extrema give e_{active+1} (one-based).") print(f"The optimized c-column is e_{target+1} with sign {end_matrix[target,75]}.") if __name__ == "__main__": parser = argparse.ArgumentParser(description=__doc__.split("\n")[0]) parser.add_argument("e7_directory", nargs="?", type=Path, default=Path(__file__).resolve().parent) main(parser.parse_args().e7_directory.resolve())