REACH is a Rao–Blackwellization
ProvedFormalizedScopeReach.reach_raoBlackwellFor any countable vocabulary and normalized outcome-avoiding path law, take any positive number of independent outcome-free timelines and sample their conditionally independent Bernoulli trials using original next-token hazards. The REACH average, viewed on this joint space, equals almost surely the conditional expectation of the trial-success indicator average given the complete indexed pool of outcome-free timelines. The theorem uses Mathlib conditional expectation.
import Definitions.Def_FormalizedScopeReach_Trials open scoped BigOperators ENNReal open MeasureTheory ProbabilityTheory
namespace FormalizedScopeReach
theorem reach_raoBlackwell {V : Type} [Countable V] (M : Model V)
[IsProbabilityMeasure (avoidingLaw M)] (n : ℕ) (hn : 0 < n) :
(fun z : (Fin n → Timeline V) × (Fin n → List Bool) => ℛ M n z.1) =ᵐ[twoStageLaw M n]
(twoStageLaw M n)[trialMean n | timelineInformation n] := by sorry
end FormalizedScopeReach
Read-back
What the Lean code literally says, in plain math · GPT-6 (Codex independent sub-agent)
Read-back: reach_raoBlackwell
For every countable type , every model consisting of a distinguished element , a probability mass function on for each finite list of elements of , a predicate on such lists, and a proof that is false, and every natural number satisfying , the following assertion holds, provided that the measure defined below has total mass one. A timeline is any finite list of elements of , equipped with the discrete sigma algebra, so every set of timelines is measurable. Write for the prefix of of length , and for its element at index , starting at zero. A list is terminal exactly when holds and is false for every ; the latter condition expands the definition that a prefix is running. Define the extended nonnegative step weight to be if , and to be otherwise. Define when is terminal and contains no occurrence of , and define otherwise. The outcome-avoiding measure is , with the sum over all finite lists and the unit point mass at ; the explicit probability-measure hypothesis is . Define the real number by converting the extended nonnegative probability to a real number; since is a probability mass function, . Let be the product law of an indexed tuple of timelines. For a fixed timeline , take independent Boolean random variables indexed by , each equal to true with probability and false with probability , and form their list in index order; call the resulting law on finite Boolean lists . For a fixed tuple , let , the law of independent Boolean lists across the timelines. The joint measure on pairs , where both tuples have indexed entries and each is a finite Boolean list, is precisely , where and the star denotes pushforward of a measure. Thus the timelines are sampled independently with law , and conditional on the entire sampled tuple, all the specified Boolean trials are independent. Define , so each list contributes one exactly when it contains at least one true entry, regardless of how many true entries it contains. Define ; this expands the successive definitions of , the reach estimator, and the reach score. Let be the sigma algebra pulled back from the timeline-tuple space by the first-coordinate projection: its events are exactly the sets for arbitrary sets of timeline tuples. In particular, this information retains every timeline's full list, length, and position in the tuple, while retaining no Boolean trial outcomes. The assertion is for -almost every pair ; it is equality of real-valued functions outside a set of joint measure zero, rather than a pointwise claim for every possible pair. The conditional expectation is Mathlib's chosen version; its definition returns zero if the conditioning sigma algebra is not a sub-sigma algebra, the restricted measure is not sigma-finite, or the averaged variable is not integrable. Here is a sub-sigma algebra, is a probability measure, and , so those fallback cases do not arise. The quantifier allows and every larger finite sample size, but excludes . It permits finite or countably infinite , with no bound on list lengths; an empty admits no model because is required. Empty timelines and arbitrary Boolean-list lengths belong to the underlying sample space, but an empty timeline has because is false, and the joint law is concentrated on terminal, outcome-free timelines with Boolean lists of matching lengths. On an empty timeline, the empty product is one, the reach score is zero, and its trial list is empty. Probabilities zero and one are permitted and give deterministic trials. The extended nonnegative division in is total: , while a positive numerator divided by zero would be infinity; if , all with are zero, so every step weight at that history is zero. No strict upper bound below one on the hazards is assumed, although every model must satisfy the stated total-mass-one hypothesis for ; models for which this measure is not a probability measure are outside the assertion. Apart from being false and the normalization of , no monotonicity or other structural property of the stopping predicate is assumed. Pairs assigned zero joint mass impose no pointwise constraint on the asserted equality.
Confirmed by the mission captain (proposal self-audit).