Documentation

CslibFrontier.Privacy.DifferentialPrivacy.SmallUniverse

De's lower bound over a small universe #

Answering k queries of sensitivity 1 with pure privacy needs noise Ω(min (k, d) / ε) even when the universe has only d items [DworkRoth2014, Theorem 8.8], a theorem Dwork and Roth credit to De (§8.3). For ε ∈ (0, 1 / 40] and databases of n ≥ min (k, d) / ε rows there is a query F into ℝ ^ k, of sensitivity at most 1 in each coordinate, such that every (ε, 0)-private mechanism adds noise of ℓ∞ norm Ω(min (k, d) / ε) with probability at least 1 / 2 on some database. The one-way marginals bound of CslibFrontier.Privacy.DifferentialPrivacy.Packing [DworkRoth2014, Theorem 8.7] needs a universe of 2 ^ k items; this one does not.

Datasets are tuples x : ι → X of n = |ι| rows from a universe X of d items, compared by HammingAdjacent. Dwork and Roth work with histograms in ℕ ^ d. A query of tuples is a query of histograms exactly when reordering the rows does not change it, and the query F here has this property. Without it the size of the universe would play no role, since a query could read individual rows.

The construction:

Dwork and Roth sketch the code without details and take k random ± 1 combinations of bump functions around the codewords, with a Chernoff and a union bound to separate the answers. An ℓ∞ separation needs only one coordinate for each pair of codewords, so labelling the codewords by L ≤ k bits makes the query deterministic, and McShane's extension replaces the bump functions. This simplifies the proof; the theorem is theirs.

Scope, relative to [DworkRoth2014, Theorem 8.8]:

Main definitions #

Main results #

References #

def Cslib.Privacy.rowCount {ι : Type u_1} {X : Type u_2} [Fintype ι] [DecidableEq X] (x : ι → X) (a : X) :

The number of rows of the dataset x equal to a: the histogram of x at a.

theorem Cslib.Privacy.rowCount_apply {ι : Type u_1} {X : Type u_2} [Fintype ι] [DecidableEq X] (x : ι → X) (a : X) :
rowCount x a = {i : ι | x i = a}.card

Unfolding rowCount.

theorem Cslib.Privacy.rowCount_comp_equiv {ι : Type u_1} {X : Type u_2} [Fintype ι] [DecidableEq X] (x : ι → X) (σ : Equiv.Perm ι) (a : X) :
rowCount (x ∘ ⇑σ) a = rowCount x a

Reindexing the rows does not change the histogram.

def Cslib.Privacy.countExcess {ι : Type u_1} {X : Type u_2} [Fintype ι] [DecidableEq X] [Fintype X] (x y : ι → X) :

The histogram excess of x over y: the number of rows of x that have no matching row of y, ∑ a, (rowCount x a - rowCount y a) with truncated subtraction. For datasets with the same number of rows it is half the ℓ₁ distance between their histograms. It depends only on the histograms, so it is invariant under reordering the rows of either dataset.

theorem Cslib.Privacy.countExcess_apply {ι : Type u_1} {X : Type u_2} [Fintype ι] [DecidableEq X] [Fintype X] (x y : ι → X) :
countExcess x y = ∑ a : X, (rowCount x a - rowCount y a)

Unfolding countExcess.

@[simp]
theorem Cslib.Privacy.countExcess_self {ι : Type u_1} {X : Type u_2} [Fintype ι] [DecidableEq X] [Fintype X] (x : ι → X) :

A dataset has no excess over itself.

theorem Cslib.Privacy.countExcess_comp_equiv_right {ι : Type u_1} {X : Type u_2} [Fintype ι] [DecidableEq X] [Fintype X] (x y : ι → X) (σ : Equiv.Perm ι) :
countExcess x (y ∘ ⇑σ) = countExcess x y

Reordering the rows of the second dataset does not change the excess.

theorem Cslib.Privacy.countExcess_le_hammingDist {ι : Type u_1} {X : Type u_2} [Fintype ι] [DecidableEq X] [Fintype X] (x y : ι → X) :

The excess is at most the Hamming distance.

theorem Cslib.Privacy.countExcess_le_add {ι : Type u_1} {X : Type u_2} [Fintype ι] [DecidableEq X] [Fintype X] (x y z : ι → X) :

The triangle inequality for the excess.

theorem Cslib.Privacy.countExcess_le_add_hammingDist {ι : Type u_1} {X : Type u_2} [Fintype ι] [DecidableEq X] [Fintype X] (x y z : ι → X) :

The excess over z is 1-Lipschitz in the Hamming distance of z.

