Offline · exact source
Exact Lean source

PCTProjectorPurityEnvelopeRate

formalization/Cloning/PCTProjectorPurityEnvelopeRate.lean

Source hash: 47b9e49eb83cfa1235caad57fe7e1694fe0349cd4e054b4f7eeb0835a29c9478

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.PCTProjectorPurityEnvelope
2import Cloning.ScalarTaylorRemainder
3 
4/-! Explicit next-order envelope errors and target-error bracketing. These
5are scalar consequences of the physical two-envelope theorem; no convergence
6of the physical fidelity at fixed gain is assumed. -/
7noncomputable section
8open scoped Topology
9open Filter Asymptotics
10namespace Cloning.PCTProjectorPurity
11 
12private theorem linear_remainder {f : ℝ→ℝ} (hf : ContDiffAt ℝ 2 f 0) :
13    (fun x=>f x-(f 0+deriv f 0*x)) =O[𝓝 (0:ℝ)] (fun x=>x^2) := by
14  have h := ScalarTaylor.local_taylor_isBigO 1 hf
15  convert h using 1
16  · ext x
17    simp only [taylorWithinEval_succ,taylor_within_zero_eval,iteratedDerivWithin_univ,
18      iteratedDeriv_one,smul_eq_mul,sub_zero]
19    norm_num
20    ring
21  · simp
22 
23/-- The internal purity correction has the fourth-order remainder stated in
24the manuscript, including its exact quadratic coefficient. -/
25theorem internalError_quartic_remainder (b : ℕ) :
26    (fun δ=>internalError b δ-2*(b:ℝ)*δ^2) =O[𝓝 (0:ℝ)] (fun δ=>δ^4) := by
27  let f : ℝ→ℝ := fun x=>(1-4*x)^(-((b:ℝ)/2))-1
28  have hf : ContDiffAt ℝ 2 f 0 :=
29    ((contDiffAt_const.sub (contDiffAt_const.mul contDiffAt_id)).rpow_const_of_ne
30      (by norm_num)).sub contDiffAt_const
31  have hd : HasDerivAt f (2*(b:ℝ)) 0 := by
32    have h := (((hasDerivAt_id (0:ℝ)).const_mul 4).const_sub 1).rpow_const
33      (p := -((b:ℝ)/2)) (Or.inl (by norm_num))
34    convert h.sub_const 1 using 1 <;> simp [f] <;> ring
35  have h := (linear_remainder hf).comp_tendsto
36    (show Tendsto (fun δ:ℝ=>δ^2) (𝓝 0) (𝓝 0) by
37      simpa using (tendsto_id : Tendsto (fun δ:ℝ=>δ) (𝓝 0) (𝓝 0)).pow 2)
38  simpa [f,internalError,hd.deriv,Function.comp_def,← pow_mul] using h
39 
40theorem lowerEnvelope_quadratic_remainder (a : ℕ) :
41    (fun δ=>lowerEnvelope a δ-(a:ℝ)*δ) =O[𝓝 (0:ℝ)] (fun δ=>δ^2) := by
42  have hf : ContDiffAt ℝ 2 (lowerEnvelope a) 0 :=
43    contDiffAt_const.sub ((contDiffAt_const.add contDiffAt_id).rpow_const_of_ne
44      (by norm_num))
45  simpa [lowerEnvelope,supportLimit,(lowerEnvelope_hasDerivAt_zero a).deriv] using
46    linear_remainder hf
47 
48theorem upperEnvelope_quadratic_remainder (a b : ℕ) :
49    (fun δ=>upperEnvelope a b δ-(a:ℝ)*δ) =O[𝓝 (0:ℝ)] (fun δ=>δ^2) := by
50  have hs : ContDiffAt ℝ 2 (supportLimit a) 0 :=
51    (contDiffAt_const.add contDiffAt_id).rpow_const_of_ne (by norm_num)
52  have hi : ContDiffAt ℝ 2 (internalError b) 0 :=
53    ((contDiffAt_const.sub (contDiffAt_const.mul (contDiffAt_id.pow 2))).rpow_const_of_ne
54      (by norm_num)).sub contDiffAt_const
55  have hf : ContDiffAt ℝ 2 (upperEnvelope a b) 0 :=
56    contDiffAt_const.sub (hs.mul (contDiffAt_const.sub hi))
57  simpa [upperEnvelope,supportLimit,internalError,(upperEnvelope_hasDerivAt_zero a b).deriv]
58    using linear_remainder hf
59 
60private theorem scaled_ratio_tendsto {f : ℝ→ℝ} {a : ℝ}
61    (hf0 : f 0=0) (hf : HasDerivAt f a 0) (c : ℝ) :
62    Tendsto (fun ε=>f (c*ε)/ε) (𝓝[≠] (0:ℝ)) (𝓝 (a*c)) := by
63  have hc : HasDerivAt (fun ε=>f (c*ε)) (a*c) 0 := by
64    have hf' : HasDerivAt f a (c * id (0:ℝ)) := by simpa using hf
65    simpa using hf'.comp 0 ((hasDerivAt_id (0:ℝ)).const_mul c)
66  simpa [hf0,smul_eq_mul,div_eq_mul_inv,mul_comm] using hc.tendsto_slope_zero
67 
68/-- For a positive rank-boundary coefficient, the two envelopes bracket a
69small target error at gains (1±η)ε/a. This is an iterated-limit certificate. -/
70theorem envelopes_target_bracket (a b : ℕ) (ha : 0<a) {η : ℝ}
71    (hη : 0<η) (hη1 : η<1) :
72    ∀ᶠ ε in 𝓝[>] (0:ℝ),
73      upperEnvelope a b ((1-η)*ε/a)<ε ∧
74      ε<lowerEnvelope a ((1+η)*ε/a) := by
75  have ha0 : (a:ℝ)≠0 := by exact_mod_cast Nat.ne_of_gt ha
76  have hl := scaled_ratio_tendsto
77    (show lowerEnvelope a 0=0 by simp [lowerEnvelope,supportLimit])
78    (lowerEnvelope_hasDerivAt_zero a) ((1+η)/a)
79  have hu := scaled_ratio_tendsto
80    (show upperEnvelope a b 0=0 by simp [upperEnvelope,supportLimit,internalError])
81    (upperEnvelope_hasDerivAt_zero a b) ((1-η)/a)
82  have hal : (a:ℝ)*((1+η)/a)=1+η := by field_simp
83  have hau : (a:ℝ)*((1-η)/a)=1-η := by field_simp
84  rw [hal] at hl
85  rw [hau] at hu
86  have hmono : 𝓝[>] (0:ℝ)≤𝓝[≠] (0:ℝ) :=
87    nhdsWithin_mono _ (by intro x hx; simpa using ne_of_gt hx)
88  have hl' := (hl.mono_left hmono).eventually (Ioi_mem_nhds (show 1<1+η by linarith))
89  have hu' := (hu.mono_left hmono).eventually (Iio_mem_nhds (show 1-η<1 by linarith))
90  filter_upwards [hl',hu',self_mem_nhdsWithin] with ε hlε huε hε
91  have hε0 : 0<ε := hε
92  constructor
93  · have h := (div_lt_one hε0).mp huε
94    simpa [div_eq_mul_inv,mul_assoc,mul_left_comm,mul_comm] using h
95  · have h := (one_lt_div hε0).mp hlε
96    simpa [div_eq_mul_inv,mul_assoc,mul_left_comm,mul_comm] using h
97 
98end Cloning.PCTProjectorPurity