introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
8.56 kB
import Mathlib
namespace OAI
section
noncomputable section
open Set Filter
open scoped Topology
namespace ElasticityBoundary
attribute [local instance] 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