File size: 1,618 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
import OAI.Algorithms.SubexponentialSAT.LeanCompat
import OAI.Algorithms.SubexponentialSAT.Subexp.BlockSearchExecution
import OAI.Algorithms.SubexponentialSAT.Subexp.PairScoreBounds

namespace OAI.Algorithms

/-! A closed local bound including generation of all search data. -/

namespace SubexponentialSAT.Subexp.BlockSearchBounds

/-- This bound includes the actual tuple generation and the three nested
search loops. Its exponent depends on the local block dimension only. -/
theorem cost_le {K : Type*} (code : StackEncoding.BlockCode K) (alphabet : List K)
    (hA : 1 ≤ alphabet.length) (N bound : ℕ) :
    BlockSearchExecution.cost code alphabet N bound ≤
      800 * (N * N + 1) * alphabet.length ^ (N * N) * ((N * N + 1) * code.width + 1) +
      800 * (N + 1) * alphabet.length ^ N * ((N + 1) * code.width + 1) +
      6 * N ^ 2 + 22 * N + 37 +
      BlockSearchExecution.searchBound alphabet.length N code.width bound := by
  have ha : 1 ≤ (alphabet.map code.block).length := by simpa using hA
  have hw : ∀ row ∈ alphabet.map code.block, row.length ≤ code.width := by
    intro row hrow
    obtain ⟨x, hx, rfl⟩ := List.mem_map.mp hrow
    exact (code.length_block x).le
  have ht := PairScoreBounds.generated_powerCost_le (alphabet.map code.block) (N * N)
    code.width ha hw
  have hc := PairScoreBounds.generated_powerCost_le (alphabet.map code.block) N code.width ha hw
  simp only [List.length_map] at ht hc
  unfold BlockSearchExecution.cost BlockSearchPreparation.cost
  simp only [List.length_replicate]
  omega

end SubexponentialSAT.Subexp.BlockSearchBounds

end OAI.Algorithms