Basic functions with bounds of given degrees #
Functions on unary numbers and integers, in linear time and space, and equality tests, in quadratic time and space.
Main definitions #
Turing.MultiTapeTM.encUnary: natural numbers in unary.Turing.MultiTapeTM.encIntUnary: integers in unary, as a sign bit followed by a unary magnitude.
Main results #
Turing.MultiTapeTM.ComputableTidilyInDegree.eq: equality, for any encoding.- successor, predecessor and zero test in unary, and adding one or subtracting one on unary integers.
Unary numbers #
theorem Turing.MultiTapeTM.ComputableTidilyInDegree.unary_succ :
ComputableTidilyInDegree (fun (x : ℕ) => x + 1) encUnary encUnary 1 1
theorem Turing.MultiTapeTM.ComputableTidilyInDegree.unary_pred :
ComputableTidilyInDegree (fun (x : ℕ) => x - 1) encUnary encUnary 1 1
Integers #
Integers in unary: false followed by n ones for n ≥ 0, and true followed by n
ones for -(n + 1). The code of z has z.natAbs + 1 bits when 0 ≤ z and z.natAbs bits when
z < 0; Turing.MultiTapeTM.encIntBin is the binary sign-magnitude encoding.
Instances For
@[simp]
@[simp]
@[simp]
@[simp]
theorem Turing.MultiTapeTM.ComputableTidilyInDegree.int_succ :
ComputableTidilyInDegree (fun (x : ℤ) => x + 1) encIntUnary encIntUnary 1 1
theorem Turing.MultiTapeTM.ComputableTidilyInDegree.int_pred :
ComputableTidilyInDegree (fun (x : ℤ) => x - 1) encIntUnary encIntUnary 1 1
Equality #
theorem Turing.MultiTapeTM.ComputableTidilyInDegree.eq {α : Type} [DecidableEq α] (enc : α ↪ List Bool) :
Equality, for any encoding.