File size: 6,023 Bytes
4a56cd6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
import Mathlib

namespace OAI

/-! Finite Fourier orthogonality and row-column operator duality. -/

noncomputable section
open scoped BigOperators
open Module Complex UniqueFactorizationMonoid
attribute [local instance] Classical.propDecidable

namespace CubicFirstMoment.SieveFourier
variable {R : Type*} [CommRing R] [Fintype R]

lemma finite_fourier_parseval (ψ : AddChar R β„‚) (hψ : ψ.IsPrimitive) (f : R β†’ β„‚) :
    (βˆ‘ a : R, β€–βˆ‘ x : R, f x * ψ (a*x)β€–^2) =
      (Fintype.card R : ℝ) * βˆ‘ x : R, β€–f xβ€–^2 := by
  classical
  have hcomplex :
      (βˆ‘ a : R, (βˆ‘ x : R, f x * ψ (a*x)) * star (βˆ‘ x : R, f x * ψ (a*x))) =
        (Fintype.card R : β„‚) * βˆ‘ x : R, f x * star (f x) := by
    simp_rw [star_sum, Finset.sum_mul_sum]
    rw [Finset.sum_comm]
    apply Eq.trans (Finset.sum_congr rfl fun x _ => Finset.sum_comm)
    have he (x y a : R) :
        f x * ψ (a*x) * star (f y * ψ (a*y)) =
          (f x * star (f y)) * ψ (a*(x-y)) := by
      rw [star_mul]
      have hc : star (ψ (a*y)) = ψ (-(a*y)) := by
        exact (ψ.map_neg_eq_conj (a*y)).symm
      rw [hc]
      rw [show f x * ψ (a*x) * (ψ (-(a*y)) * star (f y)) =
        (f x * star (f y)) * (ψ (a*x) * ψ (-(a*y))) by ring]
      rw [← ψ.map_add_eq_mul]
      congr 2
      ring
    simp_rw [he, ← Finset.mul_sum, AddChar.sum_mulShift _ hψ]
    simp only [sub_eq_zero, Nat.cast_ite, Nat.cast_zero, mul_ite, mul_zero]
    simp [Finset.mul_sum, mul_comm]
  simp only [Complex.star_def, Complex.mul_conj, ← Complex.ofReal_sum,
    ← Complex.ofReal_natCast, ← Complex.ofReal_mul] at hcomplex
  have hre := congrArg Complex.re hcomplex
  simpa only [map_sum, Complex.mul_conj, Complex.ofReal_re, Complex.re_sum,
    Complex.mul_re, Complex.natCast_re, Complex.natCast_im, zero_mul, sub_zero,
    Complex.normSq_eq_norm_sq] using hre

