The stationary distribution is unique
ProvedBitcoinSelfishUnique.stationary_uniqueFor , any , and any with IsStationary α γ π: stationary α s for every state . With the geometric form, the balance equations at and express every value through , and total mass 1 fixes , the paper's equation (7). Together with the selfish-mining mission this makes the revenue analysis a statement about the chain's only stationary distribution.
import Definitions.Def_BitcoinSelfishUnique import Definitions.Def_BitcoinSelfishMining open BitcoinSelfishUnique BitcoinSelfishMining
theorem BitcoinSelfishUnique.stationary_unique (α γ : ℝ) (π : BitcoinSelfishMining.State → ℝ)
(h0 : 0 < α) (h1 : α < 1 / 2) (h : BitcoinSelfishUnique.IsStationary α γ π)
(s : BitcoinSelfishMining.State) : π s = BitcoinSelfishMining.stationary α s := by sorryRead-back
What the Lean code literally says, in plain math · claude-fable-5-1 (independent sub-agent, blind: Lean code + auditor instructions only)
Read-back: Thm_BitcoinSelfishUnique_stationary_unique.lean
Theorem BitcoinSelfishUnique.stationary_unique. For every real number , every real number , and every function from the state type to , under the hypotheses
- (strict),
- (strict; is the real number one half),
- (which bundles the four conditions nonneg, summable, mass and invariant spelled out below),
and for every state (i.e. , , or for some natural number ), the following equality of real numbers holds:
where is the specific function stationary α unfolded in the last block below. Spelled out, the conclusion is the conjunction, over all states, of
with and real division (which returns for a zero divisor; the statement contains no separate hypothesis , while ensures ). There is no hypothesis on : it is an arbitrary real number (possibly negative or larger than ), it enters only through the kernel inside the hypothesis , and the right-hand side does not depend on it. The statement is a pointwise equality of functions (every stationary in the sense of IsStationary agrees with at every state); it is phrased as "for all satisfying the predicate, pointwise", not as a unique-existence statement, and it does not itself assert that satisfies the predicate. All four fields of are available as hypotheses; the statement itself does not indicate which of them are needed.
Setting and unfolded definitions (as they are actually defined in the bundle)
Throughout, and are real numbers. Unless a hypothesis is listed explicitly for the declaration below, nothing restricts them: they need not lie in , so the "probabilities" below are simply real numbers that may be negative or exceed .
States. The state type has exactly these elements: a state (the constructor zero), a state (the constructor tie), and, for every natural number , a state (the constructor lead n). The documentation in the definition file says that encodes a private lead of blocks, so is "lead ", is "lead ", and is "lead "; the code itself only ever works with the index .
Outcomes and their weights. There are exactly three outcomes, , (honest miner on the pool's branch) and (honest miner on the honest branch), with real weights
Write for the sum of the two honest weights. As a polynomial identity, valid for all real , one has and ; the definitions, however, are written with the unsimplified expressions.
One-step map. The function sends a state and an outcome to a state:
- ; ;
- for each of the three outcomes ;
- ; ;
- ; ;
- for every : ; .
Transition kernel. For states ,
where is if the equality holds and otherwise (the three-term sum is taken in the order pool, hP, hO). Reading off the step map, the only entries that are not literally a sum of three zeros are:
| from | to | |
|---|---|---|
| () | ||
| () |
Every other pair has .
Sums over all states. For a real-valued function on states,
where is Mathlib's tsum: if the family is summable (unconditionally summable in , which for real numbers is the same as absolute convergence), it is the ordinary infinite sum; if the family is not summable, the tail is defined to be . A family with only finitely many nonzero terms is summable and its tsum is the finite sum of those terms.
The predicate "IsStationary". For real and a function from states to , is the conjunction of the following four conditions (it is a structure with four fields; being given it as a hypothesis means all four are available, and the statement of a theorem does not say which of them its proof uses):
- nonneg: for every state , .
- summable: the family is summable in .
- mass: , i.e. . (Because of condition 2 the tail here is the genuine infinite sum, not the fallback.)
- invariant: for every state ,
By the table above, for each fixed target the family has at most one nonzero term, so this tail is always a genuine (finite) sum. Unfolding the table, condition 4 says exactly the following five families of equations, where :
- at : ;
- at : ;
- at : ;
- at : ;
- at for every : .
Note that the invariant condition does not mention except through and , which simplify to and for every real .
The candidate distribution "stationary". Let (the definition denom). The function (the definition stationary α) from states to is
Here is real division with the convention : if then all three values are , and if then . The exponent is a natural number, so (even when the base is ). The function does not depend on .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.