Download data/lean/OAI/MathematicalPhysics/Elasticity/Extension.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 8.56 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MathematicalPhysics/Elasticity/Extension.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/MathematicalPhysics/Elasticity/Extension.lean
-
curl -L -o Extension.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/MathematicalPhysics/Elasticity/Extension.lean
8.56 kB
| import Mathlib | |
| namespace OAI | |
| section | |
| noncomputable section | |
| open Set Filter | |
| open scoped Topology | |
| namespace ElasticityBoundary | |
| Classical.propDecidable | |
| variable {E F : Type} [NormedAddCommGroup E] [NormedSpace β E] | |
| [NormedAddCommGroup F] [NormedSpace β F] | |
| lemma hasFDerivAt_piecewise (s : Set E) (f g : E β F) | |
| (hf : Differentiable β f) (hg : Differentiable β g) | |
| (hv : β x β frontier s, f x=g x) | |
| (hd : β x β frontier s, fderiv β f x=fderiv β g x) (x : E) : | |
| HasFDerivAt (s.piecewise f g) (s.piecewise (fderiv β f) (fderiv β g) x) x := by | |
| classical | |
| by_cases hb : x β frontier s | |
| Β· have hvf : s.piecewise f g x=f x := by | |
| by_cases hx : xβs | |
| Β· simp [hx] | |
| Β· simp [hx,hv x hb] | |
| have hvg : s.piecewise f g x=g x := hvf.trans (hv x hb) | |
| have hd' : s.piecewise (fderiv β f) (fderiv β g) x=fderiv β f x := by | |
| by_cases hx : xβs | |
| Β· simp [hx] | |
| Β· simp [hx,hd x hb] | |
| rw [hd'] | |
| have h1 : HasFDerivWithinAt (s.piecewise f g) (fderiv β f x) s x := | |
| (hf x).hasFDerivAt.hasFDerivWithinAt.congr (by intro y hy; simp [hy]) hvf | |
| have h2 : HasFDerivWithinAt (s.piecewise f g) (fderiv β f x) sαΆ x := by | |
| rw [hd x hb] | |
| exact (hg x).hasFDerivAt.hasFDerivWithinAt.congr (by intro y hy; exact piecewise_eq_of_notMem s f g hy) hvg | |
| simpa only [union_compl_self,hasFDerivWithinAt_univ] using h1.union h2 | |
| Β· by_cases hx : xβs | |
| Β· simp only [piecewise_eq_of_mem s _ _ hx] | |
| apply (hf x).hasFDerivAt.congr_of_eventuallyEq | |
| filter_upwards [mem_interior_iff_mem_nhds.mp ((mem_interior_iff_notMem_frontier hx).mpr hb)] with y hy | |
| simp [hy] | |
| Β· simp only [piecewise_eq_of_notMem s _ _ hx] | |
| apply (hg x).hasFDerivAt.congr_of_eventuallyEq | |
| have hi : xβinterior sαΆ := (mem_interior_iff_notMem_frontier hx).mpr (by simpa using hb) | |
| filter_upwards [mem_interior_iff_mem_nhds.mp hi] with y hy | |
| exact piecewise_eq_of_notMem s f g hy | |
| /-- Matching all actual FrΓ©chet jets gives smooth gluing across an arbitrary interface. -/ | |
| theorem smooth_piecewise_all_jets (s : Set E) (f g : E β F) | |
| (hf : ContDiff β (β€ : ββ) f) (hg : ContDiff β (β€ : ββ) g) | |
| (hj : β n : β, β xβfrontier s, iteratedFDeriv β n f x=iteratedFDeriv β n g x) : | |
| ContDiff β (β€ : ββ) (s.piecewise f g) := by | |
| classical | |
| have main : β n : β, β (F : Type) [NormedAddCommGroup F] [NormedSpace β F] | |
| (f g : E β F), ContDiff β (β€ : ββ) f β ContDiff β (β€ : ββ) g β | |
| (β m : β, β xβfrontier s, iteratedFDeriv β m f x=iteratedFDeriv β m g x) β | |
| ContDiff β n (s.piecewise f g) := by | |
| intro n | |
| induction n with | |
| | zero => | |
| intro F _ _ f g hf hg hj | |
| change ContDiff β 0 _ | |
| rw [contDiff_zero] | |
| apply Continuous.piecewise _ hf.continuous hg.continuous | |
| intro x hx | |
| have hh := congrArg (fun L => L (fun i : Fin 0 => ![] i)) (hj 0 x hx) | |
| simpa using hh | |
| | succ n ih => | |
| intro F _ _ f g hf hg hj | |
| have hd : β m : β, β xβfrontier s, | |
| iteratedFDeriv β m (fderiv β f) x=iteratedFDeriv β m (fderiv β g) x := by | |
| intro m x hx | |
| have hh := hj (m+1) x hx | |
| simp only [iteratedFDeriv_succ_eq_comp_right,Function.comp_apply] at hh | |
| exact (continuousMultilinearCurryRightEquiv' β m E F).symm.injective hh | |
| refine contDiff_succ_iff_hasFDerivAt.mpr β¨s.piecewise (fderiv β f) (fderiv β g), | |
| ih _ _ _ (hf.fderiv_right (by simp)) (hg.fderiv_right (by simp)) hd, ?_β© | |
| intro x | |
| apply hasFDerivAt_piecewise s f g (hf.differentiable (by simp)) (hg.differentiable (by simp)) | |
| Β· intro y hy | |
| have hh := congrArg (fun L => L (fun i : Fin 0 => ![] i)) (hj 0 y hy) | |
| simpa using hh | |
| Β· intro y hy | |
| have hh := congrArg (fun L => L (fun i : Fin 0 => ![] i)) (hd 0 y hy) | |
| simpa using hh | |
| exact contDiff_infty.mpr (fun n => main n F f g hf hg hj) | |
| end ElasticityBoundary | |
| end | |
| end | |
| section | |
| noncomputable section | |
| open Set Filter Metric | |
| open scoped Topology Manifold | |
| namespace ElasticityBoundary | |
| variable {E : Type} [NormedAddCommGroup E] [NormedSpace β E] [FiniteDimensional β E] | |
| lemma compact_smooth_cutoff {K U : Set E} (hK : IsCompact K) (hU : IsOpen U) (hKU : KβU) : | |
| β Ο : E β β, ContDiff β (β€ : ββ) Ο β§ HasCompactSupport Ο β§ tsupport ΟβU β§ | |
| (βαΆ x in πΛ’ K, Ο x=1) β§ β x, Ο xβIcc 0 1 := by | |
| obtain β¨R,hRβ© := hK.isBounded.subset_ball (0 : E) | |
| obtain β¨V,hV,hKV,hVUβ© := normal_exists_closure_subset hK.isClosed (hU.inter isOpen_ball) | |
| (show KβUβ©ball (0 : E) R from fun x hx => β¨hKU hx,hR hxβ©) | |
| obtain β¨Ο,hΟ,hzero,hbβ© := exists_contMDiffMap_one_nhds_of_subset_interior | |
| (π(β,E)) (n := (β€ : ββ)) hK.isClosed (by rwa [hV.interior_eq]) | |
| have hs : tsupport (Ο : E β β)βclosure V := by | |
| apply closure_mono | |
| intro x hx | |
| by_contra hn | |
| exact hx (hzero x hn) | |
| refine β¨Ο,Ο.contMDiff.contDiff,?_,fun x hx => (hVU (hs hx)).1,hΟ,hbβ© | |
| apply (isCompact_closedBall (0 : E) R).of_isClosed_subset (isClosed_tsupport Ο) | |
| exact fun x hx => ball_subset_closedBall ((hVU (hs hx)).2) | |
| omit [FiniteDimensional β E] in | |
| lemma contDiff_cutoff_mul {U : Set E} (hU : IsOpen U) (f Ο : E β β) | |
| (hf : ContDiffOn β (β€ : ββ) f U) (hΟ : ContDiff β (β€ : ββ) Ο) | |
| (hs : tsupport ΟβU) : ContDiff β (β€ : ββ) (fun x => Ο x*f x) := by | |
| rw [contDiff_iff_contDiffAt] | |
| intro x | |
| by_cases hx : xβU | |
| Β· exact hΟ.contDiffAt.mul ((hf x hx).contDiffAt (hU.mem_nhds hx)) | |
| Β· have hn : xβtsupport Ο := fun hh => hx (hs hh) | |
| have he := notMem_tsupport_iff_eventuallyEq.mp hn | |
| apply (contDiffAt_const (c := (0 : β))).congr_of_eventuallyEq | |
| filter_upwards [he] with y hy | |
| simp [hy] | |
| /-- A genuine global smooth extension, equal on a neighborhood of the compact set. -/ | |
| theorem smooth_global_extension {K U : Set E} (hK : IsCompact K) (hU : IsOpen U) | |
| (hKU : KβU) (f : E β β) (hf : ContDiffOn β (β€ : ββ) f U) : | |
| β F : E β β, ContDiff β (β€ : ββ) F β§ HasCompactSupport F β§ F =αΆ [πΛ’ K] f := by | |
| obtain β¨Ο,hΟ,hc,hs,h1,_β© := compact_smooth_cutoff hK hU hKU | |
| refine β¨fun x => Ο x*f x,contDiff_cutoff_mul hU f Ο hf hΟ hs,?_,?_β© | |
| Β· exact hc.mul_right | |
| Β· filter_upwards [h1] with x hx | |
| simp [hx] | |
| /-- Convex interpolation preserves both physical positivity inequalities. -/ | |
| theorem admissible_global_extension {K U : Set E} (hK : IsCompact K) (hU : IsOpen U) | |
| (hKU : KβU) (lam mu : E β β) | |
| (hl : ContDiffOn β (β€ : ββ) lam U) (hm : ContDiffOn β (β€ : ββ) mu U) | |
| (hp : β xβK, 0 < mu x β§ 0<3*lam x+2*mu x) : | |
| β L M : E β β, ContDiff β (β€ : ββ) L β§ ContDiff β (β€ : ββ) M β§ | |
| L =αΆ [πΛ’ K] lam β§ M =αΆ [πΛ’ K] mu β§ | |
| (β x,0 < M x β§ 0<3*L x+2*M x) β§ | |
| HasCompactSupport L β§ HasCompactSupport (fun x => M x-1) := by | |
| obtain β¨f,hf,_,hflβ© := smooth_global_extension hK hU hKU lam hl | |
| obtain β¨g,hg,_,hgmβ© := smooth_global_extension hK hU hKU mu hm | |
| let V := {x | 0<g x} β© {x | 0<3*f x+2*g x} | |
| have hV : IsOpen V := (isOpen_lt continuous_const hg.continuous).inter | |
| (isOpen_lt continuous_const ((continuous_const.mul hf.continuous).add (continuous_const.mul hg.continuous))) | |
| have hKV : KβV := by | |
| intro x hx | |
| change 0<g x β§ 0<3*f x+2*g x | |
| rw [hfl.self_of_nhdsSet hx,hgm.self_of_nhdsSet hx] | |
| exact hp x hx | |
| obtain β¨Ο,hΟ,hc,hs,h1,hbβ© := compact_smooth_cutoff hK hV hKV | |
| let L := fun x => Ο x*f x | |
| let M := fun x => Ο x*g x+(1-Ο x) | |
| refine β¨L,M,hΟ.mul hf,(hΟ.mul hg).add (contDiff_const.sub hΟ),?_,?_,?_,?_,?_β© | |
| Β· filter_upwards [h1,hfl] with x hx hy | |
| simp [L,hx,hy] | |
| Β· filter_upwards [h1,hgm] with x hx hy | |
| simp [M,hx,hy] | |
| Β· intro x | |
| by_cases hx : Ο x=0 | |
| Β· simp [L,M,hx] | |
| Β· have hv := hs (subset_tsupport Ο (show Ο xβ 0 from hx)) | |
| have hpos : 0<Ο x := lt_of_le_of_ne (hb x).1 (Ne.symm hx) | |
| have hle := (hb x).2 | |
| have hgpos := hv.1 | |
| have hpair := hv.2 | |
| change 0<Ο x*g x+(1-Ο x) β§ 0<3*(Ο x*f x)+2*(Ο x*g x+(1-Ο x)) | |
| constructor | |
| Β· nlinarith [mul_pos hpos hgpos] | |
| Β· nlinarith [mul_pos hpos hpair] | |
| Β· exact hc.mul_right | |
| Β· have he : (fun x => M x-1)=(fun x => Ο x*(g x-1)) := by funext x; dsimp [M]; ring | |
| rw [he] | |
| exact hc.mul_right | |
| end ElasticityBoundary | |
| end | |
| end | |
| end OAI | |