Download lean/OAI/Geometry/CAT0Fillings/Slicing/Profiles.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 4.63 kB
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Geometry/CAT0Fillings/Slicing/Profiles.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/OAI/Geometry/CAT0Fillings/Slicing/Profiles.lean
-
curl -L -o Profiles.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Geometry/CAT0Fillings/Slicing/Profiles.lean
4.63 kB
Lean 4 · 9
declarations statementsfull
noncomputable def profile (a : ℝ≥0) (t x : ℝ) : ℝ := body · 1 line
Real.smoothTransition ((a:ℝ) * (x-t))noncomputable def dprofile (a : ℝ≥0) (t x : ℝ) : ℝ := body · 1 line
(a:ℝ) * deriv Real.smoothTransition ((a:ℝ) * (x-t))lemma affine_lipschitz (a : ℝ≥0) (t : ℝ) :
LipschitzWith a (fun x : ℝ => (a:ℝ)*(x-t)) := by proof · 4 lines
apply LipschitzWith.of_dist_le_mul
intro x y
simp only [Real.dist_eq,←mul_sub,sub_sub_sub_cancel_right,abs_mul,abs_of_nonneg a.coe_nonneg]
exact le_rfllemma profile_hasDerivAt (a : ℝ≥0) (t x : ℝ) :
HasDerivAt (profile a t) (dprofile a t x) x := by proof · 5 lines
have hd := ((@Real.smoothTransition.contDiff 1).differentiable (by norm_num) ((a:ℝ)*(x-t))).hasDerivAt
change HasDerivAt (fun y => Real.smoothTransition ((a:ℝ)*(y-t)))
((a:ℝ)*deriv Real.smoothTransition ((a:ℝ)*(x-t))) x
simpa only [Function.comp_def,id_eq,mul_one,mul_comm] using
hd.comp x (((hasDerivAt_id x).sub_const t).const_mul (a:ℝ))lemma profile_bounds (a : ℝ≥0) (t x : ℝ) :
0 ≤ profile a t x ∧ profile a t x ≤ 1 := proof · 1 line
⟨Real.smoothTransition.nonneg _,Real.smoothTransition.le_one _⟩lemma profile_zero (a : ℝ≥0) {t x : ℝ} (hx : x ≤ t) : profile a t x = 0 := proof · 1 line
Real.smoothTransition.zero_of_nonpos (mul_nonpos_of_nonneg_of_nonpos a.coe_nonneg (sub_nonpos.mpr hx))lemma dprofile_zero {a : ℝ≥0} (ha : 0 < a) {t x : ℝ}
(hx : x ∉ Icc t (t+(a:ℝ)⁻¹)) : dprofile a t x = 0 := by proof · 13 lines
have ha' : 0 < (a:ℝ) := ha
have hnot : (a:ℝ)*(x-t) ∉ Icc 0 1 := by
intro h
apply hx
refine ⟨?_,?_⟩
· have : 0 ≤ x-t := (mul_nonneg_iff_of_pos_left ha').mp h.1
linarith
· have : x-t ≤ (a:ℝ)⁻¹ := by
rw [inv_eq_one_div]
apply (le_div_iff₀ ha').mpr
simpa [mul_comm] using h.2
linarith
simp [dprofile,deriv_transition_eq_zero hnot]lemma exists_profile_bounds : ∃ C : ℝ≥0, ∀ (a : ℝ≥0) (t : ℝ),
LipschitzWith (C*a) (profile a t) ∧
LipschitzWith (a*(C*a)) (dprofile a t) ∧
∀ x, |dprofile a t x| ≤ (C*a:ℝ≥0) := by proof · 11 lines
obtain ⟨C,hC,hD,hb⟩ := exists_lipschitz_transition
refine ⟨C,fun a t => ⟨hC.comp (affine_lipschitz a t),?_,?_⟩⟩
· change LipschitzWith (a*(C*a)) (fun x => (a:ℝ)*deriv Real.smoothTransition ((a:ℝ)*(x-t)))
simpa only [sub_zero,Function.comp_def] using
(affine_lipschitz a 0).comp (hD.comp (affine_lipschitz a t))
· intro x
simp only [dprofile,abs_mul,abs_of_nonneg a.coe_nonneg,NNReal.coe_mul]
calc
(a:ℝ) * |deriv Real.smoothTransition ((a:ℝ)*(x-t))| ≤ (a:ℝ)*C :=
mul_le_mul_of_nonneg_left (hb _) a.coe_nonneg
_ = (C:ℝ)*a := mul_comm _ _lemma profile_sequence_tendsto (t x : ℝ) :
Tendsto (fun n : ℕ => profile ((n:ℝ≥0)+1) t x) atTop
(𝓝 ((Ioi t).indicator (fun _ => (1:ℝ)) x)) := by proof · 12 lines
by_cases hx : t < x
· rw [indicator_of_mem (show x ∈ Ioi t from hx)]
have hlim : Tendsto (fun n : ℕ => ((n:ℝ)+1)*(x-t)) atTop atTop :=
(tendsto_atTop_add_const_right atTop 1 tendsto_natCast_atTop_atTop).atTop_mul_const (sub_pos.mpr hx)
have heq : (fun n : ℕ => profile ((n:ℝ≥0)+1) t x) =ᶠ[atTop] fun _ => (1:ℝ) := by
filter_upwards [hlim.eventually (eventually_ge_atTop 1)] with n hn
apply Real.smoothTransition.one_of_one_le
simpa only [NNReal.coe_add,NNReal.coe_natCast,NNReal.coe_one] using hn
exact tendsto_const_nhds.congr' heq.symm
· rw [indicator_of_notMem (show x ∉ Ioi t from hx)]
simpa only [profile_zero _ (le_of_not_gt hx)] using
(tendsto_const_nhds : Tendsto (fun _ : ℕ => (0:ℝ)) atTop (𝓝 0))Outline