Transport #
Dyadic Haar transport on the unit interval #
This file isolates the analytic part of Section 2. A DyadicMass L is a
binary tree with exactly 2^L leaf masses. Its recursive CDF is the CDF of
the measure which spreads every leaf mass uniformly over its dyadic cell.
The second half of the file proves the finite-family Haar calculation. Tree symmetry is expressed by mass-preserving child-swap equivalences on the finite state space. This is exactly the property used to kill a nested cross term; disjoint tents vanish pointwise.
A complete binary tree of 2^L real leaf masses.
- leaf (mass : ℝ) : DyadicMass 0
- branch {L : ℕ} (left right : DyadicMass L) : DyadicMass (L + 1)
Instances For
Total mass below the root.
Instances For
Build the complete dyadic mass tree from its left-to-right vector of
2^L leaf masses.
Equations
- One or more equations did not get rendered due to their size.
- FD1D.DyadicMass.ofLeafVector 0 f = FD1D.DyadicMass.leaf (f 0)
Instances For
Every leaf mass is nonnegative.
Equations
Instances For
The hypotheses saying that the 2^L leaf masses form a probability vector.
- nonneg : q.allNonneg
Instances For
The explicit piecewise-linear CDF. Outside [0,1] this is merely a
piecewise-linear extension; all CDF statements below are restricted to the
unit interval.
Equations
- (FD1D.DyadicMass.leaf m).piecewiseCDF = fun (z : ℝ) => m * z
- (l.branch r).piecewiseCDF = fun (z : ℝ) => if z ≤ 1 / 2 then l.piecewiseCDF (2 * z) else l.total + r.piecewiseCDF (2 * z - 1)
Instances For
Nonnegative leaf masses make the explicit CDF monotone on [0,1].
The explicit generalized inverse in mass coordinates. Its input ranges
from 0 to q.total; at a branch the interval is split at the left mass.
Equations
Instances For
The actual selected-leaf policy. It returns the left endpoint of the leaf
whose cumulative-mass interval contains u.
Equations
- (FD1D.DyadicMass.leaf m).selectedLeaf = fun (x : ℝ) => 0
- (l.branch r).selectedLeaf = fun (u : ℝ) => if u ≤ l.total then l.selectedLeaf u / 2 else (1 + r.selectedLeaf (u - l.total)) / 2
Instances For
The selected point is an endpoint in the unit interval.
Generalized-inverse relation for the explicit recursive map. This includes zero-mass leaves and therefore does not require strict positivity.
The integrated Haar series, written recursively. At a branch it adds the
root imbalance and then evaluates the unique child series whose support
contains z.
Equations
- (FD1D.DyadicMass.leaf m).haarSeries = fun (x : ℝ) => 0
- (l.branch r).haarSeries = fun (z : ℝ) => (l.total - r.total) * FD1D.DyadicMass.unitTent z + if z ≤ 1 / 2 then l.haarSeries (2 * z) else r.haarSeries (2 * z - 1)
Instances For
Pointwise integrated Haar expansion of the explicit piecewise-linear CDF.
Dyadic tents and their elementary integrals #
The height-1/2 tent on [l,l+p]. Splitting into Icc and Ioc makes
the two affine pieces disjoint without changing any Lebesgue integral.
Equations
Instances For
A nonzero tent value lies in the interior of its supporting interval.
Flattening the recursive Haar series #
Pointwise value of a finite list of integrated Haar terms.
Equations
- FD1D.haarTermSum ts z = (List.map (fun (t : FD1D.HaarTerm) => t.value z) ts).sum
Instances For
List every internal node, placing the root on [a,a+p] and recursively
placing the two child lists on its two halves. The coefficient at each
node is exactly its left-subtree mass minus its right-subtree mass.
Equations
- One or more equations did not get rendered due to their size.
- FD1D.DyadicMass.haarTermsAt x✝¹ x✝ (FD1D.DyadicMass.leaf mass) = []
Instances For
The internal-node Haar terms in their geometric locations in [0,1].
Equations
- q.haarTerms = FD1D.DyadicMass.haarTermsAt 0 1 q
Instances For
The recursive integrated Haar series is the sum of every internal-node coefficient times its geometric tent, on any positive ambient interval.
Pointwise finite internal-node expansion on [0,1].
Geometric support and nesting vocabulary #
Internal nodes of a depth-L complete binary tree.
Equations
- FD1D.CompleteHaarNode L = ((d : Fin L) × Fin (2 ^ ↑d))
Instances For
Left endpoint of the dyadic interval indexed by a complete Haar node.
Instances For
Width of the dyadic interval indexed by a complete Haar node.
Equations
- FD1D.haarNodeWidth v = 1 / ↑(2 ^ ↑v.fst)
Instances For
Integrated Haar tent on the interval indexed by the node.
Equations
Instances For
Geometric nesting of two dyadic node supports.
Equations
- FD1D.HaarSupportNested v w = (Set.Icc (FD1D.haarNodeLeft v) (FD1D.haarNodeLeft v + FD1D.haarNodeWidth v) ⊆ Set.Icc (FD1D.haarNodeLeft w) (FD1D.haarNodeLeft w + FD1D.haarNodeWidth w))
Instances For
Canonical complete-tree indexing #
The masses of the two children of an internal node v = ⟨d,k⟩.
At positive depth, k selects the appropriate half-tree recursively.
Equations
Instances For
The Haar coefficient at a node is its left-child mass minus its right-child mass.
Equations
- q.nodeCoefficient v = (q.nodeChildMasses v).1 - (q.nodeChildMasses v).2
Instances For
Embed a node into the left half-tree one level below a new root.
Instances For
Embed a node into the right half-tree one level below a new root.
Instances For
Finite tree symmetry and cancellation of cross terms #
An observable has an odd symmetry if a mass-preserving child swap changes its sign. A local tree automorphism supplies precisely such an equivalence for an ancestor-descendant coefficient product.
Equations
- μ.OddSymmetry f = ∃ (e : Ω ≃ Ω), μ.InvariantUnder e ∧ ∀ (ω : Ω), f (e ω) = -f ω
Instances For
A mass-preserving sign flip forces expectation zero.
A finite integrated Haar expansion.
Equations
- FD1D.haarCombination l p b z = ∑ i : ι, b i * FD1D.dyadicTent (l i) (p i) z
Instances For
The recursive Haar series is exactly the canonical finite sum over all
internal nodes ⟨d,k⟩ of the complete depth-L tree.
The canonical node sum is the CDF deviation on the unit interval.
Squared L² norm of a finite integrated Haar expansion.
Equations
- FD1D.haarL2 l p b = ∫ (z : ℝ), FD1D.haarCombination l p b z ^ 2
Instances For
Expected Parseval identity for integrated Haar functions. For unequal nodes, either their interiors are disjoint or a tree child swap makes the coefficient product odd. Thus every cross term vanishes.
Quantile/CDF cost and Cauchy--Schwarz #
The elementary one-dimensional monotone-transport cost: the area between the source and target CDFs. This representation avoids introducing a separate Wasserstein API.
Instances For
The one-dimensional quantile/CDF identity, proved directly by expressing absolute displacement as an integral of threshold disagreements and swapping the two unit-interval integrals.
An actual quantile map together with an actual selected point.
- monotoneCDF : MonotoneOn F (Set.Icc 0 1)
- cdf_measurable : Measurable F
- cdf_mapsTo : Set.MapsTo F (Set.Icc 0 1) (Set.Icc 0 1)
Measurable generalized inverse of the cumulative distribution function.
- quantile_measurable : Measurable self.quantileMap
- quantile_mapsTo : Set.MapsTo self.quantileMap (Set.Icc 0 1) (Set.Icc 0 1)
Measurable selected location approximating the quantile map.
- selected_measurable : Measurable self.selectedPoint
- selected_mapsTo : Set.MapsTo self.selectedPoint (Set.Icc 0 1) (Set.Icc 0 1)
- withinError : ℝ
Uniform upper bound for the distance from a selected location to its quantile.
- selected_close (u : ℝ) : u ∈ Set.Icc 0 1 → |self.selectedPoint u - self.quantileMap u| ≤ self.withinError
Instances For
Actual cost of the selected-point policy against a uniform request.
Instances For
Cost of the continuous generalized inverse before leaf rounding.
Instances For
The explicit dyadic CDF, inverse, and leaf endpoint form an actual policy.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The actual selected-leaf endpoint has cost at most the exact quantile cost
plus one depth-L cell width.
For probability leaf masses, the CDF discrepancy used by the quantile policy is exactly the recursively defined integrated Haar series.
Cauchy--Schwarz on the unit interval, proved by Jensen for x ↦ x².
CDF-area transport followed by Cauchy--Schwarz in space and in state.
gap below is the abstract hazard telescope
E[H_L] - m⁻². The hypothesis htelescope is equation (2):
Σ p_v E[b_v²] ≤ 2 a² gap.
Equation (3), with the exact constant. hcost is the conditional monotone
quantile bound plus the deterministic within-cell error 1/n.