EasyCrypt's bypr, on equiv judgments #
EC's bypr (res{1}) (res{2}) proves that two procedures return the same result,
equiv[ p₁ ~ p₂ : P ==> ={res} ]
from the equality of the probabilities of each result,
∀ a₁ &1 a₂ &2 v, P → Pr[ p₁ (a₁) @ &1 : res = v ] = Pr[ p₂ (a₂) @ &2 : res = v ]
(prhlProc_res_of_Pr_eq). The coupling is not built by hand: two programs whose results have
the same distribution are related by the wp-lifting for the relation "the same result"
(ProgramDenotation.rel_fst_of_wp_eq), and the wp-lifting gives a coupling (discrete Strassen:
ProgramDenotation.relE.to_prhl2).
The expected value of a function of the result: the sum, over the results, of its value times the probability of the result.
Programs whose results have the same distribution are related, in the wp-lifting, by "the same result".
Programs whose results have the same distribution can be coupled on "the same result".
EC's bypr (res{1}) (res{2}): two procedures with the same result type return the same
result (under a coupling) when each result has the same probability on the two sides.
EC's bypr (res{1}) (res{2}) on equiv[ p₁ ~ p₂ : P ==> ={res} ]: the goal becomes
∀ a₁ &1 a₂ &2 v, P → Pr[ p₁ (a₁) @ &1 : res = v ] = Pr[ p₂ (a₂) @ &2 : res = v ] (EC's goal
after bypr … => &1 &2 v: the arguments, the memories and the value are introduced by
intro).
Equations
- One or more equations did not get rendered due to their size.