Lean / Reader
Lean readeromega-finite-check.lean
Lean 4 Web has Mathlib, so it can check files that import only Mathlib. This one also imports OAI.LinearAlgebra.SpectralBooks.ExactExponent, 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.ExactExponent/-!# A finite-size lower bound for circuits with divisionMy own derivation. Each step uses a theorem of the claimant, or a copy offive lines of a private proof of the claimant (I say which). The kernel ofLean checks each proof.The model is the model `MatrixExponent.Computes` of the claimant: astraight-line circuit with the gates add, sub, mul and div. Each gate counts 1.Constants and inputs cost nothing. The field is the field of rationalfunctions in the entries of the two input matrices.-/set_option format.width 1000namespace MobiusOtteropen OAI.LinearAlgebraopen OAI.MatrixMultiplication.Foundation/-- Step 1. The theorem `bilinearize` of the claimant, in the square case.A circuit with `m` gates gives a decomposition with `2 * m` terms. -/theorem circuit_gives_rank {F : Type*} [Field F] {n m : ℕ} (h : MatrixExponent.Computes F n m) :MatrixExponent.RankLE (MatrixExponent.Rat F n) n (2 * m) :=MatrixExponent.Rectangle.bilinearize h/-- Step 2. A decomposition with `r` terms over `F` gives a decomposition of the matrix tensorinto `r` simple tensors. This is the forward direction of the private theorem `square_rank_iff`of the claimant (`SquareRankModel.lean`, lines 14 to 21). I copy its five proof lines. -/theorem rankAtMost_of_RankLE {F : Type*} [Field F] {n r : ℕ} (h : MatrixExponent.RankLE F n r) :Tensor.RankAtMost (SpectralBooks.matrixTensor F n n n) r := byobtain ⟨a, b, c, h⟩ := hrefine ⟨a, b, fun i z => c i z.swap, ?_⟩funext x y zsimpa [SpectralBooks.matrixTensor, Tensor.matrixCoefficients, Tensor.rankOne, and_comm,and_left_comm, eq_comm] using (h x y z.swap).symm/-- Step 3. A circuit with `m` gates gives a tensor rank of at most `2 * m`. -/theorem tensorRank_le_two_mul_cost {F : Type*} [Field F] {n m : ℕ}(h : MatrixExponent.Computes F n m) :SpectralBooks.tensorRank (SpectralBooks.matrixTensor (MatrixExponent.Rat F n) n n n) ≤ 2 * m :=SpectralBooks.tensorRank_le_of_rankAtMost (rankAtMost_of_RankLE (circuit_gives_rank h))/-- Step 4. The finite-size lower bound in the model of Lean.For each side length `n ≥ 2`, such a circuit has at least `⌈n^(9/4) / 2⌉` gates. -/theorem circuit_lower_bound (F : Type*) [Field F] {n m : ℕ} (hn : 2 ≤ n)(h : MatrixExponent.Computes F n m) : ⌈(n : ℝ) ^ ((9 : ℝ) / 4) / 2⌉₊ ≤ m := byhave h3 := SpectralBooks.rpow_formalOmega_le_tensorRank (MatrixExponent.Rat F n) hnrw [SpectralBooks.square_exponent] at h3have h4 : (n : ℝ) ^ ((9 : ℝ) / 4) ≤ ((2 * m : ℕ) : ℝ) :=le_trans h3 (Nat.cast_le.2 (tensorRank_le_two_mul_cost h))have h5 : (n : ℝ) ^ ((9 : ℝ) / 4) ≤ 2 * (m : ℝ) := by exact_mod_cast h4rw [Nat.ceil_le, div_le_iff₀ (by norm_num : (0 : ℝ) < 2)]linarith/-- The rank form, for any field: a decomposition of the matrix tensor over `F` with `r` termshas `r ≥ n^(9/4)` for `n ≥ 2`. -/theorem rank_decomposition_lower_bound (F : Type*) [Field F] {n r : ℕ} (hn : 2 ≤ n)(h : MatrixExponent.RankLE F n r) : (n : ℝ) ^ ((9 : ℝ) / 4) ≤ (r : ℝ) := byhave h3 := SpectralBooks.rpow_formalOmega_le_tensorRank F hnrw [SpectralBooks.square_exponent] at h3exact le_trans h3 (Nat.cast_le.2 (SpectralBooks.tensorRank_le_of_rankAtMost (rankAtMost_of_RankLE h)))/-- The same with the ceiling: at least `⌈n^(9/4)⌉` terms. -/theorem rank_decomposition_ceiling_lower_bound (F : Type*) [Field F] {n r : ℕ} (hn : 2 ≤ n)(h : MatrixExponent.RankLE F n r) : ⌈(n : ℝ) ^ ((9 : ℝ) / 4)⌉₊ ≤ r :=Nat.ceil_le.2 (rank_decomposition_lower_bound F hn h)end MobiusOtter-- Axioms.#print axioms MobiusOtter.circuit_gives_rank#print axioms MobiusOtter.rankAtMost_of_RankLE#print axioms MobiusOtter.tensorRank_le_two_mul_cost#print axioms MobiusOtter.circuit_lower_bound#print axioms MobiusOtter.rank_decomposition_lower_bound#print axioms MobiusOtter.rank_decomposition_ceiling_lower_bound