Documentation

CslibFrontier.Privacy.DifferentialPrivacy.AdvancedComposition

Advanced composition #

k adaptively chosen (ε, δ)-differentially private mechanisms are together (√(2k ln (1/δ')) ε + k ε (e^ε - 1), k δ + δ')-private for every δ' > 0 (DifferentiallyPrivate.advancedComposition) [DworkRoth2014, Theorem 3.20]. For small ε the privacy loss grows like √k ε instead of the k ε of basic composition (DifferentiallyPrivate.adaptiveComposition).

The source proves the theorem through the KL divergence bound ε (e^ε - 1) and Azuma's inequality. Here the proof bounds the Rényi power-ratio moment of the privacy loss in each round (renyiMoment_le_exp), multiplies the bounds along the transcript (renyiMoment_transcriptWeight_le) and applies Markov's inequality (Probability.tsum_tsub_le_renyiMoment). The per-round bound gives the sharper linear term k ε tanh (ε / 2) = k ε (e^ε - 1) / (e^ε + 1) in place of k ε (e^ε - 1) (DifferentiallyPrivate.advancedComposition_sqrt), the third bound of [KairouzOhViswanath2017, Theorem 3.4]. Their proof also bounds a moment generating function, after reducing to an extremal pair of four-point distributions. For δ > 0, each round is replaced by ε-close sub-probability kernels that keep all but δ of the mass (Cslib.Probability.PMF.exists_subprob_of_hockeyStick_le); k rounds then lose at most k δ of the mass (one_le_tsum_transcriptWeight_add).

The adaptive adversary of the source's composition experiment [DworkRoth2014, Definition 3.7], which chooses in every round two adjacent inputs and a private mechanism from its coins and the previous outputs, is covered by DifferentiallyPrivate.advancedComposition_experiment; the view consists of the adversary's coins and all outputs, as in the source.

The source states the theorem for all δ' ≥ 0, reading ln (1/0) = ∞. Lean's Real.log has Real.log (1 / 0) = 0, so the statements here assume δ' > 0.

Main definitions #

Main results #

References #

noncomputable def Cslib.Privacy.transcriptWeight {R : Type u} (K : List R → R → ENNReal) :
ℕ → List R → ENNReal

The weight of a transcript l (most recent output first) after k rounds of the kernel K: the product of K history r over the rounds, and 0 unless l has length k. For a probability kernel K history = M history x this is the mass function of adaptiveComposition M k x (adaptiveComposition_apply).

theorem Cslib.Privacy.transcriptWeight_ne_top {R : Type u} {K : List R → R → ENNReal} (hK : ∀ (h : List R) (r : R), K h r ≠ ⊤) (k : ℕ) (l : List R) :
theorem Cslib.Privacy.renyiMoment_transcriptWeight_succ {R : Type u} {K L : List R → R → ENNReal} (hL : ∀ (h : List R) (r : R), L h r ≠ ⊤) {α : ℝ} (hα : 1 ≤ α) (k : ℕ) :

The order-α Rényi moment of k + 1 rounds, conditioned on the first k.

theorem Cslib.Privacy.renyiMoment_transcriptWeight_le {R : Type u} {K L : List R → R → ENNReal} (hL : ∀ (h : List R) (r : R), L h r ≠ ⊤) {α : ℝ} (hα : 1 ≤ α) {B : ENNReal} (hB : ∀ (h : List R), Probability.renyiMoment α (K h) (L h) ≤ B) (k : ℕ) :

If every round has order-α Rényi moment at most B, then k rounds have moment at most B ^ k.

theorem Cslib.Privacy.adaptiveComposition_apply {R : Type u} {D : Type v} (M : List R → D → PMF R) (k : ℕ) (x : D) (l : List R) :
(adaptiveComposition M k x) l = transcriptWeight (fun (h : List R) => ⇑(M h x)) k l

The mass function of k rounds of adaptive composition is the transcript weight.

theorem Cslib.Privacy.transcriptWeight_mono {R : Type u} {K K' : List R → R → ENNReal} (hK : ∀ (h : List R) (r : R), K' h r ≤ K h r) (k : ℕ) (l : List R) :

Transcript weights are monotone in the kernel.

theorem Cslib.Privacy.tsum_transcriptWeight_zero {R : Type u} (K : List R → R → ENNReal) :
∑' (l : List R), transcriptWeight K 0 l = 1

The empty transcript has weight one.

theorem Cslib.Privacy.tsum_transcriptWeight_succ {R : Type u} (K : List R → R → ENNReal) (k : ℕ) :
∑' (l : List R), transcriptWeight K (k + 1) l = ∑' (h : List R), transcriptWeight K k h * ∑' (r : R), K h r

The total weight after k + 1 rounds.

theorem Cslib.Privacy.tsum_transcriptWeight_le_one {R : Type u} {K : List R → R → ENNReal} (hK : ∀ (h : List R), ∑' (r : R), K h r ≤ 1) (k : ℕ) :
∑' (l : List R), transcriptWeight K k l ≤ 1

Sub-probability kernels give sub-probability transcript weights.

theorem Cslib.Privacy.one_le_tsum_transcriptWeight_add {R : Type u} {K : List R → R → ENNReal} {δ : ENNReal} (hK : ∀ (h : List R), ∑' (r : R), K h r ≤ 1) (hδ : ∀ (h : List R), 1 ≤ ∑' (r : R), K h r + δ) (k : ℕ) :
1 ≤ ∑' (l : List R), transcriptWeight K k l + ↑k * δ

Mass deficit: if every round of a sub-probability kernel keeps all but δ of the mass, then k rounds keep all but k δ.

theorem Cslib.Privacy.tsum_tsub_transcriptWeight_le {R : Type u} {K L : List R → R → ENNReal} {ε : ℝ} (hε : 0 ≤ ε) (hKL : ∀ (h : List R) (r : R), K h r ≤ ENNReal.ofReal (Real.exp ε) * L h r) (hLK : ∀ (h : List R) (r : R), L h r ≤ ENNReal.ofReal (Real.exp ε) * K h r) (hsum : ∀ (h : List R), ∑' (r : R), K h r ≤ ∑' (r : R), L h r) (hL1 : ∀ (h : List R), ∑' (r : R), L h r ≤ 1) (k : ℕ) {a : ℝ} (ha : 0 ≤ a) :
∑' (l : List R), (transcriptWeight K k l - ENNReal.ofReal (Real.exp (↑k * ε * Real.tanh (ε / 2) + a * ε)) * transcriptWeight L k l) ≤ ENNReal.ofReal (Real.exp (-(a ^ 2 / (2 * ↑k))))

The core of advanced composition, for sub-probability kernels whose likelihood ratio lies in [e^{-ε}, e^ε] in every round and whose first kernel has at most the mass of the second: for every a ≥ 0, the truncated excess of transcriptWeight K k over exp (k ε tanh (ε / 2) + a ε) · transcriptWeight L k is at most exp (-a² / (2k)).

theorem Cslib.Privacy.hockeyStick_adaptiveComposition_le {R : Type u} {D : Type v} {M : List R → D → PMF R} {x y : D} {ε : ℝ} {δ : ENNReal} (hε : 0 ≤ ε) (hxy : ∀ (h : List R), Probability.PMF.hockeyStick (ENNReal.ofReal (Real.exp ε)) (M h x) (M h y) ≤ δ) (hyx : ∀ (h : List R), Probability.PMF.hockeyStick (ENNReal.ofReal (Real.exp ε)) (M h y) (M h x) ≤ δ) (k : ℕ) {a : ℝ} (ha : 0 ≤ a) :

Hockey-stick form of advanced composition for one pair of inputs: if in every round M h x and M h y have hockey-stick divergence at most δ at factor e^ε in both directions, then the k-round transcripts have hockey-stick divergence at most exp (-a² / (2k)) + k δ at factor exp (k ε tanh (ε / 2) + a ε).

theorem Cslib.Privacy.adaptiveComposition_toOuterMeasure_le {R : Type u} {D : Type v} {M : List R → D → PMF R} {x y : D} {ε : ℝ} {δ : ENNReal} (hε : 0 ≤ ε) (hxy : ∀ (h : List R), Probability.PMF.hockeyStick (ENNReal.ofReal (Real.exp ε)) (M h x) (M h y) ≤ δ) (hyx : ∀ (h : List R), Probability.PMF.hockeyStick (ENNReal.ofReal (Real.exp ε)) (M h y) (M h x) ≤ δ) (k : ℕ) {a : ℝ} (ha : 0 ≤ a) (S : Set (List R)) :
(adaptiveComposition M k x).toOuterMeasure S ≤ ENNReal.ofReal (Real.exp (↑k * ε * Real.tanh (ε / 2) + a * ε)) * (adaptiveComposition M k y).toOuterMeasure S + (ENNReal.ofReal (Real.exp (-(a ^ 2 / (2 * ↑k)))) + ↑k * δ)

Advanced composition for one pair of inputs. If, after every history, the round distributions on x and on y have hockey-stick divergence at most δ at factor e^ε in both directions, then for every a ≥ 0 the transcripts of k rounds satisfy Pr_x[S] ≤ exp (k ε tanh (ε / 2) + a ε) · Pr_y[S] + exp (-a² / (2k)) + k δ.

theorem Cslib.Privacy.DifferentiallyPrivate.advancedComposition_tanh {R : Type u} {D : Type v} {Adj : D → D → Prop} (hAdj : ∀ ⦃x y : D⦄, Adj x y → Adj y x) {M : List R → D → PMF R} {ε : ℝ} {δ : ENNReal} (hε : 0 ≤ ε) (h : ∀ (history : List R), DifferentiallyPrivate Adj (M history) ε δ) (k : ℕ) {a : ℝ} (ha : 0 ≤ a) :
DifferentiallyPrivate Adj (Privacy.adaptiveComposition M k) (↑k * ε * Real.tanh (ε / 2) + a * ε) (ENNReal.ofReal (Real.exp (-(a ^ 2 / (2 * ↑k)))) + ↑k * δ)

Advanced composition with the slack parameter a: if every round is (ε, δ)-private for a symmetric adjacency relation, k adaptive rounds are (k ε tanh (ε / 2) + a ε, exp (-a² / (2k)) + k δ)-private.

theorem Cslib.Privacy.DifferentiallyPrivate.advancedComposition_sqrt {R : Type u} {D : Type v} {Adj : D → D → Prop} (hAdj : ∀ ⦃x y : D⦄, Adj x y → Adj y x) {M : List R → D → PMF R} {ε : ℝ} {δ : ENNReal} (hε : 0 ≤ ε) (h : ∀ (history : List R), DifferentiallyPrivate Adj (M history) ε δ) (k : ℕ) {δ' : ℝ} (hδ' : 0 < δ') :
DifferentiallyPrivate Adj (Privacy.adaptiveComposition M k) (√(2 * ↑k * Real.log (1 / δ')) * ε + ↑k * ε * Real.tanh (ε / 2)) (↑k * δ + ENNReal.ofReal δ')

Advanced composition with tanh: k adaptive rounds of (ε, δ)-private mechanisms are (√(2k ln (1/δ')) ε + k ε tanh (ε / 2), k δ + δ')-private for every δ' > 0. This is the third bound of [KairouzOhViswanath2017, Theorem 3.4], whose linear term is k ε (e^ε - 1) / (e^ε + 1) = k ε tanh (ε / 2), with the failure probability 1 - (1 - δ)^k (1 - δ') weakened to k δ + δ'. Since tanh (ε / 2) ≤ e^ε - 1, it sharpens [DworkRoth2014, Theorem 3.20].

theorem Cslib.Privacy.DifferentiallyPrivate.advancedComposition {R : Type u} {D : Type v} {Adj : D → D → Prop} (hAdj : ∀ ⦃x y : D⦄, Adj x y → Adj y x) {M : List R → D → PMF R} {ε : ℝ} {δ : ENNReal} (hε : 0 ≤ ε) (h : ∀ (history : List R), DifferentiallyPrivate Adj (M history) ε δ) (k : ℕ) {δ' : ℝ} (hδ' : 0 < δ') :
DifferentiallyPrivate Adj (Privacy.adaptiveComposition M k) (√(2 * ↑k * Real.log (1 / δ')) * ε + ↑k * ε * (Real.exp ε - 1)) (↑k * δ + ENNReal.ofReal δ')

Advanced composition [DworkRoth2014, Theorem 3.20]: if every round is (ε, δ)-private for a symmetric adjacency relation, then k adaptive rounds are (√(2k ln (1/δ')) ε + k ε (e^ε - 1), k δ + δ')-private for every δ' > 0.

theorem Cslib.Privacy.DifferentiallyPrivate.advancedComposition_experiment {D' : Type u_1} {Ω R : Type u} {Adj : D' → D' → Prop} (coins : PMF Ω) (data : Ω → List R → Bool → D') (mech : Ω → List R → D' → PMF R) {ε : ℝ} {δ : ENNReal} (hε : 0 ≤ ε) (hmech : ∀ (ω : Ω) (history : List R), DifferentiallyPrivate Adj (mech ω history) ε δ) (hdata : ∀ (ω : Ω) (history : List R), Adj (data ω history false) (data ω history true) ∧ Adj (data ω history true) (data ω history false)) (k : ℕ) {δ' : ℝ} (hδ' : 0 < δ') :
DifferentiallyPrivate (fun (x x_1 : Bool) => True) (fun (b : Bool) => do let ω ← coins let view ← Privacy.adaptiveComposition (fun (history : List R) (b : Bool) => mech ω history (data ω history b)) k b pure (ω, view)) (√(2 * ↑k * Real.log (1 / δ')) * ε + ↑k * ε * (Real.exp ε - 1)) (↑k * δ + ENNReal.ofReal δ')

Advanced composition against an adaptive adversary [DworkRoth2014, Definition 3.7 and Theorem 3.20]. In round i the adversary, knowing its coins ω and the outputs history of the previous rounds, chooses two adjacent inputs data ω history false, data ω history true and an (ε, δ)-private mechanism mech ω history; experiment b releases the output of that mechanism on input data ω history b. The adversary's view, its coins and all k outputs, is (ε', k δ + δ')-private as a function of b (adjacency True on Bool) with ε' = √(2k ln (1/δ')) ε + k ε (e^ε - 1).

theorem Cslib.Privacy.DifferentiallyPrivate.advancedComposition_of_target {R : Type u} {D : Type v} {Adj : D → D → Prop} (hAdj : ∀ ⦃x y : D⦄, Adj x y → Adj y x) {M : List R → D → PMF R} {ε₀ : ℝ} {δ : ENNReal} (k : ℕ) {δ' : ℝ} (hε₀ : 0 ≤ ε₀) (hδ' : 0 < δ') (hε₀δ' : ε₀ ≤ 8 * Real.log (1 / δ')) (h : ∀ (history : List R), DifferentiallyPrivate Adj (M history) (ε₀ / (2 * √(2 * ↑k * Real.log (1 / δ')))) δ) :

The per-round privacy parameter of [DworkRoth2014, Corollary 3.21]: if every round is (ε₀ / (2 √(2k ln (1/δ'))), δ)-private, k adaptive rounds are (ε₀, k δ + δ')-private. The source assumes only 0 < ε₀ < 1. Its proof writes the linear term k ε (e^ε - 1) as k ε², an approximation for small ε, and the step k ε² ≤ ε₀ / 2 needs ε₀ ≤ 4 ln (1/δ'). Without such a condition the corollary fails: for k = 1, ε₀ = 0.9, δ' = 0.999 the prescribed per-round parameter is ε ≈ 10.06, and randomized response reporting the true bit with probability e^ε / (1 + e^ε) is (ε, 0)-private but not (0.9, 0.999)-private. Here the linear term is k ε tanh (ε / 2) ≤ k ε² / 2 (DifferentiallyPrivate.advancedComposition_sqrt), and the hypothesis is ε₀ ≤ 8 ln (1/δ'), which holds whenever ε₀ ≤ 1 and δ' ≤ e^{-1/8}.