Documentation

CslibFrontier.Privacy.DifferentialPrivacy.Composition

Composition of differentially private mechanisms #

Running a (ε₁, δ₁)-private mechanism and then a mechanism chosen from its output, which is (ε₂, δ₂)-private for each choice, and releasing both outputs, is (ε₁ + ε₂, δ₁ + δ₂)-private (DifferentiallyPrivate.bind_pair) [DworkRoth2014, Theorem B.1]. The source states the case ε₁ = ε₂, δ₁ = δ₂; its proof, followed here, bounds the second-stage probability by min 1 (exp ε₂ · Pr[…]) + δ₂ and applies the first-stage guarantee to the [0, 1]-valued function min 1 (exp ε₂ · Pr[…]). Releasing two independent mechanisms (DifferentiallyPrivate.prod) is the non-adaptive special case [DworkRoth2014, Theorem 3.16].

adaptiveComposition M k runs k rounds; round i runs M history, where history lists the outputs of the previous rounds, most recent first. If every round with i previous outputs is (ε i, δ i)-private, the whole transcript is (∑ i < k, ε i, ∑ i < k, δ i)-private (DifferentiallyPrivate.adaptiveComposition) [DworkRoth2014, Corollary B.2]. The source fixes one pair (ε, δ) for every round; here the parameters may depend on the round. A mechanism that ignores its history gives non-adaptive k-fold composition.

Main definitions #

Main results #

References #

theorem Cslib.Privacy.DifferentiallyPrivate.bind_pair_of_support {D : Type u} {R₁ R₂ : Type v} {Adj : D → D → Prop} {ε₁ ε₂ : ℝ} {δ₁ δ₂ : ENNReal} {M₁ : D → PMF R₁} {M₂ : R₁ → D → PMF R₂} (h₁ : DifferentiallyPrivate Adj M₁ ε₁ δ₁) (P : R₁ → Prop) (hP : ∀ (x : D), ∀ r₁ ∈ (M₁ x).support, P r₁) (h₂ : ∀ (r₁ : R₁), P r₁ → DifferentiallyPrivate Adj (M₂ r₁) ε₂ δ₂) :
DifferentiallyPrivate Adj (fun (x : D) => do let r₁ ← M₁ x let r₂ ← M₂ r₁ x pure (r₁, r₂)) (ε₁ + ε₂) (δ₁ + δ₂)

Adaptive composition when the second stage is private only after first-stage outputs satisfying P, and the first stage produces only such outputs.

theorem Cslib.Privacy.DifferentiallyPrivate.bind_pair {D : Type u} {R₁ R₂ : Type v} {Adj : D → D → Prop} {ε₁ ε₂ : ℝ} {δ₁ δ₂ : ENNReal} {M₁ : D → PMF R₁} {M₂ : R₁ → D → PMF R₂} (h₁ : DifferentiallyPrivate Adj M₁ ε₁ δ₁) (h₂ : ∀ (r₁ : R₁), DifferentiallyPrivate Adj (M₂ r₁) ε₂ δ₂) :
DifferentiallyPrivate Adj (fun (x : D) => do let r₁ ← M₁ x let r₂ ← M₂ r₁ x pure (r₁, r₂)) (ε₁ + ε₂) (δ₁ + δ₂)

Adaptive composition: if M₁ is (ε₁, δ₁)-private and M₂ r₁ is (ε₂, δ₂)-private for every first output r₁, then releasing both outputs is (ε₁ + ε₂, δ₁ + δ₂)-private [DworkRoth2014, Theorem B.1].

theorem Cslib.Privacy.DifferentiallyPrivate.prod {D : Type u} {R₁ R₂ : Type v} {Adj : D → D → Prop} {ε₁ ε₂ : ℝ} {δ₁ δ₂ : ENNReal} {M₁ : D → PMF R₁} {M₂ : D → PMF R₂} (h₁ : DifferentiallyPrivate Adj M₁ ε₁ δ₁) (h₂ : DifferentiallyPrivate Adj M₂ ε₂ δ₂) :
DifferentiallyPrivate Adj (fun (x : D) => do let r₁ ← M₁ x let r₂ ← M₂ x pure (r₁, r₂)) (ε₁ + ε₂) (δ₁ + δ₂)

Releasing the outputs of two independent mechanisms, which are (ε₁, δ₁)- and (ε₂, δ₂)-private, is (ε₁ + ε₂, δ₁ + δ₂)-private [DworkRoth2014, Theorem 3.16].

noncomputable def Cslib.Privacy.adaptiveComposition {D : Type u} {R : Type v} (M : List R → D → PMF R) :
ℕ → D → PMF (List R)

k rounds of adaptive composition. Round i runs M history, where history lists the outputs of the previous i rounds with the most recent first; the result lists all k outputs in the same order.

theorem Cslib.Privacy.adaptiveComposition_zero {D : Type u} {R : Type v} (M : List R → D → PMF R) (x : D) :
theorem Cslib.Privacy.adaptiveComposition_succ {D : Type u} {R : Type v} (M : List R → D → PMF R) (k : ℕ) (x : D) :
adaptiveComposition M (k + 1) x = (adaptiveComposition M k x).bind fun (history : List R) => (M history x).bind fun (r : R) => PMF.pure (r :: history)
theorem Cslib.Privacy.length_of_mem_support_adaptiveComposition {D : Type u} {R : Type v} (M : List R → D → PMF R) (k : ℕ) (x : D) {l : List R} (hl : l ∈ (adaptiveComposition M k x).support) :
l.length = k

Every transcript of k rounds lists k outputs.

theorem Cslib.Privacy.DifferentiallyPrivate.adaptiveComposition {D : Type u} {R : Type v} {Adj : D → D → Prop} {M : List R → D → PMF R} {ε : ℕ → ℝ} {δ : ℕ → ENNReal} (h : ∀ (history : List R), DifferentiallyPrivate Adj (M history) (ε history.length) (δ history.length)) (k : ℕ) :
DifferentiallyPrivate Adj (Privacy.adaptiveComposition M k) (∑ i ∈ Finset.range k, ε i) (∑ i ∈ Finset.range k, δ i)

k-fold adaptive composition: if the mechanism run after i previous rounds is (ε i, δ i)-private for every history, then the transcript of k rounds is (∑ i < k, ε i, ∑ i < k, δ i)-private [DworkRoth2014, Corollary B.2].