File size: 4,906 Bytes
a89d282
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import OAI.Probability.InvariantIsing.Magnetic.MagneticContinuationEndpoint

namespace OAI

/-! Ordinary continuation derivatives pulled back through the actual
optimizing bias. The weighted second derivative has zero boundary limits. -/

noncomputable section
open Filter Set
open scoped Topology

namespace InvariantIsing

def magneticContinuationPullback (h : FieldStep) (J : MagneticContinuationJet) (s : ℝ) : ℝ :=
  J.value (magneticBias h s)

def magneticContinuationPullbackFirst (h : FieldStep) (J : MagneticContinuationJet) (s : ℝ) : ℝ :=
  J.first (magneticBias h s) / fieldBiasCurvature h (magneticBias h s)

def magneticContinuationPullbackSecond (h : FieldStep) (J : MagneticContinuationJet) (s : ℝ) : ℝ :=
  J.second (magneticBias h s) / (fieldBiasCurvature h (magneticBias h s)) ^ 2 -
    J.first (magneticBias h s) * fieldBiasThird h (magneticBias h s) /
      (fieldBiasCurvature h (magneticBias h s)) ^ 3

lemma magneticContinuationPullback_hasDerivAt (h : FieldStep) (J : MagneticContinuationJet)
    {s : ℝ} (hs : |s| < 1) :
    HasDerivAt (magneticContinuationPullback h J)
      (magneticContinuationPullbackFirst h J s) s := by
  convert (J.dValue (magneticBias h s)).comp s (hasDerivAt_magneticBias h hs) using 1
  · rfl
  · simp only [magneticContinuationPullbackFirst, div_eq_mul_inv]

lemma magneticContinuationPullbackFirst_hasDerivAt (h : FieldStep) (J : MagneticContinuationJet)
    {s : ℝ} (hs : |s| < 1) :
    HasDerivAt (magneticContinuationPullbackFirst h J)
      (magneticContinuationPullbackSecond h J s) s := by
  have hZ : HasDerivAt (magneticBias h) (1 / fieldBiasCurvature h (magneticBias h s)) s := by
    simpa only [one_div] using hasDerivAt_magneticBias h hs
  exact inverse_mean_pullback_quotient (fieldBiasCurvature_pos h (magneticBias h s)).ne'
    hZ rfl rfl (J.dFirst (magneticBias h s)) (hasDerivAt_fieldBiasCurvature h (magneticBias h s))

lemma magneticContinuationPullback_second_deriv (h : FieldStep) (J : MagneticContinuationJet)
    {s : ℝ} (hs : |s| < 1) :
    deriv (deriv (magneticContinuationPullback h J)) s =
      magneticContinuationPullbackSecond h J s := by
  have hh := magneticContinuationPullbackFirst_hasDerivAt h J hs
  apply HasDerivAt.deriv
  apply hh.congr_of_eventuallyEq
  filter_upwards [Ioo_mem_nhds (abs_lt.mp hs).1 (abs_lt.mp hs).2] with t ht
  exact (magneticContinuationPullback_hasDerivAt h J (abs_lt.mpr ht)).deriv

lemma magneticContinuation_weighted_second (h : FieldStep) (J : MagneticContinuationJet) (s : ℝ) :
    (magneticCurvature h s) ^ 2 * magneticContinuationPullbackSecond h J s =
      J.second (magneticBias h s) - J.first (magneticBias h s) *
        (fieldBiasThird h (magneticBias h s) / fieldBiasCurvature h (magneticBias h s)) := by
  unfold magneticCurvature magneticContinuationPullbackSecond
  field_simp [(fieldBiasCurvature_pos h (magneticBias h s)).ne']

lemma magneticFieldLevel_weighted_second_endpoint (h : FieldStep) (i : Fin (h.depth + 1)) :
    Tendsto (fun s => (magneticCurvature h s) ^ 2 *
      deriv (deriv (fun t => magneticFieldLevel h t i)) s)
      (𝓝[<] (1 : ℝ)) (𝓝 0) := by
  obtain ⟨J, hJ⟩ := magneticLevelAtBias_has_bounded_jet h i
  have hvalue : magneticContinuationPullback h J = fun t => magneticFieldLevel h t i := by
    funext t
    change J.value (magneticBias h t) = magneticLevelAtBias h (magneticBias h t) i
    exact congrFun hJ (magneticBias h t)
  apply (magneticContinuation_weighted_endpoint h i J hJ).congr'
  have hN : ∀ᶠ s : ℝ in 𝓝[<] (1 : ℝ), -1 < s :=
    (show ∀ᶠ s : ℝ in 𝓝 (1 : ℝ), -1 < s from Ioi_mem_nhds (by norm_num)).filter_mono
      nhdsWithin_le_nhds
  filter_upwards [hN, self_mem_nhdsWithin] with s hs hs1
  rw [← hvalue, magneticContinuationPullback_second_deriv h J (abs_lt.mpr ⟨hs, hs1⟩)]
  exact (magneticContinuation_weighted_second h J s).symm

lemma magneticFieldLevel_weighted_second_neg_endpoint (h : FieldStep) (i : Fin (h.depth + 1)) :
    Tendsto (fun s => (magneticCurvature h s) ^ 2 *
      deriv (deriv (fun t => magneticFieldLevel h t i)) s)
      (𝓝[>] (-1 : ℝ)) (𝓝 0) := by
  obtain ⟨J, hJ⟩ := magneticLevelAtBias_has_bounded_jet h i
  have hvalue : magneticContinuationPullback h J = fun t => magneticFieldLevel h t i := by
    funext t
    change J.value (magneticBias h t) = magneticLevelAtBias h (magneticBias h t) i
    exact congrFun hJ (magneticBias h t)
  apply (magneticContinuation_weighted_neg_endpoint h i J hJ).congr'
  have hN : ∀ᶠ s : ℝ in 𝓝[>] (-1 : ℝ), s < 1 :=
    (show ∀ᶠ s : ℝ in 𝓝 (-1 : ℝ), s < 1 from Iio_mem_nhds (by norm_num)).filter_mono
      nhdsWithin_le_nhds
  filter_upwards [hN, self_mem_nhdsWithin] with s hs hs1
  rw [← hvalue, magneticContinuationPullback_second_deriv h J (abs_lt.mpr ⟨hs1, hs⟩)]
  exact (magneticContinuation_weighted_second h J s).symm

end InvariantIsing

end

end OAI