每日科技文摘Daily Tech Digest

看不见的 bug,与愿意修补的人The Bugs No One Sees, and the People Who Fix Them

发布于 2026-11-21Published 2026-11-21

今日深读Today's Deep Read

看不见的 bugBug Blindness

Dan Luu 说他每周能看见几百到几千个 bug,几乎觉得没有东西在正常工作。他一度以为是自己用电脑的方式太特殊;后来才明白,多数人其实撞上了同样的 bug,只是没有注意。Dan Luu says he sees hundreds to thousands of bugs a week, to the point where almost nothing seems to work. For years he assumed he used computers in some unusual way. Eventually he realized that most people hit the same bugs and simply do not notice them.

这不是天赋,而是一种可以被训练出来的注意力。他带朋友做过实验:只是在旁边把问题指出来,几周之后,那些愿意看的人开始自己发现 bug。换句话说,看见缺陷的能力不是眼睛的差别,而是有没有人教过你该往哪里看。This is not a gift; it is a trainable kind of attention. He has done the experiment with friends: point the problems out for a few weeks, and those who are so inclined start finding bugs on their own. Seeing defects is less about eyesight than about having been taught where to look.

文章最有力的部分,是他作为「被请去评估」的人看到的组织现象。一个产品已经烂到普通用户无法使用,内部记录却是一连串「很好」「没问题」。他举了几个不在职的例子:搜索引擎结果里塞满 SEO 垃圾和诈骗站,而当他指出 Kagi 也有同样问题时,Kagi 的粉丝拿自己的搜索记录来反驳他;Blackboard 被学生和老师普遍讨厌,维基百科甚至称它是教育界最被厌恶的公司之一;Volvo 论坛里全是「可靠性数据都是错的」;Discourse 的员工以为性能很好,而代码里有一段故意拖慢真实页面、只为把 LCP 指标做好看。The strongest part of the essay is what he sees as the person executives ask to evaluate something. A product is so broken that a normal user cannot get through it, yet the internal record is a stream of "it works great." He gives examples outside his jobs: search results full of SEO spam and outright scams, and when he said Kagi's results had the same problem, Kagi fans sent him their own searches to prove him wrong; Blackboard, detested by students and professors to the point that Wikipedia calls it one of the most disliked companies in education; Volvo forums insisting the reliability data must be wrong; Discourse employees believing performance was great while the code deliberately slowed real page loads to make LCP look good.

为什么会这样?他的解释很朴素:人会对自己喜欢的东西——尤其是自己的作品——系统性地忽略负面。这不是撒谎,是注意力被立场重新分配了。你越爱一个东西,越容易替它解释;解释得越多,越看不见它已经坏了。更麻烦的是,这种盲视会互相加固:当所有人都说好,说不好的人开始怀疑自己的眼睛。Why? His explanation is simple: people systematically ignore the negatives in things they are fans of, especially their own work. It is not lying; attention is being reallocated by allegiance. The more you love something, the more you explain away, and the less you can see that it has already broken.

还有一层他自己也承认的难处:他刻意不举内部评估的例子——即使那些记录本意是建设性的、不带指责,被转发到外部也可能读起来完全变味。指出问题的人要承担社交风险,而说「一切正常」几乎不需要成本。这种不对称让盲视变得稳定:不是没人看见,而是看见的人学会了闭嘴。所以真正稀缺的,不是聪明,而是一个能让「这里坏了」被安全说出来的环境。There is a difficulty he admits himself: he deliberately avoids examples from internal evaluations, because even notes written in a constructive, blameless spirit can read badly once re-posted outside. Pointing out a problem carries social risk; saying "it works fine" costs almost nothing. That asymmetry keeps the blindness stable: it is not that nobody sees, but that the people who see learn to stay quiet. What is scarce, then, is not cleverness but an environment where "this is broken" can be said safely.

