File size: 3,059 Bytes
180bc03
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.NumberTheory.TwoPoint.Walks.RetainedLiouvilleEdges
import OAI.NumberTheory.TwoPoint.Bounds.OverlapPrefix

namespace OAI

/-! Summing a directed edge over the finite block keeps precisely those
starting positions whose terminal endpoint remains in the block. -/

namespace TwoPointCorrelations

open Finset
open scoped Classical

lemma block_endpoint_sum (M r : ℕ) (i : Fin M) (c : ℤ) (F : ℤ → ℂ) :
    (∑ j : Fin M, if (j.val : ℤ) + c = (i.val : ℤ) + c + r then F ((j.val : ℤ) + c) else 0) =
      if i.val + r < M then F ((i.val : ℤ) + c + r) else 0 := by
  by_cases hi : i.val + r < M
  · let j₀ : Fin M := ⟨i.val + r, hi⟩
    have he (j : Fin M) : (j.val : ℤ) + c = (i.val : ℤ) + c + r ↔ j = j₀ := by
      constructor
      · intro hj
        apply Fin.ext
        dsimp only [j₀]
        omega
      · rintro rfl
        dsimp only [j₀]
        push_cast
        ring
    simp only [he, sum_ite_eq', mem_univ, ite_true, hi]
    congr 1
    dsimp [j₀]
    ring
  · have he (j : Fin M) : (j.val : ℤ) + c ≠ (i.val : ℤ) + c + r := by
      intro hj
      have hjM := j.isLt
      omega
    simp [he, hi]

lemma block_supported_edge_sum (M r : ℕ) (c : ℤ) (F : ℤ → ℤ → ℂ)
    (hsupport : ∀ n m : ℤ, m ≠ n + r → F n m = 0) (i : Fin M) :
    (∑ j : Fin M, F ((i.val : ℤ) + c) ((j.val : ℤ) + c)) =
      if i.val + r < M then F ((i.val : ℤ) + c) ((i.val : ℤ) + c + r) else 0 := by
  have he (j : Fin M) : F ((i.val : ℤ) + c) ((j.val : ℤ) + c) =
      if (j.val : ℤ) + c = (i.val : ℤ) + c + r then
        F ((i.val : ℤ) + c) ((j.val : ℤ) + c) else 0 := by
    split_ifs with h
    · rfl
    · exact hsupport _ _ h
  calc
    _ = ∑ j : Fin M, if (j.val : ℤ) + c = (i.val : ℤ) + c + r then
        F ((i.val : ℤ) + c) ((j.val : ℤ) + c) else 0 := sum_congr rfl (fun j _ => he j)
    _ = _ := block_endpoint_sum M r i c (F ((i.val : ℤ) + c))

lemma retainedLiouvilleEdge_support (Q : Finset ℕ) (u : ℕ → ℝ) (eligible : ℕ → Prop)
    (g center : ℤ → ℝ) (L K : ℝ) (extra keep : ℤ → Prop)
    (h d q : ℕ) (n m : ℤ) (hm : m ≠ n + (h * q * d : ℕ)) :
    retainedLiouvilleEdge Q u eligible g center L K extra keep h d q n m = 0 := by
  unfold retainedLiouvilleEdge
  split_ifs with he
  · exact (hm he.2.2.2.1).elim
  · rfl

lemma retainedLiouvilleEdge_block_sum (Q : Finset ℕ) (u : ℕ → ℝ) (eligible : ℕ → Prop)
    (g center : ℤ → ℝ) (L K : ℝ) (extra keep : ℤ → Prop)
    (h d q M : ℕ) (c : ℤ) (i : Fin M) :
    (∑ j : Fin M, retainedLiouvilleEdge Q u eligible g center L K extra keep h d q
      ((i.val : ℤ) + c) ((j.val : ℤ) + c)) =
      if i.val + h * q * d < M then
        retainedLiouvilleEdge Q u eligible g center L K extra keep h d q
          ((i.val : ℤ) + c) ((i.val : ℤ) + c + (h * q * d : ℕ)) else 0 :=
  block_supported_edge_sum M (h * q * d) c _
    (retainedLiouvilleEdge_support Q u eligible g center L K extra keep h d q) i

end TwoPointCorrelations

end OAI