Documentation

CslibFrontier.Crypto.Computational.InaccessibleEntropy.Repetition

Gap amplification for inaccessible entropy via parallel repetition #

Given a deterministic function $f_0 : \alpha \to \beta$ on a finite uniform domain $\alpha$, its $t$-fold direct product $f_0^t : (\mathrm{Fin}\;t \to \alpha) \to (\mathrm{Fin}\;t \to \beta)$ (repHashFin t f₀) multiplies preimage fiber sizes across coordinates, turning realSampleEntropy and $\log_2 |L_0^t(z)|$ (repAccessibleSet t L₀) into sums of $t$ independent bounded coordinate scores. Following [HHRVW2020], Section 5.1.1, Lemma 5.3 (pp. 26–27):

  1. Real-entropy concentration (repHashFin_realSampleEntropy_le_prob, Lemma 5.3(i), p. 26): by Hoeffding's lower-tail bound (PMF.pi_sum_le_mean_sub), realSampleEntropy (repHashFin t f₀) falls below $t \cdot H(X \mid f_0(X)) - \Delta$ with probability at most $\exp(-2 \Delta^2 / (t B^2))$ whenever $\log_2 |\alpha| \le B$.
  2. Accessible-set concentration (repAccessibleSet_logb_card_ge_prob, Lemma 5.3(ii), Equation (5.1), p. 27): by Hoeffding's upper-tail bound (PMF.pi_sum_ge_mean_add), $\log_2 |L_0^t(z)|$ exceeds $t \cdot \mathbb{E}[\log_2 |L_0(X)|] + \Delta$ with probability at most $\exp(-2 \Delta^2 / (t B^2))$.
  3. Planted-coordinate escape reduction (repEscapeInverter, isPPT_repEscapeInverter, repEscape_le_dyadicSize_mul_escape, Lemma 5.3(ii), pp. 26–27): planting a single challenge input at a uniformly sampled dyadic index (ProbComp.sampleDyadicIndex) via BitString.replaceRow (BitString.uniformList_replaceRow) reduces escaping $L_0^t$ to escaping $L_0$ with concrete multiplicative loss dyadicSize (t n) ≤ 2 * (t n + 1).

Main definitions #

Main results #

References #

Finite $t$-fold direct product and product accessible sets #

def Cslib.Crypto.repHashFin (t : ℕ) {α : Type u_1} {β : Type u_2} (f₀ : α → β) (z : Fin t → α) :
Fin t → β

Finite $t$-fold direct product $f_0^t(z)_i = f_0(z_i)$ ([HHRVW2020], Section 5.1.1, Lemma 5.3, p. 26).

def Cslib.Crypto.repAccessibleSet (t : ℕ) {α : Type u_1} (L₀ : α → Finset α) (z : Fin t → α) :
Finset (Fin t → α)

Product accessible set $L_0^t(z) = \prod_{i < t} L_0(z_i)$ ([HHRVW2020], Section 5.1.1, p. 27).

