File size: 5,671 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
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
129
130
import OAI.LinearAlgebra.MatrixMultiplication.ComplexBounds.CW75ReorderedBalanced
import OAI.LinearAlgebra.MatrixMultiplication.ComplexBounds.CW75ReorderedFiniteRates
import OAI.LinearAlgebra.MatrixMultiplication.Entropy.ConditionalRateBridge
import OAI.LinearAlgebra.MatrixMultiplication.Rectangular.Witness

namespace OAI

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

noncomputable section

namespace MatrixMultiplication.CW75ReorderedBalancedRates

open MatrixMultiplication.Foundation Filter CW75LabelHierarchy
open ConditionalLabels ComplexWitness CW75ReorderedBalanced
open scoped BigOperators Topology Classical

variable (counts : Scalar → ℕ) (hD : 0 < ∑ a, counts a)
  (p : FiniteLaw Scalar)
  (mass : ∀ a, p.mass a = (counts a : ℝ) / (∑ b, counts b : ℕ))

include hD mass

theorem tendsto_log_rows :
    Tendsto (fun t => Real.log (CW75ReorderedFinite.rows counts t : ℝ) /
      ((t : ℝ) * (∑ a, counts a : ℕ))) atTop
      (𝓝 (lawPairingRate p curveLabels 5 curveReaderPair .xz)) := by
  have h := tendsto_log_stagePairingSize_law counts hD p mass
    curveLabels 5 curveReaderPair .xz
  apply h.congr
  intro t
  rw [(CW75ReorderedFinite.dimensions_eq_pairingSize counts t).1]

theorem tendsto_log_inner :
    Tendsto (fun t => Real.log (CW75ReorderedFinite.inner counts t : ℝ) /
      ((t : ℝ) * (∑ a, counts a : ℕ))) atTop
      (𝓝 (lawPairingRate p curveLabels 5 curveReaderPair .xy)) := by
  have h := tendsto_log_stagePairingSize_law counts hD p mass
    curveLabels 5 curveReaderPair .xy
  apply h.congr
  intro t
  rw [(CW75ReorderedFinite.dimensions_eq_pairingSize counts t).2.1]

theorem tendsto_log_columns :
    Tendsto (fun t => Real.log (CW75ReorderedFinite.columns counts t : ℝ) /
      ((t : ℝ) * (∑ a, counts a : ℕ))) atTop
      (𝓝 (lawPairingRate p curveLabels 5 curveReaderPair .yz)) := by
  have h := tendsto_log_stagePairingSize_law counts hD p mass
    curveLabels 5 curveReaderPair .yz
  apply h.congr
  intro t
  rw [(CW75ReorderedFinite.dimensions_eq_pairingSize counts t).2.2]

theorem tendsto_log_witness_outer :
    Tendsto (fun t => Real.log ((witness counts t).outer : ℝ) /
      ((t : ℝ) * (∑ a, counts a : ℕ))) atTop
      (𝓝 (lawPairingRate p curveLabels 5 curveReaderPair .xy +
        lawPairingRate p curveLabels 5 curveReaderPair .xz)) := by
  have h := (tendsto_log_rows counts hD p mass).add
    (tendsto_log_inner counts hD p mass)
  rw [add_comm (lawPairingRate p curveLabels 5 curveReaderPair .xz)] at h
  apply h.congr
  intro t
  rw [witness_outer, Nat.cast_mul, Real.log_mul
    (Nat.cast_ne_zero.mpr (Nat.ne_of_gt (CW75ReorderedFinite.rows_pos counts t)))
    (Nat.cast_ne_zero.mpr (Nat.ne_of_gt (CW75ReorderedFinite.inner_pos counts t))), add_div]

theorem tendsto_log_witness_inner :
    Tendsto (fun t => Real.log ((witness counts t).inner : ℝ) /
      ((t : ℝ) * (∑ a, counts a : ℕ))) atTop
      (𝓝 (2 * lawPairingRate p curveLabels 5 curveReaderPair .yz)) := by
  simpa only [witness_inner, Nat.cast_pow, Real.log_pow, Nat.cast_ofNat,
    mul_div_assoc] using (tendsto_log_columns counts hD p mass).const_mul 2

theorem tendsto_log_witness_multiplicity :
    Tendsto (fun t => Real.log ((witness counts t).multiplicity : ℝ) /
      ((t : ℝ) * (∑ a, counts a : ℕ))) atTop
      (𝓝 (2 * finiteEntropy p.mass)) := by
  simpa only [witness_multiplicity, Nat.cast_pow, Real.log_pow, Nat.cast_ofNat,
    mul_div_assoc] using
      (CW75ReorderedFiniteRates.tendsto_log_copies counts hD p mass).const_mul 2

theorem tendsto_log_witness_rank :
    Tendsto (fun t => Real.log ((witness counts t).rank : ℝ) /
      ((t : ℝ) * (∑ a, counts a : ℕ))) atTop
      (𝓝 (6 * Real.log 3 + 2 * finiteEntropy p.mass)) := by
  have h := (CW75ReorderedFiniteRates.tendsto_log_rankBudget counts hD p mass).const_mul 2
  have hcost : 2 * (3 * Real.log 3 + finiteEntropy p.mass) =
      6 * Real.log 3 + 2 * finiteEntropy p.mass := by ring
  simpa only [witness_rank, Nat.cast_pow, Real.log_pow, Nat.cast_ofNat,
    mul_div_assoc, hcost] using h

omit mass

theorem scale_eventually_pos :
    ∀ᶠ t : ℕ in atTop, 0 < (t : ℝ) * (∑ a, counts a : ℕ) := by
  filter_upwards [eventually_ge_atTop 1] with t ht
  exact mul_pos (Nat.cast_pos.mpr (by omega)) (Nat.cast_pos.mpr hD)

include mass

theorem omega_lt_of_fixed_count_law (k target : ℝ)
    (k_nonneg : 0 ≤ k)
    (incident_positive : 0 < lawPairingRate p curveLabels 5 curveReaderPair .xy +
      lawPairingRate p curveLabels 5 curveReaderPair .xz)
    (aspect_gap : k * (lawPairingRate p curveLabels 5 curveReaderPair .xy +
      lawPairingRate p curveLabels 5 curveReaderPair .xz) <
      2 * lawPairingRate p curveLabels 5 curveReaderPair .yz)
    (cost_gap : 6 * Real.log 3 < target *
      (lawPairingRate p curveLabels 5 curveReaderPair .xy +
        lawPairingRate p curveLabels 5 curveReaderPair .xz)) :
    Arithmetic.rectangularOmega ℂ k < target :=
  RectangularWitness.omega_lt_of_balanced_family (witness counts)
    (fun t => (t : ℝ) * (∑ a, counts a : ℕ)) k target
    (lawPairingRate p curveLabels 5 curveReaderPair .yz)
    (lawPairingRate p curveLabels 5 curveReaderPair .xy +
      lawPairingRate p curveLabels 5 curveReaderPair .xz)
    (finiteEntropy p.mass) k_nonneg incident_positive aspect_gap cost_gap
    (scale_eventually_pos counts hD)
    (tendsto_log_witness_outer counts hD p mass)
    (tendsto_log_witness_inner counts hD p mass)
    (tendsto_log_witness_multiplicity counts hD p mass)
    (tendsto_log_witness_rank counts hD p mass)

end MatrixMultiplication.CW75ReorderedBalancedRates

end

end OAI