Off a retarget boundary the required word is unchanged and permitted
ProvedBitcoinPow.nextWork_off_boundaryFor every last height with , every last word , and all block times,
On mainnet, where minimum-difficulty blocks are disabled, GetNextWorkRequired returns the previous word between retargets, and PermittedDifficultyTransition accepts an unchanged word there.
import Definitions.Def_BitcoinPow
theorem BitcoinPow.nextWork_off_boundary (lastHeight : Nat) (lastBits : BitVec 32) (lastTime firstTime : Int)
(h : (lastHeight + 1) % BitcoinPow.difficultyAdjustmentInterval ≠ 0) :
BitcoinPow.nextWorkRequired lastHeight lastBits lastTime firstTime = lastBits ∧
BitcoinPow.permittedTransition (lastHeight + 1) lastBits lastBits = true := 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)
Statement. For every natural number ("lastHeight"), every 32-bit word ("lastBits"), and all integers ("lastTime") and ("firstTime"), if
(where is the custom "difficulty adjustment interval"), then both of the following hold:
- , an equality of 32-bit words (bit for bit); and
- the Boolean equals true, where the transition is tested from the word to the same word at height .
The function , unfolded. It returns if , and otherwise returns (a custom retargeting computation, not reached under the hypothesis). So conclusion 1 is, under the hypothesis, the first branch of the definition.
The function , unfolded. If it is the Boolean (equality of 32-bit words). If it is instead where, with the "setCompact" decoding and the "getCompact" encoding, with and with . In conclusion 2 the height argument is , which under the hypothesis satisfies , so conclusion 2 reduces to the Boolean being true; the retarget branch (and hence , , the modular products and caps) is not exercised.
Binders and hypotheses. Four universally quantified variables ( over all natural numbers including ; over all 32-bit words, with no validity condition on its negative bit, exponent, or decoded value; over all integers, unused in the conclusions) and one hypothesis, , i.e. . The conclusion is a conjunction. The statement is an implication only; nothing is asserted when .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.