Buckets:
| import OAI.Probability.InvariantIsing.Fields.SpinPriorFieldDerivative | |
| import OAI.Probability.InvariantIsing.Fields.SpinPriorExponential | |
| import OAI.Probability.InvariantIsing.Arrays.TensorFieldDerivativeLaw | |
| namespace OAI | |
| /-! Independent Gaussian insertion for the actual constrained cascade. -/ | |
| noncomputable section | |
| open MeasureTheory ProbabilityTheory IsingPerceptron Set Filter | |
| open scoped BigOperators Topology | |
| namespace InvariantIsing | |
| def spinPriorFieldInsertedLog {N m k : ℕ} (π : Measure (Spin N)) (eig c : Fin N → ℝ) | |
| (I : Fin m → Finset (Fin N)) (degree : Fin k → Fin m → ℕ) (amp : Fin k → ℝ) | |
| (n : ℕ) (treeDegree : Fin k → ℕ) (h g : ℕ → ℝ) (a : ℝ) | |
| (p : TensorFlatDisorder N n × (ℕ → ℝ)) : ℝ := | |
| Real.log (∫ x : Spin N × LabeledLeaf n, Real.exp | |
| (tensorNamespacedHamiltonian eig c I degree amp n treeDegree h p.1 x + | |
| Real.sqrt a * cylinderField (tensorLinearCoefficients n g x) p.2) | |
| ∂labeledSpinReference n π p.1.1.2) | |
| lemma measurable_spinPriorFieldInsertedLog {N m k : ℕ} | |
| (π : Measure (Spin N)) [IsProbabilityMeasure π] (eig c : Fin N → ℝ) | |
| (I : Fin m → Finset (Fin N)) (degree : Fin k → Fin m → ℕ) (amp : Fin k → ℝ) | |
| (n : ℕ) (treeDegree : Fin k → ℕ) (h g : ℕ → ℝ) (a : ℝ) : | |
| Measurable (spinPriorFieldInsertedLog π eig c I degree amp n treeDegree h g a) := by | |
| let ν := fun p : TensorFlatDisorder N n × (ℕ → ℝ) => | |
| labeledSpinReference n π p.1.1.2 | |
| have : ∀ p, IsProbabilityMeasure (ν p) := fun p => by | |
| change IsProbabilityMeasure (labeledSpinReference n π p.1.1.2) | |
| infer_instance | |
| have hν : Measurable ν := | |
| (measurable_labeledSpinReference_general n π).comp | |
| measurable_fst.fst.snd | |
| have hm := (measurable_random_referencePartition hν | |
| (measurable_tensorFieldInsertedHamiltonian eig c I degree amp n treeDegree h g a)).log | |
| convert hm using 1 | |
| rfl | |
| lemma spinPriorFieldInsertedLog_conditional_law {N m k n : ℕ} | |
| (π : Measure (Spin N)) [IsProbabilityMeasure π] (eig c : Fin N → ℝ) | |
| (U : SpecialOrthogonal N) (T : LabeledTree n) | |
| (I : Fin m → Finset (Fin N)) (degree : Fin k → Fin m → ℕ) (amp : Fin k → ℝ) | |
| (treeDegree : Fin k → ℕ) (h g : ℕ → ℝ) | |
| (hh : Monotone h) (h0 : 0 ≤ h 0) (hg : Monotone g) (g0 : 0 ≤ g 0) | |
| (a : ℝ) (ha : 0 ≤ a) : | |
| (gaussianCoordinates.prod gaussianCoordinates).map (fun z : (ℕ → ℝ) × (ℕ → ℝ) => | |
| spinPriorFieldInsertedLog π eig c I degree amp n treeDegree h g a (((U,T),z.1),z.2)) = | |
| gaussianCoordinates.map (fun z => spinPriorNamespacedLog (n := n) π eig c I degree amp treeDegree | |
| (fun i => h i + a * g i) ((U,T),z)) := by | |
| let ν := labeledSpinReference n π T | |
| let H := fun x : Spin N × LabeledLeaf n => | |
| rotatedEnergy eig (specialRotation U) x.1 + fieldEnergy c x.1 | |
| let K := fun F : (Spin N × LabeledLeaf n → ℝ) => Real.log (∫ x, Real.exp (H x + F x) ∂ν) | |
| have : ∀ F : (Spin N × LabeledLeaf n → ℝ), IsProbabilityMeasure ((fun _ => ν) F) := | |
| fun _ => by change IsProbabilityMeasure ν; infer_instance | |
| have hE : Measurable (fun p : (Spin N × LabeledLeaf n → ℝ) × (Spin N × LabeledLeaf n) => | |
| H p.2 + p.1 p.2) := by | |
| apply measurable_from_prod_countable_left | |
| intro x | |
| have hx : Measurable (fun _ : Spin N × LabeledLeaf n → ℝ => H x) := measurable_const | |
| exact hx.add (measurable_pi_apply x) | |
| have hK : Measurable K := (measurable_random_referencePartition | |
| (ν := fun _ : Spin N × LabeledLeaf n → ℝ => ν) measurable_const hE).log | |
| let A : Spin N × LabeledLeaf n → ℕ →₀ ℝ := tensorNamespacedCoefficients (specialRotation U) I degree amp n | |
| (fun i => tensorPathProfile I degree n treeDegree h i) | |
| let B : Spin N × LabeledLeaf n → ℕ →₀ ℝ := tensorLinearCoefficients n g | |
| let C : Spin N × LabeledLeaf n → ℕ →₀ ℝ := tensorNamespacedCoefficients (specialRotation U) I degree amp n | |
| (fun i => tensorPathProfile I degree n treeDegree (fun j => h j + a * g j) i) | |
| have hf : Measurable (fun z : (ℕ → ℝ) × (ℕ → ℝ) => | |
| fun x => cylinderField (A x) z.1 + Real.sqrt a * cylinderField (B x) z.2) := | |
| Measurable.of_eval (fun x => ((measurable_cylinderField (A x)).comp measurable_fst).add | |
| (((measurable_cylinderField (B x)).comp measurable_snd).const_mul _)) | |
| have hc : Measurable (fun z => fun x => cylinderField (C x) z) := | |
| Measurable.of_eval (fun x => measurable_cylinderField (C x)) | |
| have he := cylinder_independent_sum_law A B C (Real.sqrt a) (fun x y => by | |
| rw [Real.sq_sqrt ha] | |
| exact tensorNamespacedPath_field_add_cross (specialRotation U) I degree amp n treeDegree h g hh h0 hg g0 a ha x y) | |
| have hl : (fun z : (ℕ → ℝ) × (ℕ → ℝ) => | |
| spinPriorFieldInsertedLog π eig c I degree amp n treeDegree h g a (((U,T),z.1),z.2)) = | |
| K ∘ (fun z => fun x => cylinderField (A x) z.1 + Real.sqrt a * cylinderField (B x) z.2) := by | |
| funext z | |
| apply congrArg Real.log | |
| apply integral_congr_ae | |
| refine ae_of_all _ fun x => ?_ | |
| apply congrArg Real.exp | |
| dsimp [tensorNamespacedHamiltonian, H, A, B] | |
| ring | |
| change _ = gaussianCoordinates.map (K ∘ (fun z => fun x => cylinderField (C x) z)) | |
| rw [hl, ← Measure.map_map hK hf, ← Measure.map_map hK hc, he] | |
| private lemma tensorField_joint_map_eq {Ω A B E : Type*} | |
| [MeasurableSpace Ω] [MeasurableSpace A] [MeasurableSpace B] [MeasurableSpace E] | |
| (P : Measure Ω) (Q : Measure A) (R : Measure B) [SFinite Q] [SFinite R] | |
| (f : Ω × A → E) (g : Ω × B → E) (hf : Measurable f) (hg : Measurable g) | |
| (he : ∀ ω, Q.map (fun z => f (ω,z)) = R.map (fun z => g (ω,z))) : | |
| (P.prod Q).map f = (P.prod R).map g := by | |
| apply Measure.ext | |
| intro s hs | |
| rw [Measure.map_apply hf hs, Measure.map_apply hg hs, | |
| Measure.prod_apply (hf hs), Measure.prod_apply (hg hs)] | |
| apply lintegral_congr_ae | |
| refine ae_of_all _ fun ω => ?_ | |
| have h := congrArg (fun ν : Measure E => ν s) (he ω) | |
| have hfω : Measurable (fun z => f (ω,z)) := hf.comp (measurable_const.prodMk measurable_id) | |
| have hgω : Measurable (fun z => g (ω,z)) := hg.comp (measurable_const.prodMk measurable_id) | |
| rw [Measure.map_apply hfω hs, Measure.map_apply hgω hs] at h | |
| exact h | |
| theorem spinPriorFieldInsertedLog_identDistrib {N m k : ℕ} | |
| (μ : Measure (SpecialOrthogonal N)) [IsProbabilityMeasure μ] | |
| (π : Measure (Spin N)) [IsProbabilityMeasure π] (eig c : Fin N → ℝ) | |
| (I : Fin m → Finset (Fin N)) (degree : Fin k → Fin m → ℕ) (amp : Fin k → ℝ) | |
| (n : ℕ) (b : ℕ → ℝ) (treeDegree : Fin k → ℕ) (h g : ℕ → ℝ) | |
| (hh : Monotone h) (h0 : 0 ≤ h 0) (hg : Monotone g) (g0 : 0 ≤ g 0) | |
| (a : ℝ) (ha : 0 ≤ a) : | |
| IdentDistrib (spinPriorFieldInsertedLog π eig c I degree amp n treeDegree h g a) | |
| (spinPriorNamespacedLog (n := n) π eig c I degree amp treeDegree (fun i => h i + a * g i)) | |
| (((μ.prod (labeledCascadeLaw n b : Measure (LabeledTree n))).prod gaussianCoordinates).prod gaussianCoordinates) | |
| ((μ.prod (labeledCascadeLaw n b : Measure (LabeledTree n))).prod gaussianCoordinates) := by | |
| let P := μ.prod (labeledCascadeLaw n b : Measure (LabeledTree n)) | |
| let F := fun p : (SpecialOrthogonal N × LabeledTree n) × ((ℕ → ℝ) × (ℕ → ℝ)) => | |
| spinPriorFieldInsertedLog π eig c I degree amp n treeDegree h g a ((p.1,p.2.1),p.2.2) | |
| let G := spinPriorNamespacedLog (n := n) π eig c I degree amp treeDegree (fun i => h i + a * g i) | |
| have hf : Measurable F := (measurable_spinPriorFieldInsertedLog π eig c I degree amp n treeDegree h g a).comp | |
| MeasurableEquiv.prodAssoc.symm.measurable | |
| have hg' : Measurable G := measurable_spinPriorNamespacedLog (n := n) π eig c I degree amp treeDegree _ | |
| have he := tensorField_joint_map_eq P (gaussianCoordinates.prod gaussianCoordinates) gaussianCoordinates | |
| F G hf hg' (fun ω => spinPriorFieldInsertedLog_conditional_law π eig c ω.1 ω.2 I degree amp treeDegree h g hh h0 hg g0 a ha) | |
| have hs := measurePreserving_prodAssoc P gaussianCoordinates gaussianCoordinates | |
| refine ⟨(measurable_spinPriorFieldInsertedLog π eig c I degree amp n treeDegree h g a).aemeasurable, | |
| hg'.aemeasurable, ?_⟩ | |
| change ((P.prod gaussianCoordinates).prod gaussianCoordinates).map | |
| (F ∘ (MeasurableEquiv.prodAssoc : ((SpecialOrthogonal N × LabeledTree n) × (ℕ → ℝ)) × | |
| (ℕ → ℝ) → (SpecialOrthogonal N × LabeledTree n) × ((ℕ → ℝ) × (ℕ → ℝ)))) = | |
| (P.prod gaussianCoordinates).map G | |
| rw [← Measure.map_map hf hs.measurable, hs.map_eq] | |
| exact he | |
| end InvariantIsing | |
| end | |
| end OAI | |
Xet Storage Details
- Size:
- 8.68 kB
- Xet hash:
- 7494569ba2a92f269ef8a009be8352d572f2b5b60a2dcc7fac6431157c528cc3
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.