Docs / Pragmatics / Probabilistic / Listener

The listener of the Rational Speech Act model

import Linglib.Pragmatics.Probabilistic.Listener · namespace RSA

Frank and Goodman's Rational Speech Act model, the Bayesian member of the family Franke and Jäger call probabilistic pragmatics, in mathlib's probability vocabulary. The listener reweights a prior by the mass each state's measure gives the utterance heard. At the channel of a speaker who is only truthful she is the literal listener, who conditions the prior on the extension and is certain of a state the utterance is true at alone, at a meaning that holds to a degree the graded listener, who reweights the prior by the degree, and at a speaker the pragmatic listener, mathlib's posterior. Where the speaker gives an utterance one mass throughout an event, the listener who conditions on the event holds the prior conditioned on it.

Implementation notes

  • Equation numbers are those of Degen's review (eqs. 1–4) and of Franke and Bergen's comparison of latent-variable variants (eqs. 5–22).
  • Meaning and prior are arguments, so findings quantify over them.

References

Declarations

The channel of a speaker who is only required to be truthful. The denotation sem gives each utterance the set of states it is true at, and the channel puts mass one on each utterance true at the state. For utterances that denote sets of states, sem is fun u ↦ ⟦u⟧, and its value at a lexicon, a threshold or a context when the denotation depends on one.

truthfulL51–56
noncomputable def RSA.truthful {W : Type u_1} {U : Type u_2} [MeasurableSpace U] (sem : U → Set W) (w : W) :
MeasureTheory.Measure U
  • truthful sem w = MeasureTheory.Measure.count.restrict {u : U | w ∈ sem u}

Used by instIsFiniteMeasureTruthfulOfFinite, truthful_apply_singleton, literalListener

L58–59
L61–68

The listener

A listener holds a prior over states and takes the utterance to come from a channel, a measure on utterances at each state. She reweights the prior by the mass each state's measure gives the utterance she hears and normalizes, which is Bayes' rule with the zero measure at an utterance no state she entertains produces. The literal listener (eq. 1) takes the speaker to be truthful and no more, and so conditions the prior on the denotation of the utterance. The pragmatic listener (eq. 3) takes the channel of a speaker, and is mathlib's posterior wherever the utterance is heard.

The listener reweights the prior μ by the mass each state's measure S w gives the utterance heard, and normalizes. Her row at an utterance that no state of positive prior produces is the zero measure.

listenerL96–100
noncomputable def RSA.listener {W : Type u_1} {U : Type u_2} [MeasurableSpace W] [MeasurableSpace U] [Countable U] [MeasurableSingletonClass U] (μ : MeasureTheory.Measure W) (S : W → MeasureTheory.Measure U) :
ProbabilityTheory.Kernel U W

Used by listener_apply, instIsZeroOrProbabilityMeasureCoeKernelMeasureListener, instIsFiniteKernelListener, listener_apply_eq_of_apply_singleton_eq_mul, cond_listener_apply, cond_listener_apply_eq_iff, listener_apply_le_of_setLIntegral_mul_le, listener_apply_singleton', listener_apply_singleton, listener_apply_singleton_of_equiv, listener_apply_singleton_eq_zero, ne_zero_of_listener_apply_singleton_ne_zero, listener_apply_singleton_ne_zero, listener_apply_singleton_ne_zero_iff, listener_apply_singleton_congr, listener_apply_singleton_mul_eq_of_apply_eq, listener_apply_finset, isProbabilityMeasure_listener_of_ne_zero, listener_real_finset, listener_real_singleton, listener_real_singleton_div, listener_real_finset_lt_iff, listener_real_singleton_lt_iff, listener_real_lt_of_certain, listener_real_singleton_lt_iff_of_forall_eq, listener_uniformOn_univ_apply_singleton, listener_uniformOn_univ_real_finset, listener_uniformOn_real_lt_iff, listener_uniformOn_real_le_iff, listener_uniformOn_real_finset_lt_iff, listener_apply_singleton_eq_div, isProbabilityMeasure_listener, isMarkovKernel_listener, comp_real_mul_listener_real, listener_apply_eq_posterior, listener_dirac_apply, literalListener

Used in Pragmatics/Probabilistic/AlternatingMaximization, Pragmatics/Probabilistic/Latent, Pragmatics/Probabilistic/Literal, Pragmatics/Probabilistic/QUD, Pragmatics/Probabilistic/Recursion and 41 more

L106–107
L109–110
L112–113
L115–120

Sufficiency. Where the speaker gives the utterance one positive mass throughout an event, the listener who conditions on the event holds the prior conditioned on it: within the event the utterance tells her nothing.

theorem cond_listener_applyL122–130
{W : Type u_1} {U : Type u_2} [MeasurableSpace W] [MeasurableSpace U] [Countable U] [MeasurableSingletonClass U] {μ : MeasureTheory.Measure W} {S : W → MeasureTheory.Measure U} {u : U} {s : Set W} (hs : MeasurableSet s) {c : ENNReal} (hc0 : c ≠ 0) (hc : c ≠ ⊤) (h : ∀ w ∈ s, (S w) {u} = c) (hfin : ∫⁻ (w : W), (S w) {u} ∂μ ≠ ⊤) :
((listener μ S) u)[|s] = μ[|s]

Built from

L132–141
L143–158
L162–164
L168–170
L172–177
L181–182
L184–187
L191–195
L197–199

