"""Exact verification for the cube case of the covering-number lower bound. The 12 edges of K(4,4) minus a matching and two distinguished symbols are the fourteen selected lines. Coordinate 0 is on none of those lines. All counts and set operations use integers; no solver or data file is needed. """ from itertools import combinations def pairs(group): return set(combinations(sorted(group), 2)) def disjoint_partitions(remaining, allowed): if not remaining: yield () return first = min(remaining) for triple in allowed: if first in triple and triple <= remaining: for rest in disjoint_partitions(remaining - triple, allowed): yield (triple,) + rest def fourteen_point_systems(): edges = [(i, j) for i in range(4) for j in range(4) if i != j] labels = set(range(len(edges))) stars = [frozenset(e for e in labels if edges[e][side] == i) for side in (0, 1) for i in range(4)] matchings = {} for size in (3, 4): matchings[size] = [frozenset(group) for group in combinations(sorted(labels), size) if all(len({edges[e][side] for e in group}) == size for side in (0, 1))] for perfect in combinations(matchings[4], 3): used = set.union(*(pairs(group) for group in perfect)) if len(used) != 18: continue allowed = [triple for triple in matchings[3] if used.isdisjoint(pairs(triple))] partitions = list(disjoint_partitions(labels, allowed)) occupied = [set.union(*(pairs(triple) for triple in partition)) for partition in partitions] for i, first in enumerate(partitions): for j in range(i + 1, len(partitions)): if occupied[i].isdisjoint(occupied[j]): yield ([frozenset(), frozenset({12, 13})] + stars + list(perfect) + [triple | {12} for triple in first] + [triple | {13} for triple in partitions[j]]) def support_masks(system): return tuple(sum(1 << i for i, group in enumerate(system) if x in group) for x in range(14)) def replacement_candidates(lines): """Find even a single possible opposite-side row of a six-vertex component.""" candidates = [] for group in combinations(range(1, 21), 5): mask = sum(1 << i for i in group) counts = [(mask & line).bit_count() for line in lines] if mask not in lines and min(counts) >= 1: hits = {i for i, value in enumerate(counts) if value > 1} if len(hits) <= 3: candidates.append((mask, hits)) for indices in combinations(range(14), 3): removed = [lines[i] for i in indices] union = removed[0] | removed[1] | removed[2] for mask, hits in candidates: if hits <= set(indices) and mask & union == mask: yield indices, mask def residual_supports(lines, size): """U contains coordinate 0 in every support and meets each selected line once.""" for other_coordinates in combinations(range(1, 21), size - 1): mask = 1 + sum(1 << i for i in other_coordinates) if all((mask & line).bit_count() == 1 for line in lines): yield mask if __name__ == "__main__": count = 0 candidates = 0 for system in fourteen_point_systems(): lines = support_masks(system) assert all(line.bit_count() == 5 for line in lines) assert all((a & b).bit_count() == 1 for a, b in combinations(lines, 2)) count += 1 candidates += sum(1 for _ in replacement_candidates(lines)) light = tuple(residual_supports(lines, 5)) heavy = tuple(residual_supports(lines, 6)) assert len(light) == 5 and len(heavy) == 2 # Remove the common extra coordinate only from the two heavy support types. plane = lines + light + tuple(mask - 1 for mask in heavy) assert len(set(plane)) == 21 assert all(line.bit_count() == 5 for line in plane) assert all((a & b).bit_count() == 1 for a, b in combinations(plane, 2)) assert count == 1 and candidates == 0 print("Fourteen-point systems (interchange of the distinguished points omitted):", count) print("Single replacement candidates among all 364 triples:", candidates) print("Residual supports: 5 light types, 2 heavy types; 21 projective lines checked.")