Download data/lean/OAI/Analysis/DirectCrouzeix/DividedDifferences.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 8.32 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/DirectCrouzeix/DividedDifferences.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/DirectCrouzeix/DividedDifferences.lean
-
curl -L -o DividedDifferences.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/DirectCrouzeix/DividedDifferences.lean
8.32 kB
| import OAI.Analysis.DirectCrouzeix.CompactIntegrals | |
| namespace OAI | |
| noncomputable section | |
| open scoped Matrix Matrix.Norms.L2Operator Kronecker | |
| noncomputable section | |
| open MeasureTheory Set Filter Metric | |
| open scoped Topology Interval ENNReal NNReal ComplexConjugate | |
| namespace DirectCrouzeix.Faber | |
| def divided (g : β β β) (u v : β) : β := chordIntegral (deriv g) (fun _ => 1) u v | |
| def dividedLeft (g : β β β) (u v : β) : β := | |
| chordIntegral (deriv (deriv g)) (fun t => (1-(t:β) : β)) u v | |
| def chordDenominator (c : β) (g : β β β) (u v : β) : β := c-u*v*divided g u v | |
| def correction (c : β) (g : β β β) (u v : β) : β := | |
| u*v*(divided g u v+u*dividedLeft g u v) / chordDenominator c g u v | |
| theorem divided_eq_dslope {s : Set β} (hconv : Convex β s) | |
| {g : β β β} (hg : AnalyticOnNhd β g s) {u v : β} (hu : u β s) (hv : v β s) : | |
| divided g u v = dslope g v u := chordIntegral_deriv_eq_dslope hconv hg hu hv | |
| theorem hasDerivAt_divided_left {s : Set β} (hs : IsOpen s) (hconv : Convex β s) | |
| {g : β β β} (hg : AnalyticOnNhd β g s) {u v : β} (hu : u β s) (hv : v β s) : | |
| HasDerivAt (fun z => divided g z v) (dividedLeft g u v) u := by | |
| simpa only [divided, dividedLeft, one_mul] using | |
| hasDerivAt_chordIntegral_left hs hconv hg.deriv (continuous_const (y := (1:β))) hu hv | |
| theorem continuousOn_correction {s : Set β} (hs : IsOpen s) (hconv : Convex β s) | |
| {g : β β β} (hg : AnalyticOnNhd β g s) {c : β} | |
| (hH : β u β s, β v β s, chordDenominator c g u v β 0) : | |
| ContinuousOn (fun p : β Γ β => correction c g p.1 p.2) (s ΓΛ’ s) := by | |
| have hD := continuousOn_chordIntegral hs hconv hg.deriv.continuousOn (continuous_const (y := (1:β))) | |
| have hE := continuousOn_chordIntegral hs hconv hg.deriv.deriv.continuousOn | |
| (show Continuous (fun t : Parameter => ((1-(t:β) : β):β)) by fun_prop) | |
| exact ((continuous_fst.mul continuous_snd).continuousOn.mul | |
| (hD.add (continuous_fst.continuousOn.mul hE))).div | |
| (continuousOn_const.sub ((continuous_fst.mul continuous_snd).continuousOn.mul hD)) | |
| (fun p hp => hH p.1 hp.1 p.2 hp.2) | |
| theorem analyticOnNhd_correction_left {s : Set β} (hs : IsOpen s) (hconv : Convex β s) | |
| {g : β β β} (hg : AnalyticOnNhd β g s) {c v : β} (hv : v β s) | |
| (hH : β u β s, chordDenominator c g u v β 0) : | |
| AnalyticOnNhd β (fun u => correction c g u v) s := by | |
| have hD := analyticOnNhd_chordIntegral_left hs hconv hg.deriv (continuous_const (y := (1:β))) hv | |
| have hE := analyticOnNhd_chordIntegral_left hs hconv hg.deriv.deriv | |
| (show Continuous (fun t : Parameter => ((1-(t:β) : β):β)) by fun_prop) hv | |
| intro u hu | |
| exact (((analyticAt_id.mul analyticAt_const).mul ((hD u hu).add (analyticAt_id.mul (hE u hu)))).div | |
| (analyticAt_const.sub ((analyticAt_id.mul analyticAt_const).mul (hD u hu))) (hH u hu)) | |
| theorem analyticOnNhd_correction_right {s : Set β} (hs : IsOpen s) (hconv : Convex β s) | |
| {g : β β β} (hg : AnalyticOnNhd β g s) {c u : β} (hu : u β s) | |
| (hH : β v β s, chordDenominator c g u v β 0) : | |
| AnalyticOnNhd β (correction c g u) s := by | |
| have hD := analyticOnNhd_chordIntegral_right hs hconv hg.deriv (continuous_const (y := (1:β))) hu | |
| have hE := analyticOnNhd_chordIntegral_right hs hconv hg.deriv.deriv | |
| (show Continuous (fun t : Parameter => ((1-(t:β) : β):β)) by fun_prop) hu | |
| intro v hv | |
| exact (((analyticAt_const.mul analyticAt_id).mul ((hD v hv).add (analyticAt_const.mul (hE v hv)))).div | |
| (analyticAt_const.sub ((analyticAt_const.mul analyticAt_id).mul (hD v hv))) (hH v hv)) | |
| @[simp] theorem correction_zero_left (c : β) (g : β β β) (v : β) : correction c g 0 v = 0 := by | |
| simp [correction] | |
| @[simp] theorem correction_zero_right (c : β) (g : β β β) (u : β) : correction c g u 0 = 0 := by | |
| simp [correction] | |
| def exterior (c : β) (g : β β β) (ΞΆ : β) := c*ΞΆ+g ΞΆβ»ΒΉ | |
| theorem hasDerivAt_exterior {s : Set β} {g : β β β} (hg : AnalyticOnNhd β g s) | |
| (c : β) {ΞΆ : β} (hΞΆ : ΞΆ β 0) (hΞΆs : ΞΆβ»ΒΉ β s) : | |
| HasDerivAt (exterior c g) (c-ΞΆβ»ΒΉ^2*deriv g ΞΆβ»ΒΉ) ΞΆ := by | |
| have hd := ((hasDerivAt_id ΞΆ).const_mul c).add | |
| ((hg ΞΆβ»ΒΉ hΞΆs).differentiableAt.hasDerivAt.comp ΞΆ (hasDerivAt_inv hΞΆ)) | |
| change HasDerivAt (fun z => exterior c g z) _ ΞΆ | |
| simpa only [exterior, Function.comp_def, id_eq, mul_one, Pi.add_apply, inv_pow, | |
| div_eq_mul_inv, sub_eq_add_neg, mul_neg, mul_comm, mul_left_comm] using! hd | |
| theorem chordDenominator_off_diagonal {s : Set β} (hconv : Convex β s) | |
| {g : β β β} (hg : AnalyticOnNhd β g s) (c : β) {u v : β} | |
| (hu : u β s) (hv : v β s) (hu0 : u β 0) (hv0 : v β 0) (huv : u β v) : | |
| chordDenominator c g u v = (exterior c g uβ»ΒΉ - exterior c g vβ»ΒΉ) / (uβ»ΒΉ-vβ»ΒΉ) := by | |
| rw [chordDenominator, divided_eq_dslope hconv hg hu hv, dslope_of_ne g huv] | |
| simp only [slope, smul_eq_mul, vsub_eq_sub, exterior, inv_inv] | |
| field_simp | |
| ring | |
| theorem chordDenominator_diagonal {s : Set β} (hconv : Convex β s) | |
| {g : β β β} (hg : AnalyticOnNhd β g s) (c : β) {u : β} (hu : u β s) : | |
| chordDenominator c g u u = c-u^2*deriv g u := by | |
| rw [chordDenominator, divided_eq_dslope hconv hg hu hu, dslope_same] | |
| ring | |
| theorem chordDenominator_ne_zero {s : Set β} (hconv : Convex β s) | |
| {g : β β β} (hg : AnalyticOnNhd β g s) {c : β} (hc : c β 0) | |
| (hinj : InjOn (exterior c g) (Inv.inv β»ΒΉ' s \ {0})) | |
| (hd : β ΞΆ, ΞΆ β 0 β ΞΆβ»ΒΉ β s β deriv (exterior c g) ΞΆ β 0) | |
| {u v : β} (hu : u β s) (hv : v β s) : chordDenominator c g u v β 0 := by | |
| by_cases hu0 : u = 0 | |
| Β· simp [chordDenominator, hu0, hc] | |
| by_cases hv0 : v = 0 | |
| Β· simp [chordDenominator, hv0, hc] | |
| by_cases huv : u = v | |
| Β· subst v | |
| rw [chordDenominator_diagonal hconv hg c hu] | |
| have hder := (hasDerivAt_exterior hg c (inv_ne_zero hu0) (by simpa using hu)).deriv | |
| have hn := hd uβ»ΒΉ (inv_ne_zero hu0) (by simpa using hu) | |
| rwa [hder,inv_inv] at hn | |
| Β· rw [chordDenominator_off_diagonal hconv hg c hu hv hu0 hv0 huv] | |
| exact div_ne_zero (sub_ne_zero.mpr (fun he => huv (inv_injective (hinj | |
| β¨by simpa using hu, by simpa using hu0β© β¨by simpa using hv, by simpa using hv0β© he)))) | |
| (sub_ne_zero.mpr (fun he => huv (inv_injective he))) | |
| theorem divided_fundamental {s : Set β} (hconv : Convex β s) | |
| {g : β β β} (hg : AnalyticOnNhd β g s) {u v : β} (hu : u β s) (hv : v β s) : | |
| (u-v)*divided g u v = g u-g v := by | |
| have hh := chordIntegral_deriv_mul hconv hg hu hv | |
| change divided g u v * (v-u) = _ at hh | |
| linear_combination -hh | |
| theorem divided_derivative_relation {s : Set β} (hs : IsOpen s) (hconv : Convex β s) | |
| {g : β β β} (hg : AnalyticOnNhd β g s) {u v : β} (hu : u β s) (hv : v β s) : | |
| divided g u v + (u-v)*dividedLeft g u v = deriv g u := by | |
| have hd := ((hasDerivAt_id u).sub_const v).mul (hasDerivAt_divided_left hs hconv hg hu hv) | |
| have he : (fun z => g z-g v) =αΆ [π u] (fun z => (z-v)*divided g z v) := by | |
| filter_upwards [hs.mem_nhds hu] with z hz | |
| exact (divided_fundamental hconv hg hz hv).symm | |
| have hid := (hd.congr_of_eventuallyEq he).unique ((hg u hu).differentiableAt.hasDerivAt.sub_const (g v)) | |
| simpa using hid | |
| theorem correction_identity {s : Set β} (hs : IsOpen s) (hconv : Convex β s) | |
| {g : β β β} (hg : AnalyticOnNhd β g s) (c : β) {u v : β} | |
| (hu : u β s) (hv : v β s) (hv0 : v β 0) (huv : u β v) | |
| (hH : chordDenominator c g u v β 0) : | |
| correction c g u v = (c-u^2*deriv g u)/(c+u*(g u-exterior c g vβ»ΒΉ)) - (1-u/v)β»ΒΉ := by | |
| have hD := divided_fundamental hconv hg hu hv | |
| have hE := divided_derivative_relation hs hconv hg hu hv | |
| have huv' : v-u β 0 := sub_ne_zero.mpr (Ne.symm huv) | |
| have he : c+u*(g u-exterior c g vβ»ΒΉ) = chordDenominator c g u v * (v-u)/v := by | |
| simp only [exterior,inv_inv,chordDenominator] | |
| field_simp | |
| linear_combination -u*v*hD | |
| rw [he,correction] | |
| have hd0 : chordDenominator c g u v * (v-u) / v β 0 := div_ne_zero (mul_ne_zero hH huv') hv0 | |
| field_simp | |
| simp only [chordDenominator] | |
| linear_combination -u^2*hE | |
| end DirectCrouzeix.Faber | |
| end | |
| end | |
| end OAI | |