Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
286 commits
Select commit Hold shift + click to select a range
0868efc
updated
rshlyakh Jul 11, 2025
22ab161
allissuesfixed
rshlyakh Jul 11, 2025
08a661c
norm file
tetlow01 Jul 11, 2025
e0bd30a
Merge branch 'main' of github.com:Arasyilmaz1/LeanDP
tetlow01 Jul 11, 2025
4ee3680
beforepull
rshlyakh Jul 11, 2025
75326f4
Merge branch 'main' of https://github.com/Arasyilmaz1/LeanDP
rshlyakh Jul 11, 2025
38884e3
normalization of MB and RR
tetlow01 Jul 11, 2025
117f109
Ydef
rshlyakh Jul 11, 2025
9dd5d04
Merge branch 'main' of https://github.com/Arasyilmaz1/LeanDP
rshlyakh Jul 11, 2025
08fc08e
neighbourdef
rshlyakh Jul 11, 2025
66c1637
Update AccuracyProof.lean
PCChess Jul 12, 2025
d0692dd
Merge branch 'main' of https://github.com/Arasyilmaz1/LeanDP
PCChess Jul 12, 2025
6e88b00
Co-authored-by: perrynchang <[email protected]>
Arasyilmaz1 Jul 12, 2025
53b440d
DP Proof Updates
Arasyilmaz1 Jul 12, 2025
8b0db62
Merge branch 'main' of https://github.com/Arasyilmaz1/LeanDP
Arasyilmaz1 Jul 12, 2025
f54f642
DP proof updates and new definitions
Arasyilmaz1 Jul 14, 2025
de2b8bb
monday
rshlyakh Jul 14, 2025
8bb7565
Merge branch 'main' of https://github.com/Arasyilmaz1/LeanDP
rshlyakh Jul 14, 2025
1fd25fa
Update DPProof.lean
PCChess Jul 14, 2025
0b67adf
rrbasicproofs
rshlyakh Jul 14, 2025
cce03e3
Merge branch 'main' of https://github.com/Arasyilmaz1/LeanDP
rshlyakh Jul 14, 2025
e8cc097
ethan's code
tetlow01 Jul 14, 2025
494dd54
listlemmaproven
rshlyakh Jul 14, 2025
d1a9ca9
normalizationcleaned
rshlyakh Jul 14, 2025
5fb89c6
DPProof final step
PCChess Jul 15, 2025
60beee9
someENNRlemmas
rshlyakh Jul 15, 2025
bc2754a
Update DPProof.lean
PCChess Jul 15, 2025
c8d9c2f
Merge pull request #1 from Arasyilmaz1/Perryn's-proof-of-DP
Arasyilmaz1 Jul 15, 2025
7697873
ubuybg
Arasyilmaz1 Jul 15, 2025
102c8b5
Ruthless Robert + Aras code
Arasyilmaz1 Jul 15, 2025
5fcd682
new
rshlyakh Jul 15, 2025
29cbcc8
Merge branch 'main' of https://github.com/Arasyilmaz1/LeanDP
rshlyakh Jul 15, 2025
e32e934
Update DPProof.lean
PCChess Jul 15, 2025
cbe95c2
mergewperryn
rshlyakh Jul 15, 2025
c667f76
Merge branch 'main' of https://github.com/Arasyilmaz1/LeanDP
rshlyakh Jul 15, 2025
c0d42cc
Merge pull request #2 from Arasyilmaz1/Perryn's-proof-of-DP
rshlyakh Jul 15, 2025
349497c
reduction2
rshlyakh Jul 16, 2025
65e05de
head_tail_prod
tetlow01 Jul 17, 2025
7babcb5
bruh2
Jul 17, 2025
2051bdc
Update DP.lean
perrynchang Jul 17, 2025
6add5c6
Reduction2 updates
Arasyilmaz1 Jul 21, 2025
a555249
Merge branch 'main' of https://github.com/Arasyilmaz1/LeanDP
Arasyilmaz1 Jul 21, 2025
f5bd8fe
rralt
rshlyakh Jul 21, 2025
760c3d9
Merge remote-tracking branch 'origin/main' into Robert-reduction
rshlyakh Jul 21, 2025
bff22c0
proofupdates
rshlyakh Jul 21, 2025
f50f17b
cleanup
rshlyakh Jul 22, 2025
99bfa27
moreorganization
rshlyakh Jul 22, 2025
d3edd55
proof of DP reduction step
Arasyilmaz1 Jul 22, 2025
56f176d
reduction proof
Arasyilmaz1 Jul 22, 2025
5a79b5e
nochange
rshlyakh Jul 22, 2025
d70dcd7
Merge remote-tracking branch 'origin/main' into Robert-reduction
rshlyakh Jul 22, 2025
ebd7e73
updates
Arasyilmaz1 Jul 22, 2025
3cd65ff
Update
Arasyilmaz1 Jul 22, 2025
f0b61e9
nochange
rshlyakh Jul 22, 2025
8d68ac6
nosorries
rshlyakh Jul 23, 2025
09beb64
Merge pull request #4 from Arasyilmaz1/Robert-reduction
rshlyakh Jul 23, 2025
a779b24
nochange
rshlyakh Jul 23, 2025
ddab285
Merge pull request #5 from Arasyilmaz1/Robert-new
rshlyakh Jul 23, 2025
ee9573a
fixedtypos
rshlyakh Jul 23, 2025
ec9b59a
Merge pull request #6 from Arasyilmaz1/Robert-new
rshlyakh Jul 23, 2025
e310fca
ready to pull
tetlow01 Jul 24, 2025
b6c3da3
rappor
rshlyakh Jul 25, 2025
823bf22
rappordef
rshlyakh Jul 25, 2025
c78060c
equivDPdefs
rshlyakh Jul 25, 2025
cd7ae95
arithmetic
tetlow01 Jul 25, 2025
30c213a
finish final step
PCChess Jul 26, 2025
4e21042
monday
rshlyakh Jul 28, 2025
cd4da21
difflengthsproof
rshlyakh Jul 28, 2025
3ecd464
meow
rshlyakh Jul 28, 2025
54ab220
removedunsolvedlemmas
tetlow01 Jul 28, 2025
431e284
generalprodthm
rshlyakh Jul 28, 2025
a8156d2
Merge pull request #9 from Arasyilmaz1/PerrynDPProof
perrynchang Jul 28, 2025
ee34bdf
Merge pull request #10 from Arasyilmaz1/Product-theorems_Renee
perrynchang Jul 28, 2025
b1111ea
ready to pull
rshlyakh Jul 28, 2025
520d22a
Update DPProof.lean
PCChess Jul 28, 2025
bf72ae0
Merge remote-tracking branch 'origin/main' into Robert-new
rshlyakh Jul 28, 2025
5165f39
Update RandomizedResponseMain.lean
PCChess Jul 28, 2025
94961e3
nan
rshlyakh Jul 28, 2025
0f300b4
re-added lemmas
tetlow01 Jul 28, 2025
b93f2a5
Merge branch 'main' of github.com:Arasyilmaz1/LeanDP
tetlow01 Jul 28, 2025
ec94bd1
nan
rshlyakh Jul 28, 2025
3afda8b
slightlycleanedwithrappor
rshlyakh Jul 28, 2025
d40f0c1
Update DPProof.lean
PCChess Jul 28, 2025
edc04f0
Update DPProof.lean
PCChess Jul 29, 2025
4fa8d49
beginnings
rshlyakh Jul 29, 2025
642f772
someupdates
rshlyakh Jul 29, 2025
f7cd8cc
Simplification of Reduction final
Arasyilmaz1 Jul 29, 2025
403d1e1
more updates
Arasyilmaz1 Jul 29, 2025
d116cad
More cleaning on succHelp
Arasyilmaz1 Jul 29, 2025
6d6d80c
progress
rshlyakh Jul 29, 2025
1a9692d
finished sorrys basic lemmas
tetlow01 Jul 29, 2025
b275ea6
Merge branch 'main' of github.com:Arasyilmaz1/LeanDP
tetlow01 Jul 29, 2025
d00d05d
Merge remote-tracking branch 'origin/main' into Robert-Aras-RAPPOR
rshlyakh Jul 29, 2025
50e27ab
More simplification
Arasyilmaz1 Jul 29, 2025
cfc108b
more
rshlyakh Jul 29, 2025
df71530
Merge remote-tracking branch 'origin/main' into Robert-Aras-RAPPOR
rshlyakh Jul 29, 2025
1700afc
div_ne_top
tetlow01 Jul 29, 2025
887ad43
More cleaning
Arasyilmaz1 Jul 29, 2025
b0fce85
Beta generalization
Arasyilmaz1 Jul 29, 2025
db60b18
robert
rshlyakh Jul 29, 2025
fd5389b
mergecleaning
rshlyakh Jul 29, 2025
84bbf22
disgustingproof
rshlyakh Jul 29, 2025
a232ea7
final bound sorry
tetlow01 Jul 29, 2025
d72dbae
readytopull
rshlyakh Jul 29, 2025
5a57d41
Merge branch 'Robert-Aras-RAPPOR' of github.com:Arasyilmaz1/LeanDP in…
tetlow01 Jul 29, 2025
a408651
Merge branch 'Robert-Aras-RAPPOR' of https://github.com/Arasyilmaz1/L…
rshlyakh Jul 29, 2025
864b8dd
cleanedup
rshlyakh Jul 30, 2025
a9f3931
donefortoday
rshlyakh Jul 30, 2025
a1d1538
I lied
rshlyakh Jul 30, 2025
3daa814
Update dpproof
PCChess Jul 30, 2025
d3042f6
finish DPProof
PCChess Jul 30, 2025
4099711
reduction12
rshlyakh Jul 30, 2025
87577d3
readytoedit
rshlyakh Jul 30, 2025
98ae8e5
merged
rshlyakh Jul 30, 2025
02230c1
donefor730
rshlyakh Jul 31, 2025
fbd503f
work on sorry
tetlow01 Jul 31, 2025
71dbe4d
Merge branch 'Robert-Aras-RAPPOR' of github.com:Arasyilmaz1/LeanDP in…
tetlow01 Jul 31, 2025
3fae040
beforemerge
rshlyakh Jul 31, 2025
986cd96
Prod_over_prod lemma
Arasyilmaz1 Jul 31, 2025
38aa0d2
prod_over_prod
Arasyilmaz1 Jul 31, 2025
4cbe855
prod_over_prod
Arasyilmaz1 Jul 31, 2025
86dd61c
Merge branch 'Robert-Aras-RAPPOR' of https://github.com/Arasyilmaz1/L…
rshlyakh Jul 31, 2025
2aa1f44
mergedwithAras
rshlyakh Jul 31, 2025
afef1a7
arithmetic
rshlyakh Jul 31, 2025
ebf9ca7
morearith
rshlyakh Jul 31, 2025
0c3b335
Sorries
Arasyilmaz1 Jul 31, 2025
0c7a6a3
Merge branch 'Robert-Aras-RAPPOR' of https://github.com/Arasyilmaz1/L…
rshlyakh Jul 31, 2025
d43f8d0
newlemma
rshlyakh Jul 31, 2025
0faedb1
lesssorries
rshlyakh Jul 31, 2025
3961ce6
RapporSingleDP
tetlow01 Jul 31, 2025
dce93d0
Merge branch 'Robert-Aras-RAPPOR' of github.com:Arasyilmaz1/LeanDP in…
tetlow01 Jul 31, 2025
6c36f5a
readytomerge
rshlyakh Jul 31, 2025
a0b41ee
Merge branch 'Robert-Aras-RAPPOR' of https://github.com/Arasyilmaz1/L…
rshlyakh Jul 31, 2025
3377944
sorries
Arasyilmaz1 Jul 31, 2025
c255290
Merge branch 'Robert-Aras-RAPPOR' of https://github.com/Arasyilmaz1/L…
Arasyilmaz1 Jul 31, 2025
2545e62
closetodone
rshlyakh Jul 31, 2025
915bba3
Merge branch 'Robert-Aras-RAPPOR' of https://github.com/Arasyilmaz1/L…
rshlyakh Jul 31, 2025
e45debd
two sorrys left
tetlow01 Aug 1, 2025
1acadfc
Merge branch 'Robert-Aras-RAPPOR' of github.com:Arasyilmaz1/LeanDP in…
tetlow01 Aug 1, 2025
fa000e2
readytopull
rshlyakh Aug 1, 2025
fc55384
Merge branch 'Robert-Aras-RAPPOR' of https://github.com/Arasyilmaz1/L…
rshlyakh Aug 1, 2025
d6cb153
RAPPORdone
rshlyakh Aug 1, 2025
abb333e
ShuffleModelx
Arasyilmaz1 Aug 1, 2025
5109671
majorcleanup
rshlyakh Aug 1, 2025
d69805f
Merge branch 'Robert-Aras-RAPPOR' of https://github.com/Arasyilmaz1/L…
Arasyilmaz1 Aug 2, 2025
07e64e4
pullrequestversion
rshlyakh Aug 4, 2025
2c4669e
Merge branch 'Robert-Aras-RAPPOR' of https://github.com/Arasyilmaz1/L…
rshlyakh Aug 4, 2025
9ce3fcc
removedshuffle
rshlyakh Aug 4, 2025
138c3d1
Shuffle Folder
Arasyilmaz1 Aug 4, 2025
1def986
Shuffler update
Arasyilmaz1 Aug 5, 2025
c161290
Shuffler
Arasyilmaz1 Aug 5, 2025
491d196
nochange
rshlyakh Aug 5, 2025
58e0a15
Shuffle Model Implementation
Arasyilmaz1 Aug 5, 2025
2532049
Shuffle Updates
Arasyilmaz1 Aug 5, 2025
57eec6c
changed uniform sampling
tetlow01 Aug 6, 2025
1ea40e4
Merge branch 'Shuffle-Model' of github.com:Arasyilmaz1/LeanDP into Sh…
tetlow01 Aug 6, 2025
ba7f815
Shuffler Sorry
Arasyilmaz1 Aug 6, 2025
eedf74b
Merge branch 'Shuffle-Model' of https://github.com/Arasyilmaz1/LeanDP…
Arasyilmaz1 Aug 7, 2025
ba83a74
Shuffle sorry
Arasyilmaz1 Aug 7, 2025
bfaeaa5
UniformSample' norms
tetlow01 Aug 7, 2025
e4e764a
Merge branch 'Shuffle-Model' of github.com:Arasyilmaz1/LeanDP into Sh…
tetlow01 Aug 7, 2025
da5fe13
Arasyilmaz1 Aug 7, 2025
599c12f
Binoimial Theorem stuff
tetlow01 Aug 11, 2025
78b67bc
Update SampCert/DifferentialPrivacy/Pure/Local/ProbabilityProduct.lean
rshlyakh Aug 13, 2025
f873803
binomial normalizes
tetlow01 Aug 13, 2025
7b5b4bb
changed push forward
tetlow01 Aug 13, 2025
5af5644
Update ENNRealLemmasSuite.lean
PCChess Aug 13, 2025
5577891
added postprivprocess for DP Update
tetlow01 Aug 13, 2025
8166b73
nochange
rshlyakh Aug 14, 2025
3622b22
New Model of Shuffler
Arasyilmaz1 Aug 14, 2025
9cc1113
Merge branch 'Shuffle-Model' of https://github.com/Arasyilmaz1/LeanDP…
Arasyilmaz1 Aug 14, 2025
bc8c473
cleaned defs
tetlow01 Aug 14, 2025
e2359cb
-
tetlow01 Aug 15, 2025
a077c0f
tsum
Arasyilmaz1 Aug 15, 2025
d3bf696
Merge branch 'Shuffle-Model' of https://github.com/Arasyilmaz1/LeanDP…
Arasyilmaz1 Aug 15, 2025
5f2582e
shuffler_norms
tetlow01 Aug 15, 2025
2dc16c1
Shuffler reorganized
tetlow01 Aug 15, 2025
ee139cb
RRShuffle_norms
tetlow01 Aug 15, 2025
61ea0ed
localrandomizers
rshlyakh Aug 15, 2025
507a0ee
Merge branch 'Robert-Aras-RAPPOR' of https://github.com/Arasyilmaz1/L…
rshlyakh Aug 15, 2025
c3a241a
added defs
tetlow01 Aug 15, 2025
86d3320
changes
tetlow01 Aug 15, 2025
40a8d1d
Update on shuffle_permutes proof
Arasyilmaz1 Aug 15, 2025
9011927
post-processing is DP for randomized post-processing
PCChess Aug 18, 2025
7b996b7
Shuffle model permutes proof
Arasyilmaz1 Aug 18, 2025
1e2cd06
Merge branch 'Shuffle-Model' of https://github.com/Arasyilmaz1/LeanDP…
Arasyilmaz1 Aug 18, 2025
84701ca
file imports
PCChess Aug 18, 2025
adf8ea8
readytomerge
rshlyakh Aug 19, 2025
be9ef73
Merge pull request #11 from Arasyilmaz1/Robert-Aras-RAPPOR
rshlyakh Aug 19, 2025
de80b8e
main
rshlyakh Aug 19, 2025
72f1c30
Merge branch 'main' into Shuffle-Model
Arasyilmaz1 Aug 19, 2025
6803199
Merge pull request #12 from Arasyilmaz1/Shuffle-Model
Arasyilmaz1 Aug 19, 2025
0aea4eb
fixedimports
rshlyakh Aug 19, 2025
16736c5
Reorganization
Arasyilmaz1 Aug 19, 2025
de30306
Reorg 2
Arasyilmaz1 Aug 19, 2025
d0c5940
cleanedup
rshlyakh Aug 19, 2025
d2a0b93
Merge branch 'main' of https://github.com/Arasyilmaz1/LeanDP
rshlyakh Aug 19, 2025
2a3071a
Cleaning
Arasyilmaz1 Aug 19, 2025
176d187
Merge branch 'main' of https://github.com/Arasyilmaz1/LeanDP
Arasyilmaz1 Aug 19, 2025
6763a2c
Cleaning
Arasyilmaz1 Aug 19, 2025
e780ade
fixedunified
rshlyakh Aug 19, 2025
afedb06
Merge branch 'main' of https://github.com/Arasyilmaz1/LeanDP
rshlyakh Aug 19, 2025
6d9f600
Put Randomized Post Processing in New File
PCChess Aug 19, 2025
ba048f2
randomized post processing with update neighbour
PCChess Aug 19, 2025
bf30bcd
DP
rshlyakh Aug 19, 2025
1e62fc7
Update RandomizedPostProcessing.lean
PCChess Aug 19, 2025
2523a77
Merge branch 'main' of https://github.com/Arasyilmaz1/LeanDP
rshlyakh Aug 19, 2025
f79d318
provedDP
rshlyakh Aug 19, 2025
d3c764c
Update README.md
perrynchang Aug 20, 2025
07802f1
Update README.md
perrynchang Aug 20, 2025
813bd6c
Update README.md
perrynchang Aug 20, 2025
b378ff5
fortoday
rshlyakh Aug 20, 2025
8ef4c79
Merge branch 'main' of https://github.com/Arasyilmaz1/LeanDP
rshlyakh Aug 20, 2025
0f046fb
Update README.md
rshlyakh Aug 20, 2025
6587cf4
Update README.md
perrynchang Aug 20, 2025
c13bcc5
donefortoday
rshlyakh Aug 20, 2025
ecfbd37
Merge branch 'main' of https://github.com/Arasyilmaz1/LeanDP
rshlyakh Aug 20, 2025
821780e
Update DPwithUpdateNeighbour.lean
PCChess Aug 20, 2025
948d228
Update README.md
perrynchang Aug 20, 2025
454067a
final
rshlyakh Aug 20, 2025
0a665c1
Merge branch 'main' of https://github.com/Arasyilmaz1/LeanDP
rshlyakh Aug 20, 2025
300c6dd
Cleaning
Arasyilmaz1 Aug 20, 2025
7bed9e5
Update README.md
rshlyakh Aug 20, 2025
127d619
Update README.md
rshlyakh Aug 20, 2025
4162c4a
Update README.md
rshlyakh Aug 20, 2025
f0256f2
Update README.md
rshlyakh Aug 20, 2025
fa49bf1
Update README.md
rshlyakh Aug 20, 2025
97a864e
Update README.md
rshlyakh Aug 20, 2025
f4fa100
Update README.md
rshlyakh Aug 20, 2025
06acc04
Update README.md
rshlyakh Aug 20, 2025
084487f
deleteold
rshlyakh Aug 20, 2025
45c48e0
Update README.md
rshlyakh Aug 20, 2025
c6dde03
Update README.md
rshlyakh Aug 20, 2025
0af1fb9
Merge branch 'main' of https://github.com/Arasyilmaz1/LeanDP
rshlyakh Aug 20, 2025
12d102d
Update README.md
perrynchang Aug 20, 2025
423864f
addedbasic
rshlyakh Aug 20, 2025
6e8ac8d
cleaning
Arasyilmaz1 Aug 20, 2025
6f5d925
Merge branch 'main' of https://github.com/Arasyilmaz1/LeanDP
rshlyakh Aug 20, 2025
b008c09
Update RandomizedPostProcessing.lean
PCChess Aug 20, 2025
d854bfe
Update RandomizedPostProcessing.lean
PCChess Aug 20, 2025
66496be
Update Postprocessing.lean
PCChess Aug 20, 2025
c9de83d
urandom
rshlyakh Aug 20, 2025
6c7fe5d
Update README with personal project information
rshlyakh Aug 23, 2025
5ebb1b2
Remove AccuracyProof import from Basic.lean
rshlyakh Aug 25, 2025
0394941
final
rshlyakh Aug 27, 2025
2e0a849
final
rshlyakh Aug 27, 2025
456ee49
readytomerge
rshlyakh Aug 27, 2025
cdf62ce
Add O_CLOEXEC flag when opening /dev/urandom
rshlyakh Aug 27, 2025
b867aca
Merge pull request #13 from rshlyakh/main
rshlyakh Aug 27, 2025
8e9a7ba
Update README.md
rshlyakh Aug 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"compilerPath": "C:\\msys64\\ucrt64\\bin\\gcc.exe",
"cStandard": "c17",
"cppStandard": "gnu++17",
"intelliSenseMode": "windows-gcc-x64"
}
],
"version": 4
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"C_Cpp.errorSquiggles": "disabled"
}
84 changes: 67 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,72 @@
# SampCert
# Verifying Differential Privacy in Lean

