原题
对所有自然数 a、b,4ᵃ(8b+7) 都不能写成三个平方数之和。
来源:A.-M. Legendre 三平方和定理中较容易的方向(按一般资料填写,没有逐条核对原文)。中文陈述由本项目改写,以来源为准。
第一轮的提示(Claude 写的):Induct on a, generalizing x y z. Base: reduce modulo 8: squares mod 8 are 0, 1 or 4 (have : ∀ t : ℕ, t^2 % 8 = 0 ∨ t^2 % 8 = 1 ∨ t^2 % 8 = 4, from t % 8 cases with Nat.pow_mod and interval_cases or `rcases`), then omega. Step: the sum is 4*(..), so modulo 4 all three are even (t^2 % 4 = 0 if t is even, 1 if odd); write x = 2*x' and so on, cancel 4 with pow_succ and nlinarith/omega, and apply the hypothesis.
第 5 轮的方向(Claude 写的):
x y z aren't in scope at the induction. Write: `intro a; induction a with | zero => intro b x y z h ... | succ a ih => intro b x y z h ...`, so ih : ∀ b x y z, x^2+y^2+z^2 ≠ 4^a*(8*b+7). In the succ case: 4^(a+1) = 4*4^a (pow_succ); parity: for each t have t % 2 = 0 ∨ t % 2 = 1 and t^2 % 4 = 0 or 1 by the same cases; conclude that x, y, z are all even, obtain x = 2*x1 and so on (⟨x/2, by omega⟩), and apply ih b x1 y1 z1 (by nlinarith or by ring_nf at h ⊢; omega).
第 6 轮的方向(Claude 写的):
(1) Where omega has to see that 4 divides the sum, add `have h4 : (4 ^ (a+1) * (8*b+7)) % 4 = 0 := by rw [pow_succ]; exact Nat.mod_eq_zero_of_dvd ⟨4^a * (8*b+7), by ring⟩`, then `rw [← h] at h4` and omega. (2) For the last step, after substituting x = 2*x', y = 2*y', z = 2*z': `have h5 : 4 * (x'^2+y'^2+z'^2) = 4 * (4^a * (8*b+7)) := by calc 4 * (x'^2+y'^2+z'^2) = (2*x')^2+(2*y')^2+(2*z')^2 := by ring _ = 4^(a+1) * (8*b+7) := h _ = 4 * (4^a * (8*b+7)) := by ring`, then `Nat.eq_of_mul_eq_mul_left (by norm_num) h5`.
Lean 陈述
∀ a b x y z : ℕ, x ^ 2 + y ^ 2 + z ^ 2 ≠ 4 ^ a * (8 * b + 7)
证明
theorem solution : FSpec.Target := by
unfold FSpec.Target
intro a
induction a with
| zero =>
intro b x y z h
have hsq8 : ∀ t : ℕ, t ^ 2 % 8 = 0 ∨ t ^ 2 % 8 = 1 ∨ t ^ 2 % 8 = 4 := by
intro t
have hp : t ^ 2 % 8 = (t % 8) ^ 2 % 8 := Nat.pow_mod t 2 8
rw [hp]
have hlt : t % 8 < 8 := Nat.mod_lt t (by decide)
interval_cases h : t % 8 <;> simp
have hsum : (x ^ 2 + y ^ 2 + z ^ 2) % 8 ≠ 7 := by
rcases hsq8 x with hx | hx | hx <;>
rcases hsq8 y with hy | hy | hy <;>
rcases hsq8 z with hz | hz | hz <;>
omega
have h7 : (4 ^ 0 * (8 * b + 7)) % 8 = 7 := by simp
apply hsum
rw [h]
exact h7
| succ a ih =>
intro b x y z h
have hsq4 : ∀ t : ℕ, t ^ 2 % 4 = 0 ∨ t ^ 2 % 4 = 1 := by
intro t
have hp : t ^ 2 % 4 = (t % 4) ^ 2 % 4 := Nat.pow_mod t 2 4
rw [hp]
have hlt : t % 4 < 4 := Nat.mod_lt t (by decide)
interval_cases h : t % 4 <;> simp
have heven : ∀ t : ℕ, t ^ 2 % 4 = 0 → 2 ∣ t := by
intro t ht
have hp : t ^ 2 % 4 = (t % 4) ^ 2 % 4 := Nat.pow_mod t 2 4
rw [hp] at ht
have hlt : t % 4 < 4 := Nat.mod_lt t (by decide)
interval_cases h : t % 4
· exact ⟨t / 2, by omega⟩
· simp at ht
· exact ⟨t / 2, by omega⟩
· simp at ht
have h4 : (4 ^ (a+1) * (8*b+7)) % 4 = 0 := by
rw [pow_succ]
exact Nat.mod_eq_zero_of_dvd ⟨4^a * (8*b+7), by ring⟩
rw [← h] at h4
have hd : (x ^ 2 + y ^ 2 + z ^ 2) % 4 = 0 := h4
have hx2 : x ^ 2 % 4 = 0 := by
rcases hsq4 x with hx | hx <;>
rcases hsq4 y with hy | hy <;>
rcases hsq4 z with hz | hz <;> omega
have hy2 : y ^ 2 % 4 = 0 := by
rcases hsq4 x with hx | hx <;>
rcases hsq4 y with hy | hy <;>
rcases hsq4 z with hz | hz <;> omega
have hz2 : z ^ 2 % 4 = 0 := by
rcases hsq4 x with hx | hx <;>
rcases hsq4 y with hy | hy <;>
rcases hsq4 z with hz | hz <;> omega
obtain ⟨x', rfl⟩ := heven x hx2
obtain ⟨y', rfl⟩ := heven y hy2
obtain ⟨z', rfl⟩ := heven z hz2
have h5 : 4 * (x'^2+y'^2+z'^2) = 4 * (4^a * (8*b+7)) := by
calc 4 * (x'^2+y'^2+z'^2) = (2*x')^2+(2*y')^2+(2*z')^2 := by ring
_ = 4^(a+1) * (8*b+7) := h
_ = 4 * (4^a * (8*b+7)) := by ring
have hc : x' ^ 2 + y' ^ 2 + z' ^ 2 = 4 ^ a * (8 * b + 7) :=
Nat.eq_of_mul_eq_mul_left (by norm_num) h5
exact ih b x' y' z' hc
检查记录
| 查现状 | 按关键词查了本机 Mathlib,按文件名查了 lefttosolve 的证明库,没找到同样的结果。没找到不等于没人做过。 |
| 陈述探测 | 简单策略证不了,也否不掉(正常) |
| 陈述初查 | DeepSeek:通过。VERDICT: FAITHFUL | Exact negation: no natural x,y,z have sum of squares equal to 4^a(8b+7) for all a,b. |
| 有限搜索 | 不适用 |
| 证明尝试 | DeepSeek 写的证明通过了 Lean 检查,陈述已由独立 agent 核对(第 6 轮;检查 2 次) |
| 用量 | 9 次调用,20,346 token |
复核
| 2026-11-29T22:53:25Z | 独立 Claude agent(只看题意和 Lean 陈述):final_statement → ok。6 条盲测中判为忠于原题;盲测混了 2 条改弱的陈述,都被查出。 没有人工审稿。 |
重跑
需要项目存档里的程序,这个网站上没有。
cd 数学猜想工厂 python3 factory/verify.py # 重查所有保存的证明,不花 token python3 factory/controls.py known # 会调用模型;对照必须先全部通过 python3 factory/run_known.py # 做完的阶段会跳过 python3 factory/build_site.py
AI 和人各做了什么
AI:Claude 选题、写 Lean 陈述和证明思路、写检查和搜索程序;DeepSeek 初查陈述、尝试证明,通过的题再由另一个 Claude agent 核对陈述。程序:查现状、有限搜索、Lean 检查。
人:项目负责人提出目标并定规则,没有审过这道题的数学内容。
局限
这是已知结果,不是新结果,也不算解决开放问题。查现状只看了几个来源,搜不到不等于没人解决。DeepSeek 的初查不能代替独立的陈述核对。失败只说明这一次尝试没有成功。
版本和更正
| 2026-11-29T22:27:55Z | probe:ok |
| 2026-11-29T22:32:21Z | faith:ok |
| 2026-11-29T22:33:43Z | attempt:fail |
| 2026-11-29T22:42:18Z | attempt:fail |
| 2026-11-29T22:46:17Z | attempt:lean_ok |