Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Buried-deployment activation is monotone in height

Proved
BitcoinActivation.activeAt_mono

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

bitcoinbitcoin-mainnetconsensusformal-verificationscript-flagssoft-fork-activation

For every buried deployment and heights h1≤h2h_1 \le h_2h1​≤h2​, if the deployment is active at h1h_1h1​ then it is active at h2h_2h2​: a buried deployment, once active, stays active.

Preamble
import Definitions.Def_BitcoinActivation
Formal statement
theorem BitcoinActivation.activeAt_mono (dep : BuriedDeployment) (h₁ h₂ : Nat) (h : h₁ ≤ h₂)
    (ha : BitcoinActivation.activeAt h₁ dep = true) : BitcoinActivation.activeAt h₂ dep = true := 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.activeAt_mono

Binders and hypotheses. The statement is universally quantified over

  • a label ddd 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};
  • two natural numbers h1,h2∈Nh_1, h_2 \in \mathbb{N}h1​,h2​∈N;

and it carries two hypotheses:

  1. h1≤h2h_1 \le h_2h1​≤h2​ (non-strict; h1=h2h_1 = h_2h1​=h2​ is allowed);
  2. activeAt(h1,d)=true\mathsf{activeAt}(h_1, d) = \mathsf{true}activeAt(h1​,d)=true, where the left side is a Boolean and the hypothesis is the proposition that this Boolean equals true\mathsf{true}true.

Conclusion. Under those hypotheses,

activeAt(h2,d)=true,\mathsf{activeAt}(h_2, d) = \mathsf{true},activeAt(h2​,d)=true,

again a proposition asserting that a Boolean value equals true\mathsf{true}true.

Unfolding. With H(d)=deploymentHeight(d)H(d) = \mathsf{deploymentHeight}(d)H(d)=deploymentHeight(d) the tabulated height of the label (227931227931227931, 388381388381388381, 363725363725363725, 419328419328419328, 481824481824481824 for heightInCB\mathsf{heightInCB}heightInCB, cltv\mathsf{cltv}cltv, derSig\mathsf{derSig}derSig, csv\mathsf{csv}csv, segwit\mathsf{segwit}segwit respectively), activeAt(h,d)\mathsf{activeAt}(h, d)activeAt(h,d) is the Boolean truth value of H(d)≤hH(d) \le hH(d)≤h. So the statement reads:

∀d,  ∀h1,h2∈N,h1≤h2  ⇒  H(d)≤h1  ⇒  H(d)≤h2,\forall d,\; \forall h_1, h_2 \in \mathbb{N},\quad h_1 \le h_2 \;\Rightarrow\; H(d) \le h_1 \;\Rightarrow\; H(d) \le h_2,∀d,∀h1​,h2​∈N,h1​≤h2​⇒H(d)≤h1​⇒H(d)≤h2​,

with the two activation facts expressed as "the Boolean [ H(d)≤hi ][\,H(d) \le h_i\,][H(d)≤hi​] equals true\mathsf{true}true".

Edge cases. The hypothesis activeAt(h1,d)=true\mathsf{activeAt}(h_1, d) = \mathsf{true}activeAt(h1​,d)=true forces h1≥H(d)≥227931h_1 \ge H(d) \ge 227931h1​≥H(d)≥227931, so for heights h1h_1h1​ below the label's tabulated height the statement is vacuous (the hypothesis fails). There is no claim in the other direction: nothing is asserted about activeAt(h1,d)\mathsf{activeAt}(h_1, d)activeAt(h1​,d) when activeAt(h2,d)=true\mathsf{activeAt}(h_2, d) = \mathsf{true}activeAt(h2​,d)=true, nor about the case activeAt(h1,d)=false\mathsf{activeAt}(h_1, d) = \mathsf{false}activeAt(h1​,d)=false. The statement is an implication, not an equivalence.

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