← 全部题目

n>1 时 n! 不是平方数

已知结果:完整形式化验证 已知结果,初等数论,档:低(只在本项目放宽),已知结果的形式化

原题

对每个 n>1,n! 都不是完全平方数。

来源:经典结果,用 Bertrand 公设证明(按一般资料填写,没有逐条核对原文)。中文陈述由本项目改写,以来源为准。

第一轮的提示(Claude 写的):rintro n hn ⟨m, hm⟩ (n! = m * m). Get a prime p with n < 2*p and p ≤ n: if n = 2 or 3, p = n or p = 2... in general apply Nat.exists_prime_lt_and_le_two_mul (n/2) (n/2 ≠ 0) : ∃ p, p.Prime ∧ n/2 < p ∧ p ≤ 2*(n/2), so p ≤ n and n < 2*p (omega). p ∣ n! (Nat.dvd_factorial), so p ∣ m ((Nat.Prime.dvd_mul hp).1 hm-form, or_self), so p^2 ∣ n! . But show ¬ p^2 ∣ n!: lemma by induction on j: if p ≤ j and j < 2*p then (j)! = p * c with ¬ p ∣ c: for j = p use Nat.factorial_succ / (p-1)! not divisible by p via (Nat.Prime.dvd_factorial hp).1; step multiplies c by j+1 where p < j+1 < 2*p, so ¬ p ∣ (j+1). Then p^2 ∣ p*c gives p ∣ c, a contradiction.

第 5 轮的方向(Claude 写的):

Three fixes. (1) For p^2 ∣ (j+1) * j! with Coprime (p^2) (j+1), use Nat.Coprime.dvd_of_dvd_mul_left hcop2 hdvd. (2) Where omega fails, pass it what it needs: state p ≤ j, j + 1 < 2*p and 2 ≤ p (hp.two_le) as hypotheses; in the induction, generalize the bound (∀ j, p ≤ j → j < 2*p → ¬ p^2 ∣ j!) and intro the bound inside each case, so that the hypothesis ih can use j < 2*p from j+1 < 2*p. (3) In the base case use p! = p*(p-1)! from Nat.mul_factorial_pred hp.ne_zero (check the order) and cancel p with Nat.dvd_of_mul_dvd_mul_left hp.pos, after pow_two. No comments.

第 6 轮的方向(Claude 写的):

Nat.le_induction needs the hypothesis p ≤ j, not hp2 : 2 ≤ p. Write `intro j hpj; induction j, hpj using Nat.le_induction with | base => ... | succ j hpj ih => ...`, with the upper bound j < 2*p stated after the induction variable (∀ j, p ≤ j → j < 2*p → ¬ p^2 ∣ j !), introduced by `intro hlt hcon` in each case; in succ use `ih (by omega)`.

第 8 轮的方向(Claude 写的):

Only ¬ p ∣ (j+1) fails. Use: intro hd; obtain ⟨c, hc⟩ := hd; have hp2 : 2 ≤ p := hp.two_le; rcases c with _ | _ | c; (c = 0) simp at hc; (c = 1) then j + 1 = p, against hpj : p ≤ j, by `simp at hc; omega`; (c + 2) have : p * (c + 1 + 1) ≥ 2 * p := by nlinarith; omega, using the hypothesis j + 1 < 2 * p. Make sure hypotheses p ≤ j and j + 1 < 2 * p are in the context. Change nothing else.

Lean 陈述

∀ n : ℕ, 1 < n → ¬ IsSquare (Nat.factorial n)

证明

theorem solution : FSpec.Target := by
  unfold FSpec.Target
  rintro n hn ⟨m, hm⟩
  have hfac : n.factorial = m * m := hm
  have hhalf : n / 2 ≠ 0 := by
    intro h
    omega
  obtain ⟨p, hp, hlt, hle2⟩ := Nat.exists_prime_lt_and_le_two_mul (n/2) hhalf
  have hp2 : 2 ≤ p := hp.two_le
  have hpn : p ≤ n := by omega
  have hnp : n < 2 * p := by omega
  have hdvd_fac : p ∣ n.factorial := by
    exact (Nat.Prime.dvd_factorial hp).2 hpn
  have hpm : p ∣ m := by
    rw [hfac] at hdvd_fac
    rcases (Nat.Prime.dvd_mul hp).1 hdvd_fac with h | h
    · exact h
    · exact h
  have hp2fac : p^2 ∣ n.factorial := by
    rw [hfac]
    obtain ⟨k, hk⟩ := hpm
    exact ⟨k * k, by rw [hk]; ring⟩
  have key : ∀ j, p ≤ j → j < 2*p → ¬ (p^2 ∣ j.factorial) := by
    intro j hpj
    induction j, hpj using Nat.le_induction with
    | base =>
      intro hlt hcon
      have hpfac : p.factorial = p * (p-1).factorial := by
        have := Nat.mul_factorial_pred hp.ne_zero
        omega
      rw [hpfac] at hcon
      rw [pow_two] at hcon
      have h2 : p ∣ (p-1).factorial := Nat.dvd_of_mul_dvd_mul_left hp.pos hcon
      have hpP : p ≤ p - 1 := (Nat.Prime.dvd_factorial hp).1 h2
      omega
    | succ j hpj ih =>
      intro hlt hcon
      rw [Nat.factorial_succ] at hcon
      have hltj : p < j + 1 := by omega
      have hnpj : ¬ p ∣ (j+1) := by
        intro hd
        obtain ⟨c, hc⟩ := hd
        have hp2' : 2 ≤ p := hp.two_le
        rcases c with _ | _ | c
        · simp at hc
        · simp at hc
          omega
        · have : p * (c + 1 + 1) ≥ 2 * p := by nlinarith
          omega
      have hcop : Nat.Coprime p (j + 1) := by
        exact (hp.coprime_iff_not_dvd).2 hnpj
      have hcop2 : Nat.Coprime (p^2) (j+1) := hcop.pow_left 2
      have hdvd : p^2 ∣ (j+1) * j.factorial := hcon
      have : p^2 ∣ j.factorial :=
        Nat.Coprime.dvd_of_dvd_mul_left hcop2 hdvd
      exact ih (by omega) this
  exact key n hpn hnp hp2fac

检查记录

查现状按关键词查了本机 Mathlib,按文件名查了 lefttosolve 的证明库,没找到同样的结果。没找到不等于没人做过。
陈述探测简单策略证不了,也否不掉(正常)
陈述初查DeepSeek:通过。VERDICT: FAITHFUL | Exactly matches: for all natural n>1, n! is not a square.
有限搜索不适用
证明尝试DeepSeek 写的证明通过了 Lean 检查,陈述已由独立 agent 核对(第 8 轮;检查 2 次)
用量15 次调用,35,381 token

复核

2026-11-30T00:48:05Z独立 Claude agent(只看题意和 Lean 陈述):final_statement → ok。5 条盲测中判为忠于原题;盲测混了 2 条改弱的陈述(fib 去掉 0<n、tau 上界放成 4n+4),都被查出。没有人工审稿。

重跑

需要项目存档里的程序,这个网站上没有。

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:55Zprobe:ok
2026-11-29T22:33:46Zfaith:ok
2026-11-29T22:34:45Zattempt:fail
2026-11-29T22:42:43Zattempt:fail
2026-11-29T22:46:44Zattempt:fail
2026-11-29T23:56:42Zattempt:lean_ok