Download data/lean/OAI/LinearAlgebra/MatrixMultiplication/FieldParameters/Weights.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 2.74 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/LinearAlgebra/MatrixMultiplication/FieldParameters/Weights.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/LinearAlgebra/MatrixMultiplication/FieldParameters/Weights.lean
-
curl -L -o Weights.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/LinearAlgebra/MatrixMultiplication/FieldParameters/Weights.lean
2.74 kB
| 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 | |