math / data /lean /OAI /NumberTheory /TwoPoint /Walks /BlockEndpointSum.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
3.06 kB
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