Download data/lean/OAI/LinearAlgebra/MatrixFields/Extraction/GroupSelection.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 8.01 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/LinearAlgebra/MatrixFields/Extraction/GroupSelection.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/LinearAlgebra/MatrixFields/Extraction/GroupSelection.lean
-
curl -L -o GroupSelection.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/LinearAlgebra/MatrixFields/Extraction/GroupSelection.lean
8.01 kB
| import Mathlib | |
| import OAI.LinearAlgebra.MatrixFields.Construction.GroupDegreeEnvelope | |
| import OAI.LinearAlgebra.MatrixFields.Construction.GroupNativeDegreeBound | |
| namespace OAI | |
| namespace MatrixAllFields | |
| open scoped BigOperators Topology Polynomial | |
| section | |
| noncomputable section | |
| namespace MatrixMultiplication.AllFieldGroupSelection | |
| open MatrixMultiplication.Foundation AllFieldHistory AllFieldActiveLaws | |
| open AllFieldActiveCapacity AllFieldScheduledYield AllFieldNativeCapacity | |
| open scoped BigOperators | |
| attribute [local instance] Classical.propDecidable | |
| variable {K tick : β} | |
| def orbitPrefactor (allocation : Allocation) (sigma : Placement) : β := | |
| 3 * (AllFieldHistoryOrbitCount.basePopulationBound (K := K) (tick := tick) | |
| allocation + 1) ^ AllFieldGroupOrbitCount.groupDegree K tick sigma | |
| theorem data_orbits_card_le (allocation : Allocation) (m : β) (Ξ΅ : β) | |
| (sigma : Placement) | |
| (e : AllFieldGroupOrbitData.Targets (K := K) (tick := tick) allocation m sigma) : | |
| ((AllFieldGroupOrbitData.data (K := K) (tick := tick) allocation m Ξ΅ sigma).orbits e).card β€ | |
| orbitPrefactor (K := K) (tick := tick) allocation sigma * | |
| (m + 1) ^ AllFieldGroupOrbitCount.groupDegree K tick sigma := by | |
| have hb := AllFieldGroupOrbitData.orbits_card_le allocation m Ξ΅ sigma e | |
| unfold orbitPrefactor AllFieldGroupOrbitCount.groupOrbitPrefactor at * | |
| exact_mod_cast hb | |
| theorem data_coarse_injective (allocation : Allocation) (m : β) (Ξ΅ : β) | |
| (sigma : Placement) : | |
| Function.Injective | |
| (AllFieldGroupOrbitData.data (K := K) (tick := tick) allocation m Ξ΅ sigma).coarse := | |
| AllFieldGroupOrbitData.coarse_injective allocation m sigma | |
| structure Selected (allocation : Allocation) (m : β) (width : β) | |
| (sigma : Placement) (slack : β) where | |
| sample : JointCoarseHashing.Sample | |
| (AllFieldGroupOrbitData.Pos (K := K) (tick := tick) allocation m sigma) | |
| (JointOrdinarySelection.hashLevel | |
| (selectionHashRate (K := K) (tick := tick) allocation sigma slack) m) | |
| targets : Finset (AllFieldGroupOrbitData.Targets | |
| (K := K) (tick := tick) allocation m sigma) | |
| card_targets : targets.card = | |
| βReal.exp ((m : β) * (nativeCapacity (K := K) (tick := tick) allocation - slack))ββ | |
| good : β e β targets, | |
| (AllFieldGroupOrbitData.data (K := K) (tick := tick) allocation m width sigma).Good | |
| (JointOrdinarySelection.hashLevel | |
| (selectionHashRate (K := K) (tick := tick) allocation sigma slack) m) | |
| (JointOrdinarySelection.hashSet | |
| (selectionHashRate (K := K) (tick := tick) allocation sigma slack) m) | |
| (m : β) e sample | |
| distinct_first : β e β targets, β f β targets, e β f β | |
| (AllFieldGroupOrbitData.coarse (K := K) (tick := tick) allocation m sigma e).1 β | |
| (AllFieldGroupOrbitData.coarse (K := K) (tick := tick) allocation m sigma f).1 | |
| end MatrixMultiplication.AllFieldGroupSelection | |
| end | |
| end | |
| end MatrixAllFields | |
| namespace MatrixAllFields | |
| open scoped BigOperators Topology Polynomial | |
| section | |
| noncomputable section | |
| namespace MatrixMultiplication.AllFieldGroupSelection | |
| open MatrixMultiplication.Foundation AllFieldHistory AllFieldActiveLaws | |
| open AllFieldActiveCapacity AllFieldScheduledYield AllFieldNativeCapacity | |
| open Filter | |
| open scoped BigOperators Topology | |
| attribute [local instance] Classical.propDecidable | |
| variable {K tick : β} | |
| private theorem selected_of_native_count_bound | |
| (allocation : Allocation) (sigma : Placement) (width : β) | |
| {slack : β} (hslack : 0 < slack) | |
| (hcounts : βαΆ m : β in atTop, | |
| (β e : AllFieldGroupOrbitData.Targets (K := K) (tick := tick) allocation m sigma, | |
| (((AllFieldGroupOrbitData.data (K := K) (tick := tick) allocation m width sigma).eligibilityCompetitors e).card : β) β€ | |
| Real.exp ((m : β) * | |
| (nativeDegree (K := K) (tick := tick) allocation sigma + slack / 4))) β§ | |
| (β e : AllFieldGroupOrbitData.Targets (K := K) (tick := tick) allocation m sigma, | |
| β o β (AllFieldGroupOrbitData.data (K := K) (tick := tick) allocation m width sigma).orbits e, | |
| β v β (AllFieldGroupOrbitData.data (K := K) (tick := tick) allocation m width sigma).passing e o, | |
| (((AllFieldGroupOrbitData.data (K := K) (tick := tick) allocation m width sigma).competitors e o v).card : β) β€ | |
| Real.exp ((m : β) * | |
| (nativeDegree (K := K) (tick := tick) allocation sigma + slack / 4)))) : | |
| βαΆ m : β in atTop, | |
| Nonempty (Selected (K := K) (tick := tick) allocation m width sigma slack) := by | |
| have hD : 0 β€ nativeDegree (K := K) (tick := tick) allocation sigma + slack / 4 := by | |
| linarith [nativeDegree_nonneg (K := K) (tick := tick) allocation sigma] | |
| have hdegree := AllFieldGroupDegreeEnvelope.eventually_log_uniformDegree_le | |
| allocation width sigma hD hcounts | |
| have hrate : β Ξ· : β, 0 < Ξ· β βαΆ m : β in atTop, | |
| Real.log (AllFieldGroupDegreeEnvelope.uniformDegree | |
| (K := K) (tick := tick) allocation m width sigma : β) / (m : β) β€ | |
| nativeDegree (K := K) (tick := tick) allocation sigma + slack / 4 + Ξ· := by | |
| intro Ξ· hΞ· | |
| filter_upwards [hdegree] with m hm | |
| linarith | |
| let : β m : β, Fintype (AllFieldGroupOrbitData.Pos | |
| (K := K) (tick := tick) allocation m sigma) := fun m => inferInstance | |
| let : β m : β, Fintype (AllFieldGroupOrbitData.Targets | |
| (K := K) (tick := tick) allocation m sigma) := fun m => inferInstance | |
| have hselected := JointMaskedGoodSelection.eventually_exists_good_selection | |
| (fun m => AllFieldGroupOrbitData.data (K := K) (tick := tick) allocation m width sigma) | |
| (fun m => data_coarse_injective (K := K) (tick := tick) allocation m width sigma) | |
| (fun m => AllFieldGroupDegreeEnvelope.uniformDegree (K := K) (tick := tick) allocation m width sigma) | |
| (orbitPrefactor (K := K) (tick := tick) allocation sigma) | |
| (AllFieldGroupOrbitCount.groupDegree K tick sigma) | |
| (fun m => AllFieldGroupDegreeEnvelope.eligibility_card_le (K := K) (tick := tick) allocation m width sigma) | |
| (fun m => AllFieldGroupDegreeEnvelope.competitors_card_le (K := K) (tick := tick) allocation m width sigma) | |
| (fun m => data_orbits_card_le (K := K) (tick := tick) allocation m width sigma) | |
| (selectionHashRate_nonneg (K := K) (tick := tick) allocation sigma hslack) | |
| (selectionHashRate_window_gap (K := K) (tick := tick) allocation sigma hslack) hrate | |
| (Eventually.of_forall (AllFieldGroupTargetRate.target_card_pos | |
| (K := K) (tick := tick) (sigma := sigma) allocation)) | |
| (AllFieldGroupTargetRate.tendsto_log_target_card_div | |
| (K := K) (tick := tick) (sigma := sigma) allocation) | |
| (half_pos hslack) | |
| filter_upwards [hselected] with m hm | |
| obtain β¨s, G, hcard, hgood, hdistinctβ© := hm | |
| refine β¨{ | |
| sample := s | |
| targets := G | |
| card_targets := ?_ | |
| good := hgood | |
| distinct_first := hdistinct }β© | |
| simpa only [selection_exponent] using hcard | |
| theorem exists_threshold_eventually_selected | |
| (allocation : Allocation) (sigma : Placement) | |
| {slack widthMax : β} (hslack : 0 < slack) (hwidthMax : 0 < widthMax) : | |
| β threshold : β, 0 < threshold β§ threshold β€ widthMax β§ | |
| β width : β, 0 < width β width β€ threshold β | |
| βαΆ m : β in atTop, | |
| Nonempty (Selected (K := K) (tick := tick) allocation m width sigma slack) := by | |
| obtain β¨threshold, hthreshold, hthresholdMax, hcountsβ© := | |
| AllFieldGroupNativeDegreeBound.exists_threshold_eventually_counts_le | |
| (K := K) (tick := tick) allocation sigma | |
| (show 0 < slack / 4 by linarith) hwidthMax | |
| refine β¨threshold, hthreshold, hthresholdMax, ?_β© | |
| intro width hwidth hsmall | |
| apply selected_of_native_count_bound (K := K) (tick := tick) allocation sigma width hslack | |
| simpa only [nativeDegree, AllFieldGroupNativeDegreeBound.maxNativeDegree] using | |
| hcounts width hwidth hsmall | |
| end MatrixMultiplication.AllFieldGroupSelection | |
| end | |
| end | |
| end MatrixAllFields | |
| end OAI | |