Traffic (rule 184)
Step by step: why the number of cars never changes in rule 184, and exactly what the Lean theorem proves.
What we look at
A circular road of 28 cells. A black cell is a car, a white cell is free. At each step every car moves at once, following one rule: move one cell to the right if the cell in front is free, otherwise wait.
Rule 184: traffic
Step 16: 14 cars
carfree cellconserved count
Reading the figure step by step
- The first row is the road at the start, with 14 cars.
- Each following row is the road one step later. Time runs downwards.
- Follow a lone car: it moves one cell per row, diagonally to the right.
- Follow a jam: only the front car can move, the others wait. The jam dissolves from the front.
- The number to the right of each row counts the cars. It is 14 on every row.
Why the number does not change
A car never disappears: it either stays put or moves into the next cell. And two cars never arrive in the same cell, since a car only moves when the cell ahead is free. Every change in a cell is therefore explained by a car crossing a border.
What leaves one cell enters the next
Step 0: 4 cars cross a border
cara car crosses a borderconserved count
That is exactly what the certificate says: the change in every cell equals what comes in minus what goes out. Around the ring, what leaves one cell enters the next. See Claims and certificates.
The Lean statement
theorem traffic :
Conserved (eca 184) (tableFn 2 [0, 1]) 1 :=
conserved_of_fluxCheck _ _
(tableFn 2 [1, 1, 1, 1, 1, 1, 0, 0]) 1
(by decide +kernel)The library holds the same law in another form: it counts free cells, with the density tableFn 2 [1, 0]. On a ring of fixed size, counting free cells and counting cars amount to the same thing.
What it proves
In rule 184 as defined in Lean, the number of cars never changes, on rings of every size and from every starting configuration. The kernel checked the certificate on the 16 patterns of 4 cells, and the theorem conserved_of_fluxCheck does the rest.
What it does not prove
- Anything about real road traffic. Rule 184 is a model, and this is a proof in a world.
- Anything about speed or jams: only the conservation of the number of cars is proved.
- The figure is not the proof. It shows 16 steps from one configuration; the proof covers them all.
