Documentation

CslibFrontier.Probability.Distributional.Distinguishing

Distribution distinguishing problems #

A DistinguishingProblem consists of two discrete laws on the observations supplied to a test. Its experiment draws from the null law for false and the alternative law for true, then runs a randomized Boolean test. The hypothesis bit selects the law; it is not given to the test.

The definition does not choose an encoding, an algorithm class or a resource bound. In particular, specifying a law does not assert that it has an efficient sampler. A family may use a different observation type at every parameter. The shared Boolean-game predicates in Crypto/Game can then restrict tests by any model of computation.

map and bind apply the same deterministic or randomized transformation to both laws. Their experiment equations express exactly the composition used by distributional reductions; efficiency and approximation bounds are separate obligations of a concrete reduction.

Two observation laws to be distinguished, independent of a computational model.

  • nullDist : PMF Input

    The observation law under the null hypothesis.

  • alternativeDist : PMF Input

    The observation law under the alternative hypothesis.

noncomputable def Cslib.Probability.DistinguishingProblem.experiment {Input : Type u_1} (P : DistinguishingProblem Input) (hypothesis : Bool) (test : Input → PMF Bool) :

Draw from the selected law and run the test, revealing only the sampled observation.

@[simp]

Under the null hypothesis the test receives a sample from nullDist.

@[simp]

Under the alternative hypothesis the test receives a sample from alternativeDist.

theorem Cslib.Probability.DistinguishingProblem.experiment_pure {Input : Type u_1} (P : DistinguishingProblem Input) (hypothesis : Bool) (test : Input → Bool) :
(P.experiment hypothesis fun (input : Input) => PMF.pure (test input)) = PMF.map test (if hypothesis = true then P.alternativeDist else P.nullDist)

A deterministic test pushes the selected input law forward to its Boolean answer.

@[simp]
theorem Cslib.Probability.DistinguishingProblem.experiment_const {Input : Type u_1} (P : DistinguishingProblem Input) (hypothesis : Bool) (answer : PMF Bool) :
(P.experiment hypothesis fun (x : Input) => answer) = answer

A test that ignores its observation has the same answer law under either hypothesis.

noncomputable def Cslib.Probability.DistinguishingProblem.map {Input : Type u_1} {Output : Type u_2} (P : DistinguishingProblem Input) (f : Input → Output) :

Apply one deterministic observation map under both hypotheses.

noncomputable def Cslib.Probability.DistinguishingProblem.bind {Input : Type u_1} {Output : Type u_2} (P : DistinguishingProblem Input) (kernel : Input → PMF Output) :

Apply one randomized observation kernel under both hypotheses.

theorem Cslib.Probability.DistinguishingProblem.experiment_map {Input : Type u_1} {Output : Type u_2} (P : DistinguishingProblem Input) (f : Input → Output) (hypothesis : Bool) (test : Output → PMF Bool) :
(P.map f).experiment hypothesis test = P.experiment hypothesis fun (input : Input) => test (f input)

Testing deterministically transformed observations precomposes the test with the map.

theorem Cslib.Probability.DistinguishingProblem.experiment_bind {Input : Type u_1} {Output : Type u_2} (P : DistinguishingProblem Input) (kernel : Input → PMF Output) (hypothesis : Bool) (test : Output → PMF Bool) :
(P.bind kernel).experiment hypothesis test = P.experiment hypothesis fun (input : Input) => (kernel input).bind test

Testing randomly transformed observations composes the kernel with the test.

theorem Cslib.Probability.DistinguishingProblem.experiment_map_answer {Input : Type u_1} (P : DistinguishingProblem Input) (hypothesis : Bool) (test : Input → PMF Bool) (f : Bool → Bool) :
(P.experiment hypothesis fun (input : Input) => PMF.map f (test input)) = PMF.map f (P.experiment hypothesis test)

Postprocessing the test's answer postprocesses the experiment's answer.