Documentation

CslibFrontier.Privacy.DifferentialPrivacy.Packing

Packing lower bounds for differential privacy #

A private mechanism cannot place most of its mass in many pairwise disjoint regions, one for each of many datasets, when those datasets are all close to a common centre. This is the packing argument behind lower bounds on the error of (ε, 0)-private mechanisms, due to Hardt and Talwar [DworkRoth2014, Lemma 8.4 and §8.3].

DifferentiallyPrivate.card_mul_le is the general form, for any adjacency relation. Take a mechanism that is (ε, δ)-private for the relation relating a centre x₀ to the datasets x j (j ∈ J), and pairwise disjoint events B j with Pr[M (x j) ∈ B j] ≥ p. Then |J| · p ≤ exp ε + |J| · δ. The proof compares each x j with x₀ and sums the bounds Pr[M x₀ ∈ B j], which are at most 1 in total by disjointness.

With group privacy for Hamming adjacency (DifferentiallyPrivate.hammingDist_le), datasets within Hamming distance m of the centre give |J| · p ≤ exp (m ε) + |J| · ∑ i < m, exp (i ε) δ (DifferentiallyPrivate.card_mul_le_of_hammingDist_le), and |J| · p ≤ exp (m ε) for pure privacy (DifferentiallyPrivate.card_mul_le_of_hammingDist_le_of_pure). DifferentiallyPrivate.log_two_mul_le_of_hammingDist_le is the form of [DworkRoth2014, Lemma 8.4]: 2 ^ s datasets at pairwise Hamming distance at most Δ with success probability at least 1 / 2 force ε ≥ ln 2 · (s - 1) / Δ. Dwork and Roth measure distance by the ℓ₁ distance between histograms; here datasets are tuples of rows compared by Hamming distance.

The application is the lower bound for one-way marginals [DworkRoth2014, Theorem 8.7]. A dataset of n rows in {0, 1} ^ k has k one-way marginals (oneWayMarginals), the number of rows whose j-th bit is set. Suppose an (ε, 0)-private mechanism answers, on every dataset, all of them with error less than n / 2 with probability at least p. Then 2 ^ k · p ≤ exp (n ε) (DifferentiallyPrivate.two_pow_mul_le_of_oneWayMarginals), so (k - 1) ln 2 ≤ n ε for p = 1 / 2 (DifferentiallyPrivate.log_two_mul_le_of_oneWayMarginals) and n = Ω(k / ε). The packed datasets are the 2 ^ k datasets with n equal rows.

Main definitions #

Main results #

References #

The logarithmic form of a packing bound with success probability 1 / 2: if 2 ^ n · 2⁻¹ ≤ exp x then (n - 1) ln 2 ≤ x.

theorem Cslib.Privacy.DifferentiallyPrivate.card_mul_le {D : Type u} {R : Type v} {Adj : D → D → Prop} {M : D → PMF R} {ε : ℝ} {δ : ENNReal} {ι : Type u_1} (h : DifferentiallyPrivate Adj M ε δ) (J : Finset ι) (x₀ : D) (x : ι → D) (hx : ∀ j ∈ J, Adj (x j) x₀) {B : ι → Set R} (hB : (↑J).PairwiseDisjoint B) {p : ENNReal} (hp : ∀ j ∈ J, p ≤ (M (x j)).toOuterMeasure (B j)) :
↑J.card * p ≤ ENNReal.ofReal (Real.exp ε) + ↑J.card * δ

Packing bound. Let M be (ε, δ)-private for an adjacency relating x₀ to each x j, j ∈ J. If the events B j are pairwise disjoint and M (x j) lands in B j with probability at least p, then |J| · p ≤ exp ε + |J| · δ. This is the counting step of [DworkRoth2014, Lemma 8.4].

