Buckets:
| import OAI.Analysis.MutuallyUnbiased.Cubic.CubicRoots | |
| import OAI.Analysis.MutuallyUnbiased.Certificate.IntegerMerge | |
| namespace OAI | |
| /-! Exact arithmetic in `ℤ[ω]`, interpreted in the same complex root as Tao's | |
| matrix. These definitions are for certificate checking, not assumptions. -/ | |
| noncomputable section | |
| open scoped BigOperators ComplexConjugate | |
| namespace MUB6.TaoArithmetic | |
| abbrev Coeff := ℤ × ℤ | |
| def value (z : Coeff) : ℂ := (z.1 : ℂ) + (z.2 : ℂ) * omega | |
| def mul (z w : Coeff) : Coeff := | |
| (z.1 * w.1 - z.2 * w.2, z.1 * w.2 + z.2 * w.1 - z.2 * w.2) | |
| def conjugate (z : Coeff) : Coeff := (z.1 - z.2, -z.2) | |
| def root (n : ℤ) : Coeff := | |
| if n % 3 = 0 then (1, 0) else if n % 3 = 1 then (0, 1) else (-1, -1) | |
| @[simp] theorem value_zero : value 0 = 0 := by simp [value] | |
| @[simp] theorem value_add (z w : Coeff) : value (z + w) = value z + value w := by | |
| simp [value] | |
| ring | |
| theorem value_mul (z w : Coeff) : value (mul z w) = value z * value w := by | |
| simp only [value, mul, Int.cast_add, Int.cast_sub, Int.cast_mul] | |
| linear_combination -(z.2 : ℂ) * (w.2 : ℂ) * omega_sum | |
| theorem value_conjugate (z : Coeff) : value (conjugate z) = conj (value z) := by | |
| simp only [value, conjugate, Int.cast_sub, Int.cast_neg, map_add, map_mul, | |
| map_intCast, omega_conj] | |
| linear_combination -(z.2 : ℂ) * omega_sum | |
| theorem value_sum {ι : Type*} (s : Finset ι) (f : ι → Coeff) : | |
| value (∑ i ∈ s, f i) = ∑ i ∈ s, value (f i) := by | |
| classical | |
| induction s using Finset.induction_on with | |
| | empty => simp | |
| | @insert i s hi ih => simp [hi, ih] | |
| theorem omega_zpow_mod (n : ℤ) : omega ^ n = omega ^ (n % 3) := by | |
| have hn : n = n % 3 + 3 * (n / 3) := (Int.emod_add_mul_ediv n 3).symm | |
| have h3 : omega ^ (3 : ℤ) = 1 := by simpa only [zpow_ofNat] using omega_cube | |
| calc | |
| omega ^ n = omega ^ (n % 3 + 3 * (n / 3)) := by rw [← hn] | |
| _ = omega ^ (n % 3) := by | |
| rw [zpow_add₀ (omega_isPrimitiveRoot.ne_zero (by decide)), zpow_mul, h3, | |
| one_zpow, mul_one] | |
| theorem value_root (n : ℤ) : value (root n) = omega ^ n := by | |
| rw [omega_zpow_mod] | |
| have h0 := Int.emod_nonneg n (by decide : (3 : ℤ) ≠ 0) | |
| have h3 := Int.emod_lt_of_pos n (by decide : (0 : ℤ) < 3) | |
| have hcases : n % 3 = 0 ∨ n % 3 = 1 ∨ n % 3 = 2 := by omega | |
| rcases hcases with h | h | h | |
| · simp [root, h, value] | |
| · simp [root, h, value] | |
| · simp only [root, h] | |
| norm_num [value] | |
| linear_combination -omega_sum | |
| def counts (a : Charge) : Coeff := | |
| ∑ k, root (∑ i, (taoExponent i k : ℤ) * a i) | |
| theorem omega_zpow_sum (a : Charge) : (∏ i, omega ^ a i) = omega ^ (∑ i, a i) := by | |
| have h (s : Finset Coord) : (∏ i ∈ s, omega ^ a i) = omega ^ (∑ i ∈ s, a i) := by | |
| induction s using Finset.induction_on with | |
| | empty => simp | |
| | @insert i s hi ih => | |
| rw [Finset.prod_insert hi, Finset.sum_insert hi, ih, | |
| zpow_add₀ (omega_isPrimitiveRoot.ne_zero (by decide))] | |
| exact h Finset.univ | |
| theorem counts_interpretation (a : Charge) : value (counts a) = 6 * g tao a := by | |
| unfold counts | |
| rw [value_sum] | |
| have hc (k : Coord) : character (fun i => tao i k) a = | |
| omega ^ (∑ i, (taoExponent i k : ℤ) * a i) := by | |
| unfold character tao | |
| simp_rw [← zpow_natCast, ← zpow_mul] | |
| exact omega_zpow_sum _ | |
| simp_rw [value_root] | |
| simp only [g, hc] | |
| ring | |
| end MUB6.TaoArithmetic | |
| end | |
| end OAI | |
Xet Storage Details
- Size:
- 3.38 kB
- Xet hash:
- e43776b3235bed64bcf6091b00ba4dd495ddaec5cb25cee85b7aa01627b3acea
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.