File size: 5,419 Bytes
4a56cd6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import OAI.LinearAlgebra.MatrixMultiplication.Tensor.ComplexWitness
import OAI.LinearAlgebra.MatrixMultiplication.Numerical.ComplexCertificates
import OAI.LinearAlgebra.MatrixMultiplication.Rectangular.ASI
import OAI.LinearAlgebra.MatrixMultiplication.Rectangular.RateLimit

namespace OAI

/-! Rectangular matrix multiplication algorithms and their asymptotic exponents. -/

namespace MatrixMultiplication.RectangularWitness

open Filter
open scoped Topology

theorem aspect_lower {g h : ℝ}
    (hg : (27961 : ℝ) / 25000 < g)
    (hhβ‚€ : 0 < h) (hh : h < (15761 : ℝ) / 5000) :
    (55922 : ℝ) / 78805 < 2 * g / h := by
  apply (lt_div_iffβ‚€ hhβ‚€).2
  nlinarith

theorem target_aspect_lt {g h : ℝ}
    (hg : (27961 : ℝ) / 25000 < g)
    (hhβ‚€ : 0 < h) (hh : h < (15761 : ℝ) / 5000) :
    (709 : ℝ) / 1000 < 2 * g / h := by
  exact (by norm_num : (709 : ℝ) / 1000 < 55922 / 78805).trans
    (aspect_lower hg hhβ‚€ hh)

theorem aspect_lt_one {g h : ℝ}
    (hg : g < (6991 : ℝ) / 6250)
    (hh : (31519 : ℝ) / 10000 < h) : 2 * g / h < 1 := by
  have hhβ‚€ : 0 < h := by linarith
  apply (div_lt_iffβ‚€ hhβ‚€).2
  linarith

theorem exponent_upper {c h : ℝ}
    (hc : c < (10987 : ℝ) / 10000)
    (hh : (31519 : ℝ) / 10000 < h) :
    6 * c / h < (65922 : ℝ) / 31519 := by
  have hhβ‚€ : 0 < h := by linarith
  apply (div_lt_iffβ‚€ hhβ‚€).2
  nlinarith

theorem exponent_lt_target {c h : ℝ}
    (hc : c < (10987 : ℝ) / 10000)
    (hh : (31519 : ℝ) / 10000 < h) :
    6 * c / h < (523 : ℝ) / 250 := by
  exact (exponent_upper hc hh).trans
    (by norm_num : (65922 : ℝ) / 31519 < 523 / 250)

theorem omega_lt_of_balanced_family
    (W : β„• β†’ ComplexWitness.FiniteRectangularWitness)
    (scale : β„• β†’ ℝ) (k target g h H : ℝ)
    (k_nonneg : 0 ≀ k) (h_positive : 0 < h)
    (aspect_gap : k * h < 2 * g) (cost_gap : 6 * Real.log 3 < target * h)
    (scale_positive : βˆ€αΆ  n in atTop, 0 < scale n)
    (outer_rate : Tendsto
      (fun n => Real.log ((W n).outer : ℝ) / scale n) atTop (𝓝 h))
    (inner_rate : Tendsto
      (fun n => Real.log ((W n).inner : ℝ) / scale n) atTop (𝓝 (2 * g)))
    (multiplicity_rate : Tendsto
      (fun n => Real.log ((W n).multiplicity : ℝ) / scale n) atTop (𝓝 (2 * H)))
    (rank_rate : Tendsto
      (fun n => Real.log ((W n).rank : ℝ) / scale n) atTop
      (𝓝 (6 * Real.log 3 + 2 * H))) :
    Arithmetic.rectangularOmega β„‚ k < target := by
  have hbound := RectangularRateLimit.exponent_le_of_finite_asi
    (fun n => (W n).outer_pos) (fun n => (W n).inner_pos)
    scale_positive outer_rate inner_rate multiplicity_rate rank_rate h_positive aspect_gap
    (fun n ha hab => Arithmetic.equalRectangular_log_inequality_of_polynomialApproximation
      ha (W n).multiplicity_pos k_nonneg hab (W n).approximation)
  have hcancel : (6 * Real.log 3 + 2 * H - 2 * H) / h = 6 * Real.log 3 / h := by ring
  rw [hcancel] at hbound
  exact hbound.trans_lt ((div_lt_iffβ‚€ h_positive).2 cost_gap)

