Download data/lean/OAI/LinearAlgebra/MatrixFields/Parameters/GroupSelectionParameters.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 9.08 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/LinearAlgebra/MatrixFields/Parameters/GroupSelectionParameters.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/LinearAlgebra/MatrixFields/Parameters/GroupSelectionParameters.lean
-
curl -L -o GroupSelectionParameters.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/LinearAlgebra/MatrixFields/Parameters/GroupSelectionParameters.lean
9.08 kB
| import Mathlib | |
| import OAI.LinearAlgebra.MatrixFields.Histories.ScheduledPositivity | |
| namespace OAI | |
| namespace MatrixAllFields | |
| open scoped BigOperators Topology Polynomial | |
| noncomputable section | |
| namespace MatrixMultiplication.AllFieldActiveCapacity | |
| open MatrixMultiplication.Foundation AllFieldParameters AllFieldHistory | |
| open AllFieldNativeCapacity AllFieldActiveLaws AllFieldScheduledYield | |
| open scoped BigOperators | |
| attribute [local instance] Classical.propDecidable Classical.decEq | |
| def canonicalSideMass {K : β} (w : Work K) (s : Fin 3) (k : Fin 17) : β := | |
| β b : w.Branch, if w.splitShape b s = k.val then (branchLaw w).mass b else 0 | |
| theorem placedLaw_priority_sideMass {K : β} (w : PlacedWork K) | |
| (i : Fin 3) : | |
| JointPopulationRates.sideMass (placedLaw w).mass (w.physicalOrder i) = | |
| canonicalSideMass w.1 (w.1.priority i) := by | |
| funext k | |
| rw [placedLaw_sideMass] | |
| simp only [Fin.ext_iff, branchShape, encodePhysicalShape_side, | |
| PlacedWork.physicalOrder, Equiv.trans_apply, Equiv.symm_apply_apply, | |
| canonicalSideMass, branchLaw_mass] | |
| theorem canonicalSideMass_stageA {K : β} (h : InitialPositive K) (s : Fin 3) : | |
| canonicalSideMass (.stageA h) s = | |
| (stageAMarginalLaw (initialShape h.val) h.property s).mass := by | |
| funext k | |
| rw [show (stageAMarginalLaw (initialShape h.val) h.property s).mass k = | |
| marginal (below (initialShape h.val)) | |
| (fun u => (stageALaw (initialShape h.val) u : β)) s k from | |
| indexedMarginalLaw_mass _ _ _ _ _ _ k] | |
| change (β b : ASplit h, if (below (initialShape h.val))[b.val] s = k.val | |
| then (stageALaw (initialShape h.val) (below (initialShape h.val))[b.val] : β) | |
| else 0) = _ | |
| exact Fin.sum_univ_fun_getElem _ | |
| (fun u : Shape => if u s = k.val then (stageALaw (initialShape h.val) u : β) else 0) | |
| theorem canonicalSideMass_stageB {K : β} (h : APositive K) (s : Fin 3) : | |
| canonicalSideMass (.stageB h) s = | |
| (stageBMarginalLaw (aShape h.val) h.property s).mass := by | |
| funext k | |
| rw [show (stageBMarginalLaw (aShape h.val) h.property s).mass k = | |
| marginal (below (aShape h.val)) | |
| (fun u => (stageBLaw (aShape h.val) u : β)) s k from | |
| indexedMarginalLaw_mass _ _ _ _ _ _ k] | |
| change (β b : BSplit h, if (below (aShape h.val))[b.val] s = k.val | |
| then (stageBLaw (aShape h.val) (below (aShape h.val))[b.val] : β) | |
| else 0) = _ | |
| exact Fin.sum_univ_fun_getElem _ | |
| (fun u : Shape => if u s = k.val then (stageBLaw (aShape h.val) u : β) else 0) | |
| theorem canonicalSideMass_stageC {K : β} (h : PartC K) (s : Fin 3) : | |
| canonicalSideMass (.stageC h) s = | |
| AllFieldStageCCapacity.stageCMarginal (cParameterParent h) (cShapeParent h) s := rfl | |
| theorem workCapacity_first {K : β} (w : PlacedWork K) : | |
| workCapacity w.1 0 = finiteEntropy | |
| (JointPopulationRates.sideMass (placedLaw w).mass (w.physicalOrder 0)) := by | |
| rw [placedLaw_priority_sideMass] | |
| rcases w with β¨w, phiβ© | |
| cases w with | |
| | stageA h => | |
| rw [canonicalSideMass_stageA] | |
| exact stageACapacity_first_entropy _ h.property | |
| | stageB h => | |
| rw [canonicalSideMass_stageB] | |
| exact stageBCapacity_first_entropy _ h.property | |
| | stageC h => | |
| rw [canonicalSideMass_stageC] | |
| exact workCapacity_stageC h 0 | |
| theorem workCapacity_stageC_physical {K : β} (h : PartC K) | |
| (phi : Placement) (i : Fin 3) : | |
| workCapacity (.stageC h) i = finiteEntropy | |
| (JointPopulationRates.sideMass (placedLaw (.stageC h, phi)).mass | |
| ((PlacedWork.physicalOrder (.stageC h, phi)) i)) := by | |
| rw [placedLaw_priority_sideMass, canonicalSideMass_stageC] | |
| exact workCapacity_stageC h i | |
| theorem order_first_capacity {K tick : β} {sigma : Placement} | |
| (h : ActiveOrder K tick sigma) : | |
| workCapacity h.val.val.1 0 = finiteEntropy | |
| (JointPopulationRates.sideMass (orderLaw h).mass (sigma 0)) := by | |
| have hh := workCapacity_first h.val.val | |
| rw [h.property] at hh | |
| exact hh | |
| def orderEntropyRate {K tick : β} (allocation : Allocation) (sigma : Placement) : β := | |
| β h : ActiveOrder K tick sigma, | |
| ((populationLength (K := K) allocation 1 : β) * orderMass allocation h) * | |
| finiteEntropy (orderLaw h).mass | |
| def orderNativeDegree {K tick : β} (allocation : Allocation) (sigma : Placement) | |
| (i : Fin 3) : β := | |
| β h : ActiveOrder K tick sigma, | |
| ((populationLength (K := K) allocation 1 : β) * orderMass allocation h) * | |
| (finiteEntropy (orderLaw h).mass - workCapacity h.val.val.1 i) | |
| theorem order_entropy_sub_native_degree (K tick : β) (allocation : Allocation) | |
| (sigma : Placement) : | |
| orderEntropyRate (K := K) (tick := tick) allocation sigma - | |
| max (orderNativeDegree (K := K) (tick := tick) allocation sigma 0) | |
| (max (orderNativeDegree (K := K) (tick := tick) allocation sigma 1) | |
| (orderNativeDegree (K := K) (tick := tick) allocation sigma 2)) = | |
| (populationLength (K := K) allocation 1 : β) * | |
| ((1 / 6 : β) * Staggering.minCapacity | |
| (FiniteSchedule.tickCapacity K nativeLA nativeLB | |
| (nativeLC (fun i => (allocation.mass i : β))) tick)) := by | |
| unfold orderEntropyRate orderNativeDegree | |
| rw [JointCapacityAlgebra.weighted_joint_capacity] | |
| simp_rw [order_dilation_capacity, β mul_assoc] | |
| exact PhysicalOrders.minCapacity_mul _ _ (by positivity) | |
| end MatrixMultiplication.AllFieldActiveCapacity | |
| namespace MatrixMultiplication.AllFieldGroupSelection | |
| open MatrixMultiplication.Foundation AllFieldHistory AllFieldActiveLaws | |
| open AllFieldActiveCapacity AllFieldScheduledYield AllFieldNativeCapacity | |
| open scoped BigOperators | |
| attribute [local instance] Classical.propDecidable Classical.decEq | |
| variable {K tick : β} | |
| def nativeDegree (allocation : Allocation) (sigma : Placement) : β := | |
| max (orderNativeDegree (K := K) (tick := tick) allocation sigma 0) | |
| (max (orderNativeDegree (K := K) (tick := tick) allocation sigma 1) | |
| (orderNativeDegree (K := K) (tick := tick) allocation sigma 2)) | |
| theorem targetEntropy_eq (allocation : Allocation) (sigma : Placement) : | |
| AllFieldGroupTargetRate.groupEntropyRate (K := K) (tick := tick) | |
| (sigma := sigma) allocation = | |
| orderEntropyRate (K := K) (tick := tick) allocation sigma := rfl | |
| theorem firstDegree_nonneg (allocation : Allocation) (sigma : Placement) : | |
| 0 β€ orderNativeDegree (K := K) (tick := tick) allocation sigma 0 := by | |
| apply Finset.sum_nonneg | |
| intro h _ | |
| apply mul_nonneg | |
| Β· exact mul_nonneg (Nat.cast_nonneg _) (orderMass_nonneg allocation h) | |
| Β· rw [order_first_capacity h] | |
| exact sub_nonneg.mpr | |
| (JointOrdinaryPopulationSelection.sideMass_entropy_le (orderLaw h) (sigma 0)) | |
| theorem nativeDegree_nonneg (allocation : Allocation) (sigma : Placement) : | |
| 0 β€ nativeDegree (K := K) (tick := tick) allocation sigma := | |
| (firstDegree_nonneg allocation sigma).trans (le_max_left _ _) | |
| def nativeCapacity (allocation : Allocation) : β := | |
| (populationLength (K := K) allocation 1 : β) * | |
| ((1 / 6 : β) * Staggering.minCapacity | |
| (FiniteSchedule.tickCapacity K nativeLA nativeLB | |
| (nativeLC (fun i => (allocation.mass i : β))) tick)) | |
| theorem targetEntropy_sub_degree (allocation : Allocation) (sigma : Placement) : | |
| AllFieldGroupTargetRate.groupEntropyRate (K := K) (tick := tick) | |
| (sigma := sigma) allocation - nativeDegree (K := K) (tick := tick) allocation sigma = | |
| nativeCapacity (K := K) (tick := tick) allocation := | |
| order_entropy_sub_native_degree K tick allocation sigma | |
| def selectionHashRate (allocation : Allocation) (sigma : Placement) (slack : β) : β := | |
| nativeDegree (K := K) (tick := tick) allocation sigma + slack / 2 | |
| theorem selectionHashRate_nonneg (allocation : Allocation) (sigma : Placement) | |
| {slack : β} (hslack : 0 < slack) : | |
| 0 β€ selectionHashRate (K := K) (tick := tick) allocation sigma slack := by | |
| unfold selectionHashRate | |
| linarith [nativeDegree_nonneg (K := K) (tick := tick) allocation sigma] | |
| theorem selectionHashRate_gap (allocation : Allocation) (sigma : Placement) | |
| {slack : β} (hslack : 0 < slack) : | |
| nativeDegree (K := K) (tick := tick) allocation sigma < | |
| selectionHashRate (K := K) (tick := tick) allocation sigma slack := by | |
| unfold selectionHashRate | |
| linarith | |
| theorem selectionHashRate_window_gap (allocation : Allocation) (sigma : Placement) | |
| {slack : β} (hslack : 0 < slack) : | |
| nativeDegree (K := K) (tick := tick) allocation sigma + slack / 4 < | |
| selectionHashRate (K := K) (tick := tick) allocation sigma slack := by | |
| unfold selectionHashRate | |
| linarith | |
| theorem selection_exponent (allocation : Allocation) (sigma : Placement) (slack : β) : | |
| AllFieldGroupTargetRate.groupEntropyRate (K := K) (tick := tick) | |
| (sigma := sigma) allocation - | |
| selectionHashRate (K := K) (tick := tick) allocation sigma slack - slack / 2 = | |
| nativeCapacity (K := K) (tick := tick) allocation - slack := by | |
| rw [selectionHashRate] | |
| linarith [targetEntropy_sub_degree (K := K) (tick := tick) allocation sigma] | |
| end MatrixMultiplication.AllFieldGroupSelection | |
| end | |
| end MatrixAllFields | |
| end OAI | |