Download lean/OAI/MeasureTheory/SelfSimilar/CodingIntegrals.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 6.54 kB
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/MeasureTheory/SelfSimilar/CodingIntegrals.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/OAI/MeasureTheory/SelfSimilar/CodingIntegrals.lean
-
curl -L -o CodingIntegrals.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/MeasureTheory/SelfSimilar/CodingIntegrals.lean
6.54 kB
Lean 4 · 18
declarations statementsfull
local instance : MeasurableSpace ι := ⊤ local instance : MeasurableSingletonClass ι := ⟨fun _ => trivial⟩ theorem head_point_measurable (S : System ι) :
Measurable (fun ω : ℕ → ι => (ω 0,point S ω)) := proof · 1 line
(measurable_pi_apply 0).prodMk (point_measurable S)theorem head_point_law (S : System ι) :
(addressMeasure S).map (fun ω => (ω 0,point S ω)) =
∑ i, (Measure.dirac i).prod (S.component (law S) i) := by proof · 24 lines
classical
let f : ι × ℝ → ι × ℝ := fun z => (z.1,S.affine z.1 z.2)
have hf : Measurable f := by
apply measurable_fst.prodMk
exact (((measurable_of_finite S.ratio).comp measurable_fst).mul measurable_snd).add
((measurable_of_finite S.offset).comp measurable_fst)
have hh := congrArg (Measure.map f) (head_tail_point_law S)
have hp : Measurable (fun ω : ℕ → ι => (ω 0,point S (shift ω))) :=
(measurable_pi_apply 0).prodMk ((point_measurable S).comp shift_measurable)
rw [Measure.map_map hf hp] at hh
have he : f ∘ (fun ω => (ω 0,point S (shift ω))) = fun ω => (ω 0,point S ω) := by
funext ω
exact Prod.ext rfl (point_shift S ω).symm
rw [he] at hh
rw [hh]
change ((∑ i, ENNReal.ofReal (S.weight i) • Measure.dirac i).prod (law S)).map f = _
rw [← Measure.sum_fintype,Measure.prod_sum_left,Measure.sum_fintype,
Measure.map_finset_sum hf.aemeasurable]
apply Finset.sum_congr rfl
intro i _
rw [Measure.prod_smul_left,Measure.map_smul _ hf.aemeasurable,Measure.dirac_prod,
Measure.map_map hf measurable_prodMk_left,System.component,Measure.prod_smul_right,
Measure.dirac_prod,Measure.map_map measurable_prodMk_left (S.affine_continuous i).measurable]
rfltheorem ae_head_point (S : System ι) {P : ι → ℝ → Prop}
(hP : ∀ i, ∀ᵐ x ∂S.component (law S) i, P i x) :
∀ᵐ ω ∂addressMeasure S, P (ω 0) (point S ω) := by proof · 6 lines
have hh : ∀ᵐ z ∂(addressMeasure S).map (fun ω => (ω 0,point S ω)), P z.1 z.2 := by
rw [head_point_law,ae_finsetSum_measure_iff]
intro i _
rw [Measure.dirac_prod,(measurableEmbedding_prodMk_left i).ae_map_iff]
exact hP i
exact ae_of_ae_map (head_point_measurable S).aemeasurable hhtheorem integrable_head_point (S : System ι) {f : ι → ℝ → ℝ}
(hfm : ∀ i, Measurable (f i)) (hf : ∀ i, Integrable (f i) (S.component (law S) i)) :
Integrable (fun ω => f (ω 0) (point S ω)) (addressMeasure S) := by proof · 10 lines
have hm : Measurable (fun z : ι × ℝ => f z.1 z.2) :=
measurable_from_prod_countable_right hfm
have hi : Integrable (fun z : ι × ℝ => f z.1 z.2)
((addressMeasure S).map (fun ω => (ω 0,point S ω))) := by
rw [head_point_law,integrable_finsetSum_measure]
intro i _
rw [Measure.dirac_prod,integrable_map_measure hm.aestronglyMeasurable
measurable_prodMk_left.aemeasurable]
exact hf i
exact hi.comp_measurable (head_point_measurable S)noncomputable def envelope (S : System ι) (ω : ℕ → ι) : ℝ := body · 1 line
BallRatios.logEnvelope (law S) (S.component (law S) (ω 0)) (point S ω)theorem envelope_joint_measurable (S : System ι) : Measurable (fun z : ι × ℝ =>
BallRatios.logEnvelope (law S) (S.component (law S) z.1) z.2) := by proof · 3 lines
apply measurable_from_prod_countable_right
intro i
exact BallRatios.logEnvelope_measurable (law S) (S.component (law S) i)theorem envelope_measurable (S : System ι) : Measurable (envelope S) := by proof · 3 lines
unfold envelope
have hh := (envelope_joint_measurable S).comp (head_point_measurable S)
exact hhtheorem envelope_nonneg (S : System ι) (ω : ℕ → ι) : 0 ≤ envelope S ω := proof · 1 line
BallRatios.logEnvelope_nonneg _ _ _theorem envelope_integrable (S : System ι) : Integrable (envelope S) (addressMeasure S) := proof · 2 lines
integrable_head_point S (fun i => BallRatios.logEnvelope_measurable _ (S.component (law S) i))
(fun i => BallRatios.logEnvelope_integrable _ (S.component (law S) i))noncomputable def corr (S : System ι) (n : ℕ) (ω : ℕ → ι) : ℝ := body · 1 line
BallRatios.logRatio (law S) (S.component (law S) (ω 0)) (point S ω) |slope S ω n|noncomputable def corrLimit (S : System ι) (ω : ℕ → ι) : ℝ := body · 1 line
Real.log ((law S).rnDeriv (S.component (law S) (ω 0)) (point S ω)).toRealtheorem corr_joint_measurable (S : System ι) : Measurable (fun z : ι × (ℝ × ℝ) =>
BallRatios.logRatio (law S) (S.component (law S) z.1) z.2.1 z.2.2) := by proof · 3 lines
apply measurable_from_prod_countable_right
intro i
exact BallRatios.logRatio_measurable (law S) (S.component (law S) i)theorem corr_measurable (S : System ι) (n : ℕ) : Measurable (corr S n) := by proof · 4 lines
unfold corr
have hh := (corr_joint_measurable S).comp ((measurable_pi_apply 0).prodMk
((point_measurable S).prodMk (slope_measurable S n).abs))
exact hhtheorem corrLimit_measurable (S : System ι) : Measurable (corrLimit S) := by proof · 6 lines
have hm : Measurable (fun z : ι × ℝ =>
Real.log ((law S).rnDeriv (S.component (law S) z.1) z.2).toReal) := by
apply measurable_from_prod_countable_right
intro i
exact ((law S).measurable_rnDeriv (S.component (law S) i)).ennreal_toReal.log
exact hm.comp (head_point_measurable S)theorem ae_corr_bounds (S : System ι) : ∀ᵐ ω ∂addressMeasure S, ∀ n : ℕ, 0 < n →
0 ≤ corr S n ω ∧ corr S n ω ≤ envelope S ω := by proof · 4 lines
filter_upwards [ae_head_point S (fun i => BallRatios.logRatio_bounds _ _
(S.component_le _ (law_selfSimilar S) i))] with ω hω
intro n hn
exact hω _ (abs_slope_pos S ω n) (abs_slope_lt_one S ω hn)theorem ae_corr_limit (S : System ι) : ∀ᵐ ω ∂addressMeasure S,
Tendsto (fun n => corr S n ω) atTop (𝓝 (corrLimit S ω)) := by proof · 5 lines
filter_upwards [ae_head_point S (fun i => BallRatios.ae_logRatio_limit _ _
(S.component_le _ (law_selfSimilar S) i))] with ω hω
apply hω.2.comp
exact tendsto_nhdsWithin_iff.mpr ⟨slope_tendsto_zero S ω,
Eventually.of_forall (abs_slope_pos S ω)⟩Outline
- instance
20 - instance
21 - theorem
head_point_measurable23 - theorem
head_point_law27 - theorem
ae_head_point55 - theorem
integrable_head_point65 - def
envelope79 - theorem
envelope_joint_measurable82 - theorem
envelope_measurable88 - theorem
envelope_nonneg94 - theorem
envelope_integrable97 - def
corr101 - def
corrLimit104 - theorem
corr_joint_measurable107 - theorem
corr_measurable113 - theorem
corrLimit_measurable119 - theorem
ae_corr_bounds127 - theorem
ae_corr_limit134