Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.Complexity.Primitives

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 #

Main results #

Unary numbers #

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

    Equality #

    The result of comparing words, from the state after the last step.

    theorem Turing.MultiTapeTM.ComputableTidilyInDegree.eq {α : Type} [DecidableEq α] (enc : α ↪ List Bool) :
    ComputableTidilyInDegree (fun (p : α × α) => decide (p.1 = p.2)) (encPair enc enc) encBool 2 0

    Equality, for any encoding.