{"record":{"id":"N-BABBAGE-ARITHMETIC","slug":"reconstructing-babbages-1836-arithmetic-processor","kind":"notebook","title":"Reconstructing Babbage’s 1836 Arithmetic Processor","dek":"In January 1836 Babbage charted how his engine’s mill would multiply, divide and take a square root. Rebuilt models are proved correct in Lean, division and root given H-OD, a rule this project proposes; how his mill caught an overshoot is not known.","abstract":"A note about three of Babbage’s mechanical notations of January 1836 at the Science Museum: multiplication without table (BAB/F/018–020, 11 January, 1028 × 201), division without table (F/021–024, 13 January, 9889 ÷ 49) and square root (F/026–029, 15 January, √40601). Built from a handful of primitives — give off and retain, subtraction or addition with or without carriage, a step of one cage, a counter that runs up — one controller regenerates the multiplication’s bands and products, and one subtract / test / carry-or-restore loop regenerates the 11 compared states of the division and the 11 of the square root, the two differing only in what is subtracted and how it moves. Lean models of the controllers are proved correct and terminating: multiplication within capacity; division and square root conditional on H-OD, this project’s rule for deciding an overshoot before the borrows are made. The charts write “Carriage prevented” on exactly the overshooting subtractions, and their intermediate states are those of subtraction without carriage; set beside Babbage’s 1834 proposal to compare the numbers first and his late-1835 practice of subtracting until a running up and adding back, only that reading writes every compared state on the sheets. The arithmetic is established for the models. The mechanism of January 1836 is not.","created":"2026-11-29","version":"1.2","status":"OPEN","publication":"published","authors":["Chris Hay"],"lineage":"THREE CHARTS → SHARED PRIMITIVES → ONE LOOP → CARRIAGE PREVENTED → THREE WAYS TO STOP → WHAT IS PROVED","concepts":["source-authority","verification","programming-languages"],"related":["N-BABBAGE-MILL","N-BABBAGE-SERIES-F","N-BABBAGE","N-BABBAGE-CONTROL","N-BABBAGE-201"],"media":[],"body":[{"kind":"observation","label":"01 / THREE CHARTS IN ONE WEEK","text":"In one week of January 1836, Charles Babbage charted three calculations for the mill of his Analytical Engine: the part of the engine that does the arithmetic.\n\nOn the 11th he charted a multiplication. On the 13th, a division. On the 15th, a square root.\n\nNone of them uses a table of multiples worked out in advance. Each chart follows the calculation through, band by band, as the mill’s wheels change.\n\nHere is the first thing to notice. Every number on the division and root sheets is right.\n\nAnd the columns of numbers on the division sheets, and on the first root sheet, are a fair copy: the starting numbers at the top, the results at the end of each band, and no working anywhere.\n\nSo what would a mill have to do, wheel by wheel, to write these sheets? What happens if we rebuild it in software and run it against them?","references":[{"label":"BAB/F/018, Multiplication without table (Science Museum Group)","url":"https://collection.sciencemuseumgroup.org.uk/documents/aa110000502"},{"label":"BAB/F/021, Division without table, sheet 1 of 4 (Science Museum Group)","url":"https://collection.sciencemuseumgroup.org.uk/documents/aa110000505"},{"label":"The division sheets decoded","url":"https://github.com/chrishayuk/analytical-engine/blob/7d8e681/docs/f-div-f021.md"},{"label":"The square root sheets decoded","url":"https://github.com/chrishayuk/analytical-engine/blob/7d8e681/docs/f-div-track.md"}]},{"kind":"observation","label":"02 / A FEW PRIMITIVES","text":"How little does a mill need in order to multiply, divide and take a square root?\n\nLess than you might think. Nothing in the reconstruction adds, multiplies or divides whole numbers in one go.\n\nEverything happens on figure wheels. Each wheel holds one figure, and its place in the number is called its cage. The wheels turn one tooth at a time, in nine rows of movement.\n\nWhen a wheel passes between 9 and 0, it is warned. Carriage, Babbage’s word for carrying, acts on those warnings afterwards. Or it is prevented, which will matter later.\n\nAdd giving off and retaining (passing a number to another wheel, with or without keeping a copy), a step that moves every figure up one cage, and a counter that runs up when its work is done. That is all the three operations need.\n\nThe same pieces, tooth by tooth, are in the earlier note on multiplication.","references":[{"label":"The wheel rules, committed before the multiplication run","url":"https://github.com/chrishayuk/analytical-engine/blob/7d8e681/docs/f-mill-rules.md"},{"label":"The division rules","url":"https://github.com/chrishayuk/analytical-engine/blob/7d8e681/docs/f-div-rules.md"}]},{"kind":"observation","label":"03 / ONE LOOP FOR DIVISION AND SQUARE ROOT","text":"Division and square root look like different problems. In the rebuilt mill, they are the same loop.\n\nFor each figure of the answer: subtract, then test. If the subtraction did not go too far, make the borrows (carriage, in subtraction) and count one more. If it did, undo the subtraction and step up.\n\nThe only difference between the two is what gets subtracted, and how it moves.\n\nWith nothing else changed, the loop writes the division chart’s 11 compared states and the root chart’s 11, in order. It also gets the right answer on 3,000 random operands.\n\nOne thing it does not work out for itself: it is told how many figures to make and where to start.","references":[{"label":"The shared loop, band by band, with its audit","url":"https://github.com/chrishayuk/analytical-engine/blob/7d8e681/docs/f-srt.md"},{"label":"The controller (scripts/f_srt.py)","url":"https://github.com/chrishayuk/analytical-engine/blob/7d8e681/scripts/f_srt.py"}]},{"kind":"observation","label":"04 / “CARRIAGE PREVENTED”","text":"Six of the subtractions on the two charts go too far: the number taken away is larger than what is left.\n\nOn exactly those six, Babbage wrote “Carriage prevented”.\n\nThat is a puzzle. To prevent the carriage, the mill must know the subtraction has gone too far before the borrows are made. How could it tell?\n\nThis project proposes a rule for it, called H-OD, which reads from the wheels whether the subtraction went too far. It agrees with the charts in 12 cases out of 12, and it is proved to be the same as comparing the two numbers.\n\nBut H-OD is a hypothesis, not something read in Babbage’s papers. Apart from his plans of 1834–35 to compare the numbers first, or to try the subtraction on a copy, every source of 1834 to early 1836 that was read finds out about an overshoot afterwards, from the running up: a borrow leaving the top of the number.","references":[{"label":"H-OD, its checks, and the archive readings","url":"https://github.com/chrishayuk/analytical-engine/blob/7d8e681/docs/f-overshoot-hypothesis.md"},{"label":"Overshoot detection in the sources, 1834 – early 1836","url":"https://github.com/chrishayuk/analytical-engine/blob/7d8e681/sources/notes/overshoot-detection-1834-1836.md"}]},{"kind":"observation","label":"05 / THREE WAYS TO STOP A FIGURE","text":"Babbage’s papers give two other ways to stop a figure.\n\nIn 1834 he planned to compare the numbers first. In 1835 he subtracted until the wheels ran up, then added back.\n\nRebuilt on the same wheels, all three ways give correct answers. But only carriage prevented writes every compared state on the charts.\n\nWhy keep the method he kept in 1835? In March of that year Babbage gave his reason, and it was machinery: it needed so few axes (columns of figure wheels) and carriages that “two divisions or even three might be carried on together”.","references":[{"label":"The three ways, run side by side","url":"https://github.com/chrishayuk/analytical-engine/blob/7d8e681/docs/f-comparator-1834.md"},{"label":"The 1834 passage, read on the image","url":"https://github.com/chrishayuk/analytical-engine/blob/7d8e681/sources/notes/carriage-drawings-and-chart-method-1834-1836.md"},{"label":"The “History of contrivances for Division”, 13 March 1835","url":"https://github.com/chrishayuk/analytical-engine/blob/7d8e681/sources/notes/carriage-drawings-2-1834-1835.md"}]},{"kind":"observation","label":"06 / WHAT IS PROVED","text":"The rebuilt controllers were also written in Lean, a language for mathematical proofs that a computer checks step by step.\n\nThe proofs are finished: none is left incomplete, and nothing is assumed beyond Lean’s standard axioms.\n\nMultiplication is proved correct as long as the numbers fit on the wheels. Division and square root are proved correct on a condition: that overshoots are decided by H-OD, and that the numbers start from a valid alignment.\n\nThe chart cases themselves are computed in Lean too. Each rung of the ladder says what it rests on.","references":[{"label":"The milestone: what is proved and what it is evidence of","url":"https://github.com/chrishayuk/analytical-engine/blob/7d8e681/docs/arithmetic-milestone.md"},{"label":"Multiplication (formal/Babbage/Mill.lean)","url":"https://github.com/chrishayuk/analytical-engine/blob/7d8e681/formal/Babbage/Mill.lean"},{"label":"Overshoot (formal/Babbage/Overshoot.lean)","url":"https://github.com/chrishayuk/analytical-engine/blob/7d8e681/formal/Babbage/Overshoot.lean"},{"label":"Division and square root (formal/Babbage/SRT.lean)","url":"https://github.com/chrishayuk/analytical-engine/blob/7d8e681/formal/Babbage/SRT.lean"}]},{"kind":"observation","label":"07 / CORRECTNESS IS NOT IMPLEMENTATION","text":"The proofs say the models compute correctly. They do not say Babbage’s mill did.\n\nDivision and square root rest on H-OD, and no source supports it as his mechanism.\n\nThe Lean and Python versions of the controllers are not proved to be the same program. Lean takes each row cage by cage; Python works in sequence. That they match is argued, not checked by a run.\n\nParts of the machine are left out. The bolting that chooses which wheel gives off, and the gearing, are not in the proofs. The number of figures in a quotient or root is supplied from outside.\n\nAnd every comparison rests on transcriptions of the charts: readings by a coding agent, an AI model, from the Science Museum Group’s images."},{"kind":"connection","text":"Every rule, run, proof and miss is in the repository.","links":[{"href":"https://github.com/chrishayuk/analytical-engine/blob/7d8e681/docs/arithmetic-milestone.md","label":"The milestone"},{"href":"https://github.com/chrishayuk/analytical-engine/blob/7d8e681/docs/f-srt.md","label":"The shared loop"},{"href":"https://github.com/chrishayuk/analytical-engine/blob/7d8e681/docs/f-comparator-1834.md","label":"Three ways to stop a figure"},{"href":"/notebook/making-babbages-1836-mill-multiply","label":"The earlier note: making the 1836 mill multiply"},{"href":"/notebook/why-did-babbage-keep-using-the-number-201","label":"A related question: why 201?"}]},{"kind":"refusal","title":"WHAT THIS DOES NOT SHOW","lines":["That Babbage’s mill of January 1836 decided overshoots by H-OD, or by any mechanism acting before the borrows. The charts write the decision; the sources read do not say how it was made.","Why Babbage moved from comparing first in 1834 to subtracting and restoring in 1835–36, beyond his March 1835 note that the method kept needed fewer axes and carriages. The measured trade-offs belong to this model.","That the Python and Lean controllers are the same program.","That the transcriptions are final. They are readings by a coding agent (an AI model) from the Science Museum Group’s images."],"principle":"Prove what the model computes; say separately what the machine was."},{"kind":"question","text":"How did the January 1836 charts know, in the band itself, that a subtraction had overshot?","status":"OPEN","detail":"Open here: a detection mechanism of late 1835 not yet found (the trial on a copy of March 1835 was passed over); a running up felt before the borrows were all made; or charts written knowing the arithmetic, as specifications of machinery still to be designed. The carriage drawings of 1834–35 read so far show none."}],"sources":[{"title":"Babbage Papers, BAB/F/018–020: Multiplication without table, 11 January 1836, Science Museum Group","url":"https://collection.sciencemuseumgroup.org.uk/documents/aa110000502","note":"Read from the Science Museum Group’s images at full resolution."},{"title":"Babbage Papers, BAB/F/021–029: Division without table, 13 January 1836, and Square root, 15 January 1836, Science Museum Group","url":"https://collection.sciencemuseumgroup.org.uk/documents/aa110000505","note":"The link is to F/021, sheet 1 of 4 of division."},{"title":"Babbage Papers, Scribbling Book Vol. XIII (BAB/S/1/13), Sketch of the history of the new calculating engine, Science Museum Group","url":"https://collection.sciencemuseumgroup.org.uk/documents/aa110069630","note":"History images 89–94: the 1834 feelers (image 91), the comparison of two numbers of 7 March 1835 (p 22), foreseeing carriage (image 92); pp 30–31, “History of contrivances for Division”, 13 March 1835. Read in sources/notes/carriage-drawings-and-chart-method-1834-1836.md and carriage-drawings-2-1834-1835.md."},{"title":"Babbage Papers, Scribbling Book Vol. II (BAB/S/1/02, 1835–1837), Science Museum Group","url":"https://collection.sciencemuseumgroup.org.uk/documents/aa110001323","note":"pp. 14–15 (30 Nov 1835) and 46–47 (31 Dec 1835): division by subtracting until a running up; p. 50 (1 Jan 1836): a subtraction written “without Car.” with its pending carriages 11110."},{"title":"C. Hay, analytical-engine (GitHub)","url":"https://github.com/chrishayuk/analytical-engine","note":"The controllers, checks, proofs and results."}],"published":"2026-11-29","revised":"2026-12-02"},"hash":"369dee91cbd8aa0cda6969dc92141df95a186872e27399176571542c3bf199b3","algorithm":"sha256","provenance":{"id":"N-BABBAGE-ARITHMETIC","version":"1.2","recordHash":"369dee91cbd8aa0cda6969dc92141df95a186872e27399176571542c3bf199b3","revision":{"kind":"clarification","summary":"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","previous":"1.1"},"sources":[{"title":"Babbage Papers, BAB/F/018–020: Multiplication without table, 11 January 1836, Science Museum Group","url":"https://collection.sciencemuseumgroup.org.uk/documents/aa110000502","note":"Read from the Science Museum Group’s images at full resolution."},{"title":"Babbage Papers, BAB/F/021–029: Division without table, 13 January 1836, and Square root, 15 January 1836, Science Museum Group","url":"https://collection.sciencemuseumgroup.org.uk/documents/aa110000505","note":"The link is to F/021, sheet 1 of 4 of division."},{"title":"Babbage Papers, Scribbling Book Vol. XIII (BAB/S/1/13), Sketch of the history of the new calculating engine, Science Museum Group","url":"https://collection.sciencemuseumgroup.org.uk/documents/aa110069630","note":"History images 89–94: the 1834 feelers (image 91), the comparison of two numbers of 7 March 1835 (p 22), foreseeing carriage (image 92); pp 30–31, “History of contrivances for Division”, 13 March 1835. Read in sources/notes/carriage-drawings-and-chart-method-1834-1836.md and carriage-drawings-2-1834-1835.md."},{"title":"Babbage Papers, Scribbling Book Vol. II (BAB/S/1/02, 1835–1837), Science Museum Group","url":"https://collection.sciencemuseumgroup.org.uk/documents/aa110001323","note":"pp. 14–15 (30 Nov 1835) and 46–47 (31 Dec 1835): division by subtracting until a running up; p. 50 (1 Jan 1836): a subtraction written “without Car.” with its pending carriages 11110."},{"title":"C. Hay, analytical-engine (GitHub)","url":"https://github.com/chrishayuk/analytical-engine","note":"The controllers, checks, proofs and results."}]}}