import Mathlib import OAI.Geometry.CubicTorus.Profiles.NestingEndpointBound namespace OAI section section noncomputable section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology RealInnerProductSpace namespace CubicTorus theorem exists_smooth_seam_probability {L : ℝ} (hL : L∈Ioo 0 (1/2)) : ∃ β : ℝ →ℝ,ContDiff ℝ (⊤ : ℕ∞) β ∧Function.Periodic β 1 ∧ (∀ t,0≤β t) ∧(∫ t in (0 : ℝ)..1,β t)=1 ∧ (∀ t,|t|≤L →β t=0) ∧ (∀ t : ℝ,β t≠0 →dist (t : AxisCircle) ((1/2 : ℝ) : AxisCircle)<1/2-L) := by let r : ℝ := 1/2-L have hr : 0 linarith [hh.1,hh.2,hL.1] have hBc : HasCompactSupport B := IsCompact.of_isClosed_subset isCompact_Icc (isClosed_tsupport B) (fun _ ht ↦ ⟨(hBs ht).1.le,(hBs ht).2.le⟩) let β := circlePeriodize B have hβ : ContDiff ℝ (⊤ : ℕ∞) β := circlePeriodize_contDiff hB hBc have pβ : Function.Periodic β 1 := circlePeriodize_periodic B have he (t : ℝ) (ht : t∈Icc (0 : ℝ) 1) : β t=B t := (circlePeriodize_eventuallyEq hBc hBs (by convert ht using 1; norm_num)).eq_of_nhds have hnB (t : ℝ) (ht : B t≠0) : |t-1/2|.sub (differentiable_id.const_mul (2*k))) intro t rw [deriv_sub (hv.differentiable (by simp) t) ((differentiable_id.const_mul (2*k)) t), hd,deriv_const_mul _ (differentiableAt_id),deriv_id,mul_one] nlinarith [hβ0 t,mul_nonneg hk (hβ0 t)] have hs (a b : ℝ) (hab : a≤b) : v b-v a≤2*k*(b-a) := by have hh := hm hab dsimp only at hh linarith refine ⟨v,hv,pv,hd,hcentral,fun t ↦ ?_⟩ let x : ℝ := ((AddCircle.equivIco (1 : ℝ) (-L)) (t : AxisCircle) : ℝ) have hx := ((AddCircle.equivIco (1 : ℝ) (-L)) (t : AxisCircle)).property change -L≤x ∧ x< -L+1 at hx have hxt : (x : AxisCircle)=(t : AxisCircle) := (AddCircle.equivIco (1 : ℝ) (-L)).symm_apply_apply _ have hvt : v t=v x := by rw [←pv.lift_coe t,←pv.lift_coe x,hxt] rw [hvt] by_cases hxc : x≤L · rw [hcentral x (abs_le.mpr ⟨hx.1,hxc⟩),abs_mul,abs_of_nonneg (by positivity : 0≤2*k)] exact mul_le_mul_of_nonneg_left ((abs_le.mpr ⟨hx.1,hxc⟩).trans (by linarith [hL.2])) (by positivity) · have hvL : v L=2*k*L := hcentral L (by rw [abs_of_pos hL.1]) have hvR : v (1-L)= -2*k*L := by rw [show 1-L= -L+1 by ring,pv (-L),hcentral (-L) (by rw [abs_neg,abs_of_pos hL.1])] ring have h1 := hs L x (le_of_not_ge hxc) have h2 := hs x (1-L) (by linarith [hx.2,hL.1]) rw [hvL] at h1 rw [hvR] at h2 apply abs_le.mpr constructor · have h := mul_le_mul_of_nonneg_left (show L≤x from (le_of_not_ge hxc)) (show 0≤2*k by positivity) nlinarith · have h := mul_le_mul_of_nonneg_left (show x≤1-L by linarith [hx.2,hL.1]) (show 0≤2*k by positivity) nlinarith end CubicTorus end end section noncomputable section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology RealInnerProductSpace namespace CubicTorus theorem planarTorusPerimeter_ge_strip_calibration {A : Set TransverseProduct} (hA : IsOpen A) (hin : ∀ y : TransverseProduct,y 0=0 →y∈A) (hout : ∀ y : TransverseProduct,y 0=((1/2 : ℝ) : AxisCircle) →y∉closure A) {e k : ℝ} (he : 0≤e) (hk : k∈Ico 0 1) (hedge : ∀ y∈closure A,y 1=((1/2 : ℝ) : AxisCircle) →2*‖y 0‖≤e) : ENNReal.ofReal (2*k*(volume.real A-e)+ 2*(∫ t in (-(1/2 : ℝ))..(1/2),Real.sqrt (1-(2*k*t)^2)))≤planarTorusPerimeter A := by let f : ℝ →ℝ := fun t ↦ Real.sqrt (1-(2*k*t)^2) have hf : Continuous f := (continuous_const.sub ((continuous_const.mul continuous_id).pow 2)).sqrt have hp : Continuous (fun z : ℝ ↦ ∫ t in (0 : ℝ)..z,f t) := intervalIntegral.continuous_primitive (fun _ _ ↦ hf.intervalIntegrable _ _) 0 have hI : Continuous (fun L : ℝ ↦ ∫ t in (-L)..L,f t) := by have heq (L : ℝ) : (∫ t in (-L)..L,f t)=(∫ t in (0 : ℝ)..L,f t)-(∫ t in (0 : ℝ)..(-L),f t) := (intervalIntegral.integral_interval_sub_left (hf.intervalIntegrable _ _) (hf.intervalIntegrable _ _)).symm simp_rw [heq] exact hp.sub (hp.comp continuous_neg) have happrox (ε : ℝ) (hε : 0<ε) : ENNReal.ofReal (2*k*(volume.real A-(e+ε))+2*(∫ t in (-(1/2 : ℝ))..(1/2),f t))≤planarTorusPerimeter A := by obtain ⟨δ,hδ,hcollar⟩ := planar_closed_edge_collar hedge hε let U : Set ℝ := {L | 0 exact hβ0 t have hβC1 : (∫ t : AxisCircle,pβ.lift t)=1 := by rw [←AddCircle.intervalIntegral_preimage (1 : ℝ) (0 : ℝ)] simpa only [zero_add,pβ.lift_coe] using hβ1 have hβCS (t : AxisCircle) (ht : pβ.lift t≠0) : dist t ((1/2 : ℝ) : AxisCircle)<δ := by induction t using Quotient.inductionOn with | h t => exact (hβsupport t ht).trans hLU.2.1 have hcal := planarTorusPerimeter_ge_strip_seam_calibration hA (closedCentralArc_isCompact L) hu hv pu pv (fun t ↦ Real.sqrt_nonneg _) huv (fun y hy _ ↦ hin y hy) hout hβC hβC0 hβC1 hk.1 (show 0≤e+ε by linarith) (fun t ↦ hd t) (fun y hy hn ↦ (hcollar y (subset_closure hy) (hβCS (y 1) hn)).le) have hi : (∫ t in closedCentralArc L,pu.lift t)=∫ t in (-L)..L,f t := by rw [integral_closedCentralArc ⟨hLL.1.le,hLL.2⟩] apply intervalIntegral.integral_congr intro t ht rw [uIcc_of_le (by linarith [hLL.1])] at ht change Real.sqrt (1-(v t)^2)=Real.sqrt (1-(2*k*t)^2) rw [hcentral t (abs_le.mpr ht)] rwa [hi] at hcal have hc : Continuous (fun L : ℝ ↦ ENNReal.ofReal (2*k*(volume.real A-(e+ε))+2*(∫ t in (-L)..L,f t))) := ENNReal.continuous_ofReal.comp (continuous_const.add (continuous_const.mul hI)) have hs : IsClosed {L : ℝ | ENNReal.ofReal (2*k*(volume.real A-(e+ε))+2*(∫ t in (-L)..L,f t))≤planarTorusPerimeter A} := isClosed_le hc continuous_const have hh : (1/2 : ℝ)∈closure (Ioo (1/2-η) (1/2)) := by rw [closure_Ioo (by linarith : (1/2 : ℝ)-η≠1/2)] exact ⟨by linarith,le_rfl⟩ exact closure_minimal (fun L hL ↦ hfinite L hL) hs hh have hc : Continuous (fun ε : ℝ ↦ ENNReal.ofReal (2*k*(volume.real A-(e+ε))+2*(∫ t in (-(1/2 : ℝ))..(1/2),f t))) := ENNReal.continuous_ofReal.comp ((continuous_const.mul (continuous_const.sub (continuous_const.add continuous_id))).add continuous_const) have hs : IsClosed {ε : ℝ | ENNReal.ofReal (2*k*(volume.real A-(e+ε))+2*(∫ t in (-(1/2 : ℝ))..(1/2),f t))≤planarTorusPerimeter A} := isClosed_le hc continuous_const have h0 : (0 : ℝ)∈closure (Ioi (0 : ℝ)) := by rw [closure_Ioi]; exact (le_rfl : (0 : ℝ)≤0) have hh := closure_minimal (fun ε hε ↦ happrox ε hε) hs h0 change ENNReal.ofReal (2*k*(volume.real A-(e+0))+2*(∫ t in (-(1/2 : ℝ))..(1/2),f t))≤planarTorusPerimeter A at hh simpa only [add_zero] using hh end CubicTorus end end section noncomputable section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology RealInnerProductSpace namespace CubicTorus lemma strip_sqrt_polynomial_lower {w : ℝ} (hw : w∈Icc 0 ((21/40 : ℝ)^2)) : 1-w/2-w^2/5≤Real.sqrt (1-w) := by have hw2 : w^2≤((21/40 : ℝ)^2)^2 := by nlinarith [mul_nonneg hw.1 (sub_nonneg.mpr hw.2)] have hc : -3/20+w/5+w^2/25≤0 := by nlinarith [hw.2,hw2] have hh := mul_nonpos_of_nonneg_of_nonpos (sq_nonneg w) hc apply Real.le_sqrt_of_sq_le nlinarith lemma strip_round_integral_lower {k : ℝ} (hk : k∈Icc 0 (21/40 : ℝ)) : 1-k^2/6-k^4/25≤∫ t in (-(1/2 : ℝ))..(1/2),Real.sqrt (1-(2*k*t)^2) := by let f : ℝ →ℝ := fun t ↦ 1-(2*k*t)^2/2-(2*k*t)^4/5 have hf : Continuous f := (continuous_const.sub (((continuous_const.mul continuous_id).pow 2).div_const 2)).sub (((continuous_const.mul continuous_id).pow 4).div_const 5) have hg : Continuous (fun t : ℝ ↦ Real.sqrt (1-(2*k*t)^2)) := (continuous_const.sub ((continuous_const.mul continuous_id).pow 2)).sqrt have hb := intervalIntegral.integral_mono_on (μ := volume) (show -(1/2 : ℝ)≤1/2 by norm_num) (hf.intervalIntegrable _ _) (hg.intervalIntegrable _ _) (fun t ht ↦ ?_) · have hpoly : f=(fun t : ℝ ↦ 1-(2*k^2)*t^2-((16/5)*k^4)*t^4) := by funext t; dsimp only [f]; ring have h2 : IntervalIntegrable (fun t : ℝ ↦ (2*k^2)*t^2) volume (-(1/2 : ℝ)) (1/2) := (show Continuous (fun t : ℝ ↦ (2*k^2)*t^2) by fun_prop).intervalIntegrable _ _ have h4 : IntervalIntegrable (fun t : ℝ ↦ ((16/5)*k^4)*t^4) volume (-(1/2 : ℝ)) (1/2) := (show Continuous (fun t : ℝ ↦ ((16/5)*k^4)*t^4) by fun_prop).intervalIntegrable _ _ rw [hpoly,intervalIntegral.integral_sub (intervalIntegrable_const.sub h2) h4, intervalIntegral.integral_sub intervalIntegrable_const h2, intervalIntegral.integral_const,intervalIntegral.integral_const_mul,intervalIntegral.integral_const_mul, integral_pow,integral_pow] at hb norm_num at hb nlinarith [hb] · have hm : |2*k*t|≤21/40 := by calc _=2*k*|t| := by rw [abs_mul,abs_mul,abs_of_nonneg (by norm_num : (0 : ℝ)≤2),abs_of_nonneg hk.1] _≤2*k*(1/2) := mul_le_mul_of_nonneg_left (abs_le.mpr ht) (mul_nonneg (by norm_num) hk.1) _≤21/40 := by linarith [hk.2] have hw : (2*k*t)^2∈Icc 0 ((21/40 : ℝ)^2) := ⟨sq_nonneg _,by nlinarith [sq_abs (2*k*t),abs_nonneg (2*k*t)]⟩ have hh := strip_sqrt_polynomial_lower hw convert hh using 1 dsimp only [f] ring theorem planarTorusPerimeter_ge_strip_gain {A : Set TransverseProduct} (hA : IsOpen A) (hin : ∀ y : TransverseProduct,y 0=0 →y∈A) (hout : ∀ y : TransverseProduct,y 0=((1/2 : ℝ) : AxisCircle) →y∉closure A) {e j : ℝ} (he : 0≤e) (hj : j∈Icc 0 (21/100 : ℝ)) (hedge : ∀ y∈closure A,y 1=((1/2 : ℝ) : AxisCircle) →2*‖y 0‖≤e) (hgap : j≤volume.real A-e) : ENNReal.ofReal (2*(1+(27/20)*j^2))≤planarTorusPerimeter A := by let k : ℝ := (5/2)*j have hk : k∈Icc 0 (21/40 : ℝ) := by dsimp only [k]; constructor <;> linarith [hj.1,hj.2] have hcal := planarTorusPerimeter_ge_strip_calibration hA hin hout he ⟨hk.1,by linarith [hk.2]⟩ hedge have hint := strip_round_integral_lower hk have hj2 : j^2≤(21/100 : ℝ)^2 := by nlinarith [mul_nonneg hj.1 (sub_nonneg.mpr hj.2)] have hq : 0≤13/120-(25/16)*j^2 := by nlinarith [hj2] have hqq := mul_nonneg (sq_nonneg j) hq have ha := mul_le_mul_of_nonneg_left hgap hk.1 apply le_trans (ENNReal.ofReal_le_ofReal ?_) hcal dsimp only [k] at hint ha ⊢ nlinarith end CubicTorus end end section noncomputable section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology RealInnerProductSpace namespace CubicTorus lemma planar_radial_strip_gain_first {A : Set TransverseProduct} (hA : IsOpen A) (hd : PlanarRadialDownset A) (hin : planarAxisPoint (1/2)∈A) (hout : planarFirstAxisPoint (1/2)∉closure A) {e j : ℝ} (he : 0≤e) (hj : j∈Icc 0 (21/100 : ℝ)) (hedge : ∀ y∈closure A,y 1=((1/2 : ℝ) : AxisCircle) →2*‖y 0‖≤e) (hgap : j≤volume.real A-e) : ENNReal.ofReal (2*(1+(27/20)*j^2))≤planarTorusPerimeter A := by apply planarTorusPerimeter_ge_strip_gain hA ?_ (planar_radial_empty_fiber hd hout) he hj hedge hgap intro y hy apply hd y (planarAxisPoint (1/2)) ?_ hin intro k fin_cases k · simp [hy,planarAxisPoint] · change ‖y 1‖≤‖((1/2 : ℝ) : AxisCircle)‖ rw [axisCircle_norm_coe_small (by norm_num : |(1/2 : ℝ)|≤1/2),abs_of_pos (by norm_num : (0 : ℝ)<1/2)] exact axisCircle_norm_le_half (y 1) lemma planar_radial_strip_gain_second {A : Set TransverseProduct} (hA : IsOpen A) (hd : PlanarRadialDownset A) (hin : planarFirstAxisPoint (1/2)∈A) (hout : planarAxisPoint (1/2)∉closure A) {e j : ℝ} (he : 0≤e) (hj : j∈Icc 0 (21/100 : ℝ)) (hedge : ∀ y∈closure A,y 0=((1/2 : ℝ) : AxisCircle) →2*‖y 1‖≤e) (hgap : j≤volume.real A-e) : ENNReal.ofReal (2*(1+(27/20)*j^2))≤planarTorusPerimeter A := by have hi : planarAxisPoint (1/2)∈planarSwap ⁻¹' A := by simpa using hin have ho : planarFirstAxisPoint (1/2)∉closure (planarSwap ⁻¹' A) := by intro hh apply hout simpa only [mem_preimage,planarSwap_firstAxisPoint] using planarSwap_closure_subset A hh have hb : ∀ y∈closure (planarSwap ⁻¹' A),y 1=((1/2 : ℝ) : AxisCircle) →2*‖y 0‖≤e := by intro y hy hy1 have hh := hedge (planarSwap y) (planarSwap_closure_subset A hy) (by simpa using hy1) simpa using hh have hh := planar_radial_strip_gain_first (hA.preimage planarSwap_continuous) (planarRadialDownset_swap hd) hi ho he hj hb (by simpa only [planar_volume_swap] using hgap) simpa only [planarTorusPerimeter_swap] using hh end CubicTorus end end section noncomputable section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology RealInnerProductSpace namespace CubicTorus theorem isMinimizerAt_section_strip_gain {V : ℝ} (hV : V∈Ioo 0 1) {E : Set Torus} (hmin : IsMinimizerAt V E) (hR : ∀ i : Fin 3,E=ᵐ[torusVolume]((axisReflection i).torus ⁻¹' E)) {b : Fin 3 →Bool} (hd : ∀ x∈upperOctant,∀ y∈upperOctant,OrientedCoordinateLE b x y → quotientMap y∈openRepresentative E →quotientMap x∈openRepresentative E) (i : Fin 3) (j : Fin 2) (t : ℝ) (hin : quotientMap (axialSectionCorner b i t (fun k ↦ if k=j then false else true))∈openRepresentative E) (hout : quotientMap (axialSectionCorner b i t (fun k ↦ if k=j then true else false))∉closure (openRepresentative E)) {e r : ℝ} (he : 0≤e) (hr : r∈Icc 0 (21/100 : ℝ)) (hedge : ∀ y∈closure (centeredAxialSlice (openRepresentative E) b i (t : AxisCircle)), (∀ k : Fin 2,k≠j →y k=((1/2 : ℝ) : AxisCircle)) →2*‖y j‖≤e) (hgap : r≤volume.real (axialSlice (openRepresentative E) i (t : AxisCircle))-e) : ENNReal.ofReal (2*(1+(27/20)*r^2))≤planarTorusPerimeter (axialSlice (openRepresentative E) i (t : AxisCircle)) := by let A := centeredAxialSlice (openRepresentative E) b i (t : AxisCircle) have hA : IsOpen A := centeredAxialSlice_isOpen (isOpen_openRepresentative E) b i _ have hdA : PlanarRadialDownset A := isMinimizerAt_centered_section_radial hV hmin hR hd i _ have hg : r≤volume.real A-e := by simpa only [A,centeredAxialSlice_volume] using hgap suffices hp : ENNReal.ofReal (2*(1+(27/20)*r^2))≤planarTorusPerimeter A by simpa only [A,centeredAxialSlice_perimeter] using hp fin_cases j · have hi : planarAxisPoint (1/2)∈A := by change (torusAxialSplit i).symm ((t : AxisCircle),planarAxisPoint (1/2)+axialSectionCenter b i)∈openRepresentative E rw [centered_section_second_axis] convert hin using 2 congr 1 funext k; fin_cases k <;> decide have ho : planarFirstAxisPoint (1/2)∉closure A := by intro hh apply hout have hc := centeredAxialSlice_closure_subset (openRepresentative E) b i (t : AxisCircle) hh change (torusAxialSplit i).symm ((t : AxisCircle),planarFirstAxisPoint (1/2)+axialSectionCenter b i)∈closure (openRepresentative E) at hc rw [centered_section_first_axis] at hc convert hc using 2 congr 1 apply planar_radial_strip_gain_first hA hdA hi ho he hr ?_ hg intro y hy hy1 apply hedge y hy intro k hk fin_cases k · exact (hk rfl).elim · exact hy1 · have hi : planarFirstAxisPoint (1/2)∈A := by change (torusAxialSplit i).symm ((t : AxisCircle),planarFirstAxisPoint (1/2)+axialSectionCenter b i)∈openRepresentative E rw [centered_section_first_axis] convert hin using 2 congr 1 funext k; fin_cases k <;> decide have ho : planarAxisPoint (1/2)∉closure A := by intro hh apply hout have hc := centeredAxialSlice_closure_subset (openRepresentative E) b i (t : AxisCircle) hh change (torusAxialSplit i).symm ((t : AxisCircle),planarAxisPoint (1/2)+axialSectionCenter b i)∈closure (openRepresentative E) at hc rw [centered_section_second_axis] at hc convert hc using 2 congr 1 apply planar_radial_strip_gain_second hA hdA hi ho he hr ?_ hg intro y hy hy0 apply hedge y hy intro k hk fin_cases k · exact hy0 · exact (hk rfl).elim end CubicTorus end end section noncomputable section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology RealInnerProductSpace namespace CubicTorus lemma strip_gain_dominates_shape {δ q : ℝ} (_hδ : 0≤δ) (_hq : q∈Icc 0 1) : Real.sqrt (1+Shape.c*δ^2*Shape.shape q)≤1+(27/20)*(δ*q)^2 := by have hshape : Shape.shape q≤q^2 := min_le_left _ _ have hmul := mul_le_mul_of_nonneg_left hshape (show 0≤(27/10 : ℝ)*δ^2 by positivity) apply (Real.sqrt_le_iff).mpr refine ⟨by positivity,?_⟩ dsimp only [Shape.c] at * nlinarith [sq_nonneg ((27/20 : ℝ)*(δ*q)^2)] lemma disk_gain_dominates_shape {δ q s : ℝ} (hδ : δ∈Icc 0 Shape.dm) (hq : q∈Icc 0 1) (hs : (38/100 : ℝ) decide have he1 : (fun k : Fin 2 ↦ if k=1 then true else false)=(fun k ↦ k==1) := by funext k; fin_cases k <;> decide have hp := isMinimizerAt_section_strip_gain hV hmin hR hd i 1 t (by rwa [he0]) (by rw [he1]; exact hout _ h1) he hj (hedge 1) hgap exact (ENNReal.ofReal_le_ofReal hstrip).trans hp · by_cases h1 : quotientMap (axialSectionCorner b i t (fun j ↦ j==1))∈openRepresentative E · have he0 : (fun k : Fin 2 ↦ if k=0 then false else true)=(fun k ↦ k==1) := by funext k; fin_cases k <;> decide have he1 : (fun k : Fin 2 ↦ if k=0 then true else false)=(fun k ↦ k==0) := by funext k; fin_cases k <;> decide have hp := isMinimizerAt_section_strip_gain hV hmin hR hd i 0 t (by rwa [he0]) (by rw [he1]; exact hout _ h0) he hj (hedge 0) hgap exact (ENNReal.ofReal_le_ofReal hstrip).trans hp · exact (ENNReal.ofReal_le_ofReal hdisk).trans (isMinimizerAt_section_disk_perimeter hV hmin hR hd i t hnear (hout _ h0) (hout _ h1)) · have hAe : A=∅ := by apply eq_empty_iff_forall_notMem.mpr intro y hy apply hnear apply (hcorner _).mp apply hr _ _ _ hy intro j simp only [planarSquareCorner,Bool.false_eq_true,ite_false,norm_zero] exact norm_nonneg _ have hs0 : volume.real (axialSlice (openRepresentative E) i (t : AxisCircle))=0 := by rw [←hv,hAe]; simp exfalso linarith end CubicTorus end end section noncomputable section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology RealInnerProductSpace namespace CubicTorus lemma isMinimizerAt_boundary_slice_null_ae {V : ℝ} (hV : V∈Ioo 0 1) {E : Set Torus} (hE : MeasurableSet E) (hmin : IsMinimizerAt V E) (i : Fin 3) : ∀ᵐ t : AxisCircle,volume (axialSlice (frontier (openRepresentative E)) i t)=0 := by apply (lintegral_eq_zero_iff (axialSliceVolume_measurable isClosed_frontier.measurableSet i)).mp rw [axialSliceVolume_lintegral isClosed_frontier.measurableSet i] exact isMinimizerAt_volume_frontier_eq_zero hV hE hmin theorem isMinimizerAt_planar_profile_ae {V : ℝ} (hV : V∈Ioo 0 1) {E : Set Torus} (hE : MeasurableSet E) (hmin : IsMinimizerAt V E) (hR : ∀ i : Fin 3,E=ᵐ[torusVolume]((axisReflection i).torus ⁻¹' E)) {b : Fin 3 →Bool} (hd : ∀ x∈upperOctant,∀ y∈upperOctant,OrientedCoordinateLE b x y → quotientMap y∈openRepresentative E →quotientMap x∈openRepresentative E) (i : Fin 3) : ∀ᵐ t : ℝ ∂volume.restrict (Icc (1/2 : ℝ) 1), ENNReal.ofReal (unitPlanarProfile (volume.real (axialSlice (openRepresentative E) i (t : AxisCircle))))≤ planarTorusPerimeter (axialSlice (openRepresentative E) i (t : AxisCircle)) := by have hc : ∀ᵐ t : ℝ,∀ n : Fin 2 →Bool, quotientMap (axialSectionCorner b i t n)∉frontier (openRepresentative E) := by rw [ae_all_iff] intro n exact (ae_iff.mpr (by simpa only [not_not] using isMinimizerAt_corner_boundary_heights_null hV hE hmin hR b i n)) have hp : MeasurePreserving (fun t : ℝ ↦ (t : AxisCircle)) (volume.restrict (Ioc (0 : ℝ) 1)) volume := by simpa using AddCircle.measurePreserving_mk (1 : ℝ) 0 have hn := hp.quasiMeasurePreserving.ae (isMinimizerAt_boundary_slice_null_ae hV hE hmin i) have hsub : Icc (1/2 : ℝ) 1⊆Ioc 0 1 := fun t ht ↦ ⟨by linarith [ht.1],ht.2⟩ filter_upwards [ae_restrict_of_ae hc,ae_restrict_of_ae_restrict_of_subset hsub hn, ae_restrict_mem measurableSet_Icc] with t htc htn ht exact isMinimizerAt_section_planar_profile hV hmin hR hd i ht htc htn theorem isMinimizerAt_nonstandard_planar_profile {V : ℝ} (hV : V∈Ioc 0 (1/2)) {E : Set Torus} (hmin : IsMinimizerAt V E) (hstd : ¬StandardRegionAt V E) (hR : ∀ i : Fin 3,E=ᵐ[torusVolume]((axisReflection i).torus ⁻¹' E)) : ∃ b : Fin 3 →Bool, (∀ x∈upperOctant,∀ y∈upperOctant,OrientedCoordinateLE b x y → quotientMap y∈openRepresentative E →quotientMap x∈openRepresentative E) ∧ ∀ i : Fin 3,∀ᵐ t : ℝ ∂volume.restrict (Icc (1/2 : ℝ) 1), ENNReal.ofReal (unitPlanarProfile (volume.real (axialSlice (openRepresentative E) i (t : AxisCircle))))≤ planarTorusPerimeter (axialSlice (openRepresentative E) i (t : AxisCircle)) := by have hV' : V∈Ioo (0 : ℝ) 1 := ⟨hV.1,by linarith [hV.2]⟩ have hc : IsPreconnected (frontier (openRepresentative E)) := (Periodic.isMinimizerAt_connected_or_standard_slab hV' hmin).resolve_right (fun h ↦ hstd h.2.2) obtain ⟨b,hd⟩ := isMinimizerAt_octant_downset hV' hmin hc hR refine ⟨b,hd,fun i ↦ ?_⟩ let F := toMeasurable torusVolume E have hF : MeasurableSet F := measurableSet_toMeasurable _ _ have hFE : F=ᵐ[torusVolume]E := hmin.1.1.toMeasurable_ae_eq have hmF := (isMinimizerAt_congr_ae hFE).mpr hmin have ho := openRepresentative_congr_ae hFE have hRF (j : Fin 3) : F=ᵐ[torusVolume]((axisReflection j).torus ⁻¹' F) := hFE.trans ((hR j).trans ((axisReflection j).measurePreserving.quasiMeasurePreserving.preimage_ae_eq hFE.symm)) have hdF : ∀ x∈upperOctant,∀ y∈upperOctant,OrientedCoordinateLE b x y → quotientMap y∈openRepresentative F →quotientMap x∈openRepresentative F := by rwa [ho] have hp := isMinimizerAt_planar_profile_ae hV' hF hmF hRF hdF i rwa [ho] at hp end CubicTorus end end section noncomputable section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology RealInnerProductSpace namespace CubicTorus lemma octantHeight_surjective_half (b : Fin 3 →Bool) (i : Fin 3) {t : ℝ} (ht : t∈Icc (1/2 : ℝ) 1) : ∃ z∈Icc (0 : ℝ) 1,octantHeight b i z=t := by cases hb : b i · refine ⟨2-2*t,⟨by linarith [ht.2],by linarith [ht.1]⟩,?_⟩ simp only [octantHeight,hb,Bool.false_eq_true,ite_false] ring · refine ⟨2*t-1,⟨by linarith [ht.1],by linarith [ht.2]⟩,?_⟩ simp only [octantHeight,hb,ite_true] ring theorem isMinimizerAt_nesting_improved_profile_ae {V : ℝ} (hV : V∈Ioo 0 1) {E : Set Torus} (hE : MeasurableSet E) (hmin : IsMinimizerAt V E) (hR : ∀ i : Fin 3,E=ᵐ[torusVolume]((axisReflection i).torus ⁻¹' E)) (b : Fin 3 →Bool) (hd : ∀ x∈upperOctant,∀ y∈upperOctant,OrientedCoordinateLE b x y → quotientMap y∈openRepresentative E →quotientMap x∈openRepresentative E) {μ : FiniteMeasure NormalBundle} (hμ : IsNormalMeasure E μ) {H : ℝ} (hCMC : ∀ F : Cover → Cover,ContDiff ℝ (⊤ : ℕ∞) F → (∀ m x,F (x+latticeVector m)=F x) → (∫ z,tangentialDivergence F z.1 z.2 ∂(μ : Measure NormalBundle))= H*(∫ z,⟪(z.2 : Cover),F z.1⟫ ∂(μ : Measure NormalBundle))) (i : Fin 3) (ha : (axialAreaMarginal μ i : Measure AxisCircle)≪volume) (hv : quotientMap (orientedUpperVertex b (fun j ↦ if j=i then true else false))∉openRepresentative E) (hout : quotientMap (axialSectionCorner b i (octantHeight b i 0) (fun _ ↦ true))∉closure (openRepresentative E)) (hin0 : quotientMap (axialSectionCorner b i (octantHeight b i 0) (fun j ↦ j==0))∈openRepresentative E) (hin1 : quotientMap (axialSectionCorner b i (octantHeight b i 0) (fun j ↦ j==1))∈openRepresentative E) (hH : H/2∈Icc (51/50 : ℝ) (81/50 : ℝ)) : let s := volume.real (axialSlice (openRepresentative E) i (octantHeight b i 0 : AxisCircle)) let δ := nestingDelta (H/2) s 0<δ →∀ᵐ t : ℝ ∂volume.restrict (Icc (1/2 : ℝ) 1), let v := volume.real (axialSlice (openRepresentative E) i (t : AxisCircle)) v∈Icc (Shape.u (H/2)-δ) (Shape.u (H/2)) → ENNReal.ofReal (2*Real.sqrt (1+Shape.c*δ^2*Shape.shape ((v-Shape.u (H/2)+δ)/δ)))≤ planarTorusPerimeter (axialSlice (openRepresentative E) i (t : AxisCircle)) := by intro s δ hδpos have hδ : δ∈Icc 0 Shape.dm := nestingDelta_mem _ _ have hh : 0