File size: 4,504 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 | 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
|