AFTD Auto-Formalizing Theoretical Domains

rademacher_filter

deforiginal

For a natural number m and a sign configuration s : Fin m → Bool, rademacher_filter m s is the real-valued sequence on ℤ equal to (1 : ℝ) if s ⟨j.toNat, _⟩ is true and (-1 : ℝ) if false for 0 ≤ j < m, and (0 : ℝ) otherwise.

Statement

def rademacher_filter (m : ℕ) (s : Fin m → Bool) : ℤ → ℝ
Related work
knowledgebase: OP-1152
Verified
06 Nov 2026
Axioms
none listed

Read back from the Lean

rademacher_filter is a function that takes a natural number $m$ and a sequence of booleans $s : \mathrm{Fin}\ m \to \mathrm{Bool}$, and returns a function from $\mathbb{Z}$ to $\mathbb{R}$. For an input integer $j$, it returns: - $1$ if $0 \le j < m$ and $s(j) = \mathrm{true}$ (where $j$ is cast to $\mathbb{N}$ and viewed in $\mathrm{Fin}\ m$), - $-1$ if $0 \le j < m$ and $s(j) = \mathrm{false}$, - $0$ otherwise (i.e., if $j < 0$ or $j \ge m$).

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 real sequence on ℤ defined by Rademacher signs on 0 ≤ j < m and 0 elsewhere. -/
def rademacher_filter (m : ℕ) (s : Fin m → Bool) : ℤ → ℝ := fun j =>
  if hj : 0 ≤ j ∧ j < m then
    if s ⟨j.toNat, by omega⟩ then 1 else -1
  else 0
See it in the graphDiscuss this resultChallenge it