File size: 2,143 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
import OAI.Algorithms.SubexponentialSAT.LeanCompat
import OAI.Algorithms.SubexponentialSAT.SqrtLog.AsymptoticLayoutRate

namespace OAI.Algorithms

namespace SubexponentialSAT.SqrtLog.Asymptotic

open Filter
open scoped Topology

theorem eventually_layout_small_grid :
    βˆ€αΆ  n : β„• in atTop, 16 * layoutQ n * layoutR n ^ 2 ≀ n := by
  filter_upwards [eventually_L_power_le_n 3 (show (0 : ℝ) < 16 by norm_num)] with n hn
  have hnat : 16 * L n ^ 3 ≀ n := by exact_mod_cast hn
  have hQ : layoutQ n ≀ L n := Nat.div_le_self _ _
  have hr := layoutR_le_L n
  calc
    16 * layoutQ n * layoutR n ^ 2 ≀ 16 * L n * L n ^ 2 := by gcongr
    _ = 16 * L n ^ 3 := by ring
    _ ≀ n := hnat

theorem eventually_layout_large_grid (a b : β„• β†’ β„•) (q : β„•)
    (ha : βˆ€αΆ  n : β„• in atTop, a n ≀ L n ^ q)
    (hb : βˆ€αΆ  n : β„• in atTop, b n ≀ L n ^ q) :
    βˆ€αΆ  n : β„• in atTop,
      4096 * (b n + a n) * b n ^ 2 * layoutR n ^ 2 * L n ^ 4 *
        (layoutR n ^ (2 * layoutQ n)) ^ 2 ≀ n := by
  let f (n : β„•) : ℝ := 4096 * ((b n : ℝ) + a n) * (b n : ℝ) ^ 2 *
    (layoutR n : ℝ) ^ 2 * (L n : ℝ) ^ 4
  have hf : βˆ€αΆ  n : β„• in atTop, f n ≀ 8192 * (L n : ℝ) ^ (3 * q + 6) := by
    filter_upwards [ha, hb] with n han hbn
    have ha' : (a n : ℝ) ≀ (L n : ℝ) ^ q := by exact_mod_cast han
    have hb' : (b n : ℝ) ≀ (L n : ℝ) ^ q := by exact_mod_cast hbn
    have hr : (layoutR n : ℝ) ≀ L n := by exact_mod_cast layoutR_le_L n
    calc
      f n ≀ 4096 * ((L n : ℝ) ^ q + (L n : ℝ) ^ q) * ((L n : ℝ) ^ q) ^ 2 *
          (L n : ℝ) ^ 2 * (L n : ℝ) ^ 4 := by dsimp [f]; gcongr
      _ = 8192 * (L n : ℝ) ^ (3 * q + 6) := by
        simp only [pow_add, pow_mul]
        ring
  have h := eventually_polylog_grid_le_n f (3 * q + 6)
    (show (0 : ℝ) < 8192 by norm_num) (by intro n; dsimp [f]; positivity) hf
  filter_upwards [h] with n hn
  have heq : (layoutR n ^ (2 * layoutQ n)) ^ 2 = layoutR n ^ (4 * layoutQ n) := by
    rw [← pow_mul]
    congr 1
    omega
  rw [heq]
  dsimp [f] at hn
  exact_mod_cast hn

end SubexponentialSAT.SqrtLog.Asymptotic

end OAI.Algorithms