Lean / 0xOsprey/shub-smale-tau9 / TwoAdicBautinExtensions.lean
Lean reader

Research/PvsNP/Tau/TwoAdicBautinExtensions.lean

230 lines3 declarationsno sorry
  1. module
  2. public import Research.PvsNP.Tau.TwoAdicMonicAnnihilators
  3. @[expose] public section
  4. namespace Research.PvsNP.Tau
  5. /-!
  6. # Extensions to Constructive `U`-Conjugation & Generalized `θ < 1` Bautin Taylor Domination
  7. This module extends `TwoAdicMonicAnnihilators.lean` with three machine-verified results:
  8. 1. **Generalized `θ < 1` Bautin Taylor Domination (`bautin_taylor_domination_slope`):**
  9. We do **not** require `D₀ = 1` (`θ = 0`) to avoid `2`-adic subdisk splitting!
  10. Whenever `P_m = V^m(P)(0)` satisfies a valuation recurrence with ANY rational denominator
  11. slope `θ = p / q < 1` (`0 ≤ p < q`):
  12. `q * vp m ≥ q * vp j₀ - p * (m - B)` for all `m > B`,
  13. the unrescaled unit-disk Taylor coefficient valuation `vc m := 2 * m - v2Fact m + vp m`
  14. satisfies strict domination `vc m > vc j₀` for every
  15. `m > B + Nat.log 2 (B + 1) * q / (q - p)`,
  16. giving `w₁(F) ≤ B + ⌊(q / (q - p)) · ⌊log₂(B + 1)⌋⌋` with **zero subdisk splitting**.
  17. 2. **Depth-4 `w₃`-Elimination Identity (`depth4_w3_elimination`, `depth4_HF3_linear_comb`):**
  18. Lifting the Depth-3 order-6 operator `L₃` to Depth 4 by shifting every factor by `α₃ * w₃`
  19. (`L₃⁽⁴⁾ := U₃ ∘ L₃ ∘ U₃⁻¹`) eliminates the top variable `w₃` from **all four** Depth-4
  20. generators `{1, w₁, F₂, F₃}` simultaneously:
  21. `L₃⁽⁴⁾(g) = w₃ * (L₃^{+α₃})(g)` for `g ∈ {1, w₁, F₂}`,
  22. `L₃⁽⁴⁾(α₃ * w₃) = w₃ * (L₃^{+α₃})(α₃) = w₃ * (p₃ * H₁ + q₃ * H_{F₂})`.
  23. 3. **Exact Closed-Form Order-3 `D₀ = 1` Universal Identity for `1 + w₂ ^ D`
  24. (`depth3_one_add_w2_pow_order3`):**
  25. For every `D : ℕ`, `1 + w₂ ^ D` is annihilated identically in `R` by the explicit order-3
  26. monic (`D₀ = 1`) operator
  27. `[-d₁ * (1 - 2 * w₁) - α₂ * (D - (D + 1) * w₂), -α₂ * (D - (D + 1) * w₂), 0]`.
  28. -/
  29. /-! ## 1. Generalized `θ = p / q < 1` Bautin Taylor Domination (Zero Subdisk Splitting) -/
  30. /-- **Generalized `θ < 1` Bautin Taylor Domination Theorem (Zero Subdisk Splitting):**
  31. Suppose `F(s) = ∑_{m ≥ 0} (4^m / m!) P_m s^m` has derivative valuations `vp : ℕ → ℤ`
  32. satisfying a linear valuation recurrence with rational slope `θ = p / q < 1` (`p < q`, `0 < q`):
  33. `∀ m > B, (q : ℤ) * vp m ≥ (q : ℤ) * vp j₀ - (p : ℤ) * ((m - B : ℕ) : ℤ)`
  34. where `j₀ ≤ B`. Then the unit-disk Taylor coefficient valuation
  35. `vc m := 2 * (m : ℤ) - (v2Fact m : ℤ) + vp m`
  36. satisfies strict domination `vc m > vc j₀` for every
  37. `m > B + (q * Nat.log 2 (B + 1)) / (q - p)`,
  38. bounding the unit-disk Weierstrass degree `w₁(F) ≤ B + (q * Nat.log 2 (B + 1)) / (q - p)`
  39. with **zero** subdisk splitting! -/
  40. theorem bautin_taylor_domination_slope (p q B : ℕ) (hpq : p < q) (vp : ℕ → ℤ)
  41. (j₀ : ℕ) (hj₀ : j₀ ≤ B)
  42. (hrec : ∀ m : ℕ, B < m →
  43. (q : ℤ) * vp m ≥ (q : ℤ) * vp j₀ - (p : ℤ) * ((m - B : ℕ) : ℤ))
  44. (m : ℕ) (hm : B + (q * Nat.log 2 (B + 1)) / (q - p) < m) :
  45. 2 * (m : ℤ) - (v2Fact m : ℤ) + vp m >
  46. 2 * (j₀ : ℤ) - (v2Fact j₀ : ℤ) + vp j₀ := by
  47. have hq_pos : 0 < q := by omega
  48. have hqp_pos : 0 < q - p := by omega
  49. have hBm : B < m := lt_of_le_of_lt (Nat.le_add_right _ _) hm
  50. have hrm := hrec m hBm
  51. have hleg_m : (v2Fact m : ℤ) + (popcount2 m : ℤ) = (m : ℤ) := by
  52. exact_mod_cast legendre_v2Fact m
  53. have hleg_j : (v2Fact j₀ : ℤ) + (popcount2 j₀ : ℤ) = (j₀ : ℤ) := by
  54. exact_mod_cast legendre_v2Fact j₀
  55. have hpop_m : (1 : ℤ) ≤ (popcount2 m : ℤ) := by
  56. exact_mod_cast popcount2_pos (by omega : 0 < m)
  57. have hpop_j : (popcount2 j₀ : ℤ) ≤ (Nat.log 2 (B + 1) : ℤ) := by
  58. have h1 : popcount2 j₀ ≤ Nat.log 2 (j₀ + 1) := popcount2_le_log_succ j₀
  59. have h2 : Nat.log 2 (j₀ + 1) ≤ Nat.log 2 (B + 1) := Nat.log_mono_right (by omega)
  60. exact_mod_cast le_trans h1 h2
  61. -- From hm: (q * log) / (q - p) < m - B, hence q * log < (q - p) * (m - B) + (q - p),
  62. -- actually (q * log) / (q - p) + 1 ≤ m - B => q * log < (q - p) * (m - B)!
  63. have hdiv_lt : q * Nat.log 2 (B + 1) < (q - p) * (m - B) := by
  64. have h1 : (q * Nat.log 2 (B + 1)) / (q - p) + 1 ≤ m - B := by omega
  65. have h2 : q * Nat.log 2 (B + 1) < (q - p) * ((q * Nat.log 2 (B + 1)) / (q - p) + 1) := by
  66. have hmod := Nat.mod_lt (q * Nat.log 2 (B + 1)) hqp_pos
  67. have hdm := Nat.div_add_mod (q * Nat.log 2 (B + 1)) (q - p)
  68. rw [mul_add, mul_one]; omega
  69. exact lt_of_lt_of_le h2 (Nat.mul_le_mul_left (q - p) h1)
  70. have hdiv_lt_Z : (q : ℤ) * (Nat.log 2 (B + 1) : ℤ) <
  71. ((q : ℤ) - (p : ℤ)) * ((m : ℤ) - (B : ℤ)) := by
  72. have hqp_cast : ((q - p : ℕ) : ℤ) = (q : ℤ) - (p : ℤ) := by
  73. exact_mod_cast Nat.cast_sub (le_of_lt hpq)
  74. have hmB_cast : ((m - B : ℕ) : ℤ) = (m : ℤ) - (B : ℤ) := by
  75. exact_mod_cast Nat.cast_sub (le_of_lt hBm)
  76. have hcast : ((q * Nat.log 2 (B + 1) : ℕ) : ℤ) < (((q - p) * (m - B) : ℕ) : ℤ) := by
  77. exact_mod_cast hdiv_lt
  78. push_cast at hcast
  79. rw [hqp_cast, hmB_cast] at hcast
  80. exact hcast
  81. have hmB_cast : ((m - B : ℕ) : ℤ) = (m : ℤ) - (B : ℤ) := by
  82. exact_mod_cast Nat.cast_sub (le_of_lt hBm)
  83. rw [hmB_cast] at hrm
  84. have hBj0 : (j₀ : ℤ) ≤ (B : ℤ) := by exact_mod_cast hj₀
  85. have hq_pos_Z : (0 : ℤ) < (q : ℤ) := by exact_mod_cast hq_pos
  86. -- Multiply desired inequality by q > 0:
  87. -- q*(2m - v2Fact m + vp m) - q*(2j0 - v2Fact j0 + vp j0)
  88. -- = q*(m + popcount2 m - j0 - popcount2 j0) + q*(vp m - vp j0)
  89. -- ≥ q*(m - B) + q*(B - j0) + q*(1 - log) - p*(m - B)
  90. -- = (q - p)*(m - B) - q*log + q*(B - j0) + q > 0!
  91. have hq_gt : (q : ℤ) * (2 * (m : ℤ) - (v2Fact m : ℤ) + vp m) >
  92. (q : ℤ) * (2 * (j₀ : ℤ) - (v2Fact j₀ : ℤ) + vp j₀) := by
  93. nlinarith
  94. nlinarith
  95. /-! ## 2. Depth-4 `w₃`-Elimination Identity & `H_{F₃} = p₃ H₁ + q₃ H_{F₂}` -/
  96. section DiffRingExtensions
  97. variable {R : Type*} [CommRing R] [DiffRing R]
  98. /-- **Depth-4 `w₃`-Elimination Theorem:**
  99. Let `L₃` be the Depth-3 order-6 monic operator and let `L₃⁽⁴⁾ := L₃.map (· + α₃ * w₃)` be its
  100. `U₃`-conjugate (`U₃ = 1 - w₃`). Then `L₃⁽⁴⁾` eliminates the top variable `w₃` from **all four**
  101. Depth-4 generators `{1, w₁, F₂, F₃}` simultaneously:
  102. `L₃⁽⁴⁾(g) = w₃ * (L₃.map (· + α₃))(g)` for `g ∈ {1, w₁, F₂}`, and
  103. `L₃⁽⁴⁾(α₃ * w₃) = w₃ * (L₃.map (· + α₃))(α₃)`.
  104. In particular, `L₃⁽⁴⁾(g)` is strictly linear in `w₃` (zero `w₃^2` or higher terms!), and its
  105. cofactor `(L₃.map (· + α₃))(α₃)` is a constant linear combination `p₃ * H₁ + q₃ * H_{F₂}`. -/
  106. theorem depth4_w3_elimination (w₁ w₂ w₃ d₁ p₂ q₂ p₃ q₃ : R)
  107. (hd₁ : der d₁ = 0) (hp₂ : der p₂ = 0) (hq₂ : der q₂ = 0) (hp₃ : der p₃ = 0) (hq₃ : der q₃ = 0)
  108. (hw₁ : der w₁ = d₁ * (w₁ * (1 - w₁)))
  109. (hw₂ : der w₂ = (p₂ + q₂ * w₁) * (w₂ * (1 - w₂)))
  110. (hw₃ : der w₃ = (p₃ + q₃ * ((p₂ + q₂ * w₁) * w₂)) * (w₃ * (1 - w₃))) :
  111. let α₂ := p₂ + q₂ * w₁
  112. let α₃ := p₃ + q₃ * (α₂ * w₂)
  113. let A₃ := d₁ * w₁ + α₂ * w₂
  114. let B₃ := 3 * d₁ * w₁ + α₂ * w₂
  115. let L₃ := [B₃ - α₂ - 3 * d₁, B₃ - α₂ - 2 * d₁, B₃ - α₂ - d₁, B₃ - α₂, A₃, A₃ - d₁]
  116. let L₃_4 := L₃.map (fun φ => φ + α₃ * w₃)
  117. let L₃_a3 := L₃.map (fun φ => φ + α₃)
  118. (∀ r t s : R, der r = 0 → der t = 0 → der s = 0 →
  119. applyOps L₃_4 (r + t * w₁ + s * (α₂ * w₂)) =
  120. w₃ * applyOps L₃_a3 (r + t * w₁ + s * (α₂ * w₂))) ∧
  121. applyOps L₃_4 (α₃ * w₃) =
  122. w₃ * (p₃ * applyOps L₃_a3 1 + q₃ * applyOps L₃_a3 (α₂ * w₂)) := by
  123. intro α₂ α₃ A₃ B₃ L₃ L₃_4 L₃_a3
  124. have h1mw3 : der (1 - w₃) = -(α₃ * w₃) * (1 - w₃) := by
  125. rw [der_sub, der_one, hw₃]; dsimp only [α₃]; ring
  126. have hw3_fac : der w₃ = -(α₃ * w₃ - α₃) * w₃ := by
  127. rw [hw₃]; dsimp only [α₃]; ring
  128. have hmap_eq : L₃_4 = L₃_a3.map (fun φ => φ + (α₃ * w₃ - α₃)) := by
  129. dsimp only [L₃_4, L₃_a3]
  130. rw [List.map_map]
  131. refine List.map_congr_left fun φ _ => ?_
  132. simp only [Function.comp_apply]; ring
  133. have hpull_w3 : ∀ g : R, applyOps L₃_4 (w₃ * g) = w₃ * applyOps L₃_a3 g := by
  134. intro g
  135. rw [hmap_eq]
  136. exact applyOps_map_add_mul L₃_a3 (α₃ * w₃ - α₃) w₃ g hw3_fac
  137. constructor
  138. · intro r t s hr ht hs
  139. set g := r + t * w₁ + s * (α₂ * w₂)
  140. have hsplit : g = (1 - w₃) * g + w₃ * g := by ring
  141. have hkill_1mw : applyOps L₃_4 ((1 - w₃) * g) = 0 := by
  142. dsimp only [L₃_4]
  143. rw [applyOps_map_add_mul L₃ (α₃ * w₃) (1 - w₃) g h1mw3]
  144. have h0 := depth3_universal_order6_annihilator w₁ w₂ d₁ p₂ q₂ hd₁ hp₂ hq₂ hw₁ hw₂
  145. r t s hr ht hs
  146. rw [show applyOps L₃ g = 0 from h0, mul_zero]
  147. conv_lhs => rw [hsplit]
  148. rw [applyOps_add, hkill_1mw, zero_add, hpull_w3 g]
  149. · rw [mul_comm α₃ w₃, hpull_w3 α₃]
  150. congr 1
  151. dsimp only [α₃]
  152. rw [applyOps_add]
  153. congr 1
  154. · conv_lhs => rw [show p₃ = p₃ * 1 from (mul_one p₃).symm]
  155. exact applyOps_const_mul _ p₃ 1 hp₃
  156. · exact applyOps_const_mul _ q₃ (α₂ * w₂) hq₃
  157. /-! ## 3. Exact Closed-Form Order-3 `D₀ = 1` Universal Identity for `1 + w₂ ^ D` -/
  158. /-- **Exact Closed-Form Order-3 `D₀ = 1` Identity for `1 + w₂ ^ D` (all `D : ℕ`):**
  159. For every `D : ℕ`, `V w₁ = d₁ w₁ (1 - w₁)`, `α₂ = p₂ + q₂ w₁`, `V w₂ = α₂ w₂ (1 - w₂)`,
  160. the explicit order-3 monic (`D₀ = 1`) operator
  161. `[-d₁ * (1 - 2 * w₁) - α₂ * (D - (D + 1) * w₂), -α₂ * (D - (D + 1) * w₂), 0]`
  162. annihilates `1 + w₂ ^ D` identically in `R`! -/
  163. theorem depth3_one_add_w2_pow_order3 (w₁ w₂ d₁ p₂ q₂ : R) (D : ℕ)
  164. (hd₁ : der d₁ = 0) (hp₂ : der p₂ = 0) (hq₂ : der q₂ = 0)
  165. (hw₁ : der w₁ = d₁ * (w₁ * (1 - w₁)))
  166. (hw₂ : der w₂ = (p₂ + q₂ * w₁) * (w₂ * (1 - w₂))) :
  167. let α₂ := p₂ + q₂ * w₁
  168. let φ := -(α₂ * ((D : R) - ((D : R) + 1) * w₂))
  169. let ψ := -(d₁ * (1 - 2 * w₁)) + φ
  170. applyOps [ψ, φ, 0] (1 + w₂ ^ D) = 0 := by
  171. intro α₂ φ ψ
  172. simp only [applyOps_cons, applyOps_nil, shiftOp, zero_mul, add_zero]
  173. cases D with
  174. | zero =>
  175. simp only [pow_zero, der_add, der_one, der_zero, add_zero, mul_zero]
  176. | succ n =>
  177. -- Let h = (n + 1) * w₂ ^ (n + 1) * (1 - w₂).
  178. -- Step 1: der (1 + w₂ ^ (n + 1)) = α₂ * h.
  179. have hstep1 : der (1 + w₂ ^ (n + 1)) =
  180. α₂ * (((n + 1 : ℕ) : R) * w₂ ^ (n + 1) * (1 - w₂)) := by
  181. rw [der_add, der_one, zero_add, der_pow, Nat.add_sub_cancel, hw₂]
  182. dsimp only [α₂]
  183. rw [pow_succ]
  184. ring
  185. -- Step 2: der h = (-φ) * h!
  186. have hder_h : der (((n + 1 : ℕ) : R) * w₂ ^ (n + 1) * (1 - w₂)) =
  187. -φ * (((n + 1 : ℕ) : R) * w₂ ^ (n + 1) * (1 - w₂)) := by
  188. rw [der_mul, der_mul, der_natCast, zero_mul, zero_add, der_pow, Nat.add_sub_cancel,
  189. der_sub, der_one, hw₂]
  190. dsimp only [φ, α₂]
  191. push_cast
  192. rw [pow_succ]
  193. ring
  194. -- Step 3: (der + φ) (α₂ * h) = (der α₂) * h!
  195. have hstep2 : der (der (1 + w₂ ^ (n + 1))) + φ * der (1 + w₂ ^ (n + 1)) =
  196. der α₂ * (((n + 1 : ℕ) : R) * w₂ ^ (n + 1) * (1 - w₂)) := by
  197. rw [hstep1, der_mul, hder_h]
  198. ring
  199. -- Step 4: der (der α₂) = d₁ * (1 - 2 * w₁) * der α₂!
  200. have hder2_a2 : der (der α₂) = d₁ * (1 - 2 * w₁) * der α₂ := by
  201. have h1 : der α₂ = q₂ * (d₁ * (w₁ * (1 - w₁))) := by
  202. dsimp only [α₂]
  203. rw [der_add, hp₂, zero_add, der_mul, hq₂, zero_mul, zero_add, hw₁]
  204. rw [h1, der_mul, hq₂, zero_mul, zero_add, der_mul, hd₁, zero_mul, zero_add,
  205. der_mul, der_sub, der_one, hw₁]
  206. ring
  207. rw [hstep2, der_mul, hder2_a2, hder_h]
  208. dsimp only [ψ]
  209. ring
  210. end DiffRingExtensions
  211. end Research.PvsNP.Tau