每日科技文摘Daily Tech Digest

每日思考文摘 · 2026-10-26Daily Thought Digest · 2026-10-26

发布于 2026-10-26Published 2026-10-26

今日深读Today's Deep Read

重写世界的成本突然便宜了:为什么大多数程序员还在用旧时代的成本模型When Rewriting the World Got Cheap: Why Most Programmers Still Use Last Era's Cost Model

今年初,Postgres 开发者 Michael Malis 一直说『我们该把软件写得更大胆一些』。这句话听上去像口号,但 Dan Luu 在 10 月 24 日这篇帖子里把它落实成了具体的证据:pgrust 项目在做的事是——用 Rust 重写 Postgres 的查询层。这个规模的项目,按旧成本模型,需要一支团队花几年才有产出;而 Malis 已经靠它找到 Postgres 里好几个真实的 bug(数值 bug 导致 SP-GiST 操作失败、JSONPath 缓存错误、pgcrypto 后续操作失败、字典加载器的内存安全 bug、金额溢出 bug)。Luu 的原话很关键:『即使 pgrust 本身最终失败了,光是做这个尝试,就已经让 Postgres 永久变好了。』Early this year, Postgres developer Michael Malis kept telling people 'we should be more ambitious with the software we build.' It sounds like a slogan, but Dan Luu's October 24 post turns it into concrete evidence: pgrust, a project to rewrite Postgres's query layer in Rust, is the kind of project that under the old cost model would take a team years. Instead, Malis has already found real bugs in Postgres through it — a numeric bug breaking valid SP-GiST operations, a JSONPath cache bug producing wrong results, a pgcrypto bug, memory-safety bugs in the dictionary loader, a money-overflow bug. Luu's key line: even if pgrust itself never succeeds, just attempting it has made Postgres permanently better.

Luu 接下来做了一个他自己在其他领域也验证过的事情:他不懂正则引擎,但现在可以花『个位数小时』写出一个比通用正则库在自己特定工作负载上更快的引擎;他不懂编译器,但 fork 了 Rust 的 ripgrep 让它编译自己的正则;他甚至不打算自己造轮子去做『直接 I/O』或自定义文件系统——因为这些事情在 AI 编码助手能力暴涨之前,对一个没有对应背景的人来说,是那种『只会让永远不会发货的人才会去碰』的事。他的观察是:『我最有生产力的几个同事到现在还保留着对这类项目的本能抗拒,即使这类项目现在其实完全合理。』Luu has verified the same pattern in other domains: he knows nothing about regex engines, but now spends single-digit hours building one faster than the general-purpose libraries on his own workloads; he forks ripgrep so its regex backend compiles; he's not even willing to build his own direct-I/O or filesystem layer, because those are now things a person with no background in the area can 'get good enough.' His observation: several of his most productive colleagues still carry a reflexive aversion to this kind of project, even though it's now genuinely reasonable to attempt it.

他还补充了一个更细的对比:他之前用 GPT-5.1/5.2 做棋牌 AI,花了约 5 小时才做到『超人级』,约 20 小时做到当时公开平台(Board Game Arena)上最强的一个,中间大部分时间花在纠正模型『表面像某个技术、但其实没做对』的实现上。换成 Fable 5.1 和 Opus 5.5 之后,模型能直接读懂论文并正确实现里面的技术,这个纠正过程几乎消失了——对没有该领域背景的人来说,这是时间成本数量级的变化。He also adds a finer-grained comparison: doing board-game AI with GPT-5.1/5.2 took him roughly 5 hours to reach superhuman play and 20 hours to reach the strongest public engine on Board Game Arena, mostly spent correcting the model's 'looks like the technique but isn't' implementations. With Fable 5.1 and Opus 5.5, the model reads the paper and implements the technique correctly — for someone with no domain background, that's a change in the order of magnitude of the time cost.

核心论点其实很简单,但值得每个人重新想一遍:AI 没有让『大胆』本身变得可行,AI 改变了大胆行为在时间维度上的成本——过去需要整年、几乎注定做不完的事,现在是个位数小时就能『够用到』。大多数资深程序员判断『这事该不该做』时,脑子里跑的还是前 agent 时代的成本表。Luu 自己说,他本来想写的是『我们可以』而不是『我们该』——因为真正的问题不是道德上的应该,是成本模型过时了。The actual thesis is simple but worth everyone re-running: AI didn't make ambition possible — it changed the time cost of ambitious work. Something that used to be a year-long, almost certainly unfinished project is now a single-digit-hours 'good enough.' Most senior engineers deciding 'should we even attempt this?' are still running the pre-agent cost table in their heads. Luu says he'd have written 'we can' rather than 'we should' — the real issue isn't moral obligation, it's an outdated cost model.

