Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Physlib.lean
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
80 changes: 80 additions & 0 deletions Physlib/Mathematics/ForMathlib/Analytic.lean
Original file line number Diff line number Diff line change
@@ -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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would remove this line.

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 : ι)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason behind having this lemma? Seems like one could just use (EuclideanSpace.proj (𝕜 := 𝕜) i).analyticAt z in its place.

(z : EuclideanSpace 𝕜 ι) : AnalyticAt 𝕜 (fun x : EuclideanSpace 𝕜 ι => x i) z :=
(EuclideanSpace.proj (𝕜 := 𝕜) i).analyticAt z
1 change: 1 addition & 0 deletions PhyslibAlpha.lean
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
35 changes: 34 additions & 1 deletion PhyslibAlpha/ClassicalMechanics/LiouvilleIntegrable/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Authors: Rithwik Ranganathan
-/
module

public import Physlib.ClassicalMechanics.HamiltonianMechanics.Basic
public import Physlib.ClassicalMechanics.HamiltonianMechanics.PoissonBracket
/-!

Expand Down Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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."
Expand Down Expand Up @@ -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
Expand Down
Loading
Loading