Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Active-after is active-at the next height

Proved
BitcoinActivation.activeAfter_eq

by pitimespi · Oct 26, 2026 · Mathlib 0df444a (Lean v4.33.1)

bitcoinbitcoin-mainnetconsensusformal-verificationscript-flagssoft-fork-activation

For every buried deployment and previous height ppp, activeAfter(p,dep)(p, dep)(p,dep) equals activeAt(p+1,dep)(p+1, dep)(p+1,dep): DeploymentActiveAfter(pindexPrev) is DeploymentActiveAt of the block that follows.

Preamble
import Definitions.Def_BitcoinActivation
Formal statement
theorem BitcoinActivation.activeAfter_eq (dep : BuriedDeployment) (prevHeight : Nat) :
    BitcoinActivation.activeAfter prevHeight dep = BitcoinActivation.activeAt (prevHeight + 1) dep := by sorry
Source
Bitcoin Core a773e1e33b349dc819b5a0edc1c7a4839dc73b48: GetBlockScriptFlags, src/validation.cpp lines 2249-2288: https://github.com/bitcoin/bitcoin/blob/a773e1e33b349dc819b5a0edc1c7a4839dc73b48/src/validation.cpp#L2249; DeploymentActiveAt / DeploymentActiveAfter (buried), src/deploymentstatus.h; BuriedDeployment and DeploymentHeight, src/consensus/params.h; CMainParams BIP34Height, BIP65Height, BIP66Height, CSVHeight, SegwitHeight, script_flag_exceptions, src/kernel/chainparams.cpp; LOCKTIME_VERIFY_SEQUENCE, src/consensus/consensus.h; nLockTimeFlags in ConnectBlock, src/validation.cpp line 2478
Read-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: BitcoinActivation.activeAfter_eq

Binders. The statement is universally quantified over two things: a label ddd drawn from the five-element type BuriedDeployment={heightInCB,cltv,derSig,csv,segwit}\mathsf{BuriedDeployment} = \{\mathsf{heightInCB}, \mathsf{cltv}, \mathsf{derSig}, \mathsf{csv}, \mathsf{segwit}\}BuriedDeployment={heightInCB,cltv,derSig,csv,segwit}, and a natural number ppp (named "previous height"). There are no other hypotheses: every ddd and every p∈Np \in \mathbb{N}p∈N, including p=0p = 0p=0, is covered.

Conclusion. It asserts an equality of Boolean values (not a logical equivalence of propositions):

activeAfter(p,d)  =  activeAt(p+1,d).\mathsf{activeAfter}(p, d) \;=\; \mathsf{activeAt}(p + 1, d).activeAfter(p,d)=activeAt(p+1,d).

Unfolding the two sides. Writing H(d)=deploymentHeight(d)H(d) = \mathsf{deploymentHeight}(d)H(d)=deploymentHeight(d) for the tabulated height (H(heightInCB)=227931H(\mathsf{heightInCB}) = 227931H(heightInCB)=227931, H(cltv)=388381H(\mathsf{cltv}) = 388381H(cltv)=388381, H(derSig)=363725H(\mathsf{derSig}) = 363725H(derSig)=363725, H(csv)=419328H(\mathsf{csv}) = 419328H(csv)=419328, H(segwit)=481824H(\mathsf{segwit}) = 481824H(segwit)=481824), and [ P ]∈{true,false}[\,P\,] \in \{\mathsf{true}, \mathsf{false}\}[P]∈{true,false} for the Boolean truth value of a decidable inequality PPP:

  • the left-hand side activeAfter(p,d)\mathsf{activeAfter}(p, d)activeAfter(p,d) is by definition [ H(d)≤p+1 ][\,H(d) \le p + 1\,][H(d)≤p+1];
  • the right-hand side activeAt(p+1,d)\mathsf{activeAt}(p + 1, d)activeAt(p+1,d) is by definition [ H(d)≤(p+1) ][\,H(d) \le (p+1)\,][H(d)≤(p+1)], i.e. the activation test [ H(d)≤h ][\,H(d) \le h\,][H(d)≤h] evaluated at the height h=p+1h = p + 1h=p+1.

So the statement says that, for every label and every natural ppp, the Boolean [ H(d)≤p+1 ][\,H(d) \le p+1\,][H(d)≤p+1] computed via the first definition equals the Boolean [ H(d)≤p+1 ][\,H(d) \le p+1\,][H(d)≤p+1] computed via the second definition. Here p+1p + 1p+1 is natural-number successor; there is no overflow or wrap-around, and p+1≥1p + 1 \ge 1p+1≥1 always.

What is not said. The statement does not relate activeAfter(p,d)\mathsf{activeAfter}(p, d)activeAfter(p,d) to activeAt(p,d)\mathsf{activeAt}(p, d)activeAt(p,d) (same height, not shifted), and it does not say anything about the value of either side; it only says the two sides agree.

Human review
  • Endorsed by Shuze Chen · Oct 26, 2026

    Confirmed by the moderator at approval.

  • Endorsed by pitimespi · Oct 26, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me