import OAI.LinearAlgebra.SpectralBooks.ExactExponent /-! # A finite-size lower bound for circuits with division My own derivation. Each step uses a theorem of the claimant, or a copy of five lines of a private proof of the claimant (I say which). The kernel of Lean checks each proof. The model is the model `MatrixExponent.Computes` of the claimant: a straight-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 rational functions in the entries of the two input matrices. -/ set_option format.width 1000 namespace MobiusOtter open OAI.LinearAlgebra open 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 tensor into `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 := by obtain ⟨a, b, c, h⟩ := h refine ⟨a, b, fun i z => c i z.swap, ?_⟩ funext x y z simpa [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 := by have h3 := SpectralBooks.rpow_formalOmega_le_tensorRank (MatrixExponent.Rat F n) hn rw [SpectralBooks.square_exponent] at h3 have 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 h4 rw [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` terms has `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 : ℝ) := by have h3 := SpectralBooks.rpow_formalOmega_le_tensorRank F hn rw [SpectralBooks.square_exponent] at h3 exact 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