File size: 3,424 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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 | import OAI.Probability.FreeIsing.Model
namespace OAI
noncomputable section
open MeasureTheory Filter
open scoped Topology
namespace Problem367.SpinRecovery
def spinSign : IsingSpin β β
| .neg => -1
| .pos => 1
def decode (x : β β β) : IsingSpin := by
classical
exact if Tendsto (fun n : β => x n / (n : β)) atTop (π (-1 : β))
then .neg else .pos
theorem measurable_decode : Measurable decode := by
unfold decode
apply Measurable.ite
Β· exact measurableSet_tendsto (π (-1 : β))
(f := fun (n : β) (x : β β β) => x n / (n : β))
(by intro n; fun_prop)
Β· exact measurable_const
Β· exact measurable_const
theorem decode_of_tendsto {x : β β β} {s : IsingSpin}
(h : Tendsto (fun n : β => x n / (n : β)) atTop (π (spinSign s))) :
decode x = s := by
cases s with
| neg =>
simp only [spinSign] at h
simp [decode, h]
| pos =>
have hn : Β¬ Tendsto (fun n : β => x n / (n : β)) atTop (π (-1 : β)) := by
intro hm
have he : (-1 : β) = 1 := tendsto_nhds_unique hm h
norm_num at he
simp [decode, hn]
theorem decode_signal_add_noise (s : IsingSpin) {z : β β β}
(hz : Tendsto (fun n : β => z n / (n : β)) atTop (π (0 : β))) :
decode (fun n : β => (n : β) * spinSign s + z n) = s := by
apply decode_of_tendsto
have he : (fun n : β => ((n : β) * spinSign s + z n) / (n : β)) =αΆ [atTop]
(fun n : β => spinSign s + z n / (n : β)) := by
filter_upwards [eventually_ge_atTop 1] with n hn
have hn' : (n : β) β 0 := by exact_mod_cast (by omega : n β 0)
field_simp
apply (tendsto_congr' he).2
simpa using tendsto_const_nhds.add hz
def decodeArray {V : Type*} (x : V β β β β) : V β IsingSpin :=
fun v => decode (x v)
theorem measurable_decodeArray {V : Type*} :
Measurable (decodeArray (V := V)) := by
exact Measurable.of_eval fun vertex =>
measurable_decode.comp (measurable_pi_apply vertex)
theorem decodeArray_comp {V W : Type*} (x : V β β β β) (f : W β V) :
decodeArray (x β f) = decodeArray x β f := rfl
theorem decodeArray_relabel {d : β} (g : TreeAut d)
(x : TreeVertex d β β β β) :
decodeArray (relabel g x) = relabel g (decodeArray x) := rfl
theorem decodeArray_of_tendsto {V : Type*} {x : V β β β β}
{s : V β IsingSpin}
(h : β v, Tendsto (fun n : β => x v n / (n : β)) atTop (π (spinSign (s v)))) :
decodeArray x = s := by
funext v
exact decode_of_tendsto (h v)
theorem decodeArray_ae_eq {Ξ© V : Type*} [MeasurableSpace Ξ©] [Countable V]
{ΞΌ : Measure Ξ©} {x : Ξ© β V β β β β} {s : Ξ© β V β IsingSpin}
(h : β v, βα΅ Ο βΞΌ,
Tendsto (fun n : β => x Ο v n / (n : β)) atTop (π (spinSign (s Ο v)))) :
(fun Ο => decodeArray (x Ο)) =α΅[ΞΌ] s := by
filter_upwards [ae_all_iff.2 h] with Ο hΟ
exact decodeArray_of_tendsto hΟ
theorem map_decodeArray_eq {Ξ© V : Type*} [MeasurableSpace Ξ©] [Countable V]
{ΞΌ : Measure Ξ©} {x : Ξ© β V β β β β} {s : Ξ© β V β IsingSpin}
(h : β v, βα΅ Ο βΞΌ,
Tendsto (fun n : β => x Ο v n / (n : β)) atTop (π (spinSign (s Ο v)))) :
Measure.map (fun Ο => decodeArray (x Ο)) ΞΌ = Measure.map s ΞΌ :=
Measure.map_congr (decodeArray_ae_eq h)
end Problem367.SpinRecovery
end
end OAI
|