Documentation

Complexitylib.Classes.P.DataEncode.Internal.Write

Writing encodings in polynomial time — proof internals #

The fold behind Complexitylib.Classes.P.DataEncode. DataEncode writes a list of bits as its entries' encodings between a leading false and a trailing true, and a bit's encoding is 01 for false and 0011 for true. The part between the brackets, encodeBody, is built by a fold that puts one bit's encoding in front of the encoding of the rest, so its state is at most four times as long as the list.

Contents #

The encodings of a list's bits, run together: the encoding of the list without its two brackets.

Equations
Instances For

    A list's encoding is its body between a leading false and a trailing true.

    The body is at most four bits per entry.

    theorem Complexity.encodeBody_mem_FP {a : List Bool → List Bool} (ha : a ∈ FP) :
    (fun (z : List Bool) => encodeBody (a z)) ∈ FP

    Writing the body is polynomial-time. It is a fold over the list that puts 01 or 0011 in front of the body of the rest.