import Mathlib import OAI.Geometry.CubicTorus.Profiles.CornerGrid381 namespace OAI section noncomputable section open Set namespace CubicTorus theorem secondCorner_endpoint_contradiction {A h b r s : ℝ} (hA0 : 0 t+x/Real.pi*(1-t^2) have hf : Continuous f := by fun_prop have hf1 : f 1=1 := by dsimp [f]; ring obtain ⟨t,ht,hft⟩ := intermediate_value_Icc hw1 hf.continuousOn (show b∈Icc (f w) (f 1) from ⟨hnorm,by rw [hf1]; exact hb1.le⟩) have ht0 : 0≤t := hw0.trans ht.1 have ht1 : t<1 := by by_contra hn have he : t=1 := le_antisymm ht.2 (le_of_not_gt hn) rw [he,hf1] at hft linarith have htden : 0<1-t^2 := by nlinarith have hroot : t+x/Real.pi*(1-t^2)=b := hft have hxterm : 0≤x/Real.pi*(1-t^2) := by positivity have htd : t+d^2≤1 := by linarith only [hroot,hxterm,hd2] have hxroot : x=Real.pi*(1-t-d^2)/(1-t^2) := by apply (eq_div_iff htden.ne').mpr have he := congrArg (fun y : ℝ => y*Real.pi) hroot field_simp at he rw [show 1-t-d^2=b-t by linarith only [hd2]] nlinarith only [he] have hwtsq : w^2≤t^2 := (sq_le_sq₀ hw0 ht0).mpr ht.1 have hrbound : r≤a^2*t^2/Real.pi := by rw [hrw] exact div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hwtsq (sq_nonneg a)) Real.pi_pos.le have hEt : A*b-h*(1/Real.pi-a^2*t^2/Real.pi)≤a*t := by have he : A*b-h*(1/Real.pi-a^2*t^2/Real.pi)= A*t+(h/Real.pi)*(A^2-a^2)*(1-t^2) := by rw [hva,← hroot] dsimp only [x] ring have hA2 : A^2≤a^2 := (sq_le_sq₀ hA0.le ha.le).mpr haA have hcorr : (h/Real.pi)*(A^2-a^2)*(1-t^2)≤0 := mul_nonpos_of_nonpos_of_nonneg (mul_nonpos_of_nonneg_of_nonpos (div_nonneg hh Real.pi_pos.le) (sub_nonpos.mpr hA2)) htden.le rw [he] have hat := mul_le_mul_of_nonneg_right haA ht0 linarith only [hcorr,hat] have hsb : s≤a^2*t^2/Real.pi+a*d := by have hAd := mul_le_mul_of_nonneg_right haA hd0 linarith only [hdrop,hrbound,hAd] have hbottom' : Real.sqrt (Real.pi*(1-s))≤a*t+x*d := by have hdiff := mul_le_mul_of_nonneg_left hdrop hh have hrr := mul_le_mul_of_nonneg_left hrbound hh have hxd : h*(A*d)=x*d := by dsimp [x]; ring rw [hxd] at hdiff linarith only [hbottom,hdiff,hrr,hEt] have hbsq : Real.pi*(1-s)≤(a*t+x*d)^2 := by have hy : 0≤a*t+x*d := by positivity have hh' := (sq_le_sq₀ (Real.sqrt_nonneg (Real.pi*(1-s))) hy).mpr hbottom' rwa [Real.sq_sqrt (mul_nonneg Real.pi_pos.le (by linarith : 0≤1-s))] at hh' have hnec : 1≤a*d+(a^2*t^2+(a*t+x*d)^2)/Real.pi := by have hh' := mul_le_mul_of_nonneg_left hsb Real.pi_pos.le have hcancel : Real.pi*(a^2*t^2/Real.pi+a*d)=a^2*t^2+Real.pi*a*d := by field_simp rw [hcancel] at hh' have hh2 : 1≤((a*d)*Real.pi+(a^2*t^2+(a*t+x*d)^2))/Real.pi := (le_div_iff₀ Real.pi_pos).mpr (by nlinarith only [hh',hbsq]) simpa only [add_div,mul_div_cancel_right₀ _ hp] using hh2 have hd3 : d^2≤1/3 := by linarith only [hd2,hbmax] have hroot' : Real.pi*(1-t-d^2)=x*(1-t^2) := by exact ((eq_div_iff htden.ne').mp hxroot).symm have hstrict := corner_root_strict (show CornerRootData t d x from ⟨ht0,ht1,hd0,hd3,hx0,hxcap,hroot'⟩) have hnec' : 1≤d+(t^2+(t+x*d)^2)/Real.pi := by simpa only [a,one_mul,one_pow] using hnec exact (not_lt_of_ge hnec') hstrict end CubicTorus end end section noncomputable section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology RealInnerProductSpace namespace CubicTorus theorem isMinimizerAt_second_transition_corner_excluded {E : Set Torus} (hE : MeasurableSet E) (hm : IsMinimizerAt (1/Real.pi) E) {μ : FiniteMeasure NormalBundle} (hμ : IsNormalMeasure E μ) {N : Cover → Cover} (hN : ContDiff ℝ (⊤ : ℕ∞) N) (hp : ∀ m x,N (x+latticeVector m)=N x) (ha : ∀ᵐ z ∂(μ : Measure NormalBundle),N z.1=(z.2 : Cover)) (hs : ∀ i : Fin 3,coordinateReflection i ⁻¹' E =ᵐ[torusVolume] E) {c : Fin 3 → Bool} (hsg : ∀ (x : Cover) (i : Fin 3), quotientMap x∈frontier (openRepresentative E)∩coordinateHalf i (if c i then 0 else 1/2) →0 decide (j=0 ∨ j=1)))∉openRepresentative E) (ht2 : quotientMap (chamberVertex c (fun j => decide (j=0 ∨ j=2)))∉openRepresentative E) (hb1 : quotientMap (chamberVertex c (fun j => decide (j=1)))∈openRepresentative E) (hb2 : quotientMap (chamberVertex c (fun j => decide (j=2)))∈openRepresentative E) : False := by have hvh := secondTransition_mem_Ioo_half have hV : 1/Real.pi∈Ioo (0 : ℝ) 1 := ⟨hvh.1,by linarith [hvh.2]⟩ obtain ⟨H,hH⟩ := isMinimizerAt_coordinate_multiplier hV hE hm hμ obtain ⟨hA,_,hA1,hh,hr,hrV,_,hs1,hb,_,htop,hbottom,hdrop⟩ := isMinimizerAt_four_corner_necessary_data hvh hE hm hμ hN hp ha hs hsg hH ht1 ht2 hb1 hb2 exact secondCorner_endpoint_contradiction hA hA1 hh hb hw1 hr hrV hs1 htop hbottom hdrop hw0 (isMinimizerAt_second_endpoint_linear_bound hE hm hμ hH).le theorem isMinimizerAt_second_transition_standard {E : Set Torus} (hmE : IsMinimizerAt (1/Real.pi) E) : SmallStandardRegion (1/Real.pi) E := by by_contra hnstd obtain ⟨F,μ,N,hN,hp,c,H,hF,hm,hμ,ha,hs,hsg,hH,hws,hw,haxis,hface⟩ := isMinimizerAt_second_transition_nonstandard_star hmE hnstd obtain ⟨i,hi⟩ : ∃ i : Fin 3,2/3≤axialFluxWeight μ i := by by_contra! hn rw [Fin.sum_univ_three] at hws linarith [hn 0,hn 1,hn 2] classical let e : Fin 3 ≃ Fin 3 := Equiv.swap 0 i have he0 : e.symm 0=i := by simp [e] have he1 : e.symm 1≠i := by rw [← he0]; exact e.symm.injective.ne (by decide) have he2 : e.symm 2≠i := by rw [← he0]; exact e.symm.injective.ne (by decide) have hpair (j : Fin 3) : ((fun k : Fin 3 => decide (k=0 ∨ k=j)) ∘ e)= (fun k => decide (k=i ∨ k=e.symm j)) := by funext k simp only [Function.comp_apply,← Equiv.eq_symm_apply,he0] have hsingle (j : Fin 3) : ((fun k : Fin 3 => decide (k=j)) ∘ e)= (fun k => decide (k=e.symm j)) := by funext k simp only [Function.comp_apply,← Equiv.eq_symm_apply] have ht (j : Fin 3) (hj : j≠i) : quotientMap (chamberVertex c (fun k => decide (k=i ∨ k=j)))∉openRepresentative F := by obtain ⟨k,hk⟩ := fin3_pair_complement i j hj.symm rw [hk] exact fun h => hface k (subset_closure h) have hv (b : Fin 3 → Bool) : quotientMap (chamberVertex (c ∘ e.symm) b)∈openRepresentative (torusCoordinatePermute e ⁻¹' F) ↔ quotientMap (chamberVertex c (b ∘ e))∈openRepresentative F := by rw [openRepresentative_coordinatePermute hF e] change torusCoordinatePermute e (quotientMap (chamberVertex (c ∘ e.symm) b))∈openRepresentative F ↔ _ rw [← quotientMap_coordinatePermute,chamberVertex_coordinatePermute] apply isMinimizerAt_second_transition_corner_excluded ((torusCoordinatePermute e).continuous.measurable hF) (isMinimizerAt_coordinatePermute hm e) (isNormalMeasure_coordinatePermute hF hμ e) (coordinatePermutedField_contDiff e hN) (coordinatePermutedField_periodic e hp) (permuted_normal_ae hN.continuous hp ha e) (reflection_invariant_coordinatePermute hs e) (chamberSign_coordinatePermute hF hsg e) · simpa [axialFluxWeight_permute,e] using hi · rw [axialFluxWeight_permute] exact (hw _).2 · rw [hv,hpair] exact ht _ he1 · rw [hv,hpair] exact ht _ he2 · rw [hv,hsingle] exact haxis _ · rw [hv,hsingle] exact haxis _ end CubicTorus end end section noncomputable section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology RealInnerProductSpace namespace CubicTorus theorem isoperimetricProfile_second_transition : isoperimetricProfile (1/Real.pi)=1 := by have hV := secondTransition_mem_Ioo_half obtain ⟨E,hm⟩ := exists_isMinimizerAt (show 1/Real.pi∈Ioo (0 : ℝ) 1 from ⟨hV.1,by linarith [hV.2]⟩) have hs := isMinimizerAt_second_transition_standard hm have hP := (hs.bv_data ⟨hV.1,hV.2.le⟩).2.2 rw [candidateProfile_slab (show 1/Real.pi∈Icc TwoVolume.V₂ (1-TwoVolume.V₂) from ⟨le_rfl,by change 1/Real.pi≤1-1/Real.pi; linarith [hV.2]⟩)] at hP rw [isoperimetricProfile_eq_of_isMinimizerAt hm,hP,ENNReal.toReal_ofReal (by positivity)] norm_num end CubicTorus end end section noncomputable section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology RealInnerProductSpace namespace CubicTorus def cylinderRatio (V : ℝ) : ℝ := isoperimetricProfile V/Real.sqrt V lemma profile_ge_second_chord {V : ℝ} (hV : V∈Icc (0 : ℝ) (1/Real.pi)) : Real.pi*V ≤ isoperimetricProfile V := by have hv2 := secondTransition_mem_Ioo_half have hvp : V*Real.pi≤1 := (le_div_iff₀ Real.pi_pos).mp hV.2 have hh := concaveOn_isoperimetricProfile.2 (show (0 : ℝ)∈Icc (0 : ℝ) 1 by constructor <;> norm_num) (show 1/Real.pi∈Icc (0 : ℝ) 1 from ⟨hv2.1.le,by linarith [hv2.2]⟩) (show 0≤1-V*Real.pi by linarith) (show 0≤V*Real.pi from mul_nonneg hV.1 Real.pi_pos.le) (show (1-V*Real.pi)+V*Real.pi=1 by ring) have he : (1-V*Real.pi)*0+V*Real.pi*(1/Real.pi)=V := by field_simp; ring simp only [smul_eq_mul,isoperimetricProfile_zero,isoperimetricProfile_second_transition, mul_zero,mul_one,zero_add] at hh simpa only [mul_assoc,mul_one_div_cancel Real.pi_pos.ne',mul_one,mul_comm] using hh lemma cylinder_contact_support_deriv {V : ℝ} (hV : 0 C W/Real.sqrt W) V := by filter_upwards [hc,hs.above,Ioi_mem_nhds hV] with W hW hab hpos change C V/Real.sqrt V≤C W/Real.sqrt W rw [hs.contact] exact hW.trans (div_le_div_of_nonneg_right hab (Real.sqrt_nonneg _)) have hd := (hs.smooth.differentiableAt (by norm_num)).hasDerivAt.div (Real.hasDerivAt_sqrt hV.ne') (Real.sqrt_ne_zero'.mpr hV) have hz := hloc.hasDerivAt_eq_zero hd rw [hs.contact] at hz have hq : (Real.sqrt V)^2=V := Real.sq_sqrt hV.le have hn : Real.sqrt V≠0 := Real.sqrt_ne_zero'.mpr hV field_simp [hn] at hz apply (eq_div_iff (by positivity : 2*V≠0)).mpr rw [hq] at hz nlinarith only [hz] theorem isMinimizerAt_cylinder_contact_multiplier {V : ℝ} (hV : V∈Ioo 0 1) (hc : IsLocalMin cylinderRatio V) {E : Set Torus} (hE : MeasurableSet E) (hm : IsMinimizerAt V E) {μ : FiniteMeasure NormalBundle} (hμ : IsNormalMeasure E μ) {H : ℝ} (hH : ∀ D : Periodic.Variation,Periodic.normalFirstVariation μ D= H*directionalFlux E D.coordinate D.function) : (H/2)*V=((perimeter E).toReal/2)/2 := by obtain ⟨N,C,hN,hp,ha,hs,hd,_⟩ := Periodic.profile_hessian_of_CMC hV hE hm hμ (fun _ hF hpF => Periodic.weakCMC_identity hμ hH hF hpF) have hh := cylinder_contact_support_deriv hV.1 hc hs rw [hd,isoperimetricProfile_eq_of_isMinimizerAt hm] at hh have he := (eq_div_iff (ne_of_gt (mul_pos (by norm_num : (0 : ℝ)<2) hV.1))).mp hh nlinarith only [he] theorem isMinimizerAt_cylinder_contact_bounds {V : ℝ} (hV : V∈Icc TwoVolume.V₁ TwoVolume.V₂) (hc : IsLocalMin cylinderRatio V) {E : Set Torus} (hE : MeasurableSet E) (hm : IsMinimizerAt V E) {μ : FiniteMeasure NormalBundle} (hμ : IsNormalMeasure E μ) {H : ℝ} (hH : ∀ D : Periodic.Variation,Periodic.normalFirstVariation μ D= H*directionalFlux E D.coordinate D.function) : let A := (perimeter E).toReal/2 let h := H/2 0 x*A) he] exact ⟨hpos,hA1,he,hh,hcap⟩ end CubicTorus end end section noncomputable section open Set namespace CubicTorus def criticalCorrection (h : ℝ) : ℝ := (49/50 : ℝ)/Real.pi*h+(51*Real.pi/200)*h⁻¹-1 lemma criticalCorrection_convex : ConvexOn ℝ (Ioi 0) criticalCorrection := by have hi : ConvexOn ℝ (Ioi (0 : ℝ)) (fun h : ℝ => h⁻¹) := by simpa using (strictConvexOn_zpow (m := -1) (by norm_num) (by norm_num)).convexOn refine ⟨convex_Ioi 0,?_⟩ intro x hx y hy a b ha hb hab have hh := mul_le_mul_of_nonneg_left (hi.2 hx hy ha hb hab) (show 0≤51*Real.pi/200 by positivity) simp only [smul_eq_mul] at hh ⊢ unfold criticalCorrection nlinarith only [hh,hab] lemma criticalCorrection_nonpos {h : ℝ} (hl : Real.pi/2≤h) (hu : h≤81/50) : criticalCorrection h≤0 := by have hp : 0 ha.trans_le hy.1) (convex_Icc a b) have hf : ConcaveOn ℝ (Icc a b) (fun h => nestingBaseline h-criticalCorrection h-(1/a^2)*h^2) := by apply ((ReusedScalar205.CubicTorus.Scalar.concaveOn_baseline_corrected (b := b) ha).sub hc).congr intro y hy dsimp only [Pi.sub_apply] rw [nestingBaseline_eq_reused (ha.trans_le hy.1)] ring have hb := ReusedScalar205.CubicTorus.Scalar.semiconcave_chord_bound hab (show 0≤(1 : ℝ)/a^2 by positivity) hf hx have hm := min_le_min hl hr have he : (1/a^2)*(b-a)^2/4=(b-a)^2/(4*a^2) := by ring rw [he] at hb linarith lemma critical_baseline_positive {h : ℝ} (hh : h∈Icc (81/50 : ℝ) (19/10)) : 0 decide (l=j)))∈openRepresentative F) ∧ (∀ j : Fin 3,quotientMap (chamberVertex c (fun l => decide (l≠j)))∉closure (openRepresentative F)) := by have hv1 := firstTransition_mem_Ioo_half have hv2 := secondTransition_mem_Ioo_half have hvh : V∈Ioo (0 : ℝ) (1/2) := ⟨hv1.1.trans_le hVrange.1,hVrange.2.trans_lt hv2.2⟩ have hV : V∈Ioo (0 : ℝ) 1 := ⟨hvh.1,by linarith [hvh.2]⟩ obtain ⟨v,F,μ,N,hN,hp,c,H,hF,he,hm,hcon,hμ,ha,hs,hsg,hH,_,hws,hw,hvi,_⟩ := isMinimizerAt_nonstandard_section_system ⟨hvh.1,hvh.2.le⟩ hmE hnstd have hnF : ¬SmallStandardRegion V F := fun h => hnstd (smallStandardRegion_of_translated he h) have hnstdF : ¬StandardRegionAt V F := by simpa only [StandardRegionAt,ite_eq_left hvh.2.le] using hnF have hR : ∀ i : Fin 3,F=ᵐ[torusVolume]((axisReflection i).torus ⁻¹' F) := by intro i rw [axisReflection_eq_coordinateReflection] exact (hs i).symm have hd := isMinimizerAt_chamber_upper_downset hV hF hm hμ hN hp ha hs hsg have heq (j : Fin 3) : quotientMap (orientedUpperVertex c (fun k => if k=j then true else false))= quotientMap (chamberVertex c (fun k => decide (k=j))) := by rw [quotient_orientedUpperVertex_eq] congr 2 obtain ⟨i,hi⟩ := hvi have hiO : quotientMap (chamberVertex c (fun j => decide (j=i)))∈openRepresentative F := mem_open_of_mem_closure_not_frontier (isOpen_openRepresentative F) hi (isMinimizerAt_reflection_vertex_excluded hV hF hm hμ hN hp ha hs (chamberVertex_sine_zero c _)) have hcF : IsPreconnected (frontier (openRepresentative F)) := (Periodic.isMinimizerAt_connected_or_standard_slab hV hm).resolve_right (fun h => hnstdF h.2.2) obtain ⟨ν,K,hν,hCMC,hAC,_⟩ := isMinimizerAt_nonstandard_integrated_flux ⟨hvh.1,hvh.2.le⟩ hm hnstdF hR have hno (k : Fin 3) (hk : quotientMap (chamberVertex c (fun j => decide (j=k)))∉openRepresentative F) (hall : ∀ j : Fin 2,quotientMap (chamberVertex c (fun l => decide (l=k.succAbove j)))∈openRepresentative F) : False := by apply isMinimizerAt_cylinder_contact_not_three_vertices hVrange hcontact hF hm hcF hR c hd hν hCMC k (hAC k) · rwa [heq] · intro j rw [heq] exact hall j have hall : ∀ j : Fin 3,quotientMap (chamberVertex c (fun l => decide (l=j)))∈openRepresentative F := by rcases three_axes_dichotomy _ ⟨i,hiO⟩ hno with hall|⟨k,hk⟩ · exact hall · obtain ⟨hzero,_,hdown⟩ := isMinimizerAt_chamber_vertex_order hV hF hm hμ ha (fun x hx j => (hsg x j ⟨hx.1,mem_iInter.mp hx.2 j⟩).le) hs have hv := bool_vertex_two_point_ideal hzero hdown k ((hk k).mpr rfl) (fun j hj => (hk j).mp hj) exact (isMinimizerAt_strict_two_vertices_impossible ⟨hvh.1,hvh.2.le⟩ hF hm hμ hN hp ha hs hsg k hv).elim exact ⟨F,μ,N,hN,hp,c,H,hF,hm,hμ,ha,hs,hsg,hH,hws,hw,hall, isMinimizerAt_smaller_side_double_vertices_vacant hvh hF hm hμ hN hp ha hs hsg hH⟩ end CubicTorus end end section noncomputable section open Set namespace CubicTorus theorem fourCorner_normalized_contradiction {A h b r s a V : ℝ} (hA0 : 0 t+x/Real.pi*(1-t^2) have hf : Continuous f := by fun_prop have hf1 : f 1=1 := by dsimp [f]; ring obtain ⟨t,ht,hft⟩ := intermediate_value_Icc hw1 hf.continuousOn (show b∈Icc (f w) (f 1) from ⟨hnorm,by rw [hf1]; exact hb1.le⟩) have ht0 : 0≤t := hw0.trans ht.1 have ht1 : t<1 := by by_contra hn have he : t=1 := le_antisymm ht.2 (le_of_not_gt hn) rw [he,hf1] at hft linarith have htden : 0<1-t^2 := by nlinarith have hroot : t+x/Real.pi*(1-t^2)=b := hft have hxterm : 0≤x/Real.pi*(1-t^2) := by positivity have htd : t+d^2≤1 := by linarith only [hroot,hxterm,hd2] have hxroot : x=Real.pi*(1-t-d^2)/(1-t^2) := by apply (eq_div_iff htden.ne').mpr have he := congrArg (fun y : ℝ => y*Real.pi) hroot field_simp at he rw [show 1-t-d^2=b-t by linarith only [hd2]] nlinarith only [he] have hwtsq : w^2≤t^2 := (sq_le_sq₀ hw0 ht0).mpr ht.1 have hrbound : r≤a^2*t^2/Real.pi := by rw [hrw] exact div_le_div_of_nonneg_right (mul_le_mul_of_nonneg_left hwtsq (sq_nonneg a)) Real.pi_pos.le have hEt : A*b-h*(V-a^2*t^2/Real.pi)≤a*t := by have he : A*b-h*(V-a^2*t^2/Real.pi)= A*t+(h/Real.pi)*(A^2-a^2)*(1-t^2) := by rw [hva,← hroot] dsimp only [x] ring have hA2 : A^2≤a^2 := (sq_le_sq₀ hA0.le ha.le).mpr haA have hcorr : (h/Real.pi)*(A^2-a^2)*(1-t^2)≤0 := mul_nonpos_of_nonpos_of_nonneg (mul_nonpos_of_nonneg_of_nonpos (div_nonneg hh Real.pi_pos.le) (sub_nonpos.mpr hA2)) htden.le rw [he] have hat := mul_le_mul_of_nonneg_right haA ht0 linarith only [hcorr,hat] have hsb : s≤a^2*t^2/Real.pi+a*d := by have hAd := mul_le_mul_of_nonneg_right haA hd0 linarith only [hdrop,hrbound,hAd] have hbottom' : Real.sqrt (Real.pi*(1-s))≤a*t+x*d := by have hdiff := mul_le_mul_of_nonneg_left hdrop hh have hrr := mul_le_mul_of_nonneg_left hrbound hh have hxd : h*(A*d)=x*d := by dsimp [x]; ring rw [hxd] at hdiff linarith only [hbottom,hdiff,hrr,hEt] have hbsq : Real.pi*(1-s)≤(a*t+x*d)^2 := by have hy : 0≤a*t+x*d := by positivity have hh' := (sq_le_sq₀ (Real.sqrt_nonneg (Real.pi*(1-s))) hy).mpr hbottom' rwa [Real.sq_sqrt (mul_nonneg Real.pi_pos.le (by linarith : 0≤1-s))] at hh' have hnec : 1≤a*d+(a^2*t^2+(a*t+x*d)^2)/Real.pi := by have hh' := mul_le_mul_of_nonneg_left hsb Real.pi_pos.le have hcancel : Real.pi*(a^2*t^2/Real.pi+a*d)=a^2*t^2+Real.pi*a*d := by field_simp rw [hcancel] at hh' have hh2 : 1≤((a*d)*Real.pi+(a^2*t^2+(a*t+x*d)^2))/Real.pi := (le_div_iff₀ Real.pi_pos).mpr (by nlinarith only [hh',hbsq]) simpa only [add_div,mul_div_cancel_right₀ _ hp] using hh2 have hd3 : d^2≤1/3 := by linarith only [hd2,hbmax] have hroot' : Real.pi*(1-t-d^2)=x*(1-t^2) := by exact ((eq_div_iff htden.ne').mp hxroot).symm have hstrict := corner_root_strict (show CornerRootData t d x from ⟨ht0,ht1,hd0,hd3,hx0,hxcap,hroot'⟩) have hnec' : 1≤d+(t^2+(t+x*d)^2)/Real.pi := by have had := mul_le_mul_of_nonneg_right ha1 hd0 have hat : a*t≤t := by simpa using mul_le_mul_of_nonneg_right ha1 ht0 have hatsq : a^2*t^2≤t^2 := by simpa only [mul_pow] using (sq_le_sq₀ (mul_nonneg ha.le ht0) ht0).mpr hat have hsum : (a*t+x*d)^2≤(t+x*d)^2 := by have hat0 : 0≤a*t+x*d := by positivity have hxd0 : 0≤x*d := by positivity exact (sq_le_sq₀ hat0 (add_nonneg ht0 hxd0)).mpr (add_le_add hat (le_refl (x*d))) have hdiv := div_le_div_of_nonneg_right (add_le_add hatsq hsum) Real.pi_pos.le linarith only [hnec,had,hdiv] exact (not_lt_of_ge hnec') hstrict end CubicTorus end end section noncomputable section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology RealInnerProductSpace namespace CubicTorus theorem isMinimizerAt_cylinder_contact_corner_excluded {V : ℝ} (hVrange : V∈Icc TwoVolume.V₁ TwoVolume.V₂) (hcontact : IsLocalMin cylinderRatio V) {E : Set Torus} (hE : MeasurableSet E) (hm : IsMinimizerAt V E) {μ : FiniteMeasure NormalBundle} (hμ : IsNormalMeasure E μ) {N : Cover → Cover} (hN : ContDiff ℝ (⊤ : ℕ∞) N) (hp : ∀ m x,N (x+latticeVector m)=N x) (ha : ∀ᵐ z ∂(μ : Measure NormalBundle),N z.1=(z.2 : Cover)) (hs : ∀ i : Fin 3,coordinateReflection i ⁻¹' E =ᵐ[torusVolume] E) {c : Fin 3 → Bool} (hsg : ∀ (x : Cover) (i : Fin 3), quotientMap x∈frontier (openRepresentative E)∩coordinateHalf i (if c i then 0 else 1/2) →0 decide (j=0 ∨ j=1)))∉openRepresentative E) (ht2 : quotientMap (chamberVertex c (fun j => decide (j=0 ∨ j=2)))∉openRepresentative E) (hb1 : quotientMap (chamberVertex c (fun j => decide (j=1)))∈openRepresentative E) (hb2 : quotientMap (chamberVertex c (fun j => decide (j=2)))∈openRepresentative E) : False := by have hv1 := firstTransition_mem_Ioo_half have hv2 := secondTransition_mem_Ioo_half have hvh : V∈Ioo (0 : ℝ) (1/2) := ⟨hv1.1.trans_le hVrange.1,hVrange.2.trans_lt hv2.2⟩ have hV : V∈Ioo (0 : ℝ) 1 := ⟨hvh.1,by linarith [hvh.2]⟩ obtain ⟨H,hH⟩ := isMinimizerAt_coordinate_multiplier hV hE hm hμ obtain ⟨hA,hAc,hA1,hh,hr,hrV,_,hs1,hb,_,htop,hbottom,hdrop⟩ := isMinimizerAt_four_corner_necessary_data hvh hE hm hμ hN hp ha hs hsg hH ht1 ht2 hb1 hb2 have hpos : 0 decide (k=0 ∨ k=j)) ∘ e)= (fun k => decide (k=i ∨ k=e.symm j)) := by funext k simp only [Function.comp_apply,← Equiv.eq_symm_apply,he0] have hsingle (j : Fin 3) : ((fun k : Fin 3 => decide (k=j)) ∘ e)= (fun k => decide (k=e.symm j)) := by funext k simp only [Function.comp_apply,← Equiv.eq_symm_apply] have ht (j : Fin 3) (hj : j≠i) : quotientMap (chamberVertex c (fun k => decide (k=i ∨ k=j)))∉openRepresentative F := by obtain ⟨k,hk⟩ := fin3_pair_complement i j hj.symm rw [hk] exact fun h => hface k (subset_closure h) have hv (b : Fin 3 → Bool) : quotientMap (chamberVertex (c ∘ e.symm) b)∈openRepresentative (torusCoordinatePermute e ⁻¹' F) ↔ quotientMap (chamberVertex c (b ∘ e))∈openRepresentative F := by rw [openRepresentative_coordinatePermute hF e] change torusCoordinatePermute e (quotientMap (chamberVertex (c ∘ e.symm) b))∈openRepresentative F ↔ _ rw [← quotientMap_coordinatePermute,chamberVertex_coordinatePermute] apply isMinimizerAt_cylinder_contact_corner_excluded hVrange hcontact ((torusCoordinatePermute e).continuous.measurable hF) (isMinimizerAt_coordinatePermute hm e) (isNormalMeasure_coordinatePermute hF hμ e) (coordinatePermutedField_contDiff e hN) (coordinatePermutedField_periodic e hp) (permuted_normal_ae hN.continuous hp ha e) (reflection_invariant_coordinatePermute hs e) (chamberSign_coordinatePermute hF hsg e) · simpa [axialFluxWeight_permute,e] using hi · rw [axialFluxWeight_permute] exact (hw _).2 · rw [hv,hpair] exact ht _ he1 · rw [hv,hpair] exact ht _ he2 · rw [hv,hsingle] exact haxis _ · rw [hv,hsingle] exact haxis _ end CubicTorus end end section noncomputable section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology RealInnerProductSpace namespace CubicTorus lemma cylinder_interval_interior {V : ℝ} (hV : V∈Icc TwoVolume.V₁ TwoVolume.V₂) : V∈Ioo (0 : ℝ) (1/2) := ⟨firstTransition_mem_Ioo_half.1.trans_le hV.1,hV.2.trans_lt secondTransition_mem_Ioo_half.2⟩ lemma profile_eq_tube_of_small_standard {V : ℝ} (hV : V∈Icc TwoVolume.V₁ TwoVolume.V₂) {E : Set Torus} (hm : IsMinimizerAt V E) (hs : SmallStandardRegion V E) : isoperimetricProfile V=Real.sqrt (Real.pi*V) := by have hv := cylinder_interval_interior hV have hP := (hs.bv_data ⟨hv.1,hv.2.le⟩).2.2 rw [candidateProfile_tube hV] at hP rw [isoperimetricProfile_eq_of_isMinimizerAt hm,hP,ENNReal.toReal_ofReal (by positivity)] ring lemma cylinderRatio_eq_of_profile {V : ℝ} (hV : 0 norm_num) (show TwoVolume.V₁∈Icc (0 : ℝ) 1 from ⟨hv1.le,hv1'⟩) (show 0≤1-V/TwoVolume.V₁ by linarith) hb (show (1-V/TwoVolume.V₁)+V/TwoVolume.V₁=1 by ring) have hcenter : (1-V/TwoVolume.V₁)*0+(V/TwoVolume.V₁)*TwoVolume.V₁=V := by field_simp ring simp only [smul_eq_mul] at hh rw [hcenter] at hh simp only [isoperimetricProfile_zero,Real.zero_rpow (by norm_num : (3/2 : ℝ)≠0), mul_zero,zero_add,hlimit,TwoVolume.sphereArea_three_halves hv1.le] at hh have hl : TwoVolume.sphereArea V^(3/2 : ℝ) ≤ isoperimetricProfile V^(3/2 : ℝ) := by rw [TwoVolume.sphereArea_three_halves hV.1] calc (9*Real.pi/2)^(1/2 : ℝ)*V = (V/TwoVolume.V₁)*((9*Real.pi/2)^(1/2 : ℝ)*TwoVolume.V₁) := by field_simp _ ≤ isoperimetricProfile V^(3/2 : ℝ) := hh have hl' := (Real.rpow_le_rpow_iff (TwoVolume.sphereArea_nonneg hV.1) (isoperimetricProfile_nonneg V) (by norm_num : (0 : ℝ)<3/2)).mp hl have hu := isoperimetricProfile_le_candidate (show V∈Icc (0 : ℝ) 1 from ⟨hV.1,hV.2.trans hv1'⟩) rw [candidateProfile_sphere hV,unit_sphereArea] at hu apply le_antisymm _ hl' linarith only [hu] theorem isMinimizerAt_sphere_open_standard {V : ℝ} (hV : V∈Ioo 0 TwoVolume.V₁) {E : Set Torus} (hm : IsMinimizerAt V E) : SmallStandardRegion V E := by have hv1h : TwoVolume.V₁<1/2 := TwoVolume.transitions.2.1.trans TwoVolume.transitions.2.2 have hvh : V∈Ioo (0 : ℝ) (1/2) := ⟨hV.1,hV.2.trans hv1h⟩ have hv : V∈Ioo (0 : ℝ) 1 := ⟨hV.1,by linarith [hvh.2]⟩ rcases Periodic.isMinimizerAt_connected_or_standard_slab hv hm with hc|hs · let F := toMeasurable torusVolume E have hF : MeasurableSet F := measurableSet_toMeasurable _ _ have hFE : F=ᵐ[torusVolume]E := hm.1.1.toMeasurable_ae_eq have hmF := (isMinimizerAt_congr_ae hFE).mpr hm have hcF : IsPreconnected (frontier (openRepresentative F)) := by rwa [openRepresentative_congr_ae hFE] have he : ∀ᶠ W in 𝓝 V,isoperimetricProfile W^(3/2 : ℝ)=(9*Real.pi/2)^(1/2 : ℝ)*W+0 := by filter_upwards [Ioo_mem_nhds hV.1 hV.2] with W hW rw [isoperimetricProfile_sphere_interval ⟨hW.1.le,hW.2.le⟩, TwoVolume.sphereArea_three_halves hW.1.le,add_zero] have hh := Periodic.isMinimizerAt_power_affine_standard_ball hvh hF hmF hcF he have hstd : SmallStandardRegion V F := Or.inl hh exact (smallStandardRegion_congr_ae hFE V).mp hstd · have hs' : SmallStandardRegion V E := by simpa only [StandardRegionAt,ite_eq_left hvh.2.le] using hs.2.2 exact hs' end CubicTorus end end section noncomputable section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology RealInnerProductSpace namespace CubicTorus theorem isoperimetricProfile_slab_interval {V : ℝ} (hV : V∈Icc TwoVolume.V₂ (1-TwoVolume.V₂)) : isoperimetricProfile V=1 := by have hv2 := secondTransition_mem_Ioo_half have hh := isoperimetricProfile_chord hv2.1.le (show 1-TwoVolume.V₂≤1 by change 1-1/Real.pi≤1; linarith [hv2.1]) (show TwoVolume.V₂<1-TwoVolume.V₂ by change 1/Real.pi<1-1/Real.pi; linarith [hv2.2]) V hV rw [isoperimetricProfile_compl (show TwoVolume.V₂∈Icc (0 : ℝ) 1 from ⟨hv2.1.le,by change 1/Real.pi≤1; linarith [hv2.2]⟩)] at hh change isoperimetricProfile (1/Real.pi)+_ ≤ isoperimetricProfile V at hh simp only [TwoVolume.V₂,sub_self,mul_zero,zero_div,add_zero,isoperimetricProfile_second_transition] at hh have hv : V∈Icc (0 : ℝ) 1 := ⟨hv2.1.le.trans hV.1,hV.2.trans (by change 1-1/Real.pi≤1; linarith [hv2.1])⟩ have hu := isoperimetricProfile_le_candidate hv rw [candidateProfile_slab hV] at hu exact le_antisymm (by linarith only [hu]) hh lemma isoperimetricProfile_slab_local_min {V : ℝ} (hV : V∈Ioo TwoVolume.V₂ (1-TwoVolume.V₂)) : IsLocalMin isoperimetricProfile V := by filter_upwards [Ioo_mem_nhds hV.1 hV.2] with W hW rw [isoperimetricProfile_slab_interval ⟨hV.1.le,hV.2.le⟩, isoperimetricProfile_slab_interval ⟨hW.1.le,hW.2.le⟩] theorem isMinimizerAt_small_slab_standard {V : ℝ} (hV : V∈Icc TwoVolume.V₂ (1/2)) {E : Set Torus} (hm : IsMinimizerAt V E) : SmallStandardRegion V E := by rcases eq_or_lt_of_le hV.1 with he|he · subst V exact isMinimizerAt_second_transition_standard hm have hv2 := secondTransition_mem_Ioo_half have hv : V∈Ioo (0 : ℝ) 1 := ⟨hv2.1.trans_le hV.1,by linarith [hV.2]⟩ have hc := isoperimetricProfile_slab_local_min (show V∈Ioo TwoVolume.V₂ (1-TwoVolume.V₂) from ⟨he,by change V<1-1/Real.pi; linarith [hV.2,hv2.2]⟩) have hh := Periodic.isMinimizerAt_profile_local_min_slab hv hm hc simpa only [StandardRegionAt,ite_eq_left hV.2] using hh.2.2 end CubicTorus end end section noncomputable section open MeasureTheory Set Filter open scoped ENNReal NNReal Topology RealInnerProductSpace namespace CubicTorus theorem isMinimizerAt_small_volume_standard {V : ℝ} (hV : V ∈ Ioc 0 (1/2 : ℝ)) {E : Set Torus} (hm : IsMinimizerAt V E) : SmallStandardRegion V E := by by_cases hfirst : V < TwoVolume.V₁ · exact isMinimizerAt_sphere_open_standard ⟨hV.1,hfirst⟩ hm · by_cases hsecond : V ≤ TwoVolume.V₂ · exact isMinimizerAt_cylinder_interval_standard ⟨le_of_not_gt hfirst,hsecond⟩ hm · exact isMinimizerAt_small_slab_standard ⟨(lt_of_not_ge hsecond).le,hV.2⟩ hm theorem isMinimizerAt_all_volume_standard {V : ℝ} (hV : V ∈ Ioo 0 1) {E : Set Torus} (hm : IsMinimizerAt V E) : StandardRegionAt V E := by unfold StandardRegionAt split_ifs with hv · exact isMinimizerAt_small_volume_standard ⟨hV.1,hv⟩ hm · have hvc : 1-V ∈ Ioc (0 : ℝ) (1/2) := by constructor <;> linarith [hV.2] exact isMinimizerAt_small_volume_standard hvc ((isMinimizerAt_compl ⟨hV.1.le,hV.2.le⟩).2 hm) theorem perimeter_eq_candidate_of_minimizer {V : ℝ} (hV : V ∈ Ioo 0 1) {E : Set Torus} (hm : IsMinimizerAt V E) : perimeter E = ENNReal.ofReal (candidateProfile V) := ((isMinimizerAt_all_volume_standard hV hm).bv_data hV).2.2 theorem StandardRegionAt.isMinimizerAt {V : ℝ} (hV : V ∈ Ioo 0 1) {E : Set Torus} (hs : StandardRegionAt V E) : IsMinimizerAt V E := by obtain ⟨F,hmF⟩ := exists_isMinimizerAt hV obtain ⟨hE,heV,heP⟩ := hs.bv_data hV have hfP := perimeter_eq_candidate_of_minimizer hV hmF refine ⟨hE,heV,?_⟩ intro G hG hgV rw [heP,←hfP] exact hmF.2.2 G hG hgV theorem unit_cubic_isoperimetric (V : ℝ) (hV : V ∈ Ioo 0 1) : (∃ E : Set Torus, IsMinimizerAt V E) ∧ (∀ E : Set Torus, IsMinimizerAt V E → perimeter E = ENNReal.ofReal (candidateProfile V)) ∧ (∀ E : Set Torus, IsMinimizerAt V E ↔ StandardRegionAt V E) := by refine ⟨exists_isMinimizerAt hV,?_,?_⟩ · intro E hm exact perimeter_eq_candidate_of_minimizer hV hm · intro E exact ⟨isMinimizerAt_all_volume_standard hV,StandardRegionAt.isMinimizerAt hV⟩ end CubicTorus end end end OAI