Download data/lean/OAI/Dynamics/EntropyCounterexample/ClockPeriodization.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 5.8 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Dynamics/EntropyCounterexample/ClockPeriodization.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Dynamics/EntropyCounterexample/ClockPeriodization.lean
-
curl -L -o ClockPeriodization.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Dynamics/EntropyCounterexample/ClockPeriodization.lean
5.8 kB
| import Mathlib | |
| namespace OAI | |
| noncomputable section | |
| open Set Filter Function | |
| open scoped Topology ContDiff | |
| namespace Problem340.ClockPeriodization | |
| variable {E F : Type*} [NormedAddCommGroup E] [NormedSpace β E] | |
| [NormedAddCommGroup F] [NormedSpace β F] | |
| def periodize (P : β) (f : β Γ E β F) (x : β Γ E) : F := | |
| β' k : β€, f (x.1 - (k : β) * P, x.2) | |
| theorem contDiff_tsum_of_locallyFinite {ΞΉ : Type*} {f : ΞΉ β E β F} {n : ββΟ} | |
| (hf : β i, ContDiff β n (f i)) | |
| (hl : LocallyFinite (fun i => support (f i))) : | |
| ContDiff β n (fun x => β' i, f i x) := by | |
| have heq : (fun x => β' i, f i x) = (fun x => βαΆ i, f i x) := by | |
| funext x | |
| exact tsum_eq_finsum (hl.point_finite x) | |
| rw [heq] | |
| exact contMDiff_iff_contDiff.mp (contMDiff_finsum | |
| (fun i => contMDiff_iff_contDiff.mpr (hf i)) hl) | |
| theorem locallyFinite_clockIntervals {P : β} (hP : 0 < P) (a b : β) : | |
| LocallyFinite (fun k : β€ => Icc ((k : β) * P + a) ((k : β) * P + b)) := by | |
| apply locallyFinite_Icc_of_tendsto | |
| Β· exact (tendsto_intCast_atTop_atTop.atTop_mul_const hP).atTop_add tendsto_const_nhds | |
| Β· exact ((tendsto_intCast_atBot_iff.mpr tendsto_id).atBot_mul_const hP).atBot_add | |
| tendsto_const_nhds | |
| omit [NormedSpace β E] [NormedSpace β F] in | |
| theorem locallyFinite_translates {P a b : β} (hP : 0 < P) {f : β Γ E β F} | |
| (hsupport : β x, f x β 0 β x.1 β Icc a b) : | |
| LocallyFinite (fun k : β€ => support (fun x : β Γ E => | |
| f (x.1 - (k : β) * P, x.2))) := by | |
| refine ((locallyFinite_clockIntervals hP a b).preimage_continuous continuous_fst).subset ?_ | |
| intro k x hx | |
| have h := hsupport (x.1 - (k : β) * P, x.2) hx | |
| change (k : β) * P + a β€ x.1 β§ x.1 β€ (k : β) * P + b | |
| constructor <;> linarith [h.1, h.2] | |
| theorem contDiff_periodize {P a b : β} {n : ββΟ} (hP : 0 < P) | |
| {f : β Γ E β F} (hf : ContDiff β n f) | |
| (hsupport : β x, f x β 0 β x.1 β Icc a b) : | |
| ContDiff β n (periodize P f) := by | |
| apply contDiff_tsum_of_locallyFinite | |
| Β· intro k | |
| exact hf.comp ((contDiff_fst.sub contDiff_const).prodMk contDiff_snd) | |
| Β· exact locallyFinite_translates hP hsupport | |
| omit [NormedAddCommGroup E] [NormedSpace β E] [NormedSpace β F] in | |
| theorem periodize_add_period (P : β) (f : β Γ E β F) (t : β) (x : E) : | |
| periodize P f (t + P, x) = periodize P f (t, x) := by | |
| unfold periodize | |
| calc | |
| (β' k : β€, f (t + P - (k : β) * P, x)) = | |
| β' k : β€, f (t - ((k + -1 : β€) : β) * P, x) := by | |
| apply tsum_congr | |
| intro k | |
| apply congrArg (fun r : β => f (r, x)) | |
| push_cast | |
| ring | |
| _ = β' k : β€, f (t - (k : β) * P, x) := | |
| (Equiv.addRight (-1 : β€)).tsum_eq (fun k : β€ => f (t - (k : β) * P, x)) | |
| omit [NormedAddCommGroup E] [NormedSpace β E] [NormedSpace β F] in | |
| theorem periodize_eq_on_fundamental {P : β} (hP : 0 < P) {f : β Γ E β F} | |
| (hsupport : β x, f x β 0 β x.1 β Ioo 0 P) | |
| {t : β} (ht : t β Icc 0 P) (x : E) : | |
| periodize P f (t, x) = f (t, x) := by | |
| unfold periodize | |
| rw [tsum_eq_single (0 : β€)] | |
| Β· simp | |
| Β· intro k hk | |
| by_contra hne | |
| have h := hsupport (t - (k : β) * P, x) hne | |
| rcases lt_or_gt_of_ne hk with hkn | hkp | |
| Β· have hk1 : k β€ -1 := by omega | |
| have hk1' : (k : β) β€ -1 := by exact_mod_cast hk1 | |
| nlinarith [h.2, ht.1] | |
| Β· have hk1 : 1 β€ k := by omega | |
| have hk1' : 1 β€ (k : β) := by exact_mod_cast hk1 | |
| nlinarith [h.1, ht.2] | |
| omit [NormedAddCommGroup E] [NormedSpace β E] [NormedSpace β F] in | |
| theorem translate_index_unique {P a b : β} (hP : 0 < P) (hab : b - a β€ P) | |
| {f : β Γ E β F} (hsupport : β x, f x β 0 β x.1 β Ioo a b) | |
| {x : β Γ E} {k l : β€} | |
| (hk : f (x.1 - (k : β) * P, x.2) β 0) | |
| (hl : f (x.1 - (l : β) * P, x.2) β 0) : k = l := by | |
| have hk' := hsupport (x.1 - (k : β) * P, x.2) hk | |
| have hl' := hsupport (x.1 - (l : β) * P, x.2) hl | |
| by_contra hne | |
| rcases lt_or_gt_of_ne hne with hkl | hlk | |
| Β· have hij : k + 1 β€ l := by omega | |
| have hij' : (k : β) + 1 β€ (l : β) := by exact_mod_cast hij | |
| nlinarith [hk'.2, hl'.1] | |
| Β· have hij : l + 1 β€ k := by omega | |
| have hij' : (l : β) + 1 β€ (k : β) := by exact_mod_cast hij | |
| nlinarith [hl'.2, hk'.1] | |
| omit [NormedAddCommGroup E] [NormedSpace β E] [NormedSpace β F] in | |
| theorem norm_periodize_le {P a b C : β} (hP : 0 < P) (hab : b - a β€ P) | |
| (hC : 0 β€ C) {f : β Γ E β F} | |
| (hsupport : β x, f x β 0 β x.1 β Ioo a b) | |
| (hbound : β x, βf xβ β€ C) (x : β Γ E) : | |
| βperiodize P f xβ β€ C := by | |
| classical | |
| by_cases hex : β k : β€, f (x.1 - (k : β) * P, x.2) β 0 | |
| Β· obtain β¨k, hkβ© := hex | |
| have heq : periodize P f x = f (x.1 - (k : β) * P, x.2) := by | |
| apply tsum_eq_single k | |
| intro l hl | |
| by_contra hne | |
| exact hl (translate_index_unique hP hab hsupport hne hk) | |
| rw [heq] | |
| exact hbound _ | |
| Β· have hzero : β k : β€, f (x.1 - (k : β) * P, x.2) = 0 := by | |
| simpa using hex | |
| simpa only [periodize, hzero, tsum_zero, norm_zero] using hC | |
| omit [NormedAddCommGroup E] [NormedSpace β E] [NormedSpace β F] in | |
| theorem periodize_mem_Icc {P a b C : β} (hP : 0 < P) (hab : b - a β€ P) | |
| (hC : 0 β€ C) {f : β Γ E β β} | |
| (hsupport : β x, f x β 0 β x.1 β Ioo a b) | |
| (hbound : β x, f x β Icc 0 C) (x : β Γ E) : | |
| periodize P f x β Icc 0 C := by | |
| constructor | |
| Β· exact tsum_nonneg (fun k => (hbound _).1) | |
| Β· apply le_trans (le_abs_self _) | |
| exact norm_periodize_le hP hab hC hsupport | |
| (fun y => by simpa only [Real.norm_eq_abs, abs_of_nonneg (hbound y).1] | |
| using (hbound y).2) x | |
| end Problem340.ClockPeriodization | |
| end | |
| end OAI | |