Encodings into Data #
This file defines the class that is used to encode arbitrary data structures into Data,
so that RTMs (rose tree machines) can operate on them.
Instances are provided for convenience for Data itself, Bool, List α, Option α, α × β,
and ℕ (binary encoding via List Bool)
Encoding of types into Data.
- encode : α → Data
Encode a value of
αasData. - h_inj : Function.Injective encode
The encoding is injective, so distinct values never collide.
Instances
@[implicit_reducible]
Equations
- Complexity.RoseTreeMachine.instDataEncodeData = { encode := fun (b : Complexity.RoseTreeMachine.Data) => b, h_inj := Complexity.RoseTreeMachine.instDataEncodeData._proof_2 }
@[simp]
@[implicit_reducible]
Equations
- One or more equations did not get rendered due to their size.
@[implicit_reducible]
instance
Complexity.RoseTreeMachine.instDataEncodeList
(α : Type)
[DataEncode α]
:
DataEncode (List α)
Equations
- One or more equations did not get rendered due to their size.
@[simp]
@[simp]
theorem
Complexity.RoseTreeMachine.DataEncode_list_eq_nil_iff_nil
{α : Type}
[DataEncode α]
(xs : List α)
:
@[simp]
@[implicit_reducible]
instance
Complexity.RoseTreeMachine.instDataEncodeOption
(α : Type)
[DataEncode α]
:
DataEncode (Option α)
Equations
- One or more equations did not get rendered due to their size.
@[simp]
theorem
Complexity.RoseTreeMachine.DataEncode_Option_empty
{α : Type}
[DataEncode α]
(x : Option α)
:
@[implicit_reducible]
instance
Complexity.RoseTreeMachine.instDataEncodeProd
(α β : Type)
[DataEncode α]
[DataEncode β]
:
DataEncode (α × β)
Equations
- One or more equations did not get rendered due to their size.
theorem
Complexity.RoseTreeMachine.DataEncode_pair
{α β : Type}
[DataEncode α]
[DataEncode β]
(a : α)
(b : β)
:
@[implicit_reducible]
Equations
- Complexity.RoseTreeMachine.instDataEncodeNat = { encode := fun (x : ℕ) => Complexity.RoseTreeMachine.DataEncode.encode x.bits, h_inj := Complexity.RoseTreeMachine.instDataEncodeNat._proof_1 }