List functions in polynomial time for the repeated tailored verifier #
The pure stages of the repeated programs (issue #280) cut questions and answers into blocks and
put the coordinates' outputs together. The functions they need, as PolyTimeFuns:
theorem
MIPRE.Tailored.RepProg.esize_drop_le
{α : Type u_1}
[Cost.SizedEncoding α]
(l : List α)
(n : ℕ)
:
theorem
MIPRE.Tailored.RepProg.esize_take_le
{α : Type u_1}
[Cost.SizedEncoding α]
(l : List α)
(n : ℕ)
:
Concatenation #
noncomputable def
MIPRE.Tailored.RepProg.flattenF
{α : Type u_1}
[Cost.SizedEncoding α]
:
Cost.PolyTimeFun (List (List α)) (List α)
The concatenation of a list of lists.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem
MIPRE.Tailored.RepProg.flattenF_apply
{α : Type u_1}
[Cost.SizedEncoding α]
(l : List (List α))
:
Blocks of equal length #
The k blocks of s elements of l: its i-th block is chunk s i l.
Equations
- MIPRE.Tailored.RepProg.blocks l s k = List.ofFn fun (i : Fin k) => MIPRE.Cost.Data.chunk s (↑i) l
Instances For
@[simp]
theorem
MIPRE.Tailored.RepProg.length_blocks
{α : Type u_1}
[Cost.SizedEncoding α]
(l : List α)
(s k : ℕ)
:
noncomputable def
MIPRE.Tailored.RepProg.dropStepF
{α : Type u_1}
[Cost.SizedEncoding α]
:
Cost.PolyTimeFun (List α × Cost.Unary) (List α × Cost.Unary)
The step of the block cutter: drop a block.
Equations
Instances For
@[simp]
theorem
MIPRE.Tailored.RepProg.dropStepF_apply
{α : Type u_1}
[Cost.SizedEncoding α]
(p : List α × Cost.Unary)
:
theorem
MIPRE.Tailored.RepProg.iterate_dropStepF
{α : Type u_1}
[Cost.SizedEncoding α]
(p : List α × Cost.Unary)
(i : ℕ)
:
noncomputable def
MIPRE.Tailored.RepProg.blocksF
{α : Type u_1}
[Cost.SizedEncoding α]
:
Cost.PolyTimeFun ((List α × Cost.Unary) × Cost.Unary) (List (List α))
The k blocks of s elements, with s and k in unary.
Equations
- One or more equations did not get rendered due to their size.
Instances For
@[simp]
theorem
MIPRE.Tailored.RepProg.blocksF_apply
{α : Type u_1}
[Cost.SizedEncoding α]
(l : List α)
(us uk : Cost.Unary)
:
Consecutive pieces of given lengths #
l cut into consecutive pieces of the lengths ns; the pieces past the end of l are
short or empty.
Equations
- MIPRE.Tailored.RepProg.cut l [] = []
- MIPRE.Tailored.RepProg.cut l (n :: ns) = List.take n l :: MIPRE.Tailored.RepProg.cut (List.drop n l) ns