Lean / Reader
Lean reader

omega-bridge-check.lean

205 lines18 declarationsno sorryimports OAI.LinearAlgebra.SpectralBooks.ExactExponent OAI.LinearAlgebra.MatrixFields.Main

Lean 4 Web has Mathlib, so it can check files that import only Mathlib. This one also imports OAI.LinearAlgebra.SpectralBooks.ExactExponent, OAI.LinearAlgebra.MatrixFields.Main, which it does not have: you can read it there, but it will not check. Build the project itself to check it.

  1. import OAI.LinearAlgebra.SpectralBooks.ExactExponent
  2. import OAI.LinearAlgebra.MatrixFields.Main
  3. /-!
  4. # My bridge file
  5. Small statements that I derive from the theorems of the claimant. The kernel
  6. of Lean checks each proof. The file is my own work.
  7. -/
  8. set_option format.width 1000
  9. namespace MobiusOtter
  10. open OAI.LinearAlgebra
  11. open OAI.MatrixMultiplication
  12. /-! ## 1. The answer to the question of the registry
  13. The question is: "Is the exponent of matrix multiplication equal to 2?"
  14. The theorem `square_exponent` gives the answer "no" in the model of the
  15. challenge file. The theorem `omega_eq` gives the same answer in the model of
  16. the paper, where the circuits have division gates. -/
  17. theorem exponent_is_not_two_division_free (F : Type*) [Field F] :
  18. SpectralBooks.formalOmega F 1 1 1 ≠ 2 := by
  19. rw [SpectralBooks.square_exponent]
  20. norm_num
  21. theorem exponent_is_not_two_with_division (F : Type*) [Field F] :
  22. MatrixExponent.omega F ≠ 2 := by
  23. rw [MatrixExponent.omega_eq]
  24. norm_num
  25. /-- The same for two fields as examples: the rational numbers and the field with two elements. -/
  26. theorem exponent_rationals :
  27. SpectralBooks.formalOmega ℚ 1 1 1 = 9 / 4 :=
  28. SpectralBooks.square_exponent ℚ
  29. theorem exponent_field_two_elements :
  30. SpectralBooks.formalOmega (ZMod 2) 1 1 1 = 9 / 4 :=
  31. SpectralBooks.square_exponent (ZMod 2)
  32. /-! ## 2. The two halves of the equality, as separate statements -/
  33. theorem at_most_nine_fourths (F : Type*) [Field F] :
  34. SpectralBooks.formalOmega F 1 1 1 ≤ 9 / 4 :=
  35. le_of_eq (SpectralBooks.square_exponent F)
  36. theorem at_least_nine_fourths (F : Type*) [Field F] :
  37. 9 / 4 ≤ SpectralBooks.formalOmega F 1 1 1 :=
  38. ge_of_eq (SpectralBooks.square_exponent F)
  39. /-- At weight 1 the rounded wire dimension is the base size itself.
  40. Thus the programs of `formalOmega F 1 1 1` multiply two matrices of size `N` by `N`.
  41. This is line 34 of `SquareExponent.lean` of the claimant. -/
  42. theorem wireDimension_one (N : ℕ) : SpectralBooks.wireDimension N 1 = N := by
  43. simp [SpectralBooks.wireDimension]
  44. /-! ## 2b. The two directions, with the definitions of the challenge file
  45. The definition `FormalAdmissibleExponent` says: for each positive `ε` there is a
  46. positive constant `C` such that each size `N ≥ 1` has a division-free program
  47. that is formally correct and has cost at most `C * N^(τ + ε)`. -/
  48. /-- The number 9/4 has the property of the definition. -/
  49. theorem nine_fourths_is_admissible (F : Type*) [Field F] :
  50. SpectralBooks.FormalAdmissibleExponent F 1 1 1 (9 / 4) := by
  51. rw [← SpectralBooks.square_exponent F]
  52. exact SpectralBooks.formalOmega_admissible F (by norm_num) (by norm_num) (by norm_num)
  53. /-- The upper bound, in the words of the definition. -/
  54. theorem upper_bound_explicit (F : Type*) [Field F] {ε : ℝ} (hε : 0 < ε) :
  55. ∃ C : ℝ, 0 < C ∧ ∀ N : ℕ, 1 ≤ N →
  56. ∃ P : Arithmetic.MatrixAlgorithm F (SpectralBooks.wireDimension N 1)
  57. (SpectralBooks.wireDimension N 1) (SpectralBooks.wireDimension N 1),
  58. SpectralBooks.FormalCorrect P ∧ (P.cost : ℝ) ≤ C * (N : ℝ) ^ ((9 : ℝ) / 4 + ε) :=
  59. nine_fourths_is_admissible F ε hε
  60. /-- No number below 9/4 has the property of the definition. -/
  61. theorem no_exponent_below_nine_fourths (F : Type*) [Field F] {τ : ℝ} (hτ : τ < (9 : ℝ) / 4) :
  62. ¬ SpectralBooks.FormalAdmissibleExponent F 1 1 1 τ := by
  63. intro hadm
  64. set S := {τ : ℝ | SpectralBooks.FormalAdmissibleExponent F 1 1 1 τ} with hS
  65. have hnonempty : S.Nonempty :=
  66. ⟨_, SpectralBooks.formalOmega_admissible F (by norm_num) (by norm_num) (by norm_num)⟩
  67. have h9 : sInf S = (9 : ℝ) / 4 := SpectralBooks.square_exponent F
  68. -- The set is bounded below. If it were not, its infimum would be 0.
  69. have hbdd : BddBelow S := by
  70. by_contra h
  71. have h0 := csInf_of_not_bddBelow h
  72. rw [h9] at h0
  73. norm_num at h0
  74. have h1 : (9 : ℝ) / 4 ≤ τ := by
  75. rw [← h9]
  76. exact csInf_le hbdd hadm
  77. exact absurd hτ (not_lt.2 h1)
  78. /-- The lower bound, in the words of the definition. -/
  79. theorem lower_bound_explicit (F : Type*) [Field F] {τ : ℝ} (hτ : τ < (9 : ℝ) / 4) :
  80. ∃ ε : ℝ, 0 < ε ∧ ∀ C : ℝ, 0 < C → ∃ N : ℕ, 1 ≤ N ∧
  81. ∀ P : Arithmetic.MatrixAlgorithm F (SpectralBooks.wireDimension N 1)
  82. (SpectralBooks.wireDimension N 1) (SpectralBooks.wireDimension N 1),
  83. ¬ (SpectralBooks.FormalCorrect P ∧ (P.cost : ℝ) ≤ C * (N : ℝ) ^ (τ + ε)) := by
  84. have h1 : ¬ SpectralBooks.FormalAdmissibleExponent F 1 1 1 τ :=
  85. no_exponent_below_nine_fourths F hτ
  86. unfold SpectralBooks.FormalAdmissibleExponent at h1
  87. by_contra hcon
  88. push Not at hcon
  89. exact h1 hcon
  90. /-! ## 2c. The finite form of the lower bound that Lean has: tensor rank
  91. For each side length, Lean has a bound for the tensor rank (a bilinear algorithm
  92. over `F`). My file `Check/Finite.lean` derives from it a bound for circuits with
  93. division in the model where each gate counts. -/
  94. /-- For each side length `n ≥ 2`, a decomposition of the matrix tensor over `F` into simple
  95. tensors has at least `n^(9/4)` terms. -/
  96. theorem tensor_rank_lower_bound (F : Type*) [Field F] {n : ℕ} (hn : 2 ≤ n) :
  97. (n : ℝ) ^ ((9 : ℝ) / 4) ≤ (SpectralBooks.tensorRank (SpectralBooks.matrixTensor F n n n) : ℝ) := by
  98. rw [← SpectralBooks.square_exponent F]
  99. exact SpectralBooks.rpow_formalOmega_le_tensorRank F hn
  100. /-- The same bound with the ceiling: at least `⌈n^(9/4)⌉` products. -/
  101. theorem tensor_rank_ceiling_lower_bound (F : Type*) [Field F] {n : ℕ} (hn : 2 ≤ n) :
  102. ⌈(n : ℝ) ^ ((9 : ℝ) / 4)⌉₊ ≤ SpectralBooks.tensorRank (SpectralBooks.matrixTensor F n n n) :=
  103. Nat.ceil_le.2 (tensor_rank_lower_bound F hn)
  104. /-- The asymptotic rank of the matrix tensor at side length `n ≥ 2` is `n^(9/4)`. -/
  105. theorem asymptotic_rank_value (F : Type*) [Field F] {n : ℕ} (hn : 2 ≤ n) :
  106. SpectralBooks.asymptoticRank (SpectralBooks.matrixTensor F n n n) = (n : ℝ) ^ ((9 : ℝ) / 4) := by
  107. rw [SpectralBooks.square_asymptoticRank_eq_rpow_formalOmega F hn, SpectralBooks.square_exponent]
  108. /-! ## 3. The bound of the registry link is not 9/4
  109. The registry links the declaration `omega_lt_source_constant`. It states an
  110. upper bound below 2371054886006746/10^15. This number is above 9/4.
  111. Thus the linked declaration does not state the claim of 24 November 2026. -/
  112. theorem linked_bound_above_nine_fourths : (9 : ℝ) / 4 < 2371054886006746 / 10 ^ 15 := by
  113. norm_num
  114. theorem linked_bound_minus_nine_fourths :
  115. (2371054886006746 : ℝ) / 10 ^ 15 - (9 : ℝ) / 4 = 121054886006746 / 10 ^ 15 := by
  116. norm_num
  117. /-- The bound of the linked declaration is above 2. Thus this bound alone does not answer the question of the registry. -/
  118. theorem linked_bound_allows_two : (2 : ℝ) < 2371054886006746 / 10 ^ 15 := by
  119. norm_num
  120. /-- The model of the paper: the new theorem gives a stronger upper bound than the bound of the linked declaration. -/
  121. theorem new_claim_gives_linked_bound (F : Type*) [Field F] :
  122. MatrixExponent.omega F < 2371054886006746 / 10 ^ 15 := by
  123. rw [MatrixExponent.omega_eq]
  124. exact linked_bound_above_nine_fourths
  125. end MobiusOtter
  126. -- Readable form of the auxiliary statements.
  127. #check @OAI.LinearAlgebra.MatrixExponent.Build
  128. #check @OAI.LinearAlgebra.MatrixExponent.Computes
  129. #check @OAI.LinearAlgebra.MatrixExponent.Admissible
  130. #check @OAI.LinearAlgebra.MatrixExponent.omega
  131. #check @OAI.LinearAlgebra.MatrixExponent.RankLE
  132. #check @OAI.LinearAlgebra.MatrixExponent.omega_eq
  133. #check @OAI.LinearAlgebra.MatrixExponent.nine_fourths_le_omega
  134. #check @OAI.LinearAlgebra.MatrixExponent.omega_eq_and_rigidity
  135. #check @OAI.LinearAlgebra.MatrixExponent.omega_lt_iff_rank
  136. #check @OAI.LinearAlgebra.SpectralBooks.formalOmega_square_eq_omega
  137. #check @OAI.LinearAlgebra.SpectralBooks.rpow_formalOmega_le_tensorRank
  138. #check @OAI.LinearAlgebra.SpectralBooks.square_asymptoticRank_eq_rpow_formalOmega
  139. #check @OAI.LinearAlgebra.SpectralBooks.formalOmega_admissible
  140. #check @OAI.LinearAlgebra.SpectralBooks.wireDimension
  141. #check @OAI.LinearAlgebra.SpectralBooks.FormalAdmissibleExponent
  142. #check @OAI.MatrixMultiplication.Arithmetic.naiveAlgorithm_cost_le
  143. #check @OAI.MatrixMultiplication.Arithmetic.admissibleExponent_three
  144. -- Axioms.
  145. #print axioms OAI.LinearAlgebra.MatrixExponent.omega_eq
  146. #print axioms OAI.LinearAlgebra.MatrixExponent.nine_fourths_le_omega
  147. #print axioms OAI.LinearAlgebra.MatrixExponent.omega_eq_and_rigidity
  148. #print axioms OAI.LinearAlgebra.MatrixExponent.omega_lt_iff_rank
  149. #print axioms OAI.LinearAlgebra.SpectralBooks.formalOmega_square_eq_omega
  150. #print axioms OAI.LinearAlgebra.SpectralBooks.rpow_formalOmega_le_tensorRank
  151. #print axioms OAI.LinearAlgebra.SpectralBooks.square_asymptoticRank_eq_rpow_formalOmega
  152. #print axioms MobiusOtter.exponent_is_not_two_division_free
  153. #print axioms MobiusOtter.exponent_is_not_two_with_division
  154. #print axioms MobiusOtter.exponent_rationals
  155. #print axioms MobiusOtter.exponent_field_two_elements
  156. #print axioms MobiusOtter.at_most_nine_fourths
  157. #print axioms MobiusOtter.at_least_nine_fourths
  158. #print axioms MobiusOtter.wireDimension_one
  159. #print axioms MobiusOtter.nine_fourths_is_admissible
  160. #print axioms MobiusOtter.upper_bound_explicit
  161. #print axioms MobiusOtter.no_exponent_below_nine_fourths
  162. #print axioms MobiusOtter.lower_bound_explicit
  163. #print axioms MobiusOtter.tensor_rank_lower_bound
  164. #print axioms MobiusOtter.tensor_rank_ceiling_lower_bound
  165. #print axioms MobiusOtter.asymptotic_rank_value
  166. #print axioms MobiusOtter.linked_bound_above_nine_fourths
  167. #print axioms MobiusOtter.linked_bound_minus_nine_fourths
  168. #print axioms MobiusOtter.linked_bound_allows_two
  169. #print axioms MobiusOtter.new_claim_gives_linked_bound