Download data/lean/OAI/LinearAlgebra/MatrixFields/Extraction/InitialHash.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 6.6 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/LinearAlgebra/MatrixFields/Extraction/InitialHash.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/LinearAlgebra/MatrixFields/Extraction/InitialHash.lean
-
curl -L -o InitialHash.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/LinearAlgebra/MatrixFields/Extraction/InitialHash.lean
6.6 kB
| import Mathlib | |
| import OAI.LinearAlgebra.MatrixFields.Construction.InitialState | |
| namespace OAI | |
| namespace MatrixAllFields | |
| open scoped BigOperators Topology Polynomial | |
| noncomputable section | |
| namespace MatrixMultiplication.AllFieldInitialHash | |
| open MatrixMultiplication.Foundation AllFieldFiniteFamily AllFieldInitialStep | |
| open JointPopulation JointCoarseHashing | |
| open scoped BigOperators Classical | |
| variable {K : β} (counts : Fin K β Shape β β) | |
| def xKeep (k : β) (U : Finset (ZMod (37 ^ k))) | |
| (s : Sample (Position counts) k) (w : CoarseWord counts) : Prop := | |
| JointHashing.xHash s (castWord k w) β U | |
| def yKeep (k : β) (U : Finset (ZMod (37 ^ k))) | |
| (s : Sample (Position counts) k) (w : CoarseWord counts) : Prop := | |
| JointHashing.yHash s (castWord k w) β U | |
| def zKeep (k : β) (U : Finset (ZMod (37 ^ k))) | |
| (s : Sample (Position counts) k) (w : CoarseWord counts) : Prop := | |
| JointHashing.zHash (twoUnit k) s (fun _ => (16 : ZMod (37 ^ k))) (castWord k w) β U | |
| theorem ambient_support {H : Type*} [Fintype H] [DecidableEq H] | |
| (counts : H β Shape β β) (f : Triple (Position counts)) | |
| (hf : f β ambientSet counts (fun _ => 16)) : | |
| HasSupportSum (fun _ => 16) f := | |
| (Finset.mem_filter.mp hf).2.1 | |
| theorem target_mem_ambient | |
| (hsupport : β h u, 0 < counts h u β u.1.val + u.2.1.val + u.2.2.val = 16) | |
| (e : Target counts) : triple counts e β ambientSet counts (fun _ => 16) := | |
| targetSet_subset_ambient counts (fun _ => 16) hsupport | |
| (Finset.mem_image.mpr β¨e, Finset.mem_univ _, rflβ©) | |
| theorem side_survival_iff (k : β) (U : Finset (ZMod (37 ^ k))) | |
| (hAP : β x β U, β y β U, β z β U, x + y = 2 * z β x = z β§ y = z) | |
| (s : Sample (Position counts) k) (e : Triple (Position counts)) | |
| (he : HasSupportSum (fun _ => 16) e) : | |
| JointCoarseAssignment.survives (xKeep counts k U s) (yKeep counts k U s) | |
| (zKeep counts k U s) e β Survives k U e s := | |
| full_survival_iff k U hAP (fun _ => 16) e he s | |
| theorem isolated_of_good | |
| (hsupport : β h u, 0 < counts h u β u.1.val + u.2.1.val + u.2.2.val = 16) | |
| (k : β) (U : Finset (ZMod (37 ^ k))) | |
| (hAP : β x β U, β y β U, β z β U, x + y = 2 * z β x = z β§ y = z) | |
| (s : Sample (Position counts) k) (e : Target counts) | |
| (hgood : JointOrdinarySelection.Good k U (ambientSet counts (fun _ => 16)) | |
| (triple counts e) s) : | |
| AllFieldInitialExact.Isolated counts (xKeep counts k U s) (yKeep counts k U s) | |
| (zKeep counts k U s) e := by | |
| constructor | |
| Β· exact (side_survival_iff counts k U hAP s (triple counts e) | |
| (triple_support counts (fun _ => 16) hsupport e)).mpr hgood.1 | |
| Β· intro f hf hsurvives hshare | |
| by_contra hne | |
| have hs := (side_survival_iff counts k U hAP s f (ambient_support counts f hf)).mp | |
| hsurvives | |
| exact JointOrdinarySelection.good_excludes_neighbor k U | |
| (ambientSet counts (fun _ => 16)) (triple counts e) f s hgood hf hne hshare hs | |
| abbrev SelectedTargets (G : Finset (Target counts)) := {e : Target counts // e β G} | |
| def toTarget (G : Finset (Target counts)) : SelectedTargets counts G β Target counts := | |
| Subtype.val | |
| theorem toTarget_injective (G : Finset (Target counts)) : | |
| Function.Injective (toTarget counts G) := Subtype.val_injective | |
| @[simp] theorem selectedTargets_card (G : Finset (Target counts)) : | |
| Fintype.card (SelectedTargets counts G) = G.card := Fintype.card_coe G | |
| variable {F : Type*} [Field F] {N : β} | |
| def selectedExecution (total : β h, β u, counts h u = N) | |
| (hsupport : β h u, 0 < counts h u β u.1.val + u.2.1.val + u.2.2.val = 16) | |
| (k : β) (U : Finset (ZMod (37 ^ k))) | |
| (hAP : β x β U, β y β U, β z β U, x + y = 2 * z β x = z β§ y = z) | |
| (s : Sample (Position counts) k) (G : Finset (Target counts)) | |
| (hgood : β e β G, JointOrdinarySelection.Good k U | |
| (ambientSet counts (fun _ => 16)) (triple counts e) s) : | |
| Execution (cwSource F K N) | |
| (Tensor.directSum (fun _ : SelectedTargets counts G => JointCanonicalInitial.canonical counts)) := | |
| AllFieldInitialExact.selectedExecution counts | |
| (xKeep counts k U s) (yKeep counts k U s) (zKeep counts k U s) | |
| total (toTarget counts G) (toTarget_injective counts G) | |
| (fun e => target_mem_ambient counts hsupport e.val) | |
| (fun e => isolated_of_good counts hsupport k U hAP s e.val (hgood e.val e.property)) | |
| @[simp] theorem selectedExecution_copies (total : β h, β u, counts h u = N) | |
| (hsupport : β h u, 0 < counts h u β u.1.val + u.2.1.val + u.2.2.val = 16) | |
| (k : β) (U : Finset (ZMod (37 ^ k))) | |
| (hAP : β x β U, β y β U, β z β U, x + y = 2 * z β x = z β§ y = z) | |
| (s : Sample (Position counts) k) (G : Finset (Target counts)) | |
| (hgood : β e β G, JointOrdinarySelection.Good k U | |
| (ambientSet counts (fun _ => 16)) (triple counts e) s) : | |
| Fintype.card (selectedExecution (F := F) counts total hsupport k U hAP s G hgood).Copies = 1 := | |
| rfl | |
| theorem exists_selectedExecution (total : β h, β u, counts h u = N) | |
| (hsupport : β h u, 0 < counts h u β u.1.val + u.2.1.val + u.2.2.val = 16) | |
| (k : β) (U : Finset (ZMod (37 ^ k))) | |
| (hAP : β x β U, β y β U, β z β U, x + y = 2 * z β x = z β§ y = z) | |
| (D : β) | |
| (hdegree : β e : Target counts, | |
| (JointOrdinarySelection.neighbors (ambientSet counts (fun _ => 16)) | |
| (triple counts e)).card β€ D) | |
| (hsmall : (D : β) / ((37 ^ k : β) : β) β€ 1 / 2) | |
| (n : β) (hn : (n : β) β€ (Fintype.card (Target counts) : β) * | |
| ((U.card : β) / ((37 ^ k : β) : β) ^ 2 / 2)) : | |
| β (s : Sample (Position counts) k) (G : Finset (Target counts)), | |
| G.card = n β§ | |
| (β e β G, JointOrdinarySelection.Good k U | |
| (ambientSet counts (fun _ => 16)) (triple counts e) s) β§ | |
| β E : Execution (cwSource F K N) | |
| (Tensor.directSum (fun _ : SelectedTargets counts G => | |
| JointCanonicalInitial.canonical counts)), | |
| Fintype.card E.Copies = 1 := by | |
| obtain β¨s, G, hcard, hgood, _hpairwiseβ© := | |
| JointOrdinarySelection.exists_selection_of_degree_bound k U | |
| (ambientSet counts (fun _ => 16)) (fun _ => 16) (triple counts) | |
| (triple_injective counts) (fun f hf => ambient_support counts f hf) | |
| (target_mem_ambient counts hsupport) D hdegree hsmall n hn | |
| exact β¨s, G, hcard, hgood, | |
| selectedExecution (F := F) counts total hsupport k U hAP s G hgood, | |
| selectedExecution_copies (F := F) counts total hsupport k U hAP s G hgoodβ© | |
| end MatrixMultiplication.AllFieldInitialHash | |
| end | |
| end MatrixAllFields | |
| end OAI | |