Accepted blocks strictly increase the chain work
ProvedBitcoinBlock.work_increasesvalidate S b now = accept S' undo implies S.chainWork < S'.chainWork: GetBlockProof of a header with valid proof of work is at least one, so the most-work rule always prefers an extended chain.
Deprecated. Superseded by BitcoinBlockV2.work_increases (revision 2 of the block mission): the p2shSigOpCount of this revision counted every push of scriptSig instead of only the redeem script, over-counting P2SH sigops; the V2 declarations carry the corrected definition.
import Definitions.Def_BitcoinBlock import Definitions.Def_BitcoinSer
theorem BitcoinBlock.work_increases (S : ChainState) (b : BitcoinSer.Block) (now : Int) (S' : ChainState) (undo : BlockUndo)
(h : BitcoinBlock.validate S b now = .accept S' undo) : S.chainWork < S'.chainWork := 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: BitcoinBlock.work_increases
Binders and hypotheses
- : a chain state ; : a serialized block; .
- : a chain state; : a block undo list.
- Hypothesis : .
Conclusion
a strict inequality of natural numbers, where and
with decoding the compact word (mantissa low bits, exponent top byte, left shift truncated modulo ) and returning none when the word is "negative" (mantissa and bit set), the value is , the word "overflows", or the value exceeds .
Hypothesis, unfolded
holds exactly when: is true (in particular is some with the header hash value ); ; the bits equal ; ; the version is not outdated; and hold; ; and .
So the statement says: under those conditions, the sum of per-header proofs over 's headers — which are 's headers followed by 's header — strictly exceeds the sum over 's headers; i.e. (since the sums differ exactly by ) that .
Edge cases silently included
and matter only inside ; is for headers with an invalid compact target (possible among 's existing headers, which are unconstrained); the formula uses natural subtraction and floor division ( whenever defined); the hypothesis may be unsatisfiable for a given , making the claim vacuous.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.