taocp

This site has no text of the book. Keep your own copy of TAOCP next to it. See what is checked.

Volume P0 · Guide

The map and the site

Draft. This chapter is written and checked by the tools of the project, and a person has not reviewed it yet. Read it with care.

Contents
  1. Nodes and their ids
  2. The statuses of a node
  3. The edges of the map
  4. The fidelity battery in plain words
  5. Finding things on the site
  6. The status table

Nodes and their ids

A node is one item of TAOCP, or one lemma that the project adds. Every theorem, every numbered equation that claims something, every algorithm, every program and every exercise of the book is a node. Informal exercises and open problems are nodes too. So the map covers the whole book, not only the parts that are easy to formalize.

The kinds of node

Kind What it is
definition a definition of the book
theorem a theorem or a lemma of the book
equation a numbered equation that claims something
algorithm an algorithm in the step format, such as Algorithm 1.1E
program a MIX or MMIX program
analysis a theorem about the cost of an algorithm or a program
exercise, exercise-part an exercise, or one part of an exercise
open a problem that is open in the literature
informal an item with no formal content
example a worked example of the text
certificate the data that a computation produced, for a proof to check
lemma a fact that the project adds to help a proof

Two names for each node

Each node has two names (spec 08.3).

The tag is a stable id: the letters TA and eight more letters and digits, for example TAFN06QKX0. The tag never changes, even when the book reference of the node changes in a new printing. Links between nodes use the tag.

The reference is a readable name, built from the number of the item in the book. It is unique. Its forms are these:

Reference Item
1.2.6-10 exercise 10 of Section 1.2.6
1.2.6-(21) equation (21) of Section 1.2.6
Algorithm 1.2.10M Algorithm M of Section 1.2.10
Theorem 1.2.7A Theorem A of Section 1.2.7
MPR-70 exercise 70 of the Mathematical Preliminaries Redux of Volume 4B
V1-NE-4 an exercise in the notes on the exercises of Volume 1

The spec writes the same references in a shorter form, such as 1.2.6-eq21 and 1.1-algE (spec 08.3). The map uses the forms of the table above. The handbook follows the map: on a Node line, thb check reports a short form such as 1.1-algE as a fault and names the form of the map.

Example. A reader of Section 1.2.6 sees a reference to equation (21). On the site, the search for 1.2.6-(21) finds the node. Its page shows the tag, the Lean name TAOCP.S1_2_6.eq21 and the status. The three names belong together: the book number, the reference and the Lean name.

Example. Suppose that a later printing adds a new exercise before exercise 10, so that the old exercise 10 becomes exercise 11. The reference of the node changes to 1.2.6-11, and the field that records the printing changes. The tag stays the same. So a link that uses the tag still goes to the right node.

What a node file holds

A node is a small file of data in blueprint/nodes/ of the repository tamnd/taocp. Here is a real node of the edition c97f505, the node of exercise 1.2.6-10:

tag: TAFN06QKX0
ref: 1.2.6-10
kind: exercise
title: Exercise 1.2.6-10
volume: "1"
section: 1.2.6
number: 10
rating: M25
pages: 53 to 74
printing: V1 3rd ed.

Read it from the top. The tag and the reference name the node. The kind says that it is an exercise. The volume, the section and the number place it in the book. The rating is copied from the book. The pages give where the section and its answers are, and the printing says which copy of the book the record was read from (Section 1.4). The file has no text of the exercise.

As the work goes on, more fields are added to each node (spec 08.3). Here is the full form, with invented values:

exkind: K1
summary: |
  Three congruences for binomial coefficients modulo a prime.
uses: [TA4N7Y1KTE, TA8XQ2V0CD]
lean:
  problem: TAOCP.S1_2_6.Ex10.statement
  solution: TAOCP.S1_2_6.Ex10.solved

The exkind is the kind of exercise of Section 2.5. The summary describes the exercise in at most two sentences, in the project's own words. It never quotes the book. The uses field lists the tags of the nodes that its proof uses (Section 5.3). The lean field gives the Lean names of Section 4.3. A K1 exercise has no answer. The status is not in the file: a program computes it, and nobody writes it by hand.

