The outdated-version condition as height thresholds
ProvedBitcoinHeader.versionOutdated_iffFor every version and previous height , holds exactly when
the BIP34, BIP66 and BIP65 version floors at their mainnet activation heights.
import Definitions.Def_BitcoinHeader
theorem BitcoinHeader.versionOutdated_iff (version : Int) (prevHeight : Nat) :
BitcoinHeader.versionOutdated version prevHeight = true ↔
(version < 2 ∧ BitcoinHeader.BIP34Height ≤ prevHeight + 1) ∨
(version < 3 ∧ BitcoinHeader.BIP66Height ≤ prevHeight + 1) ∨
(version < 4 ∧ BitcoinHeader.BIP65Height ≤ prevHeight + 1) := 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 integer (named version; any integer, including negative values and values exceeding ) and every natural number (named prevHeight), the statement asserts a logical equivalence ("if and only if") between, on one side, the Boolean-valued function evaluating to the Boolean true, and, on the other side, the proposition
where , , are the constants BIP34Height, BIP66Height, BIP65Height, the comparisons , , are integer comparisons, and is natural-number addition (no overflow). Unfolding the definition, is the Boolean "or" of three Boolean "and"s: ( and ), ( and ), ( and ), where is the Boolean that is true exactly when . So the statement says: the Boolean computation returns true exactly when the corresponding proposition, with each Boolean test replaced by the inequality it decides, holds; and (by the "only if" direction) returns false exactly when that proposition fails. The equivalence is a two-way statement about a Boolean versus a proposition, with no further hypotheses. Note, as a consequence of the shape of the right-hand side, that it holds for every negative whenever , and fails for every and for every .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.