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

Research/PvsNP/Tau/PadicBarrier.lean

277 lines9 declarationsno sorry
  1. module
  2. public import Research.PvsNP.Tau.TauConjecture
  3. public import Mathlib.NumberTheory.Padics.Hensel
  4. @[expose] public section
  5. namespace Research.PvsNP.Tau
  6. /-!
  7. # Unconditional $2$-Adic Exponential Lower Bound (`z_max^{ℤ_2}(4k) ≥ 2^k`)
  8. This module proves that the constant-free straight-line program family
  9. - `P₀(X) = X^2 - 1`
  10. - `c₁ = 64`, `c_{n+1} = 64 * c_n^2`
  11. - `P_{n+1}(X) = P_n(X)^2 - c_{n+1}`
  12. has constant-free SLP length `τ(P_n) ≤ 4 * (n + 1)` (exact length `2` for `n = 0` and
  13. `4 * (n + 1)` for `n ≥ 1`), yet admits at least `2 ^ (n + 1)` distinct roots in the
  14. $2$-adic integers `ℤ_[2]`.
  15. Combined with Chebyshev polynomials over `ℝ` (`2 ^ ((τ - 1) / 2)` real roots) and
  16. `X^(2^(τ-1)) - 1` over `𝔽_p`, this shows that **no purely Archimedean (`ℝ`), purely
  17. $p$-adic (`ℚ_p`), or purely finite-field (`𝔽_p`) method can prove `z_max(τ) = 2^o(τ)`
  18. or the Shub–Smale $\tau$-conjecture**.
  19. -/
  20. /-- Exponent sequence `exp2 n`: `exp2 0 = 0`, `exp2 1 = 3`, `exp2 (n + 2) = 2 * exp2 (n + 1) + 3`.
  21. Thus `c_n = 2 ^ (2 * exp2 n)` satisfies `c_1 = 64` and `c_{n+1} = 64 * c_n ^ 2`. -/
  22. def padicExp2 : ℕ → ℕ
  23. | 0 => 0
  24. | 1 => 3
  25. | n + 2 => 2 * padicExp2 (n + 1) + 3
  26. /-- The polynomial family `padicPoly n ∈ ℤ[X]` with `2 ^ (n + 1)` distinct roots in `ℤ_[2]`. -/
  27. noncomputable def padicPoly : ℕ → Polynomial ℤ
  28. | 0 => Polynomial.X ^ 2 - 1
  29. | n + 1 => (padicPoly n) ^ 2 - (2 : Polynomial ℤ) ^ (2 * padicExp2 (n + 1))
  30. /-- Explicit constant-free SLP of length `4 * (n + 2)` computing `padicPoly (n + 1)` for `n : ℕ`.
  31. Wire layout at stage `n` (`τ = 4 * (n + 2)`, wires `0 .. 4 * n + 9`):
  32. - wire `5`: constant `64 = 2^6`
  33. - wire `4 * n + 7` (or `5` when `n = 0`): `c_{n+1} = 2 ^ (2 * padicExp2 (n + 1))`
  34. - wire `4 * n + 9` (output): `padicPoly (n + 1)`
  35. -/
  36. def padicSLP : (n : ℕ) → SLP (4 * (n + 2))
  37. | 0 =>
  38. let p1 : SLP 1 := .snoc .nil .mul ⟨1, by omega⟩ ⟨1, by omega⟩ -- w2 = X^2
  39. let p2 : SLP 2 := .snoc p1 .sub ⟨2, by omega⟩ ⟨0, by omega⟩ -- w3 = X^2 - 1 = P_0
  40. let p3 : SLP 3 := .snoc p2 .add ⟨0, by omega⟩ ⟨0, by omega⟩ -- w4 = 2
  41. let p4 : SLP 4 := .snoc p3 .mul ⟨4, by omega⟩ ⟨4, by omega⟩ -- w5 = 4
  42. let p5 : SLP 5 := .snoc p4 .mul ⟨4, by omega⟩ ⟨5, by omega⟩ -- w6 = 8
  43. let p6 : SLP 6 := .snoc p5 .mul ⟨6, by omega⟩ ⟨6, by omega⟩ -- w7 = 64 = c_1
  44. let p7 : SLP 7 := .snoc p6 .mul ⟨3, by omega⟩ ⟨3, by omega⟩ -- w8 = P_0^2
  45. .snoc p7 .sub ⟨8, by omega⟩ ⟨7, by omega⟩ -- w9 = P_0^2 - 64 = P_1
  46. | n + 1 =>
  47. let prev : SLP (4 * (n + 2)) := padicSLP n
  48. let s1 : SLP (4 * (n + 2) + 1) :=
  49. .snoc prev .mul ⟨4 * n + 7, by omega⟩ ⟨4 * n + 7, by omega⟩ -- w_{4n+10} = c_{n+1}^2
  50. let s2 : SLP (4 * (n + 2) + 2) :=
  51. .snoc s1 .mul ⟨7, by omega⟩ ⟨4 * n + 10, by omega⟩ -- w_{4n+11} = 64 * c_{n+1}^2 = c_{n+2}
  52. let s3 : SLP (4 * (n + 2) + 3) :=
  53. .snoc s2 .mul ⟨4 * n + 9, by omega⟩ ⟨4 * n + 9, by omega⟩ -- w_{4n+12} = P_{n+1}^2
  54. .snoc s3 .sub ⟨4 * n + 12, by change 4 * n + 12 < 4 * (n + 3) + 1; omega⟩
  55. ⟨4 * n + 11, by change 4 * n + 11 < 4 * (n + 3) + 1; omega⟩ -- w_{4n+13} = P_{n+2}
  56. theorem padicSLP_wires (n : ℕ) :
  57. (padicSLP n).evalWire ⟨7, by omega⟩ = (64 : Polynomial ℤ) ∧
  58. (padicSLP n).evalWire ⟨4 * n + 7, by omega⟩ = (2 : Polynomial ℤ) ^ (2 * padicExp2 (n + 1)) ∧
  59. (padicSLP n).evalWire ⟨4 * n + 9, by omega⟩ = padicPoly (n + 1) := by
  60. induction n with
  61. | zero =>
  62. refine ⟨?_, ?_, ?_⟩
  63. · simp [padicSLP, SLP.evalWire, SLPOp.applyPoly]; norm_num
  64. · simp [padicSLP, SLP.evalWire, SLPOp.applyPoly, padicExp2]; norm_num
  65. · simp [padicSLP, SLP.evalWire, SLPOp.applyPoly, padicPoly, padicExp2]; ring
  66. | succ n ih =>
  67. rcases ih with ⟨h64, hC, hP⟩
  68. have h7_1 : 7 < 4 * (n + 2) + 2 := by omega
  69. have h7_2 : 7 < 4 * (n + 2) + 3 := by omega
  70. have h7_3 : 7 < 4 * (n + 2) + 4 := by omega
  71. have h7_4 : 7 < 4 * (n + 2) + 5 := by omega
  72. have hC_1 : 4 * n + 7 < 4 * (n + 2) + 2 := by omega
  73. have hP_1 : 4 * n + 9 < 4 * (n + 2) + 2 := by omega
  74. have hP_2 : 4 * n + 9 < 4 * (n + 2) + 3 := by omega
  75. have hP_3 : 4 * n + 9 < 4 * (n + 2) + 4 := by omega
  76. refine ⟨?_, ?_, ?_⟩
  77. · simpa [padicSLP, SLP.evalWire, h7_1, h7_2, h7_3, h7_4] using h64
  78. · have hstep :
  79. (padicSLP (n + 1)).evalWire ⟨4 * (n + 1) + 7, by omega⟩ =
  80. (padicSLP n).evalWire ⟨7, by omega⟩ *
  81. ((padicSLP n).evalWire ⟨4 * n + 7, by omega⟩ *
  82. (padicSLP n).evalWire ⟨4 * n + 7, by omega⟩) := by
  83. simp only [padicSLP, SLP.evalWire, SLPOp.applyPoly]
  84. split_ifs <;> first | rfl | omega
  85. rw [hstep, h64, hC]
  86. have h64pow : (64 : Polynomial ℤ) = (2 : Polynomial ℤ) ^ 6 := by norm_num
  87. rw [h64pow, ← pow_add, ← pow_add, padicExp2]
  88. congr 1
  89. ring
  90. · have hstep :
  91. (padicSLP (n + 1)).evalWire ⟨4 * (n + 1) + 9, by omega⟩ =
  92. (padicSLP n).evalWire ⟨4 * n + 9, by omega⟩ *
  93. (padicSLP n).evalWire ⟨4 * n + 9, by omega⟩ -
  94. (padicSLP n).evalWire ⟨7, by omega⟩ *
  95. ((padicSLP n).evalWire ⟨4 * n + 7, by omega⟩ *
  96. (padicSLP n).evalWire ⟨4 * n + 7, by omega⟩) := by
  97. simp only [padicSLP, SLP.evalWire, SLPOp.applyPoly]
  98. split_ifs <;> first | rfl | omega
  99. rw [hstep, h64, hC, hP]
  100. change (padicPoly (n + 1)) * (padicPoly (n + 1)) -
  101. (64 : Polynomial ℤ) *
  102. ((2 : Polynomial ℤ) ^ (2 * padicExp2 (n + 1)) *
  103. (2 : Polynomial ℤ) ^ (2 * padicExp2 (n + 1))) =
  104. (padicPoly (n + 1)) ^ 2 - (2 : Polynomial ℤ) ^ (2 * padicExp2 (n + 2))
  105. have h64pow : (64 : Polynomial ℤ) = (2 : Polynomial ℤ) ^ 6 := by norm_num
  106. rw [h64pow, ← pow_add, ← pow_add]
  107. have hexp : 6 + (2 * padicExp2 (n + 1) + 2 * padicExp2 (n + 1)) =
  108. 2 * padicExp2 (n + 2) := by
  109. simp only [padicExp2]
  110. ring
  111. rw [hexp, sq]
  112. theorem padicSLP_evalPoly (n : ℕ) : (padicSLP n).evalPoly = padicPoly (n + 1) := by
  113. have hfin :
  114. (⟨4 * (n + 2) + 1, Nat.lt_succ_self _⟩ : Fin (4 * (n + 2) + 2)) =
  115. ⟨4 * n + 9, by omega⟩ := by
  116. ext; dsimp; omega
  117. rw [SLP.evalPoly, hfin]
  118. exact (padicSLP_wires n).2.2
  119. /-- Every `1 + 8 * t` in `ℤ_[2]` has a square root `u ∈ ℤ_[2]` with `u ≠ -u`. -/
  120. theorem padicInt_exists_sqrt_one_add_eight (t : ℤ_[2]) :
  121. ∃ u : ℤ_[2], u ^ 2 = 1 + 8 * t ∧ u ≠ -u := by
  122. have : Fact (Nat.Prime 2) := ⟨Nat.prime_two⟩
  123. let F : Polynomial ℤ_[2] := Polynomial.X ^ 2 - Polynomial.C (1 + 8 * t)
  124. have hF1 : F.aeval (1 : ℤ_[2]) = -(8 * t) := by
  125. simp [F]
  126. have hderiv : F.derivative = 2 * Polynomial.X := by
  127. simp [F]; ring
  128. have hFd1 : F.derivative.aeval (1 : ℤ_[2]) = (2 : ℤ_[2]) := by
  129. simp [hderiv]
  130. have hnorm2 : ‖(2 : ℤ_[2])‖ = (1 / 2 : ℝ) := by
  131. simpa [PadicInt.norm_p] using (PadicInt.norm_p (p := 2))
  132. have hnorm8 : ‖(8 : ℤ_[2])‖ = (1 / 8 : ℝ) := by
  133. have h8 : (8 : ℤ_[2]) = (2 : ℤ_[2]) ^ 3 := by norm_num
  134. rw [h8, norm_pow, hnorm2]
  135. norm_num
  136. have hnorm_lt : ‖F.aeval (1 : ℤ_[2])‖ < ‖F.derivative.aeval (1 : ℤ_[2])‖ ^ 2 := by
  137. rw [hF1, hFd1, norm_neg, norm_mul, hnorm8, hnorm2]
  138. have ht : ‖t‖ ≤ 1 := PadicInt.norm_le_one t
  139. nlinarith [norm_nonneg t]
  140. rcases hensels_lemma (p := 2) (F := F) (a := (1 : ℤ_[2])) hnorm_lt with
  141. ⟨u, hu_root, hu_dist, _, _⟩
  142. have hu_sq : u ^ 2 = 1 + 8 * t := by
  143. have h0 : u ^ 2 - (1 + 8 * t) = 0 := by simpa [F] using hu_root
  144. exact sub_eq_zero.mp h0
  145. have hu_ne : u ≠ -u := by
  146. intro heq
  147. have h2u : (2 : ℤ_[2]) * u = 0 := by
  148. rw [two_mul]
  149. calc u + u = u + (-u) := by nth_rw 2 [heq]
  150. _ = 0 := add_neg_cancel u
  151. have hu0 : u = 0 := (mul_eq_zero.mp h2u).resolve_left (by norm_num)
  152. rw [hu0, zero_sub, norm_neg, norm_one, hFd1, hnorm2] at hu_dist
  153. norm_num at hu_dist
  154. exact ⟨u, hu_sq, hu_ne⟩
  155. /-- Binary preimage tree in `ℤ_[2]`: for every `n : ℕ` and every `t : ℤ_[2]`, there exist
  156. `2 ^ (n + 1)` distinct elements `r ∈ ℤ_[2]` such that
  157. `Polynomial.aeval r (padicPoly n) = 2 ^ (padicExp2 (n + 1)) * t`. -/
  158. theorem padicPoly_preimages (n : ℕ) :
  159. ∀ t : ℤ_[2],
  160. ∃ S : Finset ℤ_[2],
  161. S.card = 2 ^ (n + 1) ∧
  162. ∀ r ∈ S, Polynomial.aeval r (padicPoly n) = (2 : ℤ_[2]) ^ (padicExp2 (n + 1)) * t := by
  163. classical
  164. induction n with
  165. | zero =>
  166. intro t
  167. rcases padicInt_exists_sqrt_one_add_eight t with ⟨u, hu_sq, hu_ne⟩
  168. refine ⟨{u, -u}, ?_, ?_⟩
  169. · rw [Finset.card_pair hu_ne]; norm_num
  170. · intro r hr
  171. simp only [Finset.mem_insert, Finset.mem_singleton] at hr
  172. rcases hr with rfl | rfl
  173. · simp only [padicPoly, padicExp2, map_sub, map_pow, map_one, Polynomial.aeval_X, hu_sq]
  174. ring
  175. · simp only [padicPoly, padicExp2, map_sub, map_pow, map_one, Polynomial.aeval_X, neg_sq,
  176. hu_sq]
  177. ring
  178. | succ n ih =>
  179. intro t
  180. rcases padicInt_exists_sqrt_one_add_eight t with ⟨u, hu_sq, hu_ne⟩
  181. rcases ih u with ⟨S₁, hcard₁, hS₁⟩
  182. rcases ih (-u) with ⟨S₂, hcard₂, hS₂⟩
  183. have hdisj : Disjoint S₁ S₂ := by
  184. rw [Finset.disjoint_left]
  185. intro r hr₁ hr₂
  186. have h1 := hS₁ r hr₁
  187. have h2 := hS₂ r hr₂
  188. have heq : (2 : ℤ_[2]) ^ padicExp2 (n + 1) * u =
  189. (2 : ℤ_[2]) ^ padicExp2 (n + 1) * (-u) := h1.symm.trans h2
  190. have h2ne : (2 : ℤ_[2]) ^ padicExp2 (n + 1) ≠ 0 := pow_ne_zero _ (by norm_num)
  191. exact hu_ne (mul_left_cancel₀ h2ne heq)
  192. refine ⟨S₁ ∪ S₂, ?_, ?_⟩
  193. · rw [Finset.card_union_of_disjoint hdisj, hcard₁, hcard₂, pow_succ]
  194. ring
  195. · intro r hr
  196. have hexp : padicExp2 (n + 2) = 2 * padicExp2 (n + 1) + 3 := by rfl
  197. simp only [padicPoly, map_sub, map_pow, map_ofNat]
  198. rcases Finset.mem_union.mp hr with hr₁ | hr₂
  199. · rw [hS₁ r hr₁, mul_pow, hu_sq, hexp, pow_add, ← pow_mul]
  200. have h23 : (2 : ℤ_[2]) ^ 3 = 8 := by norm_num
  201. rw [h23, mul_comm (padicExp2 (n + 1)) 2]
  202. ring
  203. · rw [hS₂ r hr₂, mul_pow, neg_sq, hu_sq, hexp, pow_add, ← pow_mul]
  204. have h23 : (2 : ℤ_[2]) ^ 3 = 8 := by norm_num
  205. rw [h23, mul_comm (padicExp2 (n + 1)) 2]
  206. ring
  207. /-- `padicPoly m` is monic of degree `2 ^ (m + 1)`. -/
  208. theorem padicPoly_monic_and_deg (m : ℕ) :
  209. (padicPoly m).Monic ∧ (padicPoly m).natDegree = 2 ^ (m + 1) := by
  210. induction m with
  211. | zero =>
  212. simp only [padicPoly]
  213. have hlt : (1 : Polynomial ℤ).degree < (Polynomial.X ^ 2 : Polynomial ℤ).degree := by
  214. simp [Polynomial.degree_one]
  215. have hmon : (Polynomial.X ^ 2 - (1 : Polynomial ℤ)).Monic :=
  216. (Polynomial.monic_X_pow 2).sub_of_left hlt
  217. have hdeg : (Polynomial.X ^ 2 - (1 : Polynomial ℤ)).natDegree = 2 := by
  218. rw [Polynomial.natDegree_sub_eq_left_of_natDegree_lt]
  219. · simp
  220. · simp
  221. exact ⟨hmon, by simpa using hdeg⟩
  222. | succ m ih =>
  223. rcases ih with ⟨hm, hd⟩
  224. simp only [padicPoly]
  225. have hsq_m : (padicPoly m ^ 2).Monic := hm.pow 2
  226. have hsq_d : (padicPoly m ^ 2).natDegree = 2 ^ (m + 2) := by
  227. rw [Polynomial.natDegree_pow, hd, pow_succ]; ring
  228. have hc_d : ((2 : Polynomial ℤ) ^ (2 * padicExp2 (m + 1))).natDegree = 0 := by
  229. rw [show (2 : Polynomial ℤ) = Polynomial.C 2 by simp, ← map_pow, Polynomial.natDegree_C]
  230. have hc_lt : ((2 : Polynomial ℤ) ^ (2 * padicExp2 (m + 1))).natDegree <
  231. (padicPoly m ^ 2).natDegree := by
  232. rw [hc_d, hsq_d]; positivity
  233. have hdeg_lt : ((2 : Polynomial ℤ) ^ (2 * padicExp2 (m + 1))).degree <
  234. (padicPoly m ^ 2).degree := by
  235. have hc_le : ((2 : Polynomial ℤ) ^ (2 * padicExp2 (m + 1))).degree ≤ 0 := by
  236. rw [show (2 : Polynomial ℤ) = Polynomial.C 2 by simp, ← map_pow]
  237. exact Polynomial.degree_C_le
  238. rw [Polynomial.degree_eq_natDegree hsq_m.ne_zero, hsq_d]
  239. exact lt_of_le_of_lt hc_le (by exact_mod_cast (by positivity : 0 < 2 ^ (m + 2)))
  240. exact ⟨hsq_m.sub_of_left hdeg_lt,
  241. by rw [Polynomial.natDegree_sub_eq_left_of_natDegree_lt hc_lt, hsq_d]⟩
  242. /-- **Unconditional $2$-Adic Exponential Lower Bound (`z_max^{ℤ_2}(4k) ≥ 2^k`):**
  243. For every `k ≥ 2`, there exists a constant-free SLP of length `4 * k` computing a nonzero
  244. polynomial `f ∈ ℤ[X]` with at least `2 ^ k` distinct roots in the $2$-adic integers `ℤ_[2]`. -/
  245. theorem tau_padic_two_pow (k : ℕ) (hk : 2 ≤ k) :
  246. ∃ P : SLP (4 * k),
  247. P.evalPoly ≠ 0 ∧
  248. ∃ S : Finset ℤ_[2],
  249. S.card = 2 ^ k ∧ ∀ r ∈ S, Polynomial.aeval r P.evalPoly = 0 := by
  250. obtain ⟨n, rfl⟩ : ∃ n, k = n + 2 := ⟨k - 2, by omega⟩
  251. refine ⟨padicSLP n, ?_, ?_⟩
  252. · rw [padicSLP_evalPoly]
  253. exact (padicPoly_monic_and_deg (n + 1)).1.ne_zero
  254. · rcases padicPoly_preimages (n + 1) 0 with ⟨S, hcard, hS⟩
  255. refine ⟨S, hcard, ?_⟩
  256. intro r hr
  257. rw [padicSLP_evalPoly, hS r hr, mul_zero]
  258. end Research.PvsNP.Tau
  259. end