The replay kernel as the regular conditional distribution #
Traces.outputGivenTrace is a finite kernel, and by trace soundness the joint law of the source
is its trace law followed by the replay, the joint law of the target the same trace law followed
by the target's replay. Mathlib's disintegration kernel is almost everywhere unique among the
finite kernels with this factorization property (eq_condKernel_of_measure_eq_compProd), so
each replay is a version of the regular conditional distribution of the output given the trace,
and the almost-sure clause of trace soundness transfers to the conditional laws.
The compact replay is a finite kernel: its mass is at most one.
A joint law that is a trace law followed by the replay of program has that replay as its
disintegration kernel, for almost every trace.
The determinized program has the trace law of its source.
The public conditional-law theorem: both replays are versions of the regular conditional distributions of the outputs given the trace, and trace soundness holds for those.
Trace preservation: the first two clauses of conditional_law.
Tracewise soundness: the almost-sure clause of conditional_law.
The target's output law is the trace law pushed forward by the source's conditional mean. The target's joint law is the trace law followed by the Dirac mass at the replay mean, which agrees almost everywhere with the conditional mean because both describe the target's conditional law.