Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Bounded native region-growth loop

Open
Lax455465Proofs.RamRegionBoundedLoop.command_spec

by Shuze Chen · Nov 18, 2026 · Mathlib 0df444a (Lean v4.33.1)

algorithmscomputational-complexitygraph-theory

Fix a rational network instance, its rational metric, the seed and threshold data, and the active-set/history state appearing in this interface. Assume its complete coefficient-height, dimension, positivity, word-size and allocated-storage guards. The fixed command implements the complete bounded region-growth process, with the explicit instruction bound from the source:

SpecB(InitialRegion,cloop,FinalRegion,Tloop).\mathrm{Spec}_B(\mathrm{InitialRegion},c_{\rm loop},\mathrm{FinalRegion},T_{\rm loop}).SpecB​(InitialRegion,cloop​,FinalRegion,Tloop​).

This is a reusable source interface for composing the complete finite-program implementation.

Retired because the namespace-wrapped declaration compiled during publication but the proof-comparison parser rejects that header (expected token / unknown full theorem identifier). The mathematically identical, fully qualified declaration is Lax455465Proofs.RamRegionBoundedLoop.command_spec_native.

Preamble
import Definitions.Def_EdgeSublinearMWIS_Main_NativeDetailedInterfaces
Formal statement
namespace Lax455465Proofs.RamRegionBoundedLoop
theorem command_spec : ∀ (B M H : Nat) {n : Nat} (I : Lax455465.RationalEncoding.RationalInstance n)
  (length : Lax455465Proofs.MetricMatrix.Matrix n) (seed beta delta threshold : NNRat) (p : Nat),
  Nat.le ((1:Nat)) M →
    Nat.le (Lax455465Proofs.RegionBudget.steps p) M →
      Nat.lt
          (Nat.add
            (Nat.mul ((2:Nat))
              (@HPow.hPow Nat Nat Nat (@instHPow Nat Nat (@NPow.toPow Nat (@Monoid.toNPow Nat Nat.instMonoid))) M
                ((2:Nat))))
            ((3:Nat)))
          B →
        Nat.lt
            (Nat.add
              (Nat.mul
                ((2:Nat))
                (@HPow.hPow Nat Nat Nat (@instHPow Nat Nat (@NPow.toPow Nat (@Monoid.toNPow Nat Nat.instMonoid)))
                  (@HPow.hPow Nat Nat Nat (@instHPow Nat Nat (@NPow.toPow Nat (@Monoid.toNPow Nat Nat.instMonoid)))
                    ((2:Nat)) H)
                  ((2:Nat))))
              ((3:Nat)))
            B →
          Nat.lt
              (Nat.add
                (Nat.mul
                  ((2:Nat))
                  (Nat.mul n n))
                ((2:Nat)))
              B →
            Nat.lt
                (Nat.add
                  (Nat.mul
                    ((2:Nat)) n)
                  ((2:Nat)))
                B →
              Nat.lt
                  (Nat.add
                    (Nat.mul
                      ((2:Nat))
                      (Nat.add
                        (Nat.add (Lax455465Proofs.RegionBudget.steps p)
                          ((1:Nat)))
                        (Nat.mul
                          ((2:Nat)) n)))
                    ((2:Nat)))
                  B →
                Nat.lt
                    (Nat.add
                      (Nat.mul
                        ((4:Nat)) p)
                      ((4:Nat)))
                    B →
                  Lax455465Proofs.LpInputSize.Height
                      (@HPow.hPow Nat Nat Nat (@instHPow Nat Nat (@NPow.toPow Nat (@Monoid.toNPow Nat Nat.instMonoid)))
                        ((2:Nat)) H)
                      (@NNRat.cast Rat Rat.instNNRatCast threshold) →
                    (∀ (v : Fin n),
                        Nat.le (@Lax455465.RationalEncoding.RationalInstance.weight n I v).num M) →
                      (∀ (v : Fin n),
                          Nat.le (@Lax455465.RationalEncoding.RationalInstance.weight n I v).den M) →
                        (∀ (u v : Fin n),
                            Nat.le (@Lax455465.RationalEncoding.RationalInstance.capacity n I u v).num
                              M) →
                          (∀ (u v : Fin n),
                              Nat.le (@Lax455465.RationalEncoding.RationalInstance.capacity n I u v).den
                                M) →
                            (∀ (u v : Fin n),
                                Lax455465Proofs.LpInputSize.Height M (@NNRat.cast Rat Rat.instNNRatCast (length u v))) →
                              Lax455465Proofs.LpInputSize.Height M (@NNRat.cast Rat Rat.instNNRatCast delta) →
                                Lax455465Proofs.LpInputSize.Height M
                                    (@NNRat.cast Rat Rat.instNNRatCast
                                      (@HDiv.hDiv NNRat NNRat NNRat (@instHDiv NNRat NNRat.instDiv) delta
                                        (@Nat.cast NNRat
                                          (@AddMonoidWithOne.toNatCast NNRat
                                            (@AddCommMonoidWithOne.toAddMonoidWithOne NNRat
                                              (@NonAssocSemiring.toAddCommMonoidWithOne NNRat
                                                (@Semiring.toNonAssocSemiring NNRat
                                                  (@DivisionSemiring.toSemiring NNRat
                                                    (@Semifield.toDivisionSemiring NNRat NNRat.instSemifield))))))
                                          (Lax455465Proofs.RegionBudget.steps p)))) →
                                  (∀ (active : Finset (Fin n)) (root : Fin n) (i : Nat)
                                      (hi :
                                        Nat.lt i
                                          (@List.length NNRat
                                            (@Lax455465Proofs.RadiusData.candidates n (length root)
                                              (fun (v : Fin n) => length v root) (Lax455465Proofs.RegionBudget.steps p)
                                              delta))),
                                      @Lax455465Proofs.RegionQueryHeight.Bounds n
                                        (@Lax455465Proofs.RadiusSearchData.atRadius n
                                          (@Lax455465Proofs.RegionExecutionData.query n I length active root seed beta)
                                          (@GetElem.getElem (List NNRat) Nat NNRat
                                            (fun (as : List NNRat) (i : Nat) =>
                                              Nat.lt i (@List.length NNRat as))
                                            (@List.instGetElemNatLtLength NNRat)
                                            (@Lax455465Proofs.RadiusData.candidates n (length root)
                                              (fun (v : Fin n) => length v root) (Lax455465Proofs.RegionBudget.steps p)
                                              delta)
                                            i hi))
                                        H) →
                                    @Eq Rat (@NNRat.cast Rat Rat.instNNRatCast beta)
                                        (Lax455465Proofs.RegionSearch.slope (Lax455465Proofs.RegionBudget.steps p)
                                          (@NNRat.cast Rat Rat.instNNRatCast delta)) →
                                      @LT.lt Rat Rat.instLT (@OfNat.ofNat Rat (nat_lit 0) (@Rat.instOfNat (nat_lit 0)))
                                          (@NNRat.cast Rat Rat.instNNRatCast seed) →
                                        @LT.lt Rat Rat.instLT
                                            (@OfNat.ofNat Rat (nat_lit 0) (@Rat.instOfNat (nat_lit 0)))
                                            (@NNRat.cast Rat Rat.instNNRatCast delta) →
                                          Nat.lt ((0:Nat))
                                              p →
                                            (∀ (v : Fin n),
                                                @Eq NNRat (length v v)
                                                  (@OfNat.ofNat NNRat (nat_lit 0)
                                                    (@Zero.toOfNat0 NNRat
                                                      (@MulZeroClass.toZero NNRat
                                                        (@instMulZeroClassOfSemiring NNRat
                                                          (@DivisionSemiring.toSemiring NNRat
                                                            (@Semifield.toDivisionSemiring NNRat
                                                              NNRat.instSemifield))))))) →
                                              (∀ (u v w : Fin n),
                                                  @LE.le Rat Rat.instLE (@NNRat.cast Rat Rat.instNNRatCast (length u w))
                                                    (@HAdd.hAdd Rat Rat Rat (@instHAdd Rat Rat.instAdd)
                                                      (@NNRat.cast Rat Rat.instNNRatCast (length u v))
                                                      (@NNRat.cast Rat Rat.instNNRatCast (length v w)))) →
                                                @LE.le Rat Rat.instLE
                                                    (@Lax455465Proofs.RegionRounding.metricCost n I
                                                      (@Lax455465Proofs.MetricMatrix.rational n length))
                                                    (@HMul.hMul Rat Rat Rat (@instHMul Rat Rat.instMul)
                                                      (@Nat.cast Rat Rat.instNatCast p)
                                                      (@NNRat.cast Rat Rat.instNNRatCast seed)) →
                                                  Nat.le
                                                      (@Finset.card (Fin n)
                                                        (@Lax455465Proofs.RegionSelection.support n
                                                          (@Lax455465Proofs.RegionLoop.weights n I
                                                            (@Finset.univ (Fin n) (Fin.fintype n)))))
                                                      p →
                                                    Lax808846Proofs.Reasoning.Spec B
                                                      (fun (σ : Lax808846Proofs.Imp.Env) =>
                                                        And
                                                          (@Lax455465Proofs.RamRegionInvariant.Fixed n I length seed
                                                            beta delta threshold p σ)
                                                          (And (Lax455465Proofs.RamRegionInvariant.Room n p σ)
                                                            (And
                                                              (@Eq Nat (σ.vars "loop.limit")
                                                                (Nat.add p
                                                                  ((1:Nat))))
                                                              (@Lax455465Proofs.RamRegionState.View n I length seed beta
                                                                (Lax455465Proofs.RamRegionBoundedLoop.initial n) σ))))
                                                      Lax455465Proofs.RamRegionScan.command
                                                      (fun (x τ : Lax808846Proofs.Imp.Env) =>
                                                        And
                                                          (@Lax455465Proofs.RamRegionInvariant.Fixed n I length seed
                                                            beta delta threshold p τ)
                                                          (And (Lax455465Proofs.RamRegionInvariant.Room n p τ)
                                                            (@Lax455465Proofs.RamRegionState.View n I length seed beta
                                                              (@Nat.iterate (Lax455465Proofs.RegionRuntimeState.State n)
                                                                (@Lax455465Proofs.RegionRuntimeState.advance n I length
                                                                  seed beta delta threshold p)
                                                                (Nat.add p
                                                                  ((1:Nat)))
                                                                (Lax455465Proofs.RamRegionBoundedLoop.initial n))
                                                              τ)))
                                                      (Lax455465Proofs.RamRegionBoundedLoop.cost n p M H) := by sorry
end Lax455465Proofs.RamRegionBoundedLoop
Source
https://github.com/EdouardBonnet/lax-455465/blob/9988b9c5399185cfb3ca2129ca7c807fd80c2885/proofs/Lax455465Proofs/RamRegionBoundedLoop.lean, theorem command_spec (lines 15–49)

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