Repository navigation
Conversation
Add O'Donnell's degree-k part f^{=k} (`levelPart`) and Fourier weight
W^k[f] (`levelWeight`) (Definition 1.19), and the spectral sample of a
Boolean function as a `PMF (Finset ι)` (Definition 1.18).
Results: the coefficients of f^{=k}, its membership in `lowDegree ℝ ι k`,
the decomposition f = ∑_k f^{=k}, orthogonality of the parts with
‖f^{=k}‖² = W^k[f] (Exercise 1.18), Parseval by degree, W^0 = (𝔼 f)^2,
the tail ∑_{k>t} W^k as the inline `∑ S with t < #S` weight, and that the
size of the spectral sample has law W^k.
First milestone of cslib-community#2131. Variance and covariance facts (Props 1.13–1.16)
are left for a follow-up.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Independent reviewer: Claude Code (Opus 5.5), thread Source mapping, checked against the arXiv text (2105.10386v1): Definition 1.18 is the spectral sample of a Boolean Mathematics: the statements are the conventional ones, and
Before merging: CI is at Limits: I read the diff and spot-checked the names it relies on, without a local build. I checked the locators in the arXiv edition, not the 2014 printing. |
|
Thanks for the review. On the nit: |
….4 (cslib-community#2194) Add `Fintype.expect_sub_expect_mul_sub_expect` and `Fintype.expect_sub_expect_sq` (covariance and variance of uniform averages, the non-Fourier halves of Props 1.13 and 1.16), and in `Cslib.BitString`: Cov[f,g] = ∑_{S≠∅} f̂ĝ (Prop 1.16), the variance of a Boolean function read as signs as 1 − (𝔼F)² = 4·dist(f,false)·dist(f,true) (Fact 1.14, Exercise 1.16), and 2ε ≤ Var ≤ 4ε for the distance ε to the nearer constant (Prop 1.15). `Expander/Mixing` now uses the public variance lemma instead of its private copy. Completes the "Level weights and variance" milestone of cslib-community#2131 with cslib-community#2181. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
You're right about Claude Code (Opus 5.5), thread |
|
Coordinator |
|
Integration verified by |
Adds O'Donnell's Fourier weight by degree and the spectral sample. This is the first mathematical milestone of #2131.
New API (
Cslib.BitString, two small topic modules underFoundations/BooleanAnalysis/):LevelWeight.lean:levelPart k fis the degree-kpartf^{=k} = ∑_{|S|=k} f̂(S) χ_S, andlevelWeight k fis the weightW^k[f] = ∑_{|S|=k} f̂(S)²(Definition 1.19).f^{=k}, andf^{=k} ∈ lowDegree ℝ ι k;f = ∑_k f^{=k};𝔼[f^{=j} f^{=k}] = [j = k]·W^k[f](Exercise 1.18);W^0[f] = (𝔼 f)²;W^k = 0aboven;∑_{t<k≤n} W^k[f] = ∑_{t<|S|} f̂(S)², which links to the inline tail sums the library already uses for spectral concentration.SpectralSample.lean:spectralSample f : PMF (Finset ι)drawsSwith probabilityf̂(S)²(Definition 1.18). Its size has lawW^k:(spectralSample f).map card k = ENNReal.ofReal (W^k[f]), which is the book's equivalent definitionW^k[f] = Pr_{S∼𝒮_f}[|S| = k].Source mapping (arXiv:2105.10386v1, same numbering as the 2014 edition):
f : {−1,1}ⁿ → ℝis the library's(ι → Bool) → ℝ, and a Booleanfis read throughsignVal.0 ≤ k ≤ n. Herek : ℕis arbitrary, andlevelWeight_eq_zero_of_card_ltcoversk > n.f, as in the book, with probabilities inℝ≥0∞throughENNReal.ofReal.Design notes.
∑ S with t < #S, f̂ S ^ 2). This PR doesn't migrate those clients;sum_levelWeight_Iocis the bridge for later migration.levelPartandlevelWeightare@[expose]because they are plain sums that clients unfold.LevelWeightpublicly importsDegreeonly for thelowDegreestatement.SpectralSampleis a separate module, so the PMF imports stay out ofLevelWeight.Tests.
ComplexityTests/BooleanAnalysisLevelWeight.leanuses the two-bit conjunction:1/4;3/4;1/4;Validation. All six gates (
scripts/check.sh: build, mk_all, test, lint, lint-style, checkInitImports) pass locally at ae21ee0, and so doesscripts/check_hygiene.py --check-simp. No abstract impact: this adds new declarations and changes no existing statements.Limitations. This is part of the "Level weights and variance" milestone in #2131. The variance and covariance facts (Props 1.13–1.16, Fact 1.14) are left for a follow-up PR, so that milestone stays open.
AI assistance: Claude Code (Opus 5.5) drafted the definitions, proofs, tests and this description; I reviewed them. This needs independent review of the API and of the source mapping.
🤖 Generated with Claude Code