import OAI.Probability.ClassicalON.DyadicSine namespace OAI noncomputable section open scoped BigOperators ComplexConjugate namespace ClassicalON variable {k : ℕ} def groupedPoint (m s : Bool) (p : DyadicFreq k) : ℤ × ℤ := let q := if m then (dyadicPoint p).swap else dyadicPoint p if s then -q else q def groupedTorusPoint (m s : Bool) (p : DyadicFreq k) : DiscreteTorus (16*2^k) := (((groupedPoint m s p).1:ZMod (16*2^k)), ((groupedPoint m s p).2:ZMod (16*2^k))) instance dyadicModulus_neZero (k : ℕ) : NeZero (16*2^k) := ⟨by positivity⟩ theorem groupedTorusPoint_injective (m s : Bool) : Function.Injective (groupedTorusPoint (k := k) m s) := by have hs := dyadicTorusPoint_injective (k := k) cases m <;> cases s <;> intro p q h <;> apply hs · exact h · simpa [groupedTorusPoint, groupedPoint, dyadicTorusPoint, Prod.ext_iff] using h · exact Prod.ext (congrArg Prod.snd h) (congrArg Prod.fst h) · have h' : (dyadicTorusPoint p).swap = (dyadicTorusPoint q).swap := by simpa [groupedTorusPoint, groupedPoint, dyadicTorusPoint, Prod.ext_iff] using h exact Prod.swap_injective h' def dyadicWeight (p : DyadicFreq k) : ℝ := 1/((dyadicRadius p:ℝ)*Real.sqrt (dyadicRadius p:ℝ)) theorem dyadicWeight_pos (p : DyadicFreq k) : 0 < dyadicWeight p := by have h : (0:ℝ)