{"record":{"id":"N-BABBAGE-CONTROL","slug":"where-babbages-1836-count-comes-from-decides-what-his-engine-could-compute","kind":"notebook","title":"Where Babbage’s 1836 count comes from decides what his engine could compute.","dek":"Babbage wrote in 1836 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; read the other, it can, but not 2↑↑↑n for every n. Both are proved in Lean.","abstract":"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.","created":"2026-11-27","version":"1.1","status":"OPEN","publication":"published","authors":["Chris Hay"],"lineage":"SKETCH BOOKS → TRANSCRIPTION → FROZEN RULES → MACHINE → LEAN → REVIEW","concepts":["source-authority","verification","programming-languages"],"related":["N-BABBAGE","N-TURING-ACE","N-NINE-CHAPTERS"],"media":[],"body":[{"kind":"observation","label":"01 / A NUMBER PUT ON AN AXIS","text":"On 7 March 1836 Babbage wrote that when an operation is to end “after a given variable number of repetitions”, the number should be put on an axis, unity subtracted before each operation, and the running up would suspend it. The page says the number varies from one use to the next. It does not say where it comes from: a card punched in advance, or a number the engine has computed and holds in its store. That decides how much this machine can compute.","references":[{"label":"Scribbling Book Vol. II, Science Museum Group","url":"https://collection.sciencemuseumgroup.org.uk/documents/aa110001323"},{"label":"The page read at full resolution","url":"https://github.com/chrishayuk/analytical-engine/blob/a9093f5/sources/notes/repetition-count-1836-1842.md"}]},{"kind":"observation","label":"02 / THE CONTROL OF THE SKETCH BOOKS","text":"The pages give three arrangements, each with a date. March 1836 repeats one operation a counted number of times. In December 1837 combinatorial wheels hold a count, and backing cards send the cards back to the first card, counted or always. On 30 May (the year inferred as 1838) the wheels can be “set to back any No of cards”. Every arrangement found sets a count before the group 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."},{"kind":"observation","label":"03 / A CONJECTURE THAT FAILED","text":"The first conjecture was that no deck of these dated arrangements that halts computes 2↑↑n, 2 raised to itself n times. It was wrong. A deck of six cards, accepted by the arrangement of December 1837, halts with 2↑↑n for every n ≥ 1, because the machine, as first built, read a repetition count from the store. The page of 7 March 1836 allows that reading and does not require it. The conjecture was withdrawn in the repository, with the date, rather than quietly replaced."},{"kind":"observation","label":"04 / TWO READINGS, TWO THEOREMS","text":"With repetition counts from number cards only (the wheels may still take computed numbers), everything a halting deck gives off is below a tower of 2s whose height is fixed by the deck, so from some n on it does not give 2↑↑n. With repetition counts from the store, a deck reaches 2↑↑n, but no deck gives 2↑↑↑n for every n. Each of these is proved in Lean. Where a single repetition count comes from moves the machine one level."},{"kind":"observation","label":"05 / ONE STEP NO PAGE GIVES","text":"Add to the arrangement of 30 May 1838 one more thing: a count set inside the group of cards it counts. Then a deck can test a counter for zero with arithmetic alone, and every counter machine translates into a deck that halts exactly when the machine does. Given Minsky’s theorem (cited, not formalised), this machine is general. Every dated arrangement refuses those decks, and no page read sets a count inside the group it counts."},{"kind":"observation","label":"06 / OR CHANGE WHAT COUNTS AS THE END","text":"So far a run ends by passing its last card, and 1 ÷ 0 is an error. Read such a stop as the end of the run instead. 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, and December 1837 does 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."},{"kind":"observation","label":"07 / DECEMBER 1837 AGAINST MAY 1838","text":"Backing to any card matters as much as where a count comes from. 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 trap read as the end and counts from the store, both are general."},{"kind":"observation","label":"08 / HOW IT WAS CHECKED","text":"Every theorem named 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 (it accepted a negative count on the wheels) and a theorem stated more strongly than 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 trap. 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."},{"kind":"connection","text":"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.","links":[{"href":"https://github.com/chrishayuk/analytical-engine","label":"Source: the machine, the decks, the Lean proofs"},{"href":"https://github.com/chrishayuk/analytical-engine/blob/a9093f5/docs/semantics.md","label":"The rules, each marked page, reading or idealisation"},{"href":"https://github.com/chrishayuk/analytical-engine/blob/a9093f5/docs/expressiveness.md","label":"What the theorems mean, with the correction"},{"href":"https://github.com/chrishayuk/analytical-engine/blob/a9093f5/formal/README.md","label":"The Lean theorems, file by file"},{"href":"/notebook/babbage-reordered-a-program-to-save-ten-turns-of-the-hand","label":"The first note: Babbage’s programs of August 1837, run"}]},{"kind":"refusal","title":"WHAT THIS DOES NOT SHOW","lines":["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."],"principle":"A page that leaves a word open leaves a theorem open. Prove both, and say which page you read."},{"kind":"question","text":"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?","status":"OPEN","detail":"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."}],"sources":[{"title":"C. Babbage, Scribbling Book Vol. II (1835–1837), p. 84, 7 March 1836, BAB/S/1/02, the Babbage Papers, Science Museum Group","url":"https://collection.sciencemuseumgroup.org.uk/documents/aa110001323","note":"“a given variable number of repetitions … put on an axis”. Transcribed at full resolution in the repository (sources/notes/repetition-count-1836-1842.md)."},{"title":"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","note":"The combinatorial wheels and cards, counted and unconditional backing, and backing to any card. Transcribed in sources/notes/sketchbooks-control.md."},{"title":"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","url":"https://www.fourmilab.ch/babbage/sketch.html","note":"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."},{"title":"R. Rojas, “How to make Zuse’s Z3 a universal computer”, IEEE Annals of the History of Computing 20(3), 1998, pp. 51–54","url":"https://doi.org/10.1109/85.707574","note":"One loop of arithmetic, ended by an operation the machine cannot do."},{"title":"R. Rojas, “Unconventional universal computation in Babbage’s Analytical Engine”, arXiv:2408.03334, 2024","url":"https://arxiv.org/abs/2408.03334","note":"Universality from a backing that depends on a computed result: the step the 1836–1838 arrangements lack."},{"title":"M. L. Minsky, Computation: Finite and Infinite Machines, Prentice-Hall, 1967","note":"Two counters suffice. Cited, not formalised, and not read for this note."},{"title":"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","note":"The bounds on loops whose count is fixed at entry. Meyer and Ritchie read; Grzegorczyk cited, not read."},{"title":"The literature review","url":"https://github.com/chrishayuk/analytical-engine/blob/a9093f5/docs/literature-expressiveness.md","note":"What was read, what was not, and what was not found."},{"title":"chrishayuk/analytical-engine, commit a9093f5","url":"https://github.com/chrishayuk/analytical-engine/tree/a9093f5","note":"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."}],"published":"2026-11-27","revised":"2026-12-01"},"hash":"c526a487afac23c909dfa5b109d8ad9aea7a142171c8a447c0a890a4bbbb86dd","algorithm":"sha256","provenance":{"id":"N-BABBAGE-CONTROL","version":"1.1","recordHash":"c526a487afac23c909dfa5b109d8ad9aea7a142171c8a447c0a890a4bbbb86dd","revision":{"kind":"clarification","summary":"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)","previous":"1.0"},"sources":[{"title":"C. Babbage, Scribbling Book Vol. II (1835–1837), p. 84, 7 March 1836, BAB/S/1/02, the Babbage Papers, Science Museum Group","url":"https://collection.sciencemuseumgroup.org.uk/documents/aa110001323","note":"“a given variable number of repetitions … put on an axis”. Transcribed at full resolution in the repository (sources/notes/repetition-count-1836-1842.md)."},{"title":"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","note":"The combinatorial wheels and cards, counted and unconditional backing, and backing to any card. Transcribed in sources/notes/sketchbooks-control.md."},{"title":"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","url":"https://www.fourmilab.ch/babbage/sketch.html","note":"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."},{"title":"R. Rojas, “How to make Zuse’s Z3 a universal computer”, IEEE Annals of the History of Computing 20(3), 1998, pp. 51–54","url":"https://doi.org/10.1109/85.707574","note":"One loop of arithmetic, ended by an operation the machine cannot do."},{"title":"R. Rojas, “Unconventional universal computation in Babbage’s Analytical Engine”, arXiv:2408.03334, 2024","url":"https://arxiv.org/abs/2408.03334","note":"Universality from a backing that depends on a computed result: the step the 1836–1838 arrangements lack."},{"title":"M. L. Minsky, Computation: Finite and Infinite Machines, Prentice-Hall, 1967","note":"Two counters suffice. Cited, not formalised, and not read for this note."},{"title":"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","note":"The bounds on loops whose count is fixed at entry. Meyer and Ritchie read; Grzegorczyk cited, not read."},{"title":"The literature review","url":"https://github.com/chrishayuk/analytical-engine/blob/a9093f5/docs/literature-expressiveness.md","note":"What was read, what was not, and what was not found."},{"title":"chrishayuk/analytical-engine, commit a9093f5","url":"https://github.com/chrishayuk/analytical-engine/tree/a9093f5","note":"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."}]}}