Coupling introduction for relE (the symmetric proof principle) #
A relE judgment is two rel directions, and for asymmetric coupling
relations the two directions are not logically interderivable — proving
them separately duplicates the whole case analysis (the "mirror tax"
measured in the up-to-bad client).
This module provides the missing symmetric introduction form: an
explicit coupling witness — a joint subdistribution over output pairs
whose marginals are the two runs and whose support lies in the post —
yields both directions at once (ProgramDenotation.relE.of_coupling). This is
the CertiCrypt/FCF lifting, deliberately confined to its sweet spot:
- leaves are proved by exhibiting a coupling (
Coupling.of_purefor deterministic steps,Coupling.of_uniformfor synchronized sampling — the closed wp forms required as inputs are exactly what thewp-style proofs compute anyway, now stated once instead of once per direction); - composition stays with the wp-lifting rules (
relE.bind,relE.loop_n, …), which need no couplings, no measurability, and no choice principles.
A coupling witness for the runs p from σ₁ and q from σ₂: a joint
subdistribution on output pairs with the two runs as marginals and
support inside Post (stated in CertiCrypt's range form, which needs
no decidability).
- w : SubProbability ((α × s₁) × β × s₂)
The joint subdistribution.
Left marginal: integrating a left-post recovers
p's run.Right marginal.
- supp (f : (α × s₁) × β × s₂ → ENNReal) : (∀ (uv : (α × s₁) × β × s₂), Post uv.1 uv.2 → f uv = 0) → self.w.expected f = 0
Support condition: any function vanishing on
Postintegrates to 0.
Instances For
Expected-value helpers #
Expected value of the constant-zero post.
Pointwise congruence for expected.
Collapse a constant average.
Domination through the witness: a Post-pointwise inequality between
pair-posts integrates.
Deterministic coupling: both runs are point masses on a
Post-related pair of outputs.
Equations
Instances For
Sampling coupling along a shared index (the rnd rule with an
explicit branch matching): both runs are uniform averages over T,
coupled branch-by-branch.
Equations
- GaudisCrypt.ProgramDenotation.Coupling.of_uniform f₁ f₂ h₁ h₂ hP = { w := do let t ← GaudisCrypt.SubProbability.uniform pure (f₁ t, f₂ t), marg₁ := ⋯, marg₂ := ⋯, supp := ⋯ }
Instances For
Coupling introduction (the symmetric proof principle): a coupling
witness at every Pre-related state pair yields the full two-sided
relE judgment — both directions from the same witness.