Documentation

CslibFrontier.Probability.StatisticalDistance.CommitmentAmplification

Instance-Dependent Commitment Security Amplification #

This module formalizes security amplification for non-interactive instance-dependent bit-commitment schemes over finite probability mass functions (PMF):

Main definitions #

Main results #

1. Finite-PMF Instance-Dependent Commitments and Binding Probability #

structure Cslib.Probability.PMFIDCommitment (α : Type u_3) (C : Type u_4) :
Type (max u_3 u_4)

A non-interactive instance-dependent bit-commitment scheme over a commitment type C, assigning to each instance x : α and bit b : Bool a probability mass function commit x b.

  • commit : α → Bool → PMF C

    Commitment distribution on instance x and bit b.

theorem Cslib.Probability.PMFIDCommitment.ext {α : Type u_3} {C : Type u_4} {x y : PMFIDCommitment α C} (commit : x.commit = y.commit) :
x = y
theorem Cslib.Probability.PMFIDCommitment.ext_iff {α : Type u_3} {C : Type u_4} {x y : PMFIDCommitment α C} :
x = y ↔ x.commit = y.commit
noncomputable def Cslib.Probability.bindingProb {C : Type u_2} (p₀ p₁ : PMF C) :

Binding probability Pr[p₀ ∈ supp(p₁)] for probability mass functions.

theorem Cslib.Probability.bindingProb_nonneg {C : Type u_2} (p₀ p₁ : PMF C) :
0 ≤ bindingProb p₀ p₁
theorem Cslib.Probability.bindingProb_le_one {C : Type u_2} (p₀ p₁ : PMF C) :
bindingProb p₀ p₁ ≤ 1

Statistical honest-sender q-binding on YES instances of P: for every x ∈ P.yes and b : Bool, Pr[Com_x(b) ∈ supp(Com_x(!b))] ≤ q x.

theorem Cslib.Probability.PMFIDCommitment.isHonestSenderBinding_iff {α : Type u_1} {C : Type u_2} (com : PMFIDCommitment α C) (P : Complexity.PromiseProblem α) (q : α → ℝ) :
com.IsHonestSenderBinding P q ↔ ∀ x ∈ P.yes, ∀ (b : Bool), ((com.commit x b).toOuterMeasure (com.commit x !b).support).toReal ≤ q x

Statistical p-hiding on NO instances of P: for every x ∈ P.no, dist (Com_x false) (Com_x true) ≤ p x.

theorem Cslib.Probability.PMFIDCommitment.isStatisticallyHiding_iff {α : Type u_1} {C : Type u_2} [Fintype C] (com : PMFIDCommitment α C) (P : Complexity.PromiseProblem α) (p : α → ℝ) :
com.IsStatisticallyHiding P p ↔ ∀ x ∈ P.no, dist (com.commit x false) (com.commit x true) ≤ p x
theorem Cslib.Probability.one_sub_bindingProb_le_dist {C : Type u_2} [Fintype C] (p₀ p₁ : PMF C) :
1 - bindingProb p₀ p₁ ≤ dist p₀ p₁

Honest-sender q-binding implies statistical distance at least 1 - q: 1 - Pr[p₀ ∈ supp(p₁)] ≤ dist p₀ p₁.

theorem Cslib.Probability.dist_iid_le_one_sub {C : Type u_2} [Fintype C] (p₀ p₁ : PMF C) (k : ℕ) :
dist (PMF.iid p₀ k) (PMF.iid p₁ k) ≤ 1 - (1 - dist p₀ p₁) ^ k

Repetition (PMF.iid) degrades statistical distance at most to 1 - (1 - dist p₀ p₁)^k.

theorem Cslib.Probability.bindingProb_iid {C : Type u_2} [Finite C] (p₀ p₁ : PMF C) (k : ℕ) :
bindingProb (PMF.iid p₀ k) (PMF.iid p₁ k) = bindingProb p₀ p₁ ^ k

Repetition (PMF.iid) amplifies honest-sender binding exponentially: Pr[p₀^⊗k ∈ supp(p₁^⊗k)] = (Pr[p₀ ∈ supp(p₁)])^k.

