-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from leanprover/ConcentratedBound
Query verification
- Loading branch information
Showing
32 changed files
with
1,903 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/- | ||
Copyright (c) 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Jean-Baptiste Tristan | ||
-/ | ||
|
||
variable {T : Type} | ||
|
||
inductive Neighbour (l₁ l₂ : List T) : Prop where | ||
| Addition : l₁ = a ++ b → l₂ = a ++ [n] ++ b → Neighbour l₁ l₂ | ||
| Deletion : l₁ = a ++ [n] ++ b → l₂ = a ++ b → Neighbour l₁ l₂ | ||
| Update : l₁ = a ++ [n] ++ b → l₂ = a ++ [m] ++ b -> Neighbour l₁ l₂ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/- | ||
Copyright (c) 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Jean-Baptiste Tristan | ||
-/ | ||
|
||
import Mathlib.Topology.Algebra.InfiniteSum.Ring | ||
import Mathlib.NumberTheory.ModularForms.JacobiTheta.TwoVariable | ||
import Mathlib.Analysis.SpecialFunctions.Pow.NNReal | ||
|
||
open Real ENNReal | ||
|
||
variable {T : Type} | ||
|
||
noncomputable def RenyiDivergence (p q : T → ENNReal) (α : ℝ) : ℝ := | ||
(α - 1)⁻¹ * Real.log (∑' x : T, (p x)^α * (q x)^(1 - α)).toReal | ||
|
||
theorem RenyiDivergenceExpectation (p q : T → ENNReal) {α : ℝ} (h : 1 < α) (h1 : ∀ x : T, q x ≠ 0) (h2 : ∀ x : T, q x ≠ ⊤) : | ||
(∑' x : T, (p x)^α * (q x)^(1 - α)) = ∑' x : T, (p x / q x)^α * (q x) := by | ||
congr 4 | ||
ext x | ||
rw [ENNReal.rpow_sub] | ||
. rw [← ENNReal.mul_comm_div] | ||
rw [← ENNReal.div_rpow_of_nonneg] | ||
. rw [ENNReal.rpow_one] | ||
. apply le_of_lt (lt_trans Real.zero_lt_one h ) | ||
. apply h1 x | ||
. apply h2 x | ||
|
||
theorem RenyiDivergenceExpectation' (p q : T → ENNReal) {α : ℝ} (h : 1 < α) (h1 : ∀ x : T, q x ≠ 0) (h2 : ∀ x : T, q x ≠ ⊤) : | ||
(α - 1)⁻¹ * Real.log ((∑' x : T, (p x)^α * (q x)^(1 - α))).toReal = (α - 1)⁻¹ * Real.log (∑' x : T, (p x / q x)^α * (q x)).toReal := by | ||
congr 4 | ||
ext x | ||
rw [ENNReal.rpow_sub] | ||
. rw [← ENNReal.mul_comm_div] | ||
rw [← ENNReal.div_rpow_of_nonneg] | ||
. rw [ENNReal.rpow_one] | ||
. apply le_of_lt (lt_trans Real.zero_lt_one h ) | ||
. apply h1 x | ||
. apply h2 x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/- | ||
Copyright (c) 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Jean-Baptiste Tristan | ||
-/ | ||
|
||
import Mathlib.Topology.Algebra.InfiniteSum.Ring | ||
import Mathlib.Algebra.Group.Basic | ||
import SampCert.SLang | ||
import SampCert.DifferentialPrivacy.Neighbours | ||
|
||
open Classical Nat Int Real | ||
|
||
variable {T : Type} | ||
|
||
noncomputable def sensitivity (q : List T → ℤ) (Δ : ℕ) : Prop := | ||
∀ l₁ l₂ : List T, Neighbour l₁ l₂ → Int.natAbs (q l₁ - q l₂) ≤ Δ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/- | ||
Copyright (c) 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Jean-Baptiste Tristan | ||
-/ | ||
|
||
import Mathlib.Topology.Algebra.InfiniteSum.Basic | ||
import Mathlib.Topology.Algebra.InfiniteSum.Ring | ||
import Mathlib.Algebra.Group.Basic | ||
import SampCert.DifferentialPrivacy.ZeroConcentrated.ConcentratedBound | ||
import SampCert.SLang | ||
import SampCert.Samplers.GaussianGen.Basic | ||
import SampCert.DifferentialPrivacy.Neighbours | ||
import SampCert.DifferentialPrivacy.Sensitivity | ||
import Mathlib.MeasureTheory.MeasurableSpace.Basic | ||
import Mathlib.MeasureTheory.Measure.Count | ||
import Mathlib.Probability.ProbabilityMassFunction.Integrals | ||
import Mathlib.Analysis.Convex.SpecificFunctions.Basic | ||
import Mathlib.Analysis.Convex.Integral | ||
|
||
def DP (q : List T → SLang U) (ε : ℝ) : Prop := | ||
∀ α : ℝ, 1 < α → ∀ l₁ l₂ : List T, Neighbour l₁ l₂ → | ||
RenyiDivergence (q l₁) (q l₂) α ≤ (1/2) * ε ^ 2 * α | ||
|
||
def NonZeroNQ (nq : List T → SLang U) := | ||
∀ l : List T, ∀ n : U, nq l n ≠ 0 | ||
|
||
def NonTopSum (nq : List T → SLang U) := | ||
∀ l : List T, ∑' n : U, nq l n ≠ ⊤ | ||
|
||
def NonTopNQ (nq : List T → SLang U) := | ||
∀ l : List T, ∀ n : U, nq l n ≠ ⊤ | ||
|
||
def NonTopRDNQ (nq : List T → SLang U) : Prop := | ||
∀ α : ℝ, 1 < α → ∀ l₁ l₂ : List T, Neighbour l₁ l₂ → | ||
∑' (x : U), nq l₁ x ^ α * nq l₂ x ^ (1 - α) ≠ ⊤ |
8 changes: 8 additions & 0 deletions
8
SampCert/DifferentialPrivacy/ZeroConcentrated/Foundations/Composition/Basic.lean
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/- | ||
Copyright (c) 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Jean-Baptiste Tristan | ||
-/ | ||
|
||
import SampCert.DifferentialPrivacy.ZeroConcentrated.Foundations.Composition.Code | ||
import SampCert.DifferentialPrivacy.ZeroConcentrated.Foundations.Composition.Properties |
18 changes: 18 additions & 0 deletions
18
SampCert/DifferentialPrivacy/ZeroConcentrated/Foundations/Composition/Code.lean
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/- | ||
Copyright (c) 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
Released under Apache 2.0 license as described in the file LICENSE. | ||
Authors: Jean-Baptiste Tristan | ||
-/ | ||
|
||
import SampCert.SLang | ||
|
||
noncomputable section | ||
|
||
namespace SLang | ||
|
||
def Compose (nq1 nq2 : List T → SLang ℤ) (l : List T) : SLang (ℤ × ℤ) := do | ||
let A ← nq1 l | ||
let B ← nq2 l | ||
return (A,B) | ||
|
||
end SLang |
Oops, something went wrong.