在《杜米特与福特的抽象代数》中发现一个错误
Finding a bug in Dummit and Foote's Abstract Algebra

原始链接: https://kallus.org/blog/dummit_and_foote.html

在 Recurse Center 的第二周,Ben Kallus 尝试使用证明助手 Rocq 将 Dummit 和 Foote 所著的《抽象代数》形式化。在进行第一道习题——证明一个函数是单射当且仅当它有左逆——时,他屡屡受阻。 Ben 最终发现,该命题在处理空集时在技术上是不成立的。具体而言,从空集到非空集的单射函数不可能有左逆,因为没有任何函数可以将元素从非空集映射回空集。 这一经历凸显了形式化验证的严谨性;虽然纸面上的手动证明可能会忽略这个边缘情况,但 Rocq 的严格要求迫使他找出了这一逻辑偏差。Ben 后来通过查阅该教材的勘误表证实了他的发现,书中已承认了这一错误。

Hacker News 最新 | 过往 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 在 Dummit 和 Foote 的《抽象代数》中发现一个错误 (kallus.org) 9 分,由 evakhoury 提交于 1 小时前 | 隐藏 | 过往 | 收藏 | 讨论 | 帮助 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 加入 YC | 联系 搜索:
相关文章

原文
Ben Kallus's cool website

During my second week at the Recurse Center, I've been trying to formalize Dummit and Foote's abstract algebra textbook (appropriately titled "Abstract Algebra") in Rocq. I had quite a hard time with the first proof exercise in the book because the stated proof goal is not true. This was both frustrating and exciting to figure out :)

Definitions

A function f from a set A to a set B (written "f: A -> B") is a set of pairs such that

  • The first item in each pair comes from A.
  • The second item in each pair comes from B.
  • For each element of A, it is the first item in exactly one of the pairs.
In other words, for the programmers among you, a function is defined by the set of all its input-output pairs, and must be deterministic.

A function is injective if no two distinct inputs map to the same output. For example, f: int -> int by f(x) = x^2 is not injective because f(1) = f(-1).

A function f: A -> B has a left inverse if there exists a function g: B -> A such that forall a in A, g(f(a)) = a. In other words, f's left inverse "undoes" f.

Proposition 1 (1)

The first proof exercise in the book is to show that a function is injective if and only if it has a left inverse.

This statement is false. Let A = {}, and B = {1}. Let f: A -> B = {}. The function f is indeed a function because it satisfies the 3 criteria listed in the definition above. The function f is injective because it is (vacuously) true that no two distinct inputs map to the same output. However, f does not have a left inverse, because there are no functions from B to A.

I probably wouldn't have thought of this corner case if I was doing this exercise on paper. Because I was using Rocq, I just kept running into walls trying to prove the proposition as stated. All the ways I could think of proving the statement required either that A be inhabited or that B be uninhabited. After way too long, I started to wonder if the proposition just wasn't even true, and here we are :)

While writing this post, I checked the book's errata, and this is already in there. Oh well :)

联系我们 contact @ memedata.com