A verified implementation using [Lean](https://github.com/leanprover/lean4) and [Mathlib](https://github.com/leanprover-community/mathlib4) of randomized algorithms including [the discrete Gaussian sampler for differential privacy](https://arxiv.org/abs/2004.00010), key results in [zero concentrated differential privacy](https://arxiv.org/abs/1605.02065), and [some verified (unbounded) private queries](https://arxiv.org/pdf/1909.01917).
The [SampCert](https://github.com/leanprover/SampCert) project (de Medeiros et al. 2024) was created to implement and formalize differential privacy notions in Lean. It provided support for various notions of differential privacy, a framework for implementing differentially private mechanisms via verified sampling algorithms, and implemented several differentially private algorithms, including the Gaussian and Laplace mechanisms.

SampCert is deployed and used in the [AWS Clean Rooms Differential Privacy service](https://docs.aws.amazon.com/clean-rooms/latest/userguide/differential-privacy.html#dp-overview). SampCert proves deep properties about some of its randomized algorithm and makes heavy use of Mathlib. For example, we use theorems such as [the Poisson summation formula](https://leanprover-community.github.io/mathlib4_docs/Mathlib/Analysis/Fourier/PoissonSummation.html#Real.tsum_eq_tsum_fourierIntegral_of_rpow_decay).
We build upon SampCert, creating support for the local model using [Lean](https://lean-lang.org/) and the extensive [Mathlib](https://github.com/leanprover-community/mathlib4) library. We also implement the [randomized response](https://www.tandfonline.com/doi/abs/10.1080/01621459.1965.10480775) and [one-time basic RAPPOR](https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/42852.pdf) mechanisms, as well as a more robust post-processing property for randomized mappings. We additionally move towards an implementation of the shuffle model.

The principal developer of SampCert is [Jean-Baptiste Tristan](https://jtristan.github.io/). It is also developed by [Markus de Medeiros](https://www.markusde.ca/).
Our implementations are in `SampCert/DifferentialPrivacy/Pure`. Our additions are in the Local folder, Shuffle Model folder, and a few separate files in the Pure folder.

Other people have contributed important ideas or tools for deployment including (in no particular order): Leo de Moura, Anjali Joshi, Joseph Tassarotti, Stefan Zetzsche, Aws Albharghouti, Muhammad Naveed, Tristan Ravitch, Fabian Zaiser, Tomas Skrivan.
### Local

To cite SampCert you can currently use the following reference:
```
@software{Tristan_SampCert_Verified_2024,
author = {Tristan, Jean-Baptiste},
doi = {10.5281/zenodo.11204806},
month = may,
title = {{SampCert : Verified Differential Privacy}},
url = {https://github.com/leanprover/SampCert},
version = {1.0.0},
year = {2024}
}
```
#### BinomialSample

We implement and show normalization for a sampler for the Binomial distribution.

#### LocalDP

The files in this folder provide a variety of definitions to support the local model of differential privacy. We create a definition of differential privacy that is parametrized by a neighbour relation, thus generalizing the SampCert definition. For the local model, we use the `DP_withUpdateNeighbour` definition of neighboring datasets, which considers two lists to be neighbouring if they differ in the update of a single entry.

We also show that if an $\epsilon$-local randomizer is extended to a dataset via monadic map, the resulting algorithm is $\epsilon$-differentially private. This is proven in `LocalDP_toDataset.`

#### MultiBernoulli

The files here implement and show normalization for the "multi-Bernoulli" distribution, which we define to be the distribution associated with flipping each entry of a list independently and with the same probability.

#### RAPPOR

In this folder, we provide an implementation of basic one-time RAPPOR and give a proof of differential privacy. The file `Definitions.lean` provides our implementation of RAPPOR. The file `Properties/DPProof.lean` provides a proof that our implementation of RAPPOR is differentially private.

#### RandomizedResponse

In this folder, we provide an implementation of randomized response and give a proof of differential privacy. The file `Definitions.lean` provides our implementation of randomized response. The file `Properties/DPProof.lean` provides a proof that our implementation of randomized response is differentially private.

#### ProbabilityProduct.lean

We show that the probability of generating a list of outputs is equal to the product of the probabilities of generating each output independently. This is used to prove our `LocalDP_toDataset` lemma.
#### PushForward.lean

We prove that the push-forward of a probability measure is a probability measure. A similar statement already exists in SampCert, but our rephrasing was slightly more convenient for our purposes.
#### Reduction.lean

We prove a helper lemma that is used in proving a local algorithm is DP. It allows us to reduce the problem to just considering the local randomizer.

### Shuffle model

This folder contains the implementation and properties of the shuffle model.

#### Definitions.lean

This contains the definition of the shuffle model. The definition `Shuffler` is the randomized permutation. We implement the shuffle algorithm with randomized response in `RRShuffle`, and provide a more general definition in `ShuffleAlgorithm`.

#### Properties.lean

This instantiates the shuffle algorithm as a PMF, and show that our algorithm for a random permutation that is indeed uniformly random. In the theorem `ShuffleAlgorithm_is_DP`, we show that shuffling the output of a differentially-private algorithm does not worsen the differential privacy bound.

#### ENNRealLemmaSuite.lean

A significant challenge in our work was proving arithemetic statements over extended non-negative reals. Mathlib currently provides less support for arithmetic in the ENNReal type, so oftentimes we have to prove statements ourselves. These statements are in this file.

#### LawfulMonadSLang.lean

We instantiate SLang as a LawfulMonad.

#### Normalization.lean

We prove a lemma showing that the mass of a distribution is preserved under monadic map. This is used for both of the local algorithms that we implemented.

### RandomizedPostProcess.lean

This file provides the Lean proof about the post-processing property of differential privacy: If there is an $\epsilon$-DP mechanism $M: X \rightarrow W$ and a (possibly randomized) mapping $F: W \rightarrow Z$, then $F \circ M$ is $\epsilon$-DP. The case where $F$ is deterministic is implemented in SampCert. We implement the case where $F$ is random. The result is in the lemma
``randPostProcess_DP_bound_with_UpdateNeighbour``.

We would like to thank SampCert for motivating and being the basis for our project. We would also like to thank Google for sponsoring and mentoring this project, and the Institute of Pure and Applied Mathematics (IPAM) for supporting and hosting our work.
3 changes: 1 addition & 2 deletions SampCert/DifferentialPrivacy/Neighbours.lean
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ variable {T : Type}
/--
Lists which differ by the inclusion or modification of an element.

This is SampCert's private property.
This is SampCert's private property.
-/
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₂


/--
Neighbour relation is symmetric.
-/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import SampCert.DifferentialPrivacy.Pure.Local.LocalDP.DPwithUpdateNeighbour
import SampCert.DifferentialPrivacy.Pure.Local.MultiBernoulli.Code
import SampCert.DifferentialPrivacy.Pure.Local.MultiBernoulli.Properties
import SampCert.DifferentialPrivacy.Pure.Local.PushForward

namespace SLang

def BinomialSample (seed: MultiBernoulli.SeedType)(n:PNat) := do
let seeds := List.replicate n seed
let list ← MultiBernoulli.MultiBernoulliSample (seeds)
let k := List.count true list
return k

theorem BinomialSample_norms [LawfulMonad SLang] (seed : MultiBernoulli.SeedType) (n : PNat) :
HasSum (BinomialSample seed n) 1 := by
rw [BinomialSample]
simp
unfold probBind
simp [Summable.hasSum_iff ENNReal.summable]
have h: (push_forward (MultiBernoulli.MultiBernoulliSample (List.replicate (↑n) seed))
(fun (a : List Bool) => (List.count true a))) = (fun (b : Nat) =>
(∑' (a : List Bool), if b = List.count true a then MultiBernoulli.MultiBernoulliSample
(List.replicate (↑n) seed) a else 0)) := by
unfold push_forward
rfl

rw [← h]
rw [push_forward_prob_is_prob]
simp [MultiBernoulli.MultiBernoulliSample_normalizes]

def BinomialSample_PMF [LawfulMonad SLang] (seed : MultiBernoulli.SeedType) (n : PNat) : PMF ℕ :=
⟨BinomialSample seed n, BinomialSample_norms seed n⟩
Loading