Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Reindexing a Mask-Selected Finite Sum

Proved
FunctionalInequalities.KLS.BKL.sum_selected_eq_readable

by Lazyfill · Oct 26, 2026 · Mathlib 0df444a (Lean v4.33.1)

functional-inequalitieskls-conjecturekls-modularkls-readablelog-concave

This reindexes a sum over Boolean masks by the selected and complementary slots.

Let w:ι→Ew:\iota\to Ew:ι→E, let q:Fin⁡(k)→{false,true}q:\operatorname{Fin}(k)\to\{\mathrm{false},\mathrm{true}\}q:Fin(k)→{false,true}, and let GGG map pairs of lists in EEE to R\mathbb{R}R. If the mask has c1c_1c1​ true entries and its complement has c2c_2c2​ true entries, then

∑J:Fin⁡(k)→ιG(w(J) selected by q, w(J) selected by ¬q)=∑J1:Fin⁡(c1)→ι∑J2:Fin⁡(c2)→ιG(w(J1),w(J2)).\sum_{J:\operatorname{Fin}(k)\to\iota} G\bigl(w(J)\text{ selected by }q,\,w(J)\text{ selected by }\neg q\bigr) = \sum_{J_1:\operatorname{Fin}(c_1)\to\iota} \sum_{J_2:\operatorname{Fin}(c_2)\to\iota} G\bigl(w(J_1),w(J_2)\bigr).J:Fin(k)→ι∑​G(w(J) selected by q,w(J) selected by ¬q)=J1​:Fin(c1​)→ι∑​J2​:Fin(c2​)→ι∑​G(w(J1​),w(J2​)).

The formal functions maskCount and selected specify the two lists and their lengths. This is a combinatorial reindexing tool for cumulant-energy decompositions.

Original Lean declaration header

Within namespace FunctionalInequalities.KLS.BKL. Shown in its original module context. Proof omitted.

theorem sum_selected_eq {E ι : Type*} [Fintype ι] (w : ι → E) :
    ∀ (k : ℕ) (q : Fin k → Bool) (G : List E → List E → ℝ) (c₁ c₂ : ℕ),
      maskCount q = c₁ → maskCount (fun i => !(q i)) = c₂ →
      ∑ J : Fin k → ι, G (selected (fun i => w (J i)) q)
          (selected (fun i => w (J i)) (fun i => !(q i))) =
        ∑ J₁ : Fin c₁ → ι, ∑ J₂ : Fin c₂ → ι,
          G (List.ofFn fun i => w (J₁ i)) (List.ofFn fun i => w (J₂ i))

Module navigation

Module: KLS/BKL/CumulantEnergy/Basic.

Definition modules: Analysis/IteratedDerivative/Bilinear.

Next: sqrt_sum_sq_sum_le.

Source excerpt, lines 169–175 · Frozen source 408915f.

Preamble
import Definitions.Def_KLSModular_FunctionalInequalities_KLS_BKL_CumulantEnergy_Basic

open FunctionalInequalities.Analysis FunctionalInequalities.Analysis.BakryEmery
Formal statement

theorem FunctionalInequalities.KLS.BKL.sum_selected_eq_readable {E ι : Type*} [Fintype ι] (w : ι → E) :
    ∀ (k : ℕ) (q : Fin k → Bool) (G : List E → List E → ℝ) (c₁ c₂ : ℕ),
      maskCount q = c₁ → maskCount (fun i => !(q i)) = c₂ →
      ∑ J : Fin k → ι, G (selected (fun i => w (J i)) q)
          (selected (fun i => w (J i)) (fun i => !(q i))) =
        ∑ J₁ : Fin c₁ → ι, ∑ J₂ : Fin c₂ → ι,
          G (List.ofFn fun i => w (J₁ i)) (List.ofFn fun i => w (J₂ i)) := by sorry
Source
Lean source: https://github.com/human-ai-mathematics/kls-lean/blob/408915f/formalization/FunctionalInequalities/KLS/BKL/CumulantEnergy/Basic.lean#L168-L234 (repository human-ai-mathematics/kls-lean, commit 408915f, module `FunctionalInequalities.KLS.BKL.CumulantEnergy.Basic`, declaration `FunctionalInequalities.KLS.BKL.sum_selected_eq`; the repository is private at upload time).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me