"""Check a clay-map route: each claimed theorem placed against the four Clay cases, consistently, with two reviews.""" import json, sys from pathlib import Path # Fefferman's Clay statement: (A)(B) zero force, global smoothness; (C)(D) breakdown, a smooth force is allowed. CASES = {"A": ("R3", "smooth"), "B": ("T3", "smooth"), "C": ("R3", "blowup"), "D": ("T3", "blowup")} def fail(msg): print(f"rejected: {msg}") sys.exit(1) def main(): if len(sys.argv) != 2: fail("usage: python3 verify.py ") f = Path(sys.argv[1]) / "clay-map.json" if not f.exists(): fail("clay-map.json missing") try: d = json.loads(f.read_text(encoding="utf-8")) except ValueError as e: fail(f"clay-map.json is not JSON: {e}") if d.get("example"): print("EXAMPLE ONLY: fictional theorems and reviews; not evidence") claims = d.get("claims") if not isinstance(claims, list) or not claims: fail("claims must be a nonempty list") for i, c in enumerate(claims, 1): for k in ("source", "lean", "plain", "forcing", "domain", "clay_case", "reason"): if not isinstance(c.get(k), str) or not c[k].strip(): fail(f"claim {i}: {k} missing") if c["forcing"] not in ("forced", "unforced"): fail(f"claim {i}: forcing must be forced or unforced") if c["domain"] not in ("R3", "T3"): fail(f"claim {i}: domain must be R3 or T3") case = c["clay_case"] if case != "none" and case not in CASES: fail(f"claim {i}: clay_case {case!r} is not one of A, B, C, D, none") if case != "none": if c["forcing"] == "forced" and CASES[case][1] == "smooth": fail(f"claim {i}: a forced result cannot be Clay ({case}), which has zero force") if CASES[case][0] != c["domain"]: fail(f"claim {i}: Clay ({case}) is on {CASES[case][0]}, claim is on {c['domain']}") author = str(d.get("author", "")).strip() if not author: fail("author missing") reviews = {r.strip() for r in d.get("reviews", []) if isinstance(r, str) and r.strip()} reviews.discard(author) if len(reviews) < 2: fail(f"need 2 reviews other than the author, found {len(reviews)}") print(f"clay: {len(claims)} claims mapped, {len(reviews)} reviews ok") main()