Download data/lean/OAI/Analysis/DirectCrouzeix/ExponentialLevels.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.22 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/DirectCrouzeix/ExponentialLevels.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/DirectCrouzeix/ExponentialLevels.lean
-
curl -L -o ExponentialLevels.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/DirectCrouzeix/ExponentialLevels.lean
6.22 kB
| import OAI.Analysis.DirectCrouzeix.AnalyticCharts | |
| namespace OAI | |
| universe u_135 u_136 u_137 | |
| noncomputable section | |
| open scoped Matrix Matrix.Norms.L2Operator Kronecker | |
| noncomputable section | |
| open MeasureTheory Set Filter Metric | |
| open scoped Topology Interval ENNReal NNReal ComplexConjugate | |
| noncomputable section | |
| open Filter Metric Set | |
| open scoped Topology ComplexConjugate | |
| noncomputable section | |
| open Set Filter Metric | |
| open scoped Topology ComplexConjugate | |
| noncomputable section | |
| open Set Filter Metric | |
| open scoped Topology ComplexConjugate | |
| namespace DirectCrouzeix.Geometry | |
| variable {ΞΉ : Type u_135} [Fintype ΞΉ] | |
| def expGradient (v : ΞΉ β β) (b : ΞΉ β β) (z : β) : β := | |
| β i, Real.exp (inner β (v i) z+b i) β’ v i | |
| theorem expLevel_contDiff (v : ΞΉ β β) (b : ΞΉ β β) : ContDiff β β€ (expLevel v b) := by | |
| apply ContDiff.sum | |
| intro i hi | |
| exact ((innerSL β (v i)).contDiff.add contDiff_const).exp | |
| theorem expLevel_hasFDerivAt (v : ΞΉ β β) (b : ΞΉ β β) (z : β) : | |
| HasFDerivAt (expLevel v b) (innerSL β (expGradient v b z)) z := by | |
| have hh := HasFDerivAt.fun_sum (x := z) (u := Finset.univ) (fun i _ => | |
| (((innerSL β (v i)).hasFDerivAt).add_const (b i)).exp) | |
| convert! hh using 1 | |
| ext w | |
| simp only [expGradient,innerSL_apply_apply,sum_inner,real_inner_smul_left,sum_apply,smul_apply,smul_eq_mul] | |
| theorem expLevel_first_order (v : ΞΉ β β) (b : ΞΉ β β) (z w : β) : | |
| expLevel v b z + inner β (expGradient v b z) (w-z) β€ expLevel v b w := by | |
| have hh (i : ΞΉ) : | |
| Real.exp (inner β (v i) z+b i) + Real.exp (inner β (v i) z+b i)*inner β (v i) (w-z) β€ | |
| Real.exp (inner β (v i) w+b i) := by | |
| have ht := mul_le_mul_of_nonneg_left (Real.add_one_le_exp (inner β (v i) (w-z))) | |
| (Real.exp_nonneg (inner β (v i) z+b i)) | |
| rw [β Real.exp_add] at ht | |
| have he : inner β (v i) z+b i+inner β (v i) (w-z) = inner β (v i) w+b i := by | |
| rw [inner_sub_right]; ring | |
| rw [he] at ht | |
| linarith | |
| have hs := Finset.sum_le_sum (fun i (_ : i β Finset.univ) => hh i) | |
| simpa only [expLevel,expGradient,sum_inner,real_inner_smul_left,Finset.sum_add_distrib] using hs | |
| theorem expGradient_ne_zero (v : ΞΉ β β) (b : ΞΉ β β) {p a : β} | |
| (hp : expLevel v b p = 1) (ha : expLevel v b a < 1) : expGradient v b p β 0 := by | |
| intro he | |
| have hh := expLevel_first_order v b p a | |
| rw [he,inner_zero_left,hp,add_zero] at hh | |
| linarith | |
| theorem expLevel_convex (v : ΞΉ β β) (b : ΞΉ β β) : ConvexOn β univ (expLevel v b) := by | |
| refine β¨convex_univ,?_β© | |
| intro x hx y hy a c ha hc hac | |
| have hh (i : ΞΉ) := convexOn_exp.2 (show inner β (v i) x+b i β univ from mem_univ _) | |
| (show inner β (v i) y+b i β univ from mem_univ _) ha hc hac | |
| have he (i : ΞΉ) : inner β (v i) (a β’ x+c β’ y)+b i = | |
| a*(inner β (v i) x+b i)+c*(inner β (v i) y+b i) := by | |
| simp only [inner_add_right,inner_smul_right] | |
| have hb := congrArg (fun u : β => u*b i) hac | |
| nlinarith | |
| simp only [expLevel,he] | |
| simpa [smul_eq_mul,Finset.sum_add_distrib,Finset.mul_sum] using | |
| Finset.sum_le_sum (fun i (_ : i β Finset.univ) => hh i) | |
| end DirectCrouzeix.Geometry | |
| namespace DirectCrouzeix.Geometry | |
| variable {ΞΉ : Type u_136} [Fintype ΞΉ] | |
| def expComplex (Ξ± Ξ² Ξ³ : ΞΉ β β) (z : β Γ β) : β := | |
| β i, Complex.exp ((Ξ³ i:β)+(Ξ± i:β)*z.1+(Ξ² i:β)*z.2) | |
| theorem expComplex_analytic (Ξ± Ξ² Ξ³ : ΞΉ β β) (z : β Γ β) : AnalyticAt β (expComplex Ξ± Ξ² Ξ³) z := by | |
| apply Finset.analyticAt_fun_sum | |
| intro i hi | |
| exact ((analyticAt_const.add (analyticAt_const.mul analyticAt_fst)).add | |
| (analyticAt_const.mul analyticAt_snd)).cexp | |
| theorem expComplex_zero (Ξ± Ξ² Ξ³ : ΞΉ β β) : expComplex Ξ± Ξ² Ξ³ 0 = (β i, Real.exp (Ξ³ i):β) := by | |
| simp [expComplex,Complex.ofReal_exp] | |
| theorem expComplex_conj (Ξ± Ξ² Ξ³ : ΞΉ β β) (z : β Γ β) : | |
| expComplex Ξ± Ξ² Ξ³ (conj z.1,conj z.2) = conj (expComplex Ξ± Ξ² Ξ³ z) := by | |
| simp only [expComplex,map_sum] | |
| apply Finset.sum_congr rfl | |
| intro i hi | |
| rw [β Complex.exp_conj] | |
| congr 1 | |
| simp | |
| theorem expComplex_real (Ξ± Ξ² Ξ³ : ΞΉ β β) (x y : β) : | |
| expComplex Ξ± Ξ² Ξ³ (x,y) = (β i, Real.exp (Ξ³ i+Ξ± i*x+Ξ² i*y):β) := by | |
| simp [expComplex,Complex.ofReal_exp] | |
| theorem expComplex_hasFDerivAt_zero (Ξ± Ξ² Ξ³ : ΞΉ β β) : | |
| HasFDerivAt (expComplex Ξ± Ξ² Ξ³) | |
| (((β i, Real.exp (Ξ³ i)*Ξ± i : β):β) β’ ContinuousLinearMap.fst β β β + | |
| ((β i, Real.exp (Ξ³ i)*Ξ² i : β):β) β’ ContinuousLinearMap.snd β β β) 0 := by | |
| have hh := HasFDerivAt.fun_sum (x := (0:β Γ β)) (u := Finset.univ) (fun i _ => | |
| (((hasFDerivAt_const (Ξ³ i:β) (0:β Γ β)).add | |
| ((hasFDerivAt_fst (π := β) (p := (0:β Γ β))).const_mul (Ξ± i:β))).add | |
| ((hasFDerivAt_snd (π := β) (p := (0:β Γ β))).const_mul (Ξ² i:β))).cexp) | |
| convert! hh using 1 | |
| apply ContinuousLinearMap.ext | |
| intro z | |
| simp [Complex.ofReal_exp,Finset.sum_mul,Finset.sum_add_distrib,mul_assoc] | |
| end DirectCrouzeix.Geometry | |
| namespace DirectCrouzeix.Geometry | |
| theorem closure_strict_level {f : β β β} (hc : Continuous f) | |
| (hv : ConvexOn β univ f) {a : β} (ha : f a < 1) : | |
| closure {z | f z < 1} = {z | f z β€ 1} := by | |
| apply Subset.antisymm | |
| Β· apply closure_minimal | |
| Β· intro z hz | |
| exact (show f z < 1 from hz).le | |
| Β· exact isClosed_le hc continuous_const | |
| Β· intro z hz | |
| let y := fun t : β => (1-t) β’ z+t β’ a | |
| have hy : Continuous y := by fun_prop | |
| apply mem_closure_of_tendsto (b := π[>] (0:β)) ((hy.tendsto' 0 z (by simp [y])).mono_left nhdsWithin_le_nhds) | |
| filter_upwards [Ioo_mem_nhdsGT (by norm_num : (0:β)<1)] with t ht | |
| have hh := hv.2 (mem_univ z) (mem_univ a) (sub_nonneg.mpr (le_of_lt ht.2)) (le_of_lt ht.1) (sub_add_cancel 1 t) | |
| change f (y t) β€ (1-t)*f z+t*f a at hh | |
| change f (y t) < 1 | |
| have h1 := mul_le_mul_of_nonneg_left hz (sub_nonneg.mpr (le_of_lt ht.2)) | |
| have h2 := mul_lt_mul_of_pos_left ha ht.1 | |
| nlinarith | |
| end DirectCrouzeix.Geometry | |
| namespace DirectCrouzeix.Geometry | |
| variable {ΞΉ : Type u_137} [Fintype ΞΉ] | |
| end DirectCrouzeix.Geometry | |
| end | |
| end | |
| end | |
| end | |
| end | |
| end OAI | |