diff --git a/Physlib.lean b/Physlib.lean index 3391d814e5..9c0b62ee8c 100644 --- a/Physlib.lean +++ b/Physlib.lean @@ -152,6 +152,7 @@ public import Physlib.Mathematics.Calculus.Wirtinger.Coordinate public import Physlib.Mathematics.Calculus.Wirtinger.Hessian public import Physlib.Mathematics.Distribution.PowMul public import Physlib.Mathematics.Distribution.TemperedDistribution +public import Physlib.Mathematics.ForMathlib.Analytic public import Physlib.Mathematics.ForMathlib.ComplexLinear public import Physlib.Mathematics.ForMathlib.Contraction public import Physlib.Mathematics.ForMathlib.Cutoff diff --git a/Physlib/Mathematics/ForMathlib/Analytic.lean b/Physlib/Mathematics/ForMathlib/Analytic.lean new file mode 100644 index 0000000000..de1f429b87 --- /dev/null +++ b/Physlib/Mathematics/ForMathlib/Analytic.lean @@ -0,0 +1,80 @@ +/- +Copyright (c) 2026 Rithwik Ranganathan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Rithwik Ranganathan +-/ +module + +-- `Uniqueness` imports this module privately; the auxiliary analyticity lemmas need its public API. +public import Mathlib.Analysis.Analytic.Constructions +public import Mathlib.Analysis.Analytic.Uniqueness +public import Mathlib.Analysis.InnerProductSpace.PiL2 +/-! + +# Analyticity and dense non-vanishing sets + +Analytic coordinate functions and density of the non-vanishing set of an analytic function. + +## i. Overview + +By the identity principle, an analytic function on a connected normed space which vanishes on a +non-empty open set vanishes everywhere. Hence an analytic function which is non-zero at one point +is non-zero on a dense set. + +The coordinate functionals on Euclidean space are registered with `fun_prop` to automate proofs of +analyticity for polynomial expressions in the coordinates. Combined with the density lemma, this +shows that the non-vanishing set of such an expression is dense whenever it is non-zero at some +point. Applications include domains in phase space used in proofs of Liouville integrability. + +## ii. Key results + +- `AnalyticOnNhd.dense_setOf_ne_zero` : a function analytic on a connected space and non-zero at + some point is non-zero on a dense set. +- `analyticAt_euclideanSpace_apply` : coordinate functionals on Euclidean space are analytic. + +## iii. Table of contents + +- A. Density of the non-vanishing set +- B. Analyticity of coordinate functionals + +## iv. References + +The density proof uses the identity principle in `Mathlib.Analysis.Analytic.Uniqueness`. +-/ + +@[expose] public section + +open Filter Topology + +/-! + +## A. Density of the non-vanishing set + +-/ + +/-- A function analytic on a connected space, and non-zero at some point, is non-zero on a dense +set. -/ +lemma AnalyticOnNhd.dense_setOf_ne_zero {𝕜 E F : Type*} [NontriviallyNormedField 𝕜] + [NormedAddCommGroup E] [NormedSpace 𝕜 E] [NormedAddCommGroup F] [NormedSpace 𝕜 F] + [PreconnectedSpace E] {f : E → F} (hf : AnalyticOnNhd 𝕜 f Set.univ) {x₀ : E} + (hx₀ : f x₀ ≠ 0) : Dense {x | f x ≠ 0} := by + rw [dense_iff_inter_open] + rintro W hW ⟨z, hz⟩ + by_contra h + have hzero : f =ᶠ[𝓝 z] 0 := by + filter_upwards [hW.mem_nhds hz] with y hy + by_contra hne + exact h ⟨y, hy, hne⟩ + exact hx₀ (congrFun (hf.eq_of_eventuallyEq analyticOnNhd_const hzero) x₀) + +/-! + +## B. Analyticity of coordinate functionals + +-/ + +/-- The coordinate functionals on Euclidean space are analytic. -/ +@[fun_prop] +lemma analyticAt_euclideanSpace_apply {𝕜 ι : Type*} [RCLike 𝕜] [Fintype ι] (i : ι) + (z : EuclideanSpace 𝕜 ι) : AnalyticAt 𝕜 (fun x : EuclideanSpace 𝕜 ι => x i) z := + (EuclideanSpace.proj (𝕜 := 𝕜) i).analyticAt z diff --git a/PhyslibAlpha.lean b/PhyslibAlpha.lean index a01e40530a..c2a00a9434 100644 --- a/PhyslibAlpha.lean +++ b/PhyslibAlpha.lean @@ -153,6 +153,7 @@ public import PhyslibAlpha.ClassicalMechanics.CentralForce.AngularMomentum public import PhyslibAlpha.ClassicalMechanics.CentralForce.Basic public import PhyslibAlpha.ClassicalMechanics.CoupledSpringPotential public import PhyslibAlpha.ClassicalMechanics.LiouvilleIntegrable.Basic +public import PhyslibAlpha.ClassicalMechanics.LiouvilleIntegrable.CentralForce public import PhyslibAlpha.ClassicalMechanics.MomentMap.Basic public import PhyslibAlpha.ClassicalMechanics.MomentMap.Cohomology public import PhyslibAlpha.ClassicalMechanics.MomentMap.GalileanMass diff --git a/PhyslibAlpha/ClassicalMechanics/LiouvilleIntegrable/Basic.lean b/PhyslibAlpha/ClassicalMechanics/LiouvilleIntegrable/Basic.lean index 21c8211a65..32c4f0cb3f 100644 --- a/PhyslibAlpha/ClassicalMechanics/LiouvilleIntegrable/Basic.lean +++ b/PhyslibAlpha/ClassicalMechanics/LiouvilleIntegrable/Basic.lean @@ -5,6 +5,7 @@ Authors: Rithwik Ranganathan -/ module +public import Physlib.ClassicalMechanics.HamiltonianMechanics.Basic public import Physlib.ClassicalMechanics.HamiltonianMechanics.PoissonBracket /-! @@ -49,6 +50,10 @@ already used for e.g. `RigidBody (d : ℕ)`. - `LiouvilleIntegrableOn` : the structure of a Liouville integrable system for a Hamiltonian `H` on an open dense domain `U` of phase space. +- `HamiltonianSystem.LiouvilleIntegrabilityData` : an autonomous coordinate Hamiltonian and its + integrability data, related to a Hamiltonian system on a coordinate domain. +- `HamiltonianSystem.IsLiouvilleIntegrableOn` : coordinate integrability for a Hamiltonian system, + including agreement with an autonomous Hamiltonian on the integrability domain. - `LiouvilleIntegrableOn.deriv_comp_eq_zero` : each conserved quantity has zero time derivative along a solution of Hamilton's equations for `H` which stays in `U`. - `LiouvilleIntegrableOn.oneDegreeOfFreedom` : a system with one degree of freedom is Liouville @@ -57,6 +62,7 @@ already used for e.g. `RigidBody (d : ℕ)`. ## iii. Table of contents - A. The definition of Liouville integrability + - A.1. Integrability of Hamiltonian systems - B. Conservation along the flow - C. Systems with one degree of freedom @@ -70,7 +76,7 @@ already used for e.g. `RigidBody (d : ℕ)`. namespace ClassicalMechanics open Time -open scoped ContDiff +open scoped ContDiff Manifold TODO "Formalize the conclusion of the Liouville–Arnold theorem (action-angle coordinates, invariant tori) — the definition here is only its hypothesis." @@ -106,6 +112,33 @@ structure LiouvilleIntegrableOn {d : ℕ} independent : ∀ x ∈ U, LinearIndependent ℝ (fun i => (gradient (fun p' => f i p' x.2) x.1, gradient (fun q' => f i x.1 q') x.2)) +/-! +### A.1. Integrability of Hamiltonian systems +-/ + +/-- An autonomous coordinate Hamiltonian and its Liouville integrability data, related to a +Hamiltonian system on a coordinate domain. -/ +structure HamiltonianSystem.LiouvilleIntegrabilityData {d : ℕ} + (S : HamiltonianSystem 𝓘(ℝ, EuclideanSpace ℝ (Fin d)) ⟨EuclideanSpace ℝ (Fin d)⟩) + (U : Set (EuclideanSpace ℝ (Fin d) × EuclideanSpace ℝ (Fin d))) where + /-- The autonomous Hamiltonian in momentum-position coordinates. -/ + coordinateHamiltonian : EuclideanSpace ℝ (Fin d) → EuclideanSpace ℝ (Fin d) → ℝ + /-- The system agrees with the coordinate Hamiltonian on the domain at every time. -/ + hamiltonian_eq : ∀ t p q, (p, q) ∈ U → + S.hamiltonian (t, PhaseSpace.ofInnerProductSpace p q) = coordinateHamiltonian p q + /-- Coordinate states in the integrability domain belong to the system's domain. -/ + domain_subset : ∀ p q, (p, q) ∈ U → PhaseSpace.ofInnerProductSpace p q ∈ S.domain + /-- The coordinate Hamiltonian has the Liouville integrability data. -/ + integrable : LiouvilleIntegrableOn U coordinateHamiltonian + +/-- A Hamiltonian system is Liouville integrable on a coordinate domain when that domain lies +inside the system's domain and, for every time, the system agrees there with an autonomous +coordinate Hamiltonian satisfying the Liouville integrability conditions. -/ +def HamiltonianSystem.IsLiouvilleIntegrableOn {d : ℕ} + (S : HamiltonianSystem 𝓘(ℝ, EuclideanSpace ℝ (Fin d)) ⟨EuclideanSpace ℝ (Fin d)⟩) + (U : Set (EuclideanSpace ℝ (Fin d) × EuclideanSpace ℝ (Fin d))) : Prop := + Nonempty (S.LiouvilleIntegrabilityData U) + /-! ## B. Conservation along the flow diff --git a/PhyslibAlpha/ClassicalMechanics/LiouvilleIntegrable/CentralForce.lean b/PhyslibAlpha/ClassicalMechanics/LiouvilleIntegrable/CentralForce.lean new file mode 100644 index 0000000000..71bc6f3e07 --- /dev/null +++ b/PhyslibAlpha/ClassicalMechanics/LiouvilleIntegrable/CentralForce.lean @@ -0,0 +1,261 @@ +/- +Copyright (c) 2026 Rithwik Ranganathan. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Rithwik Ranganathan +-/ +module + +public import Physlib.Mathematics.ForMathlib.Analytic +public import PhyslibAlpha.ClassicalMechanics.CentralForce.AngularMomentum +public import PhyslibAlpha.ClassicalMechanics.LiouvilleIntegrable.Basic +/-! + +# Central-force systems are Liouville integrable + +Independence and involution of the Hamiltonian, squared angular momentum and axial component. + +## i. Overview + +The Hamiltonian `H`, squared angular momentum `L²` and axial component `L_z` are independent +and in involution on the open dense domain where the radial momentum is non-zero and the +angular momentum is not parallel to the z-axis. This proves Liouville integrability for every +central-force system. The domain is sufficient; no maximality claim is made. + +Independence follows by pairing a vanishing combination of gradients with radial changes of +momentum, infinitesimal rotations and momentum scaling, successively eliminating its coefficients. + +## ii. Key results + +- `CentralForce.integrabilityDomain` : the chosen domain in phase space. +- `CentralForce.isOpen_integrabilityDomain`, `CentralForce.dense_integrabilityDomain` : it is + open and dense. +- `CentralForce.snd_ne_zero_of_mem_integrabilityDomain` : it excludes the centre of force. +- `CentralForce.linearIndependent_conservedQuantities` : the observables are independent there. +- `CentralForce.liouvilleIntegrable` : the resulting Liouville-integrability construction. +- `CentralForce.toHamiltonianSystem_isLiouvilleIntegrableOn` : the shared Hamiltonian system is + integrable on the same coordinate domain. + +## iii. Table of contents + +- A. The domain of integrability +- B. The conserved quantities + - B.1. Involution + - B.2. Functional independence +- C. Liouville integrability + +## iv. References + +* V. I. Arnold, *Mathematical Methods of Classical Mechanics*, 2nd edition, Chapter 10. +-/ + +@[expose] public section + +namespace ClassicalMechanics.CentralForce + +open InnerProductSpace +open scoped ContDiff + +attribute [local fun_prop] analyticAt_fst analyticAt_snd + +/-! + +## A. The domain of integrability + +-/ + +/-- The phase-space domain where the radial momentum is non-zero and the angular momentum +is not parallel to the z-axis, used to establish central-force integrability. -/ +def integrabilityDomain : Set (EuclideanSpace ℝ (Fin 3) × EuclideanSpace ℝ (Fin 3)) := + {x | ⟪x.2, x.1⟫_ℝ ≠ 0 ∧ angularMomentum x.1 x.2 0 ^ 2 + angularMomentum x.1 x.2 1 ^ 2 ≠ 0} + +/-- The domain is the non-vanishing set of a polynomial in the phase-space coordinates. -/ +lemma integrabilityDomain_eq : integrabilityDomain = + {x | (x.1 0 * x.2 0 + x.1 1 * x.2 1 + x.1 2 * x.2 2) * + ((x.2 1 * x.1 2 - x.2 2 * x.1 1) ^ 2 + (x.2 2 * x.1 0 - x.2 0 * x.1 2) ^ 2) ≠ 0} := by + ext x + simp only [integrabilityDomain, Set.mem_ofPred_eq, mul_ne_zero_iff, angularMomentum_apply_zero, + angularMomentum_apply_one, PiLp.inner_apply, Fin.sum_univ_three, RCLike.inner_apply, + conj_trivial] + +/-- The chosen central-force domain is open. -/ +lemma isOpen_integrabilityDomain : IsOpen integrabilityDomain := by + rw [integrabilityDomain_eq] + exact isOpen_ne_fun (by fun_prop) continuous_const + +/-- The chosen central-force domain is dense. -/ +lemma dense_integrabilityDomain : Dense integrabilityDomain := by + rw [integrabilityDomain_eq] + refine AnalyticOnNhd.dense_setOf_ne_zero (𝕜 := ℝ) (fun z _ => by fun_prop) + (x₀ := (!₂[1, 0, 1], !₂[1, 0, 0])) ?_ + norm_num [Matrix.cons_val_two] + +/-- The chosen domain excludes the centre of force. -/ +lemma snd_ne_zero_of_mem_integrabilityDomain + {x : EuclideanSpace ℝ (Fin 3) × EuclideanSpace ℝ (Fin 3)} (hx : x ∈ integrabilityDomain) : + x.2 ≠ 0 := by + intro h + exact hx.1 (by rw [h, inner_zero_left]) + +/-! + +## B. The conserved quantities + +-/ + +variable (S : CentralForce) + +/-- The three conserved quantities in involution of a central-force system: the Hamiltonian `H`, +the squared magnitude `L²` of the angular momentum, and its z-component `L_z`. -/ +noncomputable def conservedQuantities : + Fin 3 → EuclideanSpace ℝ (Fin 3) → EuclideanSpace ℝ (Fin 3) → ℝ := + ![S.hamiltonian, angularMomentumSq, angularMomentumZ] + +/-! + +### B.1. Involution + +-/ + +/-- Away from the centre of force, the conserved quantities of a central-force system are pairwise +in involution. -/ +lemma poissonBracket_conservedQuantities (i j : Fin 3) (p : EuclideanSpace ℝ (Fin 3)) + {q : EuclideanSpace ℝ (Fin 3)} (hq : q ≠ 0) : + poissonBracket (S.conservedQuantities i) (S.conservedQuantities j) p q = 0 := by + have hSqH := S.poissonBracket_angularMomentumSq_hamiltonian p hq + have hZH := S.poissonBracket_angularMomentumZ_hamiltonian p hq + have hSqZ := poissonBracket_angularMomentumSq_angularMomentumZ p q + have hHSq : poissonBracket S.hamiltonian angularMomentumSq p q = 0 := by + rw [poissonBracket_antisymm, hSqH, neg_zero] + have hHZ : poissonBracket S.hamiltonian angularMomentumZ p q = 0 := by + rw [poissonBracket_antisymm, hZH, neg_zero] + have hZSq : poissonBracket angularMomentumZ angularMomentumSq p q = 0 := by + rw [poissonBracket_antisymm, hSqZ, neg_zero] + fin_cases i <;> fin_cases j <;> simp [conservedQuantities, poissonBracket_self, *] + +/-! + +### B.2. Functional independence + +-/ + +/-- Away from the centre of force, the phase-space gradients of the conserved quantities of a +central-force system. -/ +lemma gradient_conservedQuantities (p : EuclideanSpace ℝ (Fin 3)) {q : EuclideanSpace ℝ (Fin 3)} + (hq : q ≠ 0) : + (fun i => (gradient (fun p' => S.conservedQuantities i p' q) p, + gradient (fun q' => S.conservedQuantities i p q') q)) = + ![(S.m⁻¹ • p, (deriv S.V ‖q‖ / ‖q‖) • q), + ((2 * ⟪q, q⟫_ℝ) • p - (2 * ⟪q, p⟫_ℝ) • q, (2 * ⟪p, p⟫_ℝ) • q - (2 * ⟪q, p⟫_ℝ) • p), + (q 0 • EuclideanSpace.single 1 1 - q 1 • EuclideanSpace.single 0 1, + p 1 • EuclideanSpace.single 0 1 - p 0 • EuclideanSpace.single 1 1)] := by + funext i + fin_cases i + · exact Prod.ext (S.hasGradientAt_hamiltonian_momentum p q).gradient + (S.hasGradientAt_hamiltonian_position p hq).gradient + · exact Prod.ext (hasGradientAt_angularMomentumSq_momentum p q).gradient + (hasGradientAt_angularMomentumSq_position p q).gradient + · exact Prod.ext (hasGradientAt_angularMomentumZ_momentum p q).gradient + (hasGradientAt_angularMomentumZ_position p q).gradient + +/-- On the domain of integrability, a phase-space function whose momentum gradient is a non-zero +multiple `a • p` of the momentum and whose position gradient is a multiple `c • q` of the +position, such as the Hamiltonian of a central-force system, is functionally independent of `L²` +and `L_z`: the three phase-space gradients are linearly independent. -/ +lemma linearIndependent_gradients {p q : EuclideanSpace ℝ (Fin 3)} {a c : ℝ} (ha : a ≠ 0) + (hx : (p, q) ∈ integrabilityDomain) : + LinearIndependent ℝ ![(a • p, c • q), + ((2 * ⟪q, q⟫_ℝ) • p - (2 * ⟪q, p⟫_ℝ) • q, (2 * ⟪p, p⟫_ℝ) • q - (2 * ⟪q, p⟫_ℝ) • p), + (q 0 • EuclideanSpace.single 1 1 - q 1 • EuclideanSpace.single 0 1, + p 1 • EuclideanSpace.single 0 1 - p 0 • EuclideanSpace.single 1 1)] := by + rw [integrabilityDomain_eq] at hx + obtain ⟨hqp, hL⟩ := mul_ne_zero_iff.mp hx + rw [Fintype.linearIndependent_iff] + intro g hg + obtain ⟨h1, h2⟩ := Prod.ext_iff.mp hg + simp only [Fin.sum_univ_three, Matrix.cons_val_zero, Matrix.cons_val_one, Matrix.cons_val_two, + Matrix.head_cons, Matrix.tail_cons, Prod.fst_add, Prod.snd_add, Prod.smul_fst, Prod.smul_snd, + Prod.fst_zero, Prod.snd_zero] at h1 h2 + -- The six components of the vanishing combination of gradients. + have A0 := congrArg (fun v => v 0) h1 + have A1 := congrArg (fun v => v 1) h1 + have A2 := congrArg (fun v => v 2) h1 + have B0 := congrArg (fun v => v 0) h2 + have B1 := congrArg (fun v => v 1) h2 + have B2 := congrArg (fun v => v 2) h2 + have h20 : (2 : Fin 3) ≠ 0 := by decide + have h21 : (2 : Fin 3) ≠ 1 := by decide + simp only [Fin.isValue, PiLp.add_apply, PiLp.smul_apply, smul_eq_mul, PiLp.sub_apply, ne_eq, + zero_ne_one, one_ne_zero, h20, h21, not_false_eq_true, PiLp.single_eq_of_ne, + PiLp.single_eq_same, mul_zero, mul_one, sub_zero, zero_sub, PiLp.zero_apply, PiLp.inner_apply, + Fin.sum_univ_three, RCLike.inner_apply, conj_trivial] at A0 A1 A2 B0 B1 B2 + -- Pairing with the radial change of momentum `(q, 0)`. + have hg0 : g 0 = 0 := by + have h : g 0 * (a * (p 0 * q 0 + p 1 * q 1 + p 2 * q 2)) = 0 := by + linear_combination q 0 * A0 + q 1 * A1 + q 2 * A2 + simpa [ha, hqp] using h + -- Pairing with the infinitesimal rotations about the x- and y-axes. + have hg2 : g 2 = 0 := by + have h : g 2 * ((q 1 * p 2 - q 2 * p 1) ^ 2 + (q 2 * p 0 - q 0 * p 2) ^ 2) = 0 := by + linear_combination (q 1 * p 2 - q 2 * p 1) * (-(p 2 * A0 - p 0 * A2 + q 2 * B0 - q 0 * B2)) + + (q 2 * p 0 - q 0 * p 2) * (-p 2 * A1 + p 1 * A2 - q 2 * B1 + q 1 * B2) + exact (mul_eq_zero.mp h).resolve_right hL + -- Pairing with the scaling `(p, 0)` of the momentum. + have hg1 : g 1 = 0 := by + have h : g 1 * (2 * ((q 1 * p 2 - q 2 * p 1) ^ 2 + (q 2 * p 0 - q 0 * p 2) ^ 2 + + (q 0 * p 1 - q 1 * p 0) ^ 2)) = 0 := by + linear_combination p 0 * A0 + p 1 * A1 + p 2 * A2 - + a * (p 0 ^ 2 + p 1 ^ 2 + p 2 ^ 2) * hg0 - (q 0 * p 1 - q 1 * p 0) * hg2 + refine (mul_eq_zero.mp h).resolve_right (mul_ne_zero two_ne_zero (ne_of_gt ?_)) + exact add_pos_of_pos_of_nonneg (lt_of_le_of_ne (by positivity) (Ne.symm hL)) (sq_nonneg _) + intro i + fin_cases i + exacts [hg0, hg1, hg2] + +/-- On the domain of integrability, the conserved quantities of a central-force system are +functionally independent: their phase-space gradients are linearly independent. -/ +lemma linearIndependent_conservedQuantities + {x : EuclideanSpace ℝ (Fin 3) × EuclideanSpace ℝ (Fin 3)} (hx : x ∈ integrabilityDomain) : + LinearIndependent ℝ (fun i => (gradient (fun p' => S.conservedQuantities i p' x.2) x.1, + gradient (fun q' => S.conservedQuantities i x.1 q') x.2)) := by + rw [S.gradient_conservedQuantities x.1 (snd_ne_zero_of_mem_integrabilityDomain hx)] + exact linearIndependent_gradients (inv_ne_zero S.m_ne_zero) hx + +/-! + +## C. Liouville integrability + +-/ + +/-- Every central-force system is Liouville integrable on the domain of integrability, with the +Hamiltonian, the squared magnitude of the angular momentum and its z-component as conserved +quantities. -/ +noncomputable def liouvilleIntegrable : + LiouvilleIntegrableOn integrabilityDomain S.hamiltonian where + isOpen := isOpen_integrabilityDomain + dense := dense_integrabilityDomain + f := S.conservedQuantities + contDiffOn i := by + fin_cases i + · exact S.contDiffOn_hamiltonian.mono fun _ hx => snd_ne_zero_of_mem_integrabilityDomain hx + · exact contDiff_angularMomentumSq.contDiffOn + · exact contDiff_angularMomentumZ.contDiffOn + exists_hamiltonian := ⟨0, rfl⟩ + involutive i j x hx := + S.poissonBracket_conservedQuantities i j x.1 (snd_ne_zero_of_mem_integrabilityDomain hx) + independent _ hx := S.linearIndependent_conservedQuantities hx + +/-- The Hamiltonian system associated with a central force is Liouville integrable on the +coordinate domain of integrability. -/ +lemma toHamiltonianSystem_isLiouvilleIntegrableOn : + S.toHamiltonianSystem.IsLiouvilleIntegrableOn integrabilityDomain := by + refine ⟨{ + coordinateHamiltonian := S.hamiltonian + hamiltonian_eq := ?_ + domain_subset := ?_ + integrable := S.liouvilleIntegrable }⟩ + · intro t p q _ + exact S.toHamiltonianSystem_hamiltonian t p q + · intro p q hpq + exact (S.mem_domain_toHamiltonianSystem p q).2 (snd_ne_zero_of_mem_integrabilityDomain hpq) + +end ClassicalMechanics.CentralForce