theorem omega_lt_target_of_nearby_balanced_family
    (W : β„• β†’ ComplexWitness.FiniteRectangularWitness)
    (scale : β„• β†’ ℝ) (g h H : ℝ)
    (g_lower : (27961 : ℝ) / 25000 < g)
    (h_lower : (31519 : ℝ) / 10000 < h)
    (h_upper : h < (15761 : ℝ) / 5000)
    (scale_positive : βˆ€αΆ  n in atTop, 0 < scale n)
    (outer_rate : Tendsto
      (fun n => Real.log ((W n).outer : ℝ) / scale n) atTop
      (𝓝 h))
    (inner_rate : Tendsto
      (fun n => Real.log ((W n).inner : ℝ) / scale n) atTop
      (𝓝 (2 * g)))
    (multiplicity_rate : Tendsto
      (fun n => Real.log ((W n).multiplicity : ℝ) / scale n) atTop (𝓝 (2 * H)))
    (rank_rate : Tendsto
      (fun n => Real.log ((W n).rank : ℝ) / scale n) atTop
      (𝓝 (6 * Real.log 3 + 2 * H))) :
    Arithmetic.rectangularOmega β„‚ ((709 : ℝ) / 1000) < (523 : ℝ) / 250 := by
  have hhβ‚€ : 0 < h := by linarith
  have hgap : (709 : ℝ) / 1000 * h < 2 * g :=
    (lt_div_iffβ‚€ hhβ‚€).1 (target_aspect_lt g_lower hhβ‚€ h_upper)
  apply omega_lt_of_balanced_family W scale (709 / 1000) (523 / 250) g h H
    (by norm_num) hhβ‚€ hgap _ scale_positive outer_rate inner_rate multiplicity_rate rank_rate
  exact (div_lt_iffβ‚€ hhβ‚€).1
    (exponent_lt_target ComplexCertificates.log_three_upper h_lower)

theorem omega_lt_target_of_balanced_family
    (W : β„• β†’ ComplexWitness.FiniteRectangularWitness)
    (scale : β„• β†’ ℝ) (H : ℝ)
    (scale_positive : βˆ€αΆ  n in atTop, 0 < scale n)
    (outer_rate : Tendsto
      (fun n => Real.log ((W n).outer : ℝ) / scale n) atTop
      (𝓝 ComplexCertificates.curveH))
    (inner_rate : Tendsto
      (fun n => Real.log ((W n).inner : ℝ) / scale n) atTop
      (𝓝 (2 * ComplexCertificates.curveG)))
    (multiplicity_rate : Tendsto
      (fun n => Real.log ((W n).multiplicity : ℝ) / scale n) atTop (𝓝 (2 * H)))
    (rank_rate : Tendsto
      (fun n => Real.log ((W n).rank : ℝ) / scale n) atTop
      (𝓝 (6 * Real.log 3 + 2 * H))) :
    Arithmetic.rectangularOmega β„‚ ((709 : ℝ) / 1000) < (523 : ℝ) / 250 :=
  omega_lt_target_of_nearby_balanced_family W scale
    ComplexCertificates.curveG ComplexCertificates.curveH H
    ComplexCertificates.curveG_bounds.1 ComplexCertificates.curveH_bounds.1
    ComplexCertificates.curveH_bounds.2 scale_positive outer_rate inner_rate
    multiplicity_rate rank_rate

end MatrixMultiplication.RectangularWitness

end OAI