Distribution infrastructure for the low individual degree test #
Shared distribution definitions: finite-support weighted distributions, a probability predicate, push-forward distributions, weighted-sum linear maps, averaging, uniform distribution, and outcome summation.
Note: this module contributes declarations to the comparator statement closure
of mainFormal, which must elaborate in the same environment as the
Mathlib-only Challenge.lean. Keep the full import Mathlib; do not narrow
it. See docs/comparator.md, "Environment alignment".
The total mass carried by the explicit support of a distribution.
Equations
- 𝒟.totalWeight = ∑ a ∈ 𝒟.support, 𝒟.weight a
Instances For
A Distribution is probabilistic when its total mass is exactly 1.
Equations
- 𝒟.IsProbability = (𝒟.totalWeight = 1)
Instances For
Push a finite-support distribution forward along a map.
This is the project Distribution analogue of PMF.map. The support is the
image of the original finite support, and each new weight is the sum of the
weights in the corresponding fiber.
Equations
Instances For
Push-forward preserves total mass.
A finite weighted sum over a push-forward distribution is the corresponding
weighted sum of the pulled-back family. This is the Distribution analogue of
the finite-sum form of PMF.map.
On a finite ambient type, a summand that vanishes outside a distribution's explicit support has the same total sum over all ambient values as over that support.
This is a project-local explicit-support adapter around Mathlib's Finset.sum_subset:
Mathlib supplies the finite-sum theorem, while this lemma packages the common shape used
when paper expressions sum over a whole question set but the repository stores a smaller
Distribution.support. It is not intended to replace Mathlib probability theory.
Unpack the equality form of the probability invariant.
On a finite ambient type, a probabilistic Distribution has total weight 1 even
when its weights are summed over the whole ambient type.
This packages the explicit-support bookkeeping in Distribution for downstream Lean
statements that follow the paper's notation 𝔼_{x ∼ 𝒟} over the question set rather
than over a stored support finset.
A probability distribution has total weight at most 1.
Push-forward preserves the probability invariant.
The Mathlib probability mass function associated to a project Distribution
whose total mass is one.
The construction sends each nonnegative real weight to ℝ≥0∞ by
ENNReal.ofReal; the hypotheses of PMF.ofFinset are exactly the project
probability invariant and the stored zero-off-support condition.
Equations
- 𝒟.toPMF h𝒟 = PMF.ofFinset (fun (a : α) => ENNReal.ofReal (𝒟.weight a)) 𝒟.support ⋯ ⋯
Instances For
The associated PMF has zero mass outside the stored support of the project distribution.
The project push-forward agrees with Mathlib's push-forward of the associated probability mass function.
Average a scalar function against the stored finite support of a distribution.
Equations
- MIPStarRE.LDT.avgOver 𝒟 f = ∑ a ∈ 𝒟.support, 𝒟.weight a * f a
Instances For
The module-valued weighted finite sum associated to a finite-support Distribution,
as a linear map in the averaged family.
This packages the finite-support expression underlying both scalar averages and
operator averages. It keeps the explicit support carried by Distribution,
while exposing the Error-module structure of the weighted sum.
Equations
Instances For
The scalar average is the weighted finite-sum linear map applied to a scalar family.
Averaging against a pushed-forward distribution is averaging the pulled-back function against the original distribution.
Weighted sum of operators over a distribution's finite support, using the same
support/weight data as the scalar avgOver.
This is a project-local adapter around Mathlib finite sums for the LDT
Distribution representation and Quantum.Op scalar action, not a replacement for
Mathlib's probability theory APIs.
Equations
- MIPStarRE.LDT.averageOperatorOverDistribution 𝒟 f = ∑ a ∈ 𝒟.support, 𝒟.weight a • f a
Instances For
Operator averaging is the weighted finite-sum linear map applied to an operator-valued family.
Operator-valued averaging against a pushed-forward distribution is operator-valued averaging of the pulled-back family against the original distribution.
If two operator-valued families agree pointwise, their averages agree.
Pull a finite outcome sum through an operator-valued average.
Pull a finite-set outcome sum through an operator-valued average.
Operator averages preserve positivity.
Operator averages preserve pointwise order.
The average of a constant operator is the total mass times that operator.
The average of a constant operator over a probability distribution is that operator.
An average of effects against a sub-probability distribution is again bounded above by the identity operator.
An average of effects against a probability distribution is again bounded above by the identity operator.
The uniform distribution on a specified finite support.
The stored support is s, and the weight of a point is the elementary finite
uniform weight 1 / s.card on s and 0 off s. When the support is empty
this gives the zero sub-probability distribution, matching the convention used
for degenerate filtered supports in the LDT development.
Equations
Instances For
A nonempty finite support gives a probability distribution.
The uniform distribution on any finite support is a sub-probability
distribution. It has mass 1 on nonempty support and mass 0 on empty
support.
The project uniform distribution on a nonempty finite support is Mathlib's uniform probability mass function on that support.
The uniform distribution on a nonempty finite type.
Equations
Instances For
The uniform distribution on a finite type has full support.
The weights of a uniform distribution sum to exactly 1.
The uniform distribution is a genuine probability distribution.
The weights of a uniform distribution sum to at most 1.
The project uniform distribution on a nonempty finite type is Mathlib's uniform probability mass function on that type.
Total variation distance between two distributions:
TV(μ, ν) = ½ ∑_a |μ(a) - ν(a)| over the union of supports.
Equations
Instances For
On a finite ambient type, the local total-variation distance may be summed over all points rather than over the union of the stored supports.
For probability distributions on a finite ambient type, the local
total-variation distance is the half L^1 distance between the associated
Mathlib probability mass functions.