1200 × 1500
Where Babbage’s 1836 count comes from decides what his engine could compute.
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.
ABOUT THIS NOTE +
A note about what the control mechanisms of Charles Babbage’s Sketch Books of 1836 to 1838 can compute, at the dates the pages give: one operation repeated a counted number of times (March 1836), combinatorial wheels and backing cards to the first card (December 1837), and backing to any card (30 May 1838). I built a machine with only the rules the pages give, fixed each rule as page, reading or idealisation, and proved theorems about it in Lean. The first conjecture, that no deck that halts computes 2↑↑n, was wrong: it fails as soon as a repetition count may be read from the store, and the page of 7 March 1836 does not say where the count comes from. With repetition counts from number cards, everything a halting deck gives off is below a tower of fixed height. With repetition counts from the store, 2↑↑n is reached and 2↑↑↑n, for every n, is not. Two further steps make the machine general, given Minsky’s theorem: a count set inside the loop it counts, which no page read gives; or a stop at 1 ÷ 0 read as the end of the run, with the unconditional backing card the pages do give (for 30 May 1838 under either reading of repetition counts; for December 1837 only if they come from the store, and otherwise open). With a halt as passing the last card, December 1837 is strictly weaker than May 1838 under both readings. The Lean model and the Rust machine agree on 2,015 decks, which is a test, not a proof. The mathematics is classical; what is new here, as far as the search went, is its application to these pages.
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.
Scribbling Book Vol. II, Science Museum Group ↗The page read at full resolution ↗
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.
FOLLOW THIS IDEA — Source: the machine, the decks, the Lean proofs →FOLLOW THIS IDEA — The rules, each marked page, reading or idealisation →FOLLOW THIS IDEA — What the theorems mean, with the correction →FOLLOW THIS IDEA — The Lean theorems, file by file →FOLLOW THIS IDEA — The first note: Babbage’s programs of August 1837, run →
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.
OPEN
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.
PUBLICATION HISTORY
Each version preserves its manuscript, claims and source references. Research status is recorded separately from publication.
- V1.0 · 2026-11-27 ↗
First publication, after a fact-check against analytical-engine a9093f5: repetition counts distinguished from combinatorial counts throughout; December 1837 refuses the 1838 trap deck and needs a second deck; pentation stated as 'not for every n'; the Lean-Rust comparison described as 4,015 runs on 2,015 decks; the maximum tested for small inputs; links pinned to the commit. OPEN
- V1.1 · 2026-12-01 ↗
Visual re-edit, no change of result: every chapter opens with Babbage's page (9 crops of the Science Museum Group's scans, 7 of them new: Sketch Book Vol. III pp 161, 162 and 164, and reverse pp 74–75 of 30 May [1838]; AI-agent readings, unchecked by a person), the question it raises and something to try — the axis of 7 March 1836 under both readings, the cards of December 1837 and May 1838 stepped one by one, the tower deck with its count from the store or a number card — then a shorter account and RECORD, MODEL, PROOF and OPEN strips carrying every condition of 1.0, with 32 Lean links pinned to a9093f5; independently fact-checked (findings applied: the tower figure no longer presents a Model A run of a deck Model A does not admit; the year of 30 May stated as inferred; the June 1839 exception kept within one long addition; readings moved out of RECORD; three theorems named; the nesting of wheels on reverse p 74 marked open) OPEN
- V1.2 · 2026-12-02 ↗
Rewritten for readability with no change of result: each act now opens with a question or observation and reads as a short narrative, with technical terms explained on first use; dates, quotations, theorem names and qualifications stay in the strips and sources. A repeated disclaimer about review of the readings is removed; the readings are still attributed to an AI agent OPEN
SOURCES & PROVENANCE
- C. Babbage, Scribbling Book Vol. II (1835–1837), p. 84, 7 March 1836, BAB/S/1/02, the Babbage Papers, Science Museum Group ↗
“a given variable number of repetitions … put on an axis”. Transcribed at full resolution in the repository (sources/notes/repetition-count-1836-1842.md).
- C. Babbage, Scribbling Book Vol. III, pp. 161–165 (December 1837) and reverse pp. 74–75 (“30 May”, the year inferred as 1838), the Babbage Papers, Science Museum Group
The combinatorial wheels and cards, counted and unconditional backing, and backing to any card. Transcribed in sources/notes/sketchbooks-control.md.
- L. F. Menabrea, “Sketch of the Analytical Engine invented by Charles Babbage”, trans. and with notes by A. A. Lovelace, Scientific Memoirs 3 (1843), pp. 666–731 ↗
The bell at “the passage through zero or infinity” (p. 685); “the mill will order other cards” (p. 687); Note G (pp. 728–731). Read in sources/notes/menabrea-lovelace-1843-control.md.
- R. Rojas, “How to make Zuse’s Z3 a universal computer”, IEEE Annals of the History of Computing 20(3), 1998, pp. 51–54 ↗
One loop of arithmetic, ended by an operation the machine cannot do.
- R. Rojas, “Unconventional universal computation in Babbage’s Analytical Engine”, arXiv:2408.03334, 2024 ↗
Universality from a backing that depends on a computed result: the step the 1836–1838 arrangements lack.
- M. L. Minsky, Computation: Finite and Infinite Machines, Prentice-Hall, 1967
Two counters suffice. Cited, not formalised, and not read for this note.
- A. R. Meyer and D. M. Ritchie, “The complexity of loop programs”, Proc. ACM National Meeting, 1967; A. Grzegorczyk, “Some classes of recursive functions”, Rozprawy Matematyczne 4, 1953
The bounds on loops whose count is fixed at entry. Meyer and Ritchie read; Grzegorczyk cited, not read.
- The literature review ↗
What was read, what was not, and what was not found.
- chrishayuk/analytical-engine, commit a9093f5 ↗
src/sketch.rs (the machine), control/ (the decks), formal/ (Lean: Termination, Growth, Separation, Tower, GrowthStore, RatSize, Minsky, Trap, Classes), scripts/lean-diff.sh, docs/semantics.md, docs/expressiveness.md, docs/growth-classes.md.
AUTHOR / Chris Hay · VERSION / 1.2
PUBLISHED 27 NOV 2026 · REVISED 2 DEC 2026 · VERSION 1.2
CITECITE THIS
Research note · 1.2
Hay, C. (2026). Where Babbage’s 1836 count comes from decides what his engine could compute. (Version 1.2). Chris Hay. https://chrishayuk.com/records/N-BABBAGE-CONTROL/1.2
FOLLOW THE WORK
New notebook entries and recorded work, as they appear. Point a feed reader — or an agent of your own — at an address below. No account, no email address, nothing for this site to keep.
The notebook
New ideas, experiments and essays, as they are recorded. Includes labelled working drafts.
OPEN FEEDhttps://chrishayuk.com/notebook/feed.xmlThe record
Everything published to the Chris Hay record.
OPEN FEEDhttps://chrishayuk.com/record/feed.xml
FOR PROGRAMS · follow.json · JSON Feed