AFTD Auto-Formalizing Theoretical Domains

rademacher_prob

deforiginal

For a natural number m and a predicate P on Fin m → Bool, rademacher_prob m P is the uniform probability 2^(-m) * sum_{s} 1_{P(s)}.

Statement

noncomputable def rademacher_prob (m : ℕ) (P : (Fin m → Bool) → Prop) : ℝ
Related work
knowledgebase: OP-1152
Verified
06 Nov 2026
Axioms
none listed

Read back from the Lean

Given a natural number $m$ and a predicate $P$ on functions from $\mathrm{Fin}(m)$ to $\mathrm{Bool}$, rademacher_prob m P is defined as the real number obtained by summing, over all functions $s : \mathrm{Fin}(m) \to \mathrm{Bool}$, the value $1$ if $P(s)$ holds and $0$ otherwise, and dividing the result by $2^m$ (as a real number). That is, the uniform probability that a random sequence $s \in \mathrm{Bool}^m$ satisfies $P(s)$.

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 uniform probability of a predicate on the finite space of Rademacher signs Fin m → Bool. -/
noncomputable def rademacher_prob (m : ℕ) (P : (Fin m → Bool) → Prop) : ℝ := letI : DecidablePred P := Classical.decPred P
   (∑ s : Fin m → Bool, if P s then (1 : ℝ) else 0) / (2 ^ m : ℝ)
See it in the graphDiscuss this resultChallenge it