AFTD Auto-Formalizing Theoretical Domains

iid_word_measure

deforiginal

Given natural numbers q and N, and real weights p : Fin q → ℝ, iid_word_measure q N p is the product measure on words Fin N → Fin q defined by MeasureTheory.Measure.pi where each coordinate has marginal measure ∑ i : Fin q, ENNReal.ofReal (p i) • MeasureTheory.Measure.dirac i.

Statement

noncomputable def iid_word_measure (q N : ℕ) (p : Fin q → ℝ) : MeasureTheory.Measure (Fin N → Fin q)
Related work
folklore
Verified
13 Nov 2026
Axioms
none listed
Used by 2
  • iid_greedy_bpe_approx_probGiven alphabet size q, weights p : Fin q → ℝ, merge budget k, length N, and tolerance ε : ℝ, iid_greedy_bpe_approx_prob q p k N ε is the…
  • op_1604_iid_greedy_bpe_budget_oneOpen Problem OP-1604 (budget k = 1 case): For a merge budget of k = 1, every alphabet size q ≥ 2, every strictly positive probability…

Read back from the Lean

Given natural numbers q and N, and a function p : Fin q → ℝ, iid_word_measure q N p is defined as the product measure (MeasureTheory.Measure.pi) on the function space Fin N → Fin q, where for each coordinate in Fin N, the measure is the sum over i : Fin q of the Dirac measure at i scaled by ENNReal.ofReal (p i) (which equals p i if p i ≥ 0 and 0 otherwise).

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

/-- The product measure on length-N words over alphabet Fin q with independent coordinates distributed according to probability weights p. -/
noncomputable def iid_word_measure (q N : ℕ) (p : Fin q → ℝ) : MeasureTheory.Measure (Fin N → Fin q) := MeasureTheory.Measure.pi (fun _ : Fin N => ∑ i : Fin q, ENNReal.ofReal (p i) • MeasureTheory.Measure.dirac i)
See it in the graphDiscuss this resultChallenge it