roseking's picture
Add lean source and binary files (part 75)
695bd70 verified
Raw History Blame Contribute Delete
5.55 kB
41
lemma exists_aligned_unit (a : PhaseSpace) : ∃ ν : PhaseSpace, ‖ν‖ = 1 ∧ a = ‖a‖ • ν := by
proof · 7 lines
  by_cases ha : a = 0
  · refine ⟨EuclideanSpace.single 0 1,by simp,?_⟩
    simp [ha]
  · refine ⟨‖a‖⁻¹ • a,?_,?_⟩
    · rw [norm_smul,Real.norm_of_nonneg (inv_nonneg.mpr (norm_nonneg _)),
        inv_mul_cancel₀ (norm_ne_zero_iff.mpr ha)]
    · rw [smul_smul,mul_inv_cancel₀ (norm_ne_zero_iff.mpr ha),one_smul]
50
lemma complexPhaseVector_norm_bound (a b : PhaseSpace) :
    ‖complexPhaseVector a b‖ ≤ ‖a‖+‖b‖ := by
proof · 6 lines
  apply (pi_norm_le_iff_of_nonneg (by positivity)).mpr
  intro i
  calc
    _ ≤ ‖(a i : ℂ)‖+‖Complex.I*(b i : ℂ)‖ := norm_add_le _ _
    _ = ‖a i‖+‖b i‖ := by simp
    _ ≤ _ := add_le_add (PiLp.norm_apply_le _ _) (PiLp.norm_apply_le _ _)
59
@[simp] lemma phaseRealVector_complexPhaseVector (a b : PhaseSpace) :
    phaseRealVector (complexPhaseVector a b) = a := by
proof · 2 lines
  ext i
  simp [phaseRealVector,complexPhaseVector]
64
lemma three_phase_real_deviation (a ν b c d : PhaseSpace) (δ : ℝ)
    (hν : ‖ν‖ = 1) (hδ : 0 ≤ δ) :
    ∀ ℓ : Fin 3, ‖phaseRealVector
      (![complexPhaseVector a b,complexPhaseVector a c,complexPhaseVector (a+δ • ν) d] ℓ)-a‖ ≤ δ := by
proof · 2 lines
  intro ℓ
  fin_cases ℓ <;> simp [norm_smul,Real.norm_of_nonneg hδ,hν,hδ]
71
lemma phase_length_bound (a b : PhaseSpace) (hb : ‖b‖^2 = 1+‖a‖^2) :
    ‖b‖ ≤ ‖a‖+1 := by
proof · 1 line
  nlinarith [norm_nonneg a,norm_nonneg b]
75
lemma shiftedPhaseImag_norm_sq (a ν b : PhaseSpace) (δ : ℝ)
    (hb : ‖b‖^2 = 1+‖a‖^2) :
    ‖shiftedPhaseImag a ν b δ‖^2 = 1+‖a+δ • ν‖^2 := by
proof · 4 lines
  simp only [shiftedPhaseImag,norm_smul,Real.norm_eq_abs,sq_abs,mul_pow,div_pow,hb]
  rw [Real.sq_sqrt (by positivity),Real.sq_sqrt (by positivity)]
  have hn : (1 : ℝ)+‖a‖^2 ≠ 0 := by positivity
  field_simp
83
theorem ThreePhaseData.bounded_spec {H : RealForm PhaseSpace} {a ν : PhaseSpace}
    {δ κ η C A : ℝ} (h : ThreePhaseData H a ν δ κ η C)
    (hν : ‖ν‖ = 1) (halign : a = ‖a‖ • ν) (hA : 0 ≤ A) (ha : ‖a‖ ≤ A)
    (hδ : 0 ≤ δ) (hδ1 : δ ≤ 1) :
    ∃ b c : PhaseSpace, inner ℝ ν b = 0 ∧ inner ℝ ν c = 0 ∧
      ‖b‖^2 = 1+‖a‖^2 ∧ ‖c‖^2 = 1+‖a‖^2 ∧
      ‖b‖ ≤ A+1 ∧ ‖c‖ ≤ A+1 ∧ η ≤ transverseAngleSq b c ∧
      let z := ![complexPhaseVector a b,complexPhaseVector a c,
proof · 39 lines
        complexPhaseVector (a+δ • ν) (shiftedPhaseImag a ν b δ)]
      ∃ Q : Fin 3 → ComplexPhaseMatrix, (∀ ℓ, ‖z ℓ‖ ≤ 2*A+3) ∧
        (∀ ℓ, ∑ i, z ℓ i*z ℓ i = -1) ∧
        (∀ ℓ, PhaseMatrixValid H (z ℓ) κ C (Q ℓ)) := by
  obtain ⟨b,c,hb,hc,hbn,hcn,hang,⟨Q₀,hQ₀⟩,⟨Q₁,hQ₁⟩,⟨Q₂,hQ₂⟩⟩ := h
  have hbA : ‖b‖ ≤ A+1 := by
    apply (sq_le_sq₀ (norm_nonneg b) (add_nonneg hA zero_le_one)).mp
    rw [hbn]
    nlinarith [(sq_le_sq₀ (norm_nonneg a) hA).mpr ha]
  have hcA : ‖c‖ ≤ A+1 := (phase_length_bound a c hcn).trans (by linarith)
  have had : ‖a+δ • ν‖ ≤ A+1 := by
    calc
      _ ≤ ‖a‖+‖δ • ν‖ := norm_add_le _ _
      _ = ‖a‖+δ := by rw [norm_smul,Real.norm_of_nonneg hδ,hν,mul_one]
      _ ≤ _ := by linarith
  have hd : ‖shiftedPhaseImag a ν b δ‖ ≤ A+2 :=
    (phase_length_bound _ _ (shiftedPhaseImag_norm_sq a ν b δ hbn)).trans (by linarith)
  refine ⟨b,c,hb,hc,hbn,hcn,hbA,hcA,hang,![Q₀,Q₁,Q₂],?_,?_,?_⟩
  · intro ℓ
    fin_cases ℓ
    · simpa using
        (complexPhaseVector_norm_bound a b).trans (by linarith : ‖a‖+‖b‖ ≤ 2*A+3)
    · simpa using
        (complexPhaseVector_norm_bound a c).trans (by linarith : ‖a‖+‖c‖ ≤ 2*A+3)
    · simpa using
        (complexPhaseVector_norm_bound (a+δ • ν) (shiftedPhaseImag a ν b δ)).trans
          (by linarith : ‖a+δ • ν‖+‖shiftedPhaseImag a ν b δ‖ ≤ 2*A+3)
  · have hab : inner ℝ a b = 0 := by rw [halign,inner_smul_left]; simp [hb]
    have hac : inner ℝ a c = 0 := by rw [halign,inner_smul_left]; simp [hc]
    intro ℓ
    fin_cases ℓ
    · exact complexPhaseVector_square a b hab (by simpa only [real_inner_self_eq_norm_sq] using hbn)
    · exact complexPhaseVector_square a c hac (by simpa only [real_inner_self_eq_norm_sq] using hcn)
    · exact shifted_phase_square hb halign hbn δ
  · intro ℓ
    fin_cases ℓ
    · exact hQ₀
    · exact hQ₁
    · exact hQ₂