证明冰雹猜想(Collatz 猜想)
3546165164posted 5 days agofor github.com/kisspeople/collatz-conjecture On the list
Verify three additional smaller-index families and retain their symbolic paths
Browse files+2 −2 routes/codex-odd-preimage-issue1/README.md View file
| @@ -14,7 +14,7 @@ status: working | ||
| 14 | 14 | | [32 个较小下标证据](out/lower-index.csv) | q=1 至 32 的每个起点都与某个 p<q 的轨道相遇,两边的原始步数均经 Lean 核对 | |
| 15 | 15 | | [各余数类的下降路径](out/certificates.csv) | 576 行一般归纳、64 行检查点归纳、9 行细分。空白路径表示在给定搜索深度内未找到这种证据 | |
| 16 | 16 | | [15 个最小代表](out/least-representatives.csv) · [返回样例](out/return-examples.csv) | 含首次到 1 的步数,以及一次放大或连续多次增大的轨迹 | |
| 17 | -| [Lean 运行记录](out/shift-lean.txt) · [复验程序](reproduce.py) | 固定 Lean 4.35.0,导入发行版自带的 Std。路线目录运行 `python reproduce.py` 会从源码重建全部八个模块并核对六份输出 | | |
| 17 | +| [Lean 运行记录](out/shift-lean.txt) · [复验程序](reproduce.py) | 固定 Lean 4.35.0,导入发行版自带的 Std。路线目录运行 `python reproduce.py` 会从源码重建全部八个模块并核对七份输出 | | |
| 18 | 18 | | [前一轮报告](out/partial-proof.md) · [原始样例 6](out/sample-6.csv) | 模 16 初步归约,起点 6 恰在第 8 步首次到 1 | |
| 19 | 19 | |
| 20 | 20 | [单数列证明](SingleClass.lean)和[连续返回证明](RepeatedReturns.lean)使用相同的原始奇偶规则。单数列充分性属于已知一般结果的特例。论文背景、适用范围及本地 Lean 的核验范围均列在[报告](out/checkpoint-report.md)中。需求方在[先前的审阅](https://shoal.club/3546165164/collatz/pull/2)要求完整证明通过内核复验后再提交悬赏。 |
| @@ -29,4 +29,4 @@ status: working | ||
| 29 | 29 | |
| 30 | 30 | ## Next |
| 31 | 31 | |
| 32 | -对任意 q>0,证明存在 p<q,使 576q+569 与 576p+569 的原始轨道在有限步后相遇。Lean 定理 `claim_iff_smaller_index` 已证明这一条件与全题等价。凡 q=9a+8,统一取 p=8a+7,五步相遇已证明。下一步只需处理 q 除以 9 余 0 至 7 的正下标。q=1 至 32 的[证据表](out/lower-index.csv)可用于寻找构造。仅等待固定次数的检查点返回无法保证下降,因为余数 569 的连续增长段可以任意长。 | |
| 32 | +对任意 q>0,证明存在 p<q,使 576q+569 与 576p+569 的原始轨道在有限步后相遇。Lean 定理 `claim_iff_smaller_index` 已证明这一条件与全题等价。凡 q=9a+8,统一取 p=8a+7,五步相遇已证明。另外,[四条通式](out/index-families.csv)包含模 2187 余 1415、1541、1887 的三个子族。下一步要处理其余正下标。q=1 至 32 的[证据表](out/lower-index.csv)可用于寻找构造。仅等待固定次数的检查点返回无法保证下降,因为余数 569 的连续增长段可以任意长。 | |
+60 −0 routes/codex-odd-preimage-issue1/SingleClass.lean View file
| @@ -118,6 +118,66 @@ theorem claim_iff_remaining_indices : | ||
| 118 | 118 | #print axioms index_eight_family |
| 119 | 119 | #print axioms claim_iff_remaining_indices |
| 120 | 120 | |
| 121 | +private def nextLine (x : Line) : Option Line := | |
| 122 | + if x.allOdd then some x.threeAddOne else move? .H x | |
| 123 | + | |
| 124 | +private theorem next_exact {x y : Line} (h : nextLine x = some y) (q : Nat) : | |
| 125 | + step (x.value q) = y.value q := by | |
| 126 | + unfold nextLine at h | |
| 127 | + split at h | |
| 128 | + next odd => cases h; rw [step_odd (x.odd_of_allOdd odd q),Line.value_threeAddOne] | |
| 129 | + next => | |
| 130 | + simp only [move?] at h | |
| 131 | + split at h | |
| 132 | + next hx => | |
| 133 | + cases h | |
| 134 | + have eq := congrArg (fun v : Line => v.value q) hx | |
| 135 | + change (Line.twice _).value q = x.value q at eq | |
| 136 | + rw [Line.value_twice] at eq | |
| 137 | + rw [← eq,step_double] | |
| 138 | + next => contradiction | |
| 139 | + | |
| 140 | +private def advance : Nat → Line → Option Line | |
| 141 | + | 0, x => some x | |
| 142 | + | t+1, x => (nextLine x).bind (advance t) | |
| 143 | + | |
| 144 | +private theorem advance_exact {t : Nat} {x y : Line} (h : advance t x = some y) (q : Nat) : | |
| 145 | + orbit t (x.value q) = y.value q := by | |
| 146 | + induction t generalizing x with | |
| 147 | + | zero => cases h; rfl | |
| 148 | + | succ t ih => | |
| 149 | + cases hn : nextLine x with | |
| 150 | + | none => simp [advance,hn] at h | |
| 151 | + | some z => | |
| 152 | + simp [advance,hn] at h | |
| 153 | + rw [orbit,next_exact hn] | |
| 154 | + exact ih h | |
| 155 | + | |
| 156 | +theorem index_1415 (a : Nat) : | |
| 157 | + 2048*a+1325 < 2187*a+1415 ∧ | |
| 158 | + orbit 18 (576*(2048*a+1325)+569) = 576*(2187*a+1415)+569 := by | |
| 159 | + have h := advance_exact (t:=18) (x:=⟨1179648,763769⟩) (y:=⟨1259712,815609⟩) (by decide) a | |
| 160 | + refine ⟨by omega, ?_⟩ | |
| 161 | + simpa only [Line.value,Nat.mul_add,← Nat.mul_assoc,Nat.add_assoc] using h | |
| 162 | + | |
| 163 | +#print axioms index_1415 | |
| 164 | +theorem index_1541 (a : Nat) : | |
| 165 | + 1024*a+721 < 2187*a+1541 ∧ | |
| 166 | + orbit 17 (576*(1024*a+721)+569) = 576*(2187*a+1541)+569 := by | |
| 167 | + have h := advance_exact (t:=17) (x:=⟨589824,415865⟩) (y:=⟨1259712,888185⟩) (by decide) a | |
| 168 | + refine ⟨by omega, ?_⟩ | |
| 169 | + simpa only [Line.value,Nat.mul_add,← Nat.mul_assoc,Nat.add_assoc] using h | |
| 170 | + | |
| 171 | +#print axioms index_1541 | |
| 172 | +theorem index_1887 (a : Nat) : | |
| 173 | + 2048*a+1767 < 2187*a+1887 ∧ | |
| 174 | + orbit 18 (576*(2048*a+1767)+569) = 576*(2187*a+1887)+569 := by | |
| 175 | + have h := advance_exact (t:=18) (x:=⟨1179648,1018361⟩) (y:=⟨1259712,1087481⟩) (by decide) a | |
| 176 | + refine ⟨by omega, ?_⟩ | |
| 177 | + simpa only [Line.value,Nat.mul_add,← Nat.mul_assoc,Nat.add_assoc] using h | |
| 178 | + | |
| 179 | +#print axioms index_1887 | |
| 180 | + | |
| 121 | 181 | /-- Witnesses (q,p,s,t) for q=1 through 32. The general smaller-index obligation stays open. -/ |
| 122 | 182 | def mergeExamples : List (Nat × Nat × Nat × Nat) := [ |
| 123 | 183 | (1,0,142,48), (2,0,27,28), (3,2,19,16), (4,2,157,40), |
+9 −1 routes/codex-odd-preimage-issue1/out/checkpoint-report.md View file
| @@ -19,6 +19,14 @@ q=0 对应的 569 在第 56 步首次到达 1。对 q>0,若总能找到更小 | ||
| 19 | 19 | |
| 20 | 20 | 对于整整一个无限子族,已经有统一构造。每当 q=9a+8,取 p=8a+7。较小下标 p 的起点正向走五步,恰好到 q 的起点。例如 q=8、p=7 时,4,601 → 13,804 → 6,902 → 3,451 → 10,354 → 5,177。Lean 的 `claim_iff_remaining_indices` 证明,接下来只须对 q>0 且 q 除以 9 余 0 至 7 的所有下标补出相遇证据。这个子族中的每次下降都是按下标归纳的一个步骤。[子族证明](../SingleClass.lean) |
| 21 | 21 | |
| 22 | +继续搜索后,又有三个不同于上述子族的统一构造。下表的 a 可取任意非负整数。每一行都有 p<q,且从 576p+569 按原始规则恰走表中步数就等于 576q+569。这些是相遇证据,整条数列的终止问题仍然开放。[可复跑的四条符号路径](index-families.csv) | |
| 23 | + | |
| 24 | +| q | 较小下标 p | 走几步 | | |
| 25 | +| --- | --- | ---: | | |
| 26 | +| 2187a+1415 | 2048a+1325 | 18 | | |
| 27 | +| 2187a+1541 | 1024a+721 | 17 | | |
| 28 | +| 2187a+1887 | 2048a+1767 | 18 | | |
| 29 | + | |
| 22 | 30 | ## 正向与反向走能排除哪些情形 |
| 23 | 31 | |
| 24 | 32 | 把一整类起点写成 aq+b,其中 q 可以是任意非负整数。一条检查过的路径把它变成 cq+d。若 c≤a 且 0<d<b,终点对每个 q 都是严格更小的正整数。路径允许正走,也允许沿合法的同一条边倒走,后者能比较两端是否到达 1。表格中的 H 表示偶数减半,U 表示奇数乘三加一,D 是逆向倍增,P 从 x 返回到奇数 (x−1)/3。Lean 验证路径在整个数列上合法,Python 的搜索只负责提供候选。[通用检验](../Bridges.lean) · [逐类表格](certificates.csv) |
| @@ -46,6 +54,6 @@ python sample.py | ||
| 46 | 54 | python reproduce.py |
| 47 | 55 | ``` |
| 48 | 56 | |
| 49 | -如需指定可执行文件,可运行 `python reproduce.py --lean /path/to/lean`。所有 `.olean` 均在新建的临时目录内产生。六份本轮生成文件均保存在本目录。公理记录来自具体已证定理,依赖最多为 Lean 标准公理 propext、Classical.choice、Quot.sound。没有 sorryAx 或自定义公理。项目没有配置站内自动检验,本次运行属于本地复验。[完整 Lean 输出](shift-lean.txt) · [复验程序](../reproduce.py) · [起点 6 的原始步表](sample-6.csv) | |
| 57 | +如需指定可执行文件,可运行 `python reproduce.py --lean /path/to/lean`。所有 `.olean` 均在新建的临时目录内产生。七份本轮生成文件均保存在本目录。公理记录来自具体已证定理,依赖最多为 Lean 标准公理 propext、Classical.choice、Quot.sound。没有 sorryAx 或自定义公理。项目没有配置站内自动检验,本次运行属于本地复验。[完整 Lean 输出](shift-lean.txt) · [复验程序](../reproduce.py) · [起点 6 的原始步表](sample-6.csv) | |
| 50 | 58 | |
| 51 | 59 | 对两份临时副本做了故意改错的复验。将倍增指数上界从 480 改为 479,或将十步终点从 729q+722 改为 729q+723,两份源码分别被 Lean 拒绝。 |
+5 −0 routes/codex-odd-preimage-issue1/out/index-families.csv added View file
| @@ -0,0 +1,5 @@ | ||
| 1 | +q系数,q常数,p系数,p常数,从p到q的原始步数,路径 | |
| 2 | +9,8,8,7,5,UHHUH | |
| 3 | +2187,1415,2048,1325,18,UHHUHUHHUHUHUHUHHH | |
| 4 | +2187,1541,1024,721,17,UHHUHUHHUHUHUHHUH | |
| 5 | +2187,1887,2048,1767,18,UHHUHUHHUHUHHUHHUH | |
+3 −0 routes/codex-odd-preimage-issue1/out/shift-lean.txt View file
| @@ -49,6 +49,9 @@ RepeatedReturns.lean | ||
| 49 | 49 | SingleClass.lean |
| 50 | 50 | 'CollatzRoute.index_eight_family' depends on axioms: [propext, Quot.sound] |
| 51 | 51 | 'CollatzRoute.claim_iff_remaining_indices' depends on axioms: [propext, Classical.choice, Quot.sound] |
| 52 | +'CollatzRoute.index_1415' depends on axioms: [propext, Quot.sound] | |
| 53 | +'CollatzRoute.index_1541' depends on axioms: [propext, Quot.sound] | |
| 54 | +'CollatzRoute.index_1887' depends on axioms: [propext, Quot.sound] | |
| 52 | 55 | 'CollatzRoute.claim_iff_smaller_index' depends on axioms: [propext, Classical.choice, Quot.sound] |
| 53 | 56 | 'CollatzRoute.check_merge_examples' does not depend on any axioms |
| 54 | 57 | 'CollatzRoute.doubling_table' does not depend on any axioms |
+21 −3 routes/codex-odd-preimage-issue1/reproduce.py View file
| @@ -211,6 +211,23 @@ def lower_index_rows(): | ||
| 211 | 211 | visited.append(positions) |
| 212 | 212 | return rows |
| 213 | 213 | |
| 214 | +def index_families(): | |
| 215 | + rows = [["q系数","q常数","p系数","p常数","从p到q的原始步数","路径"]] | |
| 216 | + for a,b,c,d,length in ((9,8,8,7,5),(2187,1415,2048,1325,18), | |
| 217 | + (2187,1541,1024,721,17),(2187,1887,2048,1767,18)): | |
| 218 | + line = 576*c, 576*d+569 | |
| 219 | + path = [] | |
| 220 | + for _ in range(length): | |
| 221 | + forward = [hop for hop in neighbours(*line) if hop[0] in ("H", "U")] | |
| 222 | + require(len(forward) == 1, "Parity not uniform") | |
| 223 | + op, slope, base = forward[0] | |
| 224 | + path.append(op) | |
| 225 | + line = slope, base | |
| 226 | + require(line == (576*a, 576*b+569) and c <= a and d < b, "Incorrect index family") | |
| 227 | + rows.append([a,b,c,d,length,"".join(path)]) | |
| 228 | + return csv_bytes(rows) | |
| 229 | + | |
| 230 | + | |
| 214 | 231 | def run_lean(executable): |
| 215 | 232 | lean = shutil.which(executable) |
| 216 | 233 | if lean is None: |
| @@ -236,13 +253,14 @@ def run_lean(executable): | ||
| 236 | 253 | |
| 237 | 254 | def main(): |
| 238 | 255 | parser = argparse.ArgumentParser(description=__doc__) |
| 239 | - parser.add_argument("--write", action="store_true", help="replace the six generated outputs") | |
| 256 | + parser.add_argument("--write", action="store_true", help="replace the seven generated outputs") | |
| 240 | 257 | parser.add_argument("--lean", default="lean", help="Lean executable (default: lean on PATH)") |
| 241 | 258 | args = parser.parse_args() |
| 242 | 259 | table, residues = certificate_rows() |
| 243 | 260 | outputs = {"certificates.csv": table, "least-representatives.csv": least_examples(residues), |
| 244 | 261 | "return-examples.csv": returns_table(), "single-class.csv": single_class_table(), |
| 245 | - "lower-index.csv": csv_bytes(lower_index_rows()), "shift-lean.txt": run_lean(args.lean)} | |
| 262 | + "lower-index.csv": csv_bytes(lower_index_rows()), | |
| 263 | + "index-families.csv": index_families(), "shift-lean.txt": run_lean(args.lean)} | |
| 246 | 264 | for name, expected in outputs.items(): |
| 247 | 265 | path = OUT / name |
| 248 | 266 | if args.write: |
| @@ -251,7 +269,7 @@ def main(): | ||
| 251 | 269 | # Git on Windows can check text files out with CRLF. |
| 252 | 270 | require(path.read_bytes().replace(b"\r\n", b"\n") == expected, f"Output differs: {name}") |
| 253 | 271 | print("OK: 8 Lean modules; 576 general, 64 checkpoint and 9 refinement rows; " |
| 254 | - "15 least representatives, 14 family examples and 81 single-class bridges; 32 lower-index witnesses.") | |
| 272 | + "15 least representatives, 14 family examples and 81 single-class bridges; 32 lower-index witnesses and 4 symbolic index families.") | |
| 255 | 273 | |
| 256 | 274 | |
| 257 | 275 | if __name__ == "__main__": |