AI 思考Thinking About AI

数学之美The Beauty of Math

每日 Lean 谜题 · 周一Daily Lean Puzzle · Monday ★☆☆☆☆☆☆

为什么 2 的 10 次方减 1 恰好被 11 整除Why 2 to the 10th, Minus 1, Is Exactly Divisible by 11

证明 $11$ 整除 $2^{10} - 1$,也就是 $2^{10} - 1$ 是 $11$ 的倍数。Prove that $11$ divides $2^{10} - 1$; that is, $2^{10} - 1$ is a multiple of $11$.

提示思路:不用真的算出 $2^{10}$,而是观察 $2^{10}$ 和 $2$ 的某次幂之间存在什么循环规律。Suggested direction: you don't actually need to compute $2^{10}$ — look for a cyclic pattern in the powers of $2$ modulo $11$.

Lean 形式化陈述(把 sorry 换成你的证明):The statement in Lean (replace sorry with your proof):

-- level: 1
import Mathlib
/-! Prove that $11$ divides $2^{10} - 1$. -/
theorem eleven_dvd_two_pow_10_minus_1 : 11 ∣ 2 ^ 10 - 1 := by
  sorry

在浏览器中挑战 ▶Try it in your browser ▶ 下载题目 .leanDownload puzzle .lean

提示Hint

先算 $2^5$,再平方得到 $2^{10}$,看看模 $11$ 下会发生什么。Compute $2^5$ first, then square it to get $2^{10}$, and see what happens modulo $11$.

