Complete native near-branch segment with child executions
OpenLax263307Proofs.NativeNearExecution.near_segmentFix the native core configuration, graph, rational near point and recursive child procedure. Assume the complete near-branch setup, oracle context, stored rounded state and required bounded child executions. The actual phase machine returns the functional near reply, preserves the rounded state, context and root frame, and satisfies the published transition and time bounds:
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.NativeNearExecution.near_segment_native.
import Definitions.Def_EdgeSublinearMWIS_Main_NativeDetailedInterfaces
namespace Lax263307Proofs.NativeNearExecution
theorem near_segment : ∀ {n r : Nat} (D k p b load F fuel S v limit M h T w space flowTime childSteps childTime : Nat)
(cfg : Lax263307Proofs.NativeCoreMachine.Config) (G : SimpleGraph (Fin n))
[inst : @DecidableRel (Fin n) (Fin n) (@SimpleGraph.Adj (Fin n) G)] (flow : List Nat → List Nat)
(x : Fin (Lax263307Proofs.NativeCatalogMetadata.N n r) → Rat) (extent : String → Nat) (front : List Nat)
(child : (C : Finset (Fin n)) → Nat → Option (Finset (Fin (@Finset.card (Fin n) C)))),
Lax263307Proofs.NativeNearExecution.Bounds n r D k p M h T fuel S w cfg extent front →
(∀ (i : Fin (Lax263307Proofs.NativeCatalogMetadata.N n r)),
Lax263307Proofs.NativeSignedArithmetic.Bounded M (x i)) →
(∀ (A : Finset (Fin n)),
@Eq (Option (Finset (Fin n)))
(@Lax263307.HeavyRationalConditioning.findHeavyConditioning n r G inst k p
(@Lax263307.MomentLP.decode Rat n r x))
(@Option.some (Finset (Fin n)) A) →
Nat.le (@Finset.card (Fin n) A) r) →
(∀ (A : Finset (Fin n)),
@Eq (Option (Finset (Fin n)))
(@Lax263307.HeavyRationalConditioning.findHeavyConditioning n r G inst k p
(@Lax263307.MomentLP.decode Rat n r x))
(@Option.some (Finset (Fin n)) A) →
∀ (C : Finset (Fin n)),
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 ∈ C,
@NNRat.cast Rat Rat.instNNRatCast
(@Lax263307.NearOracle.costs n r (@Lax263307.MomentLP.decode Rat n r x) A v)))
T) →
(∀ (a : String),
@Membership.mem String (List String) (@List.instMembership String)
Lax263307Proofs.NativeSeparatorContext.workspace a →
Nat.le space (extent a)) →
(∀ (A : Finset (Fin n)),
have costs := @Lax263307.NearOracle.costs n r (@Lax263307.MomentLP.decode Rat n r x) A;
have cs :=
@Lax263307.ComputedSeparators.cuts n (@Lax263307.ComputedSeparators.step n flow G inst costs b load k)
n (@Finset.univ (Fin n) (Fin.fintype n));
Lax808846Proofs.Reasoning.Spec
(@HPow.hPow Nat Nat Nat (@instHPow Nat Nat (@NPow.toPow Nat (@Monoid.toNPow Nat Nat.instMonoid)))
((2:Nat)) w)
(fun (σ : Lax808846Proofs.Imp.Env) =>
And (@Lax263307Proofs.NativeSeparatorContext.Context n G inst costs b load k space σ)
(Nat.le
(Nat.add n
((1:Nat)))
(@List.length Nat (σ.arrs "separator.pieces"))))
(Lax263307Proofs.NativeSeparatorOutput.command cfg.flow cfg.flowWidth)
(fun (x τ : Lax808846Proofs.Imp.Env) =>
And (@Lax263307Proofs.NativeSeparatorContext.Context n G inst costs b load k space τ)
(And
(@Eq Nat (τ.vars "separator.remaining")
(@Lax263307Proofs.NativeMasks.mask n
(@Lax263307.ComputedSeparators.remaining n (@Finset.univ (Fin n) (Fin.fintype n)) cs)))
(And
(@Eq Nat (τ.vars "separator.value")
(@Lax263307Proofs.NativeMasks.mask n (@Lax263307.ComputedSeparators.separator n cs)))
(And
(@Eq Nat (τ.vars "separator.count")
(@List.length (Prod (Finset (Fin n)) (Finset (Fin n))) cs))
(And
(Lax455465Proofs.RamVirtualState.Prefix (@Lax263307Proofs.NativeCutRecords.words n cs)
"separator.cuts" τ)
(And
(@Eq Nat (τ.vars "separator.position")
(Nat.mul
((2:Nat))
(@List.length (Prod (Finset (Fin n)) (Finset (Fin n))) cs)))
(Lax455465Proofs.RamVirtualState.Prefix (@Lax263307Proofs.NativeCutPieces.words n cs)
"separator.pieces" τ)))))))
flowTime) →
(∀ (A : Finset (Fin n)),
@Eq (Option (Finset (Fin n)))
(@Lax263307.HeavyRationalConditioning.findHeavyConditioning n r G inst k p
(@Lax263307.MomentLP.decode Rat n r x))
(@Option.some (Finset (Fin n)) A) →
let costs := @Lax263307.NearOracle.costs n r (@Lax263307.MomentLP.decode Rat n r x) A;
let cs :=
@Lax263307.ComputedSeparators.cuts n
(@Lax263307.ComputedSeparators.step n flow G inst costs b load k) n
(@Finset.univ (Fin n) (Fin.fintype n));
∀ (i : Option (Fin (@List.length (Prod (Finset (Fin n)) (Finset (Fin n))) cs))),
@Membership.mem (Option (Fin (@List.length (Prod (Finset (Fin n)) (Finset (Fin n))) cs)))
(List (Option (Fin (@List.length (Prod (Finset (Fin n)) (Finset (Fin n))) cs))))
(@List.instMembership
(Option (Fin (@List.length (Prod (Finset (Fin n)) (Finset (Fin n))) cs))))
(Lax263307.NearOracle.order (@List.length (Prod (Finset (Fin n)) (Finset (Fin n))) cs)) 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 ∈ @Lax263307.ComputedSeparators.pieces n cs i,
@NNRat.cast Rat Rat.instNNRatCast (costs v)) →
∀ (base σ : Lax808846Proofs.Imp.Env),
Lax263307Proofs.NativeOracleContext.Protocol
(@HPow.hPow Nat Nat Nat
(@instHPow Nat Nat (@NPow.toPow Nat (@Monoid.toNPow Nat Nat.instMonoid)))
((2:Nat)) w)
D S v cfg extent front σ →
@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 costs
(@List.map (Option (Fin (@List.length (Prod (Finset (Fin n)) (Finset (Fin n))) cs)))
(Finset (Fin n)) (@Lax263307.ComputedSeparators.pieces n cs)
(Lax263307.NearOracle.order
(@List.length (Prod (Finset (Fin n)) (Finset (Fin n))) cs)))
A extent front base σ →
@Lax263307Proofs.NativeRestrictionRead.Data n G inst
(fun (v : Fin n) => @NNRat.cast Rat Rat.instNNRatCast (costs v))
(@Lax263307.ComputedSeparators.pieces n cs i) σ →
@Eq Nat (σ.vars "component.mask")
(@Lax263307Proofs.NativeMasks.mask n
(@Lax263307.ComputedSeparators.pieces n cs 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 ∈ @Lax263307.ComputedSeparators.pieces n cs i,
@NNRat.cast Rat Rat.instNNRatCast (costs 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
(@Lax263307.ComputedSeparators.pieces n cs 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 ∈ @Lax263307.ComputedSeparators.pieces n cs i,
@NNRat.cast Rat Rat.instNNRatCast (costs v)))
front σ
(child (@Lax263307.ComputedSeparators.pieces n cs i)
(Lax263307.ComputedRounding.target
(@HDiv.hDiv Rat Rat Rat (@instHDiv Rat Rat.instDiv)
(@OfNat.ofNat Rat (nat_lit 1)
((have costs :=
@Lax263307.NearOracle.costs n r
(@Lax263307.MomentLP.decode Rat n r x) A;
have cs :=
@Lax263307.ComputedSeparators.cuts n
(@Lax263307.ComputedSeparators.step n flow G inst costs b load
k)
n (@Finset.univ (Fin n) (Fin.fintype n));
fun
(i :
Option
(Fin
(@List.length (Prod (Finset (Fin n)) (Finset (Fin n)))
cs)))
(base σ : Lax808846Proofs.Imp.Env) =>
@Rat.instOfNat (nat_lit 1))
i base σ))
(@Nat.cast Rat Rat.instNatCast D))
(∑ v ∈ @Lax263307.ComputedSeparators.pieces n cs i,
@NNRat.cast Rat Rat.instNNRatCast (costs v))))) →
∀ (j : Nat) (state : Lax263307.RoundedOracleSearch.State (Lax263307Proofs.NativeCatalogMetadata.N n r))
(σ : Lax808846Proofs.Imp.Env),
@Lax263307Proofs.NativeOracleContext.Context n
(@HPow.hPow Nat Nat Nat (@instHPow Nat Nat (@NPow.toPow Nat (@Monoid.toNPow Nat Nat.instMonoid)))
((2:Nat)) w)
D k r p b load F fuel S v limit cfg G inst extent front σ →
@Lax263307Proofs.NativeRoundedTrace.StoredState (Lax263307Proofs.NativeCatalogMetadata.N n r) j
state σ →
Lax455465Proofs.RamVirtualState.Prefix
(@Lax109476.RationalEncoding.encodeVector (Lax263307Proofs.NativeCatalogMetadata.N n r) x)
"lp.word" σ →
@Eq Nat (σ.vars "machine.running") ((1:Nat)) →
@Eq Nat (σ.vars "machine.phase") ((6:Nat)) →
∃ (τ : 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)))
(Nat.add n
((1:Nat))))
((4:Nat))))
(And
(Nat.le total
(Lax263307Proofs.NativeNearExecution.timeBound cfg n r M S h childTime flowTime))
(And
(@Lax263307Proofs.NativeOracleContext.Context n
(@HPow.hPow Nat Nat Nat
(@instHPow Nat Nat (@NPow.toPow Nat (@Monoid.toNPow Nat Nat.instMonoid)))
((2:Nat)) w)
D k r p b load F fuel S v limit cfg G inst extent front τ)
(And
(@Lax263307Proofs.NativeRoundedTrace.StoredState
(Lax263307Proofs.NativeCatalogMetadata.N n r) j state τ)
(And
(@Lax263307Proofs.NativeNearExecution.Output n r
(@Lax263307Proofs.NativeNearExecution.run n r flow G inst D k p b load
(@Lax263307.MomentLP.decode Rat n r x) child)
τ)
(Lax263307Proofs.NativeOracleContext.RootData σ τ)))))) := by sorry
end Lax263307Proofs.NativeNearExecution