Documentation

CslibFrontier.Computability.Machines.Turing.MultiTape.BlockComputation.QueryReplaySupplierCorrect

Correctness of checked local gate preparation #

Successful canonical parsing of every assignment label initializes exactly the functional block gate's entering control/window and schedule metadata. Running that prepared supplier for one block emits precisely the existing deterministic block gate's encoded result, including motion-check FAIL. Rejected parsing selects an explicit paid rejection buffer.

theorem Turing.MultiTapePTM.BlockComputation.QueryReplay.Supplier.prepareWords_eq_of_combined_none {k s : ℕ} {Q : Type} (e : Q ≃ Fin s) (N b σ i : ℕ) (words : Assignments.Words k) (hcombined : Providers.Labels.combine e (b, ScheduleRead.providerMap k (σ, i), words.previous, words.providers) = none) :
prepareWords e { inputLength := N, blockWidth := b, schedule := σ, interval := i, words := words } = Sum.inl words.previous

A rejected label combination retains the actual previous-label word.

theorem Turing.MultiTapePTM.BlockComputation.QueryReplay.Supplier.prepareWords_eq_of_combined_some {k s : ℕ} {Q : Type} (e : Q ≃ Fin s) (N b σ i : ℕ) (words : Assignments.Words k) (raw : RawResult k Q) (hcombined : Providers.Labels.combine e (b, ScheduleRead.providerMap k (σ, i), words.previous, words.providers) = some raw) :
prepareWords e { inputLength := N, blockWidth := b, schedule := σ, interval := i, words := words } = match ScheduleRead.origin k 0 (σ, i) with | (positive, negative) => Sum.inr ((positive, negative, ScheduleRead.fullrow k (σ, i)), Load.load (N, b, (positive, negative), raw))

A successful combination supplies the exact native replay state with computed scheduling metadata; no prepared semantic window is supplied by an oracle.

theorem Turing.MultiTapePTM.BlockComputation.QueryReplay.Supplier.prepare_eq_of_combined_none {k s : ℕ} {Q : Type} (e : Q ≃ Fin s) (N b σ i limit counter stride : ℕ) (hcombined : Providers.Labels.combine e (b, ScheduleRead.providerMap k (σ, i), (Assignments.labels k { limit := limit, counter := counter, stride := stride, width := Encoding.width k s b }).previous, (Assignments.labels k { limit := limit, counter := counter, stride := stride, width := Encoding.width k s b }).providers) = none) :
prepare e { inputLength := N, blockWidth := b, schedule := σ, interval := i, limit := limit, counter := counter, stride := stride } = Sum.inl (Assignments.labels k { limit := limit, counter := counter, stride := stride, width := Encoding.width k s b }).previous

A rejected combination of the counter's labels retains the actual previous-label word.

theorem Turing.MultiTapePTM.BlockComputation.QueryReplay.Supplier.prepare_eq_of_combined_some {k s : ℕ} {Q : Type} (e : Q ≃ Fin s) (N b σ i limit counter stride : ℕ) (raw : RawResult k Q) (hcombined : Providers.Labels.combine e (b, ScheduleRead.providerMap k (σ, i), (Assignments.labels k { limit := limit, counter := counter, stride := stride, width := Encoding.width k s b }).previous, (Assignments.labels k { limit := limit, counter := counter, stride := stride, width := Encoding.width k s b }).providers) = some raw) :
prepare e { inputLength := N, blockWidth := b, schedule := σ, interval := i, limit := limit, counter := counter, stride := stride } = match ScheduleRead.origin k 0 (σ, i) with | (positive, negative) => Sum.inr ((positive, negative, ScheduleRead.fullrow k (σ, i)), Load.load (N, b, (positive, negative), raw))

A successful combination of the counter's labels supplies the exact native replay state with computed scheduling metadata.

theorem Turing.MultiTapePTM.BlockComputation.QueryReplay.Supplier.finish_prepareWords_of_parses {k s : ℕ} {Q : Type} {q : ℕ} (M : MultiTapeTM k Bool Q) (e : Q ≃ Fin s) (w : List Bool) (b : ℕ) [NeZero b] (σ : ℕ) (i : Fin q) (words : Assignments.Words k) (previous : RawResult k Q) (providers : Providers.ProviderValues k Q) (hprevious : Encoding.NativeChecked.parse e (b, words.previous) = some previous) (hproviders : ∀ (h : Fin k) (δ : Fin 3), Encoding.NativeChecked.parse e (b, words.providers h δ) = some (providers h δ)) :
(CheckedGate.machine M e).finish ((CheckedGate.machine M e).runFrom w (prepareWords e { inputLength := w.length, blockWidth := b, schedule := σ, interval := ↑i, words := words }) b) = List.ofFn (Encoding.encode e (gate (ofDeterministic M) w b (scheduleOfNat k q σ) i (some (RawResult.toView b previous)) fun (h : Fin k) (δ : Fin 3) => some (RawResult.toView b (providers h δ))))

When the previous and every provider label word pass canonical parsing, the prepared supplier emits exactly the encoded existing block gate. Failed head-motion validation still emits FAIL. The premise includes providers whose windows are unused by the current schedule.

theorem Turing.MultiTapePTM.BlockComputation.QueryReplay.Supplier.finish_prepare_of_parses {k s : ℕ} {Q : Type} {q : ℕ} (M : MultiTapeTM k Bool Q) (e : Q ≃ Fin s) (w : List Bool) (b : ℕ) [NeZero b] (σ : ℕ) (i : Fin q) (limit counter stride : ℕ) (previous : RawResult k Q) (providers : Providers.ProviderValues k Q) (hprevious : Encoding.NativeChecked.parse e (b, (Assignments.labels k { limit := limit, counter := counter, stride := stride, width := Encoding.width k s b }).previous) = some previous) (hproviders : ∀ (h : Fin k) (δ : Fin 3), Encoding.NativeChecked.parse e (b, (Assignments.labels k { limit := limit, counter := counter, stride := stride, width := Encoding.width k s b }).providers h δ) = some (providers h δ)) :
(CheckedGate.machine M e).finish ((CheckedGate.machine M e).runFrom w (prepare e { inputLength := w.length, blockWidth := b, schedule := σ, interval := ↑i, limit := limit, counter := counter, stride := stride }) b) = List.ofFn (Encoding.encode e (gate (ofDeterministic M) w b (scheduleOfNat k q σ) i (some (RawResult.toView b previous)) fun (h : Fin k) (δ : Fin 3) => some (RawResult.toView b (providers h δ))))

When the previous and every provider label pass canonical parsing, the prepared supplier emits exactly the encoded existing block gate. Failed head-motion validation still emits FAIL. The premise includes providers whose windows are unused by the current schedule.