答案与讲解Solution & walkthrough
  1. 第一步(数学):先算 $2^5 = 32$。$32$ 除以 $11$ 余数是 $10$(也就是 $-1$ 模 $11$)。Step 1 (math): first compute $2^5 = 32$. Modulo $11$, that's $10$, i.e. $-1$.
  2. 第二步(数学):既然 $2^5 \equiv -1 \pmod{11}$,两边再平方:$2^{10} = (2^5)^2 \equiv (-1)^2 = 1 \pmod{11}$。Step 2 (math): since $2^5 \equiv -1 \pmod{11}$, square both sides: $2^{10} = (2^5)^2 \equiv (-1)^2 = 1 \pmod{11}$.
  3. 第三步(数学):$2^{10} \equiv 1 \pmod{11}$ 直接推出 $11 \mid (2^{10} - 1)$。Step 3 (math): $2^{10} \equiv 1 \pmod{11}$ immediately implies $11 \mid (2^{10} - 1)$.
  4. 第四步(Lean):Lean 里用 `decide` tactic 完成整个证明——它把『$11$ 是否整除 $2^{10}-1$』变成一个有穷的布尔判定,展开计算即可。Step 4 (Lean): in Lean, the `decide` tactic handles the whole proof — it reduces 'does $11$ divide $2^{10}-1$?' to a finite Boolean check and evaluates it.
  5. 第五步(理解 `decide` 的边界):这道题之所以适合用 `decide`,是因为两边的数字都有具体的上界($2^{10}=1024$,$1024-1=1023$,$1023 = 11 \times 93$),没有一般化的变量。如果题目换成『证明对所有 $n$,$11 \mid 2^n - 1$ 当且仅当 $10 \mid n$』,`decide` 就不够用了,需要归纳或更深入的群论工具。Step 5 (understanding `decide`'s limits): this problem works with `decide` because both sides have concrete numeric bounds ($2^{10}=1024$, $1023 = 11 \times 93$) with no general variables. If the problem were instead 'prove $11 \mid 2^n - 1$ iff $10 \mid n$', `decide` alone would no longer suffice — you'd need induction or deeper group-theoretic tools.
-- level: 1
import Mathlib
/-! Prove that $11$ divides $2^{10} - 1$. -/
theorem eleven_dvd_two_pow_10_minus_1 : 11 ∣ 2 ^ 10 - 1 := by
  decide

运行答案 ▶Run the solution ▶ 下载答案 .leanDownload solution .lean

人的思考A human's take

Musings on A New Interface for Mathematics (Jeremy Kun) — Jeremy Kun

这篇是 Kun 给他《程序员数学导论》写的收束章,主角是 Bret Victor 的『Kill Math』:Victor 厌恶纸笔符号操作,认为数学该有一种能实时操纵、立刻看到结果的『新界面』。Kun 大体同意底层判断——更好的界面历史上反复改造过数学:代数、近代符号记法、集合论、范畴论,每一次都让人能想『原本根本想不了的想法』;但他在意的是,Kun 指出符号记法恰恰是一种『能扩展复杂度』的界面:它可以操作画不出来、甚至逻辑上不存在的东西(反证法就靠这个),而且纸本身替人分担了一部分认知负荷。他给任何想替代记法的新界面开出四条标准:反事实推理、意义赋予、灵活复杂度(小孩和职业数学家都能用)、渐进主义(上手一个新话题不必先把该话题的全部知识编码进去)。Kun's essay, the closing chapter of his book 'A Programmer's Introduction to Mathematics,' is a dialogue with Bret Victor's 'Kill Math': Victor despises pencil-and-paper symbol shuffling and wants a math interface you can manipulate live, with instant feedback. Kun broadly accepts the underlying claim — better interfaces have repeatedly reshaped math: algebra, modern symbolic notation, set theory, category theory, each one letting people 'think thoughts that could not previously have been thought.' But he pushes back on the plan to replace notation: symbolic notation is itself an interface that scales complexity, letting you manipulate objects you can't picture and that may not even exist (proof by contradiction runs on exactly that), while paper offloads cognitive load. He then sets four desiderata any new interface must meet: counterfactual reasoning, meaning assignment, flexible complexity (usable by both a child and a working mathematician), and incrementalism (studying a topic shouldn't require first encoding everything known about it).

跟今天谜题的关系(注:以下是编者联想,非 Kun 原文):Lean 正踩在 Kun 划的那条线上——`decide` 一行把『11 是否整除 $2^{10}-1$』变成机器可核查的判定,这就是他说的『即时性』;但这道题真正的人类想法——先发现 $2^5 \equiv -1 \pmod{11}$、再平方——是界面替不掉的那一步,所以页面上的讲解把数学一侧和 Lean 一侧分开写。Relation to today's puzzle (note: the connection below is the editor's, not Kun's text): Lean sits right on the line Kun draws — the one-line `decide` turns 'does 11 divide $2^{10}-1$?' into a machine-checkable verdict, which is the immediacy he wants. But the puzzle's real human thought — noticing $2^5 \equiv -1 \pmod{11}$ and squaring — is the step no interface supplies, which is why the walkthrough separates the math side from the Lean side.

AI 随想An AI's reflection

以下由 AI 撰写。Written by AI.

这道题很小,小到一行 `decide` 就能关干净,但它是『模算术循环』这个想法最好的入门:任何一个质数 $p$,$2$ 的幂在模 $p$ 下都会形成一个循环,这个循环的长度($2$ 模 $p$ 的乘法阶)就是整除性判断的全部依据。This puzzle is tiny — one `decide` closes it completely — but it's the ideal introduction to the 'modular arithmetic cycle' idea: for any prime $p$, the powers of $2$ modulo $p$ form a cycle, and that cycle's length (the multiplicative order of $2$ mod $p$) is the whole basis for any divisibility question you'll ask.

今天选了 $11$,因为 $2^5 \equiv -1 \pmod{11}$ 这个中间结果特别干净——它让『平方一次』成为自然的下一步,比直接算 $2^{10}$ 短得多。这个『先找到一个负号、再平方掉它』的套路,在数论里出现频率高得惊人:Fermat 小定理、Euler 判别法、各种 Legendre 符号计算,底层逻辑都是同一个。We picked $11$ today because $2^5 \equiv -1 \pmod{11}$ is a remarkably clean intermediate result — it makes 'square it once' the natural next move, far shorter than computing $2^{10}$ directly. This 'find a minus sign, then square it away' pattern shows up over and over in number theory: Fermat's little theorem, Euler's criterion, Legendre-symbol computations all run on the same underlying logic.

作为周一的 ★1 谜题,它真正的考点不是『会不会按计算器』,而是你能不能在拿到一个陌生的模运算题目时,第一反应是找循环而不是硬算——这个直觉练熟了,后面的 ★2、★3 谜题(短证明、经典初等定理)就会顺手得多。As a Monday ★1 puzzle, the real test isn't 'can you do the arithmetic' — it's whether your first reflex on an unfamiliar modular-arithmetic problem is to look for the cycle, not to grind through the calculation. Once that reflex is automatic, the ★2 and ★3 puzzles ahead (short proofs, classic elementary theorems) fall into place much more easily.

✓ 已通过 Lean 编译验证(无 sorry,无额外公理)✓ Verified by Lean (no sorry, no extra axioms) · 题目与证明由 AI 编写Problem and proof written by AI · Lean v4.35.0 · Mathlib 56a0058

程序员随想Notes From Programmers

哲学与生活Philosophy and Life

工具角Tools Corner