The raw next target is between a quarter and four times the last target
ProvedBitcoinDifficulty.raw_target_boundsFor a last target powLimit and any timestamps: rawNextTarget t lastTime firstTime , and either the cap binds (the raw target is powLimit) or rawNextTarget t lastTime firstTime . From the clamp bounds of the proof-of-work mission and the exact arithmetic.
import Definitions.Def_BitcoinDifficulty import Definitions.Def_BitcoinPow open BitcoinDifficulty BitcoinPow
theorem BitcoinDifficulty.raw_target_bounds (t : Nat) (ht : t ≤ BitcoinPow.powLimit) (lastTime firstTime : Int) :
BitcoinDifficulty.rawNextTarget t lastTime firstTime ≤ 4 * t ∧
(BitcoinDifficulty.rawNextTarget t lastTime firstTime = BitcoinPow.powLimit ∨
t / 4 ≤ BitcoinDifficulty.rawNextTarget t lastTime firstTime) := 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: theorem BitcoinDifficulty.raw_target_bounds
Statement
Binders (universally quantified).
- , a natural number;
- and , integers (named
lastTime,firstTime), unrelated to each other.
Hypothesis.
- (ht) .
Conclusion. A conjunction of two parts, writing for the raw next target:
Here is the natural-number product, is natural-number floor division, "or" is inclusive disjunction, and both inequalities are non-strict.
Definitions used
Constants (from the imported proof-of-work definitions).
- (the modulus called
width). - (the value called
powLimit). - (the value called
targetTimespan); hence and .
Clamping a timespan, (the function called clampTimespan). For an integer (positive, zero or negative),
always lies in , so it is positive and its conversion to a natural number (written below as well) is lossless.
The raw next target, (the function called rawNextTarget, defined in this bundle). For a natural number and integers , with ,
(the minimum is written in the source as "if the quotient then else the quotient"). Unfolding the definitions, .
(For reference, unfolds to: let ; let ; then if , else . No encoding to a compact word is involved.)
Edge cases and what the quantifiers include
- : then , the first part reads , and the second part's right disjunct reads .
- : , so the right disjunct of the second part holds trivially whatever is.
- and are arbitrary integers; (including ) gives , and gives .
- For the admitted , , so the reduction modulo inside does not change the product; it is still literally present.
- The second part is a disjunction: in the case the statement makes no claim that (though with that would follow), and in the other case it makes no claim that .
- The first part bounds by without any cap: when the bound exceeds , and the first part is then weaker than the cap built into .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.