Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.Complexity.LinearSpaceArith

Arithmetic in binary within linear work space #

The facts here bound lengths of arithmetic outputs and identify successor iteration, for clients with fixed workspace budgets. The certificate of binary addition, Turing.MultiTapeTM.ComputableInO.natAdd, is in Internal/BinaryAddition, which this file publicly imports: it is the linear zip-transducer certificate, weakened to time quadratic in the encoded input length and linear charged workspace.

Main results #

A number is at least as large as its length.

The binary length of a sum is bounded by the sum of the input lengths plus one.

A product is at most as long as its factors together.

theorem Turing.MultiTapeTM.ComputableInO.iterate_succ_eq (k n : ℕ) :
(fun (x : ℕ) => x + 1)^[k] n = n + k
theorem Turing.MultiTapeTM.ComputableTidilyInO.iterate_succ_eq (k n : ℕ) :
(fun (x : ℕ) => x + 1)^[k] n = n + k