写全题面:统一式形式化(六步 Λ 分档退化)+检验脚本 #2
Merged
+7 −0 AGENTS.md added View file
| @@ -0,0 +1,7 @@ | ||
| 1 | +# 项目规则(continuityunification) | |
| 2 | + | |
| 3 | +1. **一条路线一个分支**:文件放 `routes/<分支名>/`;笔记最后一节写 `## Next`。 | |
| 4 | +2. **不许改 `checks/`**:检验脚本由题目主人维护;要改先开 Issue。 | |
| 5 | +3. **不许把未证写成已证**:`sorry` 就是未证;提交里出现 `sorry`/`axiom` 一律判失败。 | |
| 6 | +4. **引用要标来源**:Direct Sum(Jain–Klauck–Santha 2010)等已知结果只引用,不主张。 | |
| 7 | +5. **边界**:本题目只校验「六步 Λ 的分档退化」;不涉及「算法必须沿树走」这一步(未证)。 | |
+53 −2 README.md View file
| @@ -1,3 +1,54 @@ | ||
| 1 | -# continuityunification | |
| 1 | +# continuityunification — 递归式跨领域统一框架 | |
| 2 | 2 | |
| 3 | -递归式跨领域统一框架 | |
| 3 | +## 目标 | |
| 4 | + | |
| 5 | +把「不付就散 → `E_in = ΔG_s + Q` → 六步 `Λ`」形式化成一**套**定义,并证明五档最简式都是它的**代入**,不是五套公式: | |
| 6 | + | |
| 7 | +- 死物(`ε=0`,无进项) | |
| 8 | +- 化学(`τ/T_ref→0`,`R=1`) | |
| 9 | +- 恒星(存量口径) | |
| 10 | +- 生物(三项全带) | |
| 11 | +- 数学(不参与 `Λ`,只算 `d ≥ log_w M`) | |
| 12 | + | |
| 13 | +## 定义(待形式化) | |
| 14 | + | |
| 15 | +一拍量 `E_in, C_m, L, E_restore, τ, T_ref` 皆非负实数。 | |
| 16 | + | |
| 17 | +``` | |
| 18 | +净日常 = E_in − C_m − L | |
| 19 | +净恢复 = 净日常 − E_restore | |
| 20 | +R = step(净恢复) -- 付得起 1,付不起 0 | |
| 21 | +Λ = R · min{ 净日常/E_in, 1 − τ/T_ref } | |
| 22 | +活着 ⟺ Λ > 0 | |
| 23 | +``` | |
| 24 | + | |
| 25 | +## 要证的五条(每条一个 theorem,不许 `sorry`) | |
| 26 | + | |
| 27 | +1. **死物**:`ε=0 ⇒ E_in=0`,`Λ` 不进入量程(显式 N/A,或取极限说明),侵蚀式另算(寿命 = 尺寸/速率)。 | |
| 28 | +2. **化学**:`τ/T_ref→0 ∧ R=1 ⇒ Λ = 1 − (C_m+L)/E_in`。 | |
| 29 | +3. **恒星**:存量口径 ⇒ `Λ = 1 − τ/T_ref`。 | |
| 30 | +4. **生物**:三项全带 ⇒ `Λ = R·min{净日常/E_in, 1−τ/T_ref}`(恒等式,不是新式)。 | |
| 31 | +5. **数学**:不参与 `Λ`;只证 `d ≥ log_w M`(树深下界)。 | |
| 32 | + | |
| 33 | +## 检验方法 | |
| 34 | + | |
| 35 | +由 `checks/check.py` 判,判据三条,缺一不算通过: | |
| 36 | + | |
| 37 | +1. 提交含 Lean 工程(`lakefile` + `lean-toolchain`),五条 theorem 名都在; | |
| 38 | +2. 全文无 `sorry`、无 `axiom`(出现即判失败,不区分位置); | |
| 39 | +3. 能 `lake build` 通过(本机无 Lean 时只做前两项,并在结论里写明“未编译”)。 | |
| 40 | + | |
| 41 | +## 已知(引用,不是我们的) | |
| 42 | + | |
| 43 | +- 树深下界 `d ≥ log_w M`:已机核(`numPaths`、`eq_of_same_at?`、`differs_somewhere`)。 | |
| 44 | +- Direct Sum 定理(Jain–Klauck–Santha 2010):独立实例一起解不比逐个解更快——引用,不主张。 | |
| 45 | + | |
| 46 | +## 我们的位置 | |
| 47 | + | |
| 48 | +这是对**本体**的内部校验,不主张新定理;也不涉及「算法必须沿树走」(那一步未证)。分档取值与推导见 Zenodo 04/05。 | |
| 49 | + | |
| 50 | +## 提交方式 | |
| 51 | + | |
| 52 | +- 一条路线 = 一个分支,文件放 `routes/<分支名>/`; | |
| 53 | +- 路线笔记最后一节写 `## Next`(下一步); | |
| 54 | +- PR 合进 main 才算采纳。 | |
+91 −0 checks/check.py added View file
| @@ -0,0 +1,91 @@ | ||
| 1 | +#!/usr/bin/env python3 | |
| 2 | +"""Shoal check for continuityunification. | |
| 3 | + | |
| 4 | +判据(三条,缺一不算通过): | |
| 5 | +1. 提交里有 Lean 工程(lakefile + lean-toolchain),五个定理名在源码里出现; | |
| 6 | +2. 源码里没有 `sorry` / `axiom`; | |
| 7 | +3. 能 `lake build` 通过(本机没有 lake 时只做前两项,并在输出里写明"未编译")。 | |
| 8 | + | |
| 9 | +用法:python3 checks/check.py <提交目录> | |
| 10 | +退出码:0 = 通过,1 = 不通过。 | |
| 11 | +""" | |
| 12 | +import os | |
| 13 | +import re | |
| 14 | +import shutil | |
| 15 | +import subprocess | |
| 16 | +import sys | |
| 17 | + | |
| 18 | +REQUIRED = [ | |
| 19 | + "dead_matter", # 死物 | |
| 20 | + "chemistry", # 化学 | |
| 21 | + "star", # 恒星 | |
| 22 | + "biology", # 生物 | |
| 23 | + "mathematics", # 数学 | |
| 24 | +] | |
| 25 | + | |
| 26 | +FORBIDDEN = re.compile(r"\b(sorry|admit)\b") | |
| 27 | +AXIOM = re.compile(r"^\s*axiom\b", re.M) | |
| 28 | + | |
| 29 | + | |
| 30 | +def lean_files(root): | |
| 31 | + for dirpath, _, names in os.walk(root): | |
| 32 | + for n in names: | |
| 33 | + if n.endswith(".lean"): | |
| 34 | + yield os.path.join(dirpath, n) | |
| 35 | + | |
| 36 | + | |
| 37 | +def main() -> int: | |
| 38 | + if len(sys.argv) < 2: | |
| 39 | + print("usage: check.py <submission-dir>") | |
| 40 | + return 1 | |
| 41 | + root = sys.argv[1] | |
| 42 | + if not os.path.isdir(root): | |
| 43 | + print(f"FAIL: not a directory: {root}") | |
| 44 | + return 1 | |
| 45 | + | |
| 46 | + files = list(lean_files(root)) | |
| 47 | + if not files: | |
| 48 | + print("FAIL: no .lean files found") | |
| 49 | + return 1 | |
| 50 | + | |
| 51 | + src = "\n".join(open(f, encoding="utf-8", errors="replace").read() for f in files) | |
| 52 | + | |
| 53 | + missing = [n for n in REQUIRED if n not in src] | |
| 54 | + if missing: | |
| 55 | + print("FAIL: missing theorem names: " + ", ".join(missing)) | |
| 56 | + return 1 | |
| 57 | + | |
| 58 | + hits = FORBIDDEN.findall(src) | |
| 59 | + if hits: | |
| 60 | + print(f"FAIL: {len(hits)} 'sorry'/'admit' occurrence(s)") | |
| 61 | + return 1 | |
| 62 | + | |
| 63 | + if AXIOM.search(src): | |
| 64 | + print("FAIL: 'axiom' declaration found") | |
| 65 | + return 1 | |
| 66 | + | |
| 67 | + lakefile = any( | |
| 68 | + os.path.exists(os.path.join(root, n)) for n in ("lakefile.toml", "lakefile.lean") | |
| 69 | + ) | |
| 70 | + if not lakefile: | |
| 71 | + print("FAIL: no lakefile (treat as not a Lean project)") | |
| 72 | + return 1 | |
| 73 | + | |
| 74 | + lake = shutil.which("lake") | |
| 75 | + if lake is None: | |
| 76 | + print("PASS (structural only): five theorems present, no sorry/axiom; " | |
| 77 | + "lake not installed, so NOT compiled") | |
| 78 | + return 0 | |
| 79 | + | |
| 80 | + r = subprocess.run([lake, "build"], cwd=root, capture_output=True, text=True) | |
| 81 | + print(r.stdout[-4000:]) | |
| 82 | + print(r.stderr[-4000:]) | |
| 83 | + if r.returncode != 0: | |
| 84 | + print("FAIL: lake build returned", r.returncode) | |
| 85 | + return 1 | |
| 86 | + print("PASS: five theorems present, no sorry/axiom, lake build ok") | |
| 87 | + return 0 | |
| 88 | + | |
| 89 | + | |
| 90 | +if __name__ == "__main__": | |
| 91 | + sys.exit(main()) | |
+22 −0 routes/define-unified/README.md added View file
| @@ -0,0 +1,22 @@ | ||
| 1 | +--- | |
| 2 | +issue: 1 | |
| 3 | +status: working | |
| 4 | +--- | |
| 5 | + | |
| 6 | +# 写全题面:统一式形式化(六步 Λ 分档退化)与检验方法 | |
| 7 | + | |
| 8 | +这条路线只做一件事:把题目仓库的 README 换成完整题面,并补上 `AGENTS.md` 与 `checks/check.py`。 | |
| 9 | + | |
| 10 | +## 做了什么 | |
| 11 | + | |
| 12 | +- `README.md`:完整题面(目标/定义/五条要证/检验方法/已知/我们的位置/提交方式); | |
| 13 | +- `AGENTS.md`:项目规则(一分支一路线、不许改 checks、sorry 即未证、引用标来源); | |
| 14 | +- `checks/check.py`:检验脚本(五个定理名齐、无 `sorry`/`axiom`、`lake build` 通过才算过)。 | |
| 15 | + | |
| 16 | +## 没做什么 | |
| 17 | + | |
| 18 | +- 没有 Lean 工程本身:这是题目定义,不是对题目的解答;解答应当开新路线、认领新 issue。 | |
| 19 | + | |
| 20 | +## Next | |
| 21 | + | |
| 22 | +维护者合并本 PR 后,README 与 checks 落到 `main`;随后任何 agent 都可以从 issue 认领并开自己的路线。 | |