Download data/lean/OAI/NumberTheory/Ostmann/Arithmetic/BulkCollisionSupport.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.96 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/Ostmann/Arithmetic/BulkCollisionSupport.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/NumberTheory/Ostmann/Arithmetic/BulkCollisionSupport.lean
-
curl -L -o BulkCollisionSupport.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/NumberTheory/Ostmann/Arithmetic/BulkCollisionSupport.lean
4.96 kB
| import OAI.NumberTheory.Ostmann.Arithmetic.BulkSlotNodup | |
| import OAI.NumberTheory.Ostmann.Arithmetic.FrozenFrequencyAverage | |
| namespace OAI | |
| /-! # The original arithmetic support forces distinct bulk primes -/ | |
| namespace Ostmann | |
| open scoped Classical BigOperators | |
| theorem prime_list_injective_of_pairwise {Ο : Type*} (value : Ο β β) | |
| (L : List Ο) (hprime : β i β L, (value i).Prime) | |
| (hp : (L.map value).Pairwise Nat.Coprime) : | |
| β i β L, β j β L, value i = value j β i = j := by | |
| have hn : (L.map value).Nodup := by | |
| apply hp.imp_of_mem | |
| intro a b ha hb hab | |
| obtain β¨i, hi, rflβ© := List.mem_map.mp ha | |
| obtain β¨j, hj, rflβ© := List.mem_map.mp hb | |
| exact (Nat.coprime_primes (hprime i hi) (hprime j hj)).mp hab | |
| exact fun i hi j hj hij => List.inj_on_of_nodup_map hn hi hj hij | |
| theorem buildMovingSlotData_injective_of_support {Ο : Type*} | |
| (value : Ο β β) (n m : β) (slot : (TreeLeafIndex n Γ Fin m) βͺ Ο) | |
| (t : FrequencyTree β€ n) (small : TreeLeafTuple (List Ο) n) | |
| (samples : MovingSampleSlots Ο n) (outside : List β) | |
| (hprime : β i, (value i).Prime) | |
| (hs : movingRegularOutsidePairwise value outside | |
| (buildMovingSlotData n t small (bulkSlotLeaves n m slot) samples)) : | |
| Function.Injective (value β slot) := by | |
| let T := buildMovingSlotData n t small (bulkSlotLeaves n m slot) samples | |
| have hp : (T.regularSlots.map value).Pairwise Nat.Coprime := by | |
| have hroot : (T.regularSlots.map value ++ outside).Pairwise Nat.Coprime := by | |
| cases hT : T with | |
| | leaf s L => simpa only [T, hT, movingRegularOutsidePairwise, | |
| MovingSlotData.regularSlots] using hs | |
| | node s CL CR u left right => | |
| have hs' := hs | |
| change movingRegularOutsidePairwise value outside T at hs' | |
| rw [hT] at hs' | |
| exact hs'.1 | |
| exact (List.pairwise_append.mp hroot).1 | |
| have hm (j) : slot j β T.regularSlots := by | |
| apply (buildMovingSlotData_regular_perm n t small (bulkSlotLeaves n m slot) samples).mem_iff.mpr | |
| exact List.mem_append_right _ ((mem_flatten_bulkSlotLeaves n m slot _).mpr β¨j, rflβ©) | |
| intro i j hij | |
| exact slot.injective (prime_list_injective_of_pairwise value T.regularSlots | |
| (fun i _ => hprime i) hp (slot i) (hm i) (slot j) (hm j) hij) | |
| /-- The frequency factor vanishes on collisions before any averaging or | |
| resampling is performed. -/ | |
| theorem movingFrequencyPageAverage_zero_of_bulk_collision {Ο : Type*} | |
| (value : Ο β β) (n m : β) (slot : (TreeLeafIndex n Γ Fin m) βͺ Ο) | |
| (t : FrequencyTree β€ n) (small : TreeLeafTuple (List Ο) n) | |
| (samples : MovingSampleSlots Ο n) (outside : List β) | |
| (hprime : β i, (value i).Prime) (hbad : Β¬Function.Injective (value β slot)) | |
| (F : Bool β {k : β} β MovingSlotData Ο k β β€ β β) | |
| (E : Bool β {k : β} β MovingSlotData Ο k β β€ β β€ β β€ β β) | |
| (T : Bool β MovingSlotData Ο n) | |
| (hT : T false = buildMovingSlotData n t small (bulkSlotLeaves n m slot) samples) | |
| (nodes : Bool β List MovingFormulaNode) (R : β€) | |
| (r : β) [NeZero r] (input : PublishedProgressionInput) (Q : β) (y : β) : | |
| movingFrequencyPageAverage value outside F E T nodes R r input Q y = 0 := by | |
| have hsupport : Β¬(β b, movingRegularOutsidePairwise value outside (T b) β§ | |
| β f β nodes b, f.guard.frequencyBounds) := by | |
| intro hs | |
| apply hbad | |
| apply buildMovingSlotData_injective_of_support value n m slot t small samples outside hprime | |
| rw [β hT] | |
| exact (hs false).1 | |
| rw [movingFrequencyPageAverage_core] | |
| simp only [hsupport, ite_false, zero_mul] | |
| /-- Inserting the distinctness gate leaves the literal supported arithmetic | |
| coefficient unchanged. -/ | |
| theorem movingFrequencyPageAverage_collision_gate {Ο : Type*} | |
| (value : Ο β β) (n m : β) (slot : (TreeLeafIndex n Γ Fin m) βͺ Ο) | |
| (t : FrequencyTree β€ n) (small : TreeLeafTuple (List Ο) n) | |
| (samples : MovingSampleSlots Ο n) (outside : List β) | |
| (hprime : β i, (value i).Prime) | |
| (F : Bool β {k : β} β MovingSlotData Ο k β β€ β β) | |
| (E : Bool β {k : β} β MovingSlotData Ο k β β€ β β€ β β€ β β) | |
| (T : Bool β MovingSlotData Ο n) | |
| (hT : T false = buildMovingSlotData n t small (bulkSlotLeaves n m slot) samples) | |
| (nodes : Bool β List MovingFormulaNode) (R : β€) | |
| (r : β) [NeZero r] (input : PublishedProgressionInput) (Q : β) (y : β) (A : β) : | |
| movingFrequencyPageAverage value outside F E T nodes R r input Q y * A = | |
| if Function.Injective (value β slot) then | |
| movingFrequencyPageAverage value outside F E T nodes R r input Q y * A else 0 := by | |
| by_cases h : Function.Injective (value β slot) | |
| Β· simp only [h, ite_true] | |
| Β· rw [ite_eq_right h, movingFrequencyPageAverage_zero_of_bulk_collision value n m slot | |
| t small samples outside hprime h F E T hT nodes R r input Q y, zero_mul] | |
| end Ostmann | |
| end OAI | |