theorem Cslib.Privacy.exists_symmetric_lipschitz_extension {ι : Type u_1} {X : Type u_2} {H : Type u_3} [Fintype ι] [Fintype X] [DecidableEq X] [Finite H] [Nonempty H] (D : H → ι → X) (g : H → ℝ) (hg : ∀ (h h' : H), g h ≤ g h' + ↑(countExcess (D h') (D h))) :
∃ (G : (ι → X) → ℝ), (∀ (y : ι → X) (σ : Equiv.Perm ι), G (y ∘ ⇑σ) = G y) ∧ (∀ (y z : ι → X), |G y - G z| ≤ ↑(hammingDist y z)) ∧ ∀ (h : H), G (D h) = g h

Symmetric Lipschitz extension. Let D h (h : H) be finitely many datasets and g h real labels with g h ≤ g h' + countExcess (D h') (D h). Then some query G that depends only on the histogram and is 1-Lipschitz in Hamming distance takes the value g h on D h. It is McShane's extension G y = min_h (g h + countExcess (D h) y), the construction of Mathlib's LipschitzOnWith.extend_real specialized to the excess, for which ι → X carries no metric instance; the minimum also makes G invariant under reordering the rows.

theorem Cslib.Privacy.exists_symmetric_query_two_pow_mul_le {ι : Type u_1} {X : Type u_2} [Fintype ι] [Fintype X] {k L t : ℕ} (hLk : L ≤ k) (hX : 16 * L < Fintype.card X) (hι : t * L ≤ Fintype.card ι) :
∃ (F : (ι → X) → Fin k → ℝ), (∀ (x : ι → X) (σ : Equiv.Perm ι), F (x ∘ ⇑σ) = F x) ∧ PointwiseSensitivity HammingAdjacent F 1 ∧ ∀ (M : (ι → X) → PMF (Fin k → ℝ)) (ε : ℝ) (p : ENNReal), DifferentiallyPrivate HammingAdjacent M ε 0 → (∀ (x : ι → X), p ≤ (M x).toOuterMeasure {a : Fin k → ℝ | ∀ (j : Fin k), |a j - F x j| < ↑t * ↑L / 4}) → 2 ^ L * p ≤ ENNReal.ofReal (Real.exp (↑t * ↑L * ε))

De's lower bound over a small universe, packing form. Let L ≤ k, let the universe X have more than 16 L items and let there be at least t L rows. Then some query F : (ι → X) → (Fin k → ℝ) that depends only on the histogram of the dataset and changes by at most 1 in each coordinate between Hamming-adjacent datasets has the following property. If an (ε, 0)-private mechanism M answers F on every dataset with ℓ∞ error less than t L / 4 with probability at least p, then 2 ^ L · p ≤ exp (t L ε).

theorem Cslib.Privacy.exists_symmetric_query_forall_exists_half_lt {ι : Type u_1} {X : Type u_2} [Fintype ι] [Fintype X] {k : ℕ} (hk : 2 ≤ k) (hX : 33 ≤ Fintype.card X) {ε : ℝ} (hε : 0 < ε) (hε' : ε ≤ 1 / 18) (hι : min ↑k ↑(Fintype.card X) / ε ≤ ↑(Fintype.card ι)) :
∃ (F : (ι → X) → Fin k → ℝ), (∀ (x : ι → X) (σ : Equiv.Perm ι), F (x ∘ ⇑σ) = F x) ∧ PointwiseSensitivity HammingAdjacent F 1 ∧ ∀ (M : (ι → X) → PMF (Fin k → ℝ)), DifferentiallyPrivate HammingAdjacent M ε 0 → ∃ (x : ι → X), 2⁻¹ < (M x).toOuterMeasure {a : Fin k → ℝ | ∃ (j : Fin k), min ↑k ↑(Fintype.card X) / (1024 * ε) ≤ |a j - F x j|}

De's lower bound over a small universe, [DworkRoth2014, Theorem 8.8]. Let the universe X have d ≥ 33 items, let k ≥ 2, let ε ∈ (0, 1 / 18] and let there be n ≥ min (k, d) / ε rows. Some query F : (ι → X) → (Fin k → ℝ) that depends only on the histogram and changes by at most 1 in each coordinate between Hamming-adjacent datasets has the following property. Every (ε, 0)-private mechanism M has, on some dataset, noise of ℓ∞ norm at least min (k, d) / (1024 ε) with probability more than 1 / 2.

Dwork and Roth assume ε ≤ 1 / 40 and compare histograms by adding or removing a row; see the module docstring for the scope.