File size: 4,103 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 | import OAI.Analysis.FiniteFactor.CrossedProduct.StageOperator
namespace OAI
namespace FiniteFactor
open MeasureTheory Filter Finset
open scoped ENNReal Topology
noncomputable section
theorem sourceCutoff_ge_shift (s n : β) :
2^n * (sourceStageState s).K β€ (sourceStageState (s+n)).K := by
induction n with
| zero => simp
| succ n ih =>
have hh := sourceStage_cutoff_growth (s+n)
rw [pow_succ, Nat.add_succ]
nlinarith
/-- The exact geometric tail estimate used in scales and tail trimming. -/
theorem sourceCutoff_tail_bound (s : β) :
(β' n : β, 1 / ((sourceStageState (s+n)).K : β)) β€
2 / ((sourceStageState s).K : β) := by
let b (n : β) : β := (1 / ((sourceStageState s).K : β)) * (1/2 : β)^n
have hb : Summable b := (summable_geometric_of_lt_one (by norm_num : (0 : β) β€ 1/2)
(by norm_num : (1/2 : β) < 1)).mul_left _
have hle (n : β) : 1 / ((sourceStageState (s+n)).K : β) β€ b n := by
have hh : (2 : β)^n * (sourceStageState s).K β€ (sourceStageState (s+n)).K :=
by exact_mod_cast sourceCutoff_ge_shift s n
have hp : (0 : β) < 2^n * (sourceStageState s).K := mul_pos (by positivity) (sourceCutoff_pos s)
have ht := one_div_le_one_div_of_le hp hh
simpa [b, one_div_pow, mul_comm, mul_left_comm] using ht
calc
_ β€ β' n, b n := (hb.of_nonneg_of_le (fun _ => by positivity) hle).tsum_le_tsum hle hb
_ = 2 / ((sourceStageState s).K : β) := by
rw [tsum_mul_left, tsum_geometric_of_lt_one (by norm_num : (0 : β) β€ 1/2) (by norm_num)]
ring
def sourceTailAngleSum (ΞΈ : SourceCoordinate β β) (s : β) : β :=
β' n : β, β i : Fin (sourceBlockSize (s+n)), ΞΈ β¨s+n,iβ©
theorem SourceAngles.tail_sum_bound {ΞΈ : SourceCoordinate β β} (hΞΈ : SourceAngles ΞΈ) (s : β) :
sourceTailAngleSum ΞΈ s β€ 4 / ((sourceStageState s).K : β) := by
have hb (n : β) :
(β i : Fin (sourceBlockSize (s+n)), ΞΈ β¨s+n,iβ©) β€ 2 / ((sourceStageState (s+n)).K : β) := by
have hh := Finset.sum_le_sum (fun i (_ : i β Finset.univ) => (hΞΈ β¨s+n,iβ©).2)
have he : (β _i : Fin (sourceBlockSize (s+n)),
2 / ((sourceBlockSize (s+n) : β)*(sourceStageState (s+n)).K)) =
2 / ((sourceStageState (s+n)).K : β) := by
simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul]
field_simp [(sourceBlockSize_pos (s+n)).ne', (sourceCutoff_pos (s+n)).ne']
exact hh.trans_eq he
have hs : Summable (fun n => 2 / ((sourceStageState (s+n)).K : β)) := by
have hh := sourceCutoff_reciprocal_summable.comp_injective (add_right_injective s)
simpa [div_eq_mul_inv] using hh.mul_left 2
calc
sourceTailAngleSum ΞΈ s β€ β' n, 2 / ((sourceStageState (s+n)).K : β) :=
(hs.of_nonneg_of_le (fun n => Finset.sum_nonneg (fun i _ => hΞΈ.nonneg _)) hb).tsum_le_tsum hb hs
_ = 2 * β' n, 1 / ((sourceStageState (s+n)).K : β) := by
rw [β tsum_mul_left]; congr; funext n; ring
_ β€ 2 * (2 / ((sourceStageState s).K : β)) :=
mul_le_mul_of_nonneg_left (sourceCutoff_tail_bound s) (by norm_num)
_ = 4 / ((sourceStageState s).K : β) := by ring
/-- The largest proposed sampling power divided by the next cutoff has the
source exponent gap 7/10 - 3/4 = -1/20. -/
theorem sourceSampling_tail_ratio (s : β) :
4 * (sourceBlockSize s : β)^((7/10 : β)*(sourceBlockSize s : β)) /
((sourceStageState (s+1)).K : β) β€
4 * (sourceBlockSize s : β)^(-(sourceBlockSize s : β)/20) := by
have hm := sourceBlockSize_pos s
have hK := sourceCutoff_pos (s+1)
have hc : (sourceBlockSize s : β)^((3/4 : β)*(sourceBlockSize s : β)) β€
(sourceStageState (s+1)).K := Nat.le_ceil _
apply (div_le_iffβ hK).mpr
calc
_ = (4 * (sourceBlockSize s : β)^(-(sourceBlockSize s : β)/20)) *
(sourceBlockSize s : β)^((3/4 : β)*(sourceBlockSize s : β)) := by
rw [mul_assoc, β Real.rpow_add hm]
congr 2
ring
_ β€ _ := mul_le_mul_of_nonneg_left hc (by positivity)
end
end FiniteFactor
end OAI
|