Download lean/OAI/Geometry/SmoothYau/SphereMetric/ExistsAlignedUnit.lean from roseking/openAI-math-dataset: direct link, hf CLI and curl.
- Browser
- Download file 5.55 kB
-
https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Geometry/SmoothYau/SphereMetric/ExistsAlignedUnit.lean
- Command line
-
hf download hf://datasets/roseking/openAI-math-dataset/lean/OAI/Geometry/SmoothYau/SphereMetric/ExistsAlignedUnit.lean
-
curl -L -o ExistsAlignedUnit.lean https://huggingface.co/datasets/roseking/openAI-math-dataset/resolve/main/lean/OAI/Geometry/SmoothYau/SphereMetric/ExistsAlignedUnit.lean
5.55 kB
Lean 4 · 7
declarations statementsfull
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]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 _ _)@[simp] lemma phaseRealVector_complexPhaseVector (a b : PhaseSpace) :
phaseRealVector (complexPhaseVector a b) = a := by proof · 2 lines
ext i simp [phaseRealVector,complexPhaseVector]
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δ]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]
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_simptheorem 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₂Outline