Download data/lean/OAI/LinearAlgebra/MatrixMultiplication/Duality/FiniteRates.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.08 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/LinearAlgebra/MatrixMultiplication/Duality/FiniteRates.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/LinearAlgebra/MatrixMultiplication/Duality/FiniteRates.lean
-
curl -L -o FiniteRates.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/LinearAlgebra/MatrixMultiplication/Duality/FiniteRates.lean
6.08 kB
| import OAI.LinearAlgebra.MatrixMultiplication.Duality.FiniteRealization | |
| import OAI.LinearAlgebra.MatrixMultiplication.Entropy.ConditionalRateBridge | |
| namespace OAI | |
| /-! Dual matrix multiplication exponents and finite rectangular constructions. -/ | |
| noncomputable section | |
| namespace MatrixMultiplication.DualFiniteRealization | |
| open MatrixMultiplication.Foundation CompletionHierarchyWords CompletionExecution | |
| open CompletionFiniteRealization StageHierarchyResources ConditionalLabels Filter | |
| open scoped BigOperators Topology Classical | |
| variable {A X Y Z : Type} [Fintype A] [Fintype X] [Fintype Y] [Fintype Z] | |
| variable (H : ReadableHierarchy A X Y Z) (counts : A β β) | |
| variable (hD : 0 < β a, counts a) | |
| variable (complete : Function.Injective (labelRecordOf H.labels H.depth)) | |
| variable (p : FiniteLaw A) | |
| variable (mass : β a, p.mass a = (counts a : β) / (β b, counts b : β)) | |
| def pairRate (pair : ReaderPair) : β := | |
| lawPairingRate p H.labels H.depth (fun n => H.pair n.val) pair | |
| include hD complete mass in | |
| omit [Fintype X] [Fintype Y] [Fintype Z] in | |
| theorem copies_limit : | |
| Tendsto (fun t : β => Real.log (copies H 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, realize_label_card H counts _ complete, hmass] using | |
| tendsto_log_exactWords_card_mul counts hD | |
| include hD complete mass in | |
| omit [Fintype X] [Fintype Y] [Fintype Z] in | |
| theorem auxiliary_limit : | |
| Tendsto (fun t : β => Real.log ((realize H counts t).execution.rankBound : β) / | |
| ((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 [realize_rankBound, hmass] using | |
| tendsto_log_stageAuxiliaryBudget counts hD H.labels H.depth complete | |
| include hD in | |
| theorem source_rank_limit (R : β) : | |
| Tendsto (fun t : β => | |
| Real.log ((R ^ CompletionFiniteRealization.blocks counts t : β) : β) / | |
| ((t : β) * (β a, counts a : β))) atTop (π (Real.log R)) := by | |
| 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, CompletionFiniteRealization.blocks, Nat.cast_mul] | |
| exact (mul_div_cancel_leftβ (Real.log R) htD).symm | |
| include hD complete mass in | |
| omit [Fintype X] [Fintype Y] [Fintype Z] in | |
| theorem rank_budget_limit {R : β} (hR : 0 < R) : | |
| Tendsto (fun t : β => Real.log (rankBudget H counts t R : β) / | |
| ((t : β) * (β a, counts a : β))) atTop | |
| (π (Real.log R + finiteEntropy p.mass)) := by | |
| apply ((source_rank_limit counts hD R).add | |
| (auxiliary_limit H counts hD complete p mass)).congr | |
| intro t | |
| have hs : ((R ^ CompletionFiniteRealization.blocks counts t : β) : β) β 0 := | |
| Nat.cast_ne_zero.mpr (pow_ne_zero _ (Nat.ne_of_gt hR)) | |
| have ha : ((realize H counts t).execution.rankBound : β) β 0 := | |
| Nat.cast_ne_zero.mpr (Nat.ne_of_gt (auxiliaryRank_pos H counts t)) | |
| rw [rankBudget, Nat.cast_mul, Real.log_mul hs ha, add_div] | |
| variable {T : Tensor β X Y Z} {R d D : β} | |
| variable (source : Tensor.PolynomialApproximation T R d D) (hR : 0 < R) | |
| variable (supported : β x y z, T x y z β 0 β | |
| β a, H.x a = x β§ H.y a = y β§ H.z a = z) | |
| variable (unit : β a, T (H.x a) (H.y a) (H.z a) = 1) | |
| include hD mass in | |
| theorem witness_outer_limit : | |
| Tendsto (fun t : β => | |
| Real.log ((witness H counts t complete source hR supported unit).outer : β) / | |
| ((t : β) * (β a, counts a : β))) atTop | |
| (π (pairRate H p .xy + pairRate H p .xz)) := by | |
| have hi := tendsto_log_stagePairingSize_law counts hD p mass H.labels H.depth | |
| (fun n => H.pair n.val) .xy | |
| have hr := tendsto_log_stagePairingSize_law counts hD p mass H.labels H.depth | |
| (fun n => H.pair n.val) .xz | |
| apply (hi.add hr).congr | |
| intro t | |
| rw [(witness_dimensions H counts t complete source hR supported unit).1, | |
| Nat.cast_mul, Real.log_mul] | |
| Β· ring | |
| Β· exact Nat.cast_ne_zero.mpr (Nat.ne_of_gt | |
| (pairingSize_pos _ _ _ (fun n => stageRefinementCount_pos counts H.labels n.val t))) | |
| Β· exact Nat.cast_ne_zero.mpr (Nat.ne_of_gt | |
| (pairingSize_pos _ _ _ (fun n => stageRefinementCount_pos counts H.labels n.val t))) | |
| include hD mass in | |
| theorem witness_inner_limit : | |
| Tendsto (fun t : β => | |
| Real.log ((witness H counts t complete source hR supported unit).inner : β) / | |
| ((t : β) * (β a, counts a : β))) atTop (π (2 * pairRate H p .yz)) := by | |
| apply ((tendsto_log_stagePairingSize_law counts hD p mass H.labels H.depth | |
| (fun n => H.pair n.val) .yz).const_mul 2).congr | |
| intro t | |
| rw [(witness_dimensions H counts t complete source hR supported unit).2, | |
| Nat.cast_pow, Real.log_pow] | |
| norm_num | |
| ring | |
| include hD mass in | |
| theorem witness_multiplicity_limit : | |
| Tendsto (fun t : β => | |
| Real.log ((witness H counts t complete source hR supported unit).multiplicity : β) / | |
| ((t : β) * (β a, counts a : β))) atTop (π (2 * finiteEntropy p.mass)) := by | |
| apply ((copies_limit H counts hD complete p mass).const_mul 2).congr | |
| intro t | |
| rw [witness_multiplicity, Nat.cast_pow, Real.log_pow] | |
| norm_num | |
| ring | |
| include hD mass in | |
| theorem witness_rank_limit : | |
| Tendsto (fun t : β => | |
| Real.log ((witness H counts t complete source hR supported unit).rank : β) / | |
| ((t : β) * (β a, counts a : β))) atTop | |
| (π (2 * (Real.log R + finiteEntropy p.mass))) := by | |
| apply ((rank_budget_limit H counts hD complete p mass hR).const_mul 2).congr | |
| intro t | |
| rw [witness_rank, Nat.cast_pow, Real.log_pow] | |
| simp only [rankBudget, Nat.cast_mul, Nat.cast_pow] | |
| norm_num | |
| ring | |
| end MatrixMultiplication.DualFiniteRealization | |
| end | |
| end OAI | |