Skip to content

Rényi-∞ divergence machinery for oracle-bounded reductions - #1076

Draft
Gustavo2622 wants to merge 3 commits into
mainfrom
library_renyi_divergence
Draft

Gustavo2622 wants to merge 3 commits into
mainfrom
library_renyi_divergence

Conversation

@Gustavo2622

Copy link
Copy Markdown
Contributor

The Rényi-∞ (max-divergence / dominance) machinery for bounded-query reductions:

  • RDiv.ec: Rényi-∞ / max-divergence (rdiv_inf, dominated) with probability preservation (dominated_pr / rdiv_inf_pr), structural composition (dmap/dlet/dprod/dlist/dexcepted/dcond/djoin/dfold/dfun), and a distinguisher layer (Sample, adv_rdiv_inf, adv_rdiv_inf_dlist).
  • BoundedPreSample.ec: fresh-sampling = presampling-a-list equivalence (eq_pr_fresh_ref) for bounded-query adversaries; admit-free.
  • RDivOracle.ec: parametric bounded-query advantage bound rdiv_bound_sampler (Pr[Game1] <= M^N * Pr[Game2]) via BoundedPreSample + dlist tensorization.

@Gustavo2622
Gustavo2622 requested a review from strub July 13, 2026 16:02
@Gustavo2622 Gustavo2622 self-assigned this Jul 13, 2026
@strub
strub force-pushed the library_renyi_divergence branch from abd5301 to 5a014e7 Compare July 15, 2026 18:49
Comment thread theories/distributions/RDivOracle.ec Outdated
(* Single Iface clone — both top-level access target (consumers use
[RDO.Iface.Oracle]/[RDO.Iface.Adv]) and BPS substitution target. *)
clone import BPS_Iface as Iface with
type out_t = out_t,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use <- to avoid proliferation.


declare axiom A_bound1 :
hoare[ A(BPS1.Count(Sampler1)).main :
BPS1.Count.n = 0 ==> BPS1.Count.n <= N ].

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you probably want a quantification over the initial value of the counter, so the result can be applied generally where there is a preamble that cannot trigger distinguishing behaviour. (Did we discuss this already? If so, ignore this.)

}.

module type Adv (O : Oracle) = {
proc main(p : param_t) : bool

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could generalise this to arbitrary return types. This would require replace all the raw res events in probabilities below with a "for all event over res (and perhaps the game's globals)".

Not super clear what value this would add, but the presampling argument certainly doesn't rely on the event being the game's output only.

If you choose to generalise, be careful: if you include the globals in scope, you will need to post-sample unused queries in the lazy version.

@strub
strub force-pushed the library_renyi_divergence branch from 5a014e7 to 9fa0ec3 Compare July 22, 2026 14:21
Adds a Rényi-∞ (max-divergence) toolkit for probability-preservation
arguments in bounded-query reductions — e.g. rejection-sampling hops
where each of N oracle queries costs a multiplicative factor M.

- theories/distributions/RDiv.ec: the dominance predicate
  [dominated M d1 d2] and the divergence [rdiv_inf], probability
  preservation (mu d1 E <= M * mu d2 E), and closure under the standard
  constructions (dmap, dlet, dprod, dlist, djoin(map), dexcepted,
  drestrict, dcond, dfst/dsnd, dopt, dfold, dfun), each in an
  explicit-bound and a tight (rdiv_inf) form.  An abstract
  [Distinguisher] theory lifts preservation to adversaries
  ([adv_rdiv_inf], [adv_rdiv_inf_le], pre-composed variants), reusing
  SDist.GenDist for the Pr-to-distribution transport.

- theories/distributions/BoundedPreSample.ec: for an adversary making
  at most N oracle queries, answering queries by fresh sampling is
  Pr-equal, per event, to pre-sampling a list of N draws
  ([eq_pr_fresh_ref_ev]); proved by a counting/up-to-bad step plus
  eager sampling via PROM.

- theories/distributions/RDivOracle.ec: the user-facing bound
  [rdiv_bound_sampler],

    Pr[Game1(A) : E res] <= M ^ N * Pr[Game2(A) : E res],

  for any N-query-bounded A against per-parameter samplers d1/d2 that
  are uniformly M-dominated on the support of the parameter
  distribution.  A second theory [RDivOracleValid] packages the common
  "valid parameters only" restriction (conditioning the parameter
  distribution), stating validity as an event conjunct — no additive
  slack and no M >= 1 assumption — with a corollary paying the
  invalid-parameter mass additively.

- tests/rdiv-instantiate.ec: smoke instantiation realizing all
  parameter axioms of both oracle theories at a trivial instance.
@Gustavo2622
Gustavo2622 force-pushed the library_renyi_divergence branch from 9fa0ec3 to 1e10036 Compare September 1, 2026 10:48
Adds a third theory to RDivOracle.ec for developments where the
per-parameter hypotheses hold only on a subset of good SAMPLES, i.e.
validity is decided per draw rather than per parameter.  The samplers
return [None] on an invalid draw, which makes invalidity observable to
the adversary, and the core bound then applies to the guarded kernels
[dmap (d_i p) (fun x => if valid p x then Some x else None)].

Dominance is required at valid points only, together with dominance of
the total invalid mass ([invalid_mass_dominated]); [invalid_mass_of_eq]
discharges the common case of equal invalid masses on both sides with
[1 <= M].  Everything else (presampling, the joint reflection, the M^N
bound) is inherited from [RDivOracle].

Also adds a smoke instantiation of the new theory to
tests/rdiv-instantiate.ec.
RDivOracleQ packages the shape where each oracle query first draws an
auxiliary value [q] from a fixed distribution, validity is decided on
[(p, q)] alone, and the kernels [k_i p q] are only meaningful (and only
lossless) at valid [q]: the samplers draw [q], then one draw from the
tagged kernel [kt_i p q] (Some (q, x) at valid q, None otherwise).  The
core bound applies to the tagged kernels; dominance is required at valid
(p, q) only, plus [1 <= M] at the shared None mass.  Both the one-draw
games and PRE-SAMPLED-q games ([GameP_i], the q's drawn as a list up
front and consumed in order) are exported, with [GameP_i_eq_Game_i] and
the public bound stated on [GameP_i].

The pre-sampled/fresh identification needs no hypothesis on the
adversary: BoundedPreSample gains [RefL], a pre-sampled list with a lazy
tail, and [eq_pr_fresh_refl], equating it with [Fresh] for every
adversary (no query bound, no losslessness) by the eager/lazy step alone.

tests/rdiv-instantiate.ec gains a smoke instantiation of RDivOracleQ.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants