Offline · exact source
Exact Lean source

CloningValueExpansionClassical

formalization/Cloning/CloningValueExpansionClassical.lean

Source hash: 2a8da2943103a4cca3060a5e1a3f0a1859e6ecd5ef1faa2f99fbd31307f53321

Full source copied without mathematical changes from the snapshot whose input hash matches the passing audit. Select a line number for a stable source pointer.

The declarations belong to the compiled inventory covered by the project’s shared axiom audit. That audit records an aggregate union, without attributing axioms to individual declarations.

Declarations in this module
1import Cloning.CloningValueExpansionThermal
2import Cloning.Main
3 
4/-! Classical Gaussian affinity and real powers preserve the exact cubic error. -/
5noncomputable section
6open scoped Topology BigOperators
7open Filter Asymptotics
8namespace Cloning.ValueExpansion
9set_option backward.isDefEq.respectTransparency false
10set_option maxHeartbeats 500000
11 
12theorem HasQuadraticExpansion.rpow {f : ℝ→ℝ} {a : ℝ}
13    (hf : HasQuadraticExpansion f a) (c : ℝ) :
14    HasQuadraticExpansion (fun x=>f x^c) (c*a) := by
15  have hc : ContDiffAt ℝ 2 (fun y : ℝ=>(1+y)^c) 0 :=
16    (contDiffAt_const.add contDiffAt_id).rpow_const_of_ne (by norm_num)
17  have hd : HasDerivAt (fun y : ℝ=>(1+y)^c) c 0 := by
18    convert ((hasDerivAt_id (0:ℝ)).const_add 1).rpow_const (Or.inl (by norm_num)) using 1 <;> simp
19  have hr : (fun y : ℝ=>(1+y)^c-(1+c*y)) =O[𝓝 (0:ℝ)] (fun y=>y^2) := by
20    have h := ScalarTaylor.local_taylor_isBigO 1 hc
21    convert h using 1
22    · ext x
23      simp only [taylorWithinEval_succ,taylor_within_zero_eval,
24        iteratedDerivWithin_univ,iteratedDeriv_one,smul_eq_mul,sub_zero]
25      norm_num
26      rw [hd.deriv]
27      ring
28    · simp
29  have hu : Tendsto (fun x=>f x-1) (𝓝 0) (𝓝 0) := by
30    simpa using hf.tendsto.sub_const 1
31  have hu2 : (fun x=>f x-1) =O[𝓝 (0:ℝ)] (fun x=>x^2) := by
32    have h := (hf.trans (isLittleO_pow_pow (by decide : 2<3)).isBigO).sub
33      (isBigO_const_mul_self a (fun x : ℝ=>x^2) (𝓝 0))
34    convert h using 1
35    ext x
36    ring
37  have hu4 : (fun x=>(f x-1)^2) =O[𝓝 (0:ℝ)] (fun x=>x^4) := by
38    convert hu2.mul hu2 using 1 <;> ext x <;> ring
39  have hcomp := ((hr.comp_tendsto hu).trans hu4).trans
40    (isLittleO_pow_pow (by decide : 3<4)).isBigO
41  have hh := hcomp.add (hf.const_mul_left c)
42  dsimp only [HasQuadraticExpansion] at *
43  convert hh using 1
44  ext x
45  simp only [Function.comp_apply]
46  rw [show 1+(f x-1)=f x by ring]
47  ring
48 
49theorem classicalBase_squared_expansion (c : ℝ) :
50    HasQuadraticExpansion (fun x=>Thermal.classicalBase (1+c*x)^2) (c^2/4) := by
51  let f : ℝ→ℝ := fun x=>c*x/(2+c*x)
52  have hc : ContDiffAt ℝ 2 f 0 := by
53    dsimp only [f]
54    fun_prop (disch:=norm_num)
55  have hzero : f 0=0 := by simp [f]
56  have hd : HasDerivAt f (c/2) 0 := by
57    have h := ((hasDerivAt_id (0:ℝ)).const_mul c).div
58      (((hasDerivAt_id (0:ℝ)).const_mul c).const_add 2) (by norm_num)
59    convert h using 1 <;> simp only [f,id_eq] <;> ring
60  have h := (square_zero_remainder hc hzero hd).neg_left
61  have he : ∀ᶠx : ℝ in 𝓝 0,0<1+c*x :=
62    (show ContinuousAt (fun x : ℝ=>1+c*x) 0 by fun_prop)
63      (Ioi_mem_nhds (by norm_num))
64  apply h.congr' ?_ (Eventually.of_forall (fun _=>rfl))
65  filter_upwards [he] with x hx
66  dsimp only [HasQuadraticExpansion,Thermal.classicalBase,f]
67  simp only [div_pow,mul_pow,Real.sq_sqrt hx.le]
68  have hd : 2+c*x≠0 := by linarith
69  rw [show 1+(1+c*x)=2+c*x by ring]
70  field_simp [hd]
71  <;> ring
72 
73theorem classicalValue_squared_expansion (c : ℝ) (d : ℕ) :
74    HasQuadraticExpansion (fun x=>classicalValue (1+c*x) d^2)
75      (((d:ℝ)-1)*c^2/8) := by
76  have h := (classicalBase_squared_expansion c).rpow (((d:ℝ)-1)/2)
77  have he : ∀ᶠx : ℝ in 𝓝 0,0<1+c*x :=
78    (show ContinuousAt (fun x : ℝ=>1+c*x) 0 by fun_prop)
79      (Ioi_mem_nhds (by norm_num))
80  apply h.congr' ?_ (Eventually.of_forall (fun _=>rfl))
81  filter_upwards [he] with x hx
82  dsimp only [HasQuadraticExpansion,classicalValue]
83  have hb := (Thermal.classicalBase_pos hx).le
84  rw [pow_two,Real.mul_rpow hb hb,←pow_two]
85  congr 1
86  ring
87 
88end Cloning.ValueExpansion