Example. A node of kind informal has no lean field and no exkind. Its file gives a reason why no faithful statement exists, and two people accept the reason. An exercise that asks for an opinion, such as "which algorithm of this chapter do you like best", is informal.

Example. A node of kind open has a Lean statement and no proof. The statement is a def of type Prop, never a theorem and never an axiom. If the literature solves the problem later, the node changes kind and cites the solution.

The statuses of a node

The status of a node tells a reader how far the project has come with it. A program, taocp index, computes it from the Lean build and the records of the checks. Nobody writes a status by hand. So a status cannot be more optimistic than the evidence.

The list

Status What it tells you
unclassified the node exists, but its kind is not accepted yet
informal the item has no formal content, and two people accepted the reason
unstated the item is formal, and it has no Lean statement yet
stated a Lean statement exists and builds, but it is not checked against the book yet
faithful the statement passed the fidelity battery and a person signed it (Section 5.4)
defined a definition that builds and passed its checks
proved the proof is complete, uses only the three standard axioms, and every node that it uses is proved or defined
proved-native as proved, but the proof uses compiled evaluation (Section 4.5)
proved-mod the proof is clean, but it takes a named hypothesis or uses a node that is not proved (Section 4.6)
refuted Lean proves the negation of the statement
open a research problem (kind K9); no proof is claimed
claimed a result from a preprint that the project has not checked

A typical formal node moves down the list: unclassified, then unstated, then stated, then faithful, then one of the proved statuses. The other statuses are ends of their own.

Example. Exercise 1.2.6-5 asks why a fact about powers of 11 holds (Section 2.6). Its node starts as unclassified. A role proposes the kind K1, and a person accepts it, so the node becomes unstated. The stater role writes the problem file, and the node becomes stated. After the fidelity battery and a signature, it is faithful. When the solution file builds with a clean list of axioms, it is proved.

Example. A node can also go back. If a person changes the statement of a faithful node, the node returns to stated, and the battery runs again. If a node that a proof uses loses its proof, the node that uses it drops from proved to proved-mod.

Statuses that need care

refuted. For an exercise, this means that the claim of the book is false as printed. That is a finding, not a failure. The node starts the errata flow of Chapter 6. A new node with a corrected statement is added, and it uses the refuted one.

open. The book rates some problems 46 to 50, or its answer calls them open. Such a node has a statement of the open problem and no proof. The site and the handbook call it "open". A conjecture of the literature is in this group too: the map has no separate status for a conjecture. A conjecture is an open node until somebody proves or refutes it.

claimed. A preprint may claim a result that bears on TAOCP. The project records it as claimed and does not rely on it. A claimed node is never a hypothesis of another node.

proved-native and proved-mod. Both are proofs, but each one trusts something more than the Lean kernel: the compiler, or a published result. The site and the handbook always show the label, and they never add these counts to proved without saying so.

Example. Suppose that the site shows 120 exercises of Section 1.2 as proved, 3 as proved-native and 2 as proved-mod. A sentence such as "125 exercises of Section 1.2 are proved" breaks the rules. A correct sentence is "120 proved, 3 proved with compiled evaluation, 2 proved under named hypotheses". These counts are invented.

Example. In the handbook, a companion section never claims more than the status of its node (spec 11.3). If the node of a theorem is stated, the section may give a proof in words, but it says that the Lean proof is not done.

The edges of the map

An edge of the map goes from one node to another, and it means "uses". If the proof of node AA uses node BB, the map has an edge from AA to BB. The edges are in the uses field of each node file.

The map has no cycles: if AA uses BB, then BB does not use AA, directly or through other nodes. A graph with this property is a directed acyclic graph. So every chain of uses ends, and every node rests on nodes that do not use anything from the map.

What the edges do

The edges carry status. A node is proved only when every node that it uses is proved or defined. When a node that it uses is only stated, the node is proved-mod, and its page names the missing node. So one missing proof shows up in every node that rests on it. A reader sees at once what a result depends on.

