import OAI.Probability.InvariantIsing.Magnetic.MagneticScalarContinuation import OAI.Probability.InvariantIsing.Magnetic.MagneticBiasEndpoint namespace OAI /-! Endpoint decay for the literal finite-field conditional square levels. The inverse-coordinate weighted curvature has zero boundary values, proved from bounded ordinary derivatives rather than an asymptotic expansion. -/ noncomputable section open Filter Set open scoped Topology namespace InvariantIsing lemma fieldBiasMean_tendsto_one (h : FieldStep) : Tendsto (fieldBiasMean h) atTop (๐“ (1 : โ„)) := by apply tendsto_order.2 constructor ยท intro l hl let s := (max l (-1) + 1) / 2 have hm : max l (-1 : โ„) < 1 := max_lt hl (by norm_num) have hs : |s| < 1 := by apply abs_lt.mpr dsimp only [s] constructor <;> linarith [le_max_right l (-1 : โ„)] have hls : l < s := by dsimp only [s]; linarith [le_max_left l (-1 : โ„)] filter_upwards [eventually_gt_atTop (magneticBias h s)] with b hb have hh := strictMono_fieldBiasMean h hb rw [fieldBiasMean_magneticBias h hs] at hh exact hls.trans hh ยท intro u hu exact Eventually.of_forall fun b => (fieldBiasMean_strict_bounds h b).2.trans hu lemma fieldBiasMean_tendsto_neg_one (h : FieldStep) : Tendsto (fieldBiasMean h) atBot (๐“ (-1 : โ„)) := by apply tendsto_order.2 constructor ยท intro l hl exact Eventually.of_forall fun b => hl.trans (fieldBiasMean_strict_bounds h b).1 ยท intro u hu let s := (min u 1 - 1) / 2 have hm : (-1 : โ„) < min u 1 := lt_min hu (by norm_num) have hs : |s| < 1 := by apply abs_lt.mpr dsimp only [s] constructor <;> linarith [min_le_right u (1 : โ„)] have hsu : s < u := by dsimp only [s]; linarith [min_le_left u (1 : โ„)] filter_upwards [eventually_lt_atBot (magneticBias h s)] with b hb have hh := strictMono_fieldBiasMean h hb rw [fieldBiasMean_magneticBias h hs] at hh exact hh.trans hsu lemma magneticLevelAtBias_tendsto_one (h : FieldStep) (i : Fin (h.depth + 1)) : Tendsto (fun b => magneticLevelAtBias h b i) atTop (๐“ (1 : โ„)) := by have hs := (fieldBiasMean_tendsto_one h).pow 2 norm_num only [one_pow] at hs exact hs.squeeze tendsto_const_nhds (fun b => fieldBiasMean_sq_le_magneticLevel h b i) (fun b => (magneticLevelAtBias_mem_unit h b i).2) lemma magneticLevelAtBias_tendsto_neg_one (h : FieldStep) (i : Fin (h.depth + 1)) : Tendsto (fun b => magneticLevelAtBias h b i) atBot (๐“ (1 : โ„)) := by have hs := (fieldBiasMean_tendsto_neg_one h).pow 2 norm_num only [neg_sq, one_pow] at hs exact hs.squeeze tendsto_const_nhds (fun b => fieldBiasMean_sq_le_magneticLevel h b i) (fun b => (magneticLevelAtBias_mem_unit h b i).2) lemma magnetic_derivative_tendsto_zero_atBot {F G D : โ„ โ†’ โ„} {c L : โ„} (hL : 0 โ‰ค L) (hF : โˆ€ x, HasDerivAt F (G x) x) (hG : โˆ€ x, HasDerivAt G (D x) x) (hD : โˆ€ x, |D x| โ‰ค L) (hlimit : Tendsto F atBot (๐“ c)) : Tendsto G atBot (๐“ 0) := by have hdF (x : โ„) : HasDerivAt (fun y => F (-y)) (-G (-x)) x := by convert (hF (-x)).comp x (hasDerivAt_neg x) using 1 <;> first | rfl | simp have hdG (x : โ„) : HasDerivAt (fun y => -G (-y)) (D (-x)) x := by convert ((hG (-x)).comp x (hasDerivAt_neg x)).neg using 1 <;> first | rfl | simp have hh := magnetic_derivative_tendsto_zero hL hdF hdG (fun x => hD (-x)) (hlimit.comp tendsto_neg_atTop_atBot) simpa only [Function.comp_def, neg_neg, neg_zero] using hh.neg.comp tendsto_neg_atBot_atTop lemma MagneticContinuationJet.first_tendsto_zero (J : MagneticContinuationJet) {c : โ„} (hJ : Tendsto J.value atTop (๐“ c)) : Tendsto J.first atTop (๐“ 0) := by obtain โŸจL, hL, bLโŸฉ := J.bSecond exact magnetic_derivative_tendsto_zero hL J.dValue J.dFirst bL hJ lemma MagneticContinuationJet.second_tendsto_zero (J : MagneticContinuationJet) {c : โ„} (hJ : Tendsto J.value atTop (๐“ c)) : Tendsto J.second atTop (๐“ 0) := by obtain โŸจL, hL, bLโŸฉ := J.bThird exact magnetic_derivative_tendsto_zero hL J.dFirst J.dSecond bL (J.first_tendsto_zero hJ) lemma MagneticContinuationJet.first_tendsto_zero_atBot (J : MagneticContinuationJet) {c : โ„} (hJ : Tendsto J.value atBot (๐“ c)) : Tendsto J.first atBot (๐“ 0) := by obtain โŸจL, hL, bLโŸฉ := J.bSecond exact magnetic_derivative_tendsto_zero_atBot hL J.dValue J.dFirst bL hJ lemma MagneticContinuationJet.second_tendsto_zero_atBot (J : MagneticContinuationJet) {c : โ„} (hJ : Tendsto J.value atBot (๐“ c)) : Tendsto J.second atBot (๐“ 0) := by obtain โŸจL, hL, bLโŸฉ := J.bThird exact magnetic_derivative_tendsto_zero_atBot hL J.dFirst J.dSecond bL (J.first_tendsto_zero_atBot hJ) lemma magneticContinuation_weighted_endpoint (h : FieldStep) (i : Fin (h.depth + 1)) (J : MagneticContinuationJet) (hJ : J.value = fun b => magneticLevelAtBias h b i) : Tendsto (fun s => J.second (magneticBias h s) - J.first (magneticBias h s) * (fieldBiasThird h (magneticBias h s) / fieldBiasCurvature h (magneticBias h s))) (๐“[<] (1 : โ„)) (๐“ 0) := by obtain โŸจL, hL, bLโŸฉ := J.bSecond obtain โŸจK, hK, bKโŸฉ := J.bThird have hv : Tendsto J.value atTop (๐“ (1 : โ„)) := by rw [hJ] exact magneticLevelAtBias_tendsto_one h i exact (magnetic_weighted_continuation_limit h hL hK J.dValue J.dFirst J.dSecond bL bK hv).comp (magneticBias_tendsto_one h) lemma magneticContinuation_weighted_neg_endpoint (h : FieldStep) (i : Fin (h.depth + 1)) (J : MagneticContinuationJet) (hJ : J.value = fun b => magneticLevelAtBias h b i) : Tendsto (fun s => J.second (magneticBias h s) - J.first (magneticBias h s) * (fieldBiasThird h (magneticBias h s) / fieldBiasCurvature h (magneticBias h s))) (๐“[>] (-1 : โ„)) (๐“ 0) := by have hv : Tendsto J.value atBot (๐“ (1 : โ„)) := by rw [hJ] exact magneticLevelAtBias_tendsto_neg_one h i have hg := J.first_tendsto_zero_atBot hv have hd := J.second_tendsto_zero_atBot hv have hp : Tendsto (fun b => J.first b * (fieldBiasThird h b / fieldBiasCurvature h b)) atBot (๐“ 0) := by apply squeeze_zero_norm (fun b => ?_) (show Tendsto (fun b => |J.first b| * magneticThirdRatioCap (scalarFieldIncrements h)) atBot (๐“ 0) by simpa only [Real.norm_eq_abs, abs_zero, zero_mul] using hg.norm.mul_const (magneticThirdRatioCap (scalarFieldIncrements h))) rw [Real.norm_eq_abs, abs_mul] exact mul_le_mul_of_nonneg_left (fieldBiasThird_quotient_bound h b) (abs_nonneg _) have hh := hd.sub hp simp only [sub_zero] at hh exact hh.comp (magneticBias_tendsto_neg_one h) end InvariantIsing end end OAI