File size: 3,362 Bytes
cdec422
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.LinearAlgebra.MatrixMultiplication.ComplexBounds.CW75ReorderedFinite

namespace OAI

/-! Explicit complex square and rectangular matrix multiplication bounds. -/

noncomputable section

namespace MatrixMultiplication.CW75ReorderedFiniteRates

open MatrixMultiplication.Foundation CW75LabelHierarchy StageHierarchyResources
open CW75ReorderedFinite ComplexWitness Filter
open scoped BigOperators Topology Classical

theorem tendsto_log_copies (counts : Scalar → ℕ) (hD : 0 < ∑ a, counts a)
    (p : FiniteLaw Scalar)
    (mass : ∀ a, p.mass a = (counts a : ℝ) / (∑ b, counts b : ℕ)) :
    Tendsto (fun t : ℕ => Real.log (copies counts t : ℝ) /
      ((t : ℝ) * (∑ a, counts a : ℕ))) atTop
      (𝓝 (finiteEntropy p.mass)) := by
  have hmass : (fun a => (counts a : ℝ) / (∑ b, counts b : ℕ)) = p.mass :=
    (funext mass).symm
  simpa only [copies, hmass] using tendsto_log_exactWords_card_mul counts hD

theorem tendsto_log_auxiliaryBudget (counts : Scalar → ℕ) (hD : 0 < ∑ a, counts a)
    (p : FiniteLaw Scalar)
    (mass : ∀ a, p.mass a = (counts a : ℝ) / (∑ b, counts b : ℕ)) :
    Tendsto (fun t : ℕ => Real.log (stageAuxiliaryBudget counts curveLabels 5 t : ℝ) /
      ((t : ℝ) * (∑ a, counts a : ℕ))) atTop
      (𝓝 (finiteEntropy p.mass)) := by
  have hmass : (fun a => (counts a : ℝ) / (∑ b, counts b : ℕ)) = p.mass :=
    (funext mass).symm
  simpa only [hmass] using tendsto_log_stageAuxiliaryBudget counts hD curveLabels 5
    curve_completeRecord_injective

theorem tendsto_log_sourceRank (counts : Scalar → ℕ) (hD : 0 < ∑ a, counts a) :
    Tendsto (fun t : ℕ => Real.log ((27 ^ blocks counts t : ℕ) : ℝ) /
      ((t : ℝ) * (∑ a, counts a : ℕ))) atTop
      (𝓝 (3 * Real.log 3)) := by
  have hlog27 : Real.log (27 : ℝ) = 3 * Real.log 3 := by
    rw [show (27 : ℝ) = 3 ^ 3 by norm_num, Real.log_pow]
    norm_num
  have hD' : ((∑ a, counts a : ℕ) : ℝ) ≠ 0 :=
    Nat.cast_ne_zero.mpr (Nat.ne_of_gt hD)
  apply tendsto_const_nhds.congr'
  filter_upwards [eventually_ne_atTop (0 : ℕ)] with t ht
  have htD : (t : ℝ) * (∑ a, counts a : ℕ) ≠ 0 :=
    mul_ne_zero (Nat.cast_ne_zero.mpr ht) hD'
  rw [Nat.cast_pow, Real.log_pow, blocks, Nat.cast_mul]
  change 3 * Real.log 3 =
    ((t : ℝ) * (∑ a, counts a : ℕ)) * Real.log 27 /
      ((t : ℝ) * (∑ a, counts a : ℕ))
  rw [mul_div_cancel_left₀ _ htD, hlog27]

theorem tendsto_log_rankBudget (counts : Scalar → ℕ) (hD : 0 < ∑ a, counts a)
    (p : FiniteLaw Scalar)
    (mass : ∀ a, p.mass a = (counts a : ℝ) / (∑ b, counts b : ℕ)) :
    Tendsto (fun t : ℕ => Real.log (rankBudget counts t : ℝ) /
      ((t : ℝ) * (∑ a, counts a : ℕ))) atTop
      (𝓝 (3 * Real.log 3 + finiteEntropy p.mass)) := by
  apply ((tendsto_log_sourceRank counts hD).add
    (tendsto_log_auxiliaryBudget counts hD p mass)).congr
  intro t
  have hsource : ((27 ^ blocks counts t : ℕ) : ℝ) ≠ 0 :=
    Nat.cast_ne_zero.mpr (pow_ne_zero _ (by decide))
  have hauxiliary : (stageAuxiliaryBudget counts curveLabels 5 t : ℝ) ≠ 0 :=
    Nat.cast_ne_zero.mpr
      (Nat.ne_of_gt (stageAuxiliaryBudget_pos counts curveLabels 5 t))
  rw [rankBudget, Nat.cast_mul, Real.log_mul hsource hauxiliary, add_div]

end MatrixMultiplication.CW75ReorderedFiniteRates

end

end OAI