math / data /lean /OAI /LinearAlgebra /MatrixMultiplication /Separation /ComplexFiniteSeparation.lean
Download data/lean/OAI/LinearAlgebra/MatrixMultiplication/Separation/ComplexFiniteSeparation.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 7.38 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/LinearAlgebra/MatrixMultiplication/Separation/ComplexFiniteSeparation.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/LinearAlgebra/MatrixMultiplication/Separation/ComplexFiniteSeparation.lean
-
curl -L -o ComplexFiniteSeparation.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/LinearAlgebra/MatrixMultiplication/Separation/ComplexFiniteSeparation.lean
7.38 kB
| import OAI.LinearAlgebra.MatrixMultiplication.Tensor.ComplexGroupTensor | |
| import OAI.LinearAlgebra.MatrixMultiplication.Separation.ComplexModularSeparation | |
| namespace OAI | |
| /-! Finite type counts, hierarchy separation and tensor execution bounds. -/ | |
| namespace MatrixMultiplication.Foundation | |
| section Separation | |
| variable {X Y Z S U G : Type*} | |
| variable [AddCommGroup G] [Fintype G] [DecidableEq G] | |
| variable [DecidableEq S] [DecidableEq U] | |
| def separatedTensor (lx : X β S) (T : Tensor β X Y Z) : | |
| Tensor β (X Γ U) (Y Γ U) (Z Γ S) := | |
| fun x y z => if lx x.1 = z.2 β§ x.2 = y.2 then T x.1 y.1 z.1 else 0 | |
| omit [Fintype G] in | |
| theorem finite_separation_identity | |
| (T : Tensor β X Y Z) (lx : X β S) (ly : Y β S) | |
| (tag : S β G) (point : S β U β G) | |
| (hlabels : β x y z, T x y z β 0 β lx x = ly y) | |
| (hcollision : β s s' i j, | |
| point s i + (tag s - point s j) = tag s' β s = s' β§ i = j) : | |
| Tensor.pullback | |
| (fun x : X Γ U => (x.1, point (lx x.1) x.2)) | |
| (fun y : Y Γ U => (y.1, tag (ly y.1) - point (ly y.1) y.2)) | |
| (fun z : Z Γ S => (z.1, tag z.2)) | |
| (Tensor.product T (groupTensor G)) = separatedTensor lx T := by | |
| funext x y z | |
| by_cases hzero : T x.1 y.1 z.1 = 0 | |
| Β· simp [Tensor.pullback, Tensor.product, separatedTensor, hzero] | |
| Β· have hxy := hlabels x.1 y.1 z.1 hzero | |
| simp only [Tensor.pullback, Tensor.product, groupTensor, separatedTensor] | |
| simp only [β hxy, hcollision, mul_ite, mul_one, mul_zero] | |
| theorem finite_separation_mem_restrictionOrbit | |
| [Fintype X] [Fintype Y] [Fintype Z] | |
| (T : Tensor β X Y Z) (lx : X β S) (ly : Y β S) | |
| (tag : S β G) (point : S β U β G) | |
| (hlabels : β x y z, T x y z β 0 β lx x = ly y) | |
| (hcollision : β s s' i j, | |
| point s i + (tag s - point s j) = tag s' β s = s' β§ i = j) : | |
| separatedTensor (U := U) lx T β | |
| Tensor.restrictionOrbit (Tensor.product T (groupTensor G)) := by | |
| classical | |
| rw [β finite_separation_identity T lx ly tag point hlabels hcollision] | |
| refine β¨(fun (x : X Γ U) (original : X Γ G) => | |
| if original = (x.1, point (lx x.1) x.2) then 1 else 0), | |
| (fun (y : Y Γ U) (original : Y Γ G) => | |
| if original = (y.1, tag (ly y.1) - point (ly y.1) y.2) then 1 else 0), | |
| (fun (z : Z Γ S) (original : Z Γ G) => | |
| if original = (z.1, tag z.2) then 1 else 0), ?_β© | |
| exact Tensor.pullback_eq_restrict _ _ _ _ | |
| theorem finite_separation_degeneratesTo | |
| [Fintype X] [Fintype Y] [Fintype Z] [Fintype S] [Fintype U] | |
| (T : Tensor β X Y Z) (lx : X β S) (ly : Y β S) | |
| (tag : S β G) (point : S β U β G) | |
| (hlabels : β x y z, T x y z β 0 β lx x = ly y) | |
| (hcollision : β s s' i j, | |
| point s i + (tag s - point s j) = tag s' β s = s' β§ i = j) : | |
| Tensor.DegeneratesTo (Tensor.product T (groupTensor G)) | |
| (separatedTensor (U := U) lx T) := by | |
| exact subset_closure | |
| (finite_separation_mem_restrictionOrbit T lx ly tag point hlabels hcollision) | |
| theorem finite_separation_rankAtMost | |
| (T : Tensor β X Y Z) (lx : X β S) (ly : Y β S) | |
| (tag : S β G) (point : S β U β G) {r : β} | |
| (hT : Tensor.RankAtMost T r) | |
| (hlabels : β x y z, T x y z β 0 β lx x = ly y) | |
| (hcollision : β s s' i j, | |
| point s i + (tag s - point s j) = tag s' β s = s' β§ i = j) : | |
| Tensor.RankAtMost (separatedTensor (U := U) lx T) (r * Fintype.card G) := by | |
| rw [β finite_separation_identity T lx ly tag point hlabels hcollision] | |
| exact (hT.product (groupTensor_rankAtMost G)).pullback _ _ _ | |
| theorem finite_separation_borderRankAtMost | |
| [Fintype X] [Fintype Y] [Fintype Z] [Fintype S] [Fintype U] | |
| (T : Tensor β X Y Z) (lx : X β S) (ly : Y β S) | |
| (tag : S β G) (point : S β U β G) {r : β} | |
| (hT : Tensor.BorderRankAtMost T r) | |
| (hlabels : β x y z, T x y z β 0 β lx x = ly y) | |
| (hcollision : β s s' i j, | |
| point s i + (tag s - point s j) = tag s' β s = s' β§ i = j) : | |
| Tensor.BorderRankAtMost (separatedTensor (U := U) lx T) | |
| (r * Fintype.card G) := by | |
| classical | |
| rw [β finite_separation_identity T lx ly tag point hlabels hcollision] | |
| rw [Tensor.pullback_eq_restrict] | |
| exact (hT.product (groupTensor_rankAtMost G).borderRankAtMost).restrict _ _ _ | |
| end Separation | |
| section FiniteGrid | |
| variable {X Y Z S : Type*} [Fintype S] [DecidableEq S] | |
| theorem finite_grid_separation_mem_restrictionOrbit | |
| [Fintype X] [Fintype Y] [Fintype Z] | |
| (T : Tensor β X Y Z) (lx : X β S) (ly : Y β S) | |
| {d Q m : β} [NeZero (4 * Q)] | |
| (hK : (d * Q ^ 2 + 1) * Fintype.card S β€ Q ^ d) | |
| (hm : (d * Q ^ 2 + 1) * m β€ Q ^ d) | |
| (hlabels : β x y z, T x y z β 0 β lx x = ly y) : | |
| separatedTensor (U := Fin m) lx T β Tensor.restrictionOrbit | |
| (Tensor.product T (groupTensor (Separation.AuxiliaryGroup d Q))) := by | |
| classical | |
| obtain β¨tag, point, hcollisionβ© := Separation.exists_modular_separation hK hm | |
| let e : S β Fin (Fintype.card S) := Fintype.equivFin S | |
| have hc : β s s' i j, | |
| point (e s) i + (tag (e s) - point (e s) j) = tag (e s') β | |
| s = s' β§ i = j := by | |
| intro s s' i j | |
| rw [hcollision, e.injective.eq_iff] | |
| exact finite_separation_mem_restrictionOrbit T lx ly | |
| (fun s => tag (e s)) (fun s => point (e s)) hlabels hc | |
| theorem finite_grid_separation_rankAtMost | |
| (T : Tensor β X Y Z) (lx : X β S) (ly : Y β S) | |
| {d Q m r : β} (hQ : 0 < Q) | |
| (hK : (d * Q ^ 2 + 1) * Fintype.card S β€ Q ^ d) | |
| (hm : (d * Q ^ 2 + 1) * m β€ Q ^ d) | |
| (hT : Tensor.RankAtMost T r) | |
| (hlabels : β x y z, T x y z β 0 β lx x = ly y) : | |
| Tensor.RankAtMost (separatedTensor (U := Fin m) lx T) (r * (4 * Q) ^ d) := by | |
| classical | |
| let : NeZero (4 * Q) := β¨Nat.ne_of_gt (Nat.mul_pos (by decide) hQ)β© | |
| obtain β¨tag, point, hcollisionβ© := Separation.exists_modular_separation hK hm | |
| let e : S β Fin (Fintype.card S) := Fintype.equivFin S | |
| have hc : β s s' i j, | |
| point (e s) i + (tag (e s) - point (e s) j) = tag (e s') β | |
| s = s' β§ i = j := by | |
| intro s s' i j | |
| rw [hcollision, e.injective.eq_iff] | |
| have hr := finite_separation_rankAtMost T lx ly | |
| (fun s => tag (e s)) (fun s => point (e s)) hT hlabels hc | |
| simpa only [Separation.card_auxiliaryGroup] using hr | |
| theorem finite_grid_separation_borderRankAtMost | |
| [Fintype X] [Fintype Y] [Fintype Z] | |
| (T : Tensor β X Y Z) (lx : X β S) (ly : Y β S) | |
| {d Q m r : β} (hQ : 0 < Q) | |
| (hK : (d * Q ^ 2 + 1) * Fintype.card S β€ Q ^ d) | |
| (hm : (d * Q ^ 2 + 1) * m β€ Q ^ d) | |
| (hT : Tensor.BorderRankAtMost T r) | |
| (hlabels : β x y z, T x y z β 0 β lx x = ly y) : | |
| Tensor.BorderRankAtMost (separatedTensor (U := Fin m) lx T) | |
| (r * (4 * Q) ^ d) := by | |
| classical | |
| let : NeZero (4 * Q) := β¨Nat.ne_of_gt (Nat.mul_pos (by decide) hQ)β© | |
| obtain β¨tag, point, hcollisionβ© := Separation.exists_modular_separation hK hm | |
| let e : S β Fin (Fintype.card S) := Fintype.equivFin S | |
| have hc : β s s' i j, | |
| point (e s) i + (tag (e s) - point (e s) j) = tag (e s') β | |
| s = s' β§ i = j := by | |
| intro s s' i j | |
| rw [hcollision, e.injective.eq_iff] | |
| have hr := finite_separation_borderRankAtMost T lx ly | |
| (fun s => tag (e s)) (fun s => point (e s)) hT hlabels hc | |
| simpa only [Separation.card_auxiliaryGroup] using hr | |
| end FiniteGrid | |
| end MatrixMultiplication.Foundation | |
| end OAI | |