Lean / Reader
Lean readeromega-bridge-check.lean
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.
import OAI.LinearAlgebra.SpectralBooks.ExactExponentimport OAI.LinearAlgebra.MatrixFields.Main/-!# My bridge fileSmall statements that I derive from the theorems of the claimant. The kernelof Lean checks each proof. The file is my own work.-/set_option format.width 1000namespace MobiusOtteropen OAI.LinearAlgebraopen OAI.MatrixMultiplication/-! ## 1. The answer to the question of the registryThe question is: "Is the exponent of matrix multiplication equal to 2?"The theorem `square_exponent` gives the answer "no" in the model of thechallenge file. The theorem `omega_eq` gives the same answer in the model ofthe paper, where the circuits have division gates. -/theorem exponent_is_not_two_division_free (F : Type*) [Field F] :SpectralBooks.formalOmega F 1 1 1 ≠ 2 := byrw [SpectralBooks.square_exponent]norm_numtheorem exponent_is_not_two_with_division (F : Type*) [Field F] :MatrixExponent.omega F ≠ 2 := byrw [MatrixExponent.omega_eq]norm_num/-- The same for two fields as examples: the rational numbers and the field with two elements. -/theorem exponent_rationals :SpectralBooks.formalOmega ℚ 1 1 1 = 9 / 4 :=SpectralBooks.square_exponent ℚtheorem exponent_field_two_elements :SpectralBooks.formalOmega (ZMod 2) 1 1 1 = 9 / 4 :=SpectralBooks.square_exponent (ZMod 2)/-! ## 2. The two halves of the equality, as separate statements -/theorem at_most_nine_fourths (F : Type*) [Field F] :SpectralBooks.formalOmega F 1 1 1 ≤ 9 / 4 :=le_of_eq (SpectralBooks.square_exponent F)theorem at_least_nine_fourths (F : Type*) [Field F] :9 / 4 ≤ SpectralBooks.formalOmega F 1 1 1 :=ge_of_eq (SpectralBooks.square_exponent F)/-- At weight 1 the rounded wire dimension is the base size itself.Thus the programs of `formalOmega F 1 1 1` multiply two matrices of size `N` by `N`.This is line 34 of `SquareExponent.lean` of the claimant. -/theorem wireDimension_one (N : ℕ) : SpectralBooks.wireDimension N 1 = N := bysimp [SpectralBooks.wireDimension]/-! ## 2b. The two directions, with the definitions of the challenge fileThe definition `FormalAdmissibleExponent` says: for each positive `ε` there is apositive constant `C` such that each size `N ≥ 1` has a division-free programthat is formally correct and has cost at most `C * N^(τ + ε)`. -//-- The number 9/4 has the property of the definition. -/theorem nine_fourths_is_admissible (F : Type*) [Field F] :SpectralBooks.FormalAdmissibleExponent F 1 1 1 (9 / 4) := byrw [← SpectralBooks.square_exponent F]exact SpectralBooks.formalOmega_admissible F (by norm_num) (by norm_num) (by norm_num)/-- The upper bound, in the words of the definition. -/theorem upper_bound_explicit (F : Type*) [Field F] {ε : ℝ} (hε : 0 < ε) :∃ C : ℝ, 0 < C ∧ ∀ N : ℕ, 1 ≤ N →∃ P : Arithmetic.MatrixAlgorithm F (SpectralBooks.wireDimension N 1)(SpectralBooks.wireDimension N 1) (SpectralBooks.wireDimension N 1),SpectralBooks.FormalCorrect P ∧ (P.cost : ℝ) ≤ C * (N : ℝ) ^ ((9 : ℝ) / 4 + ε) :=nine_fourths_is_admissible F ε hε/-- No number below 9/4 has the property of the definition. -/theorem no_exponent_below_nine_fourths (F : Type*) [Field F] {τ : ℝ} (hτ : τ < (9 : ℝ) / 4) :¬ SpectralBooks.FormalAdmissibleExponent F 1 1 1 τ := byintro hadmset S := {τ : ℝ | SpectralBooks.FormalAdmissibleExponent F 1 1 1 τ} with hShave hnonempty : S.Nonempty :=⟨_, SpectralBooks.formalOmega_admissible F (by norm_num) (by norm_num) (by norm_num)⟩have h9 : sInf S = (9 : ℝ) / 4 := SpectralBooks.square_exponent F-- The set is bounded below. If it were not, its infimum would be 0.have hbdd : BddBelow S := byby_contra hhave h0 := csInf_of_not_bddBelow hrw [h9] at h0norm_num at h0have h1 : (9 : ℝ) / 4 ≤ τ := byrw [← h9]exact csInf_le hbdd hadmexact absurd hτ (not_lt.2 h1)/-- The lower bound, in the words of the definition. -/theorem lower_bound_explicit (F : Type*) [Field F] {τ : ℝ} (hτ : τ < (9 : ℝ) / 4) :∃ ε : ℝ, 0 < ε ∧ ∀ C : ℝ, 0 < C → ∃ N : ℕ, 1 ≤ N ∧∀ P : Arithmetic.MatrixAlgorithm F (SpectralBooks.wireDimension N 1)(SpectralBooks.wireDimension N 1) (SpectralBooks.wireDimension N 1),¬ (SpectralBooks.FormalCorrect P ∧ (P.cost : ℝ) ≤ C * (N : ℝ) ^ (τ + ε)) := byhave h1 : ¬ SpectralBooks.FormalAdmissibleExponent F 1 1 1 τ :=no_exponent_below_nine_fourths F hτunfold SpectralBooks.FormalAdmissibleExponent at h1by_contra hconpush Not at hconexact h1 hcon/-! ## 2c. The finite form of the lower bound that Lean has: tensor rankFor each side length, Lean has a bound for the tensor rank (a bilinear algorithmover `F`). My file `Check/Finite.lean` derives from it a bound for circuits withdivision in the model where each gate counts. -//-- For each side length `n ≥ 2`, a decomposition of the matrix tensor over `F` into simpletensors has at least `n^(9/4)` terms. -/theorem tensor_rank_lower_bound (F : Type*) [Field F] {n : ℕ} (hn : 2 ≤ n) :(n : ℝ) ^ ((9 : ℝ) / 4) ≤ (SpectralBooks.tensorRank (SpectralBooks.matrixTensor F n n n) : ℝ) := byrw [← SpectralBooks.square_exponent F]exact SpectralBooks.rpow_formalOmega_le_tensorRank F hn/-- The same bound with the ceiling: at least `⌈n^(9/4)⌉` products. -/theorem tensor_rank_ceiling_lower_bound (F : Type*) [Field F] {n : ℕ} (hn : 2 ≤ n) :⌈(n : ℝ) ^ ((9 : ℝ) / 4)⌉₊ ≤ SpectralBooks.tensorRank (SpectralBooks.matrixTensor F n n n) :=Nat.ceil_le.2 (tensor_rank_lower_bound F hn)/-- The asymptotic rank of the matrix tensor at side length `n ≥ 2` is `n^(9/4)`. -/theorem asymptotic_rank_value (F : Type*) [Field F] {n : ℕ} (hn : 2 ≤ n) :SpectralBooks.asymptoticRank (SpectralBooks.matrixTensor F n n n) = (n : ℝ) ^ ((9 : ℝ) / 4) := byrw [SpectralBooks.square_asymptoticRank_eq_rpow_formalOmega F hn, SpectralBooks.square_exponent]/-! ## 3. The bound of the registry link is not 9/4The registry links the declaration `omega_lt_source_constant`. It states anupper bound below 2371054886006746/10^15. This number is above 9/4.Thus the linked declaration does not state the claim of 24 November 2026. -/theorem linked_bound_above_nine_fourths : (9 : ℝ) / 4 < 2371054886006746 / 10 ^ 15 := bynorm_numtheorem linked_bound_minus_nine_fourths :(2371054886006746 : ℝ) / 10 ^ 15 - (9 : ℝ) / 4 = 121054886006746 / 10 ^ 15 := bynorm_num/-- The bound of the linked declaration is above 2. Thus this bound alone does not answer the question of the registry. -/theorem linked_bound_allows_two : (2 : ℝ) < 2371054886006746 / 10 ^ 15 := bynorm_num/-- The model of the paper: the new theorem gives a stronger upper bound than the bound of the linked declaration. -/theorem new_claim_gives_linked_bound (F : Type*) [Field F] :MatrixExponent.omega F < 2371054886006746 / 10 ^ 15 := byrw [MatrixExponent.omega_eq]exact linked_bound_above_nine_fourthsend MobiusOtter-- Readable form of the auxiliary statements.#check @OAI.LinearAlgebra.MatrixExponent.Build#check @OAI.LinearAlgebra.MatrixExponent.Computes#check @OAI.LinearAlgebra.MatrixExponent.Admissible#check @OAI.LinearAlgebra.MatrixExponent.omega#check @OAI.LinearAlgebra.MatrixExponent.RankLE#check @OAI.LinearAlgebra.MatrixExponent.omega_eq#check @OAI.LinearAlgebra.MatrixExponent.nine_fourths_le_omega#check @OAI.LinearAlgebra.MatrixExponent.omega_eq_and_rigidity#check @OAI.LinearAlgebra.MatrixExponent.omega_lt_iff_rank#check @OAI.LinearAlgebra.SpectralBooks.formalOmega_square_eq_omega#check @OAI.LinearAlgebra.SpectralBooks.rpow_formalOmega_le_tensorRank#check @OAI.LinearAlgebra.SpectralBooks.square_asymptoticRank_eq_rpow_formalOmega#check @OAI.LinearAlgebra.SpectralBooks.formalOmega_admissible#check @OAI.LinearAlgebra.SpectralBooks.wireDimension#check @OAI.LinearAlgebra.SpectralBooks.FormalAdmissibleExponent#check @OAI.MatrixMultiplication.Arithmetic.naiveAlgorithm_cost_le#check @OAI.MatrixMultiplication.Arithmetic.admissibleExponent_three-- Axioms.#print axioms OAI.LinearAlgebra.MatrixExponent.omega_eq#print axioms OAI.LinearAlgebra.MatrixExponent.nine_fourths_le_omega#print axioms OAI.LinearAlgebra.MatrixExponent.omega_eq_and_rigidity#print axioms OAI.LinearAlgebra.MatrixExponent.omega_lt_iff_rank#print axioms OAI.LinearAlgebra.SpectralBooks.formalOmega_square_eq_omega#print axioms OAI.LinearAlgebra.SpectralBooks.rpow_formalOmega_le_tensorRank#print axioms OAI.LinearAlgebra.SpectralBooks.square_asymptoticRank_eq_rpow_formalOmega#print axioms MobiusOtter.exponent_is_not_two_division_free#print axioms MobiusOtter.exponent_is_not_two_with_division#print axioms MobiusOtter.exponent_rationals#print axioms MobiusOtter.exponent_field_two_elements#print axioms MobiusOtter.at_most_nine_fourths#print axioms MobiusOtter.at_least_nine_fourths#print axioms MobiusOtter.wireDimension_one#print axioms MobiusOtter.nine_fourths_is_admissible#print axioms MobiusOtter.upper_bound_explicit#print axioms MobiusOtter.no_exponent_below_nine_fourths#print axioms MobiusOtter.lower_bound_explicit#print axioms MobiusOtter.tensor_rank_lower_bound#print axioms MobiusOtter.tensor_rank_ceiling_lower_bound#print axioms MobiusOtter.asymptotic_rank_value#print axioms MobiusOtter.linked_bound_above_nine_fourths#print axioms MobiusOtter.linked_bound_minus_nine_fourths#print axioms MobiusOtter.linked_bound_allows_two#print axioms MobiusOtter.new_claim_gives_linked_bound