Example. Suppose that the map has three nodes with invented links: a K3 exercise of Section 1.2.6 uses equation 1.2.6(21), and that equation uses the definition of the binomial coefficient. If the definition is defined and the equation is proved, the exercise can be proved. If the equation is only stated, the exercise is at most proved-mod, even with a complete proof of its own.

Example. Take four nodes AA, BB, CC and DD with the edges A→BA \to B, A→CA \to C, B→DB \to D and C→DC \to D. Then DD is used by all others. If DD loses its proof, then BB, CC and AA all become proved-mod. When DD is proved again, all three return to proved, and nobody has to touch their files.

How the site draws the edges

Each node page on the site has two lists: "uses" and "used by". The first list shows what the result needs. The second shows what needs the result. Both lists link to the node pages, so you can walk the map in either direction.

The page /map/ draws the map as a graph. You can filter it by volume, by section, by kind or by status. A filter by status shows at once where the gaps are: the nodes that are stated but used by many proved nodes are the most useful ones to prove next.

Example. In the edition 4b8e3d4 of the map, the node of Algorithm 1.1E has five edges into it. Exercises 1.1-3, 1.1-5, 1.1-7, 1.1-8 and 1.1-9 each list it under "uses". So the list "used by" on the page of Algorithm 1.1E shows these five exercises. Exercise 1.1-8 also uses equation 1.1-(3), and exercise 1.1-9 also uses equation 1.1-(2). Later, the theorems about the number of steps of Euclid's algorithm in Section 4.5.3 will be in the same list. Those theorems are far from Section 1.1 in the book, but the edge shows the link.

Example. The list "uses" of a node in Volume 3 may include a node of Section 1.2. That edge tells a reader which part of Volume 1 to read first. The reading paths of Section 3.2 follow the same idea at the level of chapters.

The fidelity battery in plain words

A proof in Lean is checked by a machine. A statement is not. Nothing in Lean can tell whether a statement says what the book says. A statement can be true, proved, and still about the wrong thing. The fidelity battery is the set of checks that the project runs to catch this (spec 06.6). A statement is faithful only after it passes them.

The seven checks

Check The question it asks
F1 not trivial Is the statement too easy, too weak or empty?
F2 small cases Does it agree with a brute-force computation for small inputs?
F3 Knuth's answer Does its answer agree with the answer in the book?
F4 closed form Is the answer a real closed form, and not the question in disguise?
F5 round trip Written back in English, does it say what the book says?
F6 human review Has a person who knows the section read it and signed it?
F7 cross check Does it agree with the same fact in another source?

A statement is faithful when F1 to F5 pass and F6 is signed. F7 is recorded when another source exists.

What each check does

F1, not trivial. A program tries to prove the statement with automatic tactics for 30 seconds. If they succeed, the statement is probably too weak, unless the exercise is rated 00 to 10. The program also checks that the hypotheses can hold together: a statement with impossible hypotheses is true for no good reason. And it checks that each parameter that the book lets vary is not fixed.

Example. A statement about every byte size bb of MIX that has the hypothesis b=64b = 64 fails F1. The book allows every byte size from 64 to 100.

Example. A statement with the hypotheses n>5n > 5 and n<3n < 3 is true, because no nn satisfies both. F1 asks for a witness, a value that satisfies the hypotheses. There is none, so the statement fails.

F2, small cases. A second program, written separately from the English text, computes the quantity by brute force for small inputs, by default up to 8. The answer of the statement must agree.

Example. For the illustration of Section 4.2, the brute force adds k(nk)k\binom{n}{k} for nn from 0 to 8. The values are 0, 1, 4, 12, 32, 80, 192, 448, 1024. The answer n2n/2n2^n/2 gives the same nine numbers.

F3, Knuth's answer. A model reads the answer at the back of the book and the answer of the statement, and compares them. The book text stays on the machine of the run. If the two disagree, the node gets the flag erratum-candidate, and a person looks at it. Either the statement is wrong, or the book is (Chapter 6).

F4, closed form. For an exercise that asks for a value or an estimate, the answer may use only an allowed list of functions: arithmetic, powers, factorials, binomial coefficients, harmonic numbers, Fibonacci numbers, floors, ceilings, logarithms, and sums of fixed length. A sum with nn terms is not a closed form for a sum with nn terms.