Events

Bayes' rule on reals, for the mass of a state and of a finite event. It holds at every utterance, since an utterance that no state of positive prior produces gives the zero row and a zero normalizer.

L213–215
L217–222
L224–226
L230–235
L237–242
L244–247
L249–260
L262–276
L278–283
L285–298
L300–307

The uniform prior

Against the uniform prior the prior cancels, and the listener's mass on a state is its share of the production probability of the utterance.

L320–322
L326–331
L333–337
L339–342
L344–350

The listener of a kernel

When the channel is a kernel, the normalizer is the marginal probability of the utterance, the listener is a probability measure exactly at the utterances that are heard, and there she is mathlib's posterior.

L364–366
L370–374
L376–377
L379–388
theorem listener_apply_eq_posteriorL390–392
{W : Type u_1} {U : Type u_2} [MeasurableSpace W] [MeasurableSpace U] [Countable U] [MeasurableSingletonClass U] [Fintype W] [MeasurableSingletonClass W] (μ : MeasureTheory.Measure W) (κ : ProbabilityTheory.Kernel W U) [MeasureTheory.IsFiniteMeasure μ] [ProbabilityTheory.IsFiniteKernel κ] [StandardBorelSpace W] [Nonempty W] {u : U} (hu : (μ.bind ⇑κ) {u} ≠ 0) :
(listener μ ⇑κ) u = (ProbabilityTheory.posterior κ μ) u

Built from

L396–400

The listener of a truthful speaker

The literal listener is the listener of a speaker who is only truthful: she conditions the prior on the denotation of the utterance.

@[reducible, inline] literalListenerL406–409
noncomputable abbrev RSA.literalListener {W : Type u_1} {U : Type u_2} [MeasurableSpace W] [MeasurableSpace U] [Countable U] [MeasurableSingletonClass U] (μ : MeasureTheory.Measure W) (sem : U → Set W) :
ProbabilityTheory.Kernel U W

Built from ,

Used by literalListener_eq_ofDensity, literalListener_apply', literalListener_apply, literalListener_apply_univ, literalListener_apply_singleton, literalListener_apply_singleton_of_notMem, literalListener_real_singleton, literalListener_apply_singleton_of_eq_univ, literalListener_apply_singleton_of_eq_singleton, literalListener_apply_singleton_ne_zero_iff, literalListener_apply_singleton_eq_one_iff, literalListener_apply_singleton_eq_one_iff_eq_singleton, literalListener_apply_singleton_of_equiv, gradedListener_indicator, literalListener_map_apply_singleton, listener_restrict_truthful_map_apply_singleton, literalListener_preimage_fst_compProd, literalListener_preimage_fst_compProd_congr

Used in Pragmatics/Probabilistic/Literal, Pragmatics/Probabilistic/QUD, Pragmatics/Probabilistic/Recursion, Pragmatics/Probabilistic/Uniform, Alsop2024 and 37 more

L411–413
L415–420
theorem literalListener_applyL422–424
{W : Type u_1} {U : Type u_2} [MeasurableSpace W] [MeasurableSpace U] [Countable U] [MeasurableSingletonClass U] [DiscreteMeasurableSpace W] (μ : MeasureTheory.Measure W) (sem : U → Set W) (u : U) :
(literalListener μ sem) u = μ[|sem u]

Built from

L426–430
L436–439
L441–444
L446–449
L451–454
L456–459
L461–468
L470–487

Under a prior that leaves every state possible, the literal listener is certain of a state exactly when the utterance is true there alone.

theorem literalListener_apply_singleton_eq_one_iff_eq_singletonL489–498
{W : Type u_1} {U : Type u_2} [MeasurableSpace W] [MeasurableSpace U] [Countable U] [MeasurableSingletonClass U] [DiscreteMeasurableSpace W] (μ : MeasureTheory.Measure W) (sem : U → Set W) [MeasureTheory.IsFiniteMeasure μ] (hμ : ∀ (x : W), μ {x} ≠ 0) {u : U} {w : W} :
((literalListener μ sem) u) {w} = 1 ↔ sem u = {w}

Built from

L500–510

The listener of a graded meaning

An utterance may hold of a state to a degree. The literal listener of a graded meaning reweights the prior by the degree, and at degrees zero and one she is the literal listener of the extension.

The literal listener of a graded meaning reweights the prior by the degree to which the utterance holds of each state, a negative degree counting as zero, and normalizes.

gradedListenerL524–527
noncomputable def RSA.gradedListener {W : Type u_1} {U : Type u_2} [MeasurableSpace W] [MeasurableSpace U] [Countable U] [MeasurableSingletonClass U] (μ : MeasureTheory.Measure W) (m : U → W → ℝ) :
ProbabilityTheory.Kernel U W

Used by gradedListener_eq_ofDensity, instIsFiniteKernelGradedListener, gradedListener_indicator, gradedListener_apply_singleton_ne_zero_iff, gradedListener_real_singleton, gradedListener_uniformOn_apply_singleton, gradedListener_uniformOn_real_singleton, gradedListener_uniformOn_apply_singleton_lt_iff

Used in BellerGerstenberg2025, DegenEtAl2020, HeKaiserIskarous2025

L529–531
L533–534
L536–543
L548–552
L554–557
L562–565
L567–570
L572–579

Answers and coordinates

L594–600
L602–612
L623–630
L632–640