Download data/lean/OAI/Probability/InvariantIsing/Arrays/NSpinTensorPairPaths.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 15.5 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/InvariantIsing/Arrays/NSpinTensorPairPaths.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Probability/InvariantIsing/Arrays/NSpinTensorPairPaths.lean
-
curl -L -o NSpinTensorPairPaths.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Probability/InvariantIsing/Arrays/NSpinTensorPairPaths.lean
15.5 kB
| import OAI.Probability.InvariantIsing.Arrays.NSpinTensorPairConditioning | |
| import OAI.Probability.InvariantIsing.Arrays.OverlapBounds | |
| namespace OAI | |
| /-! Actual bounded spin pair tests under the published marked-path law. -/ | |
| noncomputable section | |
| open MeasureTheory ProbabilityTheory IsingPerceptron | |
| open scoped BigOperators ENNReal NNReal | |
| namespace InvariantIsing | |
| abbrev TensorPairPathData {N m k : β} (I : Fin m β Finset (Fin N)) | |
| (degree : Fin k β Fin m β β) (n : β) := | |
| (SpinTensorIndex I degree β β) Γ | |
| (Fin n β (SpinTensorIndex I degree β β) Γ (SpinTensorIndex I degree β β)) | |
| def tensorPairPathState {N m k : β} (I : Fin m β Finset (Fin N)) | |
| (degree : Fin k β Fin m β β) (n : β) (p : TensorPairPathData I degree n) (j : Fin 2) : | |
| SpinTensorIndex I degree β β := | |
| p.1 + β i, if j = 0 then (p.2 i).1 else (p.2 i).2 | |
| lemma measurable_tensorPairPathState {N m k : β} (I : Fin m β Finset (Fin N)) | |
| (degree : Fin k β Fin m β β) (n : β) (j : Fin 2) : | |
| Measurable (fun p => tensorPairPathState I degree n p j) := by | |
| have hm (i : Fin n) : Measurable (fun p : TensorPairPathData I degree n => | |
| if j = 0 then (p.2 i).1 else (p.2 i).2) := by | |
| split_ifs | |
| Β· exact ((measurable_pi_apply i).comp measurable_snd).fst | |
| Β· exact ((measurable_pi_apply i).comp measurable_snd).snd | |
| exact measurable_fst.add (Finset.measurable_sum _ fun i _ => hm i) | |
| private lemma measurable_tensorPairSpinMeasures {N m k : β} | |
| (eig : Fin N β β) (U : Rotation N) (c : Fin N β β) | |
| (I : Fin m β Finset (Fin N)) (degree : Fin k β Fin m β β) (amplitude : Fin k β β) | |
| (n : β) : | |
| Measurable (fun p : TensorPairPathData I degree n => Measure.pi (fun j : Fin 2 => | |
| gibbsProbability (uniformSpinPrior N : Measure (Spin N)) | |
| (tensorSpinBaseEnergy eig U c I degree amplitude (tensorPairPathState I degree n p j)))) := by | |
| have hΞ½ (j : Fin 2) : Measurable (fun p : TensorPairPathData I degree n => | |
| gibbsProbability (uniformSpinPrior N : Measure (Spin N)) | |
| (tensorSpinBaseEnergy eig U c I degree amplitude (tensorPairPathState I degree n p j))) := by | |
| let H : TensorPairPathData I degree n Γ Spin N β β := fun p => | |
| tensorSpinBaseEnergy eig U c I degree amplitude (tensorPairPathState I degree n p.1 j) p.2 | |
| have hH : Measurable H := by | |
| apply measurable_from_prod_countable_left | |
| intro Ο | |
| have hm := (measurable_pi_apply Ο).comp | |
| ((measurable_spinTensorEnergyMark U I degree amplitude).comp | |
| (measurable_tensorPairPathState I degree n j)) | |
| exact hm.const_add (rotatedEnergy eig U Ο + fieldEnergy c Ο) | |
| exact measurable_gibbsProbability | |
| (Ξ½ := fun _ : TensorPairPathData I degree n => (uniformSpinPrior N : Measure (Spin N))) | |
| (H := H) measurable_const hH | |
| apply Measure.measurable_of_measurable_coe | |
| intro s hs | |
| have he (p : TensorPairPathData I degree n) : | |
| (Measure.pi (fun j : Fin 2 => gibbsProbability (uniformSpinPrior N : Measure (Spin N)) | |
| (tensorSpinBaseEnergy eig U c I degree amplitude (tensorPairPathState I degree n p j)))) s = | |
| β' Ο : Fin 2 β Spin N, | |
| (β j : Fin 2, gibbsProbability (uniformSpinPrior N : Measure (Spin N)) | |
| (tensorSpinBaseEnergy eig U c I degree amplitude (tensorPairPathState I degree n p j)) {Ο j}) * | |
| Measure.dirac Ο s := by | |
| rw [β Measure.sum_smul_dirac (Measure.pi _), Measure.sum_apply _ hs] | |
| simp only [Measure.smul_apply, smul_eq_mul, Measure.pi_singleton] | |
| simp_rw [he] | |
| apply Measurable.tsum | |
| intro Ο | |
| exact (Finset.measurable_prod _ fun j _ => | |
| (Measure.measurable_coe (measurableSet_singleton _)).comp (hΞ½ j)).mul_const _ | |
| def tensorPairPathSpinKernel {N m k : β} | |
| (eig : Fin N β β) (U : Rotation N) (c : Fin N β β) | |
| (I : Fin m β Finset (Fin N)) (degree : Fin k β Fin m β β) (amplitude : Fin k β β) | |
| (n : β) : Kernel (TensorPairPathData I degree n) (Fin 2 β Spin N) := | |
| β¨fun p => Measure.pi (fun j : Fin 2 => | |
| gibbsProbability (uniformSpinPrior N : Measure (Spin N)) | |
| (tensorSpinBaseEnergy eig U c I degree amplitude (tensorPairPathState I degree n p j))), | |
| measurable_tensorPairSpinMeasures eig U c I degree amplitude nβ© | |
| instance tensorPairPathSpinKernel_markov {N m k : β} | |
| (eig : Fin N β β) (U : Rotation N) (c : Fin N β β) | |
| (I : Fin m β Finset (Fin N)) (degree : Fin k β Fin m β β) (amplitude : Fin k β β) | |
| (n : β) : IsMarkovKernel (tensorPairPathSpinKernel eig U c I degree amplitude n) := | |
| β¨fun _ => inferInstanceAs (IsProbabilityMeasure (Measure.pi _))β© | |
| def tensorPairPathSpinMean {N m k : β} | |
| (eig : Fin N β β) (U : Rotation N) (c : Fin N β β) | |
| (I : Fin m β Finset (Fin N)) (degree : Fin k β Fin m β β) (amplitude : Fin k β β) | |
| (n : β) (p : TensorPairPathData I degree n) (D : (Fin 2 β Spin N) β β) : β := | |
| β« Ο, D Ο βtensorPairPathSpinKernel eig U c I degree amplitude n p | |
| lemma measurable_tensorPairPathSpinMean {N m k : β} | |
| (eig : Fin N β β) (U : Rotation N) (c : Fin N β β) | |
| (I : Fin m β Finset (Fin N)) (degree : Fin k β Fin m β β) (amplitude : Fin k β β) | |
| (n : β) (D : (Fin 2 β Spin N) β β) : | |
| Measurable (fun p => tensorPairPathSpinMean eig U c I degree amplitude n p D) := by | |
| have hm : Measurable (fun p : TensorPairPathData I degree n Γ (Fin 2 β Spin N) => D p.2) := | |
| (measurable_of_countable D).comp measurable_snd | |
| exact (hm.stronglyMeasurable.integral_kernel_prod_right' | |
| (ΞΊ := tensorPairPathSpinKernel eig U c I degree amplitude n)).measurable | |
| lemma tensorPairPathSpinMean_abs_le {N m k : β} | |
| (eig : Fin N β β) (U : Rotation N) (c : Fin N β β) | |
| (I : Fin m β Finset (Fin N)) (degree : Fin k β Fin m β β) (amplitude : Fin k β β) | |
| (n : β) (p : TensorPairPathData I degree n) (D : (Fin 2 β Spin N) β β) | |
| {C : β} (hD : β Ο, |D Ο| β€ C) : | |
| |tensorPairPathSpinMean eig U c I degree amplitude n p D| β€ C := | |
| abs_integral_le_const_of_bound (measurable_of_countable D) hD | |
| def tensorPairSpinPathPayoff {N m k : β} | |
| (eig : Fin N β β) (U : Rotation N) (c : Fin N β β) | |
| (I : Fin m β Finset (Fin N)) (degree : Fin k β Fin m β β) (amplitude : Fin k β β) | |
| (n : β) (Ο : β β β) (D : (Fin 2 β Spin N) β β) | |
| (p : (SpinTensorIndex I degree β β) Γ | |
| (β Γ (Fin n β (SpinTensorIndex I degree β β) Γ (SpinTensorIndex I degree β β)))) : β := | |
| Ο p.2.1 * tensorPairPathSpinMean eig U c I degree amplitude n (p.1, p.2.2) D | |
| lemma measurable_tensorPairSpinPathPayoff {N m k : β} | |
| (eig : Fin N β β) (U : Rotation N) (c : Fin N β β) | |
| (I : Fin m β Finset (Fin N)) (degree : Fin k β Fin m β β) (amplitude : Fin k β β) | |
| (n : β) (Ο : β β β) (D : (Fin 2 β Spin N) β β) : | |
| Measurable (tensorPairSpinPathPayoff eig U c I degree amplitude n Ο D) := | |
| ((measurable_of_countable Ο).comp measurable_snd.fst).mul | |
| ((measurable_tensorPairPathSpinMean eig U c I degree amplitude n D).comp | |
| (measurable_fst.prodMk measurable_snd.snd)) | |
| lemma tensorPairSpinPathPayoff_abs_le {N m k : β} | |
| (eig : Fin N β β) (U : Rotation N) (c : Fin N β β) | |
| (I : Fin m β Finset (Fin N)) (degree : Fin k β Fin m β β) (amplitude : Fin k β β) | |
| (n : β) (Ο : β β β) (D : (Fin 2 β Spin N) β β) | |
| {B C : β} (hB : 0 β€ B) (hΟ : β d, |Ο d| β€ B) (hD : β Ο, |D Ο| β€ C) | |
| (p : (SpinTensorIndex I degree β β) Γ | |
| (β Γ (Fin n β (SpinTensorIndex I degree β β) Γ (SpinTensorIndex I degree β β)))) : | |
| |tensorPairSpinPathPayoff eig U c I degree amplitude n Ο D p| β€ B * C := by | |
| rw [tensorPairSpinPathPayoff, abs_mul] | |
| exact mul_le_mul (hΟ _) (tensorPairPathSpinMean_abs_le eig U c I degree amplitude n _ D hD) | |
| (abs_nonneg _) hB | |
| private lemma tensorPairPathState_edges {N m k : β} | |
| (I : Fin m β Finset (Fin N)) (degree : Fin k β Fin m β β) | |
| (n : β) (z : SpinTensorIndex I degree β β) (p : TensorCoordinateData I degree n) | |
| (Ξ± : Fin 2 β LabeledLeaf n) (j : Fin 2) : | |
| tensorPairPathState I degree n | |
| (z, fun i => (p.2 (edgeAt n (Ξ± 0) i), p.2 (edgeAt n (Ξ± 1) i))) j = | |
| labeledEnergy n (markForestOfCoords (SpinTensorIndex I degree β β) n p.2) (Ξ± j) z := by | |
| funext a | |
| rw [labeledEnergy_edge_sum] | |
| fin_cases j <;> simp [tensorPairPathState, Pi.add_apply, Finset.sum_apply] | |
| private lemma tensorPairPathSpinKernel_edges {N m k : β} | |
| (eig : Fin N β β) (U : Rotation N) (c : Fin N β β) | |
| (I : Fin m β Finset (Fin N)) (degree : Fin k β Fin m β β) (amplitude : Fin k β β) | |
| (n : β) (z : SpinTensorIndex I degree β β) (p : TensorCoordinateData I degree n) | |
| (Ξ± : Fin 2 β LabeledLeaf n) : | |
| tensorPairPathSpinKernel eig U c I degree amplitude n | |
| (z, fun i => (p.2 (edgeAt n (Ξ± 0) i), p.2 (edgeAt n (Ξ± 1) i))) = | |
| spinLeafPairResidualKernel (tensorLeafSpinHamiltonian eig U c I degree amplitude n z p) Ξ± := by | |
| change Measure.pi _ = Measure.pi _ | |
| congr 1 | |
| funext j | |
| rw [tensorPairPathState_edges] | |
| rfl | |
| def tensorSpinPairAverage {N m k : β} | |
| (eig : Fin N β β) (U : Rotation N) (c : Fin N β β) | |
| (I : Fin m β Finset (Fin N)) (degree : Fin k β Fin m β β) (amplitude : Fin k β β) | |
| (n : β) (b : β β β) (v : β β SpinTensorIndex I degree β ββ₯0) | |
| (z : SpinTensorIndex I degree β β) (Ο : β β β) (D : (Fin 2 β Spin N) β β) : β := | |
| β« p : TensorCoordinateData I degree n, | |
| referenceReplicaMean ((uniformSpinPrior N : Measure (Spin N)).prod (labeledLeafLaw n p.1)) | |
| (tensorLeafSpinHamiltonian eig U c I degree amplitude n z p) | |
| (fun x : Fin 2 β Spin N Γ LabeledLeaf n => | |
| Ο (labeledCommonDepth n (x 0).2 (x 1).2) * D (fun j => (x j).1)) | |
| βtensorCoordinateLaw I degree n b v | |
| theorem tensorSpinPairAverage_eq_tiltedPath {N m k : β} (hN : 0 < N) | |
| (eig : Fin N β β) (U : Rotation N) (c : Fin N β β) | |
| (I : Fin m β Finset (Fin N)) (degree : Fin k β Fin m β β) (amplitude : Fin k β β) | |
| (n : β) (b : β β β) (v : β β SpinTensorIndex I degree β ββ₯0) | |
| (hb : CascadeExponents n b) (z : SpinTensorIndex I degree β β) | |
| (Ο : β β β) (D : (Fin 2 β Spin N) β β) | |
| {B C : β} (hB : 0 β€ B) (hΟ : β d, |Ο d| β€ B) (hD : β Ο, |D Ο| β€ C) : | |
| tensorSpinPairAverage eig U c I degree amplitude n b v z Ο D = | |
| tensorTiltedPairPathMean eig U c I degree amplitude n b v z | |
| (fun q => tensorPairSpinPathPayoff eig U c I degree amplitude n Ο D (z, q)) := by | |
| apply integral_congr_ae | |
| filter_upwards [tensorLeafSpinPair_conditioning_ae hN eig U c I degree amplitude n b v hb z] with p hp | |
| let D' := fun x : Fin 2 β Spin N Γ LabeledLeaf n => | |
| Ο (labeledCommonDepth n (x 0).2 (x 1).2) * D (fun j => (x j).1) | |
| have hD' : β x, |D' x| β€ B * C := by | |
| intro x | |
| dsimp only [D'] | |
| rw [abs_mul] | |
| exact mul_le_mul (hΟ _) (hD _) (abs_nonneg _) hB | |
| rw [hp D' β¨B * C, hD'β©] | |
| congr 1 | |
| funext Ξ± | |
| dsimp only [tensorPairSpinPathPayoff, tensorPairPathSpinMean] | |
| rw [tensorPairPathSpinKernel_edges] | |
| rw [β integral_const_mul] | |
| rfl | |
| /-- The actual spin/leaf pair expectation is a Markov ancestor-path | |
| expectation conditional only on the precise published cascade input. -/ | |
| theorem tensorSpinPair_markov_identity (hpub : PanchenkoTalagrandTensorPairInput) | |
| {N m k : β} (hN : 0 < N) | |
| (eig : Fin N β β) (U : Rotation N) (c : Fin N β β) | |
| (I : Fin m β Finset (Fin N)) (degree : Fin k β Fin m β β) (amplitude : Fin k β β) | |
| (n : β) (b : β β β) (v : β β SpinTensorIndex I degree β ββ₯0) | |
| (hb : CascadeExponents n b) (z : SpinTensorIndex I degree β β) | |
| (Ο : β β β) (D : (Fin 2 β Spin N) β β) | |
| {B C : β} (hB : 0 β€ B) (hΟ : β d, |Ο d| β€ B) (hD : β Ο, |D Ο| β€ C) : | |
| tensorSpinPairAverage eig U c I degree amplitude n b v z Ο D = | |
| β« Ξ± : β β LabeledLeaf n, | |
| tensorAncestorPairPathMean eig U c I degree amplitude n b v | |
| (labeledCommonDepth n (Ξ± 0) (Ξ± 1)) n 0 z z | |
| (fun w => tensorPairSpinPathPayoff eig U c I degree amplitude n Ο D | |
| (z, labeledCommonDepth n (Ξ± 0) (Ξ± 1), w)) | |
| βcascadeReplicaLaw n b := by | |
| rw [tensorSpinPairAverage_eq_tiltedPath hN eig U c I degree amplitude n b v hb z Ο D hB hΟ hD] | |
| apply hpub N m k hN eig U c I degree amplitude n b v hb z | |
| Β· exact (measurable_tensorPairSpinPathPayoff eig U c I degree amplitude n Ο D).comp | |
| (measurable_const.prodMk measurable_id) | |
| Β· exact β¨B * C, fun p => tensorPairSpinPathPayoff_abs_le eig U c I degree amplitude n Ο D hB hΟ hD (z, p)β© | |
| theorem tensorProjectedOverlap_markov_identity (hpub : PanchenkoTalagrandTensorPairInput) | |
| {N m k : β} (hN : 0 < N) | |
| (eig : Fin N β β) (U : Rotation N) (c : Fin N β β) | |
| (I : Fin m β Finset (Fin N)) (degree : Fin k β Fin m β β) (amplitude : Fin k β β) | |
| (n : β) (b : β β β) (v : β β SpinTensorIndex I degree β ββ₯0) | |
| (hb : CascadeExponents n b) (z : SpinTensorIndex I degree β β) | |
| (J : Finset (Fin N)) (Ο : β β β) {B : β} (hB : 0 β€ B) (hΟ : β d, |Ο d| β€ B) : | |
| tensorSpinPairAverage eig U c I degree amplitude n b v z Ο | |
| (fun Ο => projectedOverlap U J (Ο 0) (Ο 1)) = | |
| β« Ξ± : β β LabeledLeaf n, | |
| tensorAncestorPairPathMean eig U c I degree amplitude n b v | |
| (labeledCommonDepth n (Ξ± 0) (Ξ± 1)) n 0 z z | |
| (fun w => tensorPairSpinPathPayoff eig U c I degree amplitude n Ο | |
| (fun Ο => projectedOverlap U J (Ο 0) (Ο 1)) | |
| (z, labeledCommonDepth n (Ξ± 0) (Ξ± 1), w)) | |
| βcascadeReplicaLaw n b := | |
| tensorSpinPair_markov_identity hpub hN eig U c I degree amplitude n b v hb z Ο _ hB hΟ | |
| (fun Ο => projectedOverlap_abs_le_one U J (Ο 0) (Ο 1)) | |
| /-- The root Gaussian retains its original law and is averaged after the | |
| conditional spin/ancestor-path identity. -/ | |
| theorem tensorRootedSpinPair_markov_identity (hpub : PanchenkoTalagrandTensorPairInput) | |
| {N m k : β} (hN : 0 < N) | |
| (eig : Fin N β β) (U : Rotation N) (c : Fin N β β) | |
| (I : Fin m β Finset (Fin N)) (degree : Fin k β Fin m β β) (amplitude : Fin k β β) | |
| (n : β) (b : β β β) (v : β β SpinTensorIndex I degree β ββ₯0) | |
| (hb : CascadeExponents n b) (Ο : β β β) (D : (Fin 2 β Spin N) β β) | |
| {B C : β} (hB : 0 β€ B) (hΟ : β d, |Ο d| β€ B) (hD : β Ο, |D Ο| β€ C) : | |
| (β« z, tensorSpinPairAverage eig U c I degree amplitude n b (fun i => v (i + 1)) z Ο D | |
| β(tensorGaussianLaw I degree (v 0) : Measure (SpinTensorIndex I degree β β))) = | |
| β« z, β« Ξ± : β β LabeledLeaf n, | |
| tensorAncestorPairPathMean eig U c I degree amplitude n b (fun i => v (i + 1)) | |
| (labeledCommonDepth n (Ξ± 0) (Ξ± 1)) n 0 z z | |
| (fun w => tensorPairSpinPathPayoff eig U c I degree amplitude n Ο D | |
| (z, labeledCommonDepth n (Ξ± 0) (Ξ± 1), w)) | |
| βcascadeReplicaLaw n b | |
| β(tensorGaussianLaw I degree (v 0) : Measure (SpinTensorIndex I degree β β)) := by | |
| exact integral_congr_ae (ae_of_all _ fun z => tensorSpinPair_markov_identity hpub hN eig U c I degree | |
| amplitude n b (fun i => v (i + 1)) hb z Ο D hB hΟ hD) | |
| end InvariantIsing | |
| end | |
| end OAI | |