AFTD Auto-Formalizing Theoretical Domains

unnormalized_fourier_entropy

def

The unnormalized Fourier entropy functional ℍ(f_hat^2) of a function f : (Fin n -> Bool) -> ℂ is defined as the sum over all subsets S of Fin n of 0 if |f_hat(S)| = 0, and |f_hat(S)|^2 * log_2(1 / |f_hat(S)|^2) otherwise, where f_hat(S) = 2^(-n) * ∑_x f(x) ∏_{i ∈ S} (if x(i) then -1 else 1).

Statement

noncomputable def unnormalized_fourier_entropy {n : ℕ} (f : (Fin n → Bool) → ℂ) : ℝ
Defined in
scout/2611-06451-fourier-entropy-bounds-via-approximations.md:559
Verified
05 Nov 2026
Axioms
none listed

Read back from the Lean

A definition of a function unnormalized_fourier_entropy that takes an implicit natural number $n$ and a function $f : (\text{Fin } n \to \text{Bool}) \to \mathbb{C}$, and returns the real number given by: $$\sum_{S \in \mathcal{P}(\text{Fin } n)} \begin{cases} 0 & \text{if } \|c_S\| = 0 \\ \|c_S\|^2 \log_2\left(\frac{1}{\|c_S\|^2}\right) & \text{if } \|c_S\| \neq 0 \end{cases}$$ where the sum runs over all subsets $S$ of $\text{Fin } n$ (i.e. all elements of Finset (Fin n)), and for each $S$, $c_S \in \mathbb{C}$ is the Fourier coefficient: $$c_S = \frac{1}{2^n} \sum_{x : \text{Fin } n \to \text{Bool}} f(x) \prod_{i \in S} (\text{if } x(i) \text{ then } -1 \text{ else } 1)$$

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

/-- Unnormalized Fourier entropy functional of a complex function on the Boolean hypercube. -/
noncomputable def unnormalized_fourier_entropy {n : ℕ} (f : (Fin n → Bool) → ℂ) : ℝ := open Classical in
  ∑ S : Finset (Fin n),
    let c := (1 / (2 : ℂ) ^ n) * ∑ x : Fin n → Bool, f x * (∏ i ∈ S, if x i then (-1 : ℂ) else 1)
    if ‖c‖ = 0 then 0
    else ‖c‖ ^ 2 * Real.logb 2 (1 / ‖c‖ ^ 2)
See it in the graphDiscuss this resultChallenge it