lemma saturated_gauss_nonunit (Ο‡ : MulChar R β„‚) (ψ : AddChar R β„‚)
    (hψ : ψ.IsPrimitive) (hG : β€–gaussSum Ο‡ Οˆβ€–^2 = (Fintype.card R : ℝ))
    {a : R} (ha : Β¬IsUnit a) : gaussSum Ο‡ (ψ.mulShift a) = 0 := by
  classical
  let d : R β†’ ℝ := fun b => β€–gaussSum Ο‡ (ψ.mulShift b)β€–^2 -
    (Fintype.card R : ℝ) * β€–Ο‡ bβ€–^2
  have hd (b : R) : 0 ≀ d b := by
    by_cases hb : IsUnit b
    Β· have he := gaussSum_mulShift_eq Ο‡ ψ hb.unit
      rw [hb.unit_spec] at he
      have hn : ‖χ⁻¹ bβ€– = 1 := by
        simpa only [MulChar.coe_equivToUnitHom, hb.unit_spec] using Complex.norm_eq_one_of_mem_rootsOfUnity
          (MulChar.apply_mem_rootsOfUnity (Ο‡ := χ⁻¹) hb.unit)
      have hn' : β€–Ο‡ bβ€– = 1 := by
        simpa only [MulChar.coe_equivToUnitHom, hb.unit_spec] using Complex.norm_eq_one_of_mem_rootsOfUnity
          (MulChar.apply_mem_rootsOfUnity (Ο‡ := Ο‡) hb.unit)
      simp [d, he, hn, hn', hG]
    Β· simp [d, MulChar.map_nonunit _ hb]
  have hs : βˆ‘ b : R, d b = 0 := by
    simp only [d, Finset.sum_sub_distrib, ← Finset.mul_sum]
    have hp := finite_fourier_parseval ψ hψ Ο‡
    simpa only [gaussSum, AddChar.mulShift_apply, sub_eq_zero] using hp
  have hz : d a = 0 := (Finset.sum_eq_zero_iff_of_nonneg (fun b _ => hd b)).mp hs a
    (Finset.mem_univ a)
  simpa [d, MulChar.map_nonunit _ ha] using hz

lemma saturated_gauss_mulShift (Ο‡ : MulChar R β„‚) (ψ : AddChar R β„‚)
    (hψ : ψ.IsPrimitive) (hG : β€–gaussSum Ο‡ Οˆβ€–^2 = (Fintype.card R : ℝ)) (a : R) :
    gaussSum Ο‡ (ψ.mulShift a) = χ⁻¹ a * gaussSum Ο‡ ψ := by
  by_cases ha : IsUnit a
  Β· simpa [ha.unit_spec] using gaussSum_mulShift_eq Ο‡ ψ ha.unit
  Β· rw [saturated_gauss_nonunit Ο‡ ψ hψ hG ha, MulChar.map_nonunit _ ha, zero_mul]

end CubicFirstMoment.SieveFourier

namespace CubicFirstMoment
namespace SieveOperator

def Bound {ΞΉ ΞΈ : Type*} (H : Finset ΞΉ) (S : Finset ΞΈ) (Ο‡ : ΞΉ β†’ ΞΈ β†’ β„‚) (K : ℝ) : Prop :=
  βˆ€ u : ΞΈ β†’ β„‚, βˆ‘ h ∈ H, β€–βˆ‘ a ∈ S, u a * Ο‡ h aβ€–^2 ≀ K * βˆ‘ a ∈ S, β€–u aβ€–^2

lemma sum_mul_norm_sq {ΞΉ : Type*} (s : Finset ΞΉ) (f g : ΞΉ β†’ β„‚) :
    β€–βˆ‘ i ∈ s, f i * g iβ€–^2 ≀ (βˆ‘ i ∈ s, β€–f iβ€–^2) * βˆ‘ i ∈ s, β€–g iβ€–^2 := by
  calc
    _ ≀ (βˆ‘ i ∈ s, β€–f iβ€–*β€–g iβ€–)^2 := by
      apply pow_le_pow_leftβ‚€ (_root_.norm_nonneg _)
      simpa only [norm_mul] using norm_sum_le s (fun i => f i*g i)
    _ ≀ _ := Finset.sum_mul_sq_le_sq_mul_sq s _ _

 
lemma Bound.transpose {ΞΉ ΞΈ : Type*} {H : Finset ΞΉ} {S : Finset ΞΈ}
    {Ο‡ : ΞΉ β†’ ΞΈ β†’ β„‚} {K : ℝ} (hK : 0 ≀ K) (h : Bound H S Ο‡ K) :
    Bound S H (fun a b => Ο‡ b a) K := by
  intro u
  let v : ΞΈ β†’ β„‚ := fun a => βˆ‘ b ∈ H, u b * Ο‡ b a
  let E : ℝ := βˆ‘ a ∈ S, β€–v aβ€–^2
  have hE : 0 ≀ E := Finset.sum_nonneg fun _ _ => sq_nonneg _
  have he : (E : β„‚) = βˆ‘ b ∈ H, u b * βˆ‘ a ∈ S, star (v a) * Ο‡ b a := by
    change ((βˆ‘ a ∈ S, β€–v aβ€–^2 : ℝ) : β„‚) = _
    push_cast
    have hn (a : ΞΈ) : (β€–v aβ€– : β„‚)^2 = v a * star (v a) := by
      rw [Complex.star_def, Complex.mul_conj, Complex.normSq_eq_norm_sq, Complex.ofReal_pow]
    simp_rw [hn]
    dsimp only [v] at *
    simp only [Finset.mul_sum, Finset.sum_mul]
    rw [Finset.sum_comm]
    apply Finset.sum_congr rfl
    intro b hb
    apply Finset.sum_congr rfl
    intro a ha
    ring
  have hc := sum_mul_norm_sq H u (fun b => βˆ‘ a ∈ S, star (v a) * Ο‡ b a)
  have hop := h (fun a => star (v a))
  simp only [norm_star] at hop
  have hc' : E^2 ≀ (βˆ‘ b ∈ H, β€–u bβ€–^2) * (K * E) := by
    rw [← he, Complex.norm_real, Real.norm_eq_abs, abs_of_nonneg hE] at hc
    exact hc.trans (mul_le_mul_of_nonneg_left hop (Finset.sum_nonneg fun _ _ => sq_nonneg _))
  change E ≀ K * βˆ‘ b ∈ H, β€–u bβ€–^2
  by_cases hE0 : E = 0
  Β· rw [hE0]
    exact mul_nonneg hK (Finset.sum_nonneg fun _ _ => sq_nonneg _)
  Β· apply (mul_le_mul_iff_rightβ‚€ (lt_of_le_of_ne hE (Ne.symm hE0))).mp
    calc
      E*E = E^2 := by ring
      _ ≀ (βˆ‘ b ∈ H, β€–u bβ€–^2) * (K*E) := hc'
      _ = E*(K*βˆ‘ b ∈ H, β€–u bβ€–^2) := by ring

end SieveOperator
end CubicFirstMoment
end

end OAI