File size: 4,611 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.Numerical.ComplexCertificatesLog
import Mathlib.Analysis.SpecialFunctions.Pow.Real
namespace OAI
/-! Exact rational intervals, logarithm bounds and arithmetic circuit soundness. -/
noncomputable section
namespace MatrixMultiplication.ComplexCertificates
def curveU : β := (2 : β) ^ ((2 : β) / 3)
def curveV : β := (19 : β) ^ ((2 : β) / 3)
def curveZ : β := 8 + 12 * curveU + 6 * curveU ^ 2 + curveV
def curveG : β :=
(12 * curveU * (1 + curveU) * Real.log 2 + curveV * Real.log 19) / curveZ
def curveH : β := Real.log curveZ - (2 / 3 : β) * curveG
theorem curveU_cube : curveU ^ 3 = 4 := by
rw [curveU, β Real.rpow_mul_natCast (by norm_num : (0 : β) β€ 2)]
norm_num
theorem curveV_cube : curveV ^ 3 = 361 := by
rw [curveV, β Real.rpow_mul_natCast (by norm_num : (0 : β) β€ 19)]
norm_num
theorem curveU_bounds :
(158739 : β) / 100000 < curveU β§ curveU < (79371 : β) / 50000 := by
have h0 : 0 β€ curveU := Real.rpow_nonneg (by norm_num) _
constructor
Β· apply (pow_lt_pow_iff_leftβ (by norm_num) h0 (by norm_num : (3 : β) β 0)).1
rw [curveU_cube]
norm_num
Β· apply (pow_lt_pow_iff_leftβ h0 (by norm_num) (by norm_num : (3 : β) β 0)).1
rw [curveU_cube]
norm_num
theorem curveV_bounds :
(71203 : β) / 10000 < curveV β§ curveV < (14241 : β) / 2000 := by
have h0 : 0 β€ curveV := Real.rpow_nonneg (by norm_num) _
constructor
Β· apply (pow_lt_pow_iff_leftβ (by norm_num) h0 (by norm_num : (3 : β) β 0)).1
rw [curveV_cube]
norm_num
Β· apply (pow_lt_pow_iff_leftβ h0 (by norm_num) (by norm_num : (3 : β) β 0)).1
rw [curveV_cube]
norm_num
theorem curveZ_bounds :
(246439 : β) / 5000 < curveZ β§ curveZ < (49289 : β) / 1000 := by
obtain β¨hu, hu'β© := curveU_bounds
obtain β¨hv, hv'β© := curveV_bounds
have hu0 : 0 β€ curveU := by linarith
constructor
Β· have h : 8 + 12 * ((158739 : β) / 100000) +
6 * ((158739 : β) / 100000) ^ 2 + (71203 : β) / 10000 β€ curveZ := by
dsimp [curveZ]
gcongr
norm_num at h β’
linarith
Β· have h : curveZ β€ 8 + 12 * ((79371 : β) / 50000) +
6 * ((79371 : β) / 50000) ^ 2 + (14241 : β) / 2000 := by
dsimp [curveZ]
gcongr
norm_num at h β’
linarith
theorem curveG_bounds :
(27961 : β) / 25000 < curveG β§ curveG < (6991 : β) / 6250 := by
obtain β¨hu, hu'β© := curveU_bounds
obtain β¨hv, hv'β© := curveV_bounds
obtain β¨hz, hz'β© := curveZ_bounds
obtain β¨hl2, hh2β© := log_two_bounds
obtain β¨hl19, hh19β© := log_nineteen_bounds
have hu0 : 0 β€ curveU := by linarith
have hv0 : 0 β€ curveV := by linarith
have hz0 : 0 < curveZ := by linarith
have hl20 : 0 β€ Real.log 2 := by linarith
have hl190 : 0 β€ Real.log 19 := by linarith
have hnlo :
12 * ((158739 : β) / 100000) * (1 + (158739 : β) / 100000) *
((34657 : β) / 50000) + ((71203 : β) / 10000) * ((7361 : β) / 2500) β€
12 * curveU * (1 + curveU) * Real.log 2 + curveV * Real.log 19 := by
gcongr
have hnhi :
12 * curveU * (1 + curveU) * Real.log 2 + curveV * Real.log 19 β€
12 * ((79371 : β) / 50000) * (1 + (79371 : β) / 50000) *
((17329 : β) / 25000) + ((14241 : β) / 2000) * ((5889 : β) / 2000) := by
gcongr
constructor
Β· apply (lt_div_iffβ hz0).2
norm_num at hnlo
nlinarith
Β· apply (div_lt_iffβ hz0).2
norm_num at hnhi
nlinarith
theorem curveH_bounds :
(31519 : β) / 10000 < curveH β§ curveH < (15761 : β) / 5000 := by
obtain β¨hg, hg'β© := curveG_bounds
obtain β¨hz, hz'β© := curveZ_bounds
have hz0 : 0 < curveZ := by linarith
have hlo : (77953 : β) / 20000 < Real.log curveZ :=
log_curve_lower.trans (Real.log_lt_log (by norm_num) hz)
have hhi : Real.log curveZ < (97443 : β) / 25000 :=
(Real.log_lt_log hz0 hz').trans log_curve_upper
dsimp [curveH]
constructor <;> linarith
def squareLeafCount : β := 2995461856366867388223311649574852466276480577
theorem square_log_lower :
(523471 : β) / 5000 < Real.log (squareLeafCount : β) := by
have hc : (59 / 20 : β) * 10 ^ 45 < (squareLeafCount : β) := by
norm_num [squareLeafCount]
have hlo := Real.log_lt_log (by positivity : (0 : β) < (59 / 20 : β) * 10 ^ 45) hc
rw [Real.log_mul (by norm_num) (by norm_num), Real.log_pow] at hlo
have h1 := log_square_mantissa_lower
have h2 := log_ten_lower
norm_num at hlo
linarith
end MatrixMultiplication.ComplexCertificates
end
end OAI
|