Download data/lean/OAI/Analysis/FiniteFactor/OrbitSampling/TestedTransport.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.5 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/FiniteFactor/OrbitSampling/TestedTransport.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/FiniteFactor/OrbitSampling/TestedTransport.lean
-
curl -L -o TestedTransport.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/FiniteFactor/OrbitSampling/TestedTransport.lean
4.5 kB
| import OAI.Analysis.FiniteFactor.OrbitSampling.SecondMarginal | |
| namespace OAI | |
| namespace FiniteFactor | |
| open MeasureTheory Filter Finset | |
| open scoped Classical ENNReal | |
| noncomputable section | |
| def sourceSamplingRectangle (E G : SourceCoordinate β Set β) : | |
| Set ((SourceCoordinate β β) Γ (SourceCoordinate β β)) := | |
| {p | β i, p.1 i β E i β§ p.2 i β G i} | |
| theorem sourceSamplingRectangle_measurable (E G : SourceCoordinate β Set β) | |
| (hE : β i, MeasurableSet (E i)) (hG : β i, MeasurableSet (G i)) : | |
| MeasurableSet (sourceSamplingRectangle E G) := by | |
| simp only [sourceSamplingRectangle,Set.ofPred_forall] | |
| apply MeasurableSet.iInter | |
| intro i | |
| exact ((hE i).preimage ((measurable_pi_apply i).comp measurable_fst)).inter | |
| ((hG i).preimage ((measurable_pi_apply i).comp measurable_snd)) | |
| theorem sourceSamplingProduct_first_indicator (I : Finset SourceCoordinate) (stage : β) | |
| (E G : SourceCoordinate β Set β) | |
| (houtside : β i β sourceSamplingPrefix stage, | |
| Set.Ico (0 : β) 1 β E i β§ Set.Ico (0 : β) 1 β G i) | |
| (ΞΈ x : SourceCoordinate β β) (n : β€) | |
| (hx : β i, x i β Set.Ico (0 : β) 1) : | |
| sourceSamplingProduct stage false (fun i => decide (i β I)) E G n ΞΈ x = | |
| if (x,coordinateRotate ΞΈ n x) β sourceSamplingRectangle E G | |
| then sourceSamplingWeight I stage ΞΈ n x else 0 := by | |
| have hy (i) : coordinateRotate ΞΈ n x i β Set.Ico (0 : β) 1 := | |
| β¨Int.fract_nonneg _,Int.fract_lt_one _β© | |
| have he : (β i β sourceSamplingPrefix stage, x i β E i β§ coordinateRotate ΞΈ n x i β G i) β | |
| (x,coordinateRotate ΞΈ n x) β sourceSamplingRectangle E G := by | |
| constructor | |
| Β· intro h i | |
| by_cases hi : i β sourceSamplingPrefix stage | |
| Β· exact h i hi | |
| Β· exact β¨(houtside i hi).1 (hx i),(houtside i hi).2 (hy i)β© | |
| Β· intro h i _ | |
| exact h i | |
| unfold sourceSamplingProduct samplingOrientedWeight samplingTestedFirstWeight | |
| simp only [Bool.false_eq_true,ite_false,β coordinateRotate_phase] | |
| simp only [Finset.prod_ite_zero,he] | |
| rfl | |
| /-- Inverse rotation exchanges the two actual tested product orientations. -/ | |
| theorem sourceSamplingProduct_second_inverse (I : Finset SourceCoordinate) (stage : β) | |
| (E G : SourceCoordinate β Set β) (ΞΈ y : SourceCoordinate β β) (n : β€) | |
| (hy : β i, y i β Set.Ico (0 : β) 1) : | |
| sourceSamplingProduct stage false (fun i => decide (i β I)) E G n ΞΈ | |
| (coordinateRotate ΞΈ (-n) y) = | |
| sourceSamplingProduct stage true (fun i => decide (i β I)) E G n ΞΈ y := by | |
| have hinv : coordinateRotate ΞΈ n (coordinateRotate ΞΈ (-n) y) = y := by | |
| simpa only [neg_neg] using coordinateRotate_neg_cube ΞΈ y (-n) hy | |
| apply Finset.prod_congr rfl | |
| intro i _ | |
| have hi := congrFun hinv i | |
| rw [coordinateRotate_phase] at hi | |
| simp only [samplingOrientedWeight,Bool.false_eq_true,ite_false,ite_true,samplingTestedFirstWeight,hi] | |
| rw [coordinateRotate_neg_phase] | |
| /-- The restricted orbit-pair summand is exactly the pushforward of its | |
| first tested product, with no assumed marginal law. -/ | |
| theorem sourceSamplingSummand_restrict_rectangle (I : Finset SourceCoordinate) (stage : β) | |
| (E G : SourceCoordinate β Set β) | |
| (hE : β i, MeasurableSet (E i)) (hG : β i, MeasurableSet (G i)) | |
| (houtside : β i β sourceSamplingPrefix stage, | |
| Set.Ico (0 : β) 1 β E i β§ Set.Ico (0 : β) 1 β G i) | |
| (ΞΈ : SourceCoordinate β β) (n : β€) : | |
| (sourceSamplingSummand I stage ΞΈ n).restrict (sourceSamplingRectangle E G) = | |
| (sourceSamplingHaar.withDensity (fun x => ENNReal.ofReal | |
| (sourceSamplingProduct stage false (fun i => decide (i β I)) E G n ΞΈ x))).map | |
| (fun x => (x,coordinateRotate ΞΈ n x)) := by | |
| have hp : Measurable (fun x : SourceCoordinate β β => (x,coordinateRotate ΞΈ n x)) := | |
| measurable_id.prodMk (coordinateRotate_preserving ΞΈ n).measurable | |
| have hR := sourceSamplingRectangle_measurable E G hE hG | |
| unfold sourceSamplingSummand sourceSamplingWeightedMeasure | |
| rw [Measure.restrict_map hp hR,restrict_withDensity (hp hR),β withDensity_indicator (hp hR)] | |
| congr 1 | |
| apply withDensity_congr_ae | |
| filter_upwards [sourceSamplingHaar_cube] with x hx | |
| rw [sourceSamplingProduct_first_indicator I stage E G houtside ΞΈ x n hx] | |
| change (if (x,coordinateRotate ΞΈ n x) β sourceSamplingRectangle E G | |
| then ENNReal.ofReal (sourceSamplingWeight I stage ΞΈ n x) else 0) = _ | |
| split_ifs <;> simp | |
| end | |
| end FiniteFactor | |
| end OAI | |