Offline · exact source
Exact Lean source

TensorCyclicError

formalization/Cloning/TensorCyclicError.lean

Source hash: a6eacaa0d3596427b3ea2ea3848e68b540a1845e43de4d47ad04e855dee7a4df

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.TensorRootBounds
2 
3/-! Quantitative physical-root errors and their fixed-cutoff asymptotics. -/
4noncomputable section
5open scoped Topology
6open Filter
7namespace Cloning.TensorLie
8set_option maxHeartbeats 1000000
9set_option backward.isDefEq.respectTransparency false
10 
11def rootError (r : ℕ) (δ : ℝ) : ℝ :=
12  max (2 * r / δ) (Real.sqrt (((r : ℝ) + 1) / δ + 2 * r * ((r : ℝ) + 1) / δ ^ 2))
13 
14theorem rootError_nonneg (r : ℕ) (δ : ℝ) : 0 ≤ rootError r δ :=
15  (Real.sqrt_nonneg _).trans (le_max_right _ _)
16 
17theorem rootError_le_one (r : ℕ) {δ : ℝ} (hδ : 2 * ((r : ℝ) + 1) ≤ δ) :
18    rootError r δ ≤ 1 := by
19  have hr : 0 ≤ (r : ℝ) := Nat.cast_nonneg r
20  have hδpos : 0 < δ := by linarith
21  apply max_le
22  · exact (div_le_iff₀ hδpos).mpr (by linarith)
23  · apply Real.sqrt_le_one.mpr
24    have hfirst : ((r : ℝ) + 1) / δ ≤ 1 / 2 :=
25      (div_le_iff₀ hδpos).mpr (by linarith)
26    have hsecond : 2 * (r : ℝ) * ((r : ℝ) + 1) / δ ^ 2 ≤ 1 / 2 := by
27      apply (div_le_iff₀ (sq_pos_of_pos hδpos)).mpr
28      have hs : (2 * ((r : ℝ) + 1)) ^ 2 ≤ δ ^ 2 := by nlinarith
29      nlinarith [sq_nonneg (r : ℝ)]
30    linarith
31 
32theorem rootError_mono {r s : ℕ} (hrs : r ≤ s) {δ : ℝ} (hδ : 0 ≤ δ) :
33    rootError r δ ≤ rootError s δ := by
34  apply max_le_max
35  · gcongr
36  · apply Real.sqrt_le_sqrt
37    gcongr
38 
39theorem rootError_tendsto_zero (r : ℕ) (δ : ℕ → ℝ) (hδ : Tendsto δ atTop atTop) :
40    Tendsto (fun n => rootError r (δ n)) atTop (𝓝 0) := by
41  have hi : Tendsto (fun n => (δ n)⁻¹) atTop (𝓝 0) := tendsto_inv_atTop_zero.comp hδ
42  have hfirst : Tendsto (fun n => ((r : ℝ) + 1) / δ n) atTop (𝓝 0) := by
43    simpa only [div_eq_mul_inv, mul_zero] using hi.const_mul ((r : ℝ) + 1)
44  have hsecond : Tendsto (fun n => 2 * (r : ℝ) * ((r : ℝ) + 1) / δ n ^ 2)
45      atTop (𝓝 0) := by
46    simpa only [div_eq_mul_inv, inv_pow, zero_pow (by omega : 2 ≠ 0), mul_zero]
47      using (hi.pow 2).const_mul (2 * (r : ℝ) * ((r : ℝ) + 1))
48  have hsqrt := (hfirst.add hsecond).sqrt
49  have hdiag := hi.const_mul (2 * (r : ℝ))
50  simpa only [rootError, div_eq_mul_inv, mul_zero, zero_add, Real.sqrt_zero, max_self]
51    using hdiag.max hsqrt
52 
53end Cloning.TensorLie