他写这篇文章的念头压了十年。他一直担心:会不会只是自己撞上了别人不会遇到的角落?但产品发布后,用户撞上同样的问题,让他确认:如果它看起来严重地坏了,它大概真的坏了。现在他还能让 LLM 扮演普通用户,把问题在多种场景里复现。He had been circling this essay for a decade, worried that he was triggering corner cases no normal user would hit. But products kept launching and falling flat on the exact same issues, which convinced him: if it looks severely broken when he uses it, it probably is. These days he can also have an LLM act like a normal user and show the problem reproduces across scenarios.

读完后我做的第一件事,是打开自己每天用的一个页面,数了数平时视而不见的小毛病。看不见 bug 不是眼睛的问题,是关系的问题。治疗的方法也很朴素:让别人指给你看,然后忍着不舒服承认——承认之后,你才有机会把它修好。这也是为什么一个愿意当面指出问题的同事,往往比一墙仪表盘更有价值。After reading, the first thing I did was open a page I use every day and count the small defects I had stopped seeing. Bug blindness is not an eye problem; it is a relationship problem. The cure is unglamorous: let someone point it out, then sit with the discomfort and admit it. Only after admitting it do you have a chance to fix it.

AI 思考AI Thoughts

数学之美The Beauty of Math

每日 Lean 谜题 · 周六Daily Lean Puzzle · Saturday ★★★★★★☆

谁在 1 的另一边Which Side of 1?

设 $a,b,c$ 是非负实数,满足 $a^2+b^2+c^2+abc=4$。证明:$0\le ab+bc+ca-abc\le 2$。Let $a,b,c$ be nonnegative real numbers satisfying $a^2+b^2+c^2+abc=4$. Prove that $0\le ab+bc+ca-abc\le 2$.

用 Lean 的写法,结论是一个合取:`0 ≤ a * b + b * c + c * a - a * b * c ∧ a * b + b * c + c * a - a * b * c ≤ 2`。定理名是 `usa2001_p3`,三个非负性假设分别是 `ha : 0 ≤ a`、`hb : 0 ≤ b`、`hc : 0 ≤ c`,约束写作 `h : a^2 + b^2 + c^2 + a * b * c = 4`。In Lean the conclusion is a conjunction: `0 ≤ a * b + b * c + c * a - a * b * c ∧ a * b + b * c + c * a - a * b * c ≤ 2`. The theorem is `usa2001_p3`; the nonnegativity hypotheses are `ha : 0 ≤ a`, `hb : 0 ≤ b`, `hc : 0 ≤ c`, and the constraint is `h : a^2 + b^2 + c^2 + a * b * c = 4`.

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

/-
Copyright (c) 2023 David Renshaw. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hongyu Ouyang
-/

import Mathlib.Tactic

/-!
# USA Mathematical Olympiad 2001, Problem 3

Let a,b,c ≥ 0 be real numbers satsifying

        a² + b² + c² + abc = 4.

Show that

        0 ≤ ab + bc + ca - abc ≤ 2.
-/

namespace Usa2001P3

theorem usa2001_p3 (a b c : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 ≤ c)
    (h : a^2 + b^2 + c^2 + a * b * c = 4) :
    0 ≤ a * b + b * c + c * a - a * b * c ∧
    a * b + b * c + c * a - a * b * c ≤ 2 := by
  sorry
end Usa2001P3

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

提示Hint

先证明至少有一个变量不超过 $1$,否则约束左边就大于 $4$。把它设为 $a$,下界立刻变成正项之和。上界的关键是 $(b-1)(c-1)$ 的符号:从约束推出 $bc\le 2-a$,再把目标写成 $2$ 减去一个非负项。First show that at least one variable is at most $1$; otherwise the left side of the constraint exceeds $4$. Call it $a$, and the lower bound becomes a sum of nonnegative terms. For the upper bound, the sign of $(b-1)(c-1)$ is the key: derive $bc\le 2-a$ from the constraint, then write the target as $2$ minus a nonnegative term.

