Download data/lean/OAI/Probability/FreeIsing/Spins/Recovery.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.42 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/FreeIsing/Spins/Recovery.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/FreeIsing/Spins/Recovery.lean
-
curl -L -o Recovery.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/FreeIsing/Spins/Recovery.lean
3.42 kB
| 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 | |