File size: 3,090 Bytes
cdec422
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import OAI.LinearAlgebra.MatrixMultiplication.CoppersmithWinograd.CWStrands

namespace OAI

/-! Coppersmith–Winograd tensors, tensor powers and local restrictions. -/

noncomputable section

namespace MatrixMultiplication.CWStrandCompatibility

open MatrixMultiplication.Foundation CWStrands CWCompatibilityTransfer InheritedMasks
open scoped BigOperators

variable {F : Type*} [CommRing F]

theorem shape_nonzero_power {n : ℕ} (g : Fin 3 → ℕ)
    (x y z : Fin n → Fin 7) (h : shapeTensor (F := F) (Fin n) g x y z ≠ 0) :
    Tensor.power (FieldCW.tensor F 5) n x y z ≠ 0 := by
  have hm := shapeTensor_support g x y z h
  simpa only [shapeTensor, ite_eq_left hm, strand, Tensor.power] using h

section Classes

variable {P A : Type*} [Fintype P] [DecidableEq P]
    [Fintype A] [DecidableEq A] {n : ℕ}
    (g : P → Fin 3 → ℕ) (x y z : P → (Fin n → Fin 7))
    (h : (∏ i, shapeTensor (F := F) (Fin n) (g i) (x i) (y i) (z i)) ≠ 0)
    (statistic : (Fin n → Fin 7) → A) (κ : A ≃ A)
    (hstatistic : ∀ w, statistic (wordComplement w) = κ (statistic w))
    (ν : A → ℝ) (η : ℝ)

include h

omit [DecidableEq P] in
theorem class_coefficient_nonzero (i : P) :
    shapeTensor (F := F) (Fin n) (g i) (x i) (y i) (z i) ≠ 0 := by
  intro hi
  exact h (Finset.prod_eq_zero (Finset.mem_univ i) hi)

include hstatistic

theorem zeroZ_transfer (hg : ∀ i, g i 2 = 0)
    (hx : typeWindow ν η (fun i => statistic (x i))) :
    typeWindow (ν ∘ κ.symm) η (fun i => statistic (y i)) := by
  apply transfer_window statistic κ hstatistic x y _ ν η hx
  intro i
  have hi := class_coefficient_nonzero g x y z h i
  have hm := shapeTensor_support (g i) (x i) (y i) (z i) hi
  have hz : wordWeight (z i) = 0 := by
    change weight (z i) = 0
    exact hm.2.2.trans (hg i)
  exact zeroZ_word_match (x i) (y i) (z i)
    (shape_nonzero_power (g i) (x i) (y i) (z i) hi) hz

theorem zeroY_transfer (hg : ∀ i, g i 1 = 0)
    (hx : typeWindow ν η (fun i => statistic (x i))) :
    typeWindow (ν ∘ κ.symm) η (fun i => statistic (z i)) := by
  apply transfer_window statistic κ hstatistic x z _ ν η hx
  intro i
  have hi := class_coefficient_nonzero g x y z h i
  have hm := shapeTensor_support (g i) (x i) (y i) (z i) hi
  have hy : wordWeight (y i) = 0 := by
    change weight (y i) = 0
    exact hm.2.1.trans (hg i)
  exact zeroY_word_match (x i) (y i) (z i)
    (shape_nonzero_power (g i) (x i) (y i) (z i) hi) hy

theorem zeroX_transfer (hg : ∀ i, g i 0 = 0)
    (hy : typeWindow ν η (fun i => statistic (y i))) :
    typeWindow (ν ∘ κ.symm) η (fun i => statistic (z i)) := by
  apply transfer_window statistic κ hstatistic y z _ ν η hy
  intro i
  have hi := class_coefficient_nonzero g x y z h i
  have hm := shapeTensor_support (g i) (x i) (y i) (z i) hi
  have hx : wordWeight (x i) = 0 := by
    change weight (x i) = 0
    exact hm.1.trans (hg i)
  exact zeroX_word_match (x i) (y i) (z i)
    (shape_nonzero_power (g i) (x i) (y i) (z i) hi) hx

end Classes

end MatrixMultiplication.CWStrandCompatibility

end

end OAI