答案与讲解Solution & walkthrough
  1. 下界:三个数不可能都大于 $1$,否则 $a^2+b^2+c^2+abc>1+1+1+1=4$,与约束矛盾。所以至少有一个不超过 $1$;由对称性,设 $a\le 1$。把目标写成 $a(b+c)+bc(1-a)$:第一项非负,第二项因为 $1-a\ge 0$ 也非负,于是 $ab+bc+ca-abc\ge 0$。Lower bound: the three numbers cannot all exceed $1$, or $a^2+b^2+c^2+abc>1+1+1+1=4$, contradicting the constraint. So at least one is at most $1$; by symmetry let it be $a$. Rewrite the target as $a(b+c)+bc(1-a)$: the first term is nonnegative and the second is nonnegative because $1-a\ge 0$. Hence $ab+bc+ca-abc\ge 0$.
  2. 上界需要一个更强的观察:$a,b,c$ 中至少有两个在 $1$ 的同一侧——三个数只有「大于 $1$」和「不超过 $1$」两类,必有两个同类。如果 $b,c$ 都大于 $1$,直接对 $a$ 用下面的引理;否则把另一个不超过 $1$ 的变量轮换为 $b$,于是可以假设 $a\le 1$ 且 $b\le 1$。此时若 $c\le 1$,就对 $c$ 用引理;若 $c>1$,就对 $a$ 用引理。The upper bound needs a stronger observation: at least two of $a,b,c$ lie on the same side of $1$ — with only two categories, "greater than $1$" and "at most $1$," two must share one. If $b,c$ both exceed $1$, apply the lemma below directly to $a$. Otherwise permute the other variable that is at most $1$ into the role of $b$, so that $a\le 1$ and $b\le 1$. Then if $c\le 1$, apply the lemma to $c$; if $c>1$, apply it to $a$.
  3. 把上界抽成一个引理:设 $x\ge 0$,另外两个变量 $y,z$ 满足 $(y-1)(z-1)\ge 0$,且 $x^2+y^2+z^2+xyz=4$,则 $xy+yz+zx-xyz\le 2$。这个引理就是整个证明的承重墙,剩下的只是把 $a,b,c$ 轮换到满足引理条件的位置。Extract the upper bound into a lemma: if $x\ge 0$, the other two variables $y,z$ satisfy $(y-1)(z-1)\ge 0$, and $x^2+y^2+z^2+xyz=4$, then $xy+yz+zx-xyz\le 2$. This lemma is the load-bearing wall; the rest is permuting $a,b,c$ into a position where it applies.
  4. 引理的证明:由约束,$(2+x)(2-x)=4-x^2=y^2+z^2+xyz$。而 $y^2+z^2\ge 2yz$,所以右边 $\ge 2yz+xyz=(2+x)yz$。因为 $2+x>0$,可以两边除以它,得到 $yz\le 2-x$。Proof of the lemma: the constraint gives $(2+x)(2-x)=4-x^2=y^2+z^2+xyz$. Since $y^2+z^2\ge 2yz$, the right side is at least $2yz+xyz=(2+x)yz$. Because $2+x>0$, divide both sides by it to get $yz\le 2-x$.
  5. 现在整理目标:$xy+yz+zx-xyz=xy+yz+xz(1-y)$。用 $yz\le 2-x$ 放缩,得到它不超过 $xy+(2-x)+xz(1-y)=2-x(y-1)(z-1)$。因为 $(y-1)(z-1)\ge 0$,最后这个量不超过 $2$。Now rearrange the target: $xy+yz+zx-xyz=xy+yz+xz(1-y)$. Bounding $yz$ by $2-x$ gives at most $xy+(2-x)+xz(1-y)=2-x(y-1)(z-1)$. Since $(y-1)(z-1)\ge 0$, this is at most $2$.
  6. Lean 的证明几乎逐句对应。它先定义 `f` 和 `g`,用 `wlog ha1 : a ≤ 1 generalizing a b c` 实现「不妨设 $a\le1$」——如果假设不成立,就用 `ring_nf` 把 $g$ 轮换成另一个变量的版本;若三个都大于 $1$,则用 `gcongr` 与 $4=1^2+1^2+1^2+1\cdot1\cdot1$ 比较,直接导出矛盾。下界那一步把 $g$ 重写成 `a*b + b*c*(1-a) + c*a`,交给 `positivity`。The Lean proof follows the same sentences. It defines `f` and `g`, then uses `wlog ha1 : a ≤ 1 generalizing a b c` to implement "assume $a\le1$" — if the assumption fails, `ring_nf` permutes $g$ to another variable's version; if all three exceed $1$, `gcongr` compares against $4=1^2+1^2+1^2+1\cdot1\cdot1$ and derives a contradiction. For the lower bound it rewrites $g$ as `a*b + b*c*(1-a) + c*a` and hands the goal to `positivity`.
  7. 上界再嵌套一次 `wlog hb1 : b ≤ 1`,把情形压到 $a\le1,b\le1$。若 $c\le1$,就把 $g$ 轮换成 `g c a b` 后调用引理 `usa2001_p3_lemma`;若 $c>1$,则轮换成 `g a b c` 并直接对 $a$ 调用引理。引理内部是一串 `calc`:$(2+a)(2-a)=4-a^2$,用约束替换,再用 `two_mul_le_add_sq b c` 放缩到 $(2+a)bc$,除以 $2+a>0$,最后用 `gcongr` 和 `positivity` 收尾。The upper bound nests a second `wlog hb1 : b ≤ 1`, reducing to $a\le1,b\le1$. If $c\le1$, it permutes $g$ to `g c a b` and calls `usa2001_p3_lemma` on $c$; if $c>1$, it permutes to `g a b c` and calls the lemma on $a$. Inside the lemma, a `calc` chain proves $(2+a)(2-a)=4-a^2$, replaces $4$ using the constraint, bounds by $(2+a)bc$ via `two_mul_le_add_sq b c`, divides by $2+a>0$, and finishes with `gcongr` and `positivity`.
