cfahlgren1's picture
download
raw
7.92 kB
12
def average (step : V → Fin d → V) (f : V → ℝ) (v : V) : ℝ :=
body · 1 line
  (∑ c : Fin d, f (step v c)) / d
15
theorem average_mono (step : V → Fin d → V) {f g : V → ℝ}
    (h : ∀ v, f v ≤ g v) : ∀ v, average step f v ≤ average step g v := by
proof · 3 lines
  intro v
  exact div_le_div_of_nonneg_right (Finset.sum_le_sum (fun c _ => h (step v c)))
    (Nat.cast_nonneg d)
21
theorem average_mul (step : V → Fin d → V) (a : ℝ) (f : V → ℝ) (v : V) :
    average step (fun w => a * f w) v = a * average step f v := by
proof · 3 lines
  unfold average
  rw [← Finset.mul_sum]
  ring
27
theorem iterate_bound (step : V → Fin d → V) (q : V → ℝ)
    {rho : ℝ} (hrho : 0 ≤ rho) (hq : ∀ v, average step q v ≤ rho * q v)
    (n : ℕ) : ∀ v, ((average step)^[n]) q v ≤ rho ^ n * q v := by
proof · 11 lines
  induction n with
  | zero => intro v; simp
  | succ n ih =>
    intro v
    rw [Function.iterate_succ_apply']
    calc
      average step (((average step)^[n]) q) v ≤
          average step (fun w => rho ^ n * q w) v := average_mono step ih v
      _ = rho ^ n * average step q v := average_mul step _ _ _
      _ ≤ rho ^ n * (rho * q v) := mul_le_mul_of_nonneg_left (hq v) (pow_nonneg hrho n)
      _ = rho ^ (n + 1) * q v := by rw [pow_succ]; ring
42
theorem average_nonneg (step : V → Fin d → V) {f : V → ℝ}
    (hf : ∀ v, 0 ≤ f v) : ∀ v, 0 ≤ average step f v := by
proof · 2 lines
  intro v
  exact div_nonneg (Finset.sum_nonneg (fun c _ => hf (step v c))) (Nat.cast_nonneg d)
47
theorem abs_average_le (step : V → Fin d → V) (f : V → ℝ) (v : V) :
    |average step f v| ≤ average step (fun w => |f w|) v := by
proof · 3 lines
  unfold average
  rw [abs_div, show |(d : ℝ)| = d from abs_of_nonneg (Nat.cast_nonneg d)]
  exact div_le_div_of_nonneg_right (Finset.abs_sum_le_sum_abs _ _) (Nat.cast_nonneg d)
53
theorem abs_iterate_average_le (step : V → Fin d → V) (f : V → ℝ) (n : ℕ) :
    ∀ v, |((average step)^[n]) f v| ≤
      ((average step)^[n]) (fun w => |f w|) v := by
proof · 6 lines
  induction n with
  | zero => intro v; simp
  | succ n ih =>
    intro v
    rw [Function.iterate_succ_apply', Function.iterate_succ_apply']
    exact (abs_average_le _ _ _).trans (average_mono step ih v)
63
theorem iterate_average_mono (step : V → Fin d → V) {f g : V → ℝ}
    (h : ∀ v, f v ≤ g v) (n : ℕ) :
    ∀ v, ((average step)^[n]) f v ≤ ((average step)^[n]) g v := by
proof · 5 lines
  induction n with
  | zero => exact h
  | succ n ih =>
    simp only [Function.iterate_succ_apply']
    exact average_mono step ih
72
theorem iterate_average_mul (step : V → Fin d → V) (a : ℝ) (f : V → ℝ) (n : ℕ) :
    ((average step)^[n]) (fun w => a * f w) =
      fun v => a * ((average step)^[n]) f v := by
proof · 6 lines
  induction n with
  | zero => rfl
  | succ n ih =>
    funext v
    rw [Function.iterate_succ_apply', ih, Function.iterate_succ_apply']
    exact average_mul step _ _ _
84
def vectorAverage (step : V → Fin d → V) (f : V → H) (v : V) : H :=
body · 1 line
  (d : ℝ)⁻¹ • ∑ c : Fin d, f (step v c)
87
theorem inner_vectorAverage (step : V → Fin d → V) (x : H) (f : V → H) (v : V) :
    inner ℝ x (vectorAverage step f v) = average step (fun w => inner ℝ x (f w)) v := by
proof · 2 lines
  simp only [vectorAverage, inner_smul_right, inner_sum, average]
  ring
92
theorem inner_iterate_vectorAverage (step : V → Fin d → V) (x : H) (f : V → H)
    (n : ℕ) :
    (fun v => inner ℝ x (((vectorAverage step)^[n]) f v)) =
      ((average step)^[n]) (fun v => inner ℝ x (f v)) := by
proof · 6 lines
  induction n with
  | zero => rfl
  | succ n ih =>
    funext v
    rw [Function.iterate_succ_apply', inner_vectorAverage, ih,
      Function.iterate_succ_apply']
103
theorem inner_iterate_bound (step : V → Fin d → V) (x : H) (f : V → H)
    (q : V → ℝ) {C rho : ℝ} (hC : 0 ≤ C) (hrho : 0 ≤ rho)
    (hq : ∀ v, average step q v ≤ rho * q v)
    (hf : ∀ v, |inner ℝ x (f v)| ≤ C * q v)
    (n : ℕ) (v : V) :
    |inner ℝ x (((vectorAverage step)^[n]) f v)| ≤ C * rho ^ n * q v := by
proof · 10 lines
  have hinner := congrFun (inner_iterate_vectorAverage step x f n) v
  rw [hinner]
  calc
    |((average step)^[n]) (fun w => inner ℝ x (f w)) v| ≤
        ((average step)^[n]) (fun w => |inner ℝ x (f w)|) v :=
      abs_iterate_average_le step _ n v
    _ ≤ ((average step)^[n]) (fun w => C * q w) v := iterate_average_mono step hf n v
    _ = C * ((average step)^[n]) q v := congrFun (iterate_average_mul step C q n) v
    _ ≤ C * (rho ^ n * q v) := mul_le_mul_of_nonneg_left (iterate_bound step q hrho hq n v) hC
    _ = C * rho ^ n * q v := by ring
120
def weight (d : ℕ) (n : ℕ) : ℝ :=
body · 1 line
  (Real.sqrt ((d : ℝ) - 1))⁻¹ ^ n
123
def rate (d : ℕ) : ℝ := 2 * Real.sqrt ((d : ℝ) - 1) / d
125
theorem rate_nonneg (d : ℕ) : 0 ≤ rate d := by
proof · 1 line
  exact div_nonneg (mul_nonneg (by norm_num) (Real.sqrt_nonneg _)) (Nat.cast_nonneg d)
128
theorem rate_lt_one {d : ℕ} (hd : 3 ≤ d) : rate d < 1 := by
proof · 7 lines
  have hdR : (3 : ℝ) ≤ d := by exact_mod_cast hd
  have hb : 0 ≤ (d : ℝ) - 1 := by linarith
  have hs := Real.sq_sqrt hb
  have hs0 := Real.sqrt_nonneg ((d : ℝ) - 1)
  unfold rate
  apply (div_lt_one (by positivity : (0 : ℝ) < d)).2
  nlinarith [sq_nonneg ((d : ℝ) - 2)]
137
theorem root_bound {d : ℕ} (hd : 3 ≤ d) : weight d 1 ≤ rate d * weight d 0 := by
proof · 8 lines
  have hdR : (3 : ℝ) ≤ d := by exact_mod_cast hd
  have hb : 0 < (d : ℝ) - 1 := by linarith
  have hs : 0 < Real.sqrt ((d : ℝ) - 1) := Real.sqrt_pos.mpr hb
  have hs2 := Real.sq_sqrt hb.le
  simp only [weight, rate, pow_one, pow_zero, mul_one]
  rw [inv_eq_one_div]
  apply (div_le_div_iff₀ hs (by positivity : (0 : ℝ) < d)).2
  nlinarith
147
theorem recurrence {d : ℕ} (hd : 3 ≤ d) (n : ℕ) :
    (weight d n + ((d : ℝ) - 1) * weight d (n + 2)) / d =
      rate d * weight d (n + 1) := by
proof · 8 lines
  have hdR : (3 : ℝ) ≤ d := by exact_mod_cast hd
  have hb : 0 < (d : ℝ) - 1 := by linarith
  have hs : Real.sqrt ((d : ℝ) - 1) ≠ 0 := (Real.sqrt_pos.mpr hb).ne'
  have hs2 := Real.sq_sqrt hb.le
  unfold weight rate
  simp only [pow_succ]
  field_simp
  nlinarith
159
def treeWeight (d : ℕ) (v : TreeVertex d) : ℝ := weight d v.1.length
161
theorem average_treeWeight_le {d : ℕ} (hd : 3 ≤ d) (v : TreeVertex d) :
    average treeStep (treeWeight d) v ≤ rate d * treeWeight d v := by
proof · 15 lines
  classical
  have hsum := sum_treeNeighborFinset_radial v (weight d)
  rw [treeNeighborFinset, Finset.sum_image (treeStep_injective v).injOn] at hsum
  unfold average treeWeight
  rw [hsum]
  by_cases hv : v.1.length = 0
  · rw [ite_eq_left hv, hv]
    have hd0 : (d : ℝ) ≠ 0 := by exact_mod_cast (show d ≠ 0 by omega)
    have hcancel : (d : ℝ) * weight d 1 / d = weight d 1 := by field_simp
    rw [hcancel]
    exact root_bound hd
  · rw [ite_eq_right hv]
    obtain ⟨n, hn⟩ := Nat.exists_eq_succ_of_ne_zero hv
    rw [hn]
    simpa only [Nat.succ_eq_add_one, Nat.add_sub_cancel] using (recurrence hd n).le
179
theorem iterate_treeWeight_le {d : ℕ} (hd : 3 ≤ d) (n : ℕ) (v : TreeVertex d) :
    ((average treeStep)^[n]) (treeWeight d) v ≤ rate d ^ n * treeWeight d v :=
proof · 1 line
  iterate_bound treeStep (treeWeight d) (rate_nonneg d) (average_treeWeight_le hd) n v
183
theorem covariance_walk_bound {d : ℕ} (hd : 3 ≤ d) (f : TreeVertex d → H)
    (o : TreeVertex d) (ho : o.1.length = 0) {C : ℝ} (hC : 0 ≤ C)
    (hcov : ∀ v, |inner ℝ (f o) (f v)| ≤ C * treeWeight d v) (n : ℕ) :
    |inner ℝ (f o) (((vectorAverage treeStep)^[n]) f o)| ≤ C * rate d ^ n := by
proof · 3 lines
  simpa only [treeWeight, ho, weight, pow_zero, mul_one] using
    inner_iterate_bound treeStep (f o) f (treeWeight d) hC (rate_nonneg d)
      (average_treeWeight_le hd) hcov n o

Xet Storage Details

Size:
7.92 kB
·
Xet hash:
f1b9defc030ff25148bffcf199b71cafcd187753c33d2c5f8a76efd9a4defc13

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.