Download lean/OAI/NumberTheory/DukePrimeDegree/Entropy/CountableSparseFineObservation.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
theoremexists_countable_sparse_fine_observation
(μ : MeasureY) [IsProbabilityMeasure μ]
(e : Y ≃ₜ Y) (he : MeasurePreserving e μ μ)
(A : ℕ→SetY) (hA : ∀ i, MeasurableSet (A i))
(hfree : ∀ i x, x ∈A i →∀n : ℕ, 0 < n → (e^n) x ≠ x)
{d : ℕ} (f : ℕ→Y→Fin d →ℝ) (hf : ∀ i, Measurable (f i))
(R : ℕ→ℝ) (hR : ∀ i, 0≤R i)
(hbound : ∀ i x, x ∈A i →∀ j, |f i x j| ≤R i)
{ε : ℝ} (hε : 0 < ε) :
∃Q : Y→ℕ, MeasurableQ∧Summable (fun n =>Real.negMulLog (μ.real {x | Q x=n})) ∧
(∑' n, Real.negMulLog (μ.real {x | Q x=n})) < ε ∧∀ᵐ x ∂μ, ∀ i, x ∈A i →∀ y,
(∀k : ℕ, Q ((e^(k+1)) y)=Q ((e^(k+1)) x)) →∀η : ℝ, 0 < η →∃k : ℕ, (e^(k+1)) x ∈A i ∧ (e^(k+1)) y ∈A i ∧∀ j, |f i ((e^(k+1)) y) j-f i ((e^(k+1)) x) j| < η :=by
proof · 59
lines
obtain ⟨K,B,hB,hclose⟩ := exists_finite_prefix_chart_codes A hA f hf R hR hbound
obtain ⟨δ,hδ,hδs,_,Hδ⟩ := exists_lastActiveObservation_entropy_budget
(Y:=Y) K hε
choose ShS hSA hSm hcover using fun n : ℕ=>
exists_small_complete_orbit_section μ e he (hA n.unpair.1)
(hfree n.unpair.1) (hδ n)
havehsμ : (∑' n, μ (S n)) ≠∞:=by
apply ne_top_of_le_ne_top hδs.tsum_ofReal_ne_top
apply ENNReal.tsum_le_tsum
intro n
exact (ENNReal.le_ofReal_iff_toReal_le (measure_ne_top μ _) (hδ n).le).mpr (hSm n).le
have hfinite := ae_finite_setOfPred_mem hsμ
havehfiniteAll : ∀ᵐ x ∂μ, ∀k : ℕ, {n | (e^k) x ∈S n}.Finite:=
ae_all_iff.mpr fun k => (measurePreserving_homeomorph_pow μ e he k).quasiMeasurePreserving.ae hfinite
havehvisitAll : ∀ᵐ x ∂μ, ∀ n, x ∈A n.unpair.1→∀M : ℕ,
∃k : ℕ, M≤ k ∧ (e^k) x ∈S n :=
ae_all_iff.mpr fun n => ae_future_visits_of_orbit_section μ e he (hS n) (hcover n)
letI:=Option (Σ n : ℕ, Fin (K n))
let : MeasurableSpaceI:= ⊤
letQ : Y→ℕ:=fun x =>Encodable.encode (lastActiveObservation SB x)
havehQ : MeasurableQ:= (measurable_of_countable Encodable.encode).comp
(measurable_lastActiveObservation hS B hB)
have hcost :=Hδ μ S hS (fun n => (hSm n).le) B hB
have hencode := encoded_observation_information μ (lastActiveObservation SB)
refine ⟨Q,hQ,hencode.1.mpr hcost.1,hencode.2.trans_lt hcost.2,?_⟩
filter_upwards [hfiniteAll,hvisitAll] with x hxfin hxvisit
intro i hxA y hxy η hη
obtain ⟨p,hp⟩ := exists_nat_gt (2/η)
let n :=Nat.pair i p
havehindex : n.unpair.1=i :=by simp only [n,Nat.unpair_pair]
havehxA' : x ∈A n.unpair.1:=by rwa [hindex]
obtain ⟨k,hk,hkx⟩ := hxvisit n hxA' 1
obtain ⟨m,hnm,hm⟩ := lastActiveObservation_scale_ge SB (hxfin k) hkx
havehim : i ≤ m := (Nat.left_le_pair i p).trans hnm
havehpm : p ≤ m := (Nat.right_le_pair i p).trans hnm
havehkcode : lastActiveObservation SB ((e^k) y)=lastActiveObservation SB ((e^k) x) :=by
apply Encodable.encode_injective
have hh := hxy (k-1)
simpa only [Nat.sub_add_cancel hk] using hh
havehycode : lastActiveObservation SB ((e^k) y)=some ⟨m,B m ((e^k) x)⟩ := hkcode.trans hm
havehmy : (e^k) y ∈ lastActiveObservationAtom SB (some ⟨m,B m ((e^k) x)⟩) :=by
rw [←lastActiveObservation_fiber]
exact hycode
havehxmem : (e^k) x ∈A i :=byhaveH:= hSA n hkx
rwa [hindex] at H
obtain ⟨hymem,hfine⟩ := hclose m i him _ hxmem _ hmy.2
refine ⟨k-1,by simpa only [Nat.sub_add_cancel hk] using hxmem,
by simpa only [Nat.sub_add_cancel hk] using hymem,?_⟩
intro j
havehpmR : (p:ℝ) ≤ m :=by exact_mod_cast hpm
havehlarge : 2 < (p:ℝ)*η := (div_lt_iff₀ hη).mp hp
havehsmall : 2*(1/(m+1:ℝ)) < η :=byhavehd : (0:ℝ) < m+1:=by positivity
rw [mul_one_div]
apply (div_lt_iff₀ hd).mpr
nlinarith
haveH:= (hfine j).trans hsmall
simpa only [Nat.sub_add_cancel hk] usingH