Documentation

CslibFrontier.Privacy.DifferentialPrivacy.ExponentialMechanism

The exponential mechanism #

Fix a finite nonempty range R and a utility score u : D → R → ℝ whose sensitivity in the dataset argument is at most Δ > 0: |u x r - u y r| ≤ Δ for adjacent x, y and every r (PointwiseSensitivity Adj u Δ). The exponential mechanism outputs r with probability proportional to exp (ε u(x, r) / (2 Δ)) [DworkRoth2014, Definition 3.4] (exponentialMechanism). It is (ε, 0)-differentially private [DworkRoth2014, Theorem 3.10] (differentiallyPrivate_exponentialMechanism).

Its utility guarantee compares the utility of the output with the optimum OPT = max_r u(x, r): for every t, the output has utility at most OPT - (2 Δ / ε) (ln (|R| / |R_OPT|) + t) with probability at most exp (-t), where R_OPT is the set of optimal outputs [DworkRoth2014, Theorem 3.11] (exponentialMechanism_toOuterMeasure_utility_le_opt_sub); replacing |R| / |R_OPT| by |R| gives [DworkRoth2014, Corollary 3.12]. Both follow from the bound Pr[u(x, M x) ≤ c] ≤ |R| / |R_OPT| · exp (ε (c - OPT) / (2 Δ)) (exponentialMechanism_toOuterMeasure_utility_le).

The range must not depend on the dataset; it is the type R. The mechanism is stated through its output law; the cost of sampling it is not modelled.

Main definitions #

Main results #

References #

noncomputable def Cslib.Privacy.exponentialMechanism {D : Type u_1} {R : Type u_2} [Fintype R] [Nonempty R] (u : D → R → ℝ) (Δ ε : ℝ) (x : D) :
PMF R

The exponential mechanism with privacy parameter ε for a utility score u of sensitivity Δ: on dataset x it outputs r with probability proportional to exp (ε u(x, r) / (2 Δ)) [DworkRoth2014, Definition 3.4].

theorem Cslib.Privacy.exponentialMechanism_apply {D : Type u_1} {R : Type u_2} [Fintype R] [Nonempty R] (u : D → R → ℝ) (Δ ε : ℝ) (x : D) (r : R) :
(exponentialMechanism u Δ ε x) r = ENNReal.ofReal (Real.exp (ε * u x r / (2 * Δ)) / ∑ r' : R, Real.exp (ε * u x r' / (2 * Δ)))

The probability that the exponential mechanism outputs r.

theorem Cslib.Privacy.differentiallyPrivate_exponentialMechanism {D : Type u_1} {R : Type u_2} [Fintype R] [Nonempty R] {Adj : D → D → Prop} {u : D → R → ℝ} {Δ ε : ℝ} (hΔ : 0 < Δ) (hε : 0 ≤ ε) (hu : PointwiseSensitivity Adj u Δ) :

The exponential mechanism is (ε, 0)-differentially private for every ε ≥ 0 when the utility score has sensitivity at most Δ > 0 [DworkRoth2014, Theorem 3.10].

noncomputable def Cslib.Privacy.optUtility {D : Type u_1} {R : Type u_2} (u : D → R → ℝ) (x : D) :

The optimal utility OPT_u(x) = max_r u(x, r).

theorem Cslib.Privacy.le_optUtility {D : Type u_1} {R : Type u_2} [Finite R] (u : D → R → ℝ) (x : D) (r : R) :
u x r ≤ optUtility u x
noncomputable def Cslib.Privacy.optSet {D : Type u_1} {R : Type u_2} [Fintype R] (u : D → R → ℝ) (x : D) :

The outputs of optimal utility, R_OPT = {r | u(x, r) = OPT_u(x)}; it is nonempty.

theorem Cslib.Privacy.mem_optSet {D : Type u_1} {R : Type u_2} [Fintype R] {u : D → R → ℝ} {x : D} {r : R} :
r ∈ optSet u x ↔ u x r = optUtility u x
theorem Cslib.Privacy.card_optSet_pos {D : Type u_1} {R : Type u_2} [Fintype R] [Nonempty R] (u : D → R → ℝ) (x : D) :
0 < (optSet u x).card
theorem Cslib.Privacy.exponentialMechanism_toOuterMeasure_utility_le {D : Type u_1} {R : Type u_2} [Fintype R] [Nonempty R] {u : D → R → ℝ} {Δ ε : ℝ} (hΔ : 0 < Δ) (hε : 0 ≤ ε) (x : D) (c : ℝ) :
(exponentialMechanism u Δ ε x).toOuterMeasure {r : R | u x r ≤ c} ≤ ENNReal.ofReal (↑(Fintype.card R) / ↑(optSet u x).card * Real.exp (ε * (c - optUtility u x) / (2 * Δ)))

The probability that the exponential mechanism returns an output of utility at most c is at most |R| / |R_OPT| · exp (ε (c - OPT) / (2 Δ)); this is the bound in the proof of [DworkRoth2014, Theorem 3.11].

theorem Cslib.Privacy.exponentialMechanism_toOuterMeasure_utility_le_opt_sub {D : Type u_1} {R : Type u_2} [Fintype R] [Nonempty R] {u : D → R → ℝ} {Δ ε : ℝ} (hΔ : 0 < Δ) (hε : 0 < ε) (x : D) (t : ℝ) :
(exponentialMechanism u Δ ε x).toOuterMeasure {r : R | u x r ≤ optUtility u x - 2 * Δ / ε * (Real.log (↑(Fintype.card R) / ↑(optSet u x).card) + t)} ≤ ENNReal.ofReal (Real.exp (-t))

Utility of the exponential mechanism [DworkRoth2014, Theorem 3.11]: the output has utility at most OPT - (2 Δ / ε) (ln (|R| / |R_OPT|) + t) with probability at most exp (-t).

theorem Cslib.Privacy.exponentialMechanism_toOuterMeasure_utility_le_opt_sub_log_card {D : Type u_1} {R : Type u_2} [Fintype R] [Nonempty R] {u : D → R → ℝ} {Δ ε : ℝ} (hΔ : 0 < Δ) (hε : 0 < ε) (x : D) (t : ℝ) :

Utility of the exponential mechanism [DworkRoth2014, Corollary 3.12]: the output has utility at most OPT - (2 Δ / ε) (ln |R| + t) with probability at most exp (-t).