theorem Cslib.Probability.bindingProb_xorMix_le {C : Type u_2} [Fintype C] (p₀ p₁ : PMF C) {k : ℕ} (hk : k ≠ 0) {q : ℝ} (hq0 : bindingProb p₀ p₁ ≤ q) (hq1 : bindingProb p₁ p₀ ≤ q) (hq_le : q ≤ 1) (c : Bool) :
bindingProb (PMF.xorMix p₀ p₁ k c) (PMF.xorMix p₀ p₁ k !c) ≤ 1 - (1 - q) ^ k

Sharing (PMF.xorMix) degrades honest-sender binding at most to 1 - (1 - q)^k: if Pr[p₀ ∈ supp(p₁)] ≤ q, Pr[p₁ ∈ supp(p₀)] ≤ q, and q ≤ 1, then for both c : Bool, Pr[xorMix p₀ p₁ k c ∈ supp(xorMix p₀ p₁ k (!c))] ≤ 1 - (1 - q)^k.

noncomputable def Cslib.Probability.PMFIDCommitment.repeatCom {α : Type u_1} {C : Type u_2} (com : PMFIDCommitment α C) (k : ℕ) :
PMFIDCommitment α (Fin k → C)

k-fold independent repetition of a finite-PMF instance-dependent commitment scheme.

noncomputable def Cslib.Probability.PMFIDCommitment.shareCom {α : Type u_1} {C : Type u_2} [Fintype C] (com : PMFIDCommitment α C) (k : ℕ) :
PMFIDCommitment α (Fin k → C)

k-fold XOR-sharing of a finite-PMF instance-dependent commitment scheme.

theorem Cslib.Probability.PMFIDCommitment.repeatCom_binding {α : Type u_1} {C : Type u_2} [Finite C] (com : PMFIDCommitment α C) (P : Complexity.PromiseProblem α) (q : α → ℝ) (k : ℕ) (hbind : com.IsHonestSenderBinding P q) :
(com.repeatCom k).IsHonestSenderBinding P fun (x : α) => q x ^ k
theorem Cslib.Probability.PMFIDCommitment.repeatCom_hiding {α : Type u_1} {C : Type u_2} [Fintype C] (com : PMFIDCommitment α C) (P : Complexity.PromiseProblem α) (p : α → ℝ) (hp1 : ∀ x ∈ P.no, p x ≤ 1) (k : ℕ) (hhid : com.IsStatisticallyHiding P p) :
(com.repeatCom k).IsStatisticallyHiding P fun (x : α) => 1 - (1 - p x) ^ k
theorem Cslib.Probability.PMFIDCommitment.shareCom_hiding {α : Type u_1} {C : Type u_2} [Fintype C] (com : PMFIDCommitment α C) (P : Complexity.PromiseProblem α) (p : α → ℝ) {k : ℕ} (hk : k ≠ 0) (hhid : com.IsStatisticallyHiding P p) :
(com.shareCom k).IsStatisticallyHiding P fun (x : α) => p x ^ k
theorem Cslib.Probability.PMFIDCommitment.shareCom_binding {α : Type u_1} {C : Type u_2} [Fintype C] (com : PMFIDCommitment α C) (P : Complexity.PromiseProblem α) (q : α → ℝ) (hq1 : ∀ x ∈ P.yes, q x ≤ 1) {k : ℕ} (hk : k ≠ 0) (hbind : com.IsHonestSenderBinding P q) :
(com.shareCom k).IsHonestSenderBinding P fun (x : α) => 1 - (1 - q x) ^ k

2. Two-Phase Greedy Doubling Security Amplification #

Elementary 2-fold commitment amplification operation: repetition or XOR-sharing.

