Documentation

CslibFrontier.Privacy.DifferentialPrivacy.Hamming

Hamming adjacency and group privacy #

Datasets are maps x : ι → X assigning a row to each index. Two datasets are Hamming-adjacent (HammingAdjacent) when they differ in at most one row, the neighbor relation of [GhoshRoughgardenSundararajan2012, §2.1]. For finite ι this is hammingDist x y ≤ 1 (hammingAdjacent_iff_hammingDist_le_one).

Group privacy: a mechanism that is (ε, δ)-private for Hamming adjacency is (k ε, ∑ i < k, exp (i ε) · δ)-private for datasets at Hamming distance at most k (DifferentiallyPrivate.hammingDist_le). For δ = 0 this is (k ε, 0) (DifferentiallyPrivate.hammingDist_le_of_pure), the Hamming-distance form of [DworkRoth2014, Theorem 2.2], which is stated for ℓ₁ distance between histograms; for 0 ≤ ε the additive term is at most k exp ((k - 1) ε) δ (DifferentiallyPrivate.hammingDist_le'), the bound in the footnote to that theorem. The proof walks along a chain of adjacent datasets.

DifferentiallyPrivate.pi: if every respondent applies an (ε, 0)-private local randomizer to their own row independently, the joint mechanism is (ε, 0)-private for Hamming adjacency.

Main definitions #

Main results #

References #

def Cslib.Privacy.HammingAdjacent {ι : Type u_1} {X : Type u_2} (x y : ι → X) :

Two datasets are Hamming-adjacent when they differ in at most one row.

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

For finitely many rows, Hamming adjacency is Hamming distance at most one.

theorem Cslib.Privacy.HammingAdjacent.refl {ι : Type u_1} {X : Type u_2} (x : ι → X) :

Every dataset is Hamming-adjacent to itself.

theorem Cslib.Privacy.HammingAdjacent.symm {ι : Type u_1} {X : Type u_2} {x y : ι → X} (h : HammingAdjacent x y) :

Hamming adjacency is symmetric.

theorem Cslib.Privacy.hammingAdjacent_update {ι : Type u_1} {X : Type u_2} [DecidableEq ι] (x : ι → X) (i : ι) (a : X) :

Changing one row gives a Hamming-adjacent dataset.

theorem Cslib.Privacy.HammingAdjacent.eq_update {ι : Type u_1} {X : Type u_2} [DecidableEq ι] {x y : ι → X} (h : HammingAdjacent x y) {i : ι} (hi : x i ≠ y i) :
y = Function.update x i (y i)

A Hamming-adjacent dataset is obtained by changing any row in which it differs.

theorem Cslib.Privacy.exists_hammingDist_le_and_hammingAdjacent {ι : Type u_1} {X : Type u_2} [Fintype ι] [DecidableEq X] {k : ℕ} {x y : ι → X} (h : hammingDist x y ≤ k + 1) :
∃ (z : ι → X), hammingDist x z ≤ k ∧ HammingAdjacent z y

A pair at Hamming distance at most k + 1 passes through a dataset at distance at most k from the first and adjacent to the second.

theorem Cslib.Privacy.DifferentiallyPrivate.hammingDist_le {R : Type v} {ι : Type u_1} {X : Type u_2} [Fintype ι] [DecidableEq X] {M : (ι → X) → PMF R} {ε : ℝ} {δ : ENNReal} (h : DifferentiallyPrivate HammingAdjacent M ε δ) (k : ℕ) :
DifferentiallyPrivate (fun (x y : ι → X) => hammingDist x y ≤ k) M (↑k * ε) (∑ i ∈ Finset.range k, ENNReal.ofReal (Real.exp (↑i * ε)) * δ)

Group privacy: an (ε, δ)-private mechanism for Hamming adjacency is (k ε, ∑ i < k, exp (i ε) · δ)-private for datasets at Hamming distance at most k.

theorem Cslib.Privacy.DifferentiallyPrivate.hammingDist_le_of_pure {R : Type v} {ι : Type u_1} {X : Type u_2} [Fintype ι] [DecidableEq X] {M : (ι → X) → PMF R} {ε : ℝ} (h : DifferentiallyPrivate HammingAdjacent M ε 0) (k : ℕ) :
DifferentiallyPrivate (fun (x y : ι → X) => hammingDist x y ≤ k) M (↑k * ε) 0

Group privacy for pure privacy: an (ε, 0)-private mechanism for Hamming adjacency is (k ε, 0)-private for datasets at Hamming distance at most k (the Hamming-distance form of [DworkRoth2014, Theorem 2.2]).

theorem Cslib.Privacy.DifferentiallyPrivate.hammingDist_le' {R : Type v} {ι : Type u_1} {X : Type u_2} [Fintype ι] [DecidableEq X] {M : (ι → X) → PMF R} {ε : ℝ} {δ : ENNReal} (h : DifferentiallyPrivate HammingAdjacent M ε δ) (hε : 0 ≤ ε) (k : ℕ) :
DifferentiallyPrivate (fun (x y : ι → X) => hammingDist x y ≤ k) M (↑k * ε) (↑k * ENNReal.ofReal (Real.exp (↑(k - 1) * ε)) * δ)

Group privacy with the additive term k exp ((k - 1) ε) δ of the footnote to [DworkRoth2014, Theorem 2.2], for 0 ≤ ε.

theorem Cslib.Privacy.DifferentiallyPrivate.pi {ι : Type u_1} {X : Type u_2} {Y : Type u_3} [Fintype ι] [Finite Y] {M : ι → X → PMF Y} {ε : ℝ} (hε : 0 ≤ ε) (h : ∀ (i : ι), DifferentiallyPrivate (fun (x x_1 : X) => True) (M i) ε 0) :
DifferentiallyPrivate HammingAdjacent (fun (x : ι → X) => Probability.PMF.pi fun (i : ι) => M i (x i)) ε 0

Products of local randomizers: if each respondent's randomizer M i is (ε, 0)-private against arbitrary changes of its own input, the mechanism applying all of them independently is (ε, 0)-private for Hamming adjacency.