Documentation

CslibFrontier.Computability.Probabilistic.PPT.Extension

Extending efficient programs to all words #

An IsPPTOn input output program certificate fixes a machine on encoded inputs only. Running the same machine, with the same clock, on an arbitrary word gives a program on all words that agrees with program on every codeword input a. Its outputs on other words need not be codewords, so a polynomial-time left inverse of the output encoding turns them into typed results.

This is the step that lets a reduction receive data it cannot decode efficiently, such as an advice word holding an input-encoded value for an arbitrary encoding: the reduction passes the word to the extension, which reads it exactly as the original machine would. In the same way, a typed adversary whose input encoding is a layout of words, such as the tuple of field words enc_structure gives a record, is literally a PPT adversary on that layout run on its input's words. A word-level assumption then applies to it directly, with no congruence argument for the game it plays.

Main results #

theorem Cslib.Probability.IsPPTOn.exists_extension {α β : Type} {input : α ↪ List Bool} {output : β ↪ List Bool} {program : α → ProbComp β} (h : IsPPTOn input output program) {decode : List Bool → β} (hdecode : Turing.MultiTapeTM.ComputableInPolyTime decode Turing.MultiTapeTM.encBits output) (hleft : ∀ (b : β), decode (output b) = b) :
∃ (extension : List Bool → ProbComp β), IsPPTOn Turing.MultiTapeTM.encBits output extension ∧ ∀ (a : α), (extension (input a)).eval = (program a).eval

Extension to all words. A uniform strict PPT program on encoded inputs extends to a uniform strict PPT program on all words that agrees with it on every codeword, given a polynomial-time left inverse decode of the output encoding. The extension runs the original machine; on words outside the range of input its results are whatever decode makes of the machine's output.

theorem Cslib.Probability.IsPPTOn.exists_bool_extension {α : Type} {input : α ↪ List Bool} {program : α → ProbComp Bool} (h : IsPPTOn input Turing.MultiTapeTM.encBool program) :
∃ (extension : List Bool → ProbComp Bool), IsPPTOn Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBool extension ∧ ∀ (a : α), (extension (input a)).eval = (program a).eval

Extension of a Boolean program to all words. A uniform strict PPT program with a Boolean answer extends to a uniform strict PPT program on all words that agrees with it on every codeword. The extension tests whether the original machine outputs [true]. This is how a typed distinguisher is compared with one quantified over words.

theorem Cslib.Probability.IsPPTOn.exists_factor {α β : Type} {input : α ↪ List Bool} {output : β ↪ List Bool} {γ : Type} {words : γ ↪ List Bool} {toWords : α → γ} (hinput : ∀ (a : α), input a = words (toWords a)) {program : α → ProbComp β} (h : IsPPTOn input output program) {decode : List Bool → β} (hdecode : Turing.MultiTapeTM.ComputableInPolyTime decode Turing.MultiTapeTM.encBits output) (hleft : ∀ (b : β), decode (output b) = b) :
∃ (W : γ → ProbComp β), IsPPTOn words output W ∧ ∀ (a : α), program a = W (toWords a)

Factoring through a word layout. Suppose every input's codeword input a is the codeword words (toWords a) of a value of a coarser type γ, such as the tuple of words of a structure whose fields are encoded words. Then a uniform strict PPT program on α is a uniform strict PPT program W on γ precomposed with toWords, given a polynomial-time left inverse of the output encoding. Off the range of toWords, W runs the extension (exists_extension).

The equation program a = W (toWords a) is literal, not distributional, so a client can replace a typed adversary by W in any game without a congruence argument for that game.

theorem Cslib.Probability.IsPPTOn.exists_bool_factor {α : Type} {input : α ↪ List Bool} {γ : Type} {words : γ ↪ List Bool} {toWords : α → γ} (hinput : ∀ (a : α), input a = words (toWords a)) {program : α → ProbComp Bool} (h : IsPPTOn input Turing.MultiTapeTM.encBool program) :
∃ (W : γ → ProbComp Bool), IsPPTOn words Turing.MultiTapeTM.encBool W ∧ ∀ (a : α), program a = W (toWords a)

Factoring a Boolean program through a word layout. exists_factor for a Boolean program, which needs no decoder. This is how a typed distinguisher becomes a distinguisher on words: the word distinguisher W run on toWords a is the typed one at a.