Ordered packet law (packetLaw, slotMarginal, retainedMass)
DefinitionpacketLawAn ordered -packet over tubes with weights has law where . The slot- marginal and the retained mass of a packet event are defined from it.
import Mathlib.Algebra.BigOperators.Group.Finset.Basic
import Mathlib.Data.Fintype.Basic
import Mathlib.Data.Fintype.Pi
import Mathlib.Data.Real.Basic
/-!
# Filtered descent — finite packet model (paper (9), (17)–(18), (25))
Finite model of the descent's "packet" picture. The paper works with
ordered packets of tubes `U = (U_1, …, U_r)` weighted by the product of the
tube weights; R5 ((9)/(25)) says that after retaining an event of mass `α`,
each slot's marginal is dominated by `α⁻¹` times the base law.
-/
namespace FilteredDescent
/-- Finite symmetric packet law (paper (17)): on ordered `r`-tuples of tubes,
the product weight normalized by the total mass `W^r`. -/
noncomputable def packetLaw {n r : ℕ} (w : Fin n → ℝ) : (Fin r → Fin n) → ℝ :=
fun U => (∏ j, w (U j)) / (∑ i, w i) ^ r
/-- One-slot marginal mass: total packet mass of tuples with `U j = t`.
Paper (18): before conditioning this equals the coarse shaded-incidence
marginal `w t / W`. -/
noncomputable def slotMarginal {n r : ℕ} (w : Fin n → ℝ) (j : Fin r)
(t : Fin n) : ℝ :=
∑ U : Fin r → Fin n, if U j = t then packetLaw w U else 0
/-- Retained packet mass of an event `A` under the packet law. This is the
finite form of the retained mass `α` in R5 (paper (9)/(25)). -/
noncomputable def retainedMass {n r : ℕ} (w : Fin n → ℝ)
(A : Finset (Fin r → Fin n)) : ℝ :=
∑ U ∈ A, packetLaw w U
end FilteredDescent
Read-back
What the Lean code literally says, in plain math · muse-spark
I have read the auditor instructions and the Lean code. I am writing blind read-backs based solely on what the code literally says, without importing any outside context. Here are my read-backs:
FilteredDescent.packetLaw
For any two implicit natural numbers and (each of which may be ) and any explicit function from the -element index set to the real numbers, is defined to be the function from the set of all -tuples of -indices (i.e., all functions ) to given by
In words, the numerator multiplies the values of at each coordinate of the tuple , and the denominator raises the total to the -th power. The declaration is marked noncomputable. The code imposes no hypotheses on : weights may be negative, zero, or arbitrary. Degenerate cases: if the total weight equals and , the denominator is and real division by zero returns , so for every tuple . If , the numerator is the empty product (equal to ) and the denominator is (with ), so the value is on the unique empty tuple — even when . If , then is the empty function and .
FilteredDescent.slotMarginal
For implicit natural numbers and , and explicit arguments , a slot index , and a tube index , is defined to be the real number
i.e., the sum of over all -tuples whose -th coordinate equals (expanding the definition, each contributing summand is ). The sum ranges over the entire finite type of functions , and the test uses decidable equality on . The declaration is marked noncomputable. Degenerate cases: if there exists no slot index that can be supplied, and if there exists no tube index ; the definition remains well-formed but cannot be applied in those cases. If and , every summand is (by the division-by-zero behavior described above), so the result is .
FilteredDescent.retainedMass
For implicit natural numbers and , an explicit weight function , and an explicit finite set of -tuples (a over ), is defined to be the real number
i.e., the sum of over exactly those tuples that belong to . Unlike , the sum is restricted to the members of the given finite set directly, with no indicator function involved. The declaration is marked noncomputable. Degenerate cases: no hypotheses are placed on or on ; in particular, if is the empty finite set, the sum is .
These read-backs report only what the Lean code literally defines: the binders (implicit ; explicit ), the exact formulas including the placement of division and powers, the noncomputable marking, and the behavior at degenerate inputs (, , zero total weight, empty ).