theorem Cslib.Privacy.DifferentiallyPrivate.card_mul_le_of_hammingDist_le {R : Type v} {ε : ℝ} {δ : ENNReal} {ι : Type u_1} {X : Type u_2} [Fintype ι] [DecidableEq X] {M : (ι → X) → PMF R} {κ : Type u_3} (h : DifferentiallyPrivate HammingAdjacent M ε δ) (J : Finset κ) (x₀ : ι → X) (x : κ → ι → X) {m : ℕ} (hx : ∀ j ∈ J, hammingDist (x j) x₀ ≤ m) {B : κ → Set R} (hB : (↑J).PairwiseDisjoint B) {p : ENNReal} (hp : ∀ j ∈ J, p ≤ (M (x j)).toOuterMeasure (B j)) :
↑J.card * p ≤ ENNReal.ofReal (Real.exp (↑m * ε)) + ↑J.card * ∑ i ∈ Finset.range m, ENNReal.ofReal (Real.exp (↑i * ε)) * δ

Packing bound in Hamming distance. If M is (ε, δ)-private for Hamming adjacency, the datasets x j (j ∈ J) are within Hamming distance m of a centre x₀, the events B j are pairwise disjoint and Pr[M (x j) ∈ B j] ≥ p, then |J| · p ≤ exp (m ε) + |J| · ∑ i < m, exp (i ε) δ. This is the Hamming-distance analogue of [DworkRoth2014, Lemma 8.4], with a centre in place of pairwise distances and with δ.

theorem Cslib.Privacy.DifferentiallyPrivate.card_mul_le_of_hammingDist_le_of_pure {R : Type v} {ε : ℝ} {ι : Type u_1} {X : Type u_2} [Fintype ι] [DecidableEq X] {M : (ι → X) → PMF R} {κ : Type u_3} (h : DifferentiallyPrivate HammingAdjacent M ε 0) (J : Finset κ) (x₀ : ι → X) (x : κ → ι → X) {m : ℕ} (hx : ∀ j ∈ J, hammingDist (x j) x₀ ≤ m) {B : κ → Set R} (hB : (↑J).PairwiseDisjoint B) {p : ENNReal} (hp : ∀ j ∈ J, p ≤ (M (x j)).toOuterMeasure (B j)) :
↑J.card * p ≤ ENNReal.ofReal (Real.exp (↑m * ε))

Packing bound for pure privacy. If M is (ε, 0)-private for Hamming adjacency, the datasets x j (j ∈ J) are within Hamming distance m of x₀, the events B j are pairwise disjoint and Pr[M (x j) ∈ B j] ≥ p, then |J| · p ≤ exp (m ε).

theorem Cslib.Privacy.DifferentiallyPrivate.log_two_mul_le_of_hammingDist_le {R : Type v} {ε : ℝ} {ι : Type u_1} {X : Type u_2} [Fintype ι] [DecidableEq X] {M : (ι → X) → PMF R} (h : DifferentiallyPrivate HammingAdjacent M ε 0) (s : ℕ) (x : Fin (2 ^ s) → ι → X) {Δ : ℕ} (hx : ∀ (i j : Fin (2 ^ s)), hammingDist (x i) (x j) ≤ Δ) {B : Fin (2 ^ s) → Set R} (hB : Pairwise (Function.onFun Disjoint B)) (hp : ∀ (j : Fin (2 ^ s)), 2⁻¹ ≤ (M (x j)).toOuterMeasure (B j)) :
Real.log 2 * (↑s - 1) ≤ ↑Δ * ε

[DworkRoth2014, Lemma 8.4], Hamming form. If M is (ε, 0)-private for Hamming adjacency and 2 ^ s datasets at pairwise Hamming distance at most Δ have pairwise disjoint events B j with Pr[M (x j) ∈ B j] ≥ 1 / 2, then ln 2 · (s - 1) ≤ Δ ε. Dwork and Roth state this for histograms at ℓ₁ distance at most Δ.

def Cslib.Privacy.oneWayMarginals {ι : Type u_1} {κ : Type u_2} [Fintype ι] (x : ι → κ → Bool) (j : κ) :

