math / data /lean /OAI /Analysis /HardSphere /Geometry /FirstVariation.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
7.39 kB
import Mathlib
import OAI.Analysis.HardSphere.FormDomain.Basic
import OAI.Analysis.HardSphere.FormDomain.Energy
namespace OAI
noncomputable section
open MeasureTheory Filter Set
open scoped ENNReal Topology BigOperators
open scoped BigOperators ComplexConjugate
namespace HardSphere
theorem IsGroundVector.first_variation {N : β„•} {L : Length} {a : ℝ}
{u : Jet N L} (hu : IsGroundVector N L a u) (v : Jet N L)
(hv : v ∈ dirichletDomain N L a) (hb : bosonic v.1) :
(βˆ‘ p : Direction N, inner β„‚ (u.2 p) (v.2 p)) =
(energy u : β„‚) * inner β„‚ u.1 v.1 := by
apply Variational.ground_pairing (groundFormSubmodule N L a) u
· exact mem_groundFormSubmodule.mpr ⟨hu.1, hu.2.1⟩
Β· exact hu.2.2.1
Β· intro w hw hn
exact hu.2.2.2 w (mem_groundFormSubmodule.mp hw).1
(mem_groundFormSubmodule.mp hw).2 hn
· exact mem_groundFormSubmodule.mpr ⟨hv, hb⟩
theorem IsGroundVector.rayleigh {N : β„•} {L : Length} {a : ℝ}
{u : Jet N L} (hu : IsGroundVector N L a u) (v : Jet N L)
(hv : v ∈ dirichletDomain N L a) (hb : bosonic v.1) :
energy u * β€–v.1β€– ^ 2 ≀ energy v := by
exact Variational.rayleigh (groundFormSubmodule N L a) u
(fun w hw hn ↦ hu.2.2.2 w (mem_groundFormSubmodule.mp hw).1
(mem_groundFormSubmodule.mp hw).2 hn) v
(mem_groundFormSubmodule.mpr ⟨hv, hb⟩)
@[simp] lemma torusDistance_comm (L : Length) (x y : Torus L) :
torusDistance L x y = torusDistance L y x := by
simp only [torusDistance, dist_comm]
lemma allowed_iff_ne {N : β„•} {L : Length} {a : ℝ} {X : Configuration N L} :
X ∈ allowed N L a ↔ βˆ€ i j, i β‰  j β†’ a < torusDistance L (X i) (X j) := by
constructor
Β· intro h i j hij
rcases lt_or_gt_of_ne hij with hlt | hgt
Β· exact h i j hlt
Β· simpa only [torusDistance_comm] using h j i hgt
Β· intro h i j hij
exact h i j (ne_of_lt hij)
lemma allowed_permute {N : β„•} {L : Length} {a : ℝ}
(Οƒ : Equiv.Perm (Fin N)) (X : Configuration N L) :
permuteConfiguration Οƒ X ∈ allowed N L a ↔ X ∈ allowed N L a := by
simp only [allowed_iff_ne, permuteConfiguration]
constructor
Β· intro h i j hij
simpa using h (Οƒ.symm i) (Οƒ.symm j) (Οƒ.symm.injective.ne hij)
Β· intro h i j hij
exact h (Οƒ i) (Οƒ j) (Οƒ.injective.ne hij)
def permuteLift {N : β„•} (Οƒ : Equiv.Perm (Fin N)) :
LiftedConfiguration N ≃L[ℝ] LiftedConfiguration N where
toFun X := fun i ↦ X (Οƒ i)
invFun X := fun i ↦ X (Οƒ.symm i)
left_inv X := by funext i; simp
right_inv X := by funext i; simp
map_add' _ _ := rfl
map_smul' _ _ := rfl
continuous_toFun := continuous_pi fun _ ↦ continuous_apply _
continuous_invFun := continuous_pi fun _ ↦ continuous_apply _
lemma permuteLift_direction {N : β„•} (Οƒ : Equiv.Perm (Fin N)) (p : Direction N) :
permuteLift Οƒ (Pi.single p.1 (Pi.single p.2 1)) =
Pi.single (Οƒ.symm p.1) (Pi.single p.2 1) := by
ext i j
change (Pi.single p.1 (Pi.single p.2 (1 : ℝ)) : LiftedConfiguration N) (Οƒ i) j = _
by_cases h : i = Οƒ.symm p.1
Β· subst i; simp
Β· have h' : Οƒ i β‰  p.1 := fun hh ↦ h ((Equiv.eq_symm_apply Οƒ).mpr hh)
simp [Pi.single_eq_of_ne h, Pi.single_eq_of_ne h']
lemma coordDerivative_permute {N : β„•} {L : Length} {a : ℝ}
(f : SmoothTest N L a) (Οƒ : Equiv.Perm (Fin N)) (p : Direction N) :
coordDerivative N L (f.toFun ∘ permuteConfiguration Οƒ) p =
coordDerivative N L f.toFun (Οƒ.symm p.1, p.2) ∘ permuteConfiguration Οƒ := by
funext X
change (fderiv ℝ ((fun Y ↦ f.toFun (project N L Y)) ∘ permuteLift Οƒ)
(representative N L X)) (Pi.single p.1 (Pi.single p.2 1)) = _
rw [fderiv_comp _ (f.smooth.differentiable (by simp)).differentiableAt
(permuteLift Οƒ).differentiableAt, (permuteLift Οƒ).fderiv]
simp only [ContinuousLinearMap.comp_apply, ContinuousLinearEquiv.coe_coe,
permuteLift_direction]
rfl
def SmoothTest.permute {N : β„•} {L : Length} {a : ℝ}
(f : SmoothTest N L a) (Οƒ : Equiv.Perm (Fin N)) : SmoothTest N L a where
toFun := f.toFun ∘ permuteConfiguration Οƒ
smooth := f.smooth.comp (permuteLift Οƒ).contDiff
compact := HasCompactSupport.of_compactSpace _
support_allowed := by
intro X hX
apply (allowed_permute Οƒ X).mp
exact f.support_allowed
(tsupport_comp_subset_preimage (f := permuteConfiguration Οƒ) f.toFun (continuous_pi fun i ↦ continuous_apply (Οƒ i)) hX)
memLp := f.memLp.comp_measurePreserving (measurePreserving_permute Οƒ)
partial_memLp := by
intro p
rw [coordDerivative_permute]
exact (f.partial_memLp (Οƒ.symm p.1, p.2)).comp_measurePreserving
(measurePreserving_permute Οƒ)
section
attribute [local instance] scalarL2_addCommMonoid scalarL2_module
lemma continuous_permutationPullback_jet {N : β„•} {L : Length} (Οƒ : Equiv.Perm (Fin N)) :
Continuous (fun u : Jet N L ↦ (permutationPullback Οƒ u.1,
fun direction : Direction N ↦
permutationPullback Οƒ (u.2 (Οƒ.symm direction.1, direction.2)))) := by
let pullback : ScalarL2 N L β†’β‚—α΅’[β„‚] ScalarL2 N L :=
Lp.compMeasurePreservingβ‚—α΅’ β„‚ (permuteConfiguration Οƒ) (measurePreserving_permute Οƒ)
exact (pullback.continuous.comp continuous_fst).prodMk
(continuous_pi fun p ↦ pullback.continuous.comp ((continuous_apply _).comp continuous_snd))
def permutationJet {N : β„•} {L : Length} (Οƒ : Equiv.Perm (Fin N)) :
Jet N L β†’L[β„‚] Jet N L where
toFun u := (permutationPullback Οƒ u.1,
fun p ↦ permutationPullback Οƒ (u.2 (Οƒ.symm p.1, p.2)))
map_add' _ _ := by simp [map_add]; rfl
map_smul' _ _ := by simp [map_smul]; rfl
cont := continuous_permutationPullback_jet Οƒ
end
lemma SmoothTest.jet_permute {N : β„•} {L : Length} {a : ℝ}
(f : SmoothTest N L a) (Οƒ : Equiv.Perm (Fin N)) :
(f.permute Οƒ).jet = permutationJet Οƒ f.jet := by
apply Prod.ext
Β· apply Lp.ext
exact (MemLp.coeFn_toLp (f.permute Οƒ).memLp).trans
((Lp.coeFn_compMeasurePreserving f.jet.1 (measurePreserving_permute Οƒ)).trans
((measurePreserving_permute Οƒ).quasiMeasurePreserving.ae_eq_comp
(MemLp.coeFn_toLp f.memLp))).symm
Β· funext p
apply Lp.ext
have h := (measurePreserving_permute (L := L) Οƒ).quasiMeasurePreserving.ae_eq_comp
(MemLp.coeFn_toLp (f.partial_memLp (Οƒ.symm p.1, p.2)))
refine (MemLp.coeFn_toLp ((f.permute Οƒ).partial_memLp p)).trans ?_
change coordDerivative N L (f.toFun ∘ permuteConfiguration Οƒ) p =ᡐ[volume] _
rw [coordDerivative_permute]
exact ((Lp.coeFn_compMeasurePreserving _ (measurePreserving_permute Οƒ)).trans h).symm
lemma permutationJet_mem_domain {N : β„•} {L : Length} {a : ℝ}
(Οƒ : Equiv.Perm (Fin N)) {u : Jet N L} (hu : u ∈ dirichletDomain N L a) :
permutationJet Οƒ u ∈ dirichletDomain N L a := by
apply map_mem_closure (permutationJet Οƒ).continuous hu
rintro _ ⟨f, rfl⟩
exact ⟨f.permute Οƒ, f.jet_permute ΟƒβŸ©
lemma energy_permutationJet {N : β„•} {L : Length} (Οƒ : Equiv.Perm (Fin N))
(u : Jet N L) : energy (permutationJet Οƒ u) = energy u := by
change (βˆ‘ p : Direction N, β€–Lp.compMeasurePreserving _ (measurePreserving_permute Οƒ)
(u.2 (Οƒ.symm p.1, p.2))β€– ^ 2) = _
simp only [Lp.norm_compMeasurePreserving]
exact Equiv.sum_comp (Equiv.prodCongr Οƒ.symm (Equiv.refl (Fin 3)))
(fun p ↦ β€–u.2 pβ€– ^ 2)
end HardSphere
end
end OAI