Download data/lean/OAI/Geometry/Arnold/Field.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 12.8 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/Arnold/Field.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Geometry/Arnold/Field.lean
-
curl -L -o Field.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Geometry/Arnold/Field.lean
12.8 kB
| import OAI.Geometry.Arnold.Factors | |
| namespace OAI | |
| universe uΞΉ | |
| noncomputable section | |
| open scoped BigOperators ContDiff | |
| namespace ArnoldCounterexample.Field | |
| open ArnoldCounterexample.Quadric ArnoldCounterexample.ThreePoints ArnoldCounterexample.Factors | |
| open scoped ContDiff Topology | |
| open Set Filter | |
| /-- The ambient symplectic bilinear form, with the factor 2 normalization. -/ | |
| def symplectic : CV βL[β] CV βL[β] β := | |
| (2 : β) β’ (β i : Fin 5, ((realCoord i).smulRight (imagCoord i) - (imagCoord i).smulRight (realCoord i))) | |
| lemma symplectic_apply (v w : CV) : symplectic v w = omega v w := by | |
| simp only [symplectic, smul_apply, sum_apply, sub_apply, ContinuousLinearMap.smulRight_apply, | |
| realCoord_apply, imagCoord_apply, smul_eq_mul, omega, Complex.im_sum, Complex.mul_im, | |
| Complex.star_def, Complex.conj_re, Complex.conj_im] | |
| congr 1 | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| ring | |
| lemma symplectic_skew (v w : CV) : symplectic v w = -symplectic w v := by | |
| simp only [symplectic, smul_apply, sum_apply, sub_apply, ContinuousLinearMap.smulRight_apply, | |
| realCoord_apply, imagCoord_apply, smul_eq_mul] | |
| rw [show -(2 * β i, ((w i).re * (v i).im - (w i).im * (v i).re)) = | |
| 2 * β i, -((w i).re * (v i).im - (w i).im * (v i).re) by rw [Finset.sum_neg_distrib]; ring] | |
| congr 1 | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| ring | |
| def rotor (a b : Fin 5) : CV βL[β] CV := | |
| (ContinuousLinearMap.single β (fun _ : Fin 5 β¦ β) b).comp (ContinuousLinearMap.proj a) - | |
| (ContinuousLinearMap.single β (fun _ : Fin 5 β¦ β) a).comp (ContinuousLinearMap.proj b) | |
| lemma rotor_apply (a b : Fin 5) (z : CV) : rotor a b z = Pi.single b (z a) - Pi.single a (z b) := rfl | |
| lemma rotor_phase (a b : Fin 5) (z : CV) (c : β) : rotor a b (c β’ z) = c β’ rotor a b z := by | |
| ext i | |
| simp [rotor_apply, Pi.single_apply, mul_sub] | |
| lemma bilinear_rotor (a b : Fin 5) (w z : CV) : | |
| bilinear w (rotor a b z) = w b * z a - w a * z b := by | |
| simp [bilinear, rotor_apply, Pi.single_apply, mul_sub, mul_ite, Finset.sum_sub_distrib] | |
| lemma moment_hasFDerivAt (a b : Fin 5) (z : CV) : | |
| HasFDerivAt (moment a b) (symplectic (rotor a b z)) z := by | |
| have hd := ((((realCoord a).hasFDerivAt (x := z)).mul (imagCoord b).hasFDerivAt).sub | |
| ((imagCoord a).hasFDerivAt.mul (realCoord b).hasFDerivAt)).const_mul 2 | |
| convert! hd using 1 | |
| Β· funext w | |
| exact moment_real a b w | |
| Β· ext v | |
| rw [symplectic_skew, symplectic_apply] | |
| change -(2 * (bilinear (star v) (rotor a b z)).im) = _ | |
| rw [bilinear_rotor] | |
| simp [Complex.mul_im] | |
| ring | |
| def leftOperator (i : Fin 3) : CV βL[β] CV := | |
| ![rotor 1 2 + rotor 3 4, rotor 1 3 - rotor 2 4, rotor 1 4 + rotor 2 3] i | |
| def rightOperator (i : Fin 3) : CV βL[β] CV := | |
| ![rotor 1 2 - rotor 3 4, rotor 1 3 + rotor 2 4, rotor 1 4 - rotor 2 3] i | |
| lemma left_hasFDerivAt (i : Fin 3) (z : CV) : | |
| HasFDerivAt (fun w β¦ leftSphere w i) (symplectic (leftOperator i z)) z := by | |
| fin_cases i <;> simp [leftSphere, leftOperator] | |
| Β· exact (moment_hasFDerivAt 1 2 z).add (moment_hasFDerivAt 3 4 z) | |
| Β· exact (moment_hasFDerivAt 1 3 z).sub (moment_hasFDerivAt 2 4 z) | |
| Β· exact (moment_hasFDerivAt 1 4 z).add (moment_hasFDerivAt 2 3 z) | |
| lemma right_hasFDerivAt (i : Fin 3) (z : CV) : | |
| HasFDerivAt (fun w β¦ rightSphere w i) (symplectic (rightOperator i z)) z := by | |
| fin_cases i <;> simp [rightSphere, rightOperator] | |
| Β· exact (moment_hasFDerivAt 1 2 z).sub (moment_hasFDerivAt 3 4 z) | |
| Β· exact (moment_hasFDerivAt 1 3 z).add (moment_hasFDerivAt 2 4 z) | |
| Β· exact (moment_hasFDerivAt 1 4 z).sub (moment_hasFDerivAt 2 3 z) | |
| lemma left_phase (i : Fin 3) (z : CV) (c : β) : | |
| leftOperator i (c β’ z) = c β’ leftOperator i z := by | |
| fin_cases i <;> simp [leftOperator, rotor_phase, smul_add, smul_sub] | |
| lemma right_phase (i : Fin 3) (z : CV) (c : β) : | |
| rightOperator i (c β’ z) = c β’ rightOperator i z := by | |
| fin_cases i <;> simp [rightOperator, rotor_phase, smul_add, smul_sub] | |
| /-- A real-skew field is simultaneously tangent to every sphere and complex quadric. -/ | |
| def SkewAt (z v : CV) : Prop := (bilinear (star z) v).re = 0 β§ bilinear z v = 0 | |
| lemma skewAt_zero (z : CV) : SkewAt z 0 := by simp [SkewAt, bilinear] | |
| lemma skewAt_add {z v w : CV} (hv : SkewAt z v) (hw : SkewAt z w) : SkewAt z (v+w) := by | |
| simp only [SkewAt, bilinear_add_right, Complex.add_re, hv.1, hw.1, hv.2, hw.2, add_zero, and_self] | |
| lemma skewAt_sub {z v w : CV} (hv : SkewAt z v) (hw : SkewAt z w) : SkewAt z (v-w) := by | |
| simp only [SkewAt, bilinear, Pi.sub_apply, mul_sub, Finset.sum_sub_distrib, Complex.sub_re] at * | |
| exact β¨by rw [hv.1, hw.1]; ring, by rw [hv.2, hw.2]; ringβ© | |
| lemma skewAt_smul {z v : CV} (hv : SkewAt z v) (a : β) : SkewAt z (a β’ v) := by | |
| have he : a β’ v = (a : β) β’ v := by ext i; simp | |
| change (bilinear (star z) (a β’ v)).re = 0 β§ bilinear z (a β’ v) = 0 | |
| rw [he, bilinear_smul_right, bilinear_smul_right] | |
| simp only [Complex.mul_re, Complex.ofReal_re, Complex.ofReal_im, zero_mul, | |
| sub_zero, hv.1, hv.2, mul_zero, and_self] | |
| lemma skewAt_sum {ΞΉ : Type uΞΉ} (T : Finset ΞΉ) {z : CV} (v : ΞΉ β CV) | |
| (hv : β i β T, SkewAt z (v i)) : SkewAt z (β i β T, v i) := by | |
| classical | |
| induction T using Finset.induction_on with | |
| | empty => simpa using skewAt_zero z | |
| | @insert a T ha ih => | |
| rw [Finset.sum_insert ha] | |
| exact skewAt_add (hv a (by simp)) (ih (fun i hi β¦ hv i (by simp [hi]))) | |
| lemma rotor_skew (a b : Fin 5) (z : CV) : SkewAt z (rotor a b z) := by | |
| simp only [SkewAt, bilinear_rotor, Complex.sub_re, Complex.mul_re, Pi.star_apply, | |
| Complex.star_def, Complex.conj_re, Complex.conj_im] | |
| constructor <;> ring | |
| lemma left_skew (i : Fin 3) (z : CV) : SkewAt z (leftOperator i z) := by | |
| fin_cases i <;> simp [leftOperator] | |
| Β· exact skewAt_add (rotor_skew _ _ z) (rotor_skew _ _ z) | |
| Β· exact skewAt_sub (rotor_skew _ _ z) (rotor_skew _ _ z) | |
| Β· exact skewAt_add (rotor_skew _ _ z) (rotor_skew _ _ z) | |
| lemma right_skew (i : Fin 3) (z : CV) : SkewAt z (rightOperator i z) := by | |
| fin_cases i <;> simp [rightOperator] | |
| Β· exact skewAt_sub (rotor_skew _ _ z) (rotor_skew _ _ z) | |
| Β· exact skewAt_add (rotor_skew _ _ z) (rotor_skew _ _ z) | |
| Β· exact skewAt_sub (rotor_skew _ _ z) (rotor_skew _ _ z) | |
| end ArnoldCounterexample.Field | |
| namespace ArnoldCounterexample.Field | |
| open ArnoldCounterexample.Quadric ArnoldCounterexample.ThreePoints ArnoldCounterexample.Factors | |
| open scoped ContDiff Topology | |
| open Set Filter | |
| lemma exists_radial : β b : β β β, ContDiff β β b β§ | |
| β s β Icc (1/32 : β) 32, b s = (Real.sqrt s)β»ΒΉ := by | |
| obtain β¨b, hb, heβ© := Extension.global_extension (isCompact_Icc (a := (1/32 : β)) (b := 32)) | |
| (fun s β¦ (Real.sqrt (s : β))β»ΒΉ) (by | |
| intro s | |
| refine β¨Ioi 0, fun x β¦ (Real.sqrt x)β»ΒΉ, isOpen_Ioi, ?_, ?_, ?_β© | |
| Β· exact lt_of_lt_of_le (by norm_num) s.property.1 | |
| Β· exact (contDiffOn_id.sqrt (fun x hx β¦ ne_of_gt hx)).inv (fun x hx β¦ (Real.sqrt_pos.2 hx).ne') | |
| Β· intro y _; rfl) | |
| exact β¨b, hb, fun s hs β¦ he β¨s,hsβ©β© | |
| def radial : β β β := exists_radial.choose | |
| lemma radial_smooth : ContDiff β β radial := exists_radial.choose_spec.1 | |
| lemma radial_eq (s : β) (hs : s β Icc (1/32 : β) 32) : radial s = (Real.sqrt s)β»ΒΉ := | |
| exists_radial.choose_spec.2 s hs | |
| lemma radial_eventually {s : β} (hs : s β Ioo (1/32 : β) 32) : | |
| radial =αΆ [π s] fun x β¦ (Real.sqrt x)β»ΒΉ := by | |
| filter_upwards [isOpen_Ioo.mem_nhds hs] with x hx | |
| exact radial_eq x β¨le_of_lt hx.1, le_of_lt hx.2β© | |
| lemma radial_squared (r : β) (hr : r β Ioo (1/2 : β) 2) : | |
| radial (r^2) = rβ»ΒΉ β§ deriv radial (r^2) = -(2*r^3)β»ΒΉ := by | |
| have hr0 : 0 < r := lt_trans (by norm_num) hr.1 | |
| have hs : r^2 β Ioo (1/32 : β) 32 := by constructor <;> nlinarith [hr.1, hr.2, sq_nonneg (r-2), sq_nonneg (r-1/2)] | |
| have hsqrt : Real.sqrt (r^2) = r := Real.sqrt_sq hr0.le | |
| have he : radial (r^2) = rβ»ΒΉ := by rw [radial_eq _ β¨hs.1.le,hs.2.leβ©, hsqrt] | |
| refine β¨he, ?_β© | |
| have hd := (((hasDerivAt_id (r^2)).sqrt (sq_pos_of_pos hr0).ne').inv ((Real.sqrt_pos.2 (sq_pos_of_pos hr0)).ne')) | |
| have hb := hd.congr_of_eventuallyEq (radial_eventually hs) | |
| rw [hb.deriv] | |
| simp only [id_eq, hsqrt] | |
| field_simp | |
| lemma radial_at_one : radial 1 = 1 β§ deriv radial 1 = -(1/2 : β) := by | |
| simpa using radial_squared 1 (by norm_num) | |
| def casimir (z : CV) : β := β i : Fin 3, leftSphere z i ^ 2 | |
| def pairing (z : CV) : β := β i : Fin 3, leftSphere z i * rightSphere z i | |
| def mixedField (z : CV) : CV := β i : Fin 3, | |
| ((rightSphere z i) β’ leftOperator i z + (leftSphere z i) β’ rightOperator i z) | |
| def selfField (z : CV) : CV := β i : Fin 3, (leftSphere z i) β’ leftOperator i z | |
| /-- A degree-two Hamiltonian near the unit fixed quadric, with restriction f. -/ | |
| def potential (z : CV) : β := leftSphere z 0 - rightSphere z 2 + radial (casimir z) * pairing z | |
| def core (z : CV) : CV := leftOperator 0 z - rightOperator 2 z + | |
| radial (casimir z) β’ mixedField z + (2 * deriv radial (casimir z) * pairing z) β’ selfField z | |
| lemma casimir_smooth : ContDiff β β casimir := by | |
| have h (i : Fin 3) : ContDiff β β (fun z : CV β¦ leftSphere z i) := | |
| (contDiff_apply β β i).comp (sphereFactors_smooth.fst) | |
| exact ContDiff.sum (fun i _ β¦ (h i).pow 2) | |
| lemma pairing_smooth : ContDiff β β pairing := by | |
| have hL (i : Fin 3) : ContDiff β β (fun z : CV β¦ leftSphere z i) := | |
| (contDiff_apply β β i).comp (sphereFactors_smooth.fst) | |
| have hR (i : Fin 3) : ContDiff β β (fun z : CV β¦ rightSphere z i) := | |
| (contDiff_apply β β i).comp (sphereFactors_smooth.snd) | |
| exact ContDiff.sum (fun i _ β¦ (hL i).mul (hR i)) | |
| lemma potential_smooth : ContDiff β β potential := by | |
| have hL : ContDiff β β (fun z : CV β¦ leftSphere z 0) := | |
| (contDiff_apply β β 0).comp (sphereFactors_smooth.fst) | |
| have hR : ContDiff β β (fun z : CV β¦ rightSphere z 2) := | |
| (contDiff_apply β β 2).comp (sphereFactors_smooth.snd) | |
| exact (hL.sub hR).add ((radial_smooth.comp casimir_smooth).mul pairing_smooth) | |
| lemma mixed_smooth : ContDiff β β mixedField := by | |
| apply ContDiff.sum | |
| intro i _ | |
| exact (((contDiff_apply β β i).comp sphereFactors_smooth.snd).smul (leftOperator i).contDiff).add | |
| (((contDiff_apply β β i).comp sphereFactors_smooth.fst).smul (rightOperator i).contDiff) | |
| lemma self_smooth : ContDiff β β selfField := by | |
| apply ContDiff.sum | |
| intro i _ | |
| exact ((contDiff_apply β β i).comp sphereFactors_smooth.fst).smul (leftOperator i).contDiff | |
| lemma core_smooth : ContDiff β β core := by | |
| have hd : ContDiff β β (deriv radial) := (contDiff_infty_iff_deriv.mp radial_smooth).2 | |
| exact (((leftOperator 0).contDiff.sub (rightOperator 2).contDiff).add | |
| ((radial_smooth.comp casimir_smooth).smul mixed_smooth)).add | |
| ((contDiff_const.mul (hd.comp casimir_smooth) |>.mul pairing_smooth).smul self_smooth) | |
| lemma casimir_hasFDerivAt (z : CV) : | |
| HasFDerivAt casimir ((2 : β) β’ symplectic (selfField z)) z := by | |
| have hd := HasFDerivAt.fun_sum (u := Finset.univ) | |
| (fun i : Fin 3 β¦ fun _ β¦ (left_hasFDerivAt i z).pow 2) | |
| convert! hd using 1 | |
| ext v | |
| simp only [selfField, map_sum, map_smul, sum_apply, smul_apply, smul_eq_mul, | |
| Finset.mul_sum] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| ring | |
| lemma pairing_hasFDerivAt (z : CV) : | |
| HasFDerivAt pairing (symplectic (mixedField z)) z := by | |
| have hd := HasFDerivAt.fun_sum (u := Finset.univ) | |
| (fun i : Fin 3 β¦ fun _ β¦ (left_hasFDerivAt i z).mul (right_hasFDerivAt i z)) | |
| convert! hd using 1 | |
| ext v | |
| simp only [mixedField, map_sum, map_add, map_smul, sum_apply, add_apply, smul_apply] | |
| apply Finset.sum_congr rfl | |
| intro i _ | |
| abel | |
| lemma core_hamiltonian (z : CV) : symplectic (core z) = fderiv β potential z := by | |
| have hb := (radial_smooth.differentiable (by simp) (casimir z)).hasDerivAt.comp_hasFDerivAt z | |
| (casimir_hasFDerivAt z) | |
| have hd := ((left_hasFDerivAt 0 z).sub (right_hasFDerivAt 2 z)).add | |
| (hb.mul (pairing_hasFDerivAt z)) | |
| change HasFDerivAt potential _ z at hd | |
| rw [hd.fderiv] | |
| ext v | |
| simp only [core, map_add, map_sub, map_smul, add_apply, sub_apply, smul_apply, smul_eq_mul, Function.comp_apply] | |
| ring | |
| lemma core_skew (z : CV) : SkewAt z (core z) := by | |
| unfold core | |
| apply skewAt_add | |
| Β· apply skewAt_add (skewAt_sub (left_skew 0 z) (right_skew 2 z)) | |
| apply skewAt_smul | |
| unfold mixedField | |
| exact skewAt_sum Finset.univ _ (fun i _ β¦ | |
| skewAt_add (skewAt_smul (left_skew i z) _) (skewAt_smul (right_skew i z) _)) | |
| Β· apply skewAt_smul | |
| unfold selfField | |
| exact skewAt_sum Finset.univ _ (fun i _ β¦ skewAt_smul (left_skew i z) _) | |
| end ArnoldCounterexample.Field | |
| end | |
| end OAI | |