Instances For
    @[instance_reducible]

    Action of a single ComOp on hiding/binding upper bounds (p, q).

    Action of a list of ComOps (applied left-to-right) on (p, q).

    theorem Cslib.Probability.comOpStepList_append (ops₁ ops₂ : List ComOp) (pq : ℝ × ℝ) :
    comOpStepList (ops₁ ++ ops₂) pq = comOpStepList ops₂ (comOpStepList ops₁ pq)

    Target commitment type after applying a list of 2-fold operations.

    @[instance_reducible]

    Fintype instance on ComSpace C ops.

    def Cslib.Probability.applyComOps {α : Type u_1} {C : Type u_2} [Fintype C] (ops : List ComOp) :

    Apply a list of 2-fold repetition/sharing operations to a finite-PMF commitment scheme.

    theorem Cslib.Probability.applyComOps_security {α : Type u_1} {C : Type u_2} [Fintype C] (ops : List ComOp) (com : PMFIDCommitment α C) (P : Complexity.PromiseProblem α) (p q : α → ℝ) (hp0 : ∀ (x : α), 0 ≤ p x) (hp1 : ∀ (x : α), p x ≤ 1) (hq0 : ∀ (x : α), 0 ≤ q x) (hq1 : ∀ (x : α), q x ≤ 1) (hbind : com.IsHonestSenderBinding P q) (hhid : com.IsStatisticallyHiding P p) :
    have x := fintypeComSpace ops; ((applyComOps ops com).IsHonestSenderBinding P fun (x : α) => (comOpStepList ops (p x, q x)).2) ∧ (applyComOps ops com).IsStatisticallyHiding P fun (x : α) => (comOpStepList ops (p x, q x)).1
    noncomputable def Cslib.Probability.greedyOp (pq : ℝ × ℝ) :

    Greedy choice of ComOp: apply share when q ≤ p and rep when p < q.

    Greedy Phase-1 schedule of length ≤ 2 * m stopping as soon as max p q ≤ 1/5.

    theorem Cslib.Probability.greedyPhase1_spec (m : ℕ) {p q : ℝ} (hp0 : 0 ≤ p) (hq0 : 0 ≤ q) (hsum : p + q < 1) :
    have pq' := comOpStepList (greedyPhase1 m (p, q)) (p, q); 0 ≤ pq'.1 ∧ 0 ≤ pq'.2 ∧ pq'.1 + pq'.2 < 1 ∧ (max pq'.1 pq'.2 ≤ 1 / 5 ∨ (13 / 12) ^ m * (1 - p - q) ≤ 1 - pq'.1 - pq'.2)

    Phase-1 invariant: after m pairs of greedy steps, either max p' q' ≤ 1/5 or the gap has grown by (13/12)^m.

    Phase-2 schedule: r repetitions of the pair [.share, .rep] for doubly-exponential decay.

    theorem Cslib.Probability.phase2Ops_bound (r : ℕ) {p q : ℝ} (hp0 : 0 ≤ p) (hq0 : 0 ≤ q) (hp : p ≤ 1 / 5) (hq : q ≤ 1 / 5) :
    have pq' := comOpStepList (phase2Ops r) (p, q); 0 ≤ pq'.1 ∧ pq'.1 ≤ 1 / 4 * (4 / 5) ^ 2 ^ r ∧ 0 ≤ pq'.2 ∧ pq'.2 ≤ 1 / 4 * (4 / 5) ^ 2 ^ r
    theorem Cslib.Probability.amplifyCommitment_exists {p q g η : ℝ} (hp0 : 0 ≤ p) (hq0 : 0 ≤ q) (hg : 0 < g) (hpq : p + q ≤ 1 - g) (hη : 0 < η) :
    ∃ (ops : List ComOp), ops.length ≤ 2 * (⌈13 * Real.log (1 / g)⌉₊ + 1) + 2 * Nat.clog 2 (⌈5 * Real.log (1 / (4 * η))⌉₊ + 1) ∧ (comOpStepList ops (p, q)).1 ≤ η ∧ (comOpStepList ops (p, q)).2 ≤ η ∧ (comOpStepList ops (p, q)).1 ≤ 1 / 5 ∧ (comOpStepList ops (p, q)).2 ≤ 1 / 5

    Scalar schedule existence lemma for hiding and honest-sender binding error bounds (p, q): for any p, q ≥ 0 with p + q ≤ 1 - g (0 < g) and any target error η > 0, there exists a concrete sequence ops : List ComOp of length ops.length ≤ 2 * (⌈13 log(1/g)⌉ + 1) + 2 * ⌈log₂(⌈5 log(1/(4η))⌉ + 1)⌉ mapping (p, q) under comOpStepList ops into [0, min η (1/5)]² (which combines with applyComOps_security to amplify a PMFIDCommitment).