Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Prefix invariant for native recursive part collection

Open
Lax263307Proofs.NativeCollectionExecution.iterations

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

algorithmscomputational-complexitygraph-theory

Fix a finite indexed family of graph parts and the bounded child-execution contract. Under the complete collection invariant and input-frame guards, every eligible iterator prefix has an actual segment realizing the same functional prefix collection. The segment retains the graph, parent and collection state, with the stated affine bounds in prefix length and child costs:

storedPrefixj=collectPrefix⁡(j,parts,child).\mathrm{storedPrefix}_j=\operatorname{collectPrefix}(j,\mathrm{parts},\mathrm{child}).storedPrefixj​=collectPrefix(j,parts,child).

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 Lax263307Proofs.NativeCollectionExecution.iterations_native.

Preamble
import Definitions.Def_EdgeSublinearMWIS_Main_NativeDetailedInterfaces
Formal statement
namespace Lax263307Proofs.NativeCollectionExecution
theorem iterations : ∀ {n : Nat} {ι : Type} (D k r fuel S h T childSteps childTime : Nat) (cfg : Lax263307Proofs.NativeCoreMachine.Config)
  (G : SimpleGraph (Fin n)) [inst : @DecidableRel (Fin n) (Fin n) (@SimpleGraph.Adj (Fin n) G)] (x : Fin n → NNRat)
  (parts : ι → Finset (Fin n)) (order : List ι) (A : Finset (Fin n)) (extent : String → Nat) (front : List Nat)
  (base : Lax808846Proofs.Imp.Env)
  (child : (C : Finset (Fin n)) → Nat → Option (Finset (Fin (@Finset.card (Fin n) C)))),
  Nat.lt ((0:Nat)) n →
    Nat.lt ((0:Nat)) D →
      (∀ (v : Fin n),
          Lax263307Proofs.NativeSignedArithmetic.Bounded
            (@HPow.hPow Nat Nat Nat (@instHPow Nat Nat (@NPow.toPow Nat (@Monoid.toNPow Nat Nat.instMonoid)))
              ((2:Nat)) h)
            (@NNRat.cast Rat Rat.instNNRatCast (x v))) →
        ∀ (w : Nat),
          Nat.le (Lax263307Proofs.NativeComponentDecision.wordHeight n D k h) w →
            Nat.le (@List.length ι order)
                (Nat.add n
                  ((1:Nat))) →
              Nat.lt
                  (@HPow.hPow Nat Nat Nat (@instHPow Nat Nat (@NPow.toPow Nat (@Monoid.toNPow Nat Nat.instMonoid)))
                    ((2:Nat)) n)
                  (@HPow.hPow Nat Nat Nat (@instHPow Nat Nat (@NPow.toPow Nat (@Monoid.toNPow Nat Nat.instMonoid)))
                    ((2:Nat)) w) →
                Nat.lt
                    (Nat.add
                      (Nat.add
                        (Nat.add
                          (Nat.add
                            (Nat.add
                              (Nat.add
                                (Nat.add
                                  (Nat.add
                                    (Nat.add (@List.length Nat front)
                                      (Nat.mul S
                                        (@List.length String (Lax263307Proofs.NativeCoreMachine.frameArrays cfg))))
                                    (@List.length String (Lax263307Proofs.NativeCoreMachine.frameScalars cfg)))
                                  (Nat.mul n n))
                                (Nat.mul
                                  ((2:Nat)) n))
                              (Nat.mul
                                ((2:Nat)) (@List.length ι order)))
                            T)
                          fuel)
                        (Nat.mul
                          ((3:Nat))
                          (Lax263307Proofs.NativeCatalogMetadata.N n r)))
                      ((80:Nat)))
                    (@HPow.hPow Nat Nat Nat (@instHPow Nat Nat (@NPow.toPow Nat (@Monoid.toNPow Nat Nat.instMonoid)))
                      ((2:Nat)) w) →
                  (∀ (i : ι),
                      @Membership.mem ι (List ι) (@List.instMembership ι) order i →
                        Nat.le
                          (Lax263307.ComputedRounding.target
                            (@HDiv.hDiv Rat Rat Rat (@instHDiv Rat Rat.instDiv)
                              (@OfNat.ofNat Rat (nat_lit 1) (@Rat.instOfNat (nat_lit 1)))
                              (@Nat.cast Rat Rat.instNatCast D))
                            (∑ v ∈ parts i, @NNRat.cast Rat Rat.instNNRatCast (x v)))
                          T) →
                    (∀ (a : String),
                        @Membership.mem String (List String) (@List.instMembership String)
                            (Lax263307Proofs.NativeCoreMachine.frameArrays cfg) a →
                          @Eq Nat (extent a) S) →
                      Nat.le
                          (Nat.add
                            (Nat.add (@List.length Nat front)
                              (Nat.mul S
                                (@List.length String (Lax263307Proofs.NativeCoreMachine.frameArrays cfg))))
                            (@List.length String (Lax263307Proofs.NativeCoreMachine.frameScalars cfg)))
                          (extent "recursion.frames") →
                        Nat.le (Nat.mul n n)
                            (extent "child.graph") →
                          Nat.le (Nat.mul n n)
                              (extent "search.graph") →
                            Nat.le n (extent "subset.bits") →
                              Nat.le n (extent "restrict.vertices") →
                                Nat.lt
                                    (Nat.mul
                                      ((3:Nat)) n)
                                    (extent "lp.word") →
                                  Nat.le
                                      (Nat.mul
                                        ((3:Nat)) n)
                                      (extent "sum.input") →
                                    Nat.le
                                        (Nat.mul
                                          ((3:Nat))
                                          (Lax263307Proofs.NativeCatalogMetadata.N n r))
                                        (extent "lp.input") →
                                      Nat.le
                                          (Nat.mul
                                            ((3:Nat))
                                            (Lax263307Proofs.NativeCatalogMetadata.N n r))
                                          (extent "round.normal") →
                                        (∀ (i : ι),
                                            @Membership.mem ι (List ι) (@List.instMembership ι) order i →
                                              @LT.lt Rat Rat.instLT
                                                  (@HDiv.hDiv Rat Rat Rat (@instHDiv Rat Rat.instDiv)
                                                    (@HMul.hMul Rat Rat Rat (@instHMul Rat Rat.instMul)
                                                      (@HDiv.hDiv Rat Rat Rat (@instHDiv Rat Rat.instDiv)
                                                        (@OfNat.ofNat Rat (nat_lit 1) (@Rat.instOfNat (nat_lit 1)))
                                                        (@Nat.cast Rat Rat.instNatCast D))
                                                      (@Nat.cast Rat Rat.instNatCast k))
                                                    (@HMul.hMul Rat Rat Rat (@instHMul Rat Rat.instMul)
                                                      (@OfNat.ofNat Rat (nat_lit 4) (@Rat.instOfNat (nat_lit 4)))
                                                      (@Nat.cast Rat Rat.instNatCast n)))
                                                  (∑ v ∈ parts i, @NNRat.cast Rat Rat.instNNRatCast (x v)) →
                                                ∀ (σ : Lax808846Proofs.Imp.Env),
                                                  @Lax263307Proofs.NativeCollectionExecution.Invariant n
                                                      (@HPow.hPow Nat Nat Nat
                                                        (@instHPow Nat Nat
                                                          (@NPow.toPow Nat (@Monoid.toNPow Nat Nat.instMonoid)))
                                                        ((2:Nat)) w)
                                                      D k r fuel S G inst x (@List.map ι (Finset (Fin n)) parts order) A
                                                      extent front base σ →
                                                    @Lax263307Proofs.NativeRestrictionRead.Data n G inst
                                                        (fun (v : Fin n) => @NNRat.cast Rat Rat.instNNRatCast (x v))
                                                        (parts i) σ →
                                                      @Eq Nat (σ.vars "component.mask")
                                                          (@Lax263307Proofs.NativeMasks.mask n (parts i)) →
                                                        @Eq Nat (σ.vars "component.target")
                                                            (Lax263307.ComputedRounding.target
                                                              (@HDiv.hDiv Rat Rat Rat (@instHDiv Rat Rat.instDiv)
                                                                (@OfNat.ofNat Rat (nat_lit 1)
                                                                  (@Rat.instOfNat (nat_lit 1)))
                                                                (@Nat.cast Rat Rat.instNatCast D))
                                                              (∑ v ∈ parts i,
                                                                @NNRat.cast Rat Rat.instNNRatCast (x v))) →
                                                          @Eq Nat (σ.vars "machine.running")
                                                              ((1:Nat)) →
                                                            @Eq Nat (σ.vars "machine.phase")
                                                                ((11:Nat)) →
                                                              @Lax263307Proofs.NativeCollectionChild.Recursive n
                                                                (@HPow.hPow Nat Nat Nat
                                                                  (@instHPow Nat Nat
                                                                    (@NPow.toPow Nat
                                                                      (@Monoid.toNPow Nat Nat.instMonoid)))
                                                                  ((2:Nat))
                                                                  w)
                                                                S fuel childSteps childTime cfg G inst (parts i)
                                                                (Lax263307.ComputedRounding.target
                                                                  (@HDiv.hDiv Rat Rat Rat (@instHDiv Rat Rat.instDiv)
                                                                    (@OfNat.ofNat Rat (nat_lit 1)
                                                                      (@Rat.instOfNat (nat_lit 1)))
                                                                    (@Nat.cast Rat Rat.instNatCast D))
                                                                  (∑ v ∈ parts i,
                                                                    @NNRat.cast Rat Rat.instNNRatCast (x v)))
                                                                front σ
                                                                (child (parts i)
                                                                  (Lax263307.ComputedRounding.target
                                                                    (@HDiv.hDiv Rat Rat Rat (@instHDiv Rat Rat.instDiv)
                                                                      (@OfNat.ofNat Rat (nat_lit 1)
                                                                        (@Rat.instOfNat (nat_lit 1)))
                                                                      (@Nat.cast Rat Rat.instNatCast D))
                                                                    (∑ v ∈ parts i,
                                                                      @NNRat.cast Rat Rat.instNNRatCast (x v))))) →
                                          @Lax263307Proofs.NativeCollectionTrace.Iterations n ι
                                            (@HPow.hPow Nat Nat Nat
                                              (@instHPow Nat Nat (@NPow.toPow Nat (@Monoid.toNPow Nat Nat.instMonoid)))
                                              ((2:Nat)) w)
                                            cfg
                                            (@Lax263307Proofs.NativeCollectionExecution.Invariant n
                                              (@HPow.hPow Nat Nat Nat
                                                (@instHPow Nat Nat
                                                  (@NPow.toPow Nat (@Monoid.toNPow Nat Nat.instMonoid)))
                                                ((2:Nat)) w)
                                              D k r fuel S G inst x (@List.map ι (Finset (Fin n)) parts order) A extent
                                              front base)
                                            (@Lax263307Proofs.NativeCollectionExecution.Cut n r A) parts
                                            (fun (i : ι) =>
                                              @HSub.hSub Nat Nat Nat (@instHSub Nat instSubNat)
                                                (Lax263307.ComputedRounding.target
                                                  (@HDiv.hDiv Rat Rat Rat (@instHDiv Rat Rat.instDiv)
                                                    (@OfNat.ofNat Rat (nat_lit 1) (@Rat.instOfNat (nat_lit 1)))
                                                    (@Nat.cast Rat Rat.instNatCast D))
                                                  (∑ v ∈ parts i, @NNRat.cast Rat Rat.instNNRatCast (x v)))
                                                ((1:Nat)))
                                            (@Lax263307.ComputedRounding.answer n ι
                                              (@HDiv.hDiv Rat Rat Rat (@instHDiv Rat Rat.instDiv)
                                                (@OfNat.ofNat Rat (nat_lit 1) (@Rat.instOfNat (nat_lit 1)))
                                                (@Nat.cast Rat Rat.instNatCast D))
                                              k (fun (i : ι) => ∑ v ∈ parts i, @NNRat.cast Rat Rat.instNNRatCast (x v))
                                              fun (i : ι) (t : Nat) =>
                                              @Option.map (Finset (Fin (@Finset.card (Fin n) (parts i))))
                                                (Finset (Fin n))
                                                (fun (I : Finset (Fin (@Finset.card (Fin n) (parts i)))) =>
                                                  @Finset.image (Fin (@Finset.card (Fin n) (parts i))) (Fin n)
                                                    (instDecidableEqFin n)
                                                    (@DFunLike.coe
                                                      (@OrderEmbedding (Fin (@Finset.card (Fin n) (parts i))) (Fin n)
                                                        (@instLEFin (@Finset.card (Fin n) (parts i))) (@instLEFin n))
                                                      (Fin (@Finset.card (Fin n) (parts i)))
                                                      (fun (x : Fin (@Finset.card (Fin n) (parts i))) => Fin n)
                                                      (@instFunLikeOrderEmbedding (Fin (@Finset.card (Fin n) (parts i)))
                                                        (Fin n) (@instLEFin (@Finset.card (Fin n) (parts i)))
                                                        (@instLEFin n))
                                                      (@Lax263307.ComputedSeparators.label n (parts i)))
                                                    I)
                                                (child (parts i) t))
                                            order
                                            (Nat.add childSteps
                                              ((5:Nat)))
                                            (Lax263307Proofs.NativeCollectionExecution.partCost cfg n r S h childTime) := by sorry
end Lax263307Proofs.NativeCollectionExecution
Source
https://github.com/EdouardBonnet/lax-263307/blob/68b2d26aa2075e2ef80fd9d355ea748d2a818fd1/proofs/Lax263307Proofs/NativeCollectionExecution.lean, theorem iterations (lines 46–123)

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