The one-way marginals of a dataset whose rows are bit vectors indexed by κ: the j-th marginal is the number of rows whose j-th bit is set [DworkRoth2014, Theorem 8.7].

theorem Cslib.Privacy.oneWayMarginals_const {ι : Type u_1} {κ : Type u_2} [Fintype ι] (w : κ → Bool) (j : κ) :
oneWayMarginals (fun (x : ι) => w) j = if w j = true then ↑(Fintype.card ι) else 0

The j-th marginal of the dataset with every row equal to w is n if w j is set and 0 otherwise.

theorem Cslib.Privacy.oneWayMarginals_apply {ι : Type u_1} {κ : Type u_2} [Fintype ι] (x : ι → κ → Bool) (j : κ) :
oneWayMarginals x j = ↑{i : ι | x i j = true}.card

Unfolding oneWayMarginals.

def Cslib.Privacy.accurateMarginals {ι : Type u_1} {κ : Type u_2} [Fintype ι] (x : ι → κ → Bool) :
Set (κ → ℝ)

The answers a that give every one-way marginal of x with error less than n / 2, n being the number of rows: the open ℓ∞ ball B_x of [DworkRoth2014, Theorem 8.7].

theorem Cslib.Privacy.mem_accurateMarginals {ι : Type u_1} {κ : Type u_2} [Fintype ι] {x : ι → κ → Bool} {a : κ → ℝ} :
a ∈ accurateMarginals x ↔ ∀ (j : κ), |a j - oneWayMarginals x j| < ↑(Fintype.card ι) / 2

Unfolding accurateMarginals.

theorem Cslib.Privacy.accurateMarginals_eq_ball {ι : Type u_1} {κ : Type u_2} [Fintype ι] [Fintype κ] [Nonempty ι] (x : ι → κ → Bool) :

With at least one row, the accurate answers form the open ball of radius n / 2 around the marginals in the sup metric.

theorem Cslib.Privacy.disjoint_accurateMarginals_const {ι : Type u_1} {κ : Type u_2} [Fintype ι] {w w' : κ → Bool} (hw : w ≠ w') :
Disjoint (accurateMarginals fun (x : ι) => w) (accurateMarginals fun (x : ι) => w')

The accuracy events of two different constant datasets are disjoint.

theorem Cslib.Privacy.DifferentiallyPrivate.two_pow_mul_le_of_oneWayMarginals {ι : Type u_1} {κ : Type u_2} [Fintype ι] [Fintype κ] {M : (ι → κ → Bool) → PMF (κ → ℝ)} {ε : ℝ} (h : DifferentiallyPrivate HammingAdjacent M ε 0) {p : ENNReal} (hp : ∀ (x : ι → κ → Bool), p ≤ (M x).toOuterMeasure (accurateMarginals x)) :

One-way marginals, [DworkRoth2014, Theorem 8.7]. Let M be (ε, 0)-private for Hamming adjacency on datasets of n rows in {0, 1} ^ κ. If on every dataset M answers all one-way marginals with error less than n / 2 with probability at least p, then 2 ^ |κ| · p ≤ exp (n ε).

theorem Cslib.Privacy.DifferentiallyPrivate.log_two_mul_le_of_oneWayMarginals {ι : Type u_1} {κ : Type u_2} [Fintype ι] [Fintype κ] {M : (ι → κ → Bool) → PMF (κ → ℝ)} {ε : ℝ} (h : DifferentiallyPrivate HammingAdjacent M ε 0) (hp : ∀ (x : ι → κ → Bool), 2⁻¹ ≤ (M x).toOuterMeasure (accurateMarginals x)) :
(↑(Fintype.card κ) - 1) * Real.log 2 ≤ ↑(Fintype.card ι) * ε

One-way marginals need Ω(k / ε) rows, [DworkRoth2014, Theorem 8.7]. If an (ε, 0)-private mechanism on datasets of n rows in {0, 1} ^ k answers, on every dataset, all k one-way marginals with error less than n / 2 with probability at least 1 / 2, then (k - 1) ln 2 ≤ n ε.