Quantitative Relational Program Logic (eRHL) #
This file develops the main theorem layer for the eRHL-style quantitative relational
logic for OracleComp, building on the core interfaces in
VCVio.ProgramLogic.Relational.QuantitativeDefs.
The core idea (from Avanzini-Barthe-Gregoire-Davoli, POPL 2025) is to make pre/postconditions
ℝ≥0∞-valued instead of Prop-valued. This subsumes both pRHL (exact coupling, via indicator
postconditions) and apRHL (ε-approximate coupling, via threshold preconditions).
Main results in this file #
- coupling-mass lemmas and support facts
- introduction, consequence, and bind rules for eRHL
- bridges to exact and approximate couplings
- total-variation characterizations via
EqRel
Design #
eRHL (ℝ≥0∞-valued pre/post)
/ | \
/ | \
pRHL (exact) apRHL (ε-approx) stat-distance
indicator R 1-ε, indicator R 1, indicator(=)
Helpers for coupling mass #
Bridge: the eRHL-based definition agrees with the existing coupling-based one.
Forward direction blocker: RelTriple' → CouplingPost requires extracting a coupling c
with f(c) = 1 from 1 ≤ ⨆ c, f(c). Although the coupling polytope is compact and f is
linear (so the max IS attained in standard math), formalizing this in Lean requires proving
compactness of the coupling space, which needs topology infrastructure not yet available here.
Bridge: RelTriple' agrees with the existing RelTriple.
If a RelTriple' holds for fun a b => f a = g b, then mapping by f and g
produces equal distributions. This is the eRHL-level version of
evalDist_map_eq_of_relTriple.
eRHL rules #
Pure rule for eRHL.
Monotonicity/consequence rule for eRHL.
Bind/sequential composition rule for eRHL.
Helpers for statistical distance / coupling characterization #
Statistical distance via eRHL #
Statistical distance as a complement of eRHL value with equality indicator.
Uses SPMF.tvDist directly to handle cross-spec comparison.
Game equivalence from pRHL equality coupling.