Download data/lean/OAI/LinearAlgebra/MatrixMultiplication/Duality/HiddenCounts.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 2.95 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/LinearAlgebra/MatrixMultiplication/Duality/HiddenCounts.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/LinearAlgebra/MatrixMultiplication/Duality/HiddenCounts.lean
-
curl -L -o HiddenCounts.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/LinearAlgebra/MatrixMultiplication/Duality/HiddenCounts.lean
2.95 kB
| import OAI.LinearAlgebra.MatrixMultiplication.Completion.Partitions | |
| namespace OAI | |
| /-! Dual matrix multiplication exponents and finite rectangular constructions. -/ | |
| noncomputable section | |
| namespace MatrixMultiplication.DualHiddenRates | |
| open MatrixMultiplication.Foundation RecursiveCompletion CompletionPartitions | |
| attribute [local instance 10000] Classical.propDecidable Classical.decEq | |
| attribute [local instance 11000] instDecidableEqFin | |
| variable {X Y Z : Type*} [Fintype X] | |
| theorem inactiveCount_minus_real (S : FlaggedTensor X Y Z) (m : β) : | |
| (inactiveCount (complete S .B m) : β) = | |
| ((activeCount S : β) + (inactiveCount S : β)) ^ m - | |
| (activeCount S : β) ^ m := by | |
| have h := partition_count (complete S .B m) | |
| rw [activeCount_minus, Fintype.card_fun, Fintype.card_fin, | |
| β partition_count S] at h | |
| have hreal : (activeCount S : β) ^ m + | |
| (inactiveCount (complete S .B m) : β) = | |
| ((activeCount S : β) + (inactiveCount S : β)) ^ m := by | |
| simpa only [Nat.cast_add, Nat.cast_pow] using | |
| congrArg (fun n : β => (n : β)) h | |
| linarith | |
| theorem activeCount_plus_real (S : FlaggedTensor X Y Z) (center : Color) | |
| (hc : center β .B) (m : β) : | |
| (activeCount (complete S center m) : β) = | |
| ((inactiveCount S : β) + (activeCount S : β)) ^ m - | |
| (inactiveCount S : β) ^ m := by | |
| have h := partition_count (complete S center m) | |
| rw [inactiveCount_plus S center hc m, Fintype.card_fun, | |
| Fintype.card_fin, β partition_count S] at h | |
| have hreal : (activeCount (complete S center m) : β) + | |
| (inactiveCount S : β) ^ m = | |
| ((activeCount S : β) + (inactiveCount S : β)) ^ m := by | |
| simpa only [Nat.cast_add, Nat.cast_pow] using | |
| congrArg (fun n : β => (n : β)) h | |
| rw [add_comm (activeCount S : β) (inactiveCount S : β)] at hreal | |
| linarith | |
| theorem activeFraction_ratio (S : FlaggedTensor X Y Z) : | |
| activeFraction S = (activeCount S : β) / | |
| ((activeCount S : β) + (inactiveCount S : β)) := by | |
| rw [activeFraction, β Nat.cast_add, partition_count] | |
| theorem inactiveFraction_ratio [Nonempty X] (S : FlaggedTensor X Y Z) : | |
| 1 - activeFraction S = (inactiveCount S : β) / | |
| ((inactiveCount S : β) + (activeCount S : β)) := by | |
| rw [add_comm (inactiveCount S : β) (activeCount S : β), | |
| β Nat.cast_add, partition_count] | |
| have h := fraction_sum S | |
| unfold inactiveFraction at h | |
| linarith | |
| theorem counts_pos [Nonempty X] (S : FlaggedTensor X Y Z) | |
| (h0 : 0 < activeFraction S) (h1 : activeFraction S < 1) : | |
| 0 < (activeCount S : β) β§ 0 < (inactiveCount S : β) := by | |
| have hcard : (0 : β) < Fintype.card X := | |
| Nat.cast_pos.mpr Fintype.card_pos | |
| have hi : 0 < inactiveFraction S := by | |
| linarith [fraction_sum S] | |
| constructor | |
| Β· exact (div_pos_iff_of_pos_right hcard).mp h0 | |
| Β· exact (div_pos_iff_of_pos_right hcard).mp hi | |
| end MatrixMultiplication.DualHiddenRates | |
| end | |
| end OAI | |