Documentation

CslibFrontier.Algorithms.Reachability.MinIsolation.Generator.SeedWeight

A native weight pass on a read-only Justesen seed #

Read the raw seed in index order, mask each bit using the prepared Justesen field context and the vertex column, and apply the layer scaling to the base-six sum. The implementation shares the seed-digit loop and replaces only its final output. The query state bound charges the prepared field context and seed length separately. With a fixed prepared context, the entire raw-seed computation has a native linear-workspace certificate.

The runtime entry loads a prepared context from the framed input prefix. Its offset executor agrees with the direct weight pass on the unchanged seed suffix. One native machine loads the header and executes this pass, using workspace linear in the encoded request and returning the binary weight. For canonical seeds and vertices, the compiled machine's workspace and output length are linear in the encoded binary dimensions. The input still contains the prepared field context.

The field data and vertex coordinates retained during a single weight query.

theorem Cslib.Reachability.Hoza.SeedWeight.encContext_field_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Context} :
theorem Cslib.Reachability.Hoza.SeedWeight.encContext_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → Code.JustesenFamily.FieldContext} {x1 x2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Code.JustesenFamily.encFieldContext budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encNat budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn Turing.MultiTapeTM.encNat budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { field := x0 x, layer := x1 x, column := x2 x }) encIn encContext budget
theorem Cslib.Reachability.Hoza.SeedWeight.encContext_layer_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Context} :
theorem Cslib.Reachability.Hoza.SeedWeight.encContext_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → Code.JustesenFamily.FieldContext} {T0 S0 x1 T1 S1 x2 T2 S2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Code.JustesenFamily.encFieldContext T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encNat T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn Turing.MultiTapeTM.encNat T2 S2) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { field := x0 x, layer := x1 x, column := x2 x }) encIn encContext (fun (x : γ) => T0 x + (T1 x + T2 x)) fun (x : γ) => S0 x + (S1 x + S2 x)

Framed field context and binary layer, followed by the binary column.

theorem Cslib.Reachability.Hoza.SeedWeight.encContext_column_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Context} :

Scan one raw seed and return the binary Justesen weight of the given vertex.

The weight of a raw seed at the vertex specified by the prepared context.

With a fixed prepared field and vertex context, the entire raw-seed pass uses native workspace linear in the seed length, including its binary output.

Every clock charges only the retained context and the length of the read-only seed.

theorem Cslib.Reachability.Hoza.SeedWeight.weight_eq_generatedWeight {w n : ℕ} (seed : Fin (Code.JustesenFamily.codeLength w n) → Bool) (z : Fin (n + 1) × Fin w) :
weight { field := Code.JustesenFamily.fieldContext w n, layer := ↑z.1, column := ↑z.2 } (List.ofFn seed) = generatedWeight seed z

A raw seed in index order gives the existing generated weight at the prepared vertex.

theorem Cslib.Reachability.Hoza.SeedWeight.generatedWeight_output {w n : ℕ} (seed : Fin (Code.JustesenFamily.codeLength w n) → Bool) (z : Fin (n + 1) × Fin w) :
have raw := List.ofFn seed; have M := machine { field := Code.JustesenFamily.fieldContext w n, layer := ↑z.1, column := ↑z.2 }; (∀ t < raw.length + 1, M.halted (M.run raw t) = false) ∧ M.halted (M.run raw (raw.length + 1)) = true ∧ M.output raw (raw.length + 1) = Turing.MultiTapeTM.encNat (generatedWeight seed z)

For the seed in increasing index order, the pass first halts at the first absent bit and returns the existing generated weight, including the zero weight at layer zero.

theorem Cslib.Reachability.Hoza.SeedWeight.generatedWeight_run_length_le_encodedDimensions :
∃ (C : ℕ), ∀ {w n : ℕ} (seed : Fin (Code.JustesenFamily.codeLength w n) → Bool) (z : Fin (n + 1) × Fin w), have ctx := { field := Code.JustesenFamily.fieldContext w n, layer := ↑z.1, column := ↑z.2 }; have raw := List.ofFn seed; have M := machine ctx; have e := SeedDigits.encState Context encContext; have budget := ((Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encNat Turing.MultiTapeTM.encNat) (w, n)).length + 1; (∀ (t : ℕ), (e (M.run raw t)).length ≤ C * budget) ∧ (Turing.MultiTapeTM.encNat (generatedWeight seed z)).length ≤ C * budget

For canonical seeds and vertices, a single bound in the encoded binary dimensions covers every state of the read-only pass and the binary weight it returns.

@[reducible, inline]

A framed binary offset and the complete encoded weight-pass state.

A prepared weight context and its read-only seed word.

  • context : Context

    Field information and vertex coordinates for this weight.

  • seed : List Bool

    Seed bits in query order.

theorem Cslib.Reachability.Hoza.SeedWeight.Runtime.encInput_seed_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Input} :

Framed weight context followed by the raw seed without an extra frame.

theorem Cslib.Reachability.Hoza.SeedWeight.Runtime.encInput_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 : γ → Context} {x1 : γ → List Bool} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn encContext budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encBits budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { context := x0 x, seed := x1 x }) encIn encInput budget
theorem Cslib.Reachability.Hoza.SeedWeight.Runtime.encInput_context_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → Input} :
Turing.MultiTapeTM.ComputableInSpace g✝ encIn✝ encInput S✝ → Turing.MultiTapeTM.ComputableInSpace (fun (c : γ✝) => (g✝ c).context) encIn✝ encContext S✝
theorem Cslib.Reachability.Hoza.SeedWeight.Runtime.encInput_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → Context} {T0 S0 : γ → ℕ} {x1 : γ → List Bool} {T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn encContext T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encBits T1 S1) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { context := x0 x, seed := x1 x }) encIn encInput (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x

Start the weight pass at the first seed cell, with the context in its initial registers.

Native initialization charges the prepared header's length, independently of seed length.

Dropping the initialized offset leaves exactly the original seed bits.

The offset weight executor. Use the loaded state as the entry to its run.

The runtime executor from the loaded state matches the direct seed pass at every clock.

The loaded executor halts at the end of the seed with the native pass's scaled weight.

theorem Cslib.Reachability.Hoza.SeedWeight.Runtime.weight_inSpace_of_locate {α : Type} {enc : α ↪ List Bool} {loc : α → Turing.QueryMachine.Located Context} {seed : α → List Bool} (hload : Turing.MultiTapeTM.ComputableInSpace loc enc (Turing.QueryMachine.encLocated Context encContext) fun (x : α) => (enc x).length) (hseed : ∀ (x : α), List.drop (loc x).offset (enc x) = seed x) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : α) => weight (loc x).inner (seed x)) enc Turing.MultiTapeTM.encNat fun (x : α) => (enc x).length + 1

Compile the weight pass with a native context-and-offset initializer. The seed suffix is read from the original input. Workspace and binary output length are linear in the input encoding when the initializer fits that budget.

One native machine loads the framed context and runs the weight pass on the original word. The binary result and workspace are both linear in the encoded prepared request.

The prepared request for a canonical seed in increasing index order and a valid vertex.

One native machine computes the generated weight on each prepared canonical request. Both workspace and binary output length are linear in the encoded graph dimensions. The runtime bound is existential and indexed by the prepared request.