EC's rnd f g #
rnd f g.
on c₁; x <$ d₁ ~ c₂; y <$ d₂ : P ==> Q couples the two samplings along the bijection f
with inverse g, and leaves EC's three conditions in the postcondition of the code before:
(forall rR, rR \in d₂ => rR = f (g rR)) /\
(forall rR, rR \in d₂ => mu1 d₂ rR = mu1 d₁ (g rR)) /\
(forall rL, rL \in d₁ => f rL \in d₂ /\ rL = g (f rL) /\ Q[x := rL, y := f rL])
equiv_rnd f (Logic/PRHLWp.lean) asks instead that f push d₁ to d₂, an equation of
distributions that is found for a few shapes of f on the uniform distribution; with the
inverse, the conditions are EC's equations.
A bijection between the supports that keeps the point masses pushes d₁ to d₂ (EC's
conditions of rnd f g).
The uniform distribution gives all values the same probability: EC's condition
mu1 d₂ rR = mu1 d₁ (g rR) of rnd f g for two uniform samplings.
EC's rnd f g: the last statements of both sides are samplings x₁ <$ d₁, x₂ <$ d₂,
coupled along f with inverse g (prhlStmt_seq_sample_inv): the postcondition before them is
EC's three conditions. f, g are relational terms (§x{1}, §x{2}).
Equations
- One or more equations did not get rendered due to their size.