F5, round trip. A model reads only the Lean code and writes what it says in English. A second model compares that text with the book and lists the differences. A person reads the list. This check catches a statement that is true and well formed but means something else.

Example. A statement uses Finset.range n where the book sums over 1≤k≤n1 \le k \le n. The Lean sum then runs over 0≤k≤n−10 \le k \le n - 1. The English version says "for kk from 0 to n−1n - 1", and the comparison shows the difference at once.

F6, human review. A person who knows the section reads the statements and signs them. For most kinds, the person signs a section as a batch, after reading at least a fifth of the statements at random and every statement that F3 or F5 flagged. For research problems and informal items, two people sign.

F7, cross check. When the same fact is in another source, the project links the two: a theorem of Mathlib, a sequence of the OEIS, a formal proof in another system, or a value from one of Knuth's own programs.

Example. The node of equation 1.2.6(21) can be linked to Nat.add_choose_eq of Mathlib, which proves the case of natural numbers. A bridge theorem shows that the project's statement implies the Mathlib one on natural numbers.

Finding things on the site

The site shows the map, the Lean files and the handbook together. Every page that names an item of TAOCP gives its section and its number, so that you can go back to the book. No page has the text of the book. This section lists the pages that a reader uses most (spec 12.3).

The main pages

Page What it shows
/book/ the volumes and their sections in the order of the book, each with a bar of statuses
/book/1.2.6/ one section: its theorems, equations, algorithms and programs by number, a table of its exercises, its companion chapter and its errata
/ex/1.2.6/42/ one exercise: number, rating, markers, kind, summary, hints folded, the solution behind a click, the Lean statement and proof, the fidelity checks
/node/<tag>/ any node: its summary, its Lean names, its "uses" and "used by" lists, its history
/alg/<ref>/ one algorithm, with a run on a sample input and its step counts
/prog/<ref>/ one MIX or MMIX program, with a trace on a sample input
/map/ the map as a graph, with filters
/learn/ the learner kit: the paths, the glossary, the notation table, the black boxes
/errata/ the errata that the project found (Chapter 6)
/native/ every proved-native node, with its computation
/search/ search by reference, summary, Lean name and handbook text

The home page has a row of doors, one for each kind of visitor: a reader of the book, a student, a teacher, a Lean user, a person who found an error, and a program.

Example. You are reading Section 1.2.6 and you want to try exercise 10. Go to /ex/1.2.6/10/. The page shows the rating M25, the triangle that marks a recommended exercise, the kind and the status. The hints are folded. Open one at a time, as Section 3.3 suggests. The full solution is behind one more click.

Example. You see a Lean name, TAOCP.S1_2_6.eq21, in a handbook section, and you want to know what uses it. Search for the name. The search finds the node. Its page has the list "used by", with each node and its status.

Following a path

The reading paths of Section 3.2 are on the site at /learn/paths/. Each path is a list of chapters with a checkbox for each.

Example. A reader on the Volume 1 course path opens /learn/paths/, chooses that path, and sees P0 Ch. 1 to 3, then P2 Ch. 1 to 8, then P7 Ch. 1 to 7, then the companion chapters. Each line links to the chapter in the handbook.

Example. A reader who knows Concrete Mathematics chooses the path for such readers. It skips P2, because the reader knows that material, and starts with P0 and P7.

What a page never does

A page never claims more than the status (spec 12.6). "Solved" on an exercise page means proved or proved-native, and a proved-native node always shows its label. Every number on the site comes from a record that a program wrote. A page of the handbook that is not reviewed has a banner that says it is a draft.

The status table

The status table is the first item of the learner kit (spec 11.6). It shows, for each chapter of TAOCP, how many items the project has stated, checked and proved. The builder of the handbook writes it at each release from the records. Nobody types a number into it.

The layout

The rows are the chapters of TAOCP. The columns are the theorems, the algorithms, the programs, the exercises by kind, and the levels G1 to G4 of the project (spec 12.2). Each cell has counts of nodes by status.

