Only the eleven most recent times determine the median
ProvedBitcoinHeader.mtp_takeFor every chain of times, : block times older than the eleventh ancestor have no influence on the median time past.
import Definitions.Def_BitcoinHeader
theorem BitcoinHeader.mtp_take (times : List Int) :
BitcoinHeader.medianTimePast times = BitcoinHeader.medianTimePast (times.take BitcoinHeader.nMedianTimeSpan) := 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)
For every finite list of integers (including the empty list; there are no hypotheses), the statement asserts the equality of two integers:
where denotes the list of the first entries of in their given order ( being the constant nMedianTimeSpan; when this is itself), and is the function that, given a list , first restricts to its first entries, sorts those into non-decreasing order with , and returns (zero-based, natural-number division rounding down — the middle element for odd , the upper-middle element for even ), or returns when , i.e. when is empty. Thus the claim is that first truncating to its first eleven entries and then applying gives the same integer as applying to directly. For both sides are the fallback value . For both sides are literally the same expression applied to the same list. The only substantive content is for , where the right-hand side's argument has exactly entries and the left-hand side's argument has more.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.