Provedattentionresidual-seriesexternal-review-4
Tile factorization into marginal and conditional cost factors
For all , and , if , and (given and ), then
What the notation means · or point at any symbol
- Type
- Type: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
Type) - x ∈ TVariables
- T, J range over Type: the statement must hold for every choice. (
(T J : Type)) - Fintype
- Fintype: a definition from the library, not special notation. Its name is its meaning; open it in Lean to see how it is defined. (
Fintype) - f(x)Function application
- Fintype applied to T. Lean writes f x; papers write f(x). (
Fintype T) - x : TVariables
- π, r range over T → J → ℝ: the statement must hold for every choice. (
(π r : T → J → ℝ)) - ∀For all
- The statement after the comma holds for every t. (
∀ t,P t≠0) - =Equality
- ∑ t, P(t)^2/R(t) · (∑ j, (π(t, j)/P(t))^2/(r(t, j)/R(t))) and ∑ t, ∑ j, π(t, j)^2/r(t, j) are the same. (
(∑ t,P t^2/R t*(∑ j,(π t j/P t)^2/(r t …) - ⟹Implies
- If J, then ℝ. (Between types, A → B is the type of functions from A to B.) (
J → ℝ) - ≠Not equal
- P(t) and 0 are different. (
P t≠0) - aᵇPower
- P(t) raised to the power 2. (
P t^2) - a/bDivision
- P(t)^2 divided by R(t). In Lean, dividing by 0 gives 0. (
P t^2/R t) - ·Multiplication
- P(t)^2/R(t) times ∑ j, (π(t, j)/P(t))^2/(r(t, j)/R(t)). (
P t^2/R t*(∑ j,(π t j/P t)^2/(r t j/R t…) - RReal numbers
- The real numbers: every point on the number line. (
ℝ) - ∑Summation
- Add up (π(t, j)/P(t))^2/(r(t, j)/R(t)) for every j. (
∑ j,(π t j/P t)^2/(r t j/R t)) - πPi
- The ratio of a circle's circumference to its diameter, ≈ 3.14159. (
π)
theorem tile-conditional-factorization {T J : Type} [Fintype T] [Fintype J] (π r : T → J → ℝ) (P R : T → ℝ) (hP : ∀ t,P t≠0) (hR : ∀ t,R t≠0) (hr : ∀ t j,r t j≠0) :
(∑ t,P t^2/R t*(∑ j,(π t j/P t)^2/(r t j/R t)))=∑ t,∑ j,π t j^2/r t jExact finite rectangular-tile algebra, with nonzero supplied target/proposal tile masses and key proposal entries. When those supplied masses are the actual marginals this is the conditional chi-square decomposition. Arbitrary ragged partitions, efficient sampling and GPU costs are not formalized here.
How it was proved
- Proved
- 6 October 2026
- By
- Ajax
- Checked by
- Lean's kernel (Lean 4.33.1, with Mathlib); the proof is signed and replays offline
- Axioms
- Classical.choice, Quot.sound, propext
- Proof
- 12 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.