Download data/lean/OAI/MathematicalPhysics/AlternatingFlow/DecoderBounds.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 5.11 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MathematicalPhysics/AlternatingFlow/DecoderBounds.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/MathematicalPhysics/AlternatingFlow/DecoderBounds.lean
-
curl -L -o DecoderBounds.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MathematicalPhysics/AlternatingFlow/DecoderBounds.lean
5.11 kB
| import OAI.MathematicalPhysics.AlternatingFlow.EffectiveProfiles | |
| import OAI.MathematicalPhysics.AlternatingFlow.Names | |
| namespace OAI | |
| section DecoderBoundsDevelopment | |
| open scoped BigOperators Topology ContDiff | |
| open Filter | |
| namespace AlternatingNS.Quantitative | |
| lemma linear_id_jet (r : β) {x : β} (hx : |x| β€ 1) : |iteratedDeriv r id x| β€ 1 := by | |
| rw [iteratedDeriv_id]; split_ifs <;> simp_all | |
| lemma transition_affine (r : β) (a d : β) : | |
| iteratedDeriv r (fun x => Real.smoothTransition ((x-a)/d)) = | |
| fun x => dβ»ΒΉ ^ r * iteratedDeriv r Real.smoothTransition ((x-a)/d) := by | |
| have h : (fun x => Real.smoothTransition ((x-a)/d)) = | |
| (fun x => Real.smoothTransition (dβ»ΒΉ * (x-a))) := by funext x; congr 1; ring | |
| rw [h, iteratedDeriv_comp_sub_const r (fun z => Real.smoothTransition (dβ»ΒΉ * z)) a, | |
| iteratedDeriv_comp_const_mul | |
| (Real.smoothTransition.contDiff.of_le (WithTop.coe_le_coe.mpr le_top))] | |
| simp only [div_eq_mul_inv, mul_comm] | |
| lemma periodizer_jet_bound (r : β) (a c : β) (ha : 0 < a) (hac : a < c) (hc : c < 1) | |
| (x : β) : | |
| βiteratedFDeriv β r (Profiles.periodizer a c) xβ β€ | |
| 1 + (c-a)β»ΒΉ ^ r * transitionBound r := by | |
| rw [norm_iteratedFDeriv_eq_norm_iteratedDeriv, Real.norm_eq_abs] | |
| have hnon : 0 β€ (c-a)β»ΒΉ ^ r * (transitionBound r : β) := by positivity | |
| by_cases hx : x = (βxβ : β) | |
| Β· have he : Profiles.periodizer a c =αΆ [π x] (fun y => y - (βxβ : β)) := by | |
| have hlo : (βxβ : β) + (c - 1) < x := by linarith | |
| have hhi : x < (βxβ : β) + a := by linarith | |
| filter_upwards [Ioo_mem_nhds hlo hhi] with y hy | |
| have hy' : y - (βxβ : β) β Set.Ioo (c - 1) a := by | |
| constructor <;> linarith [hy.1, hy.2] | |
| calc | |
| Profiles.periodizer a c y = Profiles.periodizer a c ((βxβ : β) + (y - (βxβ : β))) := by congr 1; ring | |
| _ = Profiles.periodizer a c (y - (βxβ : β)) := Profiles.periodizer_int_add a c _ _ | |
| _ = y - (βxβ : β) := Profiles.periodizer_near_zero a c ha hac hc _ hy' | |
| rw [he.iteratedDeriv_eq r] | |
| change |iteratedDeriv r (fun y => id (y - (βxβ : β))) x| β€ _ | |
| rw [iteratedDeriv_comp_sub_const] | |
| exact (linear_id_jet r (by rw [hx]; simp)).trans (le_add_of_nonneg_right hnon) | |
| Β· have he : Profiles.periodizer a c =αΆ [π x] | |
| (fun y => (y - (βxβ : β)) - Real.smoothTransition ((y - (βxβ : β)-a)/(c-a))) := by | |
| have hlo : (βxβ : β) < x := (Int.floor_le x).lt_of_ne (Ne.symm hx) | |
| filter_upwards [Ioo_mem_nhds hlo (Int.lt_floor_add_one x)] with y hy | |
| have hy' : βyβ = βxβ := Int.floor_eq_iff.2 β¨hy.1.le, hy.2β© | |
| simp only [Profiles.periodizer, Int.fract, hy'] | |
| rw [he.iteratedDeriv_eq r] | |
| change |iteratedDeriv r (fun y => ((id : β β β) - fun z => Real.smoothTransition ((z-a)/(c-a))) | |
| (y - (βxβ : β))) x| β€ _ | |
| rw [iteratedDeriv_comp_sub_const] | |
| dsimp only | |
| rw [iteratedDeriv_sub contDiffAt_id | |
| (show ContDiffAt β (r : ββΟ) (fun z => Real.smoothTransition ((z-a)/(c-a))) (x - (βxβ : β)) from by fun_prop), | |
| transition_affine] | |
| calc | |
| _ β€ |iteratedDeriv r id (x - (βxβ : β))| + | |
| (c-a)β»ΒΉ ^ r * |iteratedDeriv r Real.smoothTransition ((x - (βxβ:β)-a)/(c-a))| := by | |
| simpa only [Real.norm_eq_abs, abs_mul, abs_of_nonneg (pow_nonneg (inv_nonneg.mpr (sub_pos.mpr hac).le) r)] using | |
| norm_sub_le (iteratedDeriv r id (x - (βxβ : β))) | |
| ((c-a)β»ΒΉ ^ r * iteratedDeriv r Real.smoothTransition ((x - (βxβ:β)-a)/(c-a))) | |
| _ β€ _ := add_le_add (linear_id_jet r (by | |
| rw [abs_of_nonneg (sub_nonneg.mpr (Int.floor_le x))] | |
| linarith [Int.lt_floor_add_one x])) | |
| (mul_le_mul_of_nonneg_left | |
| (by simpa only [norm_iteratedFDeriv_eq_norm_iteratedDeriv, Real.norm_eq_abs] using | |
| transition_jet_bound r ((x - (βxβ:β)-a)/(c-a))) | |
| (pow_nonneg (inv_nonneg.mpr (sub_pos.mpr hac).le) r)) | |
| def decoderBound (b r : β) : β := 1 + (3 * (b - 1)) ^ r * transitionBound r | |
| lemma decoder_jet_bound (b : β) (hb : 2 β€ b) (r : β) (x : β) : | |
| βiteratedFDeriv β r (Profiles.decoder b) xβ β€ decoderBound b r := by | |
| have hm0 := Encoding.tailMax_nonneg b hb | |
| have hm1 := Encoding.tailMax_lt_one b hb | |
| have hgap : (((Encoding.tailMax b + 2) / 3) - ((2 * Encoding.tailMax b + 1) / 3))β»ΒΉ = | |
| (3 * (b - 1) : β) := by | |
| have hbn : (b - 1 : β) = (b : β) - 1 := by exact_mod_cast Nat.cast_sub (by omega : 1 β€ b) | |
| rw [Nat.cast_mul, hbn] | |
| have h : (b : β) - 1 β 0 := by | |
| have hb' : (2 : β) β€ b := by exact_mod_cast hb | |
| linarith | |
| unfold Encoding.tailMax | |
| field_simp | |
| ring | |
| have h := periodizer_jet_bound r ((2 * Encoding.tailMax b + 1) / 3) | |
| ((Encoding.tailMax b + 2) / 3) (by linarith) (by linarith) (by linarith) x | |
| rw [hgap] at h | |
| simpa only [Profiles.decoder, decoderBound, Nat.cast_add, Nat.cast_mul, Nat.cast_one, Nat.cast_pow] using h | |
| end AlternatingNS.Quantitative | |
| end DecoderBoundsDevelopment | |
| end OAI | |