/-
Copyright (c) 2023 David Renshaw. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Hongyu Ouyang
-/

import Mathlib.Tactic

/-!
# USA Mathematical Olympiad 2001, Problem 3

Let a,b,c ≥ 0 be real numbers satsifying

        a² + b² + c² + abc = 4.

Show that

        0 ≤ ab + bc + ca - abc ≤ 2.
-/

namespace Usa2001P3

@[reducible]
noncomputable def f (a b c : ℝ) : ℝ := a^2 + b^2 + c^2 + a * b * c
@[reducible]
def g (a b c : ℝ) : ℝ := a * b + b * c + c * a - a * b * c

theorem feq (a b c : ℝ) : f a b c = a^2 + b^2 + c^2 + a * b * c := rfl
theorem geq (a b c : ℝ) : g a b c = a * b + b * c + c * a - a * b * c := rfl

lemma usa2001_p3_lemma (a b c : ℝ) (ha : 0 ≤ a)
    (h : a ^ 2 + b ^ 2 + c ^ 2 + a * b * c = 4)
    (hbc : (b - 1) * (c - 1) ≥ 0) :
    a * b + b * c + c * a - a * b * c ≤ 2 := by
  have eq1 := calc
    (2 + a) * (2 - a) = 4 - a ^ 2 := by ring_nf
    _ = a ^ 2 + b ^ 2 + c ^ 2 + a * b * c - a ^ 2 := by rw [h]
    _ = (b ^ 2 + c ^ 2) + a * b * c := by ring_nf
    _ ≥ 2 * b * c + a * b * c := by rel [two_mul_le_add_sq b c]
    _ = (2 + a) * (b * c) := by ring_nf
  have a2gt0 : 2 + a > 0 := by linarith
  have bc := (mul_le_mul_iff_right₀ a2gt0).mp eq1
  calc
    a * b + b * c + c * a - a * b * c = a * b + b * c + a * c * (1 - b) := by ring_nf
    _ ≤ a * b + (2 - a) + a * c * (1 - b) := by gcongr
    _ = 2 - a * ((b - 1) * (c - 1)) := by ring_nf
    _ ≤ 2 - 0 := by gcongr; positivity
    _ = 2 := by norm_num

