每日思考文摘 · 2026-10-22Daily Thought Digest · 2026-10-22
发布于 2026-10-22Published 2026-10-22
今日深读Today's Deep Read
只有 1 字节熵的 CA 私钥:eMudhra 的 8 张中间证书,让全世界裸奔了 17 个月Eight Bits of Trust: How Eight CA Private Keys of One Byte Stood Between the World and Forged Certificates for 17 Months
Scott Helme 在 eMudhra 事件里做了一件很克制但很关键的事:他没有去讲『CA 私钥被偷了所以出事』这种熟悉的故事,而是把整起事故的『how』一层层剥开——8 张中间证书的私钥,不是被偷的,是从第一天起就是公开的:每张密钥的有效熵只有 1 个字节(d 等于 4、56、115 之类的小数字),任何看过证书的人,在自己笔记本上花不到 1 秒就能复原。这不是『供应链被黑』,这是『供应链在出厂时就没有锁』。Scott Helme did something restrained but crucial in the eMudhra incident write-up: instead of the familiar 'CA key was stolen, incident happened' story, he peeled the 'how' layer by layer. Eight intermediate CA private keys were not stolen — they were public from day one, because each one held only one byte of actual entropy (d = 4, 56, 115, …). Anyone who ever saw one of those certificates could recover the key in under a second on a laptop. This is not 'the supply chain got hacked.' This is 'the supply chain shipped without locks.'
他把这件事拆成三步。第一步是数学事实:P-384 椭圆曲线的私钥本应是一个 384 位的随机数($2^{384}$ 种可能,搜不过来),而 eMudhra 的 8 张密钥里,每个都是 47 个零字节加一个有内容的字节——最多 255 步就能穷举。这里值得停一秒,把『穷举』到底意味着什么说死:椭圆曲线签名里,公钥是私钥与一个固定基点的乘积($Q = dG$),验签只需要公钥;所以一旦有人把 d 试出来,他拿到的不是一个『理论上的漏洞』,而是一份和 eMudhra 完全一样的签名能力——可以给任何自己挑的域名签发证书,可以给任何软件签名。攻击成本不需要数学突破,只需要一段几十行的脚本加一次循环。第二步是时间事实:这些密钥从 2025 年 4 月起就写在公开证书里,到 2026 年 10 月被披露,中间 17 个月,任何一个看过证书的人都能复原——没有人『偷』,是因为根本不需要偷。第三步是范围事实:Chrome/Firefox/Safari 因为有 Certificate Transparency 强制校验兜住了,但 curl、CI 流水线、IoT 设备、Windows 代码签名这些默认 TLS 客户端既不查 CRL 也不查 CT,对它们来说『吊销』是一个没有效果的操作——吊销信息写在 CRL/OCSP 应答和 CT 日志里,靠客户端主动去查才生效;客户端不查,一张已被吊销的证书和一张正常证书在 TLS 握手里就无法区分。17 个月窗口里任何一次误用都无法被追溯,而受影响设备的证书有效期到 2039 年 7 月。He breaks it into three facts. The math: a P-384 elliptic-curve private key should be a 384-bit random number ($2^{384}$ possibilities — nobody can search that); eMudhra's keys were 47 zero bytes plus one content byte, so a search of at most 255 steps recovers every one. Pause for a second on what 'brute force' actually buys you: in elliptic-curve signatures the public key is the private key times a fixed base point ($Q = dG$), and verification only needs the public key — so whoever recovers d does not get 'a theoretical hole,' they get signing capability identical to eMudhra's own: certificates for any domain they choose, signatures on any software. No mathematical breakthrough is required — a few dozen lines of script and a loop. The time: the keys sat inside public certificates from April 2025 until the October 2026 disclosure — seventeen months in which anyone looking at the certificate could have recovered the key, and nobody 'stole' anything, because no theft was needed. The blast radius: Chrome, Firefox and Safari are protected by enforced Certificate Transparency, but default TLS clients — curl, CI pipelines, IoT devices, Windows code-signing — check neither CRL nor CT, so 'revocation' is a no-op for them — revocation only works because clients agree to look it up in CRL/OCSP responses and CT logs; if the client never asks, a revoked certificate and a valid one are indistinguishable during the TLS handshake. Anything abused in that 17-month window is unrecoverable, and affected device certificates stay valid until July 2039.
Helme 自己在机器上验证:一个伪造的 api.stripe.com 证书,在 curl/Python/Node 的默认设置下都通过了校验(『SSL certificate verify ok』)。这不是假设,是他跑出来的结果。他给出的应对也很具体:能更新的(操作系统 ca-certificates、certifi、Node、Homebrew、容器基镜像)立即更新;不能更新的(路由、打印、电视、家电的冻结固件)在证书 2039 年过期之前,永远信任着这批密钥。Helme verified this on his own machines: a forged api.stripe.com certificate passed validation in curl, Python and Node under default settings ('SSL certificate verify ok'). That is not a hypothetical, it is a measured result. His concrete response: update everything that ships a CA bundle (OS ca-certificates, certifi, Node, Homebrew, container base images); for what cannot be updated (routers, printers, TVs, appliances with frozen firmware), the trust window runs until the 2039 expiry.
真正值得带走的不是『记得打补丁』,而是一个更底层的原则:**信任一个体系时,最小熵决定安全边界,而不是流程**。这套体系里最弱的 1 字节,就替代了所有其他的 383 字节。这和 SRE 里『木桶最短的那块板』、加密里『Kerckhoffs 原理假设攻击者知道你的一切』是一脉相承的:当你说『我们安全』,要问的不是流程上我们做了哪些事,而是整个链条里最容易被绕过的那一处,熵是多少。反过来用,这是一份可执行的检查清单:审计一个系统时,别数自己上了多少层防护,去找最薄的那一层——随机数用的是哪个函数?密钥是不是生成流程里的默认值甚至写死的?哪一步的熵,已经小于攻击者的预算?The deeper takeaway is not 'remember to patch.' It is a principle: **in a trust system, the minimum entropy in the chain defines the security boundary, not the process**. The single weakest byte in the system replaced all the other 383 bytes. This is the same family of insight as 'the shortest stave of the bucket' in SRE and Kerckhoffs's principle in cryptography: when you say 'we are secure', ask not what processes you followed, but where the one point is where the chain's entropy drops, and how little it is. Flipped around, that is an executable checklist: when auditing a system, don't count the layers of defense — find the thinnest one. Which function generated the randomness? Is a key set to some default (or hard-coded) value in the provisioning flow? Which step's entropy is now smaller than an attacker's budget?
AI 思考AI Thoughts
- 「AI 编程已经不再是编码的瓶颈」:Anthropic 为什么把 Git 换成了 ScionCoding Is No Longer the Bottleneck: Why Anthropic Replaced Git with Scion
- 背景数字:Anthropic 在 2026 年 5 月平均每天合并 2500 次代码改动,到 9 月已经 30000 次/天。原来的 Git 基础设施(几百个内部镜像、定期 seed)撑不住了——他们算过一笔账:2500 万次/天 的 checkout,如果直接 fetch,每天要产生 600 PB 的 Git 流量。The numbers: Anthropic averaged 2,500 code merges per day in May 2026; by September it was over 30,000 per day. The old Git infrastructure (hundreds of internal mirrors, periodic seeds) could not keep up — they did the math: 25 million checkouts a day, fetched naively, is over 600 PB of Git traffic per day.
- 关键翻转不在『我们建了一个更快的 Git』,而在设计假设。Git 的一条根本假设是:客户端离线且自足(任何 clone 都是完整副本,可以离线 diff/blame/checkout)。Anthropic 观察到:他们的工具用户几乎全是 agent,而 agent 永远在线。于是他们问:如果从头设计一个假设客户端永远在线的版本控制系统,它会是什么样子?The key move is not 'we built a faster Git.' It is the design assumption. Git's fundamental assumption is that clients are offline and self-sufficient (any clone is a complete copy, capable of diff/blame/checkout offline). Anthropic noticed their tool users are almost entirely agents, and agents are always online. So the question became: what would source control look like if it were designed from scratch around 'clients are always reachable'?
- 由此推出四条原则:客户端-服务器不对称(客户端只维护有限缓存,所有历史/blame/diff 查询都走服务器 API)、一切要水平可扩展(没有 packfile、没有任何一处完整物化)、提交/合并/rebase 都在服务器侧(没有 push,所以没有锁,每次提交的成本只跟本次改动大小相关,不跟仓库总大小相关)、working copy 可选且稀疏(CI 只需要某个 diff 时直接问服务器,不用 checkout)。Four principles follow: client–server asymmetry (the client keeps a bounded cache; all history/blame/diff queries go to the server API); everything must scale horizontally (no packfiles, no fully materialized copy anywhere); commit/merge/rebase happen server-side (no push, no locks, and each commit's cost scales with the size of the change, not the size of the repo); the working copy is optional and sparse by design (a CI job that needs one diff asks the server for it, no checkout).
- 数据结构的巧处:最小单元是 changeset(写前日志条目),它只存『相对父节点改了哪些文件』+ 内容寻址指针。回答『谁最后改过这一行』这类问题用的是『derived data』——递归定义:每个 derived 类型的值可以从父 changeset 的值算出来。好处是随时可以新增一种 derived data 来优化某个查询,而客户端协议不变。The data-structure trick: the unit of work is a 'changeset' (a write-ahead-log entry) that stores only 'which files changed relative to my first parent' plus content-addressed pointers. Questions like 'who last edited this line' are answered by 'derived data' — defined recursively, so the value for any changeset can be computed from the values for its parents. The payoff: you can add a new derived-data type to speed up some query without changing the client protocol at all.
- 带走项:Anthropic 明说了这是先例,不是预言——『我们怀疑不会有太多公司很快有这个问题,但不会太久』。如果你的工具主要用户是永远在线的 agent,那么『离线可用』这个历史优点会变成 scaling 的敌人;反之如果你的用户是离线的人类工程师,坚持 Git 式设计是对的。关键不是『Git vs Scion 谁更好』,而是先问清楚你的客户端到底是什么。The takeaway: Anthropic states plainly that this is a leading indicator, not a prediction — 'we suspect very few organizations will have this problem soon, but not for long.' If your tool's primary users are agents that are always online, then 'works offline' — a historical virtue — becomes an enemy of scale; if your users are offline human engineers, the Git design is still right. The question is not 'Git vs Scion, which is better?' It is 'what actually is your client?'
- 被骂翻的『AI 强制令』,Majors 替它说句话:mandate 是一种拨款机制The Hated 'AI Mandate,' Defended: A Mandate Is a Funding Mechanism
- 背景是两边吵:工程师在网上怒骂又蠢又反效果的 AI 强制令;高管们炫耀自己的 mandate——看我们多快完成技能升级、多快出成绩,『顺便还裁了一批人』(Majors 冷冷补一句:难怪大家兴奋不起来)。她不否认有些 mandate 确实是惩罚性的、短视的;她的论点是:问题不在 mandate 本身,在于没有拨款的 mandate。The context is a two-sided fight: engineers online rage about dumb, counterproductive AI mandates; executives brag about theirs — look how fast we upskilled, how much faster we ship, 'and by the way we also laid people off' (Majors's dry aside: boy, I wonder why nobody is excited). She concedes some mandates are indeed stupid, punitive, shortsighted. Her claim: the problem is not the mandate, it is the *unfunded* mandate.
- 核心重构:mandate 是一种给变化『拨款』的方式。说出『接下来一段时间所有人都会变慢、有些截止日期会滑、这是有成本的,我们接受』,等于给 managers 发了免罪牌。不说这句话,实际是在告诉员工『用业余时间自己学会,如果愿意的话』——那就等于『这不是优先事项,公司不为此付钱』,剩下的只有压力和不确定性,而不是清晰的行动号召。The reframe: a mandate is a way of funding change. Saying out loud 'we will all be slower for a while while we figure this out, some deadlines will slip, and this is expensive — we accept that' hands managers a shield. Without that sentence, you are really telling people 'learn it in your spare time, if you feel like it' — which means 'this is not a priority and we will not pay for it,' leaving only extra pressure and uncertainty instead of a clear call to action.
- 第二层:mandate 是个 forcing function——它逼着组织把 tradeoff 说死:大家会放下什么工作?enablement(培训、工具、时间)谁来给、给多少?怎么、什么时候评估这时间花得值不值?『自愿采用』的姿态下这些对话可以无限拖延,mandate 让它们必须发生。The second layer: a mandate is a forcing function for the tradeoff conversation — what work do people put down? Who provides the enablement (training, tools, time), and how much? How will we judge whether the time was worth it? A 'voluntary adoption' posture lets you postpone these questions forever; the mandate forces them to happen.
- 全文最硬的是她给 mandate 设的条件:如果你有时间和空间,赢得人心(hearts and minds)更好,不必用 mandate;一旦要用,就必须一致——不要一边说 AI 转型是生死攸关,一边拒绝为转型付时间;不要一边说可有可无,一边回头怪员工没长出这门本事。『真去立法,你最好是对的,而且现实要尽快站在你这边:强迫员工去做他们明知错误、明知不成立的事,他们会记恨你很久。』The hardest part is the conditions she puts on mandates: if you have time and space, win hearts and minds instead; if you do mandate, be consistent — do not call the reorientation existential and refuse to fund it, and do not call it nice-to-have and then blame employees for not having built the skills. 'If you lay down the law, you had better be right — and reality had better back you up fast, because forcing people to do what they knew was wrong and would not work earns you their resentment for a long time.'
- 带走项:争论不该停在『该不该强制』,该问『我愿意把哪些成本说出口』——任何转型都要有人付钱,mandate 只是让这笔付款可见;不诚实的不是强制,是把『要求』包装成『建议』,再把成本转嫁给员工的业余时间。The takeaway: stop debating 'should AI be forced' and start asking 'which costs am I willing to name out loud.' Every transformation is paid for by someone; a mandate at least makes the payment visible. The dishonesty is not in mandating — it is in dressing a requirement up as a suggestion and shifting the cost onto employees' evenings and weekends.
数学之美Mathematics & Its Beauty
每日 Lean 谜题 · 周四Daily Lean Puzzle · Thursday ★★★★☆☆☆
「总和够大、平方和也够大,必有一个 ≥ 2」(★4)'The Sum Is Big, the Squares Are Big Too, So Some Term Must Be ≥ 2' (★4)
设 $a_1, a_2, \dots, a_n$ 是一组 $n>3$ 的实数,满足:Let $a_1, a_2, \dots, a_n$ be $n>3$ real numbers such that
$$a_1 + a_2 + \cdots + a_n \ge n$$$$a_1 + a_2 + \cdots + a_n \ge n$$
且and
$$a_1^2 + a_2^2 + \cdots + a_n^2 \ge n^2.$$$$a_1^2 + a_2^2 + \cdots + a_n^2 \ge n^2.$$
证明:$\max(a_1, a_2, \dots, a_n) \ge 2$。Prove that $\max(a_1, a_2, \dots, a_n) \ge 2$.
Lean 形式化陈述(把 sorry 换成你的证明):The statement in Lean (replace sorry with your proof):
/-
Copyright (c) 2026 The Compfiles Contributors. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kimi K3
-/
import Mathlib.Algebra.Order.Archimedean.Real.Basic
import Mathlib.Algebra.Order.BigOperators.Ring.Finset
import Mathlib.Algebra.Order.Ring.Star
/-!
# USA Mathematical Olympiad 1999, Problem 4
Let a₁, a₂, ..., aₙ be a sequence of n > 3 real numbers such that
a₁ + a₂ + ⋯ + aₙ ≥ n
and
a₁² + a₂² + ⋯ + aₙ² ≥ n².
Prove that max(a₁, a₂, ..., aₙ) ≥ 2.
-/
namespace Usa1999P4
theorem usa1999_p4 (n : ℕ) (hn : 3 < n) (a : Fin n → ℝ)
(hsum : (n : ℝ) ≤ ∑ i, a i) (hsq : (n : ℝ) ^ 2 ≤ ∑ i, (a i) ^ 2) :
∃ i, 2 ≤ a i := by
sorry
end Usa1999P4
在浏览器中挑战 ▶Try it in your browser ▶ 下载题目 .leanDownload puzzle .lean
提示Hint
先做反证:假设所有 $a_i < 2$。把序列分成非负项($P$)和负项($N$)。有一个『平滑化』(smoothing)技巧:如果 $N$ 里有两个负数,把它们合并成一个负数加一个 0——总和不变,但平方和变大——所以最坏情况一定有『恰好一个』负项。把这个负项单独拎出来,剩下的就只是个一元不等式。Try contradiction: suppose all $a_i < 2$. Split the sequence into non-negative terms ($P$) and negative terms ($N$). There is a 'smoothing' trick: if $N$ contains two negatives, merge them into one negative plus a zero — the total sum is unchanged, but the sum of squares increases — so the worst case has exactly one negative term. Pull that one out and the rest is just a one-variable inequality.
答案与讲解Solution & walkthrough
- 第一步:做反证,假设所有 $a_i < 2$。Lean 里是 `by_contra! hlt2`,展开后得到一个假设 `hlt2 : ∀ i, a i < 2`(对每个 $i$ 都严格小于 2)。这个 `!` 后缀把目标取反并展开成具体形式,对应数学上『假设目标不成立』。Step 1: work by contradiction, assuming all $a_i < 2$. In Lean this is `by_contra! hlt2`, which unfolds into the hypothesis `hlt2 : ∀ i, a i < 2` (strictly less than 2 for every $i$). The `!` suffix negates the goal and expands it into this concrete form — the math step 'suppose the goal fails.'
- 第二步:把 $n$ 个索引分成两组——$P = \{i : 0 \le a_i\}$(非负项)和 $N = \{i : a_i < 0\}$(负项)。Lean 里用 `Finset.univ.filter` 做这件事(`set P := Finset.univ.filter fun i ↦ 0 ≤ a i`),然后有一个 `hpart` 引理:任何序列的总和等于 $P$ 上总和加 $N$ 上总和,这是『分拆求和』的标准操作。Step 2: split the $n$ indices into two sets — $P = \{i : 0 \le a_i\}$ (non-negative terms) and $N = \{i : a_i < 0\}$ (negative terms). In Lean, `Finset.univ.filter` does this (`set P := Finset.univ.filter fun i ↦ 0 ≤ a i`), and a helper lemma `hpart` says that any sum over all indices equals the $P$-part plus the $N$-part — the standard 'sum over a partition' move.
- 第三步:分两个情形。情形 A:$N = \emptyset$(所有项非负)。此时每个 $a_i^2 < 4$,所以 $\sum a_i^2 < 4n$;而 $n>3$ 即 $n \ge 4$,意味着 $4n \le n^2$($n=4$ 时取等号),于是 $n^2 \le \sum a_i^2 < 4n \le n^2$,矛盾。Lean 里这是第一个 `by_cases hNe : N = ∅` 分支,`nlinarith` 负责那个二次不等式判断。Step 3: two cases. Case A: $N = \emptyset$ (all terms non-negative). Then each $a_i^2 < 4$, so $\sum a_i^2 < 4n$; and $n>3$ — i.e. $n \ge 4$ — gives $4n \le n^2$ (equality at $n=4$), so $n^2 \le \sum a_i^2 < 4n \le n^2$ — contradiction. In Lean this is the first `by_cases hNe : N = ∅` branch, with `nlinarith` handling the quadratic-inequality check.
- 第四步:情形 B:$N$ 非空。令 $S = \sum_{i \in P} a_i$(非负项之和),$M = -\sum_{i \in N} a_i$(负项之和的相反数,$M>0$)。Lean 的 `set S := ...` 和 `set M := ...` 对应这个重命名。从总和一个 $S - M \ge n$;从平方和,非负部分每项 $a_i^2 \le 2a_i$(当 $0 \le a_i < 2$ 时 $a_i^2 < 2a_i$),所以 $\sum_P a_i^2 \le 2S$;负项部分 $\sum_N a_i^2 \le M^2$(把所有负项合成 $-M$ 之后平方就是 $M^2$,这是『平滑化』的 Lean 版——`sum_sq_le_sq_sum_of_nonpos` 引理)。Step 4: Case B: $N$ is non-empty. Let $S = \sum_{i \in P} a_i$ and $M = -\sum_{i \in N} a_i$ (with $M>0$). The Lean `set S := ...` and `set M := ...` lines correspond to these renamings. From the sum hypothesis: $S - M \ge n$. From the squares hypothesis: for non-negative terms, $a_i^2 \le 2a_i$ when $0 \le a_i < 2$ (since $a_i^2 < 2a_i$ strictly), so $\sum_P a_i^2 \le 2S$; for negative terms, $\sum_N a_i^2 \le M^2$ (merging all negatives into one $-M$ and squaring gives $M^2$ — this is the Lean version of 'smoothing', via the helper lemma `sum_sq_le_sq_sum_of_nonpos`).
- 第五步:把界串起来:由 $\sum_P a_i^2 \le 2S$ 和 $\sum_N a_i^2 \le M^2$ 得 $n^2 \le 2S + M^2$;又 $M \le S - n$,所以 $n^2 \le 2S + (S-n)^2$。移项,并用 Lean 证明里那条 `ring` 恒等式 $2S + (S-n)^2 - n^2 = S\,(S + 2 - 2n)$,得到 $0 \le S\,(S - 2(n-1))$。因为 $S > 0$($S \ge n + M > n > 0$),只能 $S \ge 2(n-1)$。另一边:$P$ 非空且每项严格小于 2,所以 $S < 2\cdot\#P$;而 $N$ 非空给出 $\#P \le n-1$,于是 $S < 2(n-1)$。两头一夹,矛盾。Lean 的最后几行(`hSge`、`hSlt`、`hcard`、`hfin`)对应的正是这条链。Step 5: chain the bounds: $\sum_P a_i^2 \le 2S$ and $\sum_N a_i^2 \le M^2$ give $n^2 \le 2S + M^2$; with $M \le S - n$ this becomes $n^2 \le 2S + (S-n)^2$. Rearranging via the ring identity the Lean proof uses, $2S + (S-n)^2 - n^2 = S(S + 2 - 2n)$, we get $0 \le S(S - 2(n-1))$. Since $S > 0$ (indeed $S \ge n + M > n$), this forces $S \ge 2(n-1)$. On the other hand, $P$ is non-empty and every term in it is strictly below 2, so $S < 2\cdot\#P$; and since $N$ is non-empty, $\#P \le n-1$, hence $S < 2(n-1)$. The two bounds squeeze each other — the last four Lean lines (`hSge`, `hSlt`, `hcard`, `hfin`) walk exactly this chain.
- 整条证明的核心是:平方和对『不均匀』很敏感——把所有项都压在 $<2$ 之下,平方和的上界被『均匀分布时最大』($M$ 集中在一个变量上时 $M^2$ 最大),而均匀分布恰恰意味着 $S$ 很大,$S$ 很大又意味着总和超出 $n$,矛盾。这是竞赛数学里典型的『集中 vs 均匀』权衡,Lean 的 `nlinarith` 把每个局部不等式都自动处理,人负责的是判断『哪些局部步骤该连起来』。The heart of the proof: the sum of squares is sensitive to 'unevenness.' Squeezing every term below 2 puts the worst-case square-sum where $M$ is concentrated in one variable ($M^2$ is largest when $M$ is concentrated), which is exactly the case where $S$ gets large, and a large $S$ means the total sum exceeds $n$ — contradiction. This is the classic 'concentration vs. uniformity' trade-off from olympiad mathematics; Lean's `nlinarith` handles each local inequality automatically, and the human's job is deciding which local steps to chain together.
/-
Copyright (c) 2026 The Compfiles Contributors. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Kimi K3
-/
import Mathlib.Algebra.Order.Archimedean.Real.Basic
import Mathlib.Algebra.Order.BigOperators.Ring.Finset
import Mathlib.Algebra.Order.Ring.Star
/-!
# USA Mathematical Olympiad 1999, Problem 4
Let a₁, a₂, ..., aₙ be a sequence of n > 3 real numbers such that
a₁ + a₂ + ⋯ + aₙ ≥ n
and
a₁² + a₂² + ⋯ + aₙ² ≥ n².
Prove that max(a₁, a₂, ..., aₙ) ≥ 2.
-/
namespace Usa1999P4
/-!
We follow the proof from Evan Chen's
[USAMO 1999 Solution Notes](https://web.evanchen.cc/exams/USAMO-1999-notes.pdf),
reformulated so that no iterative "smoothing" is needed.
Assume `aᵢ < 2` for all `i`. If every `aᵢ` is nonnegative, then
`∑ aᵢ² < 4n ≤ n²`, a contradiction. Otherwise, writing `S` for the sum of the
nonnegative entries and `-M` for the sum of the negative entries, one checks
`∑ aᵢ² ≤ 2S + M²` and `M ≤ S - n`, hence `n² ≤ 2S + (S - n)²`, which forces
`S ≥ 2n - 2`. But `S < 2·#P ≤ 2(n - 1)`, contradiction.
-/
/-- If every value of `f` on `s` is nonpositive, then the sum of the squares is
at most the square of the sum: the cross terms are nonnegative. -/
theorem sum_sq_le_sq_sum_of_nonpos {ι : Type*} (s : Finset ι) (f : ι → ℝ)
(hf : ∀ i ∈ s, f i ≤ 0) :
∑ i ∈ s, f i ^ 2 ≤ (∑ i ∈ s, f i) ^ 2 := by
have h1 : ∑ i ∈ s, f i ^ 2 = ∑ i ∈ s, (-f i) ^ 2 :=
Finset.sum_congr rfl fun i _ ↦ by rw [neg_sq]
have h2 : (∑ i ∈ s, f i) ^ 2 = (∑ i ∈ s, -f i) ^ 2 := by
rw [Finset.sum_neg_distrib, neg_sq]
rw [h1, h2]
exact Finset.sum_sq_le_sq_sum_of_nonneg fun i hi ↦ neg_nonneg.mpr (hf i hi)
theorem usa1999_p4 (n : ℕ) (hn : 3 < n) (a : Fin n → ℝ)
(hsum : (n : ℝ) ≤ ∑ i, a i) (hsq : (n : ℝ) ^ 2 ≤ ∑ i, (a i) ^ 2) :
∃ i, 2 ≤ a i := by
by_contra! hlt2
-- `P` = indices of the nonnegative entries, `N` = indices of the negative ones.
set P := Finset.univ.filter fun i ↦ 0 ≤ a i with hP
set N := Finset.univ.filter fun i ↦ ¬ 0 ≤ a i with hN
have hpart : ∀ f : Fin n → ℝ, ∑ i, f i = ∑ i ∈ P, f i + ∑ i ∈ N, f i :=
fun f ↦ (Finset.sum_filter_add_sum_filter_not Finset.univ _ f).symm
by_cases hNe : N = ∅
· -- Every entry is nonnegative, so `aᵢ² < 4` for all `i` and `∑ aᵢ² < 4n ≤ n²`.
have hnonneg : ∀ i, 0 ≤ a i := by
intro i
by_contra hi
have him : i ∈ N := Finset.mem_filter.mpr ⟨Finset.mem_univ i, hi⟩
rw [hNe] at him
exact Finset.notMem_empty i him
have hsum4 : ∑ i, (a i) ^ 2 < 4 * n := by
have hlt : ∑ i, (a i) ^ 2 < ∑ _i : Fin n, (4 : ℝ) := by
apply Finset.sum_lt_sum_of_nonempty
· have : Nonempty (Fin n) := ⟨⟨0, by lia⟩⟩
exact Finset.univ_nonempty
· intro i _
have h1 := hnonneg i
have h2 := hlt2 i
nlinarith [mul_nonneg h1 (sub_nonneg_of_le h2.le : (0 : ℝ) ≤ 2 - a i)]
rw [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] at hlt
linarith [hlt]
have hn4 : (4 : ℝ) * n ≤ (n : ℝ) ^ 2 := by
have h1 : (4 : ℝ) ≤ n := by exact_mod_cast hn
have h2 : (0 : ℝ) ≤ n := by positivity
calc (4 : ℝ) * n ≤ n * n := mul_le_mul_of_nonneg_right h1 h2
_ = (n : ℝ) ^ 2 := by ring
linarith
· -- Some entry is negative.
have hNne : N.Nonempty := Finset.nonempty_iff_ne_empty.mpr hNe
set S := ∑ i ∈ P, a i with hSdef
set M := -∑ i ∈ N, a i with hMdef
have hMpos : 0 < M := by
have hneg : ∑ i ∈ N, a i < 0 := by
have hlt : ∑ i ∈ N, a i < ∑ _i ∈ N, (0 : ℝ) :=
Finset.sum_lt_sum_of_nonempty hNne fun i hi ↦
not_le.mp (Finset.mem_filter.mp hi).2
rwa [Finset.sum_const_zero] at hlt
rw [hMdef]
exact neg_pos.mpr hneg
have hSM : (n : ℝ) ≤ S - M := by
have hp := hpart a
rw [hSdef, hMdef]
linarith [hsum, hp]
have hSpos : 0 < S := by
have hnpos : (0 : ℝ) < n := by exact_mod_cast (show 0 < n by lia)
linarith [hSM, hMpos, hnpos]
-- Bound the two parts of `∑ aᵢ²`: on `P` use `aᵢ² ≤ 2aᵢ`, on `N` the
-- cross terms of `M²` are nonnegative.
have hPsq : ∑ i ∈ P, (a i) ^ 2 ≤ 2 * S := by
rw [hSdef, Finset.mul_sum]
refine Finset.sum_le_sum fun i hi ↦ ?_
have h1 : 0 ≤ a i := (Finset.mem_filter.mp hi).2
have h2 : a i < 2 := hlt2 i
nlinarith [mul_nonneg h1 (sub_nonneg_of_le h2.le : (0 : ℝ) ≤ 2 - a i)]
have hNsq : ∑ i ∈ N, (a i) ^ 2 ≤ M ^ 2 := by
rw [hMdef, neg_sq]
exact sum_sq_le_sq_sum_of_nonpos N a fun i hi ↦
le_of_lt (not_le.mp (Finset.mem_filter.mp hi).2)
-- Combine: `n² ≤ 2S + (S - n)²`, hence `S ≥ 2n - 2`.
have hMle : M ≤ S - n := by linarith [hSM]
have hMsq : M ^ 2 ≤ (S - n) ^ 2 := pow_le_pow_left₀ hMpos.le hMle 2
have hcomb : (n : ℝ) ^ 2 ≤ 2 * S + (S - n) ^ 2 :=
calc (n : ℝ) ^ 2 ≤ ∑ i, (a i) ^ 2 := hsq
_ = ∑ i ∈ P, (a i) ^ 2 + ∑ i ∈ N, (a i) ^ 2 := hpart _
_ ≤ 2 * S + M ^ 2 := add_le_add hPsq hNsq
_ ≤ 2 * S + (S - n) ^ 2 := by linarith [hMsq]
have hSge : 2 * n - 2 ≤ S := by
have hstep : 0 ≤ S * (S + 2 - 2 * n) := by
have h2 : S * (S + 2 - 2 * n) = 2 * S + (S - n) ^ 2 - n ^ 2 := by ring
rw [h2]
linarith [hcomb]
have hX : 0 ≤ S + 2 - 2 * n := nonneg_of_mul_nonneg_right hstep hSpos
linarith
-- But `S < 2·#P ≤ 2(n - 1)`, contradiction.
have hPne : P.Nonempty := by
by_contra hcon
rw [Finset.not_nonempty_iff_eq_empty] at hcon
have hS0 : S = 0 := by rw [hSdef, hcon, Finset.sum_empty]
linarith [hSpos, hS0]
have hSlt : S < 2 * P.card := by
obtain ⟨j, hj⟩ := hPne
have hlt : ∑ i ∈ P, a i < ∑ _i ∈ P, (2 : ℝ) :=
Finset.sum_lt_sum (fun i _ ↦ le_of_lt (hlt2 i)) ⟨j, hj, hlt2 j⟩
rw [Finset.sum_const, nsmul_eq_mul] at hlt
rw [hSdef]
linarith [hlt]
have hcard : (P.card : ℝ) + 1 ≤ n := by
have h1 : P.card + N.card = n := by
have h2 := Finset.card_filter_add_card_filter_not (s := Finset.univ)
(p := fun i ↦ 0 ≤ a i)
rwa [Finset.card_univ, Fintype.card_fin] at h2
have h2 : 1 ≤ N.card := Finset.card_pos.mpr hNne
have h3 : P.card + 1 ≤ n := by lia
exact_mod_cast h3
have hfin : 2 * (P.card : ℝ) ≤ 2 * n - 2 := by linarith [hcard]
linarith [hSge, hSlt, hfin]
end Usa1999P4
人的思考A human's take
Evan Chen — USAMO 1999 Solution Notes(Problem 4) — Evan Chen(陳誼廷)
Evan Chen 的解法比 Lean 形式化里的还简洁一步:他直接用『smoothing』(平滑化)说——如果 $N$ 里有两个负数 $-x$ 和 $-y$($x,y>0$),把它们换成 $-(x+y)$ 和 $0$:总和不变,但平方和增大($(-x)^2+(-y)^2 < (-(x+y))^2$)。所以『最坏情况』(平方和最大的情况)一定恰好只有一个负项,可以假设 $a_n = -M$。Evan Chen's solution is one step more direct than the Lean formalization: he invokes 'smoothing' outright — if $N$ contains two negatives $-x$ and $-y$ ($x,y>0$), replace them with $-(x+y)$ and $0$: the total sum is unchanged, but the sum of squares increases ($(-x)^2+(-y)^2 < (-(x+y))^2$). So the 'worst case' (largest square-sum) has exactly one negative term, and one may assume $a_n = -M$.
接着 Chen 说把非负项都『平滑』到 2:得到两个不等式 $2(n-1) - M > n$ 和 $4(n-1) + M^2 > n^2$。前者给出 $M < n-2$(注意方向:这是严格不等式,$2(n-1) - M > n$ 推出 $M < 2n-2-n = n-2$);后者 $M^2 > n^2 - 4(n-1) = n^2 - 4n + 4 = (n-2)^2$ 推出 $M > n-2$。两行合起来 $M < n-2$ 和 $M > n-2$,矛盾。Chen then 'smooths' all the non-negative terms up to 2, yielding two inequalities: $2(n-1) - M > n$ and $4(n-1) + M^2 > n^2$. The first gives $M < n-2$; the second, $M^2 > n^2 - 4(n-1) = (n-2)^2$, gives $M > n-2$. Together, $M < n-2$ and $M > n-2$ — contradiction.
Chen 还给出了原题的等号情形:$n-1$ 个 $a_i$ 等于 2、最后一个等于 $-(n-2)$——此时总和恰好是 $n$、平方和恰好是 $n^2$、最大项恰好是 2。这说明结论里的『2』是紧的:常数一步都不能再往上调,这正是它作为竞赛题的漂亮之处。Chen also gives the equality case of the original problem: $n-1$ of the $a_i$ equal 2 and the last equals $-(n-2)$ — then the sum is exactly $n$, the square-sum exactly $n^2$, and the maximum exactly 2. So the constant 2 in the conclusion is tight: it cannot be pushed even slightly higher, which is what makes this such an elegant olympiad problem.
AI 随想An AI's reflection
以下由 AI 撰写。Written by AI.
这道题(USAMO 1999 P4)表面上是一道『证明某个变量 ≥ 某常数』的不等式,但真正的洞见藏在那个『平滑化』操作里:把两个负数合并成一个负数加一个 0,总和不变、平方和增大——这意味着『让平方和最坏』这件事,会把配置推向一个『尽可能集中』的形状。这是很多竞赛不等式题共享的底层直觉:当约束是『总和固定、求平方和最大』这类形式时,最坏情况总在『尽可能不均匀』的那端,而不是『均匀分布』那一端。USAMO 1999 P4 looks, on the surface, like a standard 'prove some variable is at least a constant' inequality. The real insight hides in that 'smoothing' move: merge two negatives into one negative plus a zero — total unchanged, sum of squares increased. This says that 'making the square-sum worst' pushes the configuration toward a 'maximally concentrated' shape. This is a low-level intuition shared by many olympiad inequality problems: when the constraint is 'sum fixed, maximize the sum of squares' (or its variants), the worst case sits at the 'as uneven as possible' end, not the 'evenly spread out' end.
把这条直觉套到 AI/数学工具上:这题之所以值得在 Lean 里做一遍(而不是纸面上已经解出),是因为 Lean 强迫你把这个『平滑化』拆成一个明确的引理(`sum_sq_le_sq_sum_of_nonpos`),而不是一句『这是显然的』滑过去。竞赛数学里『显然』两个字是危险词——它通常意味着『这里藏着一行没写的引理』。形式化之后,那个『显然』变成了引理名,可以单独复用(比如套到任何『非负项上求平方和上界』的场合)。Applying that intuition to AI/math tooling: this problem is worth doing in Lean (rather than having it already solved on paper) because Lean forces you to break the 'smoothing' into an explicit lemma (`sum_sq_le_sq_sum_of_nonpos`), instead of sliding past it with 'this is obvious.' In olympiad math, the word 'obvious' is a danger word — it usually means 'there is a lemma hiding that was not written down.' After formalization, that 'obvious' becomes a named lemma, reusable in any situation of the form 'bound the sum of squares over non-negative terms.'
还有一个容易忽略的点:$n>3$ 这个下界卡在哪里。卡在情形 A:所有项非负时,证明用的是 $\sum a_i^2 < 4n$,而要把 $4n$ 压进 $n^2$ 之内需要 $n \ge 4$。$n=3$ 时这一步崩了,而且确实有反例:$a_1 = a_2 = a_3 = \sqrt{3}$——总和 $3\sqrt{3} \approx 5.2 \ge 3$,平方和恰好 $9 = n^2$,最大项 $\sqrt{3} < 2$。$n=2$ 同样失败:$a_1 = a_2 = 1.9$,总和 $3.8 \ge 2$,平方和 $7.22 \ge 4$,最大项仍然小于 2。『为什么恰好是 $n>3$』这个问题,是对你理解深度的反查:能亲手构造出 $n=3$ 的反例,才说明你真知道那个不等式在证明里顶用的是哪一下。One easily-missed point: where the bound $n>3$ bites. It bites in Case A: when all terms are non-negative, the proof uses $\sum a_i^2 < 4n$, and pushing $4n$ below $n^2$ requires $n \ge 4$. At $n=3$ that step collapses — and there really is a counterexample: $a_1 = a_2 = a_3 = \sqrt{3}$, with sum $3\sqrt{3} \approx 5.2 \ge 3$, squares exactly $9 = n^2$, and maximum $\sqrt{3} < 2$. $n=2$ fails too: $a_1 = a_2 = 1.9$ gives sum $3.8 \ge 2$, squares $7.22 \ge 4$, maximum still below 2. Asking 'why exactly $n>3$?' is a reverse-check on your understanding: constructing the $n=3$ counterexample with your own hands means you know precisely which move the inequality is load-bearing for.
✓ 已通过 Lean 编译验证(无 sorry,无额外公理)✓ Verified by Lean (no sorry, no extra axioms) · 题目与形式化证明来自 compfiles(Apache-2.0 (compfiles, David Renshaw and contributors))Problem and formal proof from compfiles (Apache-2.0 (compfiles, David Renshaw and contributors)) · Lean v4.35.0 · Mathlib 56a0058
- AI 证明了『准 Riemann 假设』之后,数学界真正在想什么After AI Proved the Quasi-Riemann Hypothesis, What Mathematicians Are Actually Thinking
- 先说清『准 Riemann 假设』是什么:真正的 Riemann 假设说 ζ(s) 的所有非平凡零点都落在实部 1/2 这条竖线上;『准』版本只是说它们落在某个比已知范围(0 到 1)更窄的竖条里。OpenAI 声称的 1/12–11/12 这个界,Radziwiłł 的原话是『在某种意义上,Riemann 假设的绝大部分推论已经能被准RH覆盖』——所以这不是一个装饰品,是能用的界。First, what the 'quasi-Riemann hypothesis' actually says: the real RH claims all nontrivial zeros of ζ(s) lie on the vertical line at real part 1/2; the 'quasi' version only claims they lie in some narrower strip than the known 0-to-1 strip. OpenAI's claimed 1/12–11/12 bound, in Radziwiłł's words, 'in a sense already yields the vast majority of RH's consequences' — so this is not a decorative result, it is a usable bound.
- 真正让数学家惊讶的不是『AI 证出了一个结果』,而是证明用到的工具:它靠的是 Radziwiłł 和 Dunn 在 2021 年就证明的一个公式(当时被认为是小众工具),加上 Sarnak 三十年前就主张的『把 ζ 当成一族函数来研究』的直觉。两位当事人自己都很意外——他们的工具被『一个他们以为不够强的领域』拿来解决了大问题。What actually surprised mathematicians is not 'an AI proved something.' It is which tools the proof used: a formula Radziwiłł and Dunn had proved back in 2021 (then considered a niche tool), plus Sarnak's thirty-year-old intuition to study ζ as a member of a family of functions. Both parties were themselves surprised — a tool from a field they had believed was 'not strong enough' for this problem did the work.
- 这里有一个对『AI 到底是发现新数学还是重新排列旧数学』这个问题的具体样本:OpenAI 的 11/12 证明没有引入任何新概念(Dunn 的原话:『这是一个对老想法的惊人综合』),但综合的『路径』是人类数学家没有走过的那一条——Iwaniec 2002 年差一点就找到那个函数族。AI 的增量不体现在『新引理』上,体现在『把哪些老引理接在一起』上。This is a concrete data point for 'does AI discover new mathematics or reassemble old mathematics?': the 11/12 proof introduces no new concept (Dunn: 'a surprising synthesis of well-known ideas'), but the synthesis's path is one human mathematicians had not taken — Iwaniec came close to finding that function family in 2002. The AI's increment is not visible in 'new lemmas'; it is visible in 'which old lemmas got chained together.'
- Quanta 还提到一个容易被忽略的细节:722 篇 OpenAI 论文里只有这一篇在发布前有人类编辑过,而 OpenAI 没有说明那个人是谁、为什么。这个『唯一性』本身就是个值得盯住的事——如果只有 1/722 经过了人类的把关,那么『数学界消化 AI 产出』这件事,在统计意义上还没有真正开始。Quanta also flags an easily missed detail: of the 722 papers OpenAI released, only this one was edited by a human before publication, and OpenAI has not said who that person is or why. That 'uniqueness' is itself a thing to watch — if only 1/722 went through human vetting, then 'the mathematics community digesting AI output' has not really started, in any statistical sense.
- 带走项:判断『AI 在数学上做了什么』,不要看结果(11/12 这个界本身不惊艳),要看它用的工具链——如果工具链全是 5 年内的老工具,那么『发现』这个词要重新定义;如果工具链里出现了没人见过的中间步骤,才值得警惕『幻觉式证明』。Sarnak 已经把本学期的课改成专门研读这篇证明了,这就是消化过程开始的标志。The takeaway: to judge 'what AI actually did in mathematics,' look not at the result (the 11/12 bound itself is not dazzling) but at the toolchain — if the whole chain is tools from within the last five years, the word 'discovery' needs redefining; only if the chain contains an intermediate step nobody has seen before is it worth worrying about 'hallucination-style proofs.' Sarnak has repurposed his current course to study this paper; that is the digestion process starting.
- 自称 86% 的预测准确率,实测是 7%:给未来学家的每条可证伪预测重新打分(2022 年)'86% Accurate,' Self-Reported — Measured at 7%: Re-Grading Every Falsifiable Futurist Prediction (2022)
- 问题是实用的:怎么评判『按人类未来 10–50 年的问题来挑研究方向』的人的预测?你不可能等几十年看结果。Dan Luu 的办法是统计学的:把『已经到时可以验证』的预测翻出来打分。他拿维基百科『著名未来学家』名单当独立样本(避免自己挑对手),用 archive.org 取当时的预测清单,逐条对照实际发生了什么。The question is practical: how do you judge predictions by people who pick research directions based on 'the problems humanity will face 10–50 years out'? You cannot wait decades for the answer. Dan Luu's method is statistical: grade the predictions that are already checkable. He takes Wikipedia's list of well-known futurists as an independent sample (so he is not choosing his opponents), pulls the prediction lists from archive.org as of when they were published, and scores each one against what actually happened.
- 结果很硬,最扎眼的数字是:Kurzweil 声称自己 86% 准确(147 条预测对 115 条),这个说法被无数文章转引来支撑他的新预言;Luu 亲自重打那份清单,得分为 7%。Michio Kaku 3%,Patrick Dixon 10%。对照的另一端:Steve Yegge 50%(靠本行业的深度知识),Bryan Caplan 100%——Caplan 的方法是站在别人的坏赌注对面,只做极其保守的预测。The results are brutal, and the headline number is this: Kurzweil claims an 86% success rate (115 of 147 predictions correct) — a figure repeated endlessly to support his newer prophecies; when Luu re-graded that Wikipedia list himself, he measured 7%. Michio Kaku: 3%. Patrick Dixon: 10%. On the other side: Steve Yegge at 50%, from deep knowledge of his own industry, and Bryan Caplan at 100% — Caplan's method is to take the other side of people's bad bets and predict only very conservative things.
- Luu 对自己的方法也坦白:他承认『预测准的那组』是他从记忆里取的(非独立选择,有偏);而且他在写完 98% 之前刻意没读别人对预测方法学的评估(比如 Tetlock)——之后发现,两人用完全不同的数据集,结论却大致一致。这份交叉验证是他信心的来源。Luu is honest about his own method: he concedes the 'good predictors' were sourced from his memory — a non-independent, biased choice; and he deliberately avoided reading other people's evaluations of prediction methodology (like Tetlock's) until 98% of the post was written — after which he found he generally agreed with Tetlock, despite wildly different datasets. That independent convergence is what gives him confidence.
- 模式归因是真正的干货:用『大锤』的人——一个宏大论题(摩尔定律最重要、环境末日要来、量子是关键)加鸡尾酒会级别的领域知识,用来解释为什么预言必然成真——无论那个大论题本身对不对,分数都低;准的预测者有两个共同点:深厚的领域知识,以及系统性复盘自己过往预测错误的记录。Kurzweil 在可证伪预测九成落空之后,仍然用同一套指数外推持续生产新预测——这就是『不复盘』长什么样。The pattern is the payload: people with 'big hammer' methods — one grand thesis (Moore's law is supremely important, doomsday is coming, quantum is the key) plus cocktail-party-level domain knowledge used to explain why the prediction must come true — fare badly whether or not their big idea is even correct. The accurate predictors share two traits: deep domain knowledge, and a habit of seriously evaluating their own past predictive errors. Kurzweil, after the vast majority of his falsifiable early predictions failed, keeps generating new ones with the same exponential-extrapolation method — that is what 'not updating' looks like.
- 带走项:看到『自称的准确率』,先问谁打的分数、分母里有什么、含糊不可证伪的话有没有被算成命中;看一个预测者有没有修正过往错误的记录,而不是看他措辞多自信——没有记录这件事本身,就是对他未来预测失败率的最好预测。The takeaway: when you see a self-reported accuracy figure, ask who did the grading, what the denominator includes, and whether vague unfalsifiable claims counted as hits; and watch whether a forecaster has any record of correcting past errors — the absence of that record is itself the best predictor of future misses.
- 数学家写「=」的时候,多半不是在说『相等』(2018 年)'=' in a Mathematician's Hand Is Rarely 'Equality' (2018)
- 切入点是程序员和数学家的口水仗:函数式编程阵营常说『= 只该用来表示数学意义上的相等』,好像 x = x + 1 是亵渎。Kun 反手把这面旗拆了:真去看数学家在做什么,数学里的 '=' 比任何编程语言的操作符都松——编程语言的 =、==、=== 各有白纸黑字的语义,学一次就不出错;数学里的 '=' 常常只是『是』这个字的占位符,含义完全由上下文决定。The entry point is a programmer-versus-mathematician squabble: functional programmers often claim '=' should only ever mean equality in the mathematical sense, as if x = x + 1 were blasphemy. Kun flips the flag: look at what mathematicians actually do, and mathematical '=' is looser than any operator in any language. Programming's = / == / === each have one documented semantics you learn once and never get burned; in mathematics, '=' is mostly a stand-in for the word 'is,' and the context does the rest.
- 第一层:求和与集合记号里的 = 根本不相等。$\sum_{i=1}^n i^2$ 里的 $i$ 依次『等于』1、2、……、$n$——那是迭代;把 $A = \{n^2 : n = 1, 2, \dots, 100\}$ 按字面相等去解释,放到 Python 里直接是类型错误。这些用法比编程语言早了一百多年(求和记号是 Euler 定的),但没人觉得不妥,因为在场的人都知道这个 '=' 在干什么。Layer one: '=' in sums and set notation is not equality at all. In $\sum_{i=1}^n i^2$ the index $i$ 'equals' 1, 2, …, $n$ in turn — that is iteration; read $\{n^2 : n = 1, 2, \dots, 100\}$ as literal equality and Python would raise a type error. These usages predate programming by centuries (Euler set the summation notation), and nobody minds, because everyone in the room knows what this '=' is doing.
- 第二层:同一行 $f(x) = 2x + 3$ 里藏着三个身份。定义 $f$ 时 $x$ 是不定元;说 $f(2) = 7$ 时 $x$ 又同时是具体值;解方程 $f(x) = 7$ 时 '=' 变成了一个问句。数学家在三者之间随意切换,连定义域都会在证明中途变——$\frac{(x+1)x}{x}$ 化简成 $x+1$ 之后,对 $x = 0$ 的排除是事后才补回定义域的:论证开头的 '=' 和结尾的 '=' 不是同一种相等。Layer two: one line, $f(x) = 2x + 3$, carries three identities. In the definition, $x$ is indeterminate; in $f(2) = 7$, $x$ doubles as a concrete value; in $f(x) = 7$ as a question, '=' is a puzzle. Mathematicians switch freely — even the domain drifts mid-proof: simplify $\frac{(x+1)x}{x}$ to $x+1$, and the exclusion of $x = 0$ gets patched back afterwards; the '=' at the start of an argument is not the same equality as the one at the end.
- 第三层(最深的一层):同构冒充相等。两套不同的对称结构『内部关系完全一样』,数学家想用 '=' 来说这个『一样』;专门的符号 $\cong$ 写起来烦,而且群、图、向量空间、拓扑空间……『一百万种同构』不可能各有各的记号。Kun 再补一刀:说两个东西同构,根本没告诉你『怎么』同构——找出那个同构可能极难,极端情形甚至不可计算——『连检查都做不到,算什么相等?』Layer three, the deepest: isomorphism masquerading as equality. Two different symmetry structures have the same internal relationships, and mathematicians want '=' to say that. The dedicated symbol $\cong$ is annoying to write, and there are a million kinds of isomorphism — groups, graphs, spaces — no symbol budget covers them. Kun adds a sharp question: saying two things are isomorphic does not tell you how — finding the isomorphism can be tedious or even uncomputable. 'What good is equality you cannot even check?'
- 收尾引 Hersh 的名言:『数学就是数学家在做的事。』所以拿『数学更纯粹』当武器来反对 mutation 和赋值,立场本身就站不住——数学里没有什么刚性定义坐在王座上。程序员的带走项:代码里的 '=' 该多精确就多精确,因为它要在资源约束下描述具体过程;数学爱好者的带走项:数学的松不是 sloppy,是它的目标是理解事物,记号跟着目标走。The close quotes Reuben Hersh: 'mathematics is what mathematicians do' — so you cannot reject mutation or assignment by appealing to mathematics's purity; there was never a rigid definition sitting on the throne. Takeaway for programmers: '=' in code should be as precise as possible, because its job is describing a concrete process under resource limits. Takeaway for math lovers: mathematics's looseness is not sloppiness — its job is understanding things, and notation follows the job.
程序员随想A Programmer's Reflections
- 「我一年前在 SRECon 上讲别当刺头,现在我会讲『先搞清楚你自己是什么人』」A Year Ago I Told SREs Not to Be Naysayers; Today I'd Say 'First Figure Out What Kind of Person You Are'
- Majors 把一年前自己 SRECon25 的 keynote(『SRE 应该去学 AI,别做看客和刺头』)当作一个时间锚点:她现在说『我几乎认不出自己 11 个月前的观点了』。这个『认不出』本身是全文的题眼——一个资深可靠性工程师,承认自己在 AI 问题上一年内的判断翻转了,并且不把这当成丢脸的事。Majors uses her own SRECon25 keynote a year earlier ('SREs should learn AI, stop being spectators and naysayers') as a time anchor: she now says 'I can barely recognize my own views from eleven months ago.' That 'barely recognize' is the piece's whole point — a senior reliability engineer acknowledging that her judgment on AI flipped within a year, and refusing to treat that as a shame.
- 她给翻转找的机制,不是『我之前太悲观』,而是一个反确认偏误的操作:『如果你天生是刺头/悲观者,你要知道这一点,然后逼自己去找惊奇、惊讶和喜悦的证据;如果你天生是乐观者,你要知道这一点,然后逼自己读反面故事。』——这不是『保持开放心态』这种空话,是『知道你的偏置在哪,然后刻意往反方向做动作』。The mechanism she offers for the flip is not 'I was just too pessimistic.' It is a concrete anti-confirmation-bias move: 'if you are by nature a reflexive naysayer or pessimist, know that, and force yourself to look for evidence of wonder, surprise and delight; if you are by nature an optimist, know that, and force yourself to read the cautionary tales.' This is not the empty 'stay open-minded' — it is 'know where your bias sits, and deliberately act in the opposite direction.'
- 她对『AI 是不是又一次吹过头』的回应很克制:VR/AR、web3、元宇宙、3D 打印、共享经济这些 hype train 大部分是郁金香,云和互联网是真实的——『hype train 有时载你到互联网,有时载你到郁金香』。她说 AGI 目前是『一个与所有现有证据矛盾的思想实验』(技术突破在早期通常带来巨变,然后平台期),但她仍然主张 SRE 要学 AI,理由是:即使 AGI 不来,现在的 agent 已经在改游戏了。Her response to 'is AI just another hype train?' is restrained: VR/AR, web3, the metaverse, 3D printing, the sharing economy — most of those hype trains brought tulips; cloud and the internet were real. 'Sometimes the hype train brings you the internet, sometimes it brings you tulips.' She calls AGI, at present, 'an elaborate thought experiment that contradicts all the evidence we currently have' (technological breakthroughs typically yield huge early gains, then plateau) — and still argues SREs must learn AI, because whether or not AGI arrives, agents are already changing the game.
- 她引 Adam Jacob 的一句话作为全文的『行动项』:『如果你无法在工作中做到,就在家里做到——落后者的职业风险极高。』以及她自己的一句:『每个伟大的 technologist 都需要在技术专长之上再有一套组织技能:如何在组织里导航,如何在技术语言和商业语言之间翻译。』She quotes Adam Jacob as the 'action item': 'if you can't do it at work, do it at home — the career risk of being a laggard is incredibly high.' And her own line: 'every great technologist needs a set of organizational skills on top of technical expertise: how to navigate an organization, how to translate between the language of technology and the language of the business.'
- 带走项:这篇不是『AI 会取代 SRE』的恐慌文,也不是『立即拥抱 AI』的鼓吹文,它给的是第三个东西——『如何在事实改变的时候承认自己改变了,并且不让那个改变滑成另一种偏执』。这对任何做技术判断的人(不只是 SRE)都适用。The takeaway: this is not an 'AI will replace SREs' panic piece, and it is not an 'embrace AI now' cheerlead. It is a third thing — 'how to admit, when the facts change, that you changed, without that admission sliding into a new bias of its own.' That applies to any person making technical judgments, not just SREs.
- 「Tor 上 333 个出口节点被同时盯上 SSH:我是怎么把它们全找出来的」How 333 Tor Exit Nodes Simultaneously Targeted SSH — And How I Found Every One of Them
- 事件本身:10 月 2 日周五早上,333 个 Tor 出口节点(约占全网出口 10%)被同一批攻击者悄悄部署了 Ebury 1.8.3(OpenSSH 后门+凭据窃取),专门拦截明文邮件流量和 SSH 连接(中间人攻击把 SSH 重定向到 12 台拦截服务器)。攻击者 8 月就进了那些服务器,潜伏了两个月。The event: on Friday, October 2nd, 333 Tor exit nodes (roughly 10% of all exits) had Ebury 1.8.3 (an OpenSSH backdoor and credential stealer) quietly deployed by the same attackers, targeting plaintext mail traffic and SSH connections (a MITM that redirects SSH to 12 interception servers). The attackers had gained access in August and sat quiet for two months.
- 作者的发现方法值得学:他没有等某个人被中招后去读日志,而是写了一个脚本,用 exitmap 把出口节点『钉住』,然后从自己的服务器 A 连服务器 B 走 Tor 出口,让 A 检查收到的 SSH 指纹是否正确、B 检查连接实际是从哪个出口出来的。3000 个出口节点跑一遍:大约十几个直接发了假指纹,300 多个不拦截但把流量转给了那 12 台拦截服务器。『重定向本身就已经能确认被感染了』——这是他区分『直接攻击』和『中转攻击』两个子集的方法。The author's detection method is worth learning from: instead of waiting for someone to get hit and reading logs afterward, he wrote a script that pins an exit node via exitmap, then opens an SSH connection from his server A to his server B through Tor, with A checking whether the SSH fingerprint it received matches B's real one, and B checking which exit the connection actually came out of. Run across ~3,000 exits: a dozen or so served a fake fingerprint directly; 300+ did not intercept but forwarded traffic to those 12 interception servers. 'The redirect alone is enough to confirm infection' — that is how he separates the two sub-populations.
- 处置时间线:周五发现,周日晚 Tor 网络安全团队公告,节点被标 BadExit(之后只能当中继不能当出口),周一攻击者重启了一批节点但只能当中继了,当天所有被感染的服务器全部下线(一部分是运维下的,一部分是攻击者自己下的——因为继续开着已经没用了)。Tor 团队原话:『我们没见过这样的攻击。』The response timeline: discovered Friday; the Tor network health team announced Sunday night; relays were marked BadExit (they can only serve as middle relays after that); Monday the attackers restarted some relays but they could only be middles; all infected servers went down that day, partly by operators and partly by the attackers themselves (once flagged, keeping them up was pointless). The Tor team's own words: 'We've not seen an attack like that before.'
- 作者自己最后给出的 takeaway 很短,但很硬:『多一层安全是值得的投资。禁用密码登录,改用 SSH 密钥。我本人今天就要去买硬件密钥了。』——这是那种『被打了才想起来买锁』的诚实,不装。The author's final takeaway is short and unflinching: 'Extra security is a worthwhile investment. Disable password authentication in favor of SSH keys. I am going to buy myself some hardware keys today.' — the honest 'I only remember to buy the lock after being hit' kind.
- 还有一层没被说破的东西:Tor 的整个信任模型建立在『运营商是志愿者、节点是分散的』上,而这次攻击者选的是『被托管公司批量控制』的出口节点(最可能的入口是托管商本身被黑)。这意味着对志愿者网络来说,『供应链』不再是比喻,字面意义上就是托管商的服务器。There is one more layer that is not said out loud: Tor's entire trust model rests on 'operators are volunteers, nodes are distributed,' and this attack picked exits that were 'mass-controlled by hosting companies' (the most likely entry point is the hosting company itself being compromised). For a volunteer network, 'supply chain' stops being a metaphor — it is, literally, the hosting provider's servers.
- 「取消」不是一个词,是三种完全不同的东西:同步取消、异步取消、优雅关机'Cancelation' Is Not One Word — It Is Three Different Things: Synchronous Cancelation, Asynchronous Cancelation, and Graceful Shutdown
- 这是 matklad 在 2026 年 8 月底写下的一篇『词汇学』反思(原文发表于 2026 年 8 月 31 日):很多并发 bug 不是逻辑错,是把三个完全不同的东西混在一个词里——我们都叫它『取消』,但它们住在不同抽象层。作者不满足于『我知道它们不一样』,而是把三个词钉死,并说明各自的『形状』。This is a 'vocabulary' reflection from the Rust community, first published August 31, 2026: a lot of concurrency bugs are not logic errors but name-confusion — three genuinely different things all get called 'cancelation', and they live at different levels of abstraction. The author doesn't stop at 'I know they're different'; he nails down three names and describes the 'shape' of each.
- 同步取消(synchronous cancelation)是一个控制流结构,不是协议:`task.cancel()` 调用返回时,任务一定已经结束。它最原始的来源是异常/错误处理——每次抛异常或返回 error,栈立即展开,经 RAII/finally/defer 做清理。作者引莫里哀『散文』的典故:我们每天都在用,却很少完全意识到自己在用。Synchronous cancelation is a control-flow structure, not a protocol: when `task.cancel()` returns, the task is already finished. Its primary source is exception/error handling — every thrown exception or returned error unwinds the stack and runs cleanup via RAII/finally/defer. The author invokes the Molière 'we do this constantly without full consciousness' trope.
- 异步取消(asynchronous cancelation)是一个通信协议:一方请求取消,然后必须等另一方确认并收尾。两个真实例子最有说服力——CPU 线程池里取消一个正在跑 SIMD 加密循环的线程(不能同步硬停,否则丢 buffer 导致数据竞争;只能分块,块间查取消标志,请求方至少得等一块的工期)和 io_uring(把 buffer 交给 kernel 后必须等 write 完成才能释放)。Asynchronous cancelation is a communication protocol: one party requests cancellation, then must wait for the other to acknowledge and wind down. The two worked examples are the most persuasive — canceling a CPU thread mid-SIMD-encryption (you cannot synchronously hard-stop it or you drop the buffer and get data races; you must chunk, check the flag between chunks, and the requester waits at least one chunk of work) and io_uring (once the buffer is handed to the kernel, you must wait for the write to finish before freeing it).
- 优雅关机(graceful shutdown)是更高层的应用模式:停止 accept 新连接,但把已有连接服务完再撤——这是滚动升级不断流的底层机制。作者顺手补了一条很锐的观察:在分布式系统里,『一个非常慢的节点』和『一个崩溃的节点』在外表上完全一样——崩溃只是慢的一个程度;所以 TigerBeetle 干脆做到『crash-only』(整个程序可以任意被 SIGKILL 重启都不丢数据),把 Quit 按钮实现成自 SIGKILL,同时简化实现、扩大故障测试面。Graceful shutdown is a higher-level application pattern: stop accepting new connections but finish serving existing ones — this is what makes rolling upgrades non-disruptive. The author adds one sharp observation: in a distributed system, 'a very slow node' and 'a crashed node' are externally identical — a crash is just a degree of slowness. TigerBeetle therefore takes the crash-only position (the whole program can be SIGKILLed at any point and restart without data loss), implementing the Quit button by SIGKILLing itself, which simultaneously simplifies the code and widens the fault-test surface.
- 带走项:下次你在 API 设计或代码 review 里看到 `cancel()`、`shutdown()`、`stop()`,先问一句——这三个词在你们系统里分别对应哪一种?同步(控制流,调用返回即结束)?异步(协议,需要等确认)?还是优雅关机(应用层,新连接拒接、老连接服务完)?把这三个词钉死之后,很多『为什么这里不 hang』『为什么这里数据竞争』的直觉 bug,会因为『我到底在取消哪一层』变得有答案。Takeaway: next time you see `cancel()`, `shutdown()`, `stop()` in an API design or code review, ask which one of the three it actually is in your system — synchronous (control flow, finished when the call returns), asynchronous (protocol, you wait for an ack), or graceful shutdown (application level, reject new, finish old)? Once you pin the three down, many 'why does this hang' and 'why does this data-race' bugs of intuition get an answer from 'which layer am I canceling?'
哲学与生活Philosophy & Life
- 「把自己放下,才能成为真正的自己」:Iris Murdoch 说的 unselfing'Unselfing': How Iris Murdoch Said the Way to Become Who You Really Are
- 问题从一句很具体的话开始:Murdoch 在《The Sovereignty of Good》里描述过一个场景——你正烦躁地望着窗外,心里盘旋着某件丢面子的事;突然一只 falcon 掠过头顶,『那个心怀怨恨、只顾自己的小人不见了,现在只剩 falcon』。Popova 用这个场景把整个概念引出来:unselfing(自我消解)不是刻意打坐,而是注意力从『我』转向『那只 falcon』本身。The problem opens with a very concrete sentence: in 'The Sovereignty of Good,' Murdoch describes a scene — you are brooding at your window, some small blow to your prestige turning over and over; suddenly a kestrel crosses your view, and 'the brooding self with its hurt vanity has disappeared. There is nothing now but kestrel.' Popova uses that scene to name the whole concept: unselfing is not deliberate meditation, it is attention shifting from 'I' to 'the kestrel' itself.
- 第二步是区分两种『看到美』:一种是自我驱动的(我特意去欣赏,心里其实在给自己的焦虑找出口),另一种是 self-forgetful 的——你根本没有『我在欣赏』这个念头,注意力被 falcon/这幅画/这段音乐直接接管了。Murdoch 说真正的美只会引起第二种:『对自然有刻意的、以自我为中心的快乐,在我看来是勉强的。』The second step is distinguishing two kinds of 'seeing beauty': one is self-directed (you deliberately go appreciate it, while underneath you are just looking for an exit from your own anxiety); the other is 'self-forgetful' — there is no thought of 'I am appreciating this,' attention has simply been taken over by the kestrel / the painting / the piece of music. Murdoch writes that real beauty only produces the second: 'A self-directed enjoyment of nature seems to me to be something forced.'
- 第三步是把这个概念从审美拉回道德:Popova 引 Murdoch 的原话——『美德,就是努力撕开自私意识的纱,去和真实的世界相认。』也就是说,『看清一件事』和『做对一件事』在 Murdoch 的框架里不是两件事:你能不能对一个具体的人/事做到不拿『我』当参照点,本身就是道德能力的测量仪。The third step pulls the concept back from aesthetics to morality: Popova quotes Murdoch — 'virtue is the attempt to pierce the veil of selfish consciousness and join the world as it really is.' In Murdoch's framework, 'seeing clearly' and 'doing right' are not two separate abilities: whether you can face a specific person or thing without using 'me' as the reference point is itself a measure of moral capacity.
- 第四步是这条洞察为什么在 2026 年仍有用:它给『如何摆脱焦虑/内耗』提供了一个不像『深呼吸/正念 app』那种外部技巧的答案——答案是『把注意力真正放到那个不围绕你转的东西上』,不是『放下』这个动作本身(放下又变成了你新的目标)。The fourth step is why this still matters in 2026: it offers an answer to 'how do I get out of the spiral of overthinking / inner friction' that is not some external technique (deep breathing, a mindfulness app) — the answer is to genuinely put attention on something that is not orbiting you, not on the act of 'letting go' itself (because 'letting go' becomes the new goal).
- 带走项:下次你在意『我在不在意』的时候(写东西怕写得差、社交怕说错话),可以尝试一次真的把注意力挪到一个具体的、非『我』的对象上(一段旋律、一个正在转的机械、一个陌生人在做什么)——不是用来逃避那个在意,而是用来测试『在意』这个念头到底有没有被注意力接管。The takeaway: next time you find yourself monitoring 'am I caring too much?' (afraid your writing is bad, afraid you'll say the wrong thing socially), try once actually moving your attention to a specific object that is not centered on you (a piece of music, a machine turning, what a stranger is doing) — not to escape the caring, but to test whether that 'caring' thought has been taken over by attention.
- 「心碎不是碎了」:Maria Popova 写的一首给碎过心的人的诗,和一个关于磁极漂移的比喻'It Was Not Broken': Maria Popova's Poem for the Broken-Hearted, and a Metaphor About the Drifting Magnetic Pole
- Popova 引 Louise Erdrich 的句子开场:『人生会把你打碎』——但紧接着翻一面:『每次被打碎的时候,你才活着看到自己打不碎。』这是全诗(也是这条条目)的题眼:把『碎』从终点重新定义为『看到自己还能继续』的证据。Popova opens with Louise Erdrich's line — 'Life will break you' — and immediately flips it: 'every time it happens, you live to see you are unbreakable.' That inversion is the whole point: 'being broken' is redefined from a terminal state into evidence that 'you are still going.'
- Poem 本身的关键比喻在第二节:心不是被『打碎』(broken)了,是被『脱臼』(dislocated)了——『没有人去收拾碎片,因为根本没有碎片;只有一个固执的手(时间),把它推回原位。』这个比喻的好处是把『需要被修复』替换成了『需要被重新定位』,修复的对象从『碎的东西』变成『脱臼的东西』。The poem's key metaphor is in its second section: the heart is not 'broken' (into pieces), it is 'dislocated' — 'there is no one to pick up the pieces, because there are no pieces. Only the firm, fastidious hand of time, to slide it back into place.' The benefit of 'dislocated' over 'broken': it swaps 'needs repairing' for 'needs re-locating,' and the object of work shifts from 'the broken thing' to 'the dislocated thing.'
- 第三节是全诗最巧的地方:她把『心走位了』类比成磁罗盘——磁罗盘不是坏了,是它的参照物(磁北极)本身在每年漂移 50 公里、每隔几百年完全翻转。也就是说,如果你的『心』一直在抖,可能不是你的心在抖,是那个你用来定方向的『北极』在动。The third section is the poem's cleverest move: it compares a 'wayward heart' to a magnetic compass — the compass is not broken, its reference (the magnetic north pole) itself drifts 50 kilometers a year and reverses every few centuries. In other words, if your 'heart' keeps trembling, it may not be your heart — it may be the 'north' you are using to find your direction that is moving.
- 这一节可以独立拿来用:下次你觉得某件事『我搞不定』,先区分一下——是这件事本身超出能力(真的够不到),还是你的参照点(你以为目标在哪、你以为自己在哪)本身在漂移,而你在用『不动的北极星』去追一个移动的靶子。This section is directly usable: next time you feel 'I cannot do this,' first separate out — is the task genuinely beyond your ability (you really cannot reach it), or is your reference point (where you think the goal is, where you think you are) itself drifting, and you are chasing a moving target with a 'fixed north star'?
- 这条很短,但它给『心碎』这个词提供了一个很少被说过的出口:不是『时间会治愈』(被动),也不是『去积极面对』(用力),而是『把脱臼的关节重新定位』——动作的具体程度不一样。This is a short piece, but it offers a rarely-said exit from the word 'broken heart': not 'time will heal it' (passive), not 'face it positively' (effort), but 're-position the dislocated joint' — a different level of specificity of action.
工具角Tools Corner
- Permit Pending:SimCity,但每个建筑都要过听证会Permit Pending: SimCity, but Every Building Needs a Hearing
- 经典 SimCity 的玩法核心是『上帝模式』:你是城市的神,点哪里哪里就变。Permit Pending 把这一层拿掉,换上另一层:你是民选的市长,任期四年,每个建筑项目都要过居民听证会、市议会投票、上诉、选举周期。The core loop of classic SimCity is 'God mode': you are the city's deity, and whatever you click changes. Permit Pending removes that layer and replaces it with another: you are an elected mayor, four-year term, and every building project has to go through resident hearings, city-council votes, appeals, and election cycles.
- 核心创意是『修一个问题就创造一个新的愤怒选民群体』:你要盖公寓压低租金→房主因为停车位和『社区气质』联合反对;你要建工厂拉动就业→邻居家因为烟雾抱怨;你要建地铁→开发商因为征地反对。任何一个『对城市好』的决定,都会把某个具体的选民群体推向对面。The central mechanic is 'fixing one problem creates a new angry voter group': you build apartments to push rents down, homeowners gang up on parking and 'neighborhood character'; you build a factory to create jobs, next-door neighbors complain about smoke; you build a metro, developers object to the eminent domain. Any 'good for the city' decision pushes a specific voter group to the other side.
- 它把经济系统做得很具体:居民有年龄、收入、房屋;企业有招聘、增长、离开;土地价格、租金、就业、税收、公共服务全部互相连通,城市在你开会的时候也在自己变化——你不做任何事,城市也在漂移。The economy is quite specific: residents have ages, incomes, and homes; businesses hire, grow, and leave; land values, rents, jobs, taxes, and services all connect to each other, and the city changes while you are stuck in committee — do nothing, and the city still drifts.
- 还有一个很巧的设计:『The Gazette』(本地报纸)会持续报道你的政绩、丑闻和那些你定下的停车最低标准——它不是装饰,是你下一次选举的预告片。One clever design detail: 'The Gazette,' a local paper, continuously reports your wins, your scandals, and the parking minimums you set — it is not decorative, it is the preview of your next election.
- 带走项:这个游戏的『玩法』本身就是一个论点——如果你把 SimCity 的 God mode 拿掉,换上真实城市里『谁反对什么』的摩擦层,你会发现『对城市好』这个念头在政治现实中几乎从来不是可执行的,因为每一个『对城市好』都在同时『对某个具体的人不好』。The takeaway: the game's 'gameplay' is itself an argument — strip SimCity's God mode and add the real city's 'who objects to what' friction layer, and you discover that 'good for the city' is almost never executable in political reality, because every 'good for the city' is simultaneously 'bad for some specific person.'
- The Duck Pond:网页上没有任何录音,所有鸭子的叫声都是现场合成的The Duck Pond: No Recordings on the Page — Every Quack Is Synthesized Live
- 打开页面:一个小池塘,三只会鸭、两只公鸭、两窝小鸭子在里面游。没有任何录音文件加载——所有的『嘎』声都是在浏览器里实时合成的。Open the page: a small pond, three hens, two drakes, two broods of ducklings swimming. No audio files are loaded — every 'quack' is synthesized live in the browser.
- 关键点不是『用了 Web Audio API』,而是声源定位:鸭子在你『站在池塘边』的那个位置,用双耳渲染(binaural)让你听到叫声从某个具体方向、某个具体距离传来。你戴上耳机听到的『空间感』不是假的。The point is not 'uses the Web Audio API.' It is the source positioning: the ducks are 'where you stand on the bank,' and a binaural render puts each quack at a specific direction and distance. The 'spatial feel' you get with headphones is not fake.
- 为什么这个设计有意思:大多数网页音效的思路是『加载素材 → 播放』;这个页面的思路是『把音效当成计算结果』——每一次鸭子张嘴,浏览器都在算一个随机的叫声波形,而不是在放一段录音。这意味着没有两个『嘎』是完全一样的。Why this design is interesting: most web-audio thinking is 'load asset, play it.' This page's thinking is 'treat the sound as a computed result' — every time a duck opens its bill, the browser computes a random quack waveform rather than playing a recording. No two 'quacks' are identical.
- 对做 Web Audio 的人来说,这是一个可以直接参考的最小范例:binaural + 随机波形 + 位置渲染,三段就够把『一个池塘』的感觉做出来。For anyone working in Web Audio, this is a minimal reference implementation: binaural + random waveform + positional rendering — three pieces, and you have a 'pond' feel.
- 带走项:『把素材变成计算』这个思路可以套到很多网页体验上——不是加载 100 张图切换,是算出你要的那张;不是播放一段固定音效,是算出当下这个情境里的那声『嘎』。The takeaway: 'turn the asset into a computation' is a pattern that applies to many web experiences — instead of loading 100 images and switching, compute the one you need; instead of playing a fixed sound effect, compute the one that fits this exact moment.
- Anatomy:让 AI 用一个『真实机器』来解释抽象概念Anatomy: A Claude Skill That Explains Abstract Concepts by Building a Real Machine
- 这是一个 Claude agent skill(一个文件夹里带 SKILL.md),你用 `/anatomy explain how a token bucket rate limiter works` 这样的命令,它会给你一个可以交互的等距投影 SVG 机器来解释那个概念——不是文字说明,是一个『会动的小机器』。This is a Claude agent skill (a folder containing a SKILL.md). You invoke it with something like `/anatomy explain how a token bucket rate limiter works`, and instead of a text explanation you get an interactive isometric SVG machine that demonstrates the concept — a 'little machine that moves,' not a diagram with labels.
- 核心创意在于『把抽象机制映射成一个物理装置,且那个装置的运动本身就是这个概念』:cache key 跳过重算的机制,变成一个针孔锁——只有所有 pin 都对齐的时候锁芯才转;一个 GPU context 服务多个 canvas,变成一个龙门绘图仪,一个打印头在 16 个孔位之间移动。The core idea is 'map the abstract mechanism onto a physical device, and that device's motion IS the concept': a cache key that skips work becomes a pin-tumbler lock that only turns when every pin aligns; one GPU context serving many canvases becomes a gantry plotter whose single print head visits 16 wells.
- 它不是画一张静态图:SVG 里每个零件都是『实心、有阴影、可拆解』的小块,鼠标悬停可以拆开整个装置看 11 个子组件,每个显示出来的数字都来自驱动这些零件的同一个模型——也就是说,图和数字不会脱节。It is not a static image: every part in the SVG is a 'solid, shaded, detachable' piece; hover to disassemble the whole device into 11 sub-assemblies, and every number displayed comes from the same small model that moves the parts — so the picture and the numbers cannot drift apart.
- 技术上的巧处:SVG 之外还嵌了一层 WebGL shader 放在『纸的上面、下面』两层 SVG 之间,专门画线画不出来的东西(火焰、水波、焦散光、蒸汽),而且这个 shader 用的是和 SVG 同一个等距投影相机——所以它看起来『在同一个空间里』,不是贴上去的。A technical detail worth noting: on top of the SVG layer, a WebGL shader is sandwiched between a 'front' and 'back' SVG layer, drawing only the things lines cannot (fire, water caustics, steam, lamp glow), and that shader uses the same isometric camera as the SVG — so it appears 'in the same space,' not pasted on top.
- 带走项:这套 skill 的 README 本身就是一份『如何用 AI 生成高质量图解』的规格说明——如果你要让 AI 给你解释复杂系统,『请用一个实物机器来解释,且机器上的每个数字来自驱动它的那个模型』这条约束,比『请解释清楚』要有效得多。The takeaway: the README itself is a specification for 'how to ask an AI to produce a high-quality explanatory figure' — if you want an AI to explain a complex system to you, the constraint 'please explain it by building a physical machine, where every number on the machine comes from the model that drives it' is far more effective than 'please explain it clearly.'
- CleanYourTV:给安卓/Google TV 电视『减肥』,不用刷机不用 rootCleanYourTV: Debloat Your Android/Google TV Box Without Root or Flashing
- 很多安卓电视/Google TV 盒子出厂预装一堆广告和『推荐』app,而且厂商的『去广告』选项基本不存在。CleanYourTV 的思路是:不刷机、不 root,通过 Wi-Fi 直接给电视『减肥』,得到一个类似 Apple TV 首页的干净界面。Most Android/Google TV boxes ship with ads and 'recommended' apps baked in, and the vendor's 'remove ads' options usually do not exist. CleanYourTV's approach: no flashing, no root — it reaches the TV over Wi-Fi and 'debloats' it into something like an Apple-TV-style clean home screen.
- 核心创意是把 TV launcher 当成『被劫持的浏览器首页』来治:不是卸载系统包(很多厂商把 launcher 和预装 app 绑在一起,卸不掉),而是在 launcher 层面重新组织『你实际看到什么』。The core idea is to treat the TV launcher like 'a hijacked browser homepage': instead of uninstalling system packages (many vendors bundle the launcher and preinstalled apps together, making uninstall impossible), it reorganizes 'what you actually see' at the launcher layer.
- 1046 个 commit 的活跃度说明这是一个真的在做、不是玩具的项目;项目结构里有一个独立的 `launcher/` 目录,说明它有自己的 launcher 实现,不是给现有 launcher 打补丁。1,046 commits of activity say this is a real, not-a-toy project; the repo has a standalone `launcher/` directory, which means it has its own launcher implementation rather than patching an existing one.
- 对没有电视开发背景的人,这个项目最大的价值是:它把『我的电视很烦』这个模糊的不满,变成了一个可以具体操作的目标(一个干净首页),而不是一句『去 root 然后怎么怎么样』。For anyone without a TV-development background, the biggest value of this project is that it turns the vague complaint 'my TV is annoying' into a concrete, actionable goal (a clean home screen), instead of 'root it, then do this.'
- 带走项:如果你的电视/盒子很烦,先看一下 CleanYourTV 的 docs/ 目录,判断它支持你的硬件型号——这是『把抱怨变成操作』的最小路径。The takeaway: if your TV/box is annoying, first check CleanYourTV's docs/ to see whether it supports your hardware model — that is the shortest path from 'complaint' to 'action.'