Download data/lean/OAI/Algorithms/SubexponentialSAT/Subexp/BlockSearchExecution.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.49 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Algorithms/SubexponentialSAT/Subexp/BlockSearchExecution.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Algorithms/SubexponentialSAT/Subexp/BlockSearchExecution.lean
-
curl -L -o BlockSearchExecution.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Algorithms/SubexponentialSAT/Subexp/BlockSearchExecution.lean
3.49 kB
| import OAI.Algorithms.SubexponentialSAT.LeanCompat | |
| import OAI.Algorithms.SubexponentialSAT.Subexp.BlockSearchSetup | |
| import OAI.Algorithms.SubexponentialSAT.Subexp.BlockSearchCoverage | |
| namespace OAI.Algorithms | |
| /-! Preparation and exhaustive search in one fixed instruction table. -/ | |
| namespace SubexponentialSAT.Subexp.BlockSearchExecution | |
| open BitProgram StructuredCalls BlockSearch BlockSearchEncoding BlockSearchPredicate | |
| open SubexpTupleRefinement BlockSearchLoop | |
| abbrev command (matrixPair : Cmd 24 42) : Cmd 24 42 := | |
| .seq BlockSearchSetup.command (.call (BlockSearchLoop.program matrixPair)) | |
| abbrev program (matrixPair : Cmd 24 42) := compiled (command matrixPair) 0 41 | |
| def inputState {K : Type*} (ctx : Context) (code : StackEncoding.BlockCode K) | |
| (alphabet : List K) (N : β) (regs : Fin 24 β Bool) : StructuredProgram.State 24 42 := | |
| BlockSearchSetup.inputState ctx (alphabet.map code.block) | |
| (List.replicate (N * N) true) (List.replicate N true) regs | |
| def searchBound (q N width bound : β) : β := | |
| q ^ (N * N) * ((N + 1) * (q ^ N * (24 * (N * width) + bound + 27) + | |
| 35 * N + 62) + 15 * (N * N * width) + 41) + 9 | |
| def cost {K : Type*} (code : StackEncoding.BlockCode K) (alphabet : List K) | |
| (N bound : β) : β := | |
| BlockSearchPreparation.cost (alphabet.map code.block) | |
| (List.replicate (N * N) true) (List.replicate N true) + | |
| searchBound alphabet.length N code.width bound + 1 | |
| theorem program_runsIn {K : Type*} [Field K] [DecidableEq K] | |
| (matrixPair : Cmd 24 42) (ctx : Context) | |
| (code : StackEncoding.BlockCode K) (alphabet : List K) (hfull : β x, x β alphabet) | |
| {m N : β} (M : Fin m β Fin N β K) (bound : β) | |
| (hdimension : ctx.dimension = List.replicate N true) | |
| (contract : β (C : Fin N β Fin N β K) (d : Fin (N + 1)), | |
| CoefficientContract matrixPair ctx (encodeTuple code (flattenTable C)) (splitCode d) | |
| (encodedTest code alphabet M (encodeTuple code (flattenTable C)) (splitCode d)) | |
| (fun _ => bound) (BlockSearchCoverage.ValidCoefficient code N)) | |
| (regs : Fin 24 β Bool) : | |
| β (next : StructuredProgram.State 24 42) (C : Fin N β Fin N β K) (d : Fin (N + 1)), | |
| GoodPair M (splitPair d C) β§ next.stacks 41 = encodeTuple code (flattenTable C) β§ | |
| next.stacks 8 = splitCode d β§ | |
| RunsIn (program matrixPair) (cost code alphabet N bound) | |
| ((inputState ctx code alphabet N regs).withPC (some (program matrixPair).entry)) | |
| (next.withPC none) := by | |
| obtain β¨np, prepared, hnp, hp, h0, h2, hepβ© := BlockSearchSetup.command_eval ctx | |
| (alphabet.map code.block) (List.replicate (N * N) true) (List.replicate N true) | |
| regs (N * N * code.width) (by simpa using hdimension) | |
| simp only [List.length_replicate] at hp h0 | |
| obtain β¨next, C, d, hgood, htable, hsplit, ns, hns, hesβ© := | |
| BlockSearchCoverage.program_runsIn matrixPair ctx code alphabet hfull M bound contract | |
| prepared hp h0 h2 | |
| refine β¨next, C, d, hgood, htable, hsplit, np + ns + 1, ?_, ?_β© | |
| Β· change np + ns + 1 β€ | |
| BlockSearchPreparation.cost (alphabet.map code.block) | |
| (List.replicate (N * N) true) (List.replicate N true) + | |
| searchBound alphabet.length N code.width bound + 1 | |
| change ns β€ searchBound alphabet.length N code.width bound at hns | |
| omega | |
| Β· exact compiled_halt_trace | |
| (hep.seq (Eval.call (BlockSearchLoop.program matrixPair) hes)) 0 41 | |
| end SubexponentialSAT.Subexp.BlockSearchExecution | |
| end OAI.Algorithms | |