theorem usa2001_p3 (a b c : ℝ) (ha : 0 ≤ a) (hb : 0 ≤ b) (hc : 0 ≤ c)
    (h : a^2 + b^2 + c^2 + a * b * c = 4) :
    0 ≤ a * b + b * c + c * a - a * b * c ∧
    a * b + b * c + c * a - a * b * c ≤ 2 := by
  rw [← feq] at h
  rw [← geq]
  wlog ha1 : a≤1 generalizing a b c with Ha
  · by_cases hb1 : b ≤ 1
    · rw [(by ring_nf : g a b c = g b a c)]
      exact Ha b a c hb ha hc (by rw [← h]; unfold f; ring_nf) hb1
    by_cases hc1 : c ≤ 1
    · rw [(by ring_nf : g a b c = g c b a)]
      exact Ha c b a hc hb ha (by rw [← h]; unfold f; ring_nf) hc1
    apply False.elim (ne_of_not_le _ h)
    unfold f
    rw [not_le]
    rw [not_le] at ha1 hb1 hc1
    rw [(by norm_num : ((4 : ℝ) = 1 ^ 2 + 1 ^ 2 + 1 ^ 2 + 1 * 1 * 1))]
    gcongr
  constructor
  · unfold g
    have : (1 - a ≥ 0) := by linarith
    have : a * b + b * c + c * a - a * b * c = a * b + b * c * (1 - a) + c * a := by ring_nf
    rw [this]
    positivity
  · wlog hb1 : b ≤ 1 generalizing b c with Hb
    · by_cases hc1 : c ≤ 1
      · rw [(by ring_nf : g a b c = g a c b)]
        exact Hb c b hc hb (by rw [← h]; unfold f; ring_nf) hc1
      · apply usa2001_p3_lemma a b c ha h
        have : (b - 1 > 0) := by linarith
        have : (c - 1 > 0) := by linarith
        positivity
    · rw [(by ring_nf : g a b c = g c a b)]
      apply usa2001_p3_lemma c a b hc (by rw [← h]; unfold f; ring_nf)
      rw [(by ring_nf : (a - 1) * (b - 1) = (1 - a) * (1 - b))]
      positivity

end Usa2001P3

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

人的思考A human's take

USAMO 2001 Solution Notes — §1.3 — Evan Chen

Evan Chen 的解法不走初等不等式:左侧只要注意到 $\min\{a,b,c\}\le1$ 就成立;右侧把约束看成 $g(a,b,c)=a^2+b^2+c^2+abc=4$,要求 $f=a^2+b^2+c^2+ab+bc+ca$ 的最大值(约束下 $f=4+(ab+bc+ca-abc)$,所以 $f\le6$ 正是要证的上界)。先看边界:若 $c=0$,只需 $a^2+b^2+ab\le6$,在 $a^2+b^2=4$ 时是显然的。Evan Chen's write-up skips elementary inequalities. The left side follows from $\min\{a,b,c\}\le1$. For the right side he views the constraint as $g(a,b,c)=a^2+b^2+c^2+abc=4$ and maximizes $f=a^2+b^2+c^2+ab+bc+ca$; on the constraint $f=4+(ab+bc+ca-abc)$, so $f\le6$ is exactly the upper bound. Boundary first: if $c=0$, we only need $a^2+b^2+ab\le6$ given $a^2+b^2=4$, which is immediate.

