Total decoders with plain degree certificates #
A decoder is total on every word, inverts its encoding, and carries independent cost and encoded output degrees. The basic constructors preserve totality and the round-trip law.
Main definitions #
Turing.MultiTapeTM.Decoder: total decoding with independent cost and output degrees.Turing.MultiTapeTM.Decoder.computableInPolyTime: the ordinary polynomial-time certificate.Turing.MultiTapeTM.Decoder.bits,.unary,.bool,.option,.pair,.map: basic decoders.
Main results #
Turing.MultiTapeTM.Decoder.option_computableInDegree: option decoding preserves the supplied output degree, including zero, with cost degreemax 1 (max d e).
A total decoder with polynomial cost and encoded-output growth on every input word.
The decoded value of any word.
Decoding inverts the encoding.
- computable : ∃ (d : ℕ) (e : ℕ), ComputableInDegree self.decode encBits enc d e
Decoding has independent cost and encoded-output degrees, including zero.
Instances For
Bit strings are their own encoding.
Instances For
Unary numbers are decoded by the length of the word.
Instances For
Booleans are decoded from the first symbol.
Instances For
theorem Turing.MultiTapeTM.Decoder.option_computableInDegree {α : Type} {enc : α ↪ List Bool} (D : Decoder enc) {d e : ℕ} (hD : ComputableInDegree D.decode encBits enc d e) :
Option decoding preserves any supplied encoded-output degree, including zero. Its cost accounts for reading the input, running the decoder, and emitting the tagged decoded output.