math / data /lean /OAI /NumberTheory /TwoPoint /Walks /ClosedWordPadding.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
5.07 kB
import OAI.NumberTheory.TwoPoint.Bounds.ActualPaddingProduct
namespace OAI
/-! Separate the actual closed matrix word into centered factors and its retained padding weight. -/
namespace TwoPointCorrelations
open Finset
open scoped Classical
noncomputable def retainedEdgeDeparture (Q : Finset β„•) (u : β„• β†’ ℝ)
(eligible : SignedStep β†’ β„• β†’ Prop) (g : β„€ β†’ ℝ) (L K : ℝ)
(extra : SignedStep β†’ β„€ β†’ Prop) (h : β„•) (t : SignedStep) (n : β„€) : ℝ :=
if t.padding ∈ Q ∧ eligible t t.padding ∧ (t.padding : β„€) ∣ n ∧
integerEdgeKeep Q u (eligible t) g L K (extra t) n ∧
integerEdgeKeep Q u (eligible t) g L K (extra t) (n + t.displacement h)
then L * u t.padding / (g n) ^ 2 else 0
lemma retainedEdgeDeparture_nonneg (Q : Finset β„•) (u : β„• β†’ ℝ)
(eligible : SignedStep β†’ β„• β†’ Prop) (g : β„€ β†’ ℝ) (L K : ℝ)
(extra : SignedStep β†’ β„€ β†’ Prop) (h : β„•) (hL : 0 ≀ L) (hu : βˆ€ q, 0 ≀ u q)
(t : SignedStep) (n : β„€) :
0 ≀ retainedEdgeDeparture Q u eligible g L K extra h t n := by
unfold retainedEdgeDeparture
split_ifs
Β· exact div_nonneg (mul_nonneg hL (hu _)) (sq_nonneg _)
Β· exact le_rfl
lemma retainedEdgeDeparture_le_atom (Q : Finset β„•) (u : β„• β†’ ℝ)
(eligible : SignedStep β†’ β„• β†’ Prop) (g : β„€ β†’ ℝ) (L K : ℝ)
(extra : SignedStep β†’ β„€ β†’ Prop) (h : β„•) (hL : 0 ≀ L) (hu : βˆ€ q, 0 ≀ u q)
(t : SignedStep) (n : β„€) :
retainedEdgeDeparture Q u eligible g L K extra h t n ≀
retainedPaddingAtom Q u (eligible t) g L K (extra t) n t.padding := by
unfold retainedEdgeDeparture
split_ifs with ht
Β· have hs : eligible t t.padding ∧ (t.padding : β„€) ∣ n ∧
integerEdgeKeep Q u (eligible t) g L K (extra t) n :=
⟨ht.2.1, ht.2.2.1, ht.2.2.2.1⟩
simp only [retainedPaddingAtom, ite_eq_left hs, le_refl]
Β· exact retainedPaddingAtom_nonneg Q u (eligible t) g L K (extra t) n t.padding hL (hu _)
theorem closed_signed_word_factorization (Q : Finset β„•) (u : β„• β†’ ℝ)
(eligible : SignedStep β†’ β„• β†’ Prop) (g : β„€ β†’ ℝ) (center : SignedStep β†’ β„€ β†’ ℝ)
(L K : ℝ) (extra : SignedStep β†’ β„€ β†’ Prop) (h : β„•) (n : β„€) (word : List SignedStep)
(hg : βˆ€ n, g n β‰  0)
(hperiod : βˆ€ t, βˆ€ q ∈ Q, βˆ€ z, center t (z + (h * q * t.tuple : β„•)) = center t z)
(hclosed : wordDisplacement h word = 0) :
scalarWalkProduct h (fun t x =>
signedIntegerWeight Q u (eligible t) g (center t) L K (extra t) h t x) n word =
scalarWalkProduct h (retainedEdgeDeparture Q u eligible g L K extra h) n word *
scalarWalkProduct h center n word := by
rw [signedIntegerWeight_closed_normalize Q u eligible g center L K extra h n word
hg hperiod hclosed]
rw [← scalarWalkProduct_mul]
apply scalarWalkProduct_congr
intro t x
unfold retainedEdgeDeparture
split_ifs <;> ring
lemma scalarWalkProduct_nonneg (h : β„•) (weight : SignedStep β†’ β„€ β†’ ℝ)
(hw : βˆ€ t n, 0 ≀ weight t n) (n : β„€) (word : List SignedStep) :
0 ≀ scalarWalkProduct h weight n word := by
induction word generalizing n with
| nil => exact zero_le_one
| cons t word ih => exact mul_nonneg (hw t n) (ih _)
lemma scalarWalkProduct_mono (h : β„•) (a b : SignedStep β†’ β„€ β†’ ℝ)
(ha : βˆ€ t n, 0 ≀ a t n) (hab : βˆ€ t n, a t n ≀ b t n)
(n : β„€) (word : List SignedStep) :
scalarWalkProduct h a n word ≀ scalarWalkProduct h b n word := by
induction word generalizing n with
| nil => exact le_rfl
| cons t word ih =>
exact mul_le_mul (hab t n) (ih _) (scalarWalkProduct_nonneg h a ha _ _)
((ha t n).trans (hab t n))
theorem closed_word_padding_majorant (Q : Finset β„•) (u : β„• β†’ ℝ)
(eligible : SignedStep β†’ β„• β†’ Prop) (g : β„€ β†’ ℝ) (L K : ℝ)
(extra : SignedStep β†’ β„€ β†’ Prop) (h : β„•) (hL : 0 ≀ L) (hu : βˆ€ q, 0 ≀ u q)
(n : β„€) (word : List SignedStep) :
scalarWalkProduct h (retainedEdgeDeparture Q u eligible g L K extra h) n word ≀
scalarWalkProduct h
(fun t x => retainedPaddingAtom Q u (eligible t) g L K (extra t) x t.padding) n word :=
scalarWalkProduct_mono h _ _ (retainedEdgeDeparture_nonneg Q u eligible g L K extra h hL hu)
(retainedEdgeDeparture_le_atom Q u eligible g L K extra h hL hu) n word
theorem scalarWalkProduct_ofFn {m : β„•} (h : β„•) (weight : SignedStep β†’ β„€ β†’ ℝ)
(step : Fin m β†’ SignedStep) (n : β„€) :
scalarWalkProduct h weight n (List.ofFn step) =
∏ i : Fin m, weight (step i) (n + wordDisplacement h ((List.ofFn step).take i.val)) := by
induction m generalizing n with
| zero => simp [scalarWalkProduct]
| succ m ih =>
rw [List.ofFn_succ, scalarWalkProduct, ih, Fin.prod_univ_succ]
simp only [Fin.val_zero, List.take_zero, wordDisplacement_nil, add_zero]
congr 1
apply prod_congr rfl
intro i _
simp only [Fin.val_succ, List.take_succ_cons, wordDisplacement_cons,
add_assoc]
end TwoPointCorrelations
end OAI