Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.Complexity.InSpace.InputBit

Reading the input at a stored position #

The basic accessor for bodies of Turing.MultiTapeTM.ComputableInSpace.loopWith: the bit of the input at a position held in the registers. It is the logspace lookup Turing.MultiTapeTM.computableInLogSpace_bitsGetElem? after the logspace map that swaps the index and the input, in context form by Turing.MultiTapeTM.ComputableInLogSpace.inSpace_context, since its value has constant length.

Main results #

⌊log₂⌋ of the length of a word, within logarithmic space.

theorem Turing.MultiTapeTM.ComputableInSpace.inputBit {α : Type} (encA : α ↪ List Bool) :
ComputableInSpace (fun (p : ℕ × α) => (encA p.2)[p.1]?) (encPair encNat encA) (encOption encBool) fun (p : ℕ × α) => (encNat p.1).length + (encA p.2).length.log2

Reading the input at a stored position. The bit of the encoded input a at the position i, none past its end, as a function of the stored binary index and the input, within the binary length of the index plus the logarithm of the length of the input. The index is the first component, so this is a part of a body of Turing.MultiTapeTM.ComputableInSpace.loopWith that reads the input where its registers point.