Documentation

GaudisCrypt.Lib.EC.Distr

EasyCrypt's distributions (theories/distributions/) #

EasyCrypt's 'a distr is a sub-probability, here SubProbability. Only what ported developments use is here. Names are EasyCrypt's.

EasyCrypthere
d1 \*` d2 (DProd) | dprod d1 d2`
d \ P (Dexcepted)dexcepted d P
{0,1}, dbool (DBool)dbool
is_lossless d, is_full d, is_funiform dthe same
noncomputable def GaudisCrypt.EC.dprod {α β : Type} (d1 : SubProbability α) (d2 : SubProbability β) :

d1 \*` d2`: the product distribution, sampling both independently.

Equations
Instances For
    noncomputable def GaudisCrypt.EC.mu1 {α : Type} (d : SubProbability α) (x : α) :

    EC's mu1 d x: the probability of x under d, a real.

    Equations
    Instances For
      theorem GaudisCrypt.EC.mu_ne_top {α : Type} (d : SubProbability α) (x : α) :
      ↑d {x} ≠ ⊤

      EC's mu_bounded, as finiteness: a point has finite mass.

      is_lossless d: d has total mass 1.

      Equations
      Instances For
        theorem GaudisCrypt.EC.is_lossless_iff_expected {α : Type} (d : SubProbability α) :
        is_lossless d ↔ (d.expected fun (x : α) => 1) = 1

        Losslessness as an expectation: the expected value of 1 is 1.

        theorem GaudisCrypt.EC.dprod_ll {α β : Type} {d1 : SubProbability α} {d2 : SubProbability β} (h1 : is_lossless d1) (h2 : is_lossless d2) :

        lemma dprod_ll: the product of lossless distributions is lossless.

        lemma duniform_ll for a finite nonempty type: the uniform distribution is lossless.

        is_full d: every value is in the support of d.

        Equations
        Instances For

          is_funiform d: all values have the same probability.

          Equations
          Instances For

            lemma duniform_funi for a finite nonempty type: the uniform distribution is uniform.

            lemma duniform_fu for a finite nonempty type: every value has positive probability.

            theorem GaudisCrypt.EC.eq_distr {α : Type} {μ ν : SubProbability α} (h : ∀ (x : α), ↑μ {x} = ↑ν {x}) :
            μ = ν

            lemma eq_distr (one direction): distributions with the same point masses are equal.

            theorem GaudisCrypt.EC.mu1_eq_expected {α : Type} (d : SubProbability α) (v : α) :
            ↑d {v} = d.expected fun (a : α) => if a = v then 1 else 0

            mu1 d v as the expectation of the indicator of v (EC's mu1 is mu d (pred1 v)).

            theorem GaudisCrypt.EC.dprod1E {α β : Type} (d1 : SubProbability α) (d2 : SubProbability β) (x : α) (y : β) :
            ↑(dprod d1 d2) {(x, y)} = ↑d1 {x} * ↑d2 {y}

            lemma dprod1E: the point masses of the product distribution are products.

            theorem GaudisCrypt.EC.dprod_fu {α β : Type} {d1 : SubProbability α} {d2 : SubProbability β} (h1 : is_full d1) (h2 : is_full d2) :
            is_full (dprod d1 d2)

            supp_dprod, as fullness: a product of full distributions is full.

            noncomputable def GaudisCrypt.EC.dexcepted {α : Type} (d : SubProbability α) (P : α → Prop) :

            d \ P: d conditioned on not satisfying P. EasyCrypt normalizes the restriction of d to ¬ P. Here that is done for lossless d with a ¬ P outcome of positive probability; otherwise the result is the null distribution, as in EasyCrypt when no such outcome exists.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For

              lemma dbool1E: each boolean has probability 1/2.