Documentation

CslibFrontier.Computability.PolyTime.CSP.Edge.Solver.Program

Finite stack for one edge-CSP improvement #

Frames retain the prepared original body, its finite occurrence buffer and its actual cycle. Descent performs a fresh native forest search and pushes exactly one frame per contraction. The first improvement unwinds those frames once, lifting an arbitrary improving child buffer. An exhausted child propagates optimality immediately. There is no recursive optimization of children. Clocks use actual occurrence-list lengths, independently of binary label magnitudes.

This program uses the original CSP Table ℕ, existing occurrence buffers, native forest codes and augmenting-walk codes. Preparation, contraction and lifting execute actual finite buffer operations, with no implementation or lifting provider as input. Agreement proves exact mathematical agreement; PolyTime supplies ordinary native certificates with full encoded storage bounds.

Prepared parent problem and the cycle used for its actual whole-instance contraction.

Instances For
    theorem Cslib.Complexity.CSP.EdgeSolver.Program.encFrame_cycle_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Frame} :
    theorem Cslib.Complexity.CSP.EdgeSolver.Program.encFrame_parent_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Frame} :
    Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ encFrame S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (a : γ✝) => (g✝ a).parent) encIn✝ EdgeForest.encInput S✝
    theorem Cslib.Complexity.CSP.EdgeSolver.Program.encFrame_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → EdgeForest.Input} {x1 : γ → EdgeAugmenting.WalkCode} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn EdgeForest.encInput budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn EdgeAugmenting.encWalkCode budget) :
    Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { parent := x0 x, cycle := x1 x }) encIn encFrame budget
    theorem Cslib.Complexity.CSP.EdgeSolver.Program.encFrame_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → EdgeForest.Input} {T0 S0 : γ → ℕ} {x1 : γ → EdgeAugmenting.WalkCode} {T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn EdgeForest.encInput T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn EdgeAugmenting.encWalkCode T1 S1) :
    Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { parent := x0 x, cycle := x1 x }) encIn encFrame (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x

    The framed parent input precedes the cycle's framed base and ordered position pairs.

    Instances For
      @[reducible, inline]

      Encode the actual positional labeling by scanning actual incidences.

      Instances For

        Read the actual blossom event, perform its preparatory flip and construct the child. All old constraint positions and all nullaries are retained by Blossom.contract.

        Instances For

          Flip the actual decoded native augmentation and return its exact-width buffer.

          Instances For

            Lift one actual child improvement into its prepared parent. Every outside change in the comparison is retained; the full liftComparison construction selects and lifts its walk.

            Instances For

              Finite stack state. Status is running, proved optimal, or an improving finite buffer.

              • Current contracted problem; restored to the parent after every pop.

              • frames : List Frame

                Prepared parents, newest first.

              • budget : ℕ

                Remaining contraction depth, in unary and funded by the original occurrence list.

              • status : Option (Option (List Bool))

                none descends; some none stops; some (some bits) unwinds.

              Instances For
                theorem Cslib.Complexity.CSP.EdgeSolver.Program.encState_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → EdgeForest.Input} {T0 S0 : γ → ℕ} {x1 : γ → List Frame} {T1 S1 x2 T2 S2 : γ → ℕ} {x3 : γ → Option (Option (List Bool))} {T3 S3 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn EdgeForest.encInput T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn (Turing.MultiTapeTM.encList encFrame) T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn Turing.MultiTapeTM.encUnary T2 S2) (h3 : Turing.MultiTapeTM.ComputableInO x3 encIn (Turing.MultiTapeTM.encOption (Turing.MultiTapeTM.encOption (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBool))) T3 S3) :
                Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { current := x0 x, frames := x1 x, budget := x2 x, status := x3 x }) encIn encState (fun (x : γ) => T0 x + (T1 x + (T2 x + T3 x))) fun (x : γ) => S0 x + (S1 x + (S2 x + S3 x))
                theorem Cslib.Complexity.CSP.EdgeSolver.Program.encState_current_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → State} :
                Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ encState S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (a : γ✝) => (g✝ a).current) encIn✝ EdgeForest.encInput S✝
                theorem Cslib.Complexity.CSP.EdgeSolver.Program.encState_frames_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → State} :

                Current input and stack are framed fields, followed by the two status tags and framed bits.

                Instances For
                  theorem Cslib.Complexity.CSP.EdgeSolver.Program.encState_budget_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → State} :
                  theorem Cslib.Complexity.CSP.EdgeSolver.Program.encState_mk_deg :
                  Turing.MultiTapeTM.ComputableInDegree (fun (p : EdgeForest.Input × List Frame × ℕ × Option (Option (List Bool))) => { current := p.1, frames := p.2.1, budget := p.2.2.1, status := p.2.2.2 }) encStateFields encState 1 1

                  One descent or one lift. A stopped optimum needs no parent labeling reconstruction: count-preserving preparation and reference optimality transfer certify the original optimum.

                  Instances For

                    One-improvement stack program. Each contraction uses one descent and at most one lift. The additional steps fund the terminal search and final status. Clock value is unary and funded by the input occurrence list; no binary name or arity is expanded.

                    Instances For
                      @[reducible, inline]

                      Outer optimization state: current original buffer and a flag preserving first exhaustion.

                      Instances For

                        Improve the original problem once, stopping permanently after optimality is established.

                        Instances For

                          Guarded finite optimization program. The occurrence list pays for all outer iterations. Malformed models reject before any forest search or contraction.

                          Instances For

                            Complete guarded finite decision program.

                            Instances For