File size: 5,554 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
import OAI.MeasureTheory.Falconer.Recursion.BranchExponent
import OAI.MeasureTheory.Falconer.Angular.AngularUniformAbsorption

namespace OAI

namespace PlanarFalconer

theorem DiscreteProfileLipschitz.increment_le_one {A : β„• β†’ ℝ} {N i j : β„•}
    (hA : DiscreteProfileLipschitz A N) (hN : 0 < N) (hi : i ≀ N) (hj : j ≀ N) :
    |A i-A j| ≀ 1 := by
  apply (hA i hi j hj).trans
  apply (div_le_one (Nat.cast_pos.mpr hN)).mpr
  apply abs_le.mpr
  have hi' : (i:ℝ) ≀ N := Nat.cast_le.mpr hi
  have hj' : (j:ℝ) ≀ N := Nat.cast_le.mpr hj
  constructor <;> linarith [Nat.cast_nonneg (Ξ± := ℝ) i,Nat.cast_nonneg (Ξ± := ℝ) j]

theorem DiscreteProfileLipschitz.abs_le_one {A : β„• β†’ ℝ} {N i : β„•}
    (hA : DiscreteProfileLipschitz A N) (hN : 0 < N) (hzero : A 0 = 0) (hi : i ≀ N) :
    |A i| ≀ 1 := by
  simpa only [hzero,sub_zero] using hA.increment_le_one hN hi (Nat.zero_le N)

theorem DiscreteProfileLipschitz.minimum_cost_le_one {A : β„• β†’ ℝ} {N a t i : β„•}
    (hA : DiscreteProfileLipschitz A N) (hN : 0 < N)
    (hat : a ≀ t) (ht : t ≀ N) (hi : i ≀ N) :
    A i-intervalMin A a t ≀ 1 := by
  obtain ⟨j,_,hjt,hmin⟩ := intervalMin_attained A hat
  rw [hmin]
  exact (le_abs_self _).trans (hA.increment_le_one hN hi (hjt.trans ht))

theorem BranchStep.cost_le_one {A : β„• β†’ ℝ} {N q : β„•} {sig : ℝ}
    (hA : DiscreteProfileLipschitz A N) (hN : 0 < N) (hq : 0 < q)
    {s u : BranchState} {l : BranchLabel} (h : BranchStep A N q sig s l u)
    (hs : s.Valid N sig) (hu : u.Valid N sig) : branchCost A s l u ≀ 1 := by
  have hn := h.nested hq hs
  have hsd := BranchState.valid_depths hs
  have hud := BranchState.valid_depths hu
  cases h <;> simp only [branchCost]
  Β· exact hA.minimum_cost_le_one hN hn.2 hsd.2 (hud.2.trans (le_refl _))
  Β· norm_num
  Β· exact hA.minimum_cost_le_one hN hn.1 (hud.1.trans hud.2) (hud.1.trans hud.2)
  Β· norm_num
  Β· norm_num
  Β· exact hA.minimum_cost_le_one hN hn.1 (hud.1.trans hud.2) (hud.1.trans hud.2)

theorem BranchStep.exponent_le_four {A : β„• β†’ ℝ} {N q : β„•} {lam sig eps : ℝ}
    (hA : DiscreteProfileLipschitz A N) (hN : 0 < N) (hq : 0 < q)
    (hloss : 4000*(lam+sig) ≀ 1)
    {s u : BranchState} {l : BranchLabel} (h : BranchStep A N q sig s l u)
    (hs : s.Valid N sig) (hu : u.Valid N sig) :
    branchExponent A lam sig eps s l u ≀ 4+eps := by
  have hc := h.cost_le_one hA hN hq hs hu
  have hsd := BranchState.valid_depths hs
  have hud := BranchState.valid_depths hu
  have hi := abs_le.mp (hA.increment_le_one hN (hud.1.trans hud.2) (hsd.1.trans hsd.2))
  unfold branchExponent
  split_ifs <;> linarith