At release v0.0.1, the map has 5,668 nodes, and all of them are unstated. So each cell of the real table would show a total and two zeros, and thb does not yet write the table. Here is the layout with one row. The numbers in it are invented, to show how to read a row. They are not data.

Chapter Theorems Algorithms Programs Exercises K1 Exercises K3 Informal G1
1 (invented) 40 / 25 / 10 12 / 6 / 2 30 / 0 / 0 200 / 90 / 40 150 / 70 / 30 25 95%

Each cell of the form a/b/ca / b / c gives three counts: aa nodes in all, bb of them at least faithful, and cc of them proved. The real table has more columns: one for each kind K1 to K9, and separate counts for proved-native, proved-mod and refuted.

Example. Read the cell "200 / 90 / 40" of the column K1. Chapter 1 has 200 exercises of kind K1. For 90 of them, the statement has passed the fidelity battery. For 40, the proof is complete. So 110 statements still need their checks, and 50 checked statements still need a proof.

Example. The column G1 sums up the first level of the project for the chapter (spec 12.2): how far its nodes have come from unclassified to faithful. In the invented row it is given as one share, 95%. The column "Informal" counts the nodes that have no formal content. A high count there is not a goal: an exercise is informal only when no faithful statement exists (Section 2.5).

How to read the counts

  1. Never add the proved columns. proved, proved-native and proved-mod are separate. A sum hides what each proof trusts.
  2. Look at the date. Each table gives the edition of the map that it was built from. A table from an older release can be months behind the site.
  3. Compare with the site. The page /levels/ on the site shows the same counts from the same records. If the table of a release and the site differ, the site is newer.

Example. Volumes 1 to 4B have 5,359 exercises (Chapter 2). Suppose that a table shows 4,000 of them at least faithful, 3,000 proved, 200 proved-native and 100 proved-mod (invented numbers). The correct summary is "3,000 proved, 200 proved with compiled evaluation, 100 proved under named hypotheses, out of 5,359". The summary "3,300 proved" is wrong.

Things to try

  1. Write the reference of Algorithm 1.1E and of equation (21) of Section 1.2.6, and their Lean names (Sections 5.1 and 4.2).
  2. A node uses two nodes. One is proved and the other is stated. The proof of the node is complete and clean. What is its status? (Section 5.2.)
  3. Draw the four nodes AA to DD of Section 5.3. Suppose that CC is refuted. Which nodes must change? P8 teaches graphs.
  4. For the sum ∑1≤k≤nk2\sum_{1 \le k \le n} k^2, write the values for nn from 0 to 8 that check F2 would compute. Then check the closed form n(n+1)(2n+1)/6n(n+1)(2n+1)/6 against them. P2 Chapter 1 teaches this sum.
  5. Find the page of exercise 1.2.6-5 on the site, and read its kind and status (Section 5.5).
  6. Explain in two sentences why a proved statement can still be wrong, and which check is meant to catch that (Section 5.4).

The project keeps one central record of TAOCP: the map. The map has one node for each item of the book, and an edge from each node to the nodes that it uses. Each node has a status that a program computes from the Lean files and the checks. The site shows the map, and the handbook prints its status lines from it.

Section 5.1 explains the nodes and their ids. Section 5.2 explains the statuses and what each one tells a reader. Section 5.3 explains the edges. Section 5.4 explains the fidelity battery, the checks that test whether a Lean statement says what the book says. Section 5.5 shows how to find things on the site. Section 5.6 explains the status table of the learner kit.

At release v0.0.1, the edition c97f505 of the map has 5,668 nodes: 5,372 exercises, 288 numbered equations, 5 theorems and 3 algorithms. None of them has a Lean statement yet, so every node is unstated. The edition 4b8e3d4, pinned after the release, adds four nodes of Section 1.1: Algorithm 1.1E and the equations 1.1-(1) to 1.1-(3). So the map at that edition has 5,672 nodes: 5,372 exercises, 291 equations, 5 theorems and 4 algorithms. The examples of this chapter use real nodes where they can. Where an example needs a later status, it uses invented values and says so.

The source of this page. Something is wrong? Report it.