File size: 3,058 Bytes
4a56cd6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import OAI.Algorithms.SubexponentialSAT.LeanCompat
import OAI.Algorithms.SubexponentialSAT.Subexp.BlockSearchConcrete
import OAI.Algorithms.SubexponentialSAT.Subexp.BlockSearchOutputContext

namespace OAI.Algorithms

/-! Retained physical inputs available after concrete basis search. -/

namespace SubexponentialSAT.Subexp.BlockSearchConcreteContext

open BitProgram BlockSearchPredicate

theorem retains_with_alphabet (p : β„•) [Fact p.Prime]
    (alphabet : List (ZMod p)) (hfull : βˆ€ x, x ∈ alphabet) {m N : β„•}
    (M : Fin m β†’ Fin N β†’ ZMod p) (regs : Fin 24 β†’ Bool)
    {budget : β„•} {next : StructuredProgram.State 24 42}
    (run : RunsIn BlockSearchConcrete.program budget
      ((BlockSearchExecution.inputState (BlockCoefficientProgram.context p M)
        (scalarCode p) alphabet N regs).withPC (some BlockSearchConcrete.program.entry))
      (next.withPC none)) :
    BlockSearchOutputContext.Retained (BlockCoefficientProgram.context p M) next :=
  BlockSearchOutputContext.program_retains BlockCoefficientProgram.matrixPair
    (BlockCoefficientProgram.context p M) (scalarCode p) alphabet M
    (BlockCoefficientProgram.coefficientCost p m N) rfl
    (BlockSearchConcrete.coefficientContract_with_alphabet p alphabet hfull M) regs run

theorem retains (p : β„•) [Fact p.Prime] {m N : β„•}
    (M : Fin m β†’ Fin N β†’ ZMod p) (regs : Fin 24 β†’ Bool)
    {budget : β„•} {next : StructuredProgram.State 24 42}
    (run : RunsIn BlockSearchConcrete.program budget
      ((BlockSearchConcrete.inputState p M regs).withPC (some BlockSearchConcrete.program.entry))
      (next.withPC none)) :
    BlockSearchOutputContext.Retained (BlockCoefficientProgram.context p M) next :=
  retains_with_alphabet p (QuarticSearch.elements p) (QuarticSearch.mem_elements p) M regs run

theorem dimension_with_alphabet (p : β„•) [Fact p.Prime]
    (alphabet : List (ZMod p)) (hfull : βˆ€ x, x ∈ alphabet) {m N : β„•}
    (M : Fin m β†’ Fin N β†’ ZMod p) (regs : Fin 24 β†’ Bool)
    {budget : β„•} {next : StructuredProgram.State 24 42}
    (run : RunsIn BlockSearchConcrete.program budget
      ((BlockSearchExecution.inputState (BlockCoefficientProgram.context p M)
        (scalarCode p) alphabet N regs).withPC (some BlockSearchConcrete.program.entry))
      (next.withPC none)) : next.stacks 10 = List.replicate N true :=
  (retains_with_alphabet p alphabet hfull M regs run).2.2.2.2

/-- Stack 10 supplies the actual unary dimension needed by the subsequent
table-transpose program. No second construction of this count is required. -/
theorem dimension (p : β„•) [Fact p.Prime] {m N : β„•}
    (M : Fin m β†’ Fin N β†’ ZMod p) (regs : Fin 24 β†’ Bool)
    {budget : β„•} {next : StructuredProgram.State 24 42}
    (run : RunsIn BlockSearchConcrete.program budget
      ((BlockSearchConcrete.inputState p M regs).withPC (some BlockSearchConcrete.program.entry))
      (next.withPC none)) : next.stacks 10 = List.replicate N true :=
  (retains p M regs run).2.2.2.2

end SubexponentialSAT.Subexp.BlockSearchConcreteContext

end OAI.Algorithms