proofs
Provedattentiongradientcounterexampleunbiasedness

Reused local-unbiased estimators can differ from the dense nonlinear gradient

For all p∈R\htmlData{mx=1}{p \in \htmlData{mx=0}{\mathbb{R}}}:

12⋅p⋅(1−p)−p2⋅(1−p)=p⋅(1−p)⋅(12−p)\htmlData{mx=12}{\htmlData{mx=6}{\htmlData{mx=3}{\htmlData{mx=1}{\htmlData{mx=0}{\frac{1}{2}}} \cdot \htmlData{mx=2}{p}} \cdot (\htmlData{mx=5}{1 - \htmlData{mx=4}{p}})} - \htmlData{mx=11}{\htmlData{mx=8}{\htmlData{mx=7}{p}^{2}} \cdot (\htmlData{mx=10}{1 - \htmlData{mx=9}{p}})}} \mathrel{\htmlData{mx=21}{=}} \htmlData{mx=20}{\htmlData{mx=16}{\htmlData{mx=13}{p} \cdot (\htmlData{mx=15}{1 - \htmlData{mx=14}{p}})} \cdot \left(\htmlData{mx=19}{\htmlData{mx=17}{\frac{1}{2}} - \htmlData{mx=18}{p}}\right)}
What the notation means · or point at any symbol
RReal numbers
The real numbers: every point on the number line. (ℝ)
(x : T)As real numbers
1/2 read as an element of real numbers. Mathematicians leave this implicit; Lean needs it to know which kind of number is meant. ((1 / 2 : ℝ))
·Multiplication
1/2 times p. ((1 / 2 : ℝ) * p)
=Equality
1/2 · p · (1 − p) − p^2 · (1 − p) and p · (1 − p) · (1/2 − p) are the same. ((1 / 2 : ℝ) * p * (1 - p) - p ^ 2 * (1 …)
a/bDivision
1 divided by 2. In Lean, dividing by 0 gives 0. (1 / 2)
-Subtraction
1 minus p. On ℕ, Lean's subtraction stops at 0: 2 − 5 = 0. (1 - p)
aᵇPower
p raised to the power 2. (p ^ 2)

Algebraic core of the two-key counterexample: the reused-sample expected gradient term (1/2)p(1-p) differs from the dense squared-loss gradient p^2(1-p) by p(1-p)(1/2-p). Thus they disagree for generic p, e.g. p=1/4.

How it was proved

Proved
5 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
7 lines of Lean
Sign in to see the proofThe proof, its signed report and its history.

More proved statements