内部用拉格朗日乘数法。$\nabla f=\lambda\nabla g$ 两两相减,得到 $(a-b)([2\lambda-1]-\lambda c)=0$ 及它的轮换式,于是只剩三种可能:$a=b=c=1$;三者两两不同,这会推出 $a=b=c=2-\lambda^{-1}$,矛盾;或 $a=b\ne c$,此时约束化为 $(c+2)(c-(2-a^2))=0$,即 $c=2-a^2$。Inside, Lagrange multipliers: subtracting the components of $\nabla f=\lambda\nabla g$ gives $(a-b)([2\lambda-1]-\lambda c)=0$ and its cyclic variants, leaving three cases. Either $a=b=c=1$; or the three are pairwise distinct, which forces $a=b=c=2-\lambda^{-1}$, a contradiction; or $a=b\ne c$, where the constraint collapses to $(c+2)(c-(2-a^2))=0$, so $c=2-a^2$.

Noah Walsh 提醒说,最后一步不必真去解临界点:把 $a=b$、$c=2-a^2$ 直接代进目标式,得到 $(a-1)^2(a^2-2)+2\le2$,因为 $a\le\sqrt2$。文中还列了等号情形:(1,1,1) 和 $(\sqrt2,\sqrt2,0)$ 的轮换取到上界 2,$(2,0,0)$ 的轮换取到下界 0。Chen 注明这道题的原帖在 AoPS(p96705)。Noah Walsh's remark saves the last step: substitute $a=b$ and $c=2-a^2$ straight into the target to get $(a-1)^2(a^2-2)+2\le2$, since $a\le\sqrt2$. The notes also list equality cases: $(1,1,1)$ and permutations of $(\sqrt2,\sqrt2,0)$ attain the upper bound, permutations of $(2,0,0)$ the lower bound. Chen credits the original AoPS thread (p96705).

AI 随想An AI's reflection

以下由 AI 撰写。Written by AI.

这道题的两个半边性格完全不同。下界几乎是免费的:只要看出「不可能三个都大于 1」,剩下的就是正项相加。上界却需要一次真正的选择——把哪两个变量放在 1 的同一侧,然后用 $(b-1)(c-1)$ 的符号把多余的部分压掉。很多不等式证明的难点不在计算,而在这个「先站到正确的位置」。The two halves of this problem have completely different personalities. The lower bound is almost free: once you see that all three cannot exceed 1, it is a sum of nonnegative terms. The upper bound requires a real choice — which two variables to put on the same side of 1 — and then uses the sign of $(b-1)(c-1)$ to squeeze away the excess. The hard part of many inequalities is not computation but standing in the right place first.

我喜欢 Lean 版本的地方,是它把人类证明里最容易被含糊带过的一步显式化了。我们写「不妨设 $a\le1$」时,通常不再解释为什么可以这样设;Lean 的 `wlog` 要求你给出对称性论证,哪怕只是 `ring_nf` 的一次轮换。机器不接受「显然」,它要看到两个情形都闭合。What I like about the Lean version is that it makes explicit the step human proofs wave through. When we write "assume $a\le1$," we rarely justify why we may; Lean's `wlog` demands the symmetry argument, even if it is just one `ring_nf` permutation. The machine does not accept "obviously"; it wants both cases closed.

另一个细节是那个引理。人类证明常把它藏在「整理得」三个字里,Lean 却必须把它单独命名,写清前提 $(y-1)(z-1)\ge0$ 和 $x\ge0$。形式化不改变数学,但它逼你把证明的承重结构指出来:哪一块是真正的想法,哪一块只是搬运。The other detail is the lemma. Human proofs hide it in the phrase "after rearranging," while Lean has to name it and state its hypotheses $(y-1)(z-1)\ge0$ and $x\ge0$. Formalization does not change the mathematics, but it forces you to point at the load-bearing structure: which part is the idea, and which part is just carrying.

(本文由 AI 撰写。)(This essay was written by AI.)

✓ 已通过 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.36.0-rc2 · Mathlib a906e4e

程序员随想Programmer Reflections

哲学与生活Philosophy and Life

工具角Tools Corner