Documentation

Complexity.Computability.Machines.Turing.MultiTape.Encodings.Basic

Word operations for encodings #

The building blocks of concrete encodings of pairs, options and lists, and their plain computability in linear time and space (Turing.MultiTapeTM.ComputableInLinearTimeAndSpace).

A word w is framed by writing each symbol b as [true, b] and appending [false]. A framed word marks its own end, so it can be followed by any word and still be read back.

Main definitions #

Main results #

theorem Turing.MultiTapeTM.ComputableTidilyInLinearTimeAndSpace.of_frame {α : Type u_1} {β : Type u_2} {encIn : α ↪ List Bool} {encOut : β ↪ List Bool} {f : α → β} (h : ∀ (a : α), encOut (f a) = frame (encIn a)) :

Framing an encoded value.

theorem Turing.MultiTapeTM.ComputableTidilyInLinearTimeAndSpace.of_unframe {α : Type u_1} {β : Type u_2} {encIn : α ↪ List Bool} {encOut : β ↪ List Bool} {f : α → β} (h : ∀ (a : α), encOut (f a) = unframe (encIn a)) :

Reading the word framed at the start of an encoded value.

theorem Turing.MultiTapeTM.ComputableTidilyInLinearTimeAndSpace.of_dropFrame {α : Type u_1} {β : Type u_2} {encIn : α ↪ List Bool} {encOut : β ↪ List Bool} {f : α → β} (h : ∀ (a : α), encOut (f a) = dropFrame (encIn a)) :

Dropping the frame at the start of an encoded value.

theorem Turing.MultiTapeTM.ComputableTidilyInLinearTimeAndSpace.of_cons_true {α : Type u_1} {β : Type u_2} {encIn : α ↪ List Bool} {encOut : β ↪ List Bool} {f : α → β} (h : ∀ (a : α), encOut (f a) = true :: encIn a) :

Prepending true to an encoded value.

theorem Turing.MultiTapeTM.ComputableTidilyInLinearTimeAndSpace.of_tail {α : Type u_1} {β : Type u_2} {encIn : α ↪ List Bool} {encOut : β ↪ List Bool} {f : α → β} (h : ∀ (a : α), encOut (f a) = (encIn a).tail) :

Dropping the first symbol of an encoded value.

theorem Turing.MultiTapeTM.ComputableTidilyInLinearTimeAndSpace.of_take_one {α : Type u_1} {β : Type u_2} {encIn : α ↪ List Bool} {encOut : β ↪ List Bool} {f : α → β} (h : ∀ (a : α), encOut (f a) = List.take 1 (encIn a)) :

Keeping just the first symbol of an encoded value.

theorem Turing.MultiTapeTM.ComputableTidilyInLinearTimeAndSpace.of_isEmpty {α : Type u_1} {encIn : α ↪ List Bool} {f : α → Bool} (h : ∀ (a : α), f a = (encIn a).isEmpty) :

Testing an encoded value for emptiness.