Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Finite mixtures of ensembles

Definition
EnsembleSpaceDraft_finiteMixture

by Lucas · Oct 18, 2026 · Mathlib 0df444a (Lean v4.33.1)

convexityfoundations-of-physicsmathematical-physicstopology

Definition 1.10 associates to finitely many ensembles e1,…,ene_1,\ldots,e_ne1​,…,en​ and coefficients pi∈[0,1]p_i\in[0,1]pi​∈[0,1] with ∑ipi=1\sum_i p_i=1∑i​pi​=1 a single ensemble, the finite mixture ∑ipiei\sum_i p_i e_i∑i​pi​ei​.

Coefficients equal to zero are deleted and the remaining pairs keep their order. If one pair (p,e)(p,e)(p,e) remains, the mixture is eee. If several remain, with first pair (p,e)(p,e)(p,e) and with sss the sum of the later coefficients, the mixture is

p e+pˉ m,p\,e+\bar p\,m,pe+pˉ​m,

where mmm is the finite mixture of the later ensembles with coefficients divided by sss. This is the bracketing written as (1.11) in the draft.

The same value is defined for a list of real coefficients and ensembles, and for a finite index set {1,…,n}\{1,\ldots,n\}{1,…,n} presented as Fin n.

Formalization Note. The operation is partial. It returns no ensemble if every coefficient is zero, or if a tail of the list sums to zero. Corollary 1.12 states that a value does exist when the coefficients lie in [0,1][0,1][0,1] and sum to 111. While a tail is rescaled, each new coefficient is passed through the projection of R\mathbb RR onto [0,1][0,1][0,1]. For nonnegative summands that projection is the identity on the ratios that arise from a positive tail sum.

Definition code
import Definitions.Def_EnsembleSpaceDraft_axioms
import Mathlib

/-!
# Finite mixtures (Definition 1.10)

The nested expression (1.11) is realized by dropping coefficients equal to `0` and then
folding binary mixes from the left. A coefficient known only as a real number is sent
through `Set.projIcc`, which is the identity on `[0, 1]`. If the filtered list is empty,
or a partial sum of a tail vanishes, the function returns `none`.
-/

open scoped unitInterval

namespace EnsembleSpaceDraft

universe u

variable {E : Type u} [TopologicalSpace E]

/-- Left-nested mixture of a list whose coefficients are intended to be strictly positive.
Returns `none` on the empty list and when a tail sums to zero. -/
noncomputable def nestMixture? (X : EnsembleSpace E) : List (ℝ × E) → Option E
  | [] => none
  | (p, e) :: t =>
      if t = [] then some e
      else
        let s := (t.map Prod.fst).sum
        if s = 0 then none
        else
          (nestMixture? X (t.map fun pe => (pe.1 / s, pe.2))).map fun tail =>
            X.mix (Set.projIcc (0 : ℝ) 1 zero_le_one p) e tail
termination_by l => l.length
decreasing_by
  simp_wf

/-- Definition 1.10. Zero coefficients are dropped, preserving order; the remaining list
is mixed by (1.11). Returns `none` if every coefficient is zero. -/
noncomputable def finiteMixtureList? (X : EnsembleSpace E) (l : List (ℝ × E)) : Option E :=
  nestMixture? X (l.filter fun pe => pe.1 ≠ 0)

/-- Definition 1.10, indexed by `Fin n`. -/
noncomputable def finiteMixture {n : ℕ} (X : EnsembleSpace E) (p : Fin n → ℝ) (e : Fin n → E) :
    Option E :=
  finiteMixtureList? X (List.ofFn fun i => (p i, e i))

end EnsembleSpaceDraft
Source
G. Carcassi, C. A. Aidala, Ensemble spaces, draft of 12 October 2026, Chapter 1. Generated from https://github.com/assumptionsofphysics/book (art_pm_EnsembleSpaces). Definition 1.10, equation (1.11), pp. 15–16.
Human review
  • Endorsed by Shuze Chen · Oct 18, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Lucas · Oct 18, 2026

    Confirmed by the mission captain (proposal self-audit).

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