theorem PolicyBranch.ancestor_exponent_bound {A : β„• β†’ ℝ} {N q n : β„•} {lam sig eps : ℝ}
    (b : PolicyBranch A N q sig n) (hA : DiscreteProfileLipschitz A N)
    (hN : 0 < N) (hq : 0 < q) (hloss : 4000*(lam+sig) ≀ 1) :
    (βˆ‘ j ∈ Finset.range n, branchExponent A lam sig eps (b.state j) (b.label j) (b.state (j+1))) ≀
      (n:ℝ)*(4+eps) := by
  calc
    _ ≀ βˆ‘ _j ∈ Finset.range n, (4+eps) := by
      apply Finset.sum_le_sum
      intro j hj
      have hj := Finset.mem_range.mp hj
      exact (b.step j hj).exponent_le_four hA hN hq hloss (b.valid j hj.le)
        (b.valid (j+1) (by omega))
    _ = _ := by simp only [Finset.sum_const,Finset.card_range,nsmul_eq_mul]

theorem source_error_exponent {sig kap T eps n : ℝ}
    (hsig : 0 < sig) (hkap : 0 < kap) (hn : 0 ≀ n)
    (hdepth : n ≀ 20/kap+1/sig) (heps : eps ≀ 1)
    (hT : 1000*(1/sig+1/kap)+1000 < T) : -T+n*(4+eps) < -10 := by
  have hstep : n*(4+eps) ≀ 5*n := by nlinarith
  have hk : 0 < 1/kap := by positivity
  have hs : 0 < 1/sig := by positivity
  have he : 20/kap = 20*(1/kap) := by ring
  rw [he] at hdepth
  linarith

theorem uniform_source_error_branch {lam sig kap T eps : ℝ}
    (hsig : 0 < sig) (hkap : 0 < kap) (hkap1 : kap ≀ 1) (hgap : sig < kap/1000)
    (hloss : 4000*(lam+sig) ≀ 1) (heps : eps ≀ 1)
    (hT : 1000*(1/sig+1/kap)+1000 < T) :
    βˆƒ Nβ‚€ : β„•, 0 < Nβ‚€ ∧ βˆ€ N β‰₯ Nβ‚€, βˆ€ A : β„• β†’ ℝ,
      DiscreteProfileLipschitz A N β†’ βˆ€ n : β„•,
      βˆ€ b : PolicyBranch A N (sourcePolicyBlock N kap) sig n,
      (b.state 0).index = 0 β†’
      ((2:ℝ)^N)^(-T+(βˆ‘ j ∈ Finset.range n,
        branchExponent A lam sig eps (b.state j) (b.label j) (b.state (j+1)))) ≀
      ((2:ℝ)^N)^(-10:ℝ) := by
  obtain ⟨Nβ‚€,hNβ‚€,hβ‚€βŸ© := uniform_source_branch_depth hsig hkap hkap1 hgap
  refine ⟨Nβ‚€,hNβ‚€,?_⟩
  intro N hN A hA n b hi
  have hNp : 0 < N := hNβ‚€.trans_le hN
  have hc := b.ancestor_exponent_bound (eps := eps) hA hNp (sourcePolicyBlock_pos hNp hkap) hloss
  have hd := (hβ‚€ N hN A n b hi).2.2.1
  have he := source_error_exponent hsig hkap (Nat.cast_nonneg n) hd heps hT
  apply Real.rpow_le_rpow_of_exponent_le (one_le_powβ‚€ (by norm_num))
  linarith

theorem source_profile_exponent_lower {A : β„• β†’ ℝ} {N a t Q : β„•}
    (hA : DiscreteProfileLipschitz A N) (hN : 0 < N) (hzero : A 0 = 0)
    (hQ : 0 < Q) (hw : a+Q ≀ t) (ht : t ≀ N) :
    -4 ≀ 2*A a-potential A a t Q := by
  have ha := abs_le.mp (hA.abs_le_one hN hzero (show a ≀ N by omega))
  have hb := abs_le.mp (hA.abs_le_one hN hzero (show a+Q ≀ N by omega))
  have hp := potential_le A (Q := Q) (le_refl a) (by omega : a < a+Q) hw (le_refl _)
  linarith

theorem uniform_recursion_count_subpower (D : β„•) {eta : ℝ} (heta : 0 < eta) :
    βˆƒ Nβ‚€ : β„•, βˆ€ N β‰₯ Nβ‚€, (4*(N:ℝ)+1)^D ≀ ((2:ℝ)^N)^eta :=
  fixed_polynomial_subpower D heta

end PlanarFalconer

end OAI