File size: 4,455 Bytes
f18e7de
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.LinearAlgebra.MatrixMultiplication.Numerical.ComplexCertificatesLog
import OAI.LinearAlgebra.MatrixMultiplication.Duality.WitnessArithmetic

namespace OAI

/-! Exact rational intervals, logarithm bounds and arithmetic circuit soundness. -/

namespace MatrixMultiplication.ComplexCertificates

open DualWitness

theorem rho24_bounds : (1597 : ℝ) / 5000 < rho24 ∧ rho24 < (639 : ℝ) / 2000 := by
  norm_num [rho24, rho8]

theorem rho48_bounds : (67 : ℝ) / 125 < rho48 ∧ rho48 < (537 : ℝ) / 1000 := by
  norm_num [rho48, rho24, rho8]

theorem inactive48_lower : (463 : ℝ) / 1000 < 1 - rho48 := by
  norm_num [rho48, rho24, rho8]

theorem inactive288_lower : (9 : ℝ) / 25 < 1 - rho288 := by
  norm_num [rho288, rho96, rho48, rho24, rho8]

theorem delta24_bounds :
    (87 : ℝ) / 250 < delta24 ∧ delta24 < (177 : ℝ) / 500 := by
  obtain ⟨hl, hh⟩ := log_nine_sevenths_bounds
  norm_num [delta24, rho24, rho8]
  constructor <;> linarith

theorem z48_bounds : (127 : ℝ) / 200 < z48 ∧ z48 < (651 : ℝ) / 1000 := by
  obtain ⟨hl, hh⟩ := delta24_bounds
  have helo : (701 : ℝ) / 1000 < Real.exp (-delta24) :=
    exp_neg_354_lower.trans (Real.exp_lt_exp.mpr (by linarith))
  have hehi : Real.exp (-delta24) < (707 : ℝ) / 1000 :=
    (Real.exp_lt_exp.mpr (by linarith : -delta24 < -(87 / 250 : ℝ))).trans
      exp_neg_348_upper
  have harglo : (1 + (701 / 1000 : ℝ)) ^ 2 - 1 <
      (1 + Real.exp (-delta24)) ^ 2 - 1 := by gcongr
  have harghi : (1 + Real.exp (-delta24)) ^ 2 - 1 <
      (1 + (707 / 1000 : ℝ)) ^ 2 - 1 := by gcongr
  have hargpos : 0 < (1 + Real.exp (-delta24)) ^ 2 - 1 := by
    norm_num at harglo
    linarith
  exact ⟨log_z48_lower.trans (Real.log_lt_log (by norm_num) harglo),
    (Real.log_lt_log hargpos harghi).trans log_z48_upper⟩

theorem delta96_bounds : 0 < delta96 ∧ delta96 < (43 : ℝ) / 50 := by
  obtain ⟨hr, hr'⟩ := rho48_bounds
  obtain ⟨hz, hz'⟩ := z48_bounds
  have hd : 0 < 1 + rho48 := by linarith
  constructor
  · exact div_pos (by linarith) hd
  · apply (div_lt_iff₀ hd).2
    linarith

theorem z288_bounds : (157 : ℝ) / 250 < z288 ∧ z288 < 2 := by
  obtain ⟨hd, hd'⟩ := delta96_bounds
  have helo : (169 : ℝ) / 400 < Real.exp (-delta96) :=
    exp_neg_86_lower.trans (Real.exp_lt_exp.mpr (by linarith))
  have hehi : Real.exp (-delta96) < 1 := by
    simpa using Real.exp_lt_exp.mpr (by linarith : -delta96 < 0)
  have harglo : (1 + (169 / 400 : ℝ)) ^ 3 - 1 <
      (1 + Real.exp (-delta96)) ^ 3 - 1 := by gcongr
  have harghi : (1 + Real.exp (-delta96)) ^ 3 - 1 < 7 := by
    have h : (1 + Real.exp (-delta96)) ^ 3 - 1 < (1 + (1 : ℝ)) ^ 3 - 1 := by
      gcongr
    norm_num at h
    exact h
  have hargpos : 0 < (1 + Real.exp (-delta96)) ^ 3 - 1 := by
    norm_num at harglo
    linarith
  have hlog7 : Real.log 7 < 2 := by
    apply (Real.log_lt_iff_lt_exp (by norm_num)).2
    refine lt_of_lt_of_le ?_ (Real.sum_le_exp_of_nonneg (by norm_num : (0 : ℝ) ≤ 2) 6)
    norm_num [Finset.sum_range_succ, Nat.factorial]
  exact ⟨log_z288_lower.trans (Real.log_lt_log (by norm_num) harglo),
    (Real.log_lt_log hargpos harghi).trans hlog7⟩

theorem hiddenRate_lower :
    (9 / 64 : ℝ) * (549 / 500) + (463 / 1000 : ℝ) / 48 * (127 / 200) +
      (9 / 25 : ℝ) / 288 * (157 / 250) < hiddenRate := by
  have h3 := log_three_lower
  have h48 := z48_bounds.1
  have h288 := z288_bounds.1
  have hr48 := inactive48_lower
  have hr288 := inactive288_lower
  dsimp [hiddenRate]
  gcongr

theorem dual_aspect_lower : (1548637 : ℝ) / 3327360 < aspect := by
  have h2 := log_two_bounds
  have hD := hiddenRate_lower
  have hl2 : 0 < Real.log 2 := by linarith [h2.1]
  apply (lt_div_iff₀ hl2).2
  norm_num at hD
  linarith [h2.2]

theorem dual_aspect_lt_one : aspect < 1 := by
  have h3 := log_three_upper
  have h48 := z48_bounds
  have h288 := z288_bounds
  have hr48 := DualWitness.rho48_range
  have hr288 := DualWitness.rho288_range
  have h2 := log_two_bounds
  have hD : hiddenRate < (9 / 64 : ℝ) * (10987 / 10000) +
      (1 : ℝ) / 48 * (651 / 1000) + (1 : ℝ) / 288 * 2 := by
    dsimp [hiddenRate]
    gcongr <;> linarith
  have hl2 : 0 < Real.log 2 := by linarith [h2.1]
  apply (div_lt_iff₀ hl2).2
  norm_num at hD
  linarith [h2.1]

theorem dual_aspect_milestone : (465 : ℝ) / 1000 < aspect := by
  have h := dual_aspect_lower
  norm_num at h ⊢
  linarith

end MatrixMultiplication.ComplexCertificates

end OAI