@[simp]
theorem Cslib.Crypto.mem_repAccessibleSet {t : ℕ} {α : Type u_1} (L₀ : α → Finset α) (z z' : Fin t → α) :
z' ∈ repAccessibleSet t L₀ z ↔ ∀ (i : Fin t), z' i ∈ L₀ (z i)
theorem Cslib.Crypto.self_mem_repAccessibleSet {t : ℕ} {α : Type u_1} {L₀ : α → Finset α} (hself : ∀ (x : α), x ∈ L₀ x) (z : Fin t → α) :
theorem Cslib.Crypto.fiberSet_repHashFin (t : ℕ) {α : Type u_1} {β : Type u_2} [Fintype α] [DecidableEq β] (f₀ : α → β) (y : Fin t → β) :
fiberSet (repHashFin t f₀) y = Fintype.piFinset fun (i : Fin t) => fiberSet f₀ (y i)
theorem Cslib.Crypto.repAccessibleSet_subset_fiber {t : ℕ} {α : Type u_1} {β : Type u_2} [Fintype α] [DecidableEq β] {f₀ : α → β} {L₀ : α → Finset α} (hsub : ∀ (x : α), L₀ x ⊆ fiberSet f₀ (f₀ x)) (z : Fin t → α) :
repAccessibleSet t L₀ z ⊆ fiberSet (repHashFin t f₀) (repHashFin t f₀ z)
theorem Cslib.Crypto.card_fiberSet_repHashFin (t : ℕ) {α : Type u_1} {β : Type u_2} [Fintype α] [DecidableEq β] (f₀ : α → β) (y : Fin t → β) :
(fiberSet (repHashFin t f₀) y).card = ∏ i : Fin t, (fiberSet f₀ (y i)).card
theorem Cslib.Crypto.card_repAccessibleSet (t : ℕ) {α : Type u_1} (L₀ : α → Finset α) (z : Fin t → α) :
(repAccessibleSet t L₀ z).card = ∏ i : Fin t, (L₀ (z i)).card
theorem Cslib.Crypto.realSampleEntropy_repHashFin (t : ℕ) {α : Type u_1} {β : Type u_2} [Fintype α] [DecidableEq β] (f₀ : α → β) (z : Fin t → α) :
realSampleEntropy (repHashFin t f₀) z = ∑ i : Fin t, realSampleEntropy f₀ (z i)

Real sample entropy is additive across independent coordinates of repHashFin.

theorem Cslib.Crypto.logb_card_repAccessibleSet (t : ℕ) {α : Type u_1} {L₀ : α → Finset α} (hne : ∀ (x : α), (L₀ x).Nonempty) (z : Fin t → α) :
Real.logb 2 ↑(repAccessibleSet t L₀ z).card = ∑ i : Fin t, Real.logb 2 ↑(L₀ (z i)).card

Accessible log-cardinality is additive across coordinates when every $L_0(x)$ is nonempty.

Hoeffding concentration bounds (Lemma 5.3(i)–(ii)) #

theorem Cslib.Crypto.repHashFin_realSampleEntropy_le_prob (t : ℕ) {α : Type u_1} {β : Type u_2} [Fintype α] [Nonempty α] [Finite β] [DecidableEq β] (f₀ : α → β) {B Δ : ℝ} (hB_nonneg : 0 ≤ B) (hB : Real.logb 2 ↑(Fintype.card α) ≤ B) (hΔ : 0 ≤ Δ) :

[HHRVW2020], Section 5.1.1, Lemma 5.3(i) (p. 26): under uniform sampling on $\mathrm{Fin}\;t \to \alpha$, realSampleEntropy (repHashFin t f₀) falls below $t \cdot H(X \mid f_0(X)) - \Delta$ with probability at most $\exp(-2 \Delta^2 / (t B^2))$.

theorem Cslib.Crypto.repAccessibleSet_logb_card_ge_prob (t : ℕ) {α : Type u_1} [Fintype α] [Nonempty α] (L₀ : α → Finset α) (hself : ∀ (x : α), x ∈ L₀ x) {B Δ : ℝ} (hB_nonneg : 0 ≤ B) (hB : Real.logb 2 ↑(Fintype.card α) ≤ B) (hΔ : 0 ≤ Δ) :
((Probability.PMF.uniformOfFintype (Fin t → α)).toOuterMeasure {z : Fin t → α | ↑t * accessibleSetExpectation L₀ + Δ ≤ Real.logb 2 ↑(repAccessibleSet t L₀ z).card}).toReal ≤ Real.exp (-2 * Δ ^ 2 / (↑t * B ^ 2))

[HHRVW2020], Section 5.1.1, Lemma 5.3(ii), Equation (5.1) (p. 27): when $x \in L_0(x) \subseteq \alpha$ for all $x$, $\log_2 |L_0^t(z)|$ exceeds $t \cdot \mathbb{E}[\log_2 |L_0(X)|] + \Delta$ with probability at most $\exp(-2 \Delta^2 / (t B^2))$.

Word-level evaluator and flat BitString bridge #

def Cslib.Crypto.repEvalWord (t inLen₀ : ℕ) (evalWord₀ : List Bool → List Bool) (w : List Bool) :

Word-level evaluator of the $t$-fold parallel repetition: slice w into t rows of width inLen₀, evaluate evalWord₀ on each row, and concatenate the outputs.

Plain polynomial-time certificate for repEvalWord when t, inLen₀, and n are supplied in unary.

theorem Cslib.Crypto.length_repEvalWord {t inLen₀ outLen₀ : ℕ} {evalWord₀ : List Bool → List Bool} (hlen : ∀ (u : List Bool), u.length = inLen₀ → (evalWord₀ u).length = outLen₀) (w : List Bool) :
(repEvalWord t inLen₀ evalWord₀ w).length = t * outLen₀
theorem Cslib.Crypto.listRow_repEvalWord {t inLen₀ outLen₀ : ℕ} {evalWord₀ : List Bool → List Bool} (hlen : ∀ (u : List Bool), u.length = inLen₀ → (evalWord₀ u).length = outLen₀) (w : List Bool) {j : ℕ} (hj : j < t) :
BitString.listRow outLen₀ j (repEvalWord t inLen₀ evalWord₀ w) = evalWord₀ (BitString.listRow inLen₀ j w)
theorem Cslib.Crypto.wordToFinMap_repEvalWord {t inLen₀ outLen₀ : ℕ} {evalWord₀ : List Bool → List Bool} (hlen : ∀ (u : List Bool), u.length = inLen₀ → (evalWord₀ u).length = outLen₀) (z : BitString (t * inLen₀)) :
wordToFinMap (t * inLen₀) (t * outLen₀) (repEvalWord t inLen₀ evalWord₀) z = BitString.blocksEquiv.symm (repHashFin t (wordToFinMap inLen₀ outLen₀ evalWord₀) (BitString.blocksEquiv z))

Exact agreement between wordToFinMap of repEvalWord and repHashFin conjugated by BitString.blocksEquiv.

def Cslib.Crypto.repBitAccessibleSet (t inLen₀ : ℕ) (L₀ : BitString inLen₀ → Finset (BitString inLen₀)) (z : BitString (t * inLen₀)) :
Finset (BitString (t * inLen₀))

Flat BitString (t * inLen₀) view of repAccessibleSet t L₀.

@[simp]
theorem Cslib.Crypto.mem_repBitAccessibleSet {t inLen₀ : ℕ} (L₀ : BitString inLen₀ → Finset (BitString inLen₀)) (z z' : BitString (t * inLen₀)) :
z' ∈ repBitAccessibleSet t inLen₀ L₀ z ↔ ∀ (i : Fin t), BitString.blocksEquiv z' i ∈ L₀ (BitString.blocksEquiv z i)
@[simp]
theorem Cslib.Crypto.card_repBitAccessibleSet (t inLen₀ : ℕ) (L₀ : BitString inLen₀ → Finset (BitString inLen₀)) (z : BitString (t * inLen₀)) :
theorem Cslib.Crypto.self_mem_repBitAccessibleSet {t inLen₀ : ℕ} {L₀ : BitString inLen₀ → Finset (BitString inLen₀)} (hself : ∀ (x : BitString inLen₀), x ∈ L₀ x) (z : BitString (t * inLen₀)) :
z ∈ repBitAccessibleSet t inLen₀ L₀ z
theorem Cslib.Crypto.repBitAccessibleSet_subset_fiber {t inLen₀ outLen₀ : ℕ} {evalWord₀ : List Bool → List Bool} (hlen : ∀ (u : List Bool), u.length = inLen₀ → (evalWord₀ u).length = outLen₀) {L₀ : BitString inLen₀ → Finset (BitString inLen₀)} (hsub : ∀ (x : BitString inLen₀), L₀ x ⊆ fiberSet (wordToFinMap inLen₀ outLen₀ evalWord₀) (wordToFinMap inLen₀ outLen₀ evalWord₀ x)) (z : BitString (t * inLen₀)) :
repBitAccessibleSet t inLen₀ L₀ z ⊆ fiberSet (wordToFinMap (t * inLen₀) (t * outLen₀) (repEvalWord t inLen₀ evalWord₀)) (wordToFinMap (t * inLen₀) (t * outLen₀) (repEvalWord t inLen₀ evalWord₀) z)
theorem Cslib.Crypto.realSampleEntropy_wordToFinMap_repEvalWord {t inLen₀ outLen₀ : ℕ} {evalWord₀ : List Bool → List Bool} (hlen : ∀ (u : List Bool), u.length = inLen₀ → (evalWord₀ u).length = outLen₀) (z : BitString (t * inLen₀)) :
realSampleEntropy (wordToFinMap (t * inLen₀) (t * outLen₀) (repEvalWord t inLen₀ evalWord₀)) z = realSampleEntropy (repHashFin t (wordToFinMap inLen₀ outLen₀ evalWord₀)) (BitString.blocksEquiv z)
theorem Cslib.Crypto.repEvalWord_realSampleEntropy_le_prob {t inLen₀ outLen₀ : ℕ} {evalWord₀ : List Bool → List Bool} (hlen : ∀ (u : List Bool), u.length = inLen₀ → (evalWord₀ u).length = outLen₀) {Δ : ℝ} (hΔ : 0 ≤ Δ) :
have f₀ := wordToFinMap inLen₀ outLen₀ evalWord₀; have f₁ := wordToFinMap (t * inLen₀) (t * outLen₀) (repEvalWord t inLen₀ evalWord₀); ((Probability.PMF.uniformOfFintype (BitString (t * inLen₀))).toOuterMeasure {z : BitString (t * inLen₀) | realSampleEntropy f₁ z ≤ ↑t * Probability.PMF.conditionalEntropy (PMF.map (fun (x : BitString inLen₀) => (f₀ x, x)) (Probability.PMF.uniformOfFintype (BitString inLen₀))) - Δ}).toReal ≤ Real.exp (-2 * Δ ^ 2 / (↑t * ↑inLen₀ ^ 2))

Flat BitString lower-tail Hoeffding bound for repEvalWord ([HHRVW2020], Lemma 5.3(i), p. 26).

theorem Cslib.Crypto.repBitAccessibleSet_logb_card_ge_prob (t inLen₀ : ℕ) (L₀ : BitString inLen₀ → Finset (BitString inLen₀)) (hself : ∀ (x : BitString inLen₀), x ∈ L₀ x) {Δ : ℝ} (hΔ : 0 ≤ Δ) :
((Probability.PMF.uniformOfFintype (BitString (t * inLen₀))).toOuterMeasure {z : BitString (t * inLen₀) | ↑t * accessibleSetExpectation L₀ + Δ ≤ Real.logb 2 ↑(repBitAccessibleSet t inLen₀ L₀ z).card}).toReal ≤ Real.exp (-2 * Δ ^ 2 / (↑t * ↑inLen₀ ^ 2))

Flat BitString upper-tail Hoeffding bound for repBitAccessibleSet ([HHRVW2020], Lemma 5.3(ii), Equation (5.1), p. 27).

Planted-coordinate escape reduction (Lemma 5.3(ii)) #

noncomputable def Cslib.Crypto.repEscapeInverter (t inLen₀ : ℕ → ℕ) (A : ℕ → List Bool → ProbComp (List Bool)) (n : ℕ) (xWord : List Bool) :

Planted-coordinate escape reduction ([HHRVW2020], Section 5.1.1, Lemma 5.3(ii), pp. 26–27): sample an exact dyadic index idx < dyadicSize (t n), plant the single-coordinate challenge xWord.take (inLen₀ n) into row idx of a uniform (t n * inLen₀ n)-bit dummy word, run A, and extract row idx of A's output.

theorem Cslib.Crypto.repEscape_le_dyadicSize_mul_escape (t inLen₀ outLen₀ : ℕ → ℕ) (evalWord₀ : ℕ → List Bool → List Bool) (L₀ : (n : ℕ) → BitString (inLen₀ n) → Finset (BitString (inLen₀ n))) (A : ℕ → List Bool → ProbComp (List Bool)) (n : ℕ) (hlen : ∀ (u : List Bool), u.length = inLen₀ n → (evalWord₀ n u).length = outLen₀ n) :
↑(Game.succProbability (accessibleEscapeGame (fun (k : ℕ) => repEvalWord (t k) (inLen₀ k) (evalWord₀ k)) (fun (k : ℕ) => t k * inLen₀ k) (fun (k : ℕ) => repBitAccessibleSet (t k) (inLen₀ k) (L₀ k)) A n).eval) ≤ ↑(Probability.dyadicSize (t n)) * ↑(Game.succProbability (accessibleEscapeGame evalWord₀ inLen₀ L₀ (repEscapeInverter t inLen₀ A) n).eval)

[HHRVW2020], Section 5.1.1, Lemma 5.3(ii) (pp. 26–27): for any adversary A, escaping repBitAccessibleSet (t n) in accessibleEscapeGame occurs with probability at most dyadicSize (t n) times the single-coordinate escape probability of repEscapeInverter t inLen₀ A.