Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Complete native collection of recursively solved parts

Open
Lax263307Proofs.NativeCollectionExecution.collect_segment

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

algorithmscomputational-complexitygraph-theory

Fix the finite family of parts, core configuration, graph and child procedure. Assume the source membership and eligibility hypotheses, the complete collection context, allocated frames and bounded executions for all required children. The actual collection phase returns the exact functional collection result while retaining its stored context and root frame:

answerout=collect⁡(parts,child).\mathrm{answer}_{\rm out}=\operatorname{collect}(\mathrm{parts},\mathrm{child}).answerout​=collect(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.collect_segment_native.

Preamble
import Definitions.Def_EdgeSublinearMWIS_Main_NativeDetailedInterfaces
Formal statement
namespace Lax263307Proofs.NativeCollectionExecution
theorem collect_segment : ∀ {n : Nat} {ι : Type} [inst : Fintype ι] (D k r fuel S h T childSteps childTime : Nat)
  (cfg : Lax263307Proofs.NativeCoreMachine.Config) (G : SimpleGraph (Fin n))
  [inst_1 : @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)))),
  (∀ (i : ι), @Membership.mem ι (List ι) (@List.instMembership ι) order i) →
    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_1 x
                                                        (@List.map ι (Finset (Fin n)) parts order) A extent front base
                                                        σ →
                                                      @Lax263307Proofs.NativeRestrictionRead.Data n G inst_1
                                                          (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_1 (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))))) →
                                            ∀ (σ : Lax808846Proofs.Imp.Env),
                                              @Lax263307Proofs.NativeCollectionTrace.At n
                                                  (@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_1 x (@List.map ι (Finset (Fin n)) parts order) A
                                                    extent front base)
                                                  ((0:Nat))
                                                  (@EmptyCollection.emptyCollection (Finset (Fin n))
                                                    (@Finset.instEmptyCollection (Fin n)))
                                                  σ →
                                                ∃ (τ : Lax808846Proofs.Imp.Env) (transitions : Nat) (total : Nat),
                                                  And
                                                    (Lax263307Proofs.NativeMachineSegment.Segment
                                                      (@HPow.hPow Nat Nat Nat
                                                        (@instHPow Nat Nat
                                                          (@NPow.toPow Nat (@Monoid.toNPow Nat Nat.instMonoid)))
                                                        ((2:Nat)) w)
                                                      (Lax263307Proofs.NativeCoreMachine.phases cfg) transitions total σ
                                                      τ)
                                                    (And
                                                      (Nat.le transitions
                                                        (Nat.add
                                                          (Nat.mul
                                                            (Nat.add
                                                              childSteps
                                                              ((5:Nat)))
                                                            (@List.length ι order))
                                                          ((1:Nat))))
                                                      (And
                                                        (Nat.le total
                                                          (Nat.add
                                                            (Nat.mul
                                                              (Lax263307Proofs.NativeCollectionExecution.partCost cfg n
                                                                r S h childTime)
                                                              (@List.length ι order))
                                                            ((10:Nat))))
                                                        (@Lax263307Proofs.NativeCollectionTrace.ResultOutput n
                                                          (@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_1 x
                                                            (@List.map ι (Finset (Fin n)) parts order) A extent front
                                                            base)
                                                          (@Lax263307Proofs.NativeCollectionExecution.Cut n r A)
                                                          (@Lax263307.ComputedRounding.collect n ι inst order parts
                                                            (@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))
                                                          τ))) := by sorry
end Lax263307Proofs.NativeCollectionExecution
Source
https://github.com/EdouardBonnet/lax-263307/blob/68b2d26aa2075e2ef80fd9d355ea748d2a818fd1/proofs/Lax263307Proofs/NativeCollectionExecution.lean, theorem collect_segment (lines 125–173)

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