File size: 5,878 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 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | import OAI.Analysis.FiniteFactor.Sampling.Rectangle
import OAI.Analysis.FiniteFactor.OrbitSampling.Fourier
import OAI.Analysis.FiniteFactor.Sampling.Periodization
namespace OAI
namespace FiniteFactor
open MeasureTheory Finset Filter
open scoped ENNReal Topology
noncomputable section
/-- Every constructed power is long enough for density at most two on
every coordinate in the sampling prefix. -/
theorem sourceSampling_phase_length (s : β) (hs : 200000 β€ sourceBlockSize s)
(i : SourceCoordinate) (hi : i.1 β€ s) (n : β€) (hn : n β sourceSamplingPowers s) :
1 β€ (n : β)*sourceAngleUnit i := by
have hm : (200000 : β) β€ sourceBlockSize s := by exact_mod_cast hs
have hm0 := sourceBlockSize_pos s
have hspec := (sourceSamplingPowers_spec s hs).1 n hn
have hQ : (sourceBlockSize s : β)^3 β€ samplingQ (sourceBlockSize s) := by
unfold samplingQ
rw [β Real.rpow_natCast]
exact Real.rpow_le_rpow_of_exponent_le (by linarith) (by norm_num; linarith)
have hN : (sourceBlockSize i.1 : β)*(sourceStageState i.1).K β€ (sourceBlockSize s : β)^2 := by
have hh : (sourceBlockSize i.1 : β)*(sourceStageState i.1).K β€
(sourceBlockSize s : β)*(sourceStageState s).K := by exact_mod_cast sourceFrequencyScale_monotone hi
have hK : ((sourceStageState s).K : β) β€ sourceBlockSize s := by exact_mod_cast (sourceStage s).m_ge_K
nlinarith
have hnp : (sourceBlockSize i.1 : β)*(sourceStageState i.1).K β€ (n : β) := by
nlinarith [hspec.1,sq_nonneg (sourceBlockSize s : β)]
unfold sourceAngleUnit
rw [mul_one_div,le_div_iffβ (mul_pos (sourceBlockSize_pos i.1) (sourceCutoff_pos i.1)),one_mul]
exact hnp
theorem sourceSampling_phase_domination (s : β) (hs : 200000 β€ sourceBlockSize s)
(i : SourceCoordinate) (hi : i.1 β€ s) (n : β€) (hn : n β sourceSamplingPowers s) :
sourceAngleLaw.map (fun ΞΈ => Int.fract ((n : β)*ΞΈ i)) β€
(2 : ββ₯0β) β’ unitIntervalMeasure := by
have hp : Measurable (fun t : β => Int.fract ((n : β)*t)) :=
sourceFract_measurable.comp (measurable_const.mul measurable_id)
have he : sourceAngleLaw.map (fun ΞΈ => Int.fract ((n : β)*ΞΈ i)) =
(sourceAngleMarginal i).map (fun t => Int.fract ((n : β)*t)) := by
rw [β sourceAngleLaw_coordinate i,Measure.map_map hp (measurable_pi_apply i)]
rfl
rw [he]
have hnp : (0 : β) < n := by exact_mod_cast ((sourceSamplingPowers_spec s hs).1 n hn).2.2
have hh := (sourceAngle_phase_sandwich i (n : β) hnp).2
apply hh.trans
have hlen := sourceSampling_phase_length s hs i hi n hn
have hiR : 1/(n*sourceAngleUnit i) β€ (1 : β) := by
simpa using one_div_le_one_div_of_le (by norm_num : (0 : β) < 1) hlen
have heps : ENNReal.ofReal (1+1/(n*sourceAngleUnit i)) β€ (2 : ββ₯0β) := by
exact_mod_cast ENNReal.ofReal_le_ofReal (show 1+1/(n*sourceAngleUnit i) β€ (2 : β) by linarith)
gcongr
theorem samplingCharacter_pair_expression (v w : β€) (a b : β) :
samplingCharacter v a*samplingCharacter w b =
Complex.exp (2*Real.pi*Complex.I*((v : β)*(a : β)+(w : β)*(b : β))) := by
unfold samplingCharacter
rw [β Complex.exp_add]
congr 1
ring
/-- Rectangle discrepancy for the actual pair law of the deterministic
selected powers, with every probabilistic hypothesis discharged. -/
theorem sourceSampling_rectangle_bound (s : β) (hs : 200000 β€ sourceBlockSize s)
(i : SourceCoordinate) (hi : i.1 β€ s) (n n' : β€)
(hn : n β sourceSamplingPowers s) (hn' : n' β sourceSamplingPowers s) (hne : n β n')
(a b a' b' : β) :
|(sourceAngleLaw {ΞΈ | Int.fract ((n : β)*ΞΈ i) β Set.Icc a b β§
Int.fract ((n' : β)*ΞΈ i) β Set.Icc a' b'}).toReal -
(unitIntervalMeasure (Set.Icc a b)).toReal*(unitIntervalMeasure (Set.Icc a' b')).toReal| β€
26*(sourceBlockSize s : β)^(-80 : β) := by
let m := sourceBlockSize s
have hm0 : (0 : β) < m := sourceBlockSize_pos s
have hm1 : (1 : β) β€ m := by
have hm : (200000 : β) β€ m := by exact_mod_cast hs
linarith
let Ξ΄ : β := (m : β)^(-80 : β)
let Ξ΅ : β := Real.piβ»ΒΉ*(m : β)^(-1000 : β)
have hH : 0 < samplingH m := pow_pos (by exact_mod_cast hm0) 300
have hphase (n : β€) : Measurable (fun ΞΈ : SourceCoordinate β β => Int.fract ((n : β)*ΞΈ i)) :=
sourceFract_measurable.comp (measurable_const.mul (measurable_pi_apply i))
have hh := sampling_rectangle_discrepancy sourceAngleLaw _ _ (hphase n) (hphase n')
(sourceSampling_phase_domination s hs i hi n hn) (sourceSampling_phase_domination s hs i hi n' hn')
(samplingH m) hH a b a' b' Ξ΄ Ξ΅ (by dsimp [Ξ΄]; positivity) (by dsimp [Ξ΅]; positivity)
(fun v w hv hw hne' => by
simp_rw [samplingCharacter_pair_expression]
exact sourceSampling_pair_fourier_bound s hs i hi n n' hn hn' hne v w hv.le hw.le hne')
apply hh.trans
have htail : 1/(2*(samplingH m : β)*Ξ΄^2) = (1/2 : β)*(m : β)^(-140 : β) := by
dsimp [samplingH,Ξ΄]
norm_num [Real.rpow_neg,Real.rpow_ofNat,hm0.le]
field_simp
have hfour : (samplingH m : β)^2*Ξ΅ = Real.piβ»ΒΉ*(m : β)^(-400 : β) := by
dsimp [samplingH,Ξ΅]
norm_num [Real.rpow_neg,Real.rpow_ofNat,hm0.le]
field_simp
rw [htail,hfour]
have h140 : (m : β)^(-140 : β) β€ Ξ΄ := Real.rpow_le_rpow_of_exponent_le hm1 (by norm_num)
have h400 : (m : β)^(-400 : β) β€ Ξ΄ := Real.rpow_le_rpow_of_exponent_le hm1 (by norm_num)
have hpi : Real.piβ»ΒΉ β€ 1 := by simpa using one_div_le_one_div_of_le (by norm_num : (0 : β) < 1) (show 1 β€ Real.pi by linarith [Real.two_le_pi])
have hΞ΄ : 0 β€ Ξ΄ := by dsimp [Ξ΄]; positivity
have hp0 : 0 β€ (m : β)^(-400 : β) := by positivity
change 24*Ξ΄+1/2*(m : β)^(-140 : β)+Real.piβ»ΒΉ*(m : β)^(-400 : β) β€ 26*Ξ΄
nlinarith
end
end FiniteFactor
end OAI
|