Documentation

Complexity.Crypto.Computational.Pseudoentropy.Seed

Uniform seeds for samplable pseudoentropy pairs #

Every strict PPT sampler admits one polynomial-time deterministic evaluator driven by a uniform polynomial-length seed. SeedRealization exposes this algorithm while preserving the pair's exact finite joint law. Its output is the finite mathematical view used for entropy accounting.

The entropy chain rule accounts for every seed bit, including coins unused by the sampler: H(observation) + H(bit | observation) + H(seed | observation, bit) = seed length. Thus the third source in the later extraction argument retains the unused randomness too. The seed also bounds the information in a single outcome, giving an explicit exponential concentration bound for independent repetitions of the pair.

Main definitions #

Main results #

References #

Adapted from Crypto/Computational/Pseudoentropy/Seed.lean on the cslib crypto branch at 5ff69ca93402e7c947208dc56396d6d86203ccd8, using the existing typed saved-coin evaluator and tidy machine certificates. Positive pseudoentropy gaps and extraction remain separate developments.

A sampler's PPT certificate supplies an efficiently computed bound on every possible public observation. Impossible values in its finite observation type need no size bound.

A plain polynomial-time evaluator from a uniform seed, with all input bits counted.

Instances For

    A strict PPT sampler supplies an efficient uniform-seed realization with no additional computability or sampling assumption.

    theorem Cslib.Crypto.Pseudoentropy.SamplablePair.SeedRealization.exists_supported_output {pair : SamplablePair} (seed : pair.SeedRealization) (n : ℕ) {word : List Bool} (hlength : word.length = seed.length n) :
    ∃ output ∈ (pair.joint n).support, ((pair.encode n) output.1, output.2) = seed.evaluate n word

    Every well-formed seed produces an outcome in the support of the original finite law.

    theorem Cslib.Crypto.Pseudoentropy.SamplablePair.SeedRealization.exists_output {pair : SamplablePair} (seed : pair.SeedRealization) (n : ℕ) (bits : Fin (seed.length n) → Bool) :
    ∃ (output : pair.Observation n × Bool), ((pair.encode n) output.1, output.2) = seed.evaluate n (List.ofFn bits)

    Every well-formed seed produces an encoded observation and bit in the original finite law.

    theorem Cslib.Crypto.Pseudoentropy.SamplablePair.SeedRealization.observation_length_le {pair : SamplablePair} (seed : pair.SeedRealization) (n bound : ℕ) (hbound : ∀ observation ∈ (PMF.map Prod.fst (pair.joint n)).support, ((pair.encode n) observation).length ≤ bound) {word : List Bool} (hlength : word.length = seed.length n) :
    (seed.evaluate n word).1.length ≤ bound

    A bound on supported observations also bounds the evaluator on every correctly sized seed.

    noncomputable def Cslib.Crypto.Pseudoentropy.SamplablePair.SeedRealization.output {pair : SamplablePair} (seed : pair.SeedRealization) (n : ℕ) (bits : Fin (seed.length n) → Bool) :

    The evaluator's finite mathematical output on a well-formed seed. No search over observations is run: its word representation is exactly the efficient evaluator's output.

    Instances For
      theorem Cslib.Crypto.Pseudoentropy.SamplablePair.SeedRealization.encode_output {pair : SamplablePair} (seed : pair.SeedRealization) (n : ℕ) (bits : Fin (seed.length n) → Bool) :
      ((pair.encode n) (seed.output n bits).1, (seed.output n bits).2) = seed.evaluate n (List.ofFn bits)

      The finite view preserves the evaluator's complete output, including the hidden bit.

      The uniform finite-seed presentation has the original joint law.

      Retain the complete sampler seed together with its finite output.

      Instances For

        Sample the finite mathematical view and retain every original seed bit. This relabelling has no efficiency claim; sampleWithSeed below is its efficient encoded realization.

        Instances For

          Finite uniform sampling realizes the complete latent output/seed law.

          @[simp]

          Forgetting the retained seed recovers the pair's original joint law.

          theorem Cslib.Crypto.Pseudoentropy.SamplablePair.SeedRealization.jointWithSeed_mass_ge {pair : SamplablePair} (seed : pair.SeedRealization) (n : ℕ) (result : (pair.Observation n × Bool) × (Fin (seed.length n) → Bool)) (hresult : result ∈ (seed.jointWithSeed n).support) :
          2 ^ (-↑(seed.length n)) ≤ ((seed.jointWithSeed n) result).toReal

          Keeping the seed retains its full pointwise information bound.

          An ordinary program returns the observation, label, and complete seed, including unused coins. The evaluator is the same deterministic program supplied by the sampler's certificate.

          Instances For
            theorem Cslib.Crypto.Pseudoentropy.SamplablePair.SeedRealization.eval_sampleWithSeed {pair : SamplablePair} (seed : pair.SeedRealization) (n : ℕ) :
            (seed.sampleWithSeed n).eval = PMF.map (fun (result : (pair.Observation n × Bool) × (Fin (seed.length n) → Bool)) => (((pair.encode n) result.1.1, result.1.2), List.ofFn result.2)) (seed.jointWithSeed n)

            The efficient program exactly realizes the finite joint experiment with its retained seed.

            theorem Cslib.Crypto.Pseudoentropy.SamplablePair.SeedRealization.mass_ge {pair : SamplablePair} (seed : pair.SeedRealization) (n : ℕ) (result : pair.Observation n × Bool) (hresult : result ∈ (pair.joint n).support) :
            2 ^ (-↑(seed.length n)) ≤ ((pair.joint n) result).toReal

            Every possible output has at least the probability of one complete seed.

            theorem Cslib.Crypto.Pseudoentropy.SamplablePair.SeedRealization.conditionalSurprisal_concentration {pair : SamplablePair} (seed : pair.SeedRealization) (n repetitions : ℕ) {ε : ℝ} (hε : 0 ≤ ε) :
            ((Probability.PMF.pi fun (x : Fin repetitions) => pair.joint n).toOuterMeasure {outcomes : Fin repetitions → pair.Observation n × Bool | ∑ i : Fin repetitions, Probability.PMF.surprisal (Probability.PMF.conditionalSnd (pair.joint n) (outcomes i).1) (outcomes i).2 ≤ ↑repetitions * Probability.PMF.conditionalEntropy (pair.joint n) - ε}).toReal ≤ Real.exp (-2 * ε ^ 2 / (↑repetitions * ↑(seed.length n) ^ 2))

            Independent repetitions concentrate their conditional information around the Shannon entropy of the pair. The loss accounts for the sampler's full saved seed length.

            Revealing the observation and hidden bit leaves exactly the remaining seed entropy. This identity also counts coins that the sampler never inspected.