File size: 2,420 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 | import OAI.NumberTheory.TwoPoint.Walks.BlockEndpointSum
namespace OAI
/-! The finite directed matrix form is the overlapping edge-block sum
used in the prefix comparison, with no residual multiplicity assumption. -/
namespace TwoPointCorrelations
open Finset
open scoped Classical
theorem directed_block_form_eq {E : Type*} [Fintype E] (r : E β β)
(F : E β β€ β β€ β β)
(hsupport : β (e : E) (n m : β€), m β n + r e β F e n m = 0) (M t : β) :
(β e : E, β i : Fin M, β j : Fin M,
F e ((i.val : β€) + (t + 2 : β)) ((j.val : β€) + (t + 2 : β))) =
edgeBlockSum univ r (fun e n => F e n ((n : β€) + r e)) M t := by
let g (i : β) := β e : E, if i + r e < M then
F e ((i : β€) + (t + 2 : β)) ((i : β€) + (t + 2 : β) + r e) else 0
calc
_ = β i : Fin M, β e : E, β j : Fin M,
F e ((i.val : β€) + (t + 2 : β)) ((j.val : β€) + (t + 2 : β)) := sum_comm
_ = β i : Fin M, g i.val := by
apply sum_congr rfl
intro i _
apply sum_congr rfl
intro e _
exact block_supported_edge_sum M (r e) (t + 2 : β) (F e) (hsupport e) i
_ = β i β range M, g i := Fin.sum_univ_eq_sum_range g M
_ = _ := by
unfold edgeBlockSum g
apply sum_congr rfl
intro i _
apply sum_congr rfl
intro e _
have he : i + r e < M β i + 1 + r e β€ M := by omega
simp only [he, Nat.cast_add, Nat.cast_ofNat]
simp only [add_assoc, add_left_comm, add_comm]
theorem directed_block_form_prefix_error {E : Type*} [Fintype E]
(r : E β β) (F : E β β€ β β€ β β)
(hsupport : β (e : E) (n m : β€), m β n + r e β F e n m = 0)
(M R N : β) (hM : 0 < M) (hN : 0 < N) (D : β) (hD : 0 β€ D)
(hr : β e, r e β€ R)
(hrow : β n : β, 0 < n β (β e : E, βF e n ((n : β€) + r e)β) β€ D) :
β((β t β range N, β e : E, β i : Fin M, β j : Fin M,
F e ((i.val : β€) + (t + 2 : β)) ((j.val : β€) + (t + 2 : β))) / (M : β)) / (N : β) -
positivePrefix (fun n => β e : E, F e n ((n : β€) + r e)) N / (N : β)β β€
(R : β) / M * D + 2 * (M : β) / N * D := by
have hb := edgeBlockSum_prefix_error univ r (fun e n => F e n ((n : β€) + r e))
M R N hM hN D hD (fun e _ => hr e) hrow
simpa only [directed_block_form_eq r F hsupport] using hb
end TwoPointCorrelations
end OAI
|