File size: 2,736 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 | import OAI.LinearAlgebra.MatrixMultiplication.FieldParameters.Basic
namespace OAI
/-! Fixed rational distributions and their entropy and capacity formulas. -/
namespace MatrixMultiplication.AllFieldParameters
open scoped BigOperators
theorem truncated_polynomial_positive (y : β) (hy : |y| β€ 1 / 4) :
0 < β j β Finset.range 17, y ^ j / Nat.factorial j := by
have term_bound (j : β) :
|y ^ (j + 1) / (Nat.factorial (j + 1) : β)| β€ (1 / 4 : β) ^ (j + 1) := by
have hd : (1 : β) β€ Nat.factorial (j + 1) := by
exact_mod_cast (Nat.succ_le_iff.mpr (Nat.factorial_pos (j + 1)))
calc
_ = |y| ^ (j + 1) / (Nat.factorial (j + 1) : β) := by
simp only [abs_div, abs_pow,
abs_of_nonneg (Nat.cast_nonneg (Nat.factorial (j + 1)) :
(0 : β) β€ (Nat.factorial (j + 1) : β))]
_ β€ (1 / 4 : β) ^ (j + 1) / (Nat.factorial (j + 1) : β) := by gcongr
_ β€ _ := div_le_self (by positivity) hd
have hb : |β j β Finset.range 16, y ^ (j + 1) / (Nat.factorial (j + 1) : β)| < 1 := by
calc
_ β€ β j β Finset.range 16, |y ^ (j + 1) / (Nat.factorial (j + 1) : β)| :=
Finset.abs_sum_le_sum_abs _ _
_ β€ β j β Finset.range 16, (1 / 4 : β) ^ (j + 1) :=
Finset.sum_le_sum (fun j _ => term_bound j)
_ < 1 := by norm_num [Finset.sum_range_succ]
rw [show 17 = 16 + 1 by decide, Finset.sum_range_succ']
norm_num only [pow_zero, Nat.factorial_zero, Nat.cast_one, div_one]
linarith [(abs_lt.mp hb).1]
theorem weight_positive_of_argument_bound (n : β€) (hn : |n| β€ 160000) :
0 < weight n := by
unfold weight
apply pow_pos
apply truncated_polynomial_positive
have hn' : |(n : β)| β€ 160000 := by exact_mod_cast hn
rw [abs_div]
rw [abs_of_pos (by norm_num : (0 : β) < 640000)]
exact (div_le_iffβ (by norm_num)).mpr (by linarith)
def weightArguments : List β€ := 0 :: (tablea ++ tableP ++ tablep ++ tablez)
theorem all_weight_arguments_bounded : β n β weightArguments, |n| β€ 160000 := by
decide +kernel
theorem all_weights_positive (n : β€) (hn : n β weightArguments) : 0 < weight n :=
weight_positive_of_argument_bound n (all_weight_arguments_bounded n hn)
theorem normalized_sum {ΞΉ : Type} [Fintype ΞΉ] (w : ΞΉ β β)
(h : β i, w i β 0) : β i, w i / (β j, w j) = 1 := by
simp only [div_eq_mul_inv]
rw [β Finset.sum_mul, β div_eq_mul_inv, div_self h]
theorem normalized_positive {ΞΉ : Type} [Fintype ΞΉ] (w : ΞΉ β β)
(hw : β i, 0 < w i) (i : ΞΉ) : 0 < w i / (β j, w j) := by
apply div_pos (hw i)
exact Finset.sum_pos (fun j _ => hw j) β¨i, Finset.mem_univ iβ©
end MatrixMultiplication.AllFieldParameters
end OAI
|