把「代数版 P ≠ NP」的机器证明审清楚、读懂
把 2026 年 11 月 AI 发布的「代数版 P ≠ NP」(VP ≠ VNP)Lean 证明审清楚、读懂:先由人逐条核对题面,再写成人能读的证明和科普。
| 1 | """Check a statement-review route: every item translated, sourced and judged; two signatures other than the author.""" |
| 2 | import json, sys |
| 3 | from pathlib import Path |
| 4 | |
| 5 | VERDICTS = {"match", "differs"} |
| 6 | |
| 7 | def fail(msg): |
| 8 | print(f"rejected: {msg}") |
| 9 | sys.exit(1) |
| 10 | |
| 11 | def main(): |
| 12 | if len(sys.argv) != 2: |
| 13 | fail("usage: python3 verify.py <route folder>") |
| 14 | f = Path(sys.argv[1]) / "statement-review.json" |
| 15 | if not f.exists(): |
| 16 | fail("statement-review.json missing") |
| 17 | try: |
| 18 | d = json.loads(f.read_text(encoding="utf-8")) |
| 19 | except ValueError as e: |
| 20 | fail(f"statement-review.json is not JSON: {e}") |
| 21 | if d.get("example"): |
| 22 | print("EXAMPLE ONLY: fictional names and signatures; not evidence") |
| 23 | items = d.get("items") |
| 24 | if not isinstance(items, list) or not items: |
| 25 | fail("items must be a nonempty list") |
| 26 | seen = set() |
| 27 | for i, it in enumerate(items, 1): |
| 28 | for k in ("lean", "plain", "reference", "verdict"): |
| 29 | if not isinstance(it.get(k), str) or not it[k].strip(): |
| 30 | fail(f"item {i}: {k} missing") |
| 31 | if it["lean"] in seen: |
| 32 | fail(f"item {i}: {it['lean']} listed twice") |
| 33 | seen.add(it["lean"]) |
| 34 | if it["verdict"] not in VERDICTS: |
| 35 | fail(f"item {i}: verdict must be match or differs") |
| 36 | if it["verdict"] == "differs" and not str(it.get("note", "")).strip(): |
| 37 | fail(f"item {i}: {it['lean']} differs but the note saying how is missing") |
| 38 | author = str(d.get("author", "")).strip() |
| 39 | if not author: |
| 40 | fail("author missing") |
| 41 | sigs = {s.strip() for s in d.get("signatures", []) if isinstance(s, str) and s.strip()} |
| 42 | sigs.discard(author) |
| 43 | if len(sigs) < 2: |
| 44 | fail(f"need 2 signatures other than the author, found {len(sigs)}") |
| 45 | differs = sum(it["verdict"] == "differs" for it in items) |
| 46 | if differs: |
| 47 | print(f"note: {differs} item(s) differ from the textbook; see their notes") |
| 48 | print(f"statement: {len(items)} items reviewed, {len(sigs)} signatures ok") |
| 49 | |
| 50 | main() |