OAI/Computability/FiniteCompiler/Normalization.lean
186 declarations, 0 contain sorry, 0 declared as axioms
Raw-run folds, full word compilation, partial budgets, and bounded normalization.
- abbrev
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Itemline 12 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.itemGradeline 15Source documentation
Full raw sectors have three structural letters alpha,Q,omega.
def itemGrade (g : C → ℕ) : Item C S → ℕ | .inl c => g c | .inr w => w.length + 3
Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Item
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.gradeline 19 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.grade_nilline 21 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.grade_consline 22 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.grade_appendline 24 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.prependline 29Source documentation
Fold a nonempty raw run by adjacent pair replacement. We prove below that it agrees with the source's single call on the concatenated maximal run.
def prepend (f : List S → List S) : Item C S → List (Item C S) → List (Item C S) | .inr x,.inr y::w => .inr (f (x++y))::w | a,w => a::w
Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Item
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.normalizeline 33 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.normalize_nilline 37 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.normalize_consline 38 - structure
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Budgetline 43Source documentation
Budget laws are used only where the unreduced concatenation has bounded length. They are exactly the totality/length/context interface of the source.
structure Budget (f : List S → List S) (m : ℕ) : Prop where …
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.prepend_gradeline 49 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.normalize_gradeline 66 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.tripleline 78Source documentation
The two bracketings of three adjacent raw inputs agree inside the same budget. No idempotence assumption on raw singleton sectors is made.
theorem triple (h : Budget f m) (x y z : List S) (hm : (x++y++z).length ≤ m) : f (x++f (y++z)) = f (f (x++y)++z) := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Budget
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.prepend_pairline 85 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.normalize_left_contextline 102Source documentation
Left contexts commute with equality of folded normal forms, without any stability-of-sector-boundaries claim.
theorem normalize_left_context {u v : List (Item C S)} (h : normalize f u = normalize f v) (a : List (Item C S)) : normalize f (a++u) = normalize f (a++v) := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Item, OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.normalize
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.pair_contextline 110Source documentation
Contextual invariance of pair versus its genuine returned singleton; this is the only nontrivial comparison at q_ok--cleanup with entry priority.
theorem pair_context (g : C → ℕ) (h : Budget f m) (x y : List S) (a b : List (Item C S)) (hm : grade g (a ++ .inr x :: .inr y :: b) ≤ m) : normalize f (a ++ .inr x :: .inr y :: b) = normalize f (a ++ .inr (f (x++y)) :: b) := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Budget, OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Item, OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.grade, OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.normalize
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.normalize_singletonline 123Source documentation
On one full raw sector the evaluator never calls the program.
@[simp] theorem normalize_singleton (x : List S) : normalize f ([.inr x] : List (Item C S)) = [.inr x] := rflMentions: OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.normalize, OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Item
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.normalize_runline 128Source documentation
On a raw run of size at least two this fold is exactly a single application to the literal concatenation, as specified by the frozen source.
theorem normalize_run (h : Budget f m) (x y : List S) (ws : List (List S)) (hm : (x++y++ws.flatten).length ≤ m) : normalize f (((x::y::ws).map Sum.inr) : List (Item C S)) = [.inr (f (x++y++ws.flatten))] := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Budget, OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.normalize, OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Item
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.splitRunline 145Source documentation
Split off the entire initial raw run, without changing raw contents.
def splitRun : List (Item C S) → List (List S) × List (Item C S) | [] => ([],[]) | .inl c::w => ([],.inl c::w) | .inr x::w => let p := splitRun w; (x::p.1,p.2)
Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Item
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.splitRun_joinline 150 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.splitRun_lengthline 156 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.splitRun_stopsline 161 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.grade_rawsline 170 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.prepend_append_separatorline 177 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.normalize_append_separatorline 183 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.sourceline 192Source documentation
The literal source algorithm: a singleton does not invoke f; every longer maximal raw run invokes f once on its unmodified concatenation.
def source (f : List S → List S) : List (Item C S) → List (Item C S) | [] => [] | .inl c::w => .inl c::source f w | .inr x::w => let p := splitRun w …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Item, OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.splitRun
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.source_eq_normalizeline 210Source documentation
Bounded comparison with the fold is a theorem, not an alteration of the source algorithm. In particular source calls obey the same grade budget.
theorem source_eq_normalize (g : C → ℕ) (h : Budget f m) (w : List (Item C S)) (hm : grade g w ≤ m) : source f w = normalize f w := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Budget, OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Item, OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.grade, OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.source, OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.normalize
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.source_gradeline 254 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.literalline 266Source documentation
Only a change of representation. The cell order and both literal boundary flags are retained exactly.
def literal (m : H → K) (v : Sector H B T) : Path.Sector (B×T) K := …
Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Sector, OAI.FiniteAlgebraicEnvelopes.Compiler.Path.Sector
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.unliteralline 269 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.literal_unliteralline 272 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.unliteral_literalline 274 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.literal_injectiveline 277 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Literal.inLeftline 291Source documentation
Zipper fragments of a literal cell instruction, before and after the specified cross/stay move.
def inLeft (d : Direction) (c : B×T) : List (B×T) := if d = .left then [c] else []
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Literal.inRightline 292 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Literal.outLeftline 293 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Literal.outRightline 295 - inductive
OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Literal.Ruleline 298 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Literal.cell_stepline 310 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Literal.rule_shapeline 320 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Literal.rule_lengthline 327 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Literal.prepare_ruleline 340Source documentation
Sector invariance for a deterministic table implies literal invariance for every cell and boundary equation in every word context.
theorem prepare_rule (table : Table H B T) (m : H → K) (P : Path.Sector (B×T) K → List (Path.Sector (B×T) K)) (hinv : ∀ v w, Step table v w → P (literal m v) = P (literal m w)) {u v : List (Letter (B×T) K)} (h : Rule table m u v) (x y : List (Letter (B×T) K)) (hn : shape (x++u++y) ≠ .zero) : prepare P (x++u++y) = prepare P (x++v++y) := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Table, OAI.FiniteAlgebraicEnvelopes.Compiler.Path.Sector, OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Step, OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.literal, OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Literal.Rule
- abbrev
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Cellline 369 - abbrev
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Headline 370 - abbrev
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Letterline 371 - abbrev
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Sectorline 372 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.encodeline 374 - inductive
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Ordinaryline 379Source documentation
The actual source equations, separate from the exceptional accepting exit for which only the complete raw-run evaluator is invariant.
inductive Ordinary (A : Simulator.Alphabet S Γ) (M : Simulator.Machine Q Γ) [DecidableEq S] [DecidableEq Γ] : List (Letter S Γ Q) → List (Letter S Γ Q) → Prop | raw (a : S) : Ordinary A M [.left (Validator.cell A.blank (.anchor a)),.head .raw] [.head .raw,.right (Validator.cell A.blank (.anchor a))] | merge : Ordinary A M [.head .raw,.leave,.enter,.head .raw] [.left (Validator.cell A.blank .cutC),.head .pending,.right (Validator.cell A.blank .cutD)] | quota : Ordinary A M [.left (Validator.cell A.blank .workspace),.head .pending,.right (Validator.cell A.blank .cutD)] [.head .pending,.right (Validator.cell A.blank .cutD)] | entry : Ordinary A M [.head .pending,.right (Validator.cell A.blank .cutD)] [.head (.internal .initial),.right (Validator.cell A.blank .cutD)] …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Alphabet, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Machine, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Letter, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.raw, OAI.FiniteAlgebraicEnvelopes.Compiler.Validator.cell
- inductive
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Ruleline 397 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.ordinary_shapeline 406 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.rule_shapeline 416 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.ordinary_lengthline 422 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.rule_lengthline 433 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.rules_finiteline 442Source documentation
The source presentation is finite, not a schema depending on arbitrary sector contexts. Every defining side has at most four letters.
theorem rules_finite [Fintype S] [Fintype Γ] [Fintype Q] : {p : List (Letter S Γ Q) × List (Letter S Γ Q) | Rule A M p.1 p.2}.Finite := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Letter, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Rule
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.sectorPreprocessline 452 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.preprocessline 455 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.sectorPreprocess_literalline 458 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.preprocess_ordinaryline 464Source documentation
Every ordinary source equation has identical preprocessed sector lists in any literal nonzero context. Only the accepting exit needs a program law.
theorem preprocess_ordinary {u v : List (Letter S Γ Q)} (h : Ordinary A M u v) (x y : List (Letter S Γ Q)) (hn : shape (x++u++y) ≠ .zero) : preprocess A M (x++u++y) = preprocess A M (x++v++y) := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Letter, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Ordinary, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.preprocess
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.gradeCellline 520 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.gradeline 521 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.chunksGradeline 522 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.grade_encodeline 524 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.grade_appendline 531 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.chunksGrade_appendline 534 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.chunksGrade_flattenline 537 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.grade_rawline 543 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.grade_letter_leline 550 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.sectorPreprocess_gradeline 560 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.prepareChunk_gradeline 569 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.prepareChunks_gradeline 578 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.preprocess_gradeline 586 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.rawline 595 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.rawLettersline 599Source documentation
Candidate extraction followed by a literal check recognizes only full, clean raw sectors. Dirty tags or absent boundaries cannot silently pass.
def rawLetters (w : List (Letter S Γ Q)) : List S := w.filterMap fun a => …
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.rawLetters_rawline 604 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.readRawline 610 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.readRaw_rawline 614 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.readRaw_soundline 617 - abbrev
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Itemline 624 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.classifyline 626 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.realizeline 631 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.classify_rawline 635 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.realize_classifyline 638 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.itemGrade_classifyline 644 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.grade_realizeline 652 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.classify_gradeline 658 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.realizeList_gradeline 663 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Surface.exit_alternativeline 680Source documentation
The exact exceptional comparison. When entry priority changes the answer, both boundaries really exist, and a bounded run of the specified machine returns the output of cleanup. No program equation is assumed here.
theorem exit_alternative (hdecode : ∀ g a, A.output g = some a → g = A.input a) (l : Cells S Γ) (lb : Bool) : preprocess A M ⟨l,.internal (.machine .ok),[],lb,true⟩ = preprocess A M ⟨l,.cleanup,[],lb,true⟩ ∨ ∃ x y out n c, preprocess A M ⟨l,.internal (.machine .ok),[],lb,true⟩ = [raw A.blank x,raw A.blank y] ∧ preprocess A M ⟨l,.cleanup,[],lb,true⟩ = [raw A.blank out] ∧ ReflTransGen (Simulator.TapeStep M) (Simulator.pad A (Simulator.initialTape A M (x++y)) (n+1)) c ∧ Simulator.Halted A M c ∧ Simulator.Returns A c out := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Surface.Cells, OAI.FiniteAlgebraicEnvelopes.Compiler.Surface.preprocess, OAI.FiniteAlgebraicEnvelopes.Compiler.Surface.raw, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.TapeStep, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.pad, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.initialTape, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Halted, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Returns
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normalline 734Source documentation
The source algorithm, with the partial call separated as f. Its actual computable domain/realization is established at the program boundary.
def normal (f : List S → List S) (w : List (Letter S Γ Q)) : List (Letter S Γ Q) := …
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normal_eq_foldline 738 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normal_gradeline 745 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normal_ordinaryline 756 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normal_zeroline 764 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.preprocess_rawline 774 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normal_rawline 782 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.ComputesAtline 790Source documentation
Finite tape realization at a bound. This is a lemma parameter, not an assumption of either main theorem; the partial-recursive adapter must prove it.
def ComputesAt (f : List S → List S) (m : ℕ) : Prop := …
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normal_exitline 795 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normal_ruleline 845Source documentation
Every literal defining equation is invariant in arbitrary word contexts, including dirty and incomplete sectors, within the unchanged grade bound.
theorem normal_rule (hdecode : ∀ g a, A.output g = some a → g = A.input a) {f : List S → List S} {m : ℕ} (h : RawRuns.Budget f m) (hcomp : ComputesAt A M f m) {u v : List (Letter S Γ Q)} (hr : Rule A M u v) (a b : List (Letter S Γ Q)) (h₁ : grade (a++u++b) ≤ m) (h₂ : grade (a++v++b) ≤ m) : normal A M f (a++u++b) = normal A M f (a++v++b) := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Budget, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.ComputesAt, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Letter, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Rule, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.grade, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normal
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Path.context_headedline 861 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Literal.encode_stepline 879 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Reduceline 927Source documentation
A literal equation in either direction, used without any grade increase.
def Reduce (u v : List (Letter S Γ Q)) : Prop := …
- abbrev
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Reducesline 929 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduces_gradeline 931 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduce_contextline 936 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduces_contextline 941 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduces_appendline 945 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normal_reduceline 954 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normal_reducesline 967 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Path.context_monoline 981 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Path.context_symmline 987 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.internal_rule_gradeline 1002 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.ordinary_gradeline 1012 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.rule_gradeline 1023 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduce_ruleline 1029 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduce_rule_reverseline 1033 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduce_internalline 1038 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduces_internalline 1055 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduce_of_context_ruleline 1072 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduce_reverseline 1080 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduces_reverseline 1083 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduce_headedline 1094 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduce_rawStepline 1100 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduces_rawNormalline 1108 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduces_quotaNormalline 1112 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduce_entryline 1122 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduce_cleanupline 1129 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduces_cleanupNormalline 1156 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduces_cleanupPreprocessline 1165 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduce_unmergeline 1169 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduces_unmergeline 1181 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduces_pendingPreprocessline 1205 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduce_exitline 1209 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduces_internalPreprocessline 1220 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduces_sectorPreprocessline 1252 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduces_prepareChunkline 1274 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduces_prepareChunksline 1286 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduces_preprocessline 1294 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduces_zeroline 1300 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.grade_flatMap_encodeline 1314 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduces_rawPair_of_runline 1321 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduces_rawPairline 1351 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduces_prependline 1367 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduces_rawRunsline 1389 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.reduces_normalline 1408Source documentation
A literal, grade-nonincreasing derivation to the source's whole-word evaluator, not just equality in an assumed quotient.
theorem reduces_normal {f : List S → List S} {m : ℕ} (h : RawRuns.Budget f m) (hcomp : ComputesAt A M f m) (w : List (Letter S Γ Q)) (hm : grade w ≤ m) : Reduces A M w (normal A M f w) := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Budget, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.ComputesAt, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Letter, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.grade, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Reduces, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normal
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normal_idempotentline 1424 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normal_contextline 1442Source documentation
The bounded context conclusion uses the nonincreasing literal derivations; the attachment need not preserve sector boundaries.
theorem normal_context (hdecode : ∀ g a, A.output g = some a → g = A.input a) {f : List S → List S} {m : ℕ} (h : RawRuns.Budget f m) (hcomp : ComputesAt A M f m) {u v : List (Letter S Γ Q)} (he : normal A M f u = normal A M f v) (x y : List (Letter S Γ Q)) (hu : grade (x++u++y) ≤ m) (hv : grade (x++v++y) ≤ m) : normal A M f (x++u++y) = normal A M f (x++v++y) := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Budget, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.ComputesAt, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Letter, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normal, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.grade
- abbrev
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Relline 1460Source documentation
The compiler's finite monoid presentation is formed from the literal rule table; neither a normalizer nor program totality enters its definition.
abbrev Rel (u v : FreeMonoid (Letter S Γ Q)) : Prop := Rule A M u v
Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Letter, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Rule
- abbrev
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Presentationline 1461 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.presentline 1462 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.present_appendline 1466 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.present_contextline 1471 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.present_reduceline 1477 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.present_reducesline 1488 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.present_normalline 1494 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normal_conGenline 1502Source documentation
No maximum grade of a presentation derivation is assumed. Its finitely many contextual uses are handled by the theorem at all finite budgets.
theorem normal_conGen (hdecode : ∀ g a, A.output g = some a → g = A.input a) {f : List S → List S} (h : ∀ m, RawRuns.Budget f m) (hcomp : ∀ m, ComputesAt A M f m) {u v : FreeMonoid (Letter S Γ Q)} (he : conGen (Rel A M) u v) : normal A M f u = normal A M f v := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Budget, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.ComputesAt, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Letter, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Rel, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normal
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.present_eq_iff_normalline 1538Source documentation
Exact equality criterion for the finite presentation under the global (not assumed for constructing the presentation) evaluator hypotheses.
theorem present_eq_iff_normal (hdecode : ∀ g a, A.output g = some a → g = A.input a) {f : List S → List S} (h : ∀ m, RawRuns.Budget f m) (hcomp : ∀ m, ComputesAt A M f m) (u v : List (Letter S Γ Q)) : present A M u = present A M v ↔ normal A M f u = normal A M f v := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Budget, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.ComputesAt, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Letter, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.present, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normal
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normal_nilline 1558 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normal_omegaline 1561 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normal_contains_omegaline 1564 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.preprocess_raw_pairline 1568 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normal_raw_productline 1587Source documentation
Singleton raw words are fixed, but adjacent full raw words call the program on their concatenation, exactly as in the manuscript.
theorem normal_raw_product (f : List S → List S) (u v : List S) : normal A M f (raw (Q := Q) A.blank u ++ raw A.blank v) = raw A.blank (f (u++v)) := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normal, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.raw
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.present_nil_ne_omegaline 1594 - inductive
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Actionline 1611Source documentation
A nonraw literal sector, an unchanged singleton raw sector, or a genuine program call on an entire maximal raw run.
inductive Action (C S : Type*) | keep (c : C) | raw (w : List S) | call (w : List S) deriving DecidableEq
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.planline 1617 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Action.totalline 1633 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.plan_totalline 1638 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.plan_call_boundline 1654Source documentation
Every program argument is bounded by the grade of the original item list, before any output from the program is computed.
theorem plan_call_bound (g : C → ℕ) (w : List (Item C S)) {x : List S} (hx : Action.call x ∈ plan w) : x.length ≤ grade g w := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Item, OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.plan, OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.grade
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.Action.partialline 1687 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.executeline 1692 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.execute_total_memline 1696 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.partialSourceline 1710 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.RawRuns.partialSource_total_memline 1713 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.partialNormalline 1729Source documentation
The manuscript's partial normalizer. It is defined even for a divergent program; no arbitrary value is inserted for an undefined call.
def partialNormal (f : List S → Part (List S)) (w : List (Letter S Γ Q)) : Part (List (Letter S Γ Q)) := …
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.partialNormal_total_memline 1735Source documentation
Agreement only needs the values below the input's additive grade.
theorem partialNormal_total_mem {f : List S → Part (List S)} {t : List S → List S} (w : List (Letter S Γ Q)) (h : ∀ x, x.length ≤ grade w → t x ∈ f x) : normal A M t w ∈ partialNormal A M f w := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Letter, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.grade, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.normal, OAI.FiniteAlgebraicEnvelopes.Compiler.Word.partialNormal
- structure
OAI.FiniteAlgebraicEnvelopes.Compiler.PartialBudgetline 1755Source documentation
Literal domain/length/context premises of the finite compiler's bounded theorem. These are conditions on the given partial program, not a total replacement.
structure PartialBudget {S : Type*} (f : List S → Part (List S)) (m : ℕ) : Prop where … - def
OAI.FiniteAlgebraicEnvelopes.Compiler.partValueline 1763Source documentation
Used only to state the bounded correctness proof of the partial algorithm. It has no place in its definition or in its claimed effective implementation.
noncomputable def partValue {S : Type*} (p : Part (List S)) : List S := by … - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.partValue_memline 1767 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.partValue_eqline 1771 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.PartialBudget.totalizeline 1774 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Realizesline 1792Source documentation
The finite-machine adapter has to prove this execution specification for any supplied partial-recursive program. It is not an extra main hypothesis.
def Realizes (f : List S → Part (List S)) : Prop := …
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.Realizes.computesAtline 1799 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.partialNormal_eq_someline 1804 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.partialNormal_terminatesline 1810 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.partialNormal_reducesline 1815 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.partialNormal_ruleline 1823 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Word.partialNormal_contextline 1832