File size: 4,300 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
import Mathlib
import OAI.MeasureTheory.FalconerCompletion.Recursion.MaskScale
import OAI.MeasureTheory.FalconerCompletion.Sphere.SphereAmbient2

namespace OAI

/-! Recursive policies and quantitative depth estimates. -/

section
section
open Set MeasureTheory
open scoped ComplexConjugate RealInnerProductSpace
namespace GraphLiteralSupport
namespace Attempt4PrefixShell
open Filter Real
open scoped Topology

noncomputable def sourceMaskScaleND (l : β„•) (R Οƒ : ℝ) : ℝ :=
  max 1 ((2:ℝ)^l*R^(-50*Οƒ))

noncomputable def sourceMaskRadiusND (d l : β„•) (R Οƒ : ℝ) : ℝ :=
  (sourceMaskScaleND l R Οƒ)⁻¹/(100*(d+1)^2)

noncomputable def sourceTestWidthND (J i n : β„•) (R Οƒ : ℝ) : ℝ :=
  (2-(i:ℝ)/J)*((2:ℝ)^n)⁻¹*R^(500*Οƒ)

lemma sourceMaskScaleND_one_le (l : β„•) (R Οƒ : ℝ) : 1 ≀ sourceMaskScaleND l R Οƒ := le_max_left _ _

lemma sourceMaskScaleND_pos (l : β„•) (R Οƒ : ℝ) : 0<sourceMaskScaleND l R Οƒ :=
  zero_lt_one.trans_le (sourceMaskScaleND_one_le l R Οƒ)

lemma sourceMaskRadiusND_pos (d l : β„•) (R Οƒ : ℝ) : 0<sourceMaskRadiusND d l R Οƒ :=
  div_pos (inv_pos.mpr (sourceMaskScaleND_pos l R Οƒ)) (by positivity)

lemma sourceMaskScaleND_mono {l L : β„•} (h : l ≀ L) {R Οƒ : ℝ} (hR : 0 ≀ R) :
    sourceMaskScaleND l R Οƒ ≀ sourceMaskScaleND L R Οƒ := by
  apply max_le_max_left
  exact mul_le_mul_of_nonneg_right (pow_le_pow_rightβ‚€ (by norm_num) h) (Real.rpow_nonneg hR _)

lemma sourceMaskScaleND_inv_depth {g p : β„•} (hgp : g ≀ p) {R Οƒ : ℝ} (hR : 0<R) :
    ((2:ℝ)^g)⁻¹*(sourceMaskScaleND (p-g) R Οƒ)⁻¹ ≀ ((2:ℝ)^p)⁻¹*R^(50*Οƒ) := by
  have hpos : 0<(2:ℝ)^(p-g)*R^(-50*Οƒ) := by positivity
  have hh := inv_antiβ‚€ hpos (le_max_right (1:ℝ) ((2:ℝ)^(p-g)*R^(-50*Οƒ)))
  apply (mul_le_mul_of_nonneg_left hh (by positivity : (0:ℝ) ≀ ((2:ℝ)^g)⁻¹)).trans_eq
  rw [mul_inv_rev,show -50*Οƒ=-(50*Οƒ) by ring,Real.rpow_neg hR.le,inv_inv]
  calc
    _ = (((2:ℝ)^g)*((2:ℝ)^(p-g)))⁻¹*R^(50*Οƒ) := by rw [mul_inv_rev]; ring
    _ = _ := by rw [← pow_add,Nat.add_sub_of_le hgp]

lemma sourceTestWidthND_gap {J : β„•} (hJ : 0<J) (i n : β„•) (R Οƒ : ℝ) :
    sourceTestWidthND J i n R Οƒ-sourceTestWidthND J (i+1) n R Οƒ =
      (J:ℝ)⁻¹*((2:ℝ)^n)⁻¹*R^(500*Οƒ) := by
  unfold sourceTestWidthND
  push_cast
  have hJ' : (J:ℝ) β‰  0 := by exact_mod_cast hJ.ne'
  field_simp
  ring

lemma source_mask_width_gapND {d g p J i : β„•} {R Οƒ : ℝ}
    (hgp : g ≀ p) (hJ : 0<J) (hR : 0<R) (hlarge : (J:ℝ) ≀ R^(450*Οƒ)) :
    sourceTestWidthND J (i+1) p R Οƒ+
      40*(d+1)^2/(2:ℝ)^g*sourceMaskRadiusND d (p-g) R Οƒ ≀
      sourceTestWidthND J i p R Οƒ := by
  have hD := sourceMaskScaleND_inv_depth hgp hR (Οƒ := Οƒ)
  have hJn : (0:ℝ)<J := by exact_mod_cast hJ
  have hpow : R^(50*Οƒ) ≀ (J:ℝ)⁻¹*R^(500*Οƒ) := by
    calc
      _ ≀ ((J:ℝ)⁻¹*R^(450*Οƒ))*R^(50*Οƒ) := by
        apply le_mul_of_one_le_left (Real.rpow_nonneg hR.le _)
        exact (one_le_inv_mulβ‚€ hJn).mpr hlarge
      _ = _ := by rw [mul_assoc,← Real.rpow_add hR]; congr 2; ring
  have hpert : 40*(d+1)^2/(2:ℝ)^g*sourceMaskRadiusND d (p-g) R Οƒ ≀
      (J:ℝ)⁻¹*((2:ℝ)^p)⁻¹*R^(500*Οƒ) := by
    unfold sourceMaskRadiusND
    calc
      _ = (2/5:ℝ)*(((2:ℝ)^g)⁻¹*(sourceMaskScaleND (p-g) R Οƒ)⁻¹) := by field_simp; ring
      _ ≀ (2/5:ℝ)*(((2:ℝ)^p)⁻¹*R^(50*Οƒ)) := mul_le_mul_of_nonneg_left hD (by norm_num)
      _ ≀ ((2:ℝ)^p)⁻¹*R^(50*Οƒ) := mul_le_of_le_one_left (by positivity) (by norm_num)
      _ ≀ _ := by simpa only [mul_left_comm,mul_assoc] using mul_le_mul_of_nonneg_left hpow (by positivity : (0:ℝ) ≀ ((2:ℝ)^p)⁻¹)
  have he := sourceTestWidthND_gap hJ i p R Οƒ
  linarith

theorem source_mask_width_gap_eventuallyND {Οƒ : ℝ} (hΟƒ : 0<Οƒ) (d J : β„•) (hJ : 0<J) :
    βˆ€αΆ  R : ℝ in atTop, βˆ€ g p i : β„•, g ≀ p β†’
      sourceTestWidthND J (i+1) p R Οƒ+
        40*(d+1)^2/(2:ℝ)^g*sourceMaskRadiusND d (p-g) R Οƒ ≀
        sourceTestWidthND J i p R Οƒ := by
  filter_upwards [eventually_gt_atTop (0:ℝ),
    (tendsto_rpow_atTop (by positivity : (0:ℝ)<450*Οƒ)).eventually_ge_atTop (J:ℝ)] with R hR hlarge
  intro g p i hgp
  exact source_mask_width_gapND hgp hJ hR hlarge

end Attempt4PrefixShell
end GraphLiteralSupport
end
end

end OAI