Sequential RSA: prefix-meaning composition #
@cite{cohn-gordon-goodman-potts-2019} @cite{degen-etal-2020} @cite{waldon-degen-2021} @cite{schlotterbeck-wang-2023}
The Product-of-Experts (PoE) prefix meaning underlying noisy / incremental
RSA models: a per-word lex function lex : U → W → R is composed
multiplicatively over a list of tokens. Higher layers (Noisy.lean,
Incremental.lean) bundle this with RSAConfig builders.
The substrate exists because two distinct study files
(@cite{waldon-degen-2021}, @cite{schlotterbeck-wang-2023}) independently
restipulated lexContinuousQ, prefixMeaningQ, and the order-independence
swap lemmas. With this file, both reduce to corollaries of
List.Perm.prod_eq from mathlib.
Generality #
prefixMeaning is polymorphic over any [CommMonoid R]. The default
arithmetic instance is ℚ for computable studies (S&W, W&D), but the same
operator applies over ℝ (proof studies) or PMF-valued semantics (future
mathlib-PMF migration, see MEMORY.md). Order-related lemmas
(prefixMeaning_nonneg, _pos) require the additional structure that
ℚ and ℝ both provide.
Prefix-meaning: the per-word lex composed multiplicatively over a list.
Generic over any commutative monoid R.
Equations
- RSA.prefixMeaning lex pfx w = (List.map (fun (x : U) => lex x w) pfx).prod
Instances For
Order-independence of prefix-meaning. Any permutation of the prefix yields the same product — the headline structural fact behind the noisy sequential RSA "swap" theorems.
Two-element swap — canonical instance of prefixMeaning_perm.
Swap the first two elements of a prefix (any tail). Generalized head-swap for n-element prefixes.
Foldl-prod bridge. prefixMeaning agrees with the imperative
foldl (· * lex ·) form, generalized over any starting accumulator.
Polymorphic version of the W&D study-file helper.
The PoE prefix product, expressed as a foldl from the unit
accumulator. The form W&D and S&W's original code used.