In 1836 Babbage wrote that an operation could be repeated a “given variable number” of times, without saying where the number comes from. Read one way, his control cannot reach 2↑↑n, a tower of n 2s; read the other, it can, but not 2↑↑↑n for every n. Both are proved in Lean.
Published manuscript · v1.2
01 / A NUMBER PUT ON AN AXIS
How do you tell a machine to do something a certain number of times? On 7 March 1836, Babbage wrote down his answer. When an operation is to end “after a given variable number of repetitions”, put that number on an axis, a column of figure wheels. Subtract one before each operation. When the axis runs up, the repetition stops. It is a simple counter. But the page leaves one thing out. It says the number can change from one use to the next. It does not say where the number comes from. It could be punched on a card in advance. Or it could be a number the engine has worked out for itself and holds in its store, the engine’s memory. That small gap decides how much this machine can compute.
02 / THE CONTROL OF THE SKETCH BOOKS
Babbage’s Sketch Books give three arrangements for controlling the engine, each with a date. In March 1836, one operation can be repeated a counted number of times. In December 1837, combinatorial wheels hold a count, and backing cards send the cards back to the first card so that they run again, either a counted number of times or always. On 30 May (the year is inferred as 1838), the wheels can be “set to back any No of cards”, not just back to the first. Two things hold in every arrangement found. A count is set before the group of cards it counts. And up to April 1842, no page read lets a result of the mill choose between cards, apart from one variant of June 1839, not adopted, within one long addition.
03 / A CONJECTURE THAT FAILED
The study began with a guess. Take any deck of cards these dated arrangements accept, and that halts. The guess was that no such deck computes 2↑↑n: 2 raised to itself n times, a tower of 2s. The guess was wrong. A deck of six cards, accepted by the arrangement of December 1837, halts with 2↑↑n for every n of 1 or more. It works because the machine, as first built, read a repetition count from the store. The page of 7 March 1836 allows that reading. It does not require it. The conjecture was withdrawn in the repository, with the date, rather than quietly replaced.
04 / TWO READINGS, TWO THEOREMS
So the page can be read two ways, and each gives a different machine. Suppose repetition counts come only from number cards. (The wheels may still take computed numbers.) Then everything a halting deck gives off is below a tower of 2s whose height is fixed by the deck. From some n on, it does not give 2↑↑n. Now suppose repetition counts can come from the store. Then a deck reaches 2↑↑n. But no deck gives 2↑↑↑n, the next level up, for every n. Each of these is proved in Lean, a language for mathematical proofs that a computer checks step by step. Where a single repetition count comes from moves the machine one level.
05 / ONE STEP NO PAGE GIVES
Now add one thing to the arrangement of 30 May 1838: a count set inside the group of cards it counts. With that, a deck can test whether a counter is zero using arithmetic alone. That is enough to imitate a counter machine, a very simple model of a computer that only adds to, subtracts from and tests a few counters. Every counter machine translates into a deck that halts exactly when the machine does. Minsky’s theorem says that two such counters, with inputs suitably coded, compute every partial computable function. Given that theorem (cited here, not formalised), this machine is general. But every dated arrangement refuses those decks. No page read sets a count inside the group it counts.
06 / OR CHANGE WHAT COUNTS AS THE END
There is a second way to make the machine general. So far, a run ends by passing its last card, and 1 ÷ 0 is an error. Suppose instead that a stop at 1 ÷ 0 is read as the end of the run. While every backing card is counted, nothing changes. But the pages also give a card that always orders the backing. With it, 30 May 1838 becomes general under either reading, given Minsky’s theorem. December 1837 does too, if repetition counts come from the store. With counts from number cards only, December 1837 is open. No text read treats such a stop as the end of a computation.
07 / DECEMBER 1837 AGAINST MAY 1838
Where a count comes from is not the only thing that matters. Where the cards can be sent back to matters as much. In December 1837, every card backs to the first. So a halting run is one loop. With a halt as passing the last card, December 1837 is strictly weaker than 30 May 1838 under both readings. With a stop at 1 ÷ 0 read as the end and counts from the store, both are general.
08 / HOW IT WAS CHECKED
Every theorem named here is in Lean 4, with only its core library, and is checked on every change. No proof is left unfinished. The bounds use only the standard axioms propext and Quot.sound. The theorems that make the machine general, and the instances for whole numbers and fractions, also use the classical axiom of choice, through core Lean’s lemmas on division, case analysis and one proof by contradiction. Two independent reviews read the proofs against the prose. The first found a real gap in the Rust machine, the version of the machine built as a program: it accepted a negative count on the wheels. It also found a theorem stated more strongly than it was proved. The second found the proofs sound but the prose wrong in places. A rule said no computed number reaches the wheels, when the constructions rely on it. And “counts from number cards” had to be narrowed to repetition counts. All were put right. The Lean model is not proved to be the Rust machine. Instead, the same decks are run through both and compared: nine decks of the study, six counter-machine decks and 2,000 random decks, the random ones with and without the stop at 1 ÷ 0. All 4,015 runs on 2,015 decks agree. The May 1838 decks behind section 07, including the larger of two numbers, are run in Rust only.
Every deck in this note runs in the browser under every dated arrangement at once. The rules, the theorems, the decks and the tests are in the repository.
WHAT THIS DOES NOT SHOW
- These are theorems about models of the control the Sketch Books describe up to 1838, with numbers and a store of unbounded size. They are not claims about Babbage’s engine as he went on to design it. In 1842 Menabrea writes that if a remainder is nothing “the mill will order other cards”, and Lovelace’s Note G of 1843 has V₁₀, which “decides which of two courses the succeeding processes are to follow”. Nothing here says the historical engine was not general.
- The mathematics is classical: the bounds are of the kind Meyer and Ritchie, Kalmár and Grzegorczyk gave for loop programs; the general machines are Minsky’s; and replacing a branch with arithmetic, with a trap to stop, is Rojas’s technique. What a literature search did not find is this classification of Babbage’s dated mechanisms, the dependence on how the 1836 page is read, or machine-checked proofs of either.
- Five items the search found could not be read: Bromley (2000), Rojas (2021), Copeland and Sommaruga (2015), Kfoury (1980), and Goetze and Nehrlich (1980). Any of them may already say some of this, so nothing here is claimed as first.
- Which complexity class each model is exactly is argued, not proved. Minsky’s theorem is cited, not formalised. That the Lean model and the Rust machine agree is tested on 2,015 decks, not proved.
A page that leaves a word open leaves a theorem open. Prove both, and say which page you read.
If a page does not say where a number comes from, how much of what a machine could compute is in the machine, and how much in the reading?
Still open here: whether December 1837, with repetition counts from number cards only, becomes general if a trap ends the run; whether May 1838 can compute x mod y, on which its exact class turns; whether each model is exactly the class it is argued to sit in; and whether a person reading the manuscripts agrees with the transcriptions this all rests on.
Thematic notebook / Published record
Closing thought
Where a repetition count comes from moves Babbage’s 1836–1838 control one level up the hierarchy: with repetition counts from number cards, no halting deck gives off 2↑↑n for every large n; from the store, 2↑↑n is reached and 2↑↑↑n, for every n, is not. Given Minsky’s theorem, a count set inside its own loop, which no page gives, or a stop at 1 ÷ 0 read as the end, with the unconditional backing the pages do give, makes the machine of 30 May 1838 general. With a halt as passing the last card, December 1837 is strictly weaker than May 1838 under both readings.


![Sketch Book Vol. III (BAB/S/1/03), p 162 (image 90): "Between the first and second group a card must be inserted (see page 158 of Vol 3 Sketch book) which orders the backing of operation cards which are thus brought to 0 or their commencing point; but, this order becomes ineffective if the combinatorial wheels have run up. At the end of the second group another card must be inserted (b) which always orders the backing of operation cards. / The numbers put on combinatorial wheels (usually having their first difference constant) may be computed by the constant part of formula cards. / See page 75 other end". "always" is underlined; a fainter "end" [?pencil] follows "other end". The whole written page.](/media/notebook/babbage-control/1837-12-p162-two-groups-and-card-b.jpg)

![Sketch Book Vol. III (BAB/S/1/03), p 162 (image 90), foot: "The numbers put on combinatorial / wheels (usually having their first / difference constant) may be computed / by the constant part of formula cards. / See page 75 other end", the last line underlined, a fainter "end" [?pencil] after it. "Page 75 other end" is reverse p 75, headed "30 May".](/media/notebook/babbage-control/1837-12-p162-numbers-computed-by-constant-part.jpg)



