import Mathlib import OAI.Analysis.Conductivity.Sobolev.SobolevGaugeTransform import OAI.Analysis.Conductivity.Walls.PhysicalTerminalCutoff namespace OAI section noncomputable section namespace ScalarConductivity open Set Filter Topology MeasureTheory Matrix UnitAddTorus attribute [local instance] Classical.propDecidable namespace PhysicalFiniteEndingData variable {s : Fin 3 → ℝ} (z : PhysicalFiniteEndingData s) lemma terminal_band_value (hs : ∀ x y : ℝ,(1/2)*(x^2+y^2)≤ s 0*x^2+2*s 1*x*y+s 2*y^2) {η : ℝ} (hη : 0<η) (hηc : 2*η physicalEndRegion_subset_ball i) filter_upwards [ae_all_iff.mpr hev,ae_all_iff.mpr (fun i => z.correctedEndValue_terminal_ae hs i j)] with y hv ht hy hn have hy' := (sourceOpenBlock_time_iff y).mp hy change 0 hn ⟨(lt_of_not_ge hp).le,h⟩ push Not at hn' obtain ⟨k,hk⟩ := hn' have hc : terminalTime k.succ y≤0 := (hy'.2 k).le have hek : y∈physicalEndRegion k.succ := by change -centralThickness≤terminalTime k.succ y ∧ terminalTime k.succ y≤0 exact ⟨by linarith,hc⟩ have hTa : |terminalTime k.succ y|≤η := by rw [abs_of_nonpos hc]; linarith have hh := (hv k.succ hek).trans (ht k.succ hek (hT k.succ _ hTa).le) rw [z.terminalProfile_child_band hη hηc j k hk.le,min_eq_left hc] linarith theorem source_patch_exists (hs : ∀ x y : ℝ,(1/2)*(x^2+y^2)≤ s 0*x^2+2*s 1*x*y+s 2*y^2) {η : ℝ} (hη : 0<η) (hηc : 2*η ℝ) have hχd : ContDiff ℝ (↑(⊤:ℕ∞)) (χ ∘ E) := hχ.comp E.contDiff have hχcc : HasCompactSupport (χ ∘ E) := hχc.comp_homeomorph E.toHomeomorph have hχss : tsupport (χ ∘ E)⊆ball := by have hh : tsupport (χ ∘ E)⊆E ⁻¹' tsupport χ := closure_minimal (fun y hy => subset_tsupport χ hy) ((isClosed_tsupport χ).preimage E.continuous) intro x hx exact physicalOpenBlock_subset_ball (hχs (hh hx)) let u := w j-constantH1 (z.terminalValue 0 j)-f obtain ⟨v,hv,hvv⟩ := original_smooth_mul_exists hχd hχcc hχss u have hd : q j-w j∈H10 := by change (q j-w j).val∈zeroTraceAmbient rw [hq] exact voltageOriginalJetCLM_zeroTrace physicalOpenBlock_open.measurableSet (fun _ => physicalOpenBlock_subset_ball) j hZ have hband := ae_restrict_of_ae (s:=ball) ((PiLp.volume_preserving_ofLp (Fin 3)).quasiMeasurePreserving.ae (z.terminal_band_value hs hη hηc hT w he j)) have hdv : ∀ᵐ x∂ballMeasure,WithLp.ofLp x∉physicalOpenBlock → weakValue (q j-w j) x=0 := by have hz := voltageOriginalJetCLM_ae physicalOpenBlock_open.measurableSet j Z rw [←hq j] at hz filter_upwards [hz] with x hx hxn have hh := congrArg (fun f : JetFiber => f 0) hx change (q j-w j).val x 0=0 rw [hx,ite_eq_right hxn] rfl refine ⟨v+f+(q j-w j),H10.add_mem (H10.add_mem hv hf) hd,?_⟩ filter_upwards [hvv,hfv,hband,hdv,weakValue_add (v+f) (q j-w j),weakValue_add v f, weakValue_sub (w j-constantH1 (z.terminalValue 0 j)) f, (H1_sub_constant_spec (w j) (z.terminalValue 0 j)).1,weakValue_sub (q j) (w j)] with x hmv hfv hband hdv hsum hadd hu1 hu2 hd1 rw [hsum] simp only [Pi.add_apply] rw [hadd] simp only [Pi.add_apply] have hu : weakValue u x=weakValue (w j) x-z.terminalValue 0 j-z.terminalProfile η j (WithLp.ofLp x) := by change weakValue (w j-constantH1 (z.terminalValue 0 j)-f) x=_ rw [hu1,Pi.sub_apply,hu2,hfv] rw [hmv,hu,hfv] change χ (WithLp.ofLp x)*(weakValue (w j) x-z.terminalValue 0 j-z.terminalProfile η j (WithLp.ofLp x))+ z.terminalProfile η j (WithLp.ofLp x)+weakValue (q j-w j) x=_ by_cases hx : WithLp.ofLp x∈physicalOpenBlock · rw [ite_eq_left hx,hd1] simp only [Pi.sub_apply] by_cases hc : WithLp.ofLp x∈terminalCore η · rw [hχ1 _ hc]; ring · have hh := hband hx hc simp only [WithLp.toLp_ofLp] at hh rw [show weakValue (w j) x-z.terminalValue 0 j-z.terminalProfile η j (WithLp.ofLp x)=0 by linarith] linarith · rw [ite_eq_right hx,hdv hx] have hz : χ (WithLp.ofLp x)=0 := image_eq_zero_of_notMem_tsupport (fun hn => hx (hχs hn)) rw [hz] ring end PhysicalFiniteEndingData end ScalarConductivity end end end OAI