OAI/Computability/MaxCut/Games/CanonicalWordTemplate.lean
61 declarations, 0 contain sorry, 0 declared as axioms
- inductive
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.Tokenline 11Source documentation
A literal word or a reference to one of the four saved input fields.
inductive Token | literal (value : Nat) | name (index : Fin 3) | occurrence deriving DecidableEq, Repr
- def
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.evalTokenline 17 - def
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.evalTemplateline 22 - def
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.isVariableline 26 - def
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.variableTokensline 31 - def
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.blankTemplateline 33 - def
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.singleTemplateline 37 - def
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.fullTemplateline 42 - def
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.templateline 49Source documentation
Coefficient equality alone selects the record tag and the input field.
def template {s d : Nat} (a : Fin 3 → Ambient s d) : List Token := …Mentions: OAI.MaxCutGames.Reduction.CanonicalWordTemplate.Token
- theorem
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.blankTemplate_lengthline 56 - theorem
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.singleTemplate_lengthline 58 - theorem
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.fullTemplate_lengthline 61 - theorem
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.template_lengthline 64 - theorem
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.evalTemplate_lengthline 69 - theorem
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.eval_blankTemplateline 73 - theorem
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.eval_singleTemplateline 77 - theorem
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.eval_fullTemplateline 83 - theorem
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.eval_templateline 90Source documentation
The template evaluates to the exact existing canonical-record encoding.
theorem eval_template {n m s d : Nat} (names : Fin m → Fin 3 → Fin n) (occurrence : Fin m) (a : Fin 3 → Ambient s d) : evalTemplate (fun j => (names occurrence j).val) occurrence.val (template a) = recordWords (ActualCanonical.record names occurrence a) := by …Mentions: OAI.MaxCutGames.Reduction.CanonicalWordTemplate.evalTemplate, OAI.MaxCutGames.Reduction.CanonicalWordTemplate.template, OAI.MaxCutGames.Reduction.ActualCanonical.record
- theorem
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.variableTokens_blankTemplateline 97 - theorem
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.variableTokens_singleTemplateline 99 - theorem
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.variableTokens_fullTemplateline 103 - theorem
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.variableTokens_templateline 109Source documentation
Exact input-field profile: blank has none; single reads one selected name; full reads the occurrence identifier. Coefficient values are program constants.
theorem variableTokens_template {s d : Nat} (a : Fin 3 → Ambient s d) : variableTokens (template a) = if a 0 = a 1 then if a 0 = a 2 then [] else [.name 2] else if a 0 = a 2 then [.name 1] else if a 1 = a 2 then [.name 0] else [.occurrence] := by …Mentions: OAI.MaxCutGames.Reduction.CanonicalWordTemplate.variableTokens, OAI.MaxCutGames.Reduction.CanonicalWordTemplate.template
- theorem
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.variableTokens_template_length_le_oneline 119 - theorem
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.name_mem_variableTokens_iffline 124 - theorem
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.occurrence_mem_variableTokens_iffline 132 - theorem
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.flatMap_encodeWordline 140Source documentation
Emitting each token's existing unary-delimited word gives exactly the existing list-of-words serialization, with no alternative encoding.
theorem flatMap_encodeWord (names : Fin 3 → Nat) (occurrence : Nat) (tokens : List Token) : tokens.flatMap (fun token => encodeWord (evalToken names occurrence token)) = encodeWords (evalTemplate names occurrence tokens) := by …Mentions: OAI.MaxCutGames.Reduction.CanonicalWordTemplate.Token, OAI.MaxCutGames.Reduction.CanonicalWordTemplate.evalToken, OAI.MaxCutGames.Reduction.CanonicalWordTemplate.evalTemplate
- theorem
OAI.MaxCutGames.Reduction.CanonicalWordTemplate.template_bitsline 149 - inductive
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.Tokenline 164 - def
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.evalTokenline 171 - def
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.evalTemplateline 175 - def
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.nameFieldline 178 - def
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.recordFieldsline 180 - theorem
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.recordFields_nameline 183 - theorem
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.recordFields_occurrenceline 187 - def
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.sourceFieldsline 190 - def
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.liftTokenline 194 - def
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.liftRecordline 199 - theorem
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.liftRecord_lengthline 202 - theorem
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.eval_liftTokenline 205 - theorem
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.eval_liftRecordline 211 - def
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.recordsListline 219 - theorem
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.recordsList_lengthline 223 - theorem
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.eval_recordsListline 233 - def
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.ambientShiftline 251 - def
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.alphabetOffsetline 255 - def
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.templateline 259 - theorem
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.template_lengthline 263 - theorem
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.eval_dataline 269Source documentation
Exact body serialization of general canonical data.
theorem eval_data {n m k s d : Nat} (occ : Fin k → Fin m) (names : Fin m → Fin 3 → Fin n) (rhs : Fin m → F2) (z : Ambient s d) (a : Fin k → Fin 3 → Ambient s d) : evalTemplate (sourceFields occ names) (template z a (fun j => rhs (occ j))) = bodyWords ((ActualCanonical.data occ names rhs z a).1.2, (ActualCanonical.data occ names rhs z a).2) := by …Mentions: OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.evalTemplate, OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.sourceFields, OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.template, OAI.MaxCutGames.Reduction.ActualCanonical.data
- theorem
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.alphabetOffset_dataline 283 - theorem
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.eval_canonicalline 289 - theorem
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.alphabetOffset_canonicalline 299 - def
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.coefficientTriplesline 307Source documentation
The finite coefficient table's three coefficients for each local record.
def coefficientTriples {k s d : Nat} (c : ActualEnumeration.Coefficients k (Ambient s d)) (j : Fin k) : Fin 3 → Ambient s d := …Mentions: OAI.MaxCutGames.Reduction.ActualEnumeration.Coefficients
- theorem
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.fromCoefficients_hBasisline 311 - theorem
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.standardTriple_fromCoefficientsline 316 - theorem
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.eval_actualQueryline 327 - theorem
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.alphabetOffset_actualQueryline 335 - theorem
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.eval_fromCoefficientsline 342Source documentation
Direct specialization to an actual enumerated coefficient table.
theorem eval_fromCoefficients (S : ActualSource.Source) {k s d : Nat} (occ : ActualGame.Question S k) (c : ActualEnumeration.Coefficients k (Ambient s d)) : evalTemplate (sourceFields occ (ActualGame.names S)) (template c.1 (coefficientTriples c) (fun j => ActualGame.rhs S (occ j))) = bodyWords (ActualOrbit.body (ActualGame.canonical S k s d) (occ, ActualEnumeration.fromCoefficients k (Ambient s d) c)) := by …Mentions: OAI.MaxCutGames.Reduction.ActualSource.Source, OAI.MaxCutGames.Reduction.ActualGame.Question, OAI.MaxCutGames.Reduction.ActualEnumeration.Coefficients, OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.evalTemplate, OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.sourceFields, OAI.MaxCutGames.Reduction.ActualGame.names, OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.template, OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.coefficientTriples, OAI.MaxCutGames.Reduction.ActualGame.rhs, OAI.MaxCutGames.Reduction.ActualOrbit.body, OAI.MaxCutGames.Reduction.ActualGame.canonical, OAI.MaxCutGames.Reduction.ActualEnumeration.fromCoefficients
- theorem
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.alphabetOffset_fromCoefficientsline 351 - theorem
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.actualEdge_permutationline 361Source documentation
Both permutation offsets of an actual edge are the same finite expressions used by the corresponding canonical-body templates.
theorem actualEdge_permutation (S : ActualSource.Source) (k : Nat) {s d : Nat} (g : ActualSource.SplitGadget s d) (omega : ActualGame.Outcome S k g) : (ActualGame.edge S k g omega).permutation = Encoding.translationTable (alphabetOffset ((ActualGame.leftQuery S k g omega).2 (ActualHomogeneous.hBasis k)) (ActualCanonical.standardTriple (ActualGame.leftQuery S k g omega).2) (fun j => ActualGame.rhs S ((ActualGame.leftQuery S k g omega).1 j))) (alphabetOffset ((ActualGame.rightQuery S k g omega).2 (ActualHomogeneous.hBasis k)) (ActualCanonical.standardTriple (ActualGame.rightQuery S k g omega).2) (fun j => ActualGame.rhs S ((ActualGame.rightQuery S k g omega).1 j))) := rflMentions: OAI.MaxCutGames.Reduction.ActualSource.Source, OAI.MaxCutGames.Reduction.ActualSource.SplitGadget, OAI.MaxCutGames.Reduction.ActualGame.Outcome, OAI.MaxCutGames.Reduction.ActualGame.edge, OAI.MaxCutGames.Reduction.Encoding.translationTable, OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.alphabetOffset, OAI.MaxCutGames.Reduction.ActualGame.leftQuery, OAI.MaxCutGames.Reduction.ActualHomogeneous.hBasis, OAI.MaxCutGames.Reduction.ActualCanonical.standardTriple, OAI.MaxCutGames.Reduction.ActualGame.rhs, OAI.MaxCutGames.Reduction.ActualGame.rightQuery
- theorem
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.flatMap_encodeWordline 372 - theorem
OAI.MaxCutGames.Reduction.CanonicalBodyTemplate.actualQuery_bitsline 381