CyclicSignals.lean
1module23public import SubentropyCertificates.BinarySignalColumns4public import Mathlib.Analysis.Fourier.ZMod56/-! Roots-of-unity phases, the signal states and the Fourier measurement of Appendix E. -/7@[expose] public section8noncomputable section9set_option autoImplicit false10set_option backward.isDefEq.respectTransparency false11open Matrix12open scoped BigOperators ComplexOrder13namespace SubentropyCertificates.Cyclic14open SubentropyCertificates.Discrimination SubentropyCertificates.PinchingEquality15open D5.S3.Quantum.Foundation.FiniteStateChannel1617abbrev Three := ZMod 31819/-- Coordinate j of the kth character uses the positive exponential exp(2πijk/3). -/20def phase (j k : Three) : ℂ := ZMod.stdAddChar (j*k)2122theorem phase_normalized (j k : Three) : ‖phase j k‖ = 1 := Circle.norm_coe _2324private theorem star_char (a : Three) : star (ZMod.stdAddChar a) = ZMod.stdAddChar (-a) := by25 simp only [ZMod.stdAddChar_apply, AddChar.map_neg_eq_inv, Complex.star_def]26 exact (Circle.coe_inv_eq_conj _).symm2728theorem phase_self (j k : Three) : phase j k * star (phase j k) = 1 := by29 rw [Complex.star_def, Complex.mul_conj, Complex.normSq_eq_norm_sq, phase_normalized]30 norm_num3132theorem phase_orthogonality (i j : Three) :33 ∑ k : Three, phase i k * star (phase j k) = if i=j then 3 else 0 := by34 simp only [phase, star_char, ← AddChar.map_add_eq_mul, ← sub_eq_add_neg, ← sub_mul]35 by_cases h : i=j36 · simp [h, ZMod.card]37 · simp only [h, ↓reduceIte]38 exact AddChar.sum_eq_zero_of_ne_one (ZMod.isPrimitive_stdAddChar 3 (sub_ne_zero.mpr h))3940private theorem real_star (r : ℝ) : star (r : ℂ) = (r : ℂ) := Complex.conj_ofReal r4142def wave (a : Three → ℝ) (k j : Three) : ℂ := (a j : ℂ) * phase j k4344theorem wave_normalization (a : Three → ℝ) (k : Three) :45 amplitude (wave a k) (wave a k) = ((∑ j, (a j)^2 : ℝ) : ℂ) := by46 simp only [amplitude, dotProduct, Pi.star_apply, wave, star_mul', real_star,47 Complex.ofReal_sum, Complex.ofReal_pow]48 apply Finset.sum_congr rfl49 intro j _50 linear_combination (a j : ℂ)^2 * phase_self j k5152theorem wave_projector_sum (a : Three → ℝ) :53 ∑ k, projector (wave a k) = diagonal (fun j ↦ 3 * (a j : ℂ)^2) := by54 ext i j55 simp only [Matrix.sum_apply, projector, vecMulVec_apply, Pi.star_apply, wave,56 star_mul', real_star]57 change (∑ k : Three, (a i : ℂ) * phase i k * ((a j : ℂ) * star (phase j k))) = _58 have eq (k : Three) : (a i : ℂ) * phase i k * ((a j : ℂ) * star (phase j k)) =59 ((a i : ℂ) * a j) * (phase i k * star (phase j k)) := by ring60 simp_rw [eq]61 rw [← Finset.mul_sum, phase_orthogonality]62 by_cases h : i=j63 · subst j64 simp65 ring66 · simp [h]6768def prior (_ : Three) : ℝ := 1/36970theorem prior_nonneg (k : Three) : 0 ≤ prior k := by norm_num [prior]7172theorem prior_sum : ∑ k, prior k = 1 := by norm_num [prior, ZMod.card]7374def signal (lam : Three → ℝ) (k : Three) := wave (fun j ↦ Real.sqrt (lam j)) k7576theorem signal_normalized (lam : Three → ℝ) (hp : ∀ j, 0 ≤ lam j) (hs : ∑ j, lam j = 1)77 (k : Three) : amplitude (signal lam k) (signal lam k) = 1 := by78 simp only [signal, wave_normalization, Real.sq_sqrt (hp _), hs, Complex.ofReal_one]7980def signalState (lam : Three → ℝ) (hp : ∀ j, 0 ≤ lam j) (hs : ∑ j, lam j = 1) (k : Three) :81 DensityState Three := pureSignal (signal lam k) (signal_normalized lam hp hs k)8283def fourierVector (k : Three) := wave (fun _ ↦ (Real.sqrt 3)⁻¹) k8485def fourierEffect (k : Three) : Matrix Three Three ℂ := projector (fourierVector k)8687theorem fourier_povm : (∀ k, (fourierEffect k).PosSemidef) ∧ ∑ k, fourierEffect k = 1 := by88 refine ⟨fun k ↦ Matrix.posSemidef_vecMulVec_self_star _, ?_⟩89 unfold fourierEffect fourierVector90 rw [wave_projector_sum, ← Matrix.diagonal_one]91 congr 192 funext i93 norm_cast94 rw [inv_pow, Real.sq_sqrt (by norm_num)]95 norm_num9697end SubentropyCertificates.Cyclic98
Axioms used
Choose a statement to see which axioms its proof uses.