Samplable pseudoentropy pairs #
A pair consists of a public observation and a hidden bit. The observation has a finite type at each parameter and an injective word encoding, so its conditional entropy is unambiguous. A strict PPT sampler realizes the joint law exactly.
SamplablePair.HasGap says that every uniform PPT predictor, playing
Cslib.Crypto.predictionExperiment on a draw (x, b) of the pair, eventually has signed
correlation at most 1 - H(b | x) - gap. This is the entropy threshold used in the OWF-to-PRG
construction; merely being hard to predict is not sufficient.
Predictors are typed: a SamplablePair.Predictor reads the security parameter and an observation
of pair.Observation n. Encodings appear only in SamplablePair.Predictor.IsPPT, whose machine
reads (1ⁿ, encode n x).
SamplablePair.HasGapWithAdvice gives every predictor an advice word from a fixed family. The
extraction and generator theorems built on this module are stated relative to such a family; their
uniform cases follow at empty advice from hasGap_iff_hasGapWithAdvice_nil and
computationallyIndistinguishable_iff_indistinguishableWithAdvice_nil.
SamplablePair.hasGapWithAdvice_iff_word restates the advised gap for word predictors on
encAdvisedInput in the word game predictionGame, the form used by the word-level extraction
pipeline. Its machines read the same words as the typed ones (encAdvisedPredictorInput).
This interface records the joint law and its sampler. The shared saved-coin interface exposes a strict PPT sampler's fair-bit tape as a uniform seed, including unused randomness.
Main definitions #
Cslib.Crypto.Pseudoentropy.SamplablePair: a finite joint law with a uniform strict PPT sampler.Cslib.Crypto.Pseudoentropy.SamplablePair.Predictor,Cslib.Crypto.Pseudoentropy.SamplablePair.AdvisedPredictor: typed predictors and theirIsPPTpredicates.Cslib.Crypto.Pseudoentropy.SamplablePair.HasGap: the conditional-entropy prediction threshold.Cslib.Crypto.Pseudoentropy.SamplablePair.HasGapWithAdvice: the same threshold against predictors given one fixed advice family.Cslib.Crypto.Pseudoentropy.predictionGame: the word prediction game of a word sampler.Cslib.Crypto.Pseudoentropy.encLabeledSamples: the encoding of a list of labeled samples.
Main results #
Cslib.Crypto.Pseudoentropy.isPPTOn_predictionGame: the word prediction game is strict PPT.Cslib.Crypto.Pseudoentropy.SamplablePair.eval_latentSample: recover the exact latent joint law.Cslib.Crypto.Pseudoentropy.SamplablePair.hasGapWithAdvice_iff_word: the advised gap is the same assumption against word predictors in the word game.Cslib.Crypto.Pseudoentropy.SamplablePair.hasGap_iff_hasGapWithAdvice_nil: the uniform gap is the empty-advice case.Cslib.Crypto.Pseudoentropy.SamplablePair.HasGapWithAdvice.eventually_error_ge,Cslib.Crypto.Pseudoentropy.SamplablePair.HasGap.eventually_error_ge: prediction error bounds.Cslib.Crypto.Pseudoentropy.SamplablePair.HasGapWithAdvice.eventually_entropy_add_gap_le_one,Cslib.Crypto.Pseudoentropy.SamplablePair.HasGap.eventually_entropy_add_gap_le_one: the threshold forced by an independent fair-bit predictor.
References #
- T. Holenstein, Pseudorandom Generators from One-Way Functions: A Simple Construction for Any Hardness, Definitions 3 and 4. We use a sampler presentation and uniform strict PPT predictors. Signed correlation is twice success probability minus one.
Adapted from Crypto/Computational/Pseudoentropy/Basic.lean on the cslib crypto branch at
5ff69ca93402e7c947208dc56396d6d86203ccd8, using the shared nonnegative game API and tidy machine
certificates. Existence of a pair with a positive gap is a separate security theorem.
The word prediction game: Cslib.Crypto.predictionExperiment on a word sampler of
observation words and hidden bits.
The complete prediction experiment is strict PPT whenever the sampler and predictor are.
The tuple of the fields of encAdvisedParameter.
The encoding of an advised parameter: (1ⁿ, advice), as in encAdvisedInput.
A finite joint law together with its exact strict PPT word sampler.
The public information available at each parameter.
Its alphabet is finite, without requiring a computable enumeration.
Encoding preserves all the public information.
The public observation and hidden bit.
A word-level sampler with the strict fair-coin realization certified below.
- efficient : Probability.IsPPTOn Turing.MultiTapeTM.encUnary (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBool) self.sample
Its complete running time is bounded by one polynomial.
- eval_sample (n : ℕ) : (self.sample n).eval = PMF.map (fun (pair : self.Observation n × Bool) => ((self.encode n) pair.1, pair.2)) (self.joint n)
The sampler realizes the finite joint law exactly.
Recover the latent draw by relabelling the existing sampler. This is a mathematical program, with no efficiency claim for decoding arbitrary observation encodings.
The recovered sample has exactly the joint law, including its hidden label.
Typed predictors #
The input of a uniform predictor: the security parameter and an observation.
- parameter : ℕ
The security parameter, given to machines in unary.
- observation : pair.Observation self.parameter
The observation at this parameter.
The tuple of the fields of encPredictorInput.
The encoding of a predictor input: (1ⁿ, encode n x).
The input of an advised predictor: the security parameter, the advice word and an observation.
- observation : pair.Observation self.parameter
The observation at this parameter.
The tuple of the fields of encAdvisedPredictorInput.
The encoding of an advised predictor input: ((1ⁿ, advice), encode n x), the layout of
encAdvisedInput.
A uniform predictor: given the security parameter and an observation, guess the hidden bit.
Predictor.IsPPT states its efficiency on encodings.
An advised predictor: a predictor that also reads an advice word. AdvisedPredictor.IsPPT
states its efficiency on encodings.
A predictor is PPT when one uniform strict PPT machine reads encPredictorInput.
An advised predictor is PPT when one uniform strict PPT machine reads
encAdvisedPredictorInput.
A uniform PPT predictor is a PPT advised predictor that ignores its advice.
A PPT advised predictor run on empty advice is a uniform PPT predictor.
The prediction gap #
Every uniform PPT predictor stays below the conditional-entropy threshold by this gap: drawing
(x, b) from the pair and giving the predictor x, its signed correlation with b is eventually
at most 1 - H(b | x) - gap. The threshold beyond which the inequality holds may depend on the
predictor.
The prediction gap relative to fixed advice: every uniform strict PPT predictor that also
reads the advice word advice n stays below the conditional-entropy threshold by gap. The advice
family is not bounded here; its length is charged to the predictor's clock. With empty advice this
is HasGap (hasGap_iff_hasGapWithAdvice_nil).
The word prediction game on the pair's sampler is the prediction experiment on its latent draw, with the predictor reading the observation's encoding.
HasGapWithAdvice is the word-level advised gap. Quantifying over word predictors that
read ((1ⁿ, advice), encode n x) with one uniform strict PPT machine on encAdvisedInput, in the
word game predictionGame, gives the same assumption as quantifying over typed advised predictors.
A typed predictor's machine reads exactly that layout; conversely, a word predictor is typed by
encoding its observation, and a typed one is a word predictor on that layout run on the encoded
observation (IsPPTOn.exists_bool_factor), since its output is a single bit.
The uniform gap is the empty-advice case. A uniform predictor is an advice predictor that ignores its advice, and an advice predictor run on empty advice is a uniform predictor.
A smaller requested gap follows from any larger proved gap, with the same advice.
The pseudoentropy threshold relative to fixed advice equivalently lower-bounds each efficient advised predictor's error.
The pseudoentropy threshold equivalently lower-bounds each efficient predictor's error.
A fair-bit predictor has zero correlation, so entropy plus the prediction gap relative to fixed advice cannot eventually exceed one.
A fair-bit predictor has zero correlation, so entropy plus the prediction gap cannot eventually exceed one.
A smaller requested gap follows from any larger proved gap.
A list of labeled samples (x, b), such as repeated draws of SamplablePair.sample: each
sample is an observation word x paired with its label bit b, with x framed. The samples are
framed and concatenated in order.