From 4203b93717eecf870cf837267a03ed92343e1e0c Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Fri, 18 Apr 2025 17:58:12 +0200 Subject: [PATCH 01/32] Create PseudoRiemannian This PR is divided in 3 parts. Next is Riemannian Metric (with implementation) and then is Levi-Civita Connection --- PhysLean.lean | 1 + .../Metric/PseudoRiemannian/Defs.lean | 425 ++++++++++++++++++ 2 files changed, 426 insertions(+) create mode 100644 PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean diff --git a/PhysLean.lean b/PhysLean.lean index 40d56af17..2b111421d 100644 --- a/PhysLean.lean +++ b/PhysLean.lean @@ -15,6 +15,7 @@ import PhysLean.Mathematics.LinearMaps import PhysLean.Mathematics.List import PhysLean.Mathematics.List.InsertIdx import PhysLean.Mathematics.List.InsertionSort +import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Defs import PhysLean.Mathematics.PiTensorProduct import PhysLean.Mathematics.RatComplexNum import PhysLean.Mathematics.SO3.Basic diff --git a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean new file mode 100644 index 000000000..d4c5fead8 --- /dev/null +++ b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean @@ -0,0 +1,425 @@ +import Mathlib.Analysis.InnerProductSpace.Basic +import Mathlib.Geometry.Manifold.VectorBundle.SmoothSection +import Mathlib.LinearAlgebra.BilinearForm.Properties +import Mathlib.LinearAlgebra.QuadraticForm.Basic + +/-! +# Pseudo-Riemannian Metrics on Smooth Manifolds + +This file formalizes the fundamental notion of pseudo-Riemannian metrics on smooth manifolds +and establishes their basic properties. A pseudo-Riemannian metric equips a manifold with a +smoothly varying, non-degenerate, symmetric bilinear form on each tangent space, generalizing +the concept of an inner product space to curved spaces. + +## Main Definitions + +* `PseudoRiemannianMetric I n M`: A structure representing a `C^n` pseudo-Riemannian metric + on a manifold `M` modelled on `(E, H)` with model with corners `I`. It consists of a family + of non-degenerate, symmetric, continuous bilinear forms `gโ‚“` on each tangent space `Tโ‚“M`, + varying `C^n`-smoothly with `x`. The base field `๐•œ` is required to be `RCLike`, the model + space `E` must be finite-dimensional, and the manifold `M` must be `C^{n+1}` smooth. + +* `PseudoRiemannianMetric.flatEquiv g x`: The "musical isomorphism" from the tangent space at `x` + to its dual space, representing the canonical isomorphism induced by the metric. + +* `PseudoRiemannianMetric.sharpEquiv g x`: The inverse of the flat isomorphism, mapping from + the dual space back to the tangent space. + +## Implementation Notes + +* The bilinear form `gโ‚“` at a point `x` is represented as a `ContinuousLinearMap` + `val x : Tโ‚“M โ†’L[๐•œ] (Tโ‚“M โ†’L[๐•œ] ๐•œ)`. This curried form `v โ†ฆ (w โ†ฆ gโ‚“(v, w))` encodes both + the bilinear structure and its continuity. + +* Smoothness is defined by requiring that for any two `C^n` vector fields `X, Y`, the scalar + function `x โ†ฆ gโ‚“(X x, Y x)` is `C^n` smooth (`ContMDiff n`). + +* The manifold `M` must be `C^{n+1}` smooth (`IsManifold I (n + 1) M`) to ensure the tangent + bundle is a `C^n` vector bundle, making the notion of `C^n` vector fields well-defined. + +* Finite-dimensionality of the model space (`FiniteDimensional ๐•œ E`) guarantees that tangent + spaces are finite-dimensional, which is necessary for establishing that non-degeneracy implies + the existence of an isomorphism between the tangent space and its dual. +-/ + +section PseudoRiemannianMetric + +noncomputable section + +universe u v w + +open Bundle Set Function Filter Module Topology ContinuousLinearMap +open scoped Manifold Bundle LinearMap Dual + +/-- Convert a continuous linear map representing a bilinear form to a `LinearMap.BilinForm`. -/ +def ContinuousLinearMap.toBilinForm + {๐•œ E : Type*} [NontriviallyNormedField ๐•œ] [AddCommGroup E] [Module ๐•œ E] [TopologicalSpace E] + (f : E โ†’L[๐•œ] (E โ†’L[๐•œ] ๐•œ)) : LinearMap.BilinForm ๐•œ E := + LinearMap.mkโ‚‚ ๐•œ (fun v w => (f v) w) + (fun vโ‚ vโ‚‚ w => by dsimp; rw [f.map_add]; rfl) + (fun a v w => by dsimp; rw [f.map_smul]; rfl) + (fun v wโ‚ wโ‚‚ => by dsimp; rw [(f v).map_add];) + (fun a v w => (f v).map_smul a w) + +-- We use Real-like fields for InnerProductSpace in Riemannian Metric +variable {๐•œ : Type u} [RCLike ๐•œ] -- Stronger assumption for InnerProductSpace, implies NontriviallyNormedField +variable {E : Type v} [NormedAddCommGroup E] [NormedSpace ๐•œ E] [FiniteDimensional ๐•œ E] -- Requires finite dimension on the model space +variable {H : Type w} [TopologicalSpace H] -- Chart space +variable {M : Type w} [TopologicalSpace M] [ChartedSpace H M] [ChartedSpace H E] -- Manifold M and ChartedSpace for E +variable {I : ModelWithCorners ๐•œ E H} {n : WithTop โ„•โˆž} -- Model with corners and smoothness level + +/-- A pseudo-Riemannian metric of smoothness class `C^n` on a manifold `M` modelled on `(E, H)` + with model `I`. This structure defines a smoothly varying, non-degenerate, symmetric, + continuous bilinear form `gโ‚“` on the tangent space `Tโ‚“M` at each point `x`. + Requires `M` to be `C^{n+1}` smooth. +-/ +@[ext] +structure PseudoRiemannianMetric + (I : ModelWithCorners ๐•œ E H) (n : WithTop โ„•โˆž) + -- Instances ensuring the tangent bundle is a well-defined smooth vector bundle + [TopologicalSpace (TangentBundle I M)] + [FiberBundle E (TangentSpace I : M โ†’ Type _)] + [VectorBundle ๐•œ E (TangentSpace I : M โ†’ Type _)] + [IsManifold I (n + 1) M] -- Manifold is C^{n+1} + [ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] -- Tangent bundle is C^n + : Type (max u v w) where + /-- The metric tensor at each point `x : M`, represented as a continuous linear map + `Tโ‚“M โ†’L[๐•œ] (Tโ‚“M โ†’L[๐•œ] ๐•œ)`. Applying it twice, `(val x v) w`, yields `gโ‚“(v, w)`. -/ + protected val : โˆ€ (x : M), TangentSpace I x โ†’L[๐•œ] (TangentSpace I x โ†’L[๐•œ] ๐•œ) + /-- The metric is symmetric: `gโ‚“(v, w) = gโ‚“(w, v)`. -/ + protected symm : โˆ€ (x : M) (v w : TangentSpace I x), (val x v) w = (val x w) v + /-- The metric is non-degenerate: if `gโ‚“(v, w) = 0` for all `w`, then `v = 0`. -/ + protected nondegenerate : โˆ€ (x : M) (v : TangentSpace I x), (โˆ€ w : TangentSpace I x, (val x v) w = 0) โ†’ v = 0 + /-- The metric varies smoothly: `x โ†ฆ gโ‚“(Xโ‚“, Yโ‚“)` is a `C^n` function for `C^n` vector fields `X, Y`. -/ + protected smooth : โˆ€ (X Y : ContMDiffSection I E n (TangentSpace I)), + ContMDiff I (modelWithCornersSelf ๐•œ ๐•œ) n (fun x => val x (X x) (Y x)) + +namespace PseudoRiemannianMetric + +instance TangentSpace.addCommGroup (x : M) : AddCommGroup (TangentSpace I x) := by infer_instance +instance TangentSpace.module (x : M) : Module ๐•œ (TangentSpace I x) := by infer_instance + +/-- If two vector spaces are linearly equivalent, and one is finite-dimensional, + then so is the other. This version transfers the finite-dimensional property + via a continuous linear equivalence. -/ +lemma FiniteDimensional.of_equiv + {๐•œ : Type u} [RCLike ๐•œ] + {E : Type v} [AddCommGroup E] [Module ๐•œ E] [TopologicalSpace E] + {F : Type w} [AddCommGroup F] [Module ๐•œ F] [TopologicalSpace F] + [FiniteDimensional ๐•œ E] + (e : E โ‰ƒL[๐•œ] F) : FiniteDimensional ๐•œ F := + LinearEquiv.finiteDimensional e.toLinearEquiv + +/-- If two vector spaces are linearly equivalent, and one is finite-dimensional, + then so is the other. This version works with a linear equivalence. -/ +lemma FiniteDimensional.of_linearEquiv + {๐•œ : Type u} [RCLike ๐•œ] + {E : Type v} [AddCommGroup E] [Module ๐•œ E] + {F : Type w} [AddCommGroup F] [Module ๐•œ F] + [FiniteDimensional ๐•œ E] + (e : E โ‰ƒโ‚—[๐•œ] F) : FiniteDimensional ๐•œ F := by + exact Finite.equiv e + +lemma VectorBundle.finiteDimensional_fiber + (๐•œ : Type u) [RCLike ๐•œ] + {F : Type v} [NormedAddCommGroup F] [NormedSpace ๐•œ F] [FiniteDimensional ๐•œ F] + {B : Type w} [TopologicalSpace B] + {E_bundle : B โ†’ Type*} [โˆ€ x, AddCommGroup (E_bundle x)] [โˆ€ x, Module ๐•œ (E_bundle x)] + [TopologicalSpace (Bundle.TotalSpace F E_bundle)] + [โˆ€ x, TopologicalSpace (E_bundle x)] + [FiberBundle F E_bundle] [VectorBundle ๐•œ F E_bundle] + (x : B) : FiniteDimensional ๐•œ (E_bundle x) := + let triv := trivializationAt F E_bundle x + let hx := mem_baseSet_trivializationAt F E_bundle x + have h_linear : triv.IsLinear ๐•œ := VectorBundle.trivialization_linear' triv + haveI : triv.IsLinear ๐•œ := h_linear + let linear_equiv := triv.continuousLinearEquivAt ๐•œ x hx + FiniteDimensional.of_equiv linear_equiv.symm + +instance TangentSpace.finiteDimensional + [FiniteDimensional ๐•œ E] + [โˆ€ x : M, TopologicalSpace (TangentSpace I x)] + [TopologicalSpace (Bundle.TotalSpace E (TangentSpace I : M โ†’ Type _))] + [FiberBundle E (TangentSpace I : M โ†’ Type _)] + [VectorBundle ๐•œ E (TangentSpace I : M โ†’ Type _)] + (x : M) : + FiniteDimensional ๐•œ (TangentSpace I x) := + VectorBundle.finiteDimensional_fiber ๐•œ (F := E) (E_bundle := TangentSpace I) x + +variable + [inst_top : TopologicalSpace (TangentBundle I M)] + [inst_fib : FiberBundle E (TangentSpace I : M โ†’ Type _)] + [inst_vec : VectorBundle ๐•œ E (TangentSpace I : M โ†’ Type _)] + [inst_mani : IsManifold I (n + 1) M] + [inst_cmvb : ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] + +/-- Convert the continuous linear map representation `val x` to the algebraic `LinearMap.BilinForm`. + This is useful for leveraging lemmas about `BilinForm`. -/ +def toBilinForm + (g : @PseudoRiemannianMetric ๐•œ _ E _ _ H _ M _ _ I n inst_top + inst_fib inst_vec inst_mani inst_cmvb) (x : M) : + LinearMap.BilinForm ๐•œ (TangentSpace I x) := + (g.val x).toBilinForm + +/-- Coercion from PseudoRiemannianMetric to its function representation. -/ +instance : CoeFun (@PseudoRiemannianMetric ๐•œ _ E _ _ H _ M _ _ I n inst_top + inst_fib inst_vec inst_mani inst_cmvb) + (fun _ => โˆ€ x : M, TangentSpace I x โ†’L[๐•œ] (TangentSpace I x โ†’L[๐•œ] ๐•œ)) where + coe g := g.val + +omit [FiniteDimensional ๐•œ E] [ChartedSpace H E] in +@[simp] lemma toBilinForm_apply + (g : PseudoRiemannianMetric I n) (x : M) (v w : TangentSpace I x) : + g.toBilinForm x v w = g.val x v w := rfl + +omit [FiniteDimensional ๐•œ E] [ChartedSpace H E] in +@[simp] lemma toBilinForm_isSymm + (g : PseudoRiemannianMetric I n) (x : M) : (g.toBilinForm x).IsSymm := by + intro v w + simp only [toBilinForm_apply] + exact g.symm x v w + +omit [FiniteDimensional ๐•œ E] [ChartedSpace H E] in +@[simp] lemma toBilinForm_nondegenerate + (g : PseudoRiemannianMetric I n) (x : M) : + (g.toBilinForm x).Nondegenerate := by + intro v hv + simp_rw [toBilinForm_apply] at hv + exact g.nondegenerate x v hv + +omit [FiniteDimensional ๐•œ E] [ChartedSpace H E] in +lemma symm' + (g : PseudoRiemannianMetric I n) (x : M) (v w : TangentSpace I x) : + (g.val x v) w = (g.val x w) v := + g.symm x v w + +omit [FiniteDimensional ๐•œ E] [ChartedSpace H E] in +lemma nondegenerate' + (g : PseudoRiemannianMetric I n) (x : M) (v : TangentSpace I x) + (h : โˆ€ w : TangentSpace I x, (g.val x v) w = 0) : v = 0 := + g.nondegenerate x v h + +omit [FiniteDimensional ๐•œ E] [ChartedSpace H E] in +lemma smooth' + (g : @PseudoRiemannianMetric ๐•œ _ E _ _ H _ M _ _ I n inst_top + inst_fib inst_vec inst_mani inst_cmvb) (X Y : ContMDiffSection I E n (TangentSpace I)) : + ContMDiff I (modelWithCornersSelf ๐•œ ๐•œ) n (fun x => (g.val x (X x)) (Y x)) := + g.smooth X Y + +/-- Convert a pseudo-Riemannian metric at a point to a quadratic form. -/ +@[simp] def toQuadraticForm + (g : @PseudoRiemannianMetric ๐•œ _ E _ _ H _ M _ _ I n inst_top + inst_fib inst_vec inst_mani inst_cmvb) (x : M) : + QuadraticForm ๐•œ (TangentSpace I x) where + toFun v := g.val x v v + toFun_smul a v := by + simp only [ContinuousLinearMap.map_smul, ContinuousLinearMap.smul_apply, smul_smul, pow_two] + exists_companion' := + โŸจ LinearMap.mkโ‚‚ ๐•œ (fun v y => g.val x v y + g.val x y v) + (fun vโ‚ vโ‚‚ y => by -- Additivity in v + simp only [ContinuousLinearMap.map_add, ContinuousLinearMap.add_apply] + ring) + (fun a v y => by -- Homogeneity in v + simp only [ContinuousLinearMap.map_smul, ContinuousLinearMap.smul_apply] + ring_nf + exact Eq.symm (DistribSMul.smul_add a (((g.val x) v) y) (((g.val x) y) v))) + (fun v yโ‚ yโ‚‚ => by -- Additivity in y + simp only [ContinuousLinearMap.map_add, ContinuousLinearMap.add_apply] + ring) + (fun a v y => by -- Homogeneity in y + simp only [ContinuousLinearMap.map_smul, ContinuousLinearMap.smul_apply] + ring_nf + exact Eq.symm (DistribSMul.smul_add a (((g.val x) v) y) (((g.val x) y) v))), + by + intro v y + simp only [LinearMap.mkโ‚‚_apply, ContinuousLinearMap.map_add, + ContinuousLinearMap.add_apply, g.symm x] + ringโŸฉ + +omit [FiniteDimensional ๐•œ E] [ChartedSpace H E] in +lemma toQuadraticForm_apply + (g : PseudoRiemannianMetric I n) (x : M) (v : TangentSpace I x) : + g.toQuadraticForm x v = g.val x v v := rfl + +/-- The "musical" isomorphism (index lowering) from the tangent space to its dual, + induced by a pseudo-Riemannian metric. -/ +def flat + (g : @PseudoRiemannianMetric ๐•œ _ E _ _ H _ M _ _ I n inst_top + inst_fib inst_vec inst_mani inst_cmvb) (x : M) : + TangentSpace I x โ†’โ‚—[๐•œ] (TangentSpace I x โ†’L[๐•œ] ๐•œ) := + { toFun := ฮป v => g.val x v, + map_add' := ฮป v w => by simp only [ContinuousLinearMap.map_add], + map_smul' := ฮป a v => by simp only [ContinuousLinearMap.map_smul]; exact rfl } + +omit [FiniteDimensional ๐•œ E] [ChartedSpace H E] in +@[simp] lemma flat_apply + (g : PseudoRiemannianMetric I n) (x : M) (v w : TangentSpace I x) : + (g.flat x v) w = g.val x v w := rfl + +/-- The musical isomorphism as a continuous linear map. -/ +def flatL + (g : @PseudoRiemannianMetric ๐•œ _ E _ _ H _ M _ _ I n inst_top + inst_fib inst_vec inst_mani inst_cmvb) (x : M) : + TangentSpace I x โ†’L[๐•œ] (TangentSpace I x โ†’L[๐•œ] ๐•œ) := + { g.flat x with + cont := ContinuousLinearMap.continuous (g.val x) } + +omit [FiniteDimensional ๐•œ E] [ChartedSpace H E] in +@[simp] lemma flatL_apply + (g : PseudoRiemannianMetric I n) (x : M) (v w : TangentSpace I x) : + (g.flatL x v) w = g.val x v w := rfl + +omit [FiniteDimensional ๐•œ E] [ChartedSpace H E] in +/-- The linear map `flat` is injective due to non-degeneracy. -/ +@[simp] lemma flat_inj + (g : PseudoRiemannianMetric I n) (x : M) : + Function.Injective (g.flat x) := by + rw [โ† LinearMap.ker_eq_bot] + apply LinearMap.ker_eq_bot'.mpr + intro v hv + apply g.nondegenerate' x v + intro w + exact DFunLike.congr_fun hv w + +omit [FiniteDimensional ๐•œ E] [ChartedSpace H E] in +/-- The continuous linear map `flatL` is injective. -/ +@[simp] lemma flatL_inj + (g : PseudoRiemannianMetric I n) (x : M) : + Function.Injective (g.flatL x) := by + intro vโ‚ vโ‚‚ h + apply flat_inj g x + exact h + +omit [ChartedSpace H E] in +/-- The continuous linear map `flatL` is surjective because the tangent space is finite dimensional. -/ +@[simp] lemma flatL_surj + (g : PseudoRiemannianMetric I n) (x : M) : + Function.Surjective (g.flatL x) := by + haveI : FiniteDimensional ๐•œ (TangentSpace I x) := TangentSpace.finiteDimensional x + have h_finrank_eq : finrank ๐•œ (TangentSpace I x) = finrank ๐•œ (TangentSpace I x โ†’L[๐•œ] ๐•œ) := by + have h_dual_eq : finrank ๐•œ (TangentSpace I x โ†’L[๐•œ] ๐•œ) = finrank ๐•œ (Module.Dual ๐•œ (TangentSpace I x)) := by + let to_dual : (TangentSpace I x โ†’L[๐•œ] ๐•œ) โ†’ Module.Dual ๐•œ (TangentSpace I x) := fun f => f.toLinearMap + let from_dual : Module.Dual ๐•œ (TangentSpace I x) โ†’ (TangentSpace I x โ†’L[๐•œ] ๐•œ) := fun f => + ContinuousLinearMap.mk f (by + apply LinearMap.continuous_of_finiteDimensional) + let equiv : (TangentSpace I x โ†’L[๐•œ] ๐•œ) โ‰ƒโ‚—[๐•œ] Module.Dual ๐•œ (TangentSpace I x) := + { toFun := to_dual, + invFun := from_dual, + map_add' := fun f g => by + ext v; unfold to_dual; simp only [LinearMap.add_apply]; rfl, + map_smul' := fun c f => by + ext v; unfold to_dual; simp only [LinearMap.smul_apply]; rfl, + left_inv := fun f => by + ext v; unfold to_dual from_dual; simp, + right_inv := fun f => by + ext v; unfold to_dual from_dual; simp } + exact LinearEquiv.finrank_eq equiv + rw [h_dual_eq, โ† Subspace.dual_finrank_eq] + exact (LinearMap.injective_iff_surjective_of_finrank_eq_finrank h_finrank_eq).mp (flatL_inj g x) + +/-- The "musical" isomorphism (index lowering) from the tangent space to its dual, + as a continuous linear equivalence. -/ +@[simp] def flatEquiv + (g : @PseudoRiemannianMetric ๐•œ _ E _ _ H _ M _ _ I n inst_top + inst_fib inst_vec inst_mani inst_cmvb) + (x : M) : + TangentSpace I x โ‰ƒL[๐•œ] (TangentSpace I x โ†’L[๐•œ] ๐•œ) := + LinearEquiv.toContinuousLinearEquiv + (LinearEquiv.ofBijective + ((g.flatL x).toLinearMap) + โŸจg.flatL_inj x, g.flatL_surj xโŸฉ) + +omit [ChartedSpace H E] in +lemma coe_flatEquiv + (g : PseudoRiemannianMetric I n) (x : M) : + (g.flatEquiv x : TangentSpace I x โ†’โ‚—[๐•œ] (TangentSpace I x โ†’L[๐•œ] ๐•œ)) = g.flatL x := rfl + +omit [ChartedSpace H E] in +@[simp] lemma flatEquiv_apply + (g : PseudoRiemannianMetric I n) (x : M) (v w : TangentSpace I x) : + (g.flatEquiv x v) w = g.val x v w := rfl + +/-- The "musical" isomorphism (index raising) from the dual of the tangent space to the tangent space, + induced by a pseudo-Riemannian metric. This is the inverse of `flatEquiv`. -/ +def sharpEquiv + (g : @PseudoRiemannianMetric ๐•œ _ E _ _ H _ M _ _ I n inst_top + inst_fib inst_vec inst_mani inst_cmvb) (x : M) : + (TangentSpace I x โ†’L[๐•œ] ๐•œ) โ‰ƒL[๐•œ] TangentSpace I x := + (g.flatEquiv x).symm +#lint +/-- The index raising map `sharp` as a continuous linear map. -/ +def sharpL + (g : @PseudoRiemannianMetric ๐•œ _ E _ _ H _ M _ _ I n inst_top + inst_fib inst_vec inst_mani inst_cmvb) (x : M) : + (TangentSpace I x โ†’L[๐•œ] ๐•œ) โ†’L[๐•œ] TangentSpace I x := + (g.sharpEquiv x).toContinuousLinearMap + +omit [ChartedSpace H E] in +lemma sharpL_eq_toContinuousLinearMap + (g : PseudoRiemannianMetric I n) (x : M) : + g.sharpL x = (g.sharpEquiv x).toContinuousLinearMap := rfl + +omit [ChartedSpace H E] in +lemma coe_sharpEquiv + (g : PseudoRiemannianMetric I n) (x : M) : + (g.sharpEquiv x : (TangentSpace I x โ†’L[๐•œ] ๐•œ) โ†’L[๐•œ] TangentSpace I x) = g.sharpL x := rfl + +/-- The index raising map `sharp` as a linear map. -/ +noncomputable def sharp + (g : @PseudoRiemannianMetric ๐•œ _ E _ _ H _ M _ _ I n inst_top + inst_fib inst_vec inst_mani inst_cmvb) (x : M) : + (TangentSpace I x โ†’L[๐•œ] ๐•œ) โ†’โ‚—[๐•œ] TangentSpace I x := + (g.sharpEquiv x).toLinearEquiv.toLinearMap + +omit [ChartedSpace H E] in +@[simp] lemma sharpL_apply_flatL + (g : PseudoRiemannianMetric I n) (x : M) (v : TangentSpace I x) : + g.sharpL x (g.flatL x v) = v := + (g.flatEquiv x).left_inv v + +omit [ChartedSpace H E] in +@[simp] lemma flatL_apply_sharpL + (g : PseudoRiemannianMetric I n) (x : M) (ฯ‰ : TangentSpace I x โ†’L[๐•œ] ๐•œ) : + g.flatL x (g.sharpL x ฯ‰) = ฯ‰ := + (g.flatEquiv x).right_inv ฯ‰ + +omit [ChartedSpace H E] in +/-- Applying `sharp` then `flat` recovers the original covector. -/ +@[simp] lemma flat_sharp_apply + (g : PseudoRiemannianMetric I n) (x : M) (ฯ‰ : TangentSpace I x โ†’L[๐•œ] ๐•œ) : + g.flat x (g.sharp x ฯ‰) = ฯ‰ := by + -- Use the continuous versions and coerce + have := flatL_apply_sharpL g x ฯ‰ + -- Need to relate flat and flatL, sharp and sharpL + simp only [sharp, sharpL, flat, flatL, coe_flatEquiv]; simp only [coe_sharpEquiv, + ContinuousLinearEquiv.coe_coe, LinearEquiv.coe_coe] at this โŠข + exact this + +omit [ChartedSpace H E] in +@[simp] lemma sharp_flat_apply + (g : PseudoRiemannianMetric I n) (x : M) (v : TangentSpace I x) : + g.sharp x (g.flat x v) = v := by + -- Use the continuous versions and coerce + have := sharpL_apply_flatL g x v + simp only [sharp, sharpL, flat, flatL]; simp only [coe_flatEquiv, coe_sharpEquiv, + ContinuousLinearEquiv.coe_coe, LinearEquiv.coe_coe] at this โŠข + exact this + +omit [ChartedSpace H E] in +/-- The metric evaluated at `sharp ฯ‰โ‚` and `sharp ฯ‰โ‚‚`. -/ +@[simp] lemma apply_sharp_sharp + (g : PseudoRiemannianMetric I n) (x : M) (ฯ‰โ‚ ฯ‰โ‚‚ : TangentSpace I x โ†’L[๐•œ] ๐•œ) : + g.val x (g.sharpL x ฯ‰โ‚) (g.sharpL x ฯ‰โ‚‚) = ฯ‰โ‚ (g.sharpL x ฯ‰โ‚‚) := by + rw [โ† flatL_apply g x (g.sharpL x ฯ‰โ‚)] + rw [flatL_apply_sharpL g x ฯ‰โ‚] + +omit [ChartedSpace H E] in +/-- The metric evaluated at `v` and `sharp ฯ‰`. -/ +lemma apply_vec_sharp + (g : PseudoRiemannianMetric I n) (x : M) (v : TangentSpace I x) (ฯ‰ : TangentSpace I x โ†’L[๐•œ] ๐•œ) : + g.val x v (g.sharpL x ฯ‰) = ฯ‰ v := by + rw [g.symm' x v (g.sharpL x ฯ‰)] + rw [โ† flatL_apply g x (g.sharpL x ฯ‰)] + rw [flatL_apply_sharpL g x ฯ‰] + +end PseudoRiemannianMetric From 2341670f400e4dd3c5cf280f3cd6091b03772d43 Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Fri, 18 Apr 2025 18:10:17 +0200 Subject: [PATCH 02/32] Update Defs.lean --- .../Metric/PseudoRiemannian/Defs.lean | 40 ++++++++++++------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean index d4c5fead8..9be99a29a 100644 --- a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean @@ -1,3 +1,9 @@ +/- +Copyright (c) 2025 Matteo Cipollina. All rights reserved. -- Adjusted year +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Matteo Cipollina +-/ + import Mathlib.Analysis.InnerProductSpace.Basic import Mathlib.Geometry.Manifold.VectorBundle.SmoothSection import Mathlib.LinearAlgebra.BilinearForm.Properties @@ -62,10 +68,11 @@ def ContinuousLinearMap.toBilinForm (fun a v w => (f v).map_smul a w) -- We use Real-like fields for InnerProductSpace in Riemannian Metric -variable {๐•œ : Type u} [RCLike ๐•œ] -- Stronger assumption for InnerProductSpace, implies NontriviallyNormedField -variable {E : Type v} [NormedAddCommGroup E] [NormedSpace ๐•œ E] [FiniteDimensional ๐•œ E] -- Requires finite dimension on the model space +variable {๐•œ : Type u} [RCLike ๐•œ] -- Stronger assumption, implies NontriviallyNormedField +variable {E : Type v} [NormedAddCommGroup E] [NormedSpace ๐•œ E] [FiniteDimensional ๐•œ E] variable {H : Type w} [TopologicalSpace H] -- Chart space -variable {M : Type w} [TopologicalSpace M] [ChartedSpace H M] [ChartedSpace H E] -- Manifold M and ChartedSpace for E +-- Manifold M and ChartedSpace for E +variable {M : Type w} [TopologicalSpace M] [ChartedSpace H M] [ChartedSpace H E] variable {I : ModelWithCorners ๐•œ E H} {n : WithTop โ„•โˆž} -- Model with corners and smoothness level /-- A pseudo-Riemannian metric of smoothness class `C^n` on a manifold `M` modelled on `(E, H)` @@ -81,16 +88,18 @@ structure PseudoRiemannianMetric [FiberBundle E (TangentSpace I : M โ†’ Type _)] [VectorBundle ๐•œ E (TangentSpace I : M โ†’ Type _)] [IsManifold I (n + 1) M] -- Manifold is C^{n+1} - [ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] -- Tangent bundle is C^n - : Type (max u v w) where + [ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] : -- Tangent bundle is C^n + Type (max u v w) where /-- The metric tensor at each point `x : M`, represented as a continuous linear map `Tโ‚“M โ†’L[๐•œ] (Tโ‚“M โ†’L[๐•œ] ๐•œ)`. Applying it twice, `(val x v) w`, yields `gโ‚“(v, w)`. -/ protected val : โˆ€ (x : M), TangentSpace I x โ†’L[๐•œ] (TangentSpace I x โ†’L[๐•œ] ๐•œ) /-- The metric is symmetric: `gโ‚“(v, w) = gโ‚“(w, v)`. -/ protected symm : โˆ€ (x : M) (v w : TangentSpace I x), (val x v) w = (val x w) v /-- The metric is non-degenerate: if `gโ‚“(v, w) = 0` for all `w`, then `v = 0`. -/ - protected nondegenerate : โˆ€ (x : M) (v : TangentSpace I x), (โˆ€ w : TangentSpace I x, (val x v) w = 0) โ†’ v = 0 - /-- The metric varies smoothly: `x โ†ฆ gโ‚“(Xโ‚“, Yโ‚“)` is a `C^n` function for `C^n` vector fields `X, Y`. -/ + protected nondegenerate : โˆ€ (x : M) (v : TangentSpace I x), (โˆ€ w : TangentSpace I x, + (val x v) w = 0) โ†’ v = 0 + /-- The metric varies smoothly: `x โ†ฆ gโ‚“(Xโ‚“, Yโ‚“)` is a `C^n` function for `C^n` + vector fields `X, Y`. -/ protected smooth : โˆ€ (X Y : ContMDiffSection I E n (TangentSpace I)), ContMDiff I (modelWithCornersSelf ๐•œ ๐•œ) n (fun x => val x (X x) (Y x)) @@ -291,14 +300,17 @@ omit [FiniteDimensional ๐•œ E] [ChartedSpace H E] in exact h omit [ChartedSpace H E] in -/-- The continuous linear map `flatL` is surjective because the tangent space is finite dimensional. -/ +/-- The continuous linear map `flatL` is surjective because the tangent space is + finite dimensional. -/ @[simp] lemma flatL_surj (g : PseudoRiemannianMetric I n) (x : M) : Function.Surjective (g.flatL x) := by haveI : FiniteDimensional ๐•œ (TangentSpace I x) := TangentSpace.finiteDimensional x have h_finrank_eq : finrank ๐•œ (TangentSpace I x) = finrank ๐•œ (TangentSpace I x โ†’L[๐•œ] ๐•œ) := by - have h_dual_eq : finrank ๐•œ (TangentSpace I x โ†’L[๐•œ] ๐•œ) = finrank ๐•œ (Module.Dual ๐•œ (TangentSpace I x)) := by - let to_dual : (TangentSpace I x โ†’L[๐•œ] ๐•œ) โ†’ Module.Dual ๐•œ (TangentSpace I x) := fun f => f.toLinearMap + have h_dual_eq : finrank ๐•œ (TangentSpace I x โ†’L[๐•œ] ๐•œ) = finrank ๐•œ (Module.Dual ๐•œ + (TangentSpace I x)) := by + let to_dual : (TangentSpace I x โ†’L[๐•œ] ๐•œ) โ†’ Module.Dual ๐•œ (TangentSpace I x) := + fun f => f.toLinearMap let from_dual : Module.Dual ๐•œ (TangentSpace I x) โ†’ (TangentSpace I x โ†’L[๐•œ] ๐•œ) := fun f => ContinuousLinearMap.mk f (by apply LinearMap.continuous_of_finiteDimensional) @@ -339,8 +351,8 @@ omit [ChartedSpace H E] in (g : PseudoRiemannianMetric I n) (x : M) (v w : TangentSpace I x) : (g.flatEquiv x v) w = g.val x v w := rfl -/-- The "musical" isomorphism (index raising) from the dual of the tangent space to the tangent space, - induced by a pseudo-Riemannian metric. This is the inverse of `flatEquiv`. -/ +/-- The "musical" isomorphism (index raising) from the dual of the tangent space to the + tangent space, induced by a pseudo-Riemannian metric. This is the inverse of `flatEquiv`. -/ def sharpEquiv (g : @PseudoRiemannianMetric ๐•œ _ E _ _ H _ M _ _ I n inst_top inst_fib inst_vec inst_mani inst_cmvb) (x : M) : @@ -356,7 +368,7 @@ def sharpL omit [ChartedSpace H E] in lemma sharpL_eq_toContinuousLinearMap - (g : PseudoRiemannianMetric I n) (x : M) : + (g : PseudoRiemannianMetric I n) (x : M) : g.sharpL x = (g.sharpEquiv x).toContinuousLinearMap := rfl omit [ChartedSpace H E] in @@ -367,7 +379,7 @@ lemma coe_sharpEquiv /-- The index raising map `sharp` as a linear map. -/ noncomputable def sharp (g : @PseudoRiemannianMetric ๐•œ _ E _ _ H _ M _ _ I n inst_top - inst_fib inst_vec inst_mani inst_cmvb) (x : M) : + inst_fib inst_vec inst_mani inst_cmvb) (x : M) : (TangentSpace I x โ†’L[๐•œ] ๐•œ) โ†’โ‚—[๐•œ] TangentSpace I x := (g.sharpEquiv x).toLinearEquiv.toLinearMap From 8f44f6cbd24e5532fd971dabeef21710baecd375 Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Fri, 18 Apr 2025 18:10:58 +0200 Subject: [PATCH 03/32] Update Defs.lean --- .../Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean index 9be99a29a..1da391e6d 100644 --- a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean @@ -88,8 +88,8 @@ structure PseudoRiemannianMetric [FiberBundle E (TangentSpace I : M โ†’ Type _)] [VectorBundle ๐•œ E (TangentSpace I : M โ†’ Type _)] [IsManifold I (n + 1) M] -- Manifold is C^{n+1} - [ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] : -- Tangent bundle is C^n - Type (max u v w) where + -- Tangent bundle is C^n + [ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] : Type (max u v w) where /-- The metric tensor at each point `x : M`, represented as a continuous linear map `Tโ‚“M โ†’L[๐•œ] (Tโ‚“M โ†’L[๐•œ] ๐•œ)`. Applying it twice, `(val x v) w`, yields `gโ‚“(v, w)`. -/ protected val : โˆ€ (x : M), TangentSpace I x โ†’L[๐•œ] (TangentSpace I x โ†’L[๐•œ] ๐•œ) From 3f54c98f3c566434172a2f31a653ca4edf5e0f27 Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Fri, 18 Apr 2025 18:39:33 +0200 Subject: [PATCH 04/32] Update PhysLean.lean --- PhysLean.lean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PhysLean.lean b/PhysLean.lean index 2b111421d..ce57a3c4c 100644 --- a/PhysLean.lean +++ b/PhysLean.lean @@ -11,11 +11,11 @@ import PhysLean.Electromagnetism.LorentzAction import PhysLean.Electromagnetism.MaxwellEquations import PhysLean.Mathematics.Fin import PhysLean.Mathematics.Fin.Involutions +import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Defs import PhysLean.Mathematics.LinearMaps import PhysLean.Mathematics.List import PhysLean.Mathematics.List.InsertIdx import PhysLean.Mathematics.List.InsertionSort -import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Defs import PhysLean.Mathematics.PiTensorProduct import PhysLean.Mathematics.RatComplexNum import PhysLean.Mathematics.SO3.Basic From d9912f0f42b8fd84240d948d8e949f2ecb2bc5ad Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Fri, 18 Apr 2025 18:47:21 +0200 Subject: [PATCH 05/32] Update Completeness.lean --- .../OneDimension/HarmonicOscillator/Completeness.lean | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/PhysLean/QuantumMechanics/OneDimension/HarmonicOscillator/Completeness.lean b/PhysLean/QuantumMechanics/OneDimension/HarmonicOscillator/Completeness.lean index 236438539..f048524c6 100644 --- a/PhysLean/QuantumMechanics/OneDimension/HarmonicOscillator/Completeness.lean +++ b/PhysLean/QuantumMechanics/OneDimension/HarmonicOscillator/Completeness.lean @@ -124,9 +124,14 @@ lemma mul_power_integrable (f : โ„ โ†’ โ„‚) (hf : MemHS f) (r : โ„•) : suffices h2 : IsUnit (โ†‘((1/Q.ฮพ)^ r : โ„‚)) by rw [IsUnit.integrable_smul_iff h2] at h1 simpa using h1 - simp only [isUnit_iff_ne_zero, ne_eq, pow_eq_zero_iff', Complex.ofReal_eq_zero, not_and, - Decidable.not_not] - simp + simp only [isUnit_iff_ne_zero, ne_eq, pow_eq_zero_iff', Complex.ofReal_eq_zero] + intro h + cases h with + | intro h => + have h' : Q.ฮพ = 0 := by + simpa [one_div] using h + exact Q.ฮพ_pos.ne' h' + ยท simp only [ne_eq, Decidable.not_not] at hr subst hr simpa using Q.mul_physHermite_integrable f hf 0 From 74e85ec85bdb5f72c43e9d720dae985e58fa5495 Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Fri, 18 Apr 2025 18:48:18 +0200 Subject: [PATCH 06/32] Update Defs.lean --- PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean index 1da391e6d..c82f74683 100644 --- a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean @@ -1,5 +1,5 @@ /- -Copyright (c) 2025 Matteo Cipollina. All rights reserved. -- Adjusted year +Copyright (c) 2025 Matteo Cipollina. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Matteo Cipollina -/ From c9d5940c5732d78e7c46f17ef5e499bbd29d5c54 Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Thu, 24 Apr 2025 10:46:22 +0200 Subject: [PATCH 07/32] Create Riemannian TODO: add InnerProductSpace to complete the section --- PhysLean.lean | 1 + .../Geometry/Metric/Riemannian/Defs.lean | 235 ++++++++++++++++++ .../Metric/PseudoRiemannian/Defs.lean | 171 +++++++++++++ 3 files changed, 407 insertions(+) create mode 100644 PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean create mode 100644 PhysLean/Relativity/Metric/PseudoRiemannian/Defs.lean diff --git a/PhysLean.lean b/PhysLean.lean index ce57a3c4c..e9d0b975b 100644 --- a/PhysLean.lean +++ b/PhysLean.lean @@ -12,6 +12,7 @@ import PhysLean.Electromagnetism.MaxwellEquations import PhysLean.Mathematics.Fin import PhysLean.Mathematics.Fin.Involutions import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Defs +import PhysLean.Mathematics.Geometry.Metric.Riemannian.Defs import PhysLean.Mathematics.LinearMaps import PhysLean.Mathematics.List import PhysLean.Mathematics.List.InsertIdx diff --git a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean new file mode 100644 index 000000000..21b8b5e86 --- /dev/null +++ b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean @@ -0,0 +1,235 @@ +/- +Copyright (c) 2025 Matteo Cipollina. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Matteo Cipollina +-/ + +import Mathlib.LinearAlgebra.QuadraticForm.Dual +import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Defs + +/-! +# Riemannian Metrics on Manifolds + +/-! +This file introduces `RiemannianMetric`, a smooth positiveโ€definite specialization of +`PseudoRiemannianMetric` over โ„. It requires that each bilinear form `gโ‚“` satisfy +`gโ‚“(v,v) > 0` for nonzero tangent vectors `v`, and uses this to define the canonical +inner product, norm, and distance on each tangent space. (TODO: assemble these +data into an `InnerProductSpace โ„ (TangentSpace I_โ„ x)` instance). +-/ + +## Main Definitions + +* `RiemannianMetric I n M`: A structure representing a `C^n` Riemannian metric on a manifold `M` + modelled on `(E_โ„, H_โ„)` with model `I_โ„`. This specializes `PseudoRiemannianMetric` to the + case where the base field is `โ„` and requires the bilinear form `gโ‚“` at each point `x` to be + positive-definite. +* `RiemannianMetric.inner g x`: The inner product (bilinear form `gโ‚“`) on the tangent space `Tโ‚“M`. +* `RiemannianMetric.sharp g x`: The musical isomorphism (index raising) from the cotangent space + `T*โ‚“M` to the tangent space `Tโ‚“M`, which is an isomorphism in the Riemannian case due to + positive definiteness. +* `RiemannianMetric.toQuadraticForm g x`: Expresses the metric at point `x` as a quadratic form. + +## Implementation Notes + +* Extends `PseudoRiemannianMetric` by fixing the base field to `โ„` and adding the `pos_def'` + field, ensuring `gโ‚“(v, v) > 0` for non-zero `v`. +* The positive definiteness allows defining an `InnerProductSpace โ„ (Tโ‚“M)` instance on each + tangent space `Tโ‚“M`. +-/ +universe u v w + +open PseudoRiemannianMetric Bundle ContinuousLinearMap + +noncomputable section + +variable {E_โ„ : Type v} [NormedAddCommGroup E_โ„] [NormedSpace โ„ E_โ„] [FiniteDimensional โ„ E_โ„] +variable {H_โ„ : Type w} [TopologicalSpace H_โ„] +variable {M_โ„ : Type w} [TopologicalSpace M_โ„] [ChartedSpace H_โ„ M_โ„] [ChartedSpace H_โ„ E_โ„] + +/-- A Riemannian metric of smoothness class `n` on a manifold `M` over `โ„`. + This extends a pseudo-Riemannian metric with the positive definiteness condition. -/ +@[ext] +structure RiemannianMetric + (I_โ„ : ModelWithCorners โ„ E_โ„ H_โ„) + (n : WithTop โ„•โˆž) + [inst_top : TopologicalSpace (TangentBundle I_โ„ M_โ„)] + [inst_fib : FiberBundle E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _)] + [inst_vec : VectorBundle โ„ E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _)] + [inst_mani : IsManifold I_โ„ (n + 1) M_โ„] + [inst_cmvb : ContMDiffVectorBundle n E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _) I_โ„] + extends @PseudoRiemannianMetric โ„ Real.instRCLike E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib + inst_vec inst_mani inst_cmvb where + /-- `gโ‚“(v, v) > 0` for all nonzero `v`. -/ + pos_def' : โˆ€ x v, v โ‰  0 โ†’ val x v v > 0 + + +namespace RiemannianMetric + +-- Propagate instance assumptions +variable {I_โ„ : ModelWithCorners โ„ E_โ„ H_โ„} {n : WithTop โ„•โˆž} +variable [inst_top : TopologicalSpace (TangentBundle I_โ„ M_โ„)] +variable [inst_fib : FiberBundle E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _)] +variable [inst_vec : VectorBundle โ„ E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _)] +variable [inst_mani : IsManifold I_โ„ (n + 1) M_โ„] +variable [inst_cmvb : ContMDiffVectorBundle n E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _) I_โ„] + +/-- Coercion from RiemannianMetric to its underlying PseudoRiemannianMetric. -/ +instance : Coe (@RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani + inst_cmvb) + (@PseudoRiemannianMetric โ„ Real.instRCLike E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top + inst_fib inst_vec inst_mani inst_cmvb) where + coe g := g.toPseudoRiemannianMetric + +omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in +@[simp] lemma pos_def (g : RiemannianMetric I_โ„ n) (x : M_โ„) (v : TangentSpace I_โ„ x) (hv : v โ‰  0) : + (g.toPseudoRiemannianMetric.val x v) v > 0 := g.pos_def' x v hv + +/-- The inverse of the musical isomorphism (index raising), which is an isomorphism + in the Riemannian case. This is well-defined because the metric is positive definite. -/ +def sharp + (g : (@RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani + inst_cmvb)) (x : M_โ„) : + Module.Dual โ„ (TangentSpace I_โ„ x) โ‰ƒโ‚—[โ„] TangentSpace I_โ„ x := + let bilin := g.toPseudoRiemannianMetric.toBilinForm x + have h_nondeg : bilin.Nondegenerate := + g.toPseudoRiemannianMetric.toBilinForm_nondegenerate x + LinearEquiv.symm (bilin.toDual h_nondeg) + +/-- Express a Riemannian metric at a point as a quadratic form. -/ +abbrev toQuadraticForm + (g : (@RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani + inst_cmvb)) + (x : M_โ„) : + QuadraticForm โ„ (TangentSpace I_โ„ x) := + g.toPseudoRiemannianMetric.toQuadraticForm x + +omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in +/-- The quadratic form associated with a Riemannian metric is positive definite. -/ +lemma toQuadraticForm_posDef (g : RiemannianMetric I_โ„ n) (x : M_โ„) : + (g.toQuadraticForm x).PosDef := + ฮป v hv => g.pos_def x v hv + +omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in +/-- The application of a Riemannian metric's quadratic form to a vector. -/ +lemma toQuadraticForm_apply (g : RiemannianMetric I_โ„ n) (x : M_โ„) + (v : TangentSpace I_โ„ x) : + g.toQuadraticForm x v = g.val x v v := by + simp only [toQuadraticForm, PseudoRiemannianMetric.toQuadraticForm_apply] + +omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in +/-- A positive definite quadratic form is nondegenerate. -/ +lemma posDef_to_nondegenerate [Invertible (2 : โ„)] + (g : RiemannianMetric I_โ„ n) (x : M_โ„) : + (QuadraticMap.associated (R := โ„) (N := โ„) (g.toQuadraticForm x)).Nondegenerate := by + let Q := g.toQuadraticForm x + let B := QuadraticMap.associated (R := โ„) (N := โ„) Q + constructor + ยท intro v h_all_zero_w + specialize h_all_zero_w v + have h_assoc_self : B v v = Q v := + QuadraticMap.associated_eq_self_apply โ„ Q v + rw [h_assoc_self] at h_all_zero_w + by_cases h_v_zero : v = 0 + ยท exact h_v_zero + ยท have h_quad_pos : Q v > 0 := g.pos_def x v h_v_zero + linarith [h_all_zero_w, h_quad_pos] + ยท intro w h_all_zero_v + specialize h_all_zero_v w + have h_assoc_self : B w w = Q w := + QuadraticMap.associated_eq_self_apply โ„ Q w + rw [h_assoc_self] at h_all_zero_v + by_cases h_w_zero : w = 0 + ยท exact h_w_zero + ยท have h_quad_pos : Q w > 0 := g.pos_def x w h_w_zero + linarith [h_all_zero_v, h_quad_pos] + +/-- The isometry between `(Q.prod <| -Q)` and `QuadraticForm.dualProd`, + where `Q` is the quadratic form associated with the Riemannian metric at `x`. -/ +abbrev toDualProdIso [Invertible (2 : โ„)] (g : RiemannianMetric I_โ„ n) (x : M_โ„) : + ((g.toQuadraticForm x).prod <| -(g.toQuadraticForm x)) โ†’qแตข + (QuadraticForm.dualProd โ„ (TangentSpace I_โ„ x)) := + QuadraticForm.toDualProd (g.toQuadraticForm x) + +/-- The inner product on the tangent space at point `x` induced by the Riemannian metric `g`. -/ +def inner + (g : (@RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani + inst_cmvb)) (x : M_โ„) (v w : TangentSpace I_โ„ x) : โ„ := + g.toPseudoRiemannianMetric.val x v w + +omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in +@[simp] lemma inner_apply (g : RiemannianMetric I_โ„ n) (x : M_โ„) (v w : TangentSpace I_โ„ x) : + inner g x v w = g.val x v w := rfl + +variable (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n _ _ _ _ _) (x : M_โ„) + +omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in +/-- Pointwise symmetry of the inner product. -/ +lemma inner_symm (v w : TangentSpace I_โ„ x) : + g.inner x v w = g.inner x w v := by + simp only [inner_apply] + exact g.toPseudoRiemannianMetric.symm' x v w + +/-- The inner product space core for the tangent space at a point, derived from the +Riemannian metric. -/ +noncomputable def tangentInnerCore + (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani inst_cmvb) + (x : M_โ„) : + InnerProductSpace.Core โ„ (TangentSpace I_โ„ x) where + inner := ฮป v w => g.inner x v w + conj_symm := ฮป v w => by + simp only [inner_apply, conj_trivial] + exact g.toPseudoRiemannianMetric.symm' x w v + nonneg_re := ฮป v => by + simp only [inner_apply, RCLike.re_to_real] + by_cases hv : v = 0 + ยท simp [hv, inner_apply, map_zero, zero_apply] + ยท exact le_of_lt (g.pos_def x v hv) + add_left := ฮป u v w => by + simp only [inner_apply, map_add, add_apply] + smul_left := ฮป r u v => by + simp only [inner_apply, map_smul, smul_apply, conj_trivial] + rfl + definite := fun v (h_inner_zero : g.inner x v v = 0) => by + by_contra h_v_ne_zero + have h_pos : g.inner x v v > 0 := g.pos_def x v h_v_ne_zero + linarith [h_inner_zero, h_pos] + +/-! ### Inner product space structure. -/ + +/-- Normed additive commutative group structure on the tangent space at a point `x`, +derived from the Riemannian metric `g`. -/ +noncomputable def TangentSpace.metricNormedAddCommGroup + (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani inst_cmvb) + (x : M_โ„) : + NormedAddCommGroup (TangentSpace I_โ„ x) := + @InnerProductSpace.Core.toNormedAddCommGroup โ„ (TangentSpace I_โ„ x) _ _ _ (tangentInnerCore g x) + +/-- The pre-inner product space core for the tangent space at a point, +derived from the Riemannian metric. -/ +noncomputable def tangentPreInnerCore + (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani inst_cmvb) + (x : M_โ„) : + PreInnerProductSpace.Core โ„ (TangentSpace I_โ„ x) where + inner := ฮป v w => g.inner x v w + conj_symm := ฮป v w => by + simp only [inner_apply, conj_trivial] + exact g.toPseudoRiemannianMetric.symm' x w v + nonneg_re := ฮป v => by + simp only [inner_apply, RCLike.re_to_real] + by_cases hv : v = 0 + ยท simp [hv, inner_apply, map_zero, zero_apply] + ยท exact le_of_lt (g.pos_def x v hv) + add_left := ฮป u v w => by + simp only [inner_apply, map_add, add_apply] + smul_left := ฮป r u v => by + simp only [inner_apply, map_smul, smul_apply, conj_trivial] + rfl + +/-- Each tangent space carries a seminormed add comm group structure derived from +the Riemannian metric -/ +noncomputable def TangentSpace.metricSeminormedAddCommGroup + (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani inst_cmvb) + (x : M_โ„) : + SeminormedAddCommGroup (TangentSpace I_โ„ x) := + (TangentSpace.metricNormedAddCommGroup g x).toSeminormedAddCommGroup diff --git a/PhysLean/Relativity/Metric/PseudoRiemannian/Defs.lean b/PhysLean/Relativity/Metric/PseudoRiemannian/Defs.lean new file mode 100644 index 000000000..dd81704d1 --- /dev/null +++ b/PhysLean/Relativity/Metric/PseudoRiemannian/Defs.lean @@ -0,0 +1,171 @@ +/- Lean 4 code -/ +import Mathlib.Geometry.Manifold.VectorBundle.Tangent +import Mathlib.Algebra.Module.Basic +import Mathlib.Geometry.Manifold.Instances.Real +import Mathlib.Geometry.Manifold.ContMDiffMap +import Mathlib.Geometry.Manifold.VectorBundle.SmoothSection +import Mathlib.LinearAlgebra.FiniteDimensional +import Mathlib.LinearAlgebra.BilinearForm.Properties +import Mathlib.Topology.Connected.Basic +import Mathlib.Geometry.Manifold.VectorBundle.Basic +import Mathlib.Geometry.Manifold.ContMDiff.Basic +import Mathlib.Analysis.Calculus.ContDiff.Basic +import Mathlib.Topology.FiberBundle.Basic +import Mathlib.Algebra.Module.LinearMap.Defs +import Mathlib.LinearAlgebra.Dual -- Needed for Module.Dual +import Mathlib.LinearAlgebra.BilinearForm.Basic +import Mathlib.Geometry.Manifold.VectorBundle.Hom +import Mathlib.Geometry.Manifold.IsManifold.Basic +import Mathlib.Analysis.Calculus.ContDiff.FiniteDimension +import Mathlib.Topology.Algebra.Module.LinearMap +import Mathlib.Topology.VectorBundle.Constructions -- Added for VectorBundle.dual +import Mathlib.LinearAlgebra.FiniteDimensional.Defs +import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic + + +--section PseudoRiemannianMetric + +universe u v w + +open Bundle Set Function Filter Module -- Added Module to open namespaces +open scoped Manifold Topology Bundle LinearMap.dualMap + +abbrev contMDiff_linear {๐•œ : Type u} [NontriviallyNormedField ๐•œ] + {E : Type v} [NormedAddCommGroup E] [NormedSpace ๐•œ E] + {F : Type w} [NormedAddCommGroup F] [NormedSpace ๐•œ F] + (f : E โ†’L[๐•œ] F) {n : โ„•โˆž} : + ContMDiff ๐“˜(๐•œ, E) ๐“˜(๐•œ, F) n f := + f.contDiff.contMDiff + +variable {๐•œ : Type u} [NontriviallyNormedField ๐•œ] +variable {E : Type v} [NormedAddCommGroup E] [NormedSpace ๐•œ E] [FiniteDimensional ๐•œ E] +variable {H : Type w} [TopologicalSpace H] +variable {M : Type w} [TopologicalSpace M] [ChartedSpace H M] + +/-- A pseudo-Riemannian metric of smoothness class `n` on a manifold `M`. + This structure separates the smoothness parameter from the context to allow + composition of structures with different smoothness requirements. -/ +@[ext] +structure PseudoRiemannianMetric + {๐•œ : Type u} [NontriviallyNormedField ๐•œ] + {E : Type v} [NormedAddCommGroup E] [NormedSpace ๐•œ E] + {H : Type w} [TopologicalSpace H] + {M : Type w} [TopologicalSpace M] + [ChartedSpace H M] -- Removed [ChartedSpace H E] as it seemed incorrect + (I : ModelWithCorners ๐•œ E H) + (n : WithTop โ„•โˆž) + -- Now list instances depending on I and n + -- Ensure necessary instances for TangentBundle are available + -- These instances are typically inferred when M is a manifold. + [TopologicalSpace (TangentBundle I M)] + [FiberBundle E (TangentSpace I : M โ†’ Type _)] -- Use explicit type family + [VectorBundle ๐•œ E (TangentSpace I : M โ†’ Type _)] -- Use explicit type family + -- Add IsManifold and ContMDiffVectorBundle constraints here + -- Require IsManifold I (n + 1) M to ensure ContMDiffVectorBundle n can be inferred + [IsManifold I (n + 1) M] -- Removed name h_manifold + [ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] -- Removed name h_contMDiffVec + : Type (max u v w) where + /-- The metric as a function on tangent vectors, providing a bilinear form at each point. -/ + val : โˆ€ (x : M), LinearMap.BilinForm ๐•œ (TangentSpace I x) + /-- The metric is symmetric: g(v,w) = g(w,v) for all tangent vectors v, w. -/ + symm : โˆ€ (x : M), (val x).IsSymm + /-- The metric is non-degenerate: if g(v,w) = 0 for all w, then v = 0. -/ + nondegenerate : โˆ€ (x : M), (val x).Nondegenerate + /-- The metric is smooth of class `n`: it varies smoothly across the manifold when applied to + smooth vector fields. -/ + smooth : โˆ€ (X Y : Cโ‚›^nโŸฎI; E, (TangentSpace I : M โ†’ Type _)โŸฏ), -- Use explicit type family + ContMDiff I (modelWithCornersSelf ๐•œ ๐•œ) n (ฮป x => val x (X x) (Y x)) + +namespace PseudoRiemannianMetric + +--variable [FiniteDimensional ๐•œ E] + +-- Define the model fiber for bilinear forms +@[nolint unusedArguments] +abbrev ModelBilinForm (_๐•œ E : Type*) [NontriviallyNormedField _๐•œ] [NormedAddCommGroup E] [NormedSpace _๐•œ E] : Type _ := + E โ†’L[_๐•œ] (E โ†’L[_๐•œ] _๐•œ) + +-- Define the bundle of continuous bilinear forms on the tangent bundle +-- The fiber at x is the space of continuous linear maps from TangentSpace I x to its continuous dual. +@[nolint unusedArguments] +def TangentBilinFormBundle (๐•œ : Type u) [NontriviallyNormedField ๐•œ] + {E : Type v} [NormedAddCommGroup E] [NormedSpace ๐•œ E] + {H : Type w} [TopologicalSpace H] + {M : Type w} [TopologicalSpace M] [ChartedSpace H M] + (I : ModelWithCorners ๐•œ E H) + -- Instances ensuring TangentSpace I x is a normed space and the bundle structure exists + [TopologicalSpace (TangentBundle I M)] + [FiberBundle E (TangentSpace I : M โ†’ Type _)] + [VectorBundle ๐•œ E (TangentSpace I : M โ†’ Type _)] : M โ†’ Type _ := + fun x => TangentSpace I x โ†’L[๐•œ] (TangentSpace I x โ†’L[๐•œ] ๐•œ) + +/-- The fibers of a vector bundle are finite-dimensional if the model fiber is finite-dimensional. -/ +noncomputable def VectorBundle.finiteDimensional_fiber + (๐•œ : Type u) [NontriviallyNormedField ๐•œ] + {F : Type v} [NormedAddCommGroup F] [NormedSpace ๐•œ F] [FiniteDimensional ๐•œ F] + {B : Type w} [TopologicalSpace B] + {E : B โ†’ Type*} [โˆ€ x, AddCommGroup (E x)] [โˆ€ x, Module ๐•œ (E x)] + [TopologicalSpace (Bundle.TotalSpace F E)] + [โˆ€ x, TopologicalSpace (E x)] + [FiberBundle F E] + [VectorBundle ๐•œ F E] + (x : B) : + FiniteDimensional ๐•œ (E x) := + -- Get a trivialization at `x` from the FiberBundle atlas + let triv := trivializationAt F E x + -- Get the fact that x is in the base set + let hx := mem_baseSet_trivializationAt F E x + -- Obtain linear property through the vector bundle structure + have h_linear : triv.IsLinear ๐•œ := by + apply VectorBundle.trivialization_linear' + -- Register linearity as an instance + haveI : triv.IsLinear ๐•œ := h_linear + -- Get the linear equivalence between the fiber E x and the model fiber F + let linear_equiv := triv.continuousLinearEquivAt ๐•œ x hx + -- Transfer the finite-dimensionality from F to E x via the linear equivalence + have : FiniteDimensional ๐•œ (E x) := + LinearEquiv.finiteDimensional linear_equiv.symm.toLinearEquiv + this + +-- Instance providing FiniteDimensional for tangent spaces, needed for VectorBundle.dual +-- Require the VectorBundle instance explicitly as an argument +noncomputable instance TangentSpace.finiteDimensional + (๐•œ : Type u) [NontriviallyNormedField ๐•œ] + {E : Type v} [NormedAddCommGroup E] [NormedSpace ๐•œ E] [FiniteDimensional ๐•œ E] -- Model Fiber E + {H : Type w} [TopologicalSpace H] + {M : Type w} [TopologicalSpace M] [ChartedSpace H M] + (I : ModelWithCorners ๐•œ E H) + -- Add SmoothManifoldWithCorners instance, which implies the bundle structures + [IsManifold I โŠค M] -- Specify smoothness level, e.g., C^infinity + (x : M) : + FiniteDimensional ๐•œ (TangentSpace I x) := + -- The fibers of a vector bundle with a finite-dimensional model fiber are finite-dimensional. + -- The FiberBundle and VectorBundle instances are inferred from IsManifold I โŠค M. + VectorBundle.finiteDimensional_fiber ๐•œ (F := E) (E := TangentSpace I) x + +-- Instance for the dual bundle (VectorBundle) +section DualBundle + variable (๐•œ : Type u) [NontriviallyNormedField ๐•œ] + {E : Type v} [NormedAddCommGroup E] [NormedSpace ๐•œ E] [FiniteDimensional ๐•œ E] + {H : Type w} [TopologicalSpace H] + {M : Type w} [TopologicalSpace M] [ChartedSpace H M] -- Explicitly require ChartedSpace + (I : ModelWithCorners ๐•œ E H) + [IsManifold I โŠค M] -- This requires ChartedSpace H M and provides TangentBundle structure + + -- Define the dual bundle type family + abbrev TangentDualFiber (x : M) := TangentSpace I x โ†’L[๐•œ] ๐•œ + -- Define the model fiber for the dual bundle + abbrev TangentDualModelFiber := E โ†’L[๐•œ] ๐•œ + + -- Explicitly provide instances for the dual model fiber + noncomputable instance : NormedAddCommGroup (E โ†’L[๐•œ] ๐•œ) := inferInstance + noncomputable instance : NormedSpace ๐•œ (E โ†’L[๐•œ] ๐•œ) := inferInstance + -- Finite dimensionality of the dual model fiber requires FiniteDimensional ๐•œ E + noncomputable instance : FiniteDimensional ๐•œ (E โ†’L[๐•œ] ๐•œ) := inferInstance + +-- Instance for the trivial vector bundle M ร— ๐•œ needed for continuousLinearMap + noncomputable instance TrivialBundleInstance : VectorBundle ๐•œ ๐•œ (fun _ : M => ๐•œ) := + Bundle.Trivial.vectorBundle ๐•œ M ๐•œ + +end DualBundle +end PseudoRiemannianMetric From cd65b2500e13d09c607dde9ee994888162d955b5 Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Thu, 24 Apr 2025 11:00:18 +0200 Subject: [PATCH 08/32] Delete Defs.lean --- .../Metric/PseudoRiemannian/Defs.lean | 171 ------------------ 1 file changed, 171 deletions(-) delete mode 100644 PhysLean/Relativity/Metric/PseudoRiemannian/Defs.lean diff --git a/PhysLean/Relativity/Metric/PseudoRiemannian/Defs.lean b/PhysLean/Relativity/Metric/PseudoRiemannian/Defs.lean deleted file mode 100644 index dd81704d1..000000000 --- a/PhysLean/Relativity/Metric/PseudoRiemannian/Defs.lean +++ /dev/null @@ -1,171 +0,0 @@ -/- Lean 4 code -/ -import Mathlib.Geometry.Manifold.VectorBundle.Tangent -import Mathlib.Algebra.Module.Basic -import Mathlib.Geometry.Manifold.Instances.Real -import Mathlib.Geometry.Manifold.ContMDiffMap -import Mathlib.Geometry.Manifold.VectorBundle.SmoothSection -import Mathlib.LinearAlgebra.FiniteDimensional -import Mathlib.LinearAlgebra.BilinearForm.Properties -import Mathlib.Topology.Connected.Basic -import Mathlib.Geometry.Manifold.VectorBundle.Basic -import Mathlib.Geometry.Manifold.ContMDiff.Basic -import Mathlib.Analysis.Calculus.ContDiff.Basic -import Mathlib.Topology.FiberBundle.Basic -import Mathlib.Algebra.Module.LinearMap.Defs -import Mathlib.LinearAlgebra.Dual -- Needed for Module.Dual -import Mathlib.LinearAlgebra.BilinearForm.Basic -import Mathlib.Geometry.Manifold.VectorBundle.Hom -import Mathlib.Geometry.Manifold.IsManifold.Basic -import Mathlib.Analysis.Calculus.ContDiff.FiniteDimension -import Mathlib.Topology.Algebra.Module.LinearMap -import Mathlib.Topology.VectorBundle.Constructions -- Added for VectorBundle.dual -import Mathlib.LinearAlgebra.FiniteDimensional.Defs -import Mathlib.Analysis.NormedSpace.OperatorNorm.Basic - - ---section PseudoRiemannianMetric - -universe u v w - -open Bundle Set Function Filter Module -- Added Module to open namespaces -open scoped Manifold Topology Bundle LinearMap.dualMap - -abbrev contMDiff_linear {๐•œ : Type u} [NontriviallyNormedField ๐•œ] - {E : Type v} [NormedAddCommGroup E] [NormedSpace ๐•œ E] - {F : Type w} [NormedAddCommGroup F] [NormedSpace ๐•œ F] - (f : E โ†’L[๐•œ] F) {n : โ„•โˆž} : - ContMDiff ๐“˜(๐•œ, E) ๐“˜(๐•œ, F) n f := - f.contDiff.contMDiff - -variable {๐•œ : Type u} [NontriviallyNormedField ๐•œ] -variable {E : Type v} [NormedAddCommGroup E] [NormedSpace ๐•œ E] [FiniteDimensional ๐•œ E] -variable {H : Type w} [TopologicalSpace H] -variable {M : Type w} [TopologicalSpace M] [ChartedSpace H M] - -/-- A pseudo-Riemannian metric of smoothness class `n` on a manifold `M`. - This structure separates the smoothness parameter from the context to allow - composition of structures with different smoothness requirements. -/ -@[ext] -structure PseudoRiemannianMetric - {๐•œ : Type u} [NontriviallyNormedField ๐•œ] - {E : Type v} [NormedAddCommGroup E] [NormedSpace ๐•œ E] - {H : Type w} [TopologicalSpace H] - {M : Type w} [TopologicalSpace M] - [ChartedSpace H M] -- Removed [ChartedSpace H E] as it seemed incorrect - (I : ModelWithCorners ๐•œ E H) - (n : WithTop โ„•โˆž) - -- Now list instances depending on I and n - -- Ensure necessary instances for TangentBundle are available - -- These instances are typically inferred when M is a manifold. - [TopologicalSpace (TangentBundle I M)] - [FiberBundle E (TangentSpace I : M โ†’ Type _)] -- Use explicit type family - [VectorBundle ๐•œ E (TangentSpace I : M โ†’ Type _)] -- Use explicit type family - -- Add IsManifold and ContMDiffVectorBundle constraints here - -- Require IsManifold I (n + 1) M to ensure ContMDiffVectorBundle n can be inferred - [IsManifold I (n + 1) M] -- Removed name h_manifold - [ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] -- Removed name h_contMDiffVec - : Type (max u v w) where - /-- The metric as a function on tangent vectors, providing a bilinear form at each point. -/ - val : โˆ€ (x : M), LinearMap.BilinForm ๐•œ (TangentSpace I x) - /-- The metric is symmetric: g(v,w) = g(w,v) for all tangent vectors v, w. -/ - symm : โˆ€ (x : M), (val x).IsSymm - /-- The metric is non-degenerate: if g(v,w) = 0 for all w, then v = 0. -/ - nondegenerate : โˆ€ (x : M), (val x).Nondegenerate - /-- The metric is smooth of class `n`: it varies smoothly across the manifold when applied to - smooth vector fields. -/ - smooth : โˆ€ (X Y : Cโ‚›^nโŸฎI; E, (TangentSpace I : M โ†’ Type _)โŸฏ), -- Use explicit type family - ContMDiff I (modelWithCornersSelf ๐•œ ๐•œ) n (ฮป x => val x (X x) (Y x)) - -namespace PseudoRiemannianMetric - ---variable [FiniteDimensional ๐•œ E] - --- Define the model fiber for bilinear forms -@[nolint unusedArguments] -abbrev ModelBilinForm (_๐•œ E : Type*) [NontriviallyNormedField _๐•œ] [NormedAddCommGroup E] [NormedSpace _๐•œ E] : Type _ := - E โ†’L[_๐•œ] (E โ†’L[_๐•œ] _๐•œ) - --- Define the bundle of continuous bilinear forms on the tangent bundle --- The fiber at x is the space of continuous linear maps from TangentSpace I x to its continuous dual. -@[nolint unusedArguments] -def TangentBilinFormBundle (๐•œ : Type u) [NontriviallyNormedField ๐•œ] - {E : Type v} [NormedAddCommGroup E] [NormedSpace ๐•œ E] - {H : Type w} [TopologicalSpace H] - {M : Type w} [TopologicalSpace M] [ChartedSpace H M] - (I : ModelWithCorners ๐•œ E H) - -- Instances ensuring TangentSpace I x is a normed space and the bundle structure exists - [TopologicalSpace (TangentBundle I M)] - [FiberBundle E (TangentSpace I : M โ†’ Type _)] - [VectorBundle ๐•œ E (TangentSpace I : M โ†’ Type _)] : M โ†’ Type _ := - fun x => TangentSpace I x โ†’L[๐•œ] (TangentSpace I x โ†’L[๐•œ] ๐•œ) - -/-- The fibers of a vector bundle are finite-dimensional if the model fiber is finite-dimensional. -/ -noncomputable def VectorBundle.finiteDimensional_fiber - (๐•œ : Type u) [NontriviallyNormedField ๐•œ] - {F : Type v} [NormedAddCommGroup F] [NormedSpace ๐•œ F] [FiniteDimensional ๐•œ F] - {B : Type w} [TopologicalSpace B] - {E : B โ†’ Type*} [โˆ€ x, AddCommGroup (E x)] [โˆ€ x, Module ๐•œ (E x)] - [TopologicalSpace (Bundle.TotalSpace F E)] - [โˆ€ x, TopologicalSpace (E x)] - [FiberBundle F E] - [VectorBundle ๐•œ F E] - (x : B) : - FiniteDimensional ๐•œ (E x) := - -- Get a trivialization at `x` from the FiberBundle atlas - let triv := trivializationAt F E x - -- Get the fact that x is in the base set - let hx := mem_baseSet_trivializationAt F E x - -- Obtain linear property through the vector bundle structure - have h_linear : triv.IsLinear ๐•œ := by - apply VectorBundle.trivialization_linear' - -- Register linearity as an instance - haveI : triv.IsLinear ๐•œ := h_linear - -- Get the linear equivalence between the fiber E x and the model fiber F - let linear_equiv := triv.continuousLinearEquivAt ๐•œ x hx - -- Transfer the finite-dimensionality from F to E x via the linear equivalence - have : FiniteDimensional ๐•œ (E x) := - LinearEquiv.finiteDimensional linear_equiv.symm.toLinearEquiv - this - --- Instance providing FiniteDimensional for tangent spaces, needed for VectorBundle.dual --- Require the VectorBundle instance explicitly as an argument -noncomputable instance TangentSpace.finiteDimensional - (๐•œ : Type u) [NontriviallyNormedField ๐•œ] - {E : Type v} [NormedAddCommGroup E] [NormedSpace ๐•œ E] [FiniteDimensional ๐•œ E] -- Model Fiber E - {H : Type w} [TopologicalSpace H] - {M : Type w} [TopologicalSpace M] [ChartedSpace H M] - (I : ModelWithCorners ๐•œ E H) - -- Add SmoothManifoldWithCorners instance, which implies the bundle structures - [IsManifold I โŠค M] -- Specify smoothness level, e.g., C^infinity - (x : M) : - FiniteDimensional ๐•œ (TangentSpace I x) := - -- The fibers of a vector bundle with a finite-dimensional model fiber are finite-dimensional. - -- The FiberBundle and VectorBundle instances are inferred from IsManifold I โŠค M. - VectorBundle.finiteDimensional_fiber ๐•œ (F := E) (E := TangentSpace I) x - --- Instance for the dual bundle (VectorBundle) -section DualBundle - variable (๐•œ : Type u) [NontriviallyNormedField ๐•œ] - {E : Type v} [NormedAddCommGroup E] [NormedSpace ๐•œ E] [FiniteDimensional ๐•œ E] - {H : Type w} [TopologicalSpace H] - {M : Type w} [TopologicalSpace M] [ChartedSpace H M] -- Explicitly require ChartedSpace - (I : ModelWithCorners ๐•œ E H) - [IsManifold I โŠค M] -- This requires ChartedSpace H M and provides TangentBundle structure - - -- Define the dual bundle type family - abbrev TangentDualFiber (x : M) := TangentSpace I x โ†’L[๐•œ] ๐•œ - -- Define the model fiber for the dual bundle - abbrev TangentDualModelFiber := E โ†’L[๐•œ] ๐•œ - - -- Explicitly provide instances for the dual model fiber - noncomputable instance : NormedAddCommGroup (E โ†’L[๐•œ] ๐•œ) := inferInstance - noncomputable instance : NormedSpace ๐•œ (E โ†’L[๐•œ] ๐•œ) := inferInstance - -- Finite dimensionality of the dual model fiber requires FiniteDimensional ๐•œ E - noncomputable instance : FiniteDimensional ๐•œ (E โ†’L[๐•œ] ๐•œ) := inferInstance - --- Instance for the trivial vector bundle M ร— ๐•œ needed for continuousLinearMap - noncomputable instance TrivialBundleInstance : VectorBundle ๐•œ ๐•œ (fun _ : M => ๐•œ) := - Bundle.Trivial.vectorBundle ๐•œ M ๐•œ - -end DualBundle -end PseudoRiemannianMetric From e603d8e7f5c14a71d102851752186e6d5bd827ce Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Tue, 29 Apr 2025 01:33:03 +0200 Subject: [PATCH 09/32] Update PseudoRiemannian and Riemannian smoothness is now defined locally as a predicate added constant index condition (cfr O'Neill 'Semi-Riemannian Geometry p 54,55) Removed RCLike as it should not be needed for general relativity or QFT InnerProductSpace is defined locally instead of as a global instance --- .../Metric/PseudoRiemannian/Defs.lean | 604 +++++++++--------- .../Geometry/Metric/Riemannian/Defs.lean | 281 ++++---- .../Geometry/Metric/Riemannian/DefsOrig.lean | 235 +++++++ 3 files changed, 666 insertions(+), 454 deletions(-) create mode 100644 PhysLean/Mathematics/Geometry/Metric/Riemannian/DefsOrig.lean diff --git a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean index c82f74683..9ecbb1b6c 100644 --- a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean @@ -5,25 +5,31 @@ Authors: Matteo Cipollina -/ import Mathlib.Analysis.InnerProductSpace.Basic -import Mathlib.Geometry.Manifold.VectorBundle.SmoothSection +import Mathlib.Analysis.RCLike.Lemmas +import Mathlib.Geometry.Manifold.MFDeriv.Defs +import Mathlib.Geometry.Manifold.VectorBundle.Basic import Mathlib.LinearAlgebra.BilinearForm.Properties -import Mathlib.LinearAlgebra.QuadraticForm.Basic +import Mathlib.LinearAlgebra.QuadraticForm.Real +import Mathlib.Topology.LocallyConstant.Basic /-! # Pseudo-Riemannian Metrics on Smooth Manifolds -This file formalizes the fundamental notion of pseudo-Riemannian metrics on smooth manifolds -and establishes their basic properties. A pseudo-Riemannian metric equips a manifold with a -smoothly varying, non-degenerate, symmetric bilinear form on each tangent space, generalizing -the concept of an inner product space to curved spaces. +This file formalizes pseudo-Riemannian metrics on smooth manifolds and establishes their basic +properties. + +A pseudo-Riemannian metric equips a manifold with a smoothly varying, non-degenerate, symmetric +bilinear form of *constant index* on each tangent space, generalizing the concept of an inner +product space to curved spaces. The index here refers to `QuadraticForm.negDim`, the dimension +of a maximal negative definite subspace. ## Main Definitions -* `PseudoRiemannianMetric I n M`: A structure representing a `C^n` pseudo-Riemannian metric +* `PseudoRiemannianMetric E H M n I`: A structure representing a `C^n` pseudo-Riemannian metric on a manifold `M` modelled on `(E, H)` with model with corners `I`. It consists of a family of non-degenerate, symmetric, continuous bilinear forms `gโ‚“` on each tangent space `Tโ‚“M`, - varying `C^n`-smoothly with `x`. The base field `๐•œ` is required to be `RCLike`, the model - space `E` must be finite-dimensional, and the manifold `M` must be `C^{n+1}` smooth. + varying `C^n`-smoothly with `x` and having a locally constant negative dimension (`negDim`). + The model space `E` must be finite-dimensional, and the manifold `M` must be `C^{n+1}` smooth. * `PseudoRiemannianMetric.flatEquiv g x`: The "musical isomorphism" from the tangent space at `x` to its dual space, representing the canonical isomorphism induced by the metric. @@ -31,21 +37,8 @@ the concept of an inner product space to curved spaces. * `PseudoRiemannianMetric.sharpEquiv g x`: The inverse of the flat isomorphism, mapping from the dual space back to the tangent space. -## Implementation Notes - -* The bilinear form `gโ‚“` at a point `x` is represented as a `ContinuousLinearMap` - `val x : Tโ‚“M โ†’L[๐•œ] (Tโ‚“M โ†’L[๐•œ] ๐•œ)`. This curried form `v โ†ฆ (w โ†ฆ gโ‚“(v, w))` encodes both - the bilinear structure and its continuity. - -* Smoothness is defined by requiring that for any two `C^n` vector fields `X, Y`, the scalar - function `x โ†ฆ gโ‚“(X x, Y x)` is `C^n` smooth (`ContMDiff n`). - -* The manifold `M` must be `C^{n+1}` smooth (`IsManifold I (n + 1) M`) to ensure the tangent - bundle is a `C^n` vector bundle, making the notion of `C^n` vector fields well-defined. - -* Finite-dimensionality of the model space (`FiniteDimensional ๐•œ E`) guarantees that tangent - spaces are finite-dimensional, which is necessary for establishing that non-degeneracy implies - the existence of an isomorphism between the tangent space and its dual. +* `PseudoRiemannianMetric.toQuadraticForm g x`: The quadratic form `v โ†ฆ gโ‚“(v, v)` associated + with the metric at point `x`. -/ section PseudoRiemannianMetric @@ -54,267 +47,325 @@ noncomputable section universe u v w -open Bundle Set Function Filter Module Topology ContinuousLinearMap +open Bundle Set Finset Function Filter Module Topology ContinuousLinearMap open scoped Manifold Bundle LinearMap Dual -/-- Convert a continuous linear map representing a bilinear form to a `LinearMap.BilinForm`. -/ -def ContinuousLinearMap.toBilinForm - {๐•œ E : Type*} [NontriviallyNormedField ๐•œ] [AddCommGroup E] [Module ๐•œ E] [TopologicalSpace E] - (f : E โ†’L[๐•œ] (E โ†’L[๐•œ] ๐•œ)) : LinearMap.BilinForm ๐•œ E := - LinearMap.mkโ‚‚ ๐•œ (fun v w => (f v) w) - (fun vโ‚ vโ‚‚ w => by dsimp; rw [f.map_add]; rfl) - (fun a v w => by dsimp; rw [f.map_smul]; rfl) - (fun v wโ‚ wโ‚‚ => by dsimp; rw [(f v).map_add];) - (fun a v w => (f v).map_smul a w) - --- We use Real-like fields for InnerProductSpace in Riemannian Metric -variable {๐•œ : Type u} [RCLike ๐•œ] -- Stronger assumption, implies NontriviallyNormedField -variable {E : Type v} [NormedAddCommGroup E] [NormedSpace ๐•œ E] [FiniteDimensional ๐•œ E] -variable {H : Type w} [TopologicalSpace H] -- Chart space --- Manifold M and ChartedSpace for E -variable {M : Type w} [TopologicalSpace M] [ChartedSpace H M] [ChartedSpace H E] -variable {I : ModelWithCorners ๐•œ E H} {n : WithTop โ„•โˆž} -- Model with corners and smoothness level +namespace QuadraticForm + +variable {K : Type*} [Field K] [LinearOrder K] + +/-- The negative dimension (or index) of a quadratic form is the dimension + of a maximal negative definite subspace. -/ +noncomputable def negDim {E : Type*} [AddCommGroup E] + [Module โ„ E] [FiniteDimensional โ„ E] + (q : QuadraticForm โ„ E) : โ„• := + by + classical + let P : (Fin (finrank โ„ E) โ†’ SignType) โ†’ Prop := fun w => + QuadraticMap.Equivalent q (QuadraticMap.weightedSumSquares โ„ fun i => (w i : โ„)) + let h_exists : โˆƒ w, P w := QuadraticForm.equivalent_signType_weighted_sum_squared q + let w := Classical.choose h_exists + exact Finset.card (Finset.filter (fun i => w i = SignType.neg) Finset.univ) + +/-- The i-th standard basis vector has a 1 in the i-th position. -/ +lemma Pi.basisFun_apply_same {๐•œ ฮน : Type*} [Field ๐•œ] [Fintype ฮน] [DecidableEq ฮน] (i : ฮน) : + (Pi.basisFun ๐•œ ฮน) i i = 1 := by + simp only [Pi.basisFun_apply, Pi.single_eq_same] + +/-- The i-th standard basis vector has 0 in all positions j โ‰  i. -/ +lemma Pi.basisFun_apply_ne {๐•œ ฮน : Type*} [Field ๐•œ] [Fintype ฮน] [DecidableEq ฮน] (i j : ฮน) (h : j โ‰  i) : + (Pi.basisFun ๐•œ ฮน) i j = 0 := by + simp only [Pi.basisFun_apply, Pi.single_eq_of_ne h] + +/-- For a standard basis vector in a weighted sum of squares, only one term in the sum is nonzero. -/ +lemma QuadraticMap.weightedSumSquares_basis_vector {E : Type*} [AddCommGroup E] + [Module โ„ E] {weights : Fin (finrank โ„ E) โ†’ โ„} + {i : Fin (finrank โ„ E)} (v : Fin (finrank โ„ E) โ†’ โ„) + (hv : โˆ€ j, v j = if j = i then 1 else 0) : + QuadraticMap.weightedSumSquares โ„ weights v = weights i := by + simp only [QuadraticMap.weightedSumSquares_apply] + rw [Finset.sum_eq_single i] + ยท simp only [hv i, โ†“reduceIte, mul_one, smul_eq_mul] + ยท intro j _ hj + simp only [hv j, if_neg hj, mul_zero, smul_eq_mul] + ยท simp only [Finset.mem_univ, not_true_eq_false, smul_eq_mul, mul_eq_zero, or_self, + IsEmpty.forall_iff] + +/-- When a quadratic form is equivalent to a weighted sum of squares, + negative weights correspond to vectors where the form takes negative values. -/ +lemma neg_weight_implies_neg_value {E : Type*} [AddCommGroup E] [Module โ„ E] + {q : QuadraticForm โ„ E} {w : Fin (finrank โ„ E) โ†’ SignType} + (h_equiv : QuadraticMap.Equivalent q (QuadraticMap.weightedSumSquares โ„ fun i => (w i : โ„))) + {i : Fin (finrank โ„ E)} (hi : w i = SignType.neg) : + โˆƒ v : E, v โ‰  0 โˆง q v < 0 := by + let f := Classical.choice h_equiv + let v_std : Fin (finrank โ„ E) โ†’ โ„ := fun j => if j = i then 1 else 0 + let v := f.symm v_std + have hv_ne_zero : v โ‰  0 := by + intro h + have : f v = f 0 := by rw [h] + have : f (f.symm v_std) = f 0 := by rw [โ† this] + have : v_std = 0 := by + rw [โ† f.apply_symm_apply v_std] + exact Eq.trans this (map_zero f) + have : v_std i = 0 := by rw [this]; rfl + simp only [โ†“reduceIte, one_ne_zero, v_std] at this + have hq_neg : q v < 0 := by + have heq : q v = QuadraticMap.weightedSumSquares โ„ (fun j => (w j : โ„)) v_std := + QuadraticMap.IsometryEquiv.map_app f.symm v_std + have hw : QuadraticMap.weightedSumSquares โ„ (fun j => (w j : โ„)) v_std = (w i : โ„) := by + apply QuadraticMap.weightedSumSquares_basis_vector v_std + intro j; simp only [v_std] + rw [heq, hw] + have : (w i : โ„) = -1 := by simp only [hi, SignType.neg_eq_neg_one, SignType.coe_neg, + SignType.coe_one, v_std] + rw [this] + exact neg_one_lt_zero + exact โŸจv, hv_ne_zero, hq_negโŸฉ + +/-- A positive definite quadratic form cannot have any negative weights + in its diagonal representation. -/ +lemma posDef_no_neg_weights {E : Type*} [AddCommGroup E] [Module โ„ E] + {q : QuadraticForm โ„ E} (hq : q.PosDef) + {w : Fin (finrank โ„ E) โ†’ SignType} + (h_equiv : QuadraticMap.Equivalent q (QuadraticMap.weightedSumSquares โ„ fun i => (w i : โ„))) : + โˆ€ i, w i โ‰  SignType.neg := by + intro i hi + obtain โŸจv, hv_ne_zero, hq_negโŸฉ := QuadraticForm.neg_weight_implies_neg_value h_equiv hi + have hq_pos : 0 < q v := hq v hv_ne_zero + exact lt_asymm hq_neg hq_pos + +/-- For a positive definite quadratic form, the negative dimension (index) is zero. -/ +theorem rankNeg_eq_zero {E : Type*} [AddCommGroup E] + [Module โ„ E] [FiniteDimensional โ„ E] {q : QuadraticForm โ„ E} (hq : q.PosDef) : + q.negDim = 0 := by + haveI : Invertible (2 : โ„) := inferInstance + unfold QuadraticForm.negDim + have h_exists := equivalent_signType_weighted_sum_squared q + let w := Classical.choose h_exists + have h_equiv : QuadraticMap.Equivalent q (QuadraticMap.weightedSumSquares โ„ fun i => (w i : โ„)) := + Classical.choose_spec h_exists + have h_no_neg : โˆ€ i, w i โ‰  SignType.neg := + QuadraticForm.posDef_no_neg_weights hq h_equiv + simp [Finset.card_eq_zero, Finset.filter_eq_empty_iff, h_no_neg] + exact fun โฆƒxโฆ„ => h_no_neg x + +end QuadraticForm + +/-- Helper function to convert the metric tensor at `x` to a quadratic form. -/ +private def PseudoRiemannianMetricValToQuadraticForm + {E : Type v} [NormedAddCommGroup E] [NormedSpace โ„ E] + {H : Type w} [TopologicalSpace H] + {M : Type w} [TopologicalSpace M] [ChartedSpace H M] + {I : ModelWithCorners โ„ E H} + (val : โˆ€ (x : M), TangentSpace I x โ†’L[โ„] (TangentSpace I x โ†’L[โ„] โ„)) + (symm : โˆ€ (x : M) (v w : TangentSpace I x), (val x v) w = (val x w) v) + (x : M) : QuadraticForm โ„ (TangentSpace I x) where + toFun v := val x v v + toFun_smul a v := by + simp only [ContinuousLinearMap.map_smul, ContinuousLinearMap.smul_apply, smul_smul, pow_two] + exists_companion' := + โŸจ LinearMap.mkโ‚‚ โ„ (fun v y => val x v y + val x y v) + (fun vโ‚ vโ‚‚ y => by simp only [map_add, add_apply]; ring) + (fun a v y => by simp only [map_smul, smul_apply]; ring_nf; exact Eq.symm (smul_add ..)) + (fun v yโ‚ yโ‚‚ => by simp only [map_add, add_apply]; ring) + (fun a v y => by simp only [map_smul, smul_apply]; ring_nf; exact Eq.symm (smul_add ..)), + by + intro v y + simp only [LinearMap.mkโ‚‚_apply, ContinuousLinearMap.map_add, + ContinuousLinearMap.add_apply, symm x] + ringโŸฉ /-- A pseudo-Riemannian metric of smoothness class `C^n` on a manifold `M` modelled on `(E, H)` with model `I`. This structure defines a smoothly varying, non-degenerate, symmetric, - continuous bilinear form `gโ‚“` on the tangent space `Tโ‚“M` at each point `x`. - Requires `M` to be `C^{n+1}` smooth. --/ + continuous bilinear form `gโ‚“` of constant negative dimension on the tangent space `Tโ‚“M` + at each point `x`. Requires `M` to be `C^{n+1}` smooth.-/ @[ext] structure PseudoRiemannianMetric - (I : ModelWithCorners ๐•œ E H) (n : WithTop โ„•โˆž) - -- Instances ensuring the tangent bundle is a well-defined smooth vector bundle - [TopologicalSpace (TangentBundle I M)] - [FiberBundle E (TangentSpace I : M โ†’ Type _)] - [VectorBundle ๐•œ E (TangentSpace I : M โ†’ Type _)] - [IsManifold I (n + 1) M] -- Manifold is C^{n+1} - -- Tangent bundle is C^n - [ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] : Type (max u v w) where + (E : Type v) (H : Type w) (M : Type w) (n : WithTop โ„•โˆž) + [inst_norm_grp_E : NormedAddCommGroup E] + [inst_norm_sp_E : NormedSpace โ„ E] + [inst_findim_E : FiniteDimensional โ„ E] + [inst_top_H : TopologicalSpace H] + [inst_top_M : TopologicalSpace M] + [inst_chart_M : ChartedSpace H M] + [inst_chart_E : ChartedSpace H E] + (I : ModelWithCorners โ„ E H) + [inst_mani : IsManifold I (n + 1) M] + [inst_total_top : TopologicalSpace (TotalSpace E (TangentSpace I : M โ†’ Type _))] + [inst_fb : FiberBundle E (TangentSpace I : M โ†’ Type _)] + [inst_vb : VectorBundle โ„ E (TangentSpace I : M โ†’ Type _)] + [inst_cmvb : ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] + [inst_tangent_findim : โˆ€ (x : M), FiniteDimensional โ„ (TangentSpace I x)] : + Type (max u v w) where /-- The metric tensor at each point `x : M`, represented as a continuous linear map - `Tโ‚“M โ†’L[๐•œ] (Tโ‚“M โ†’L[๐•œ] ๐•œ)`. Applying it twice, `(val x v) w`, yields `gโ‚“(v, w)`. -/ - protected val : โˆ€ (x : M), TangentSpace I x โ†’L[๐•œ] (TangentSpace I x โ†’L[๐•œ] ๐•œ) + `Tโ‚“M โ†’L[โ„] (Tโ‚“M โ†’L[โ„] โ„)`. Applying it twice, `(val x v) w`, yields `gโ‚“(v, w)`. -/ + protected val : โˆ€ (x : M), TangentSpace I x โ†’L[โ„] (TangentSpace I x โ†’L[โ„] โ„) /-- The metric is symmetric: `gโ‚“(v, w) = gโ‚“(w, v)`. -/ protected symm : โˆ€ (x : M) (v w : TangentSpace I x), (val x v) w = (val x w) v /-- The metric is non-degenerate: if `gโ‚“(v, w) = 0` for all `w`, then `v = 0`. -/ protected nondegenerate : โˆ€ (x : M) (v : TangentSpace I x), (โˆ€ w : TangentSpace I x, (val x v) w = 0) โ†’ v = 0 - /-- The metric varies smoothly: `x โ†ฆ gโ‚“(Xโ‚“, Yโ‚“)` is a `C^n` function for `C^n` - vector fields `X, Y`. -/ - protected smooth : โˆ€ (X Y : ContMDiffSection I E n (TangentSpace I)), - ContMDiff I (modelWithCornersSelf ๐•œ ๐•œ) n (fun x => val x (X x) (Y x)) + /-- The metric varies smoothly: Expressed in local coordinates via any chart `e`, the function + `y โ†ฆ g_{e.symm y}(mfderiv I I e.symm y v, mfderiv I I e.symm y w)` is `C^n` smooth on the + chart's target `e.target` for any constant vectors `v, w` in the model space `E`. -/ + protected smooth_in_charts' : โˆ€ (xโ‚€ : M) (v w : E), + let e := extChartAt I xโ‚€ + ContDiffWithinAt โ„ n + (fun y => val (e.symm y) (mfderiv I I e.symm y v) (mfderiv I I e.symm y w)) + (e.target) (e xโ‚€) + /-- The negative dimension (`QuadraticForm.negDim`) of the metric's quadratic form is + locally constant. On a connected manifold, this implies it is constant globally. -/ + protected negDim_isLocallyConstant : + IsLocallyConstant (fun x : M => + have : FiniteDimensional โ„ (TangentSpace I x) := inferInstance + (PseudoRiemannianMetricValToQuadraticForm val symm x).negDim) namespace PseudoRiemannianMetric -instance TangentSpace.addCommGroup (x : M) : AddCommGroup (TangentSpace I x) := by infer_instance -instance TangentSpace.module (x : M) : Module ๐•œ (TangentSpace I x) := by infer_instance - -/-- If two vector spaces are linearly equivalent, and one is finite-dimensional, - then so is the other. This version transfers the finite-dimensional property - via a continuous linear equivalence. -/ -lemma FiniteDimensional.of_equiv - {๐•œ : Type u} [RCLike ๐•œ] - {E : Type v} [AddCommGroup E] [Module ๐•œ E] [TopologicalSpace E] - {F : Type w} [AddCommGroup F] [Module ๐•œ F] [TopologicalSpace F] - [FiniteDimensional ๐•œ E] - (e : E โ‰ƒL[๐•œ] F) : FiniteDimensional ๐•œ F := - LinearEquiv.finiteDimensional e.toLinearEquiv - -/-- If two vector spaces are linearly equivalent, and one is finite-dimensional, - then so is the other. This version works with a linear equivalence. -/ -lemma FiniteDimensional.of_linearEquiv - {๐•œ : Type u} [RCLike ๐•œ] - {E : Type v} [AddCommGroup E] [Module ๐•œ E] - {F : Type w} [AddCommGroup F] [Module ๐•œ F] - [FiniteDimensional ๐•œ E] - (e : E โ‰ƒโ‚—[๐•œ] F) : FiniteDimensional ๐•œ F := by - exact Finite.equiv e - -lemma VectorBundle.finiteDimensional_fiber - (๐•œ : Type u) [RCLike ๐•œ] - {F : Type v} [NormedAddCommGroup F] [NormedSpace ๐•œ F] [FiniteDimensional ๐•œ F] - {B : Type w} [TopologicalSpace B] - {E_bundle : B โ†’ Type*} [โˆ€ x, AddCommGroup (E_bundle x)] [โˆ€ x, Module ๐•œ (E_bundle x)] - [TopologicalSpace (Bundle.TotalSpace F E_bundle)] - [โˆ€ x, TopologicalSpace (E_bundle x)] - [FiberBundle F E_bundle] [VectorBundle ๐•œ F E_bundle] - (x : B) : FiniteDimensional ๐•œ (E_bundle x) := - let triv := trivializationAt F E_bundle x - let hx := mem_baseSet_trivializationAt F E_bundle x - have h_linear : triv.IsLinear ๐•œ := VectorBundle.trivialization_linear' triv - haveI : triv.IsLinear ๐•œ := h_linear - let linear_equiv := triv.continuousLinearEquivAt ๐•œ x hx - FiniteDimensional.of_equiv linear_equiv.symm - -instance TangentSpace.finiteDimensional - [FiniteDimensional ๐•œ E] - [โˆ€ x : M, TopologicalSpace (TangentSpace I x)] - [TopologicalSpace (Bundle.TotalSpace E (TangentSpace I : M โ†’ Type _))] - [FiberBundle E (TangentSpace I : M โ†’ Type _)] - [VectorBundle ๐•œ E (TangentSpace I : M โ†’ Type _)] - (x : M) : - FiniteDimensional ๐•œ (TangentSpace I x) := - VectorBundle.finiteDimensional_fiber ๐•œ (F := E) (E_bundle := TangentSpace I) x - -variable - [inst_top : TopologicalSpace (TangentBundle I M)] - [inst_fib : FiberBundle E (TangentSpace I : M โ†’ Type _)] - [inst_vec : VectorBundle ๐•œ E (TangentSpace I : M โ†’ Type _)] - [inst_mani : IsManifold I (n + 1) M] - [inst_cmvb : ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] +variable {E : Type v} {H : Type w} {M : Type w} {n : WithTop โ„•โˆž} +variable [NormedAddCommGroup E] [NormedSpace โ„ E] [FiniteDimensional โ„ E] +variable [TopologicalSpace H] [TopologicalSpace M] [ChartedSpace H M] [ChartedSpace H E] +variable {I : ModelWithCorners โ„ E H} +variable [IsManifold I (n + 1) M] +variable [TopologicalSpace (TotalSpace E (TangentSpace I : M โ†’ Type _))] +variable [FiberBundle E (TangentSpace I : M โ†’ Type _)] +variable [VectorBundle โ„ E (TangentSpace I : M โ†’ Type _)] +variable [ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] +variable [inst_tangent_findim : โˆ€ (x : M), FiniteDimensional โ„ (TangentSpace I x)] +variable {g : PseudoRiemannianMetric E H M n I} -/-- Convert the continuous linear map representation `val x` to the algebraic `LinearMap.BilinForm`. - This is useful for leveraging lemmas about `BilinForm`. -/ -def toBilinForm - (g : @PseudoRiemannianMetric ๐•œ _ E _ _ H _ M _ _ I n inst_top - inst_fib inst_vec inst_mani inst_cmvb) (x : M) : - LinearMap.BilinForm ๐•œ (TangentSpace I x) := - (g.val x).toBilinForm - -/-- Coercion from PseudoRiemannianMetric to its function representation. -/ -instance : CoeFun (@PseudoRiemannianMetric ๐•œ _ E _ _ H _ M _ _ I n inst_top - inst_fib inst_vec inst_mani inst_cmvb) - (fun _ => โˆ€ x : M, TangentSpace I x โ†’L[๐•œ] (TangentSpace I x โ†’L[๐•œ] ๐•œ)) where - coe g := g.val - -omit [FiniteDimensional ๐•œ E] [ChartedSpace H E] in -@[simp] lemma toBilinForm_apply - (g : PseudoRiemannianMetric I n) (x : M) (v w : TangentSpace I x) : - g.toBilinForm x v w = g.val x v w := rfl - -omit [FiniteDimensional ๐•œ E] [ChartedSpace H E] in -@[simp] lemma toBilinForm_isSymm - (g : PseudoRiemannianMetric I n) (x : M) : (g.toBilinForm x).IsSymm := by - intro v w - simp only [toBilinForm_apply] - exact g.symm x v w - -omit [FiniteDimensional ๐•œ E] [ChartedSpace H E] in -@[simp] lemma toBilinForm_nondegenerate - (g : PseudoRiemannianMetric I n) (x : M) : - (g.toBilinForm x).Nondegenerate := by - intro v hv - simp_rw [toBilinForm_apply] at hv - exact g.nondegenerate x v hv - -omit [FiniteDimensional ๐•œ E] [ChartedSpace H E] in -lemma symm' - (g : PseudoRiemannianMetric I n) (x : M) (v w : TangentSpace I x) : - (g.val x v) w = (g.val x w) v := +instance TangentSpace.addCommGroup (x : M) : AddCommGroup (TangentSpace I x) := by infer_instance +instance TangentSpace.module (x : M) : Module โ„ (TangentSpace I x) := by infer_instance +instance TangentSpace.finiteDimensional (x : M) : FiniteDimensional โ„ (TangentSpace I x) := by + infer_instance + +/-- Convert the metric's continuous linear map representation `val x` to the algebraic + `LinearMap.BilinForm`. -/ +def toBilinForm (g : PseudoRiemannianMetric E H M n I) (x : M) : LinearMap.BilinForm โ„ (TangentSpace I x) where + toFun := ฮป v => { toFun := ฮป w => g.val x v w, + map_add' := ฮป wโ‚ wโ‚‚ => by + simp only [ContinuousLinearMap.map_add, ContinuousLinearMap.add_apply], + map_smul' := ฮป c w => by + simp only [map_smul, smul_eq_mul, RingHom.id_apply] } + map_add' := ฮป vโ‚ vโ‚‚ => by + ext w + simp only [map_add, add_apply, LinearMap.coe_mk, AddHom.coe_mk, LinearMap.add_apply] + map_smul' := ฮป c v => by + ext w + simp only [map_smul, coe_smul', Pi.smul_apply, smul_eq_mul, LinearMap.coe_mk, AddHom.coe_mk, + RingHom.id_apply, LinearMap.smul_apply] + +/-- Convert a pseudo-Riemannian metric at a point `x` to a quadratic form `v โ†ฆ gโ‚“(v, v)`. -/ +def toQuadraticForm (g : PseudoRiemannianMetric E H M n I) (x : M) : QuadraticForm โ„ (TangentSpace I x) := + PseudoRiemannianMetricValToQuadraticForm g.val g.symm x + +-- Coercion from PseudoRiemannianMetric to its function representation. +instance coeFunInst : CoeFun (PseudoRiemannianMetric E H M n I) + (fun _ => โˆ€ x : M, TangentSpace I x โ†’L[โ„] (TangentSpace I x โ†’L[โ„] โ„)) where + coe g := g.val + +@[simp] lemma toBilinForm_apply (g : PseudoRiemannianMetric E H M n I) (x : M) (v w : TangentSpace I x) : + toBilinForm g x v w = g.val x v w := rfl + +@[simp] lemma toQuadraticForm_apply (g : PseudoRiemannianMetric E H M n I) (x : M) (v : TangentSpace I x) : + toQuadraticForm g x v = g.val x v v := rfl + +@[simp] lemma toBilinForm_isSymm (g : PseudoRiemannianMetric E H M n I) (x : M) : (toBilinForm g x).IsSymm := by + intro v w; simp only [toBilinForm_apply]; exact g.symm x v w + +@[simp] lemma toBilinForm_nondegenerate (g : PseudoRiemannianMetric E H M n I) (x : M) : (toBilinForm g x).Nondegenerate := by + intro v hv; simp_rw [toBilinForm_apply] at hv; exact g.nondegenerate x v hv + +lemma symm' (x : M) (v w : TangentSpace I x) : (g.val x v) w = (g.val x w) v := g.symm x v w -omit [FiniteDimensional ๐•œ E] [ChartedSpace H E] in -lemma nondegenerate' - (g : PseudoRiemannianMetric I n) (x : M) (v : TangentSpace I x) - (h : โˆ€ w : TangentSpace I x, (g.val x v) w = 0) : v = 0 := +lemma nondegenerate' (x : M) (v : TangentSpace I x) (h : โˆ€ w : TangentSpace I x, (g.val x v) w = 0) : + v = 0 := g.nondegenerate x v h -omit [FiniteDimensional ๐•œ E] [ChartedSpace H E] in -lemma smooth' - (g : @PseudoRiemannianMetric ๐•œ _ E _ _ H _ M _ _ I n inst_top - inst_fib inst_vec inst_mani inst_cmvb) (X Y : ContMDiffSection I E n (TangentSpace I)) : - ContMDiff I (modelWithCornersSelf ๐•œ ๐•œ) n (fun x => (g.val x (X x)) (Y x)) := - g.smooth X Y - -/-- Convert a pseudo-Riemannian metric at a point to a quadratic form. -/ -@[simp] def toQuadraticForm - (g : @PseudoRiemannianMetric ๐•œ _ E _ _ H _ M _ _ I n inst_top - inst_fib inst_vec inst_mani inst_cmvb) (x : M) : - QuadraticForm ๐•œ (TangentSpace I x) where - toFun v := g.val x v v - toFun_smul a v := by - simp only [ContinuousLinearMap.map_smul, ContinuousLinearMap.smul_apply, smul_smul, pow_two] - exists_companion' := - โŸจ LinearMap.mkโ‚‚ ๐•œ (fun v y => g.val x v y + g.val x y v) - (fun vโ‚ vโ‚‚ y => by -- Additivity in v - simp only [ContinuousLinearMap.map_add, ContinuousLinearMap.add_apply] - ring) - (fun a v y => by -- Homogeneity in v - simp only [ContinuousLinearMap.map_smul, ContinuousLinearMap.smul_apply] - ring_nf - exact Eq.symm (DistribSMul.smul_add a (((g.val x) v) y) (((g.val x) y) v))) - (fun v yโ‚ yโ‚‚ => by -- Additivity in y - simp only [ContinuousLinearMap.map_add, ContinuousLinearMap.add_apply] - ring) - (fun a v y => by -- Homogeneity in y - simp only [ContinuousLinearMap.map_smul, ContinuousLinearMap.smul_apply] - ring_nf - exact Eq.symm (DistribSMul.smul_add a (((g.val x) v) y) (((g.val x) y) v))), - by - intro v y - simp only [LinearMap.mkโ‚‚_apply, ContinuousLinearMap.map_add, - ContinuousLinearMap.add_apply, g.symm x] - ringโŸฉ +lemma smooth' (xโ‚€ : M) (v w : E) : + ContDiffWithinAt โ„ n (fun y => g.val ((extChartAt I xโ‚€).symm y) + (mfderiv I I ((extChartAt I xโ‚€).symm) y v) (mfderiv I I ((extChartAt I xโ‚€).symm) y w)) + ((extChartAt I xโ‚€).target) ((extChartAt I xโ‚€) xโ‚€) := + g.smooth_in_charts' xโ‚€ v w -omit [FiniteDimensional ๐•œ E] [ChartedSpace H E] in -lemma toQuadraticForm_apply - (g : PseudoRiemannianMetric I n) (x : M) (v : TangentSpace I x) : - g.toQuadraticForm x v = g.val x v v := rfl +lemma negDim_isLocallyConstant' : IsLocallyConstant (fun x => (toQuadraticForm g x).negDim) := + g.negDim_isLocallyConstant /-- The "musical" isomorphism (index lowering) from the tangent space to its dual, induced by a pseudo-Riemannian metric. -/ -def flat - (g : @PseudoRiemannianMetric ๐•œ _ E _ _ H _ M _ _ I n inst_top - inst_fib inst_vec inst_mani inst_cmvb) (x : M) : - TangentSpace I x โ†’โ‚—[๐•œ] (TangentSpace I x โ†’L[๐•œ] ๐•œ) := +def flat (g : PseudoRiemannianMetric E H M n I) (x : M) : TangentSpace I x โ†’โ‚—[โ„] (TangentSpace I x โ†’L[โ„] โ„) := { toFun := ฮป v => g.val x v, map_add' := ฮป v w => by simp only [ContinuousLinearMap.map_add], - map_smul' := ฮป a v => by simp only [ContinuousLinearMap.map_smul]; exact rfl } + map_smul' := ฮป a v => by simp only [ContinuousLinearMap.map_smul]; rfl } -omit [FiniteDimensional ๐•œ E] [ChartedSpace H E] in -@[simp] lemma flat_apply - (g : PseudoRiemannianMetric I n) (x : M) (v w : TangentSpace I x) : - (g.flat x v) w = g.val x v w := rfl +@[simp] lemma flat_apply (g : PseudoRiemannianMetric E H M n I) (x : M) (v w : TangentSpace I x) : + (flat g x v) w = g.val x v w := by rfl /-- The musical isomorphism as a continuous linear map. -/ -def flatL - (g : @PseudoRiemannianMetric ๐•œ _ E _ _ H _ M _ _ I n inst_top - inst_fib inst_vec inst_mani inst_cmvb) (x : M) : - TangentSpace I x โ†’L[๐•œ] (TangentSpace I x โ†’L[๐•œ] ๐•œ) := - { g.flat x with +def flatL (g : PseudoRiemannianMetric E H M n I) (x : M) : TangentSpace I x โ†’L[โ„] (TangentSpace I x โ†’L[โ„] โ„) := + { toFun := ฮป v => g.val x v, + map_add' := ฮป v w => by simp only [ContinuousLinearMap.map_add], + map_smul' := ฮป a v => by simp only [ContinuousLinearMap.map_smul]; rfl, cont := ContinuousLinearMap.continuous (g.val x) } -omit [FiniteDimensional ๐•œ E] [ChartedSpace H E] in -@[simp] lemma flatL_apply - (g : PseudoRiemannianMetric I n) (x : M) (v w : TangentSpace I x) : - (g.flatL x v) w = g.val x v w := rfl - -omit [FiniteDimensional ๐•œ E] [ChartedSpace H E] in -/-- The linear map `flat` is injective due to non-degeneracy. -/ -@[simp] lemma flat_inj - (g : PseudoRiemannianMetric I n) (x : M) : - Function.Injective (g.flat x) := by - rw [โ† LinearMap.ker_eq_bot] - apply LinearMap.ker_eq_bot'.mpr - intro v hv - apply g.nondegenerate' x v - intro w - exact DFunLike.congr_fun hv w - -omit [FiniteDimensional ๐•œ E] [ChartedSpace H E] in -/-- The continuous linear map `flatL` is injective. -/ -@[simp] lemma flatL_inj - (g : PseudoRiemannianMetric I n) (x : M) : - Function.Injective (g.flatL x) := by - intro vโ‚ vโ‚‚ h - apply flat_inj g x - exact h - -omit [ChartedSpace H E] in -/-- The continuous linear map `flatL` is surjective because the tangent space is - finite dimensional. -/ +@[simp] lemma flatL_apply (g : PseudoRiemannianMetric E H M n I) (x : M) (v w : TangentSpace I x) : + (flatL g x v) w = g.val x v w := rfl + +@[simp] lemma flat_inj (g : PseudoRiemannianMetric E H M n I) (x : M) : Function.Injective (flat g x) := by + rw [โ† LinearMap.ker_eq_bot]; apply LinearMap.ker_eq_bot'.mpr + intro v hv; apply g.nondegenerate' x v; intro w; exact DFunLike.congr_fun hv w + +@[simp] lemma flatL_inj (g : PseudoRiemannianMetric E H M n I) (x : M) : Function.Injective (flatL g x) := + flat_inj g x -- Injective on LinearMap implies injective on ContLinearMap + +/-- In a finite-dimensional normed space, the continuous dual is linearly equivalent to the algebraic dual. + This is because in finite dimensions, every linear functional is continuous. -/ +def ContinuousLinearMap.equivModuleDual (๐•œ E : Type*) [NontriviallyNormedField ๐•œ] [CompleteSpace ๐•œ] + [NormedAddCommGroup E] [NormedSpace ๐•œ E] [FiniteDimensional ๐•œ E] : + (E โ†’L[๐•œ] ๐•œ) โ‰ƒโ‚—[๐•œ] Module.Dual ๐•œ E where + toFun f := f.toLinearMap + invFun ฯ† := + { toFun := ฯ† + map_add' := LinearMap.map_add ฯ† + map_smul' := LinearMap.map_smul ฯ† + cont := ฯ†.continuous_of_finiteDimensional } + map_add' f g := rfl + map_smul' c f := rfl + left_inv f := by ext; rfl + right_inv ฯ† := rfl + +/-- Helper theorem: in finite dimensions, every linear map is continuous -/ +theorem continuous_linear_map_of_finite_dimension {๐•œ E : Type*} [NontriviallyNormedField ๐•œ] + [NormedAddCommGroup E] [NormedSpace ๐•œ E] [FiniteDimensional ๐•œ E] [CompleteSpace ๐•œ] + (f : E โ†’โ‚—[๐•œ] ๐•œ) : Continuous f := + by exact LinearMap.continuous_of_finiteDimensional f + +/-- For a finite-dimensional normed space, the dimension of the continuous dual +equals the dimension of the original space. -/ +lemma finrank_continuousDual_eq_finrank {๐•œ E : Type*} [NontriviallyNormedField ๐•œ] + [NormedAddCommGroup E] [NormedSpace ๐•œ E] [FiniteDimensional ๐•œ E] [CompleteSpace ๐•œ] : + finrank ๐•œ (E โ†’L[๐•œ] ๐•œ) = finrank ๐•œ E := by + have h1 : (E โ†’L[๐•œ] ๐•œ) โ‰ƒโ‚—[๐•œ] Module.Dual ๐•œ E := by + exact ContinuousLinearMap.equivModuleDual ๐•œ E + have h2 : finrank ๐•œ (Module.Dual ๐•œ E) = finrank ๐•œ E := by + exact finrank_linearMap_self ๐•œ ๐•œ E + rw [LinearEquiv.finrank_eq h1, h2] + @[simp] lemma flatL_surj - (g : PseudoRiemannianMetric I n) (x : M) : + (g : PseudoRiemannianMetric E H M n I) (x : M) : Function.Surjective (g.flatL x) := by - haveI : FiniteDimensional ๐•œ (TangentSpace I x) := TangentSpace.finiteDimensional x - have h_finrank_eq : finrank ๐•œ (TangentSpace I x) = finrank ๐•œ (TangentSpace I x โ†’L[๐•œ] ๐•œ) := by - have h_dual_eq : finrank ๐•œ (TangentSpace I x โ†’L[๐•œ] ๐•œ) = finrank ๐•œ (Module.Dual ๐•œ + haveI : FiniteDimensional โ„ (TangentSpace I x) := TangentSpace.finiteDimensional x + have h_finrank_eq : finrank โ„ (TangentSpace I x) = finrank โ„ (TangentSpace I x โ†’L[โ„] โ„) := by + have h_dual_eq : finrank โ„ (TangentSpace I x โ†’L[โ„] โ„) = finrank โ„ (Module.Dual โ„ (TangentSpace I x)) := by - let to_dual : (TangentSpace I x โ†’L[๐•œ] ๐•œ) โ†’ Module.Dual ๐•œ (TangentSpace I x) := + let to_dual : (TangentSpace I x โ†’L[โ„] โ„) โ†’ Module.Dual โ„ (TangentSpace I x) := fun f => f.toLinearMap - let from_dual : Module.Dual ๐•œ (TangentSpace I x) โ†’ (TangentSpace I x โ†’L[๐•œ] ๐•œ) := fun f => + let from_dual : Module.Dual โ„ (TangentSpace I x) โ†’ (TangentSpace I x โ†’L[โ„] โ„) := fun f => ContinuousLinearMap.mk f (by apply LinearMap.continuous_of_finiteDimensional) - let equiv : (TangentSpace I x โ†’L[๐•œ] ๐•œ) โ‰ƒโ‚—[๐•œ] Module.Dual ๐•œ (TangentSpace I x) := + let equiv : (TangentSpace I x โ†’L[โ„] โ„) โ‰ƒโ‚—[โ„] Module.Dual โ„ (TangentSpace I x) := { toFun := to_dual, invFun := from_dual, map_add' := fun f g => by @@ -332,103 +383,86 @@ omit [ChartedSpace H E] in /-- The "musical" isomorphism (index lowering) from the tangent space to its dual, as a continuous linear equivalence. -/ @[simp] def flatEquiv - (g : @PseudoRiemannianMetric ๐•œ _ E _ _ H _ M _ _ I n inst_top - inst_fib inst_vec inst_mani inst_cmvb) + (g : PseudoRiemannianMetric E H M n I) (x : M) : - TangentSpace I x โ‰ƒL[๐•œ] (TangentSpace I x โ†’L[๐•œ] ๐•œ) := + TangentSpace I x โ‰ƒL[โ„] (TangentSpace I x โ†’L[โ„] โ„) := LinearEquiv.toContinuousLinearEquiv (LinearEquiv.ofBijective ((g.flatL x).toLinearMap) โŸจg.flatL_inj x, g.flatL_surj xโŸฉ) -omit [ChartedSpace H E] in lemma coe_flatEquiv - (g : PseudoRiemannianMetric I n) (x : M) : - (g.flatEquiv x : TangentSpace I x โ†’โ‚—[๐•œ] (TangentSpace I x โ†’L[๐•œ] ๐•œ)) = g.flatL x := rfl + (g : PseudoRiemannianMetric E H M n I) (x : M) : + (g.flatEquiv x : TangentSpace I x โ†’โ‚—[โ„] (TangentSpace I x โ†’L[โ„] โ„)) = g.flatL x := rfl -omit [ChartedSpace H E] in @[simp] lemma flatEquiv_apply - (g : PseudoRiemannianMetric I n) (x : M) (v w : TangentSpace I x) : + (g : PseudoRiemannianMetric E H M n I) (x : M) (v w : TangentSpace I x) : (g.flatEquiv x v) w = g.val x v w := rfl /-- The "musical" isomorphism (index raising) from the dual of the tangent space to the tangent space, induced by a pseudo-Riemannian metric. This is the inverse of `flatEquiv`. -/ def sharpEquiv - (g : @PseudoRiemannianMetric ๐•œ _ E _ _ H _ M _ _ I n inst_top - inst_fib inst_vec inst_mani inst_cmvb) (x : M) : - (TangentSpace I x โ†’L[๐•œ] ๐•œ) โ‰ƒL[๐•œ] TangentSpace I x := + (g : PseudoRiemannianMetric E H M n I) (x : M) : + (TangentSpace I x โ†’L[โ„] โ„) โ‰ƒL[โ„] TangentSpace I x := (g.flatEquiv x).symm -#lint + /-- The index raising map `sharp` as a continuous linear map. -/ def sharpL - (g : @PseudoRiemannianMetric ๐•œ _ E _ _ H _ M _ _ I n inst_top - inst_fib inst_vec inst_mani inst_cmvb) (x : M) : - (TangentSpace I x โ†’L[๐•œ] ๐•œ) โ†’L[๐•œ] TangentSpace I x := + (g : PseudoRiemannianMetric E H M n I) (x : M) : + (TangentSpace I x โ†’L[โ„] โ„) โ†’L[โ„] TangentSpace I x := (g.sharpEquiv x).toContinuousLinearMap -omit [ChartedSpace H E] in lemma sharpL_eq_toContinuousLinearMap - (g : PseudoRiemannianMetric I n) (x : M) : + (g : PseudoRiemannianMetric E H M n I) (x : M) : g.sharpL x = (g.sharpEquiv x).toContinuousLinearMap := rfl -omit [ChartedSpace H E] in lemma coe_sharpEquiv - (g : PseudoRiemannianMetric I n) (x : M) : - (g.sharpEquiv x : (TangentSpace I x โ†’L[๐•œ] ๐•œ) โ†’L[๐•œ] TangentSpace I x) = g.sharpL x := rfl + (g : PseudoRiemannianMetric E H M n I) (x : M) : + (g.sharpEquiv x : (TangentSpace I x โ†’L[โ„] โ„) โ†’L[โ„] TangentSpace I x) = g.sharpL x := rfl /-- The index raising map `sharp` as a linear map. -/ noncomputable def sharp - (g : @PseudoRiemannianMetric ๐•œ _ E _ _ H _ M _ _ I n inst_top - inst_fib inst_vec inst_mani inst_cmvb) (x : M) : - (TangentSpace I x โ†’L[๐•œ] ๐•œ) โ†’โ‚—[๐•œ] TangentSpace I x := + (g : PseudoRiemannianMetric E H M n I) (x : M) : + (TangentSpace I x โ†’L[โ„] โ„) โ†’โ‚—[โ„] TangentSpace I x := (g.sharpEquiv x).toLinearEquiv.toLinearMap -omit [ChartedSpace H E] in @[simp] lemma sharpL_apply_flatL - (g : PseudoRiemannianMetric I n) (x : M) (v : TangentSpace I x) : + (g : PseudoRiemannianMetric E H M n I) (x : M) (v : TangentSpace I x) : g.sharpL x (g.flatL x v) = v := (g.flatEquiv x).left_inv v -omit [ChartedSpace H E] in @[simp] lemma flatL_apply_sharpL - (g : PseudoRiemannianMetric I n) (x : M) (ฯ‰ : TangentSpace I x โ†’L[๐•œ] ๐•œ) : + (g : PseudoRiemannianMetric E H M n I) (x : M) (ฯ‰ : TangentSpace I x โ†’L[โ„] โ„) : g.flatL x (g.sharpL x ฯ‰) = ฯ‰ := (g.flatEquiv x).right_inv ฯ‰ -omit [ChartedSpace H E] in /-- Applying `sharp` then `flat` recovers the original covector. -/ @[simp] lemma flat_sharp_apply - (g : PseudoRiemannianMetric I n) (x : M) (ฯ‰ : TangentSpace I x โ†’L[๐•œ] ๐•œ) : + (g : PseudoRiemannianMetric E H M n I) (x : M) (ฯ‰ : TangentSpace I x โ†’L[โ„] โ„) : g.flat x (g.sharp x ฯ‰) = ฯ‰ := by - -- Use the continuous versions and coerce have := flatL_apply_sharpL g x ฯ‰ - -- Need to relate flat and flatL, sharp and sharpL simp only [sharp, sharpL, flat, flatL, coe_flatEquiv]; simp only [coe_sharpEquiv, ContinuousLinearEquiv.coe_coe, LinearEquiv.coe_coe] at this โŠข exact this -omit [ChartedSpace H E] in @[simp] lemma sharp_flat_apply - (g : PseudoRiemannianMetric I n) (x : M) (v : TangentSpace I x) : + (g : PseudoRiemannianMetric E H M n I) (x : M) (v : TangentSpace I x) : g.sharp x (g.flat x v) = v := by - -- Use the continuous versions and coerce have := sharpL_apply_flatL g x v simp only [sharp, sharpL, flat, flatL]; simp only [coe_flatEquiv, coe_sharpEquiv, ContinuousLinearEquiv.coe_coe, LinearEquiv.coe_coe] at this โŠข exact this -omit [ChartedSpace H E] in /-- The metric evaluated at `sharp ฯ‰โ‚` and `sharp ฯ‰โ‚‚`. -/ @[simp] lemma apply_sharp_sharp - (g : PseudoRiemannianMetric I n) (x : M) (ฯ‰โ‚ ฯ‰โ‚‚ : TangentSpace I x โ†’L[๐•œ] ๐•œ) : + (g : PseudoRiemannianMetric E H M n I) (x : M) (ฯ‰โ‚ ฯ‰โ‚‚ : TangentSpace I x โ†’L[โ„] โ„) : g.val x (g.sharpL x ฯ‰โ‚) (g.sharpL x ฯ‰โ‚‚) = ฯ‰โ‚ (g.sharpL x ฯ‰โ‚‚) := by rw [โ† flatL_apply g x (g.sharpL x ฯ‰โ‚)] rw [flatL_apply_sharpL g x ฯ‰โ‚] -omit [ChartedSpace H E] in /-- The metric evaluated at `v` and `sharp ฯ‰`. -/ lemma apply_vec_sharp - (g : PseudoRiemannianMetric I n) (x : M) (v : TangentSpace I x) (ฯ‰ : TangentSpace I x โ†’L[๐•œ] ๐•œ) : + (g : PseudoRiemannianMetric E H M n I) (x : M) (v : TangentSpace I x) (ฯ‰ : TangentSpace I x โ†’L[โ„] โ„) : g.val x v (g.sharpL x ฯ‰) = ฯ‰ v := by rw [g.symm' x v (g.sharpL x ฯ‰)] rw [โ† flatL_apply g x (g.sharpL x ฯ‰)] diff --git a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean index 21b8b5e86..38f930912 100644 --- a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean @@ -1,185 +1,105 @@ -/- -Copyright (c) 2025 Matteo Cipollina. All rights reserved. -Released under Apache 2.0 license as described in the file LICENSE. -Authors: Matteo Cipollina --/ - -import Mathlib.LinearAlgebra.QuadraticForm.Dual import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Defs +import Mathlib.LinearAlgebra.QuadraticForm.Dual +import Mathlib.Analysis.InnerProductSpace.Basic -/-! -# Riemannian Metrics on Manifolds - -/-! -This file introduces `RiemannianMetric`, a smooth positiveโ€definite specialization of -`PseudoRiemannianMetric` over โ„. It requires that each bilinear form `gโ‚“` satisfy -`gโ‚“(v,v) > 0` for nonzero tangent vectors `v`, and uses this to define the canonical -inner product, norm, and distance on each tangent space. (TODO: assemble these -data into an `InnerProductSpace โ„ (TangentSpace I_โ„ x)` instance). --/ - -## Main Definitions - -* `RiemannianMetric I n M`: A structure representing a `C^n` Riemannian metric on a manifold `M` - modelled on `(E_โ„, H_โ„)` with model `I_โ„`. This specializes `PseudoRiemannianMetric` to the - case where the base field is `โ„` and requires the bilinear form `gโ‚“` at each point `x` to be - positive-definite. -* `RiemannianMetric.inner g x`: The inner product (bilinear form `gโ‚“`) on the tangent space `Tโ‚“M`. -* `RiemannianMetric.sharp g x`: The musical isomorphism (index raising) from the cotangent space - `T*โ‚“M` to the tangent space `Tโ‚“M`, which is an isomorphism in the Riemannian case due to - positive definiteness. -* `RiemannianMetric.toQuadraticForm g x`: Expresses the metric at point `x` as a quadratic form. - -## Implementation Notes - -* Extends `PseudoRiemannianMetric` by fixing the base field to `โ„` and adding the `pos_def'` - field, ensuring `gโ‚“(v, v) > 0` for non-zero `v`. -* The positive definiteness allows defining an `InnerProductSpace โ„ (Tโ‚“M)` instance on each - tangent space `Tโ‚“M`. --/ -universe u v w +section RiemannianMetric -open PseudoRiemannianMetric Bundle ContinuousLinearMap +open Bundle Set Finset Function Filter Module Topology ContinuousLinearMap +open scoped Manifold Bundle LinearMap Dual +open PseudoRiemannianMetric InnerProductSpace noncomputable section -variable {E_โ„ : Type v} [NormedAddCommGroup E_โ„] [NormedSpace โ„ E_โ„] [FiniteDimensional โ„ E_โ„] -variable {H_โ„ : Type w} [TopologicalSpace H_โ„] -variable {M_โ„ : Type w} [TopologicalSpace M_โ„] [ChartedSpace H_โ„ M_โ„] [ChartedSpace H_โ„ E_โ„] +variable {E : Type v} [NormedAddCommGroup E] [NormedSpace โ„ E] [FiniteDimensional โ„ E] +variable {H : Type w} [TopologicalSpace H] +variable {M : Type w} [TopologicalSpace M] [ChartedSpace H M] [ChartedSpace H E] +variable {I : ModelWithCorners โ„ E H} {n : โ„•โˆž} /-- A Riemannian metric of smoothness class `n` on a manifold `M` over `โ„`. This extends a pseudo-Riemannian metric with the positive definiteness condition. -/ @[ext] structure RiemannianMetric - (I_โ„ : ModelWithCorners โ„ E_โ„ H_โ„) - (n : WithTop โ„•โˆž) - [inst_top : TopologicalSpace (TangentBundle I_โ„ M_โ„)] - [inst_fib : FiberBundle E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _)] - [inst_vec : VectorBundle โ„ E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _)] - [inst_mani : IsManifold I_โ„ (n + 1) M_โ„] - [inst_cmvb : ContMDiffVectorBundle n E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _) I_โ„] - extends @PseudoRiemannianMetric โ„ Real.instRCLike E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib - inst_vec inst_mani inst_cmvb where + (I : ModelWithCorners โ„ E H) (n : โ„•โˆž) (M : Type w) + [TopologicalSpace M] [ChartedSpace H M] [IsManifold I (n + 1) M] + [inst_top : TopologicalSpace (TangentBundle I M)] + [inst_fib : FiberBundle E (TangentSpace I : M โ†’ Type _)] + [inst_vec : VectorBundle โ„ E (TangentSpace I : M โ†’ Type _)] + [inst_cmvb : ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] + [inst_tangent_findim : โˆ€ (x : M), FiniteDimensional โ„ (TangentSpace I x)] : Type _ where + /-- The underlying pseudo-Riemannian metric. -/ + toPseudoRiemannianMetric : PseudoRiemannianMetric E H M (n) I /-- `gโ‚“(v, v) > 0` for all nonzero `v`. -/ - pos_def' : โˆ€ x v, v โ‰  0 โ†’ val x v v > 0 - + pos_def' : โˆ€ x v, v โ‰  0 โ†’ toPseudoRiemannianMetric.val x v v > 0 namespace RiemannianMetric --- Propagate instance assumptions -variable {I_โ„ : ModelWithCorners โ„ E_โ„ H_โ„} {n : WithTop โ„•โˆž} -variable [inst_top : TopologicalSpace (TangentBundle I_โ„ M_โ„)] -variable [inst_fib : FiberBundle E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _)] -variable [inst_vec : VectorBundle โ„ E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _)] -variable [inst_mani : IsManifold I_โ„ (n + 1) M_โ„] -variable [inst_cmvb : ContMDiffVectorBundle n E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _) I_โ„] +variable {I : ModelWithCorners โ„ E H} {n : โ„•โˆž} {M : Type w} +variable [TopologicalSpace M] [ChartedSpace H M] [IsManifold I (n + 1) M] +variable [inst_top : TopologicalSpace (TangentBundle I M)] +variable [inst_fib : FiberBundle E (TangentSpace I : M โ†’ Type _)] +variable [inst_vec : VectorBundle โ„ E (TangentSpace I : M โ†’ Type _)] +variable [inst_cmvb : ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] +variable [inst_tangent_findim : โˆ€ (x : M), FiniteDimensional โ„ (TangentSpace I x)] /-- Coercion from RiemannianMetric to its underlying PseudoRiemannianMetric. -/ -instance : Coe (@RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani - inst_cmvb) - (@PseudoRiemannianMetric โ„ Real.instRCLike E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top - inst_fib inst_vec inst_mani inst_cmvb) where +instance : Coe (RiemannianMetric I n M) (PseudoRiemannianMetric E H M (n) I) where coe g := g.toPseudoRiemannianMetric -omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in -@[simp] lemma pos_def (g : RiemannianMetric I_โ„ n) (x : M_โ„) (v : TangentSpace I_โ„ x) (hv : v โ‰  0) : +@[simp] lemma pos_def (g : RiemannianMetric I n M) (x : M) (v : TangentSpace I x) + (hv : v โ‰  0) : (g.toPseudoRiemannianMetric.val x v) v > 0 := g.pos_def' x v hv /-- The inverse of the musical isomorphism (index raising), which is an isomorphism in the Riemannian case. This is well-defined because the metric is positive definite. -/ def sharp - (g : (@RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani - inst_cmvb)) (x : M_โ„) : - Module.Dual โ„ (TangentSpace I_โ„ x) โ‰ƒโ‚—[โ„] TangentSpace I_โ„ x := - let bilin := g.toPseudoRiemannianMetric.toBilinForm x - have h_nondeg : bilin.Nondegenerate := - g.toPseudoRiemannianMetric.toBilinForm_nondegenerate x - LinearEquiv.symm (bilin.toDual h_nondeg) + (g : RiemannianMetric I n M) (x : M) : + (TangentSpace I x โ†’L[โ„] โ„) โ‰ƒL[โ„] TangentSpace I x := + g.toPseudoRiemannianMetric.sharpEquiv x /-- Express a Riemannian metric at a point as a quadratic form. -/ -abbrev toQuadraticForm - (g : (@RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani - inst_cmvb)) - (x : M_โ„) : - QuadraticForm โ„ (TangentSpace I_โ„ x) := +abbrev toQuadraticForm (g : RiemannianMetric I n M) (x : M) : + QuadraticForm โ„ (TangentSpace I x) := g.toPseudoRiemannianMetric.toQuadraticForm x -omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in /-- The quadratic form associated with a Riemannian metric is positive definite. -/ -lemma toQuadraticForm_posDef (g : RiemannianMetric I_โ„ n) (x : M_โ„) : +@[simp] lemma toQuadraticForm_posDef (g : RiemannianMetric I n M) (x : M) : (g.toQuadraticForm x).PosDef := ฮป v hv => g.pos_def x v hv -omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in /-- The application of a Riemannian metric's quadratic form to a vector. -/ -lemma toQuadraticForm_apply (g : RiemannianMetric I_โ„ n) (x : M_โ„) - (v : TangentSpace I_โ„ x) : - g.toQuadraticForm x v = g.val x v v := by +@[simp] lemma toQuadraticForm_apply (g : RiemannianMetric I n M) (x : M) + (v : TangentSpace I x) : + g.toQuadraticForm x v = g.toPseudoRiemannianMetric.val x v v := by simp only [toQuadraticForm, PseudoRiemannianMetric.toQuadraticForm_apply] -omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in -/-- A positive definite quadratic form is nondegenerate. -/ -lemma posDef_to_nondegenerate [Invertible (2 : โ„)] - (g : RiemannianMetric I_โ„ n) (x : M_โ„) : - (QuadraticMap.associated (R := โ„) (N := โ„) (g.toQuadraticForm x)).Nondegenerate := by - let Q := g.toQuadraticForm x - let B := QuadraticMap.associated (R := โ„) (N := โ„) Q - constructor - ยท intro v h_all_zero_w - specialize h_all_zero_w v - have h_assoc_self : B v v = Q v := - QuadraticMap.associated_eq_self_apply โ„ Q v - rw [h_assoc_self] at h_all_zero_w - by_cases h_v_zero : v = 0 - ยท exact h_v_zero - ยท have h_quad_pos : Q v > 0 := g.pos_def x v h_v_zero - linarith [h_all_zero_w, h_quad_pos] - ยท intro w h_all_zero_v - specialize h_all_zero_v w - have h_assoc_self : B w w = Q w := - QuadraticMap.associated_eq_self_apply โ„ Q w - rw [h_assoc_self] at h_all_zero_v - by_cases h_w_zero : w = 0 - ยท exact h_w_zero - ยท have h_quad_pos : Q w > 0 := g.pos_def x w h_w_zero - linarith [h_all_zero_v, h_quad_pos] - -/-- The isometry between `(Q.prod <| -Q)` and `QuadraticForm.dualProd`, - where `Q` is the quadratic form associated with the Riemannian metric at `x`. -/ -abbrev toDualProdIso [Invertible (2 : โ„)] (g : RiemannianMetric I_โ„ n) (x : M_โ„) : - ((g.toQuadraticForm x).prod <| -(g.toQuadraticForm x)) โ†’qแตข - (QuadraticForm.dualProd โ„ (TangentSpace I_โ„ x)) := - QuadraticForm.toDualProd (g.toQuadraticForm x) +theorem riemannian_metric_negDim_zero (g : RiemannianMetric I n M) (x : M) : + (g.toQuadraticForm x).negDim = 0 := by + apply QuadraticForm.rankNeg_eq_zero + exact g.toQuadraticForm_posDef x /-- The inner product on the tangent space at point `x` induced by the Riemannian metric `g`. -/ -def inner - (g : (@RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani - inst_cmvb)) (x : M_โ„) (v w : TangentSpace I_โ„ x) : โ„ := +def inner (g : RiemannianMetric I n M) (x : M) (v w : TangentSpace I x) : โ„ := g.toPseudoRiemannianMetric.val x v w -omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in -@[simp] lemma inner_apply (g : RiemannianMetric I_โ„ n) (x : M_โ„) (v w : TangentSpace I_โ„ x) : - inner g x v w = g.val x v w := rfl +@[simp] lemma inner_apply (g : RiemannianMetric I n M) (x : M) (v w : TangentSpace I x) : + inner g x v w = g.toPseudoRiemannianMetric.val x v w := rfl -variable (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n _ _ _ _ _) (x : M_โ„) +variable (g : RiemannianMetric I n M) (x : M) -omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in /-- Pointwise symmetry of the inner product. -/ -lemma inner_symm (v w : TangentSpace I_โ„ x) : +lemma inner_symm (v w : TangentSpace I x) : g.inner x v w = g.inner x w v := by simp only [inner_apply] exact g.toPseudoRiemannianMetric.symm' x v w /-- The inner product space core for the tangent space at a point, derived from the Riemannian metric. -/ -noncomputable def tangentInnerCore - (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani inst_cmvb) - (x : M_โ„) : - InnerProductSpace.Core โ„ (TangentSpace I_โ„ x) where +noncomputable def tangentInnerCore (g : RiemannianMetric I n M) (x : M) : + InnerProductSpace.Core โ„ (TangentSpace I x) where inner := ฮป v w => g.inner x v w conj_symm := ฮป v w => by simp only [inner_apply, conj_trivial] - exact g.toPseudoRiemannianMetric.symm' x w v + exact g.toPseudoRiemannianMetric.symm x w v nonneg_re := ฮป v => by simp only [inner_apply, RCLike.re_to_real] by_cases hv : v = 0 @@ -195,41 +115,64 @@ noncomputable def tangentInnerCore have h_pos : g.inner x v v > 0 := g.pos_def x v h_v_ne_zero linarith [h_inner_zero, h_pos] -/-! ### Inner product space structure. -/ - -/-- Normed additive commutative group structure on the tangent space at a point `x`, -derived from the Riemannian metric `g`. -/ -noncomputable def TangentSpace.metricNormedAddCommGroup - (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani inst_cmvb) - (x : M_โ„) : - NormedAddCommGroup (TangentSpace I_โ„ x) := - @InnerProductSpace.Core.toNormedAddCommGroup โ„ (TangentSpace I_โ„ x) _ _ _ (tangentInnerCore g x) - -/-- The pre-inner product space core for the tangent space at a point, -derived from the Riemannian metric. -/ -noncomputable def tangentPreInnerCore - (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani inst_cmvb) - (x : M_โ„) : - PreInnerProductSpace.Core โ„ (TangentSpace I_โ„ x) where - inner := ฮป v w => g.inner x v w - conj_symm := ฮป v w => by - simp only [inner_apply, conj_trivial] - exact g.toPseudoRiemannianMetric.symm' x w v - nonneg_re := ฮป v => by - simp only [inner_apply, RCLike.re_to_real] - by_cases hv : v = 0 - ยท simp [hv, inner_apply, map_zero, zero_apply] - ยท exact le_of_lt (g.pos_def x v hv) - add_left := ฮป u v w => by - simp only [inner_apply, map_add, add_apply] - smul_left := ฮป r u v => by - simp only [inner_apply, map_smul, smul_apply, conj_trivial] - rfl - -/-- Each tangent space carries a seminormed add comm group structure derived from -the Riemannian metric -/ -noncomputable def TangentSpace.metricSeminormedAddCommGroup - (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani inst_cmvb) - (x : M_โ„) : - SeminormedAddCommGroup (TangentSpace I_โ„ x) := - (TangentSpace.metricNormedAddCommGroup g x).toSeminormedAddCommGroup +/- We Define NormedAddCommGroup and InnerProductSpace structures locally. + We DO NOT mark them as instance.-/ + +/-- Creates a `NormedAddCommGroup` structure on the tangent space at a point, + derived from a Riemannian metric. -/ +noncomputable def TangentSpace.metricNormedAddCommGroup (g : RiemannianMetric I n M) (x : M) : + NormedAddCommGroup (TangentSpace I x) := + @InnerProductSpace.Core.toNormedAddCommGroup โ„ (TangentSpace I x) _ _ _ (tangentInnerCore g x) + +/-- Creates an `InnerProductSpace` structure on the tangent space at a point, + derived from a Riemannian metric. Alternative implementation using `letI`. -/ +noncomputable def TangentSpace.metricInnerProductSpace' (g : RiemannianMetric I n M) (x : M) : + letI := TangentSpace.metricNormedAddCommGroup g x + InnerProductSpace โ„ (TangentSpace I x) := + InnerProductSpace.ofCore (tangentInnerCore g x) + +/-- Creates an `InnerProductSpace` structure on the tangent space at a point, + derived from a Riemannian metric. -/ +noncomputable def TangentSpace.metricInnerProductSpace (g : RiemannianMetric I n M) (x : M) : + let _ := TangentSpace.metricNormedAddCommGroup g x + InnerProductSpace โ„ (TangentSpace I x) := + let inner_core := tangentInnerCore g x + let _ := TangentSpace.metricNormedAddCommGroup g x + InnerProductSpace.ofCore inner_core + +/-- The norm on a tangent space induced by a Riemannian metric, defined as the square root + of the inner product of a vector with itself. -/ +noncomputable def norm (g : RiemannianMetric I n M) (x : M) (v : TangentSpace I x) : โ„ := + Real.sqrt (g.inner x v v) + +-- Example using the norm function +example (g : RiemannianMetric I n M) (x : M) (v : TangentSpace I x) : + norm g x v โ‰ฅ 0 := Real.sqrt_nonneg _ + +-- Example showing how to use the metric inner product space +example (g : RiemannianMetric I n M) (x : M) (v w : TangentSpace I x) : + (TangentSpace.metricInnerProductSpace g x).inner v w = g.inner x v w := by + letI := TangentSpace.metricInnerProductSpace g x + rfl + +/-- Helper function to compute the norm on a tangent space from a Riemannian metric, + using the underlying `NormedAddCommGroup` structure. -/ +noncomputable def norm' (g : RiemannianMetric I n M) (x : M) (v : TangentSpace I x) : โ„ := + let normed_group := TangentSpace.metricNormedAddCommGroup g x + @Norm.norm (TangentSpace I x) (@NormedAddCommGroup.toNorm (TangentSpace I x) normed_group) v + +-- Example: Using a custom norm function instead of the notation +example (g : RiemannianMetric I n M) (x : M) (v : TangentSpace I x) : + norm g x v โ‰ฅ 0 := by + unfold norm + apply Real.sqrt_nonneg + +example (g : RiemannianMetric I n M) (x : M) (v : TangentSpace I x) : โ„ := + letI := TangentSpace.metricNormedAddCommGroup g x + โ€–vโ€– + +example (g : RiemannianMetric I n M) (x : M) (v : TangentSpace I x) : โ„ := + let normed_group := TangentSpace.metricNormedAddCommGroup g x + @Norm.norm (TangentSpace I x) (@NormedAddCommGroup.toNorm (TangentSpace I x) normed_group) v + +end RiemannianMetric diff --git a/PhysLean/Mathematics/Geometry/Metric/Riemannian/DefsOrig.lean b/PhysLean/Mathematics/Geometry/Metric/Riemannian/DefsOrig.lean new file mode 100644 index 000000000..21b8b5e86 --- /dev/null +++ b/PhysLean/Mathematics/Geometry/Metric/Riemannian/DefsOrig.lean @@ -0,0 +1,235 @@ +/- +Copyright (c) 2025 Matteo Cipollina. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Matteo Cipollina +-/ + +import Mathlib.LinearAlgebra.QuadraticForm.Dual +import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Defs + +/-! +# Riemannian Metrics on Manifolds + +/-! +This file introduces `RiemannianMetric`, a smooth positiveโ€definite specialization of +`PseudoRiemannianMetric` over โ„. It requires that each bilinear form `gโ‚“` satisfy +`gโ‚“(v,v) > 0` for nonzero tangent vectors `v`, and uses this to define the canonical +inner product, norm, and distance on each tangent space. (TODO: assemble these +data into an `InnerProductSpace โ„ (TangentSpace I_โ„ x)` instance). +-/ + +## Main Definitions + +* `RiemannianMetric I n M`: A structure representing a `C^n` Riemannian metric on a manifold `M` + modelled on `(E_โ„, H_โ„)` with model `I_โ„`. This specializes `PseudoRiemannianMetric` to the + case where the base field is `โ„` and requires the bilinear form `gโ‚“` at each point `x` to be + positive-definite. +* `RiemannianMetric.inner g x`: The inner product (bilinear form `gโ‚“`) on the tangent space `Tโ‚“M`. +* `RiemannianMetric.sharp g x`: The musical isomorphism (index raising) from the cotangent space + `T*โ‚“M` to the tangent space `Tโ‚“M`, which is an isomorphism in the Riemannian case due to + positive definiteness. +* `RiemannianMetric.toQuadraticForm g x`: Expresses the metric at point `x` as a quadratic form. + +## Implementation Notes + +* Extends `PseudoRiemannianMetric` by fixing the base field to `โ„` and adding the `pos_def'` + field, ensuring `gโ‚“(v, v) > 0` for non-zero `v`. +* The positive definiteness allows defining an `InnerProductSpace โ„ (Tโ‚“M)` instance on each + tangent space `Tโ‚“M`. +-/ +universe u v w + +open PseudoRiemannianMetric Bundle ContinuousLinearMap + +noncomputable section + +variable {E_โ„ : Type v} [NormedAddCommGroup E_โ„] [NormedSpace โ„ E_โ„] [FiniteDimensional โ„ E_โ„] +variable {H_โ„ : Type w} [TopologicalSpace H_โ„] +variable {M_โ„ : Type w} [TopologicalSpace M_โ„] [ChartedSpace H_โ„ M_โ„] [ChartedSpace H_โ„ E_โ„] + +/-- A Riemannian metric of smoothness class `n` on a manifold `M` over `โ„`. + This extends a pseudo-Riemannian metric with the positive definiteness condition. -/ +@[ext] +structure RiemannianMetric + (I_โ„ : ModelWithCorners โ„ E_โ„ H_โ„) + (n : WithTop โ„•โˆž) + [inst_top : TopologicalSpace (TangentBundle I_โ„ M_โ„)] + [inst_fib : FiberBundle E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _)] + [inst_vec : VectorBundle โ„ E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _)] + [inst_mani : IsManifold I_โ„ (n + 1) M_โ„] + [inst_cmvb : ContMDiffVectorBundle n E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _) I_โ„] + extends @PseudoRiemannianMetric โ„ Real.instRCLike E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib + inst_vec inst_mani inst_cmvb where + /-- `gโ‚“(v, v) > 0` for all nonzero `v`. -/ + pos_def' : โˆ€ x v, v โ‰  0 โ†’ val x v v > 0 + + +namespace RiemannianMetric + +-- Propagate instance assumptions +variable {I_โ„ : ModelWithCorners โ„ E_โ„ H_โ„} {n : WithTop โ„•โˆž} +variable [inst_top : TopologicalSpace (TangentBundle I_โ„ M_โ„)] +variable [inst_fib : FiberBundle E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _)] +variable [inst_vec : VectorBundle โ„ E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _)] +variable [inst_mani : IsManifold I_โ„ (n + 1) M_โ„] +variable [inst_cmvb : ContMDiffVectorBundle n E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _) I_โ„] + +/-- Coercion from RiemannianMetric to its underlying PseudoRiemannianMetric. -/ +instance : Coe (@RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani + inst_cmvb) + (@PseudoRiemannianMetric โ„ Real.instRCLike E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top + inst_fib inst_vec inst_mani inst_cmvb) where + coe g := g.toPseudoRiemannianMetric + +omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in +@[simp] lemma pos_def (g : RiemannianMetric I_โ„ n) (x : M_โ„) (v : TangentSpace I_โ„ x) (hv : v โ‰  0) : + (g.toPseudoRiemannianMetric.val x v) v > 0 := g.pos_def' x v hv + +/-- The inverse of the musical isomorphism (index raising), which is an isomorphism + in the Riemannian case. This is well-defined because the metric is positive definite. -/ +def sharp + (g : (@RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani + inst_cmvb)) (x : M_โ„) : + Module.Dual โ„ (TangentSpace I_โ„ x) โ‰ƒโ‚—[โ„] TangentSpace I_โ„ x := + let bilin := g.toPseudoRiemannianMetric.toBilinForm x + have h_nondeg : bilin.Nondegenerate := + g.toPseudoRiemannianMetric.toBilinForm_nondegenerate x + LinearEquiv.symm (bilin.toDual h_nondeg) + +/-- Express a Riemannian metric at a point as a quadratic form. -/ +abbrev toQuadraticForm + (g : (@RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani + inst_cmvb)) + (x : M_โ„) : + QuadraticForm โ„ (TangentSpace I_โ„ x) := + g.toPseudoRiemannianMetric.toQuadraticForm x + +omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in +/-- The quadratic form associated with a Riemannian metric is positive definite. -/ +lemma toQuadraticForm_posDef (g : RiemannianMetric I_โ„ n) (x : M_โ„) : + (g.toQuadraticForm x).PosDef := + ฮป v hv => g.pos_def x v hv + +omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in +/-- The application of a Riemannian metric's quadratic form to a vector. -/ +lemma toQuadraticForm_apply (g : RiemannianMetric I_โ„ n) (x : M_โ„) + (v : TangentSpace I_โ„ x) : + g.toQuadraticForm x v = g.val x v v := by + simp only [toQuadraticForm, PseudoRiemannianMetric.toQuadraticForm_apply] + +omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in +/-- A positive definite quadratic form is nondegenerate. -/ +lemma posDef_to_nondegenerate [Invertible (2 : โ„)] + (g : RiemannianMetric I_โ„ n) (x : M_โ„) : + (QuadraticMap.associated (R := โ„) (N := โ„) (g.toQuadraticForm x)).Nondegenerate := by + let Q := g.toQuadraticForm x + let B := QuadraticMap.associated (R := โ„) (N := โ„) Q + constructor + ยท intro v h_all_zero_w + specialize h_all_zero_w v + have h_assoc_self : B v v = Q v := + QuadraticMap.associated_eq_self_apply โ„ Q v + rw [h_assoc_self] at h_all_zero_w + by_cases h_v_zero : v = 0 + ยท exact h_v_zero + ยท have h_quad_pos : Q v > 0 := g.pos_def x v h_v_zero + linarith [h_all_zero_w, h_quad_pos] + ยท intro w h_all_zero_v + specialize h_all_zero_v w + have h_assoc_self : B w w = Q w := + QuadraticMap.associated_eq_self_apply โ„ Q w + rw [h_assoc_self] at h_all_zero_v + by_cases h_w_zero : w = 0 + ยท exact h_w_zero + ยท have h_quad_pos : Q w > 0 := g.pos_def x w h_w_zero + linarith [h_all_zero_v, h_quad_pos] + +/-- The isometry between `(Q.prod <| -Q)` and `QuadraticForm.dualProd`, + where `Q` is the quadratic form associated with the Riemannian metric at `x`. -/ +abbrev toDualProdIso [Invertible (2 : โ„)] (g : RiemannianMetric I_โ„ n) (x : M_โ„) : + ((g.toQuadraticForm x).prod <| -(g.toQuadraticForm x)) โ†’qแตข + (QuadraticForm.dualProd โ„ (TangentSpace I_โ„ x)) := + QuadraticForm.toDualProd (g.toQuadraticForm x) + +/-- The inner product on the tangent space at point `x` induced by the Riemannian metric `g`. -/ +def inner + (g : (@RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani + inst_cmvb)) (x : M_โ„) (v w : TangentSpace I_โ„ x) : โ„ := + g.toPseudoRiemannianMetric.val x v w + +omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in +@[simp] lemma inner_apply (g : RiemannianMetric I_โ„ n) (x : M_โ„) (v w : TangentSpace I_โ„ x) : + inner g x v w = g.val x v w := rfl + +variable (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n _ _ _ _ _) (x : M_โ„) + +omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in +/-- Pointwise symmetry of the inner product. -/ +lemma inner_symm (v w : TangentSpace I_โ„ x) : + g.inner x v w = g.inner x w v := by + simp only [inner_apply] + exact g.toPseudoRiemannianMetric.symm' x v w + +/-- The inner product space core for the tangent space at a point, derived from the +Riemannian metric. -/ +noncomputable def tangentInnerCore + (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani inst_cmvb) + (x : M_โ„) : + InnerProductSpace.Core โ„ (TangentSpace I_โ„ x) where + inner := ฮป v w => g.inner x v w + conj_symm := ฮป v w => by + simp only [inner_apply, conj_trivial] + exact g.toPseudoRiemannianMetric.symm' x w v + nonneg_re := ฮป v => by + simp only [inner_apply, RCLike.re_to_real] + by_cases hv : v = 0 + ยท simp [hv, inner_apply, map_zero, zero_apply] + ยท exact le_of_lt (g.pos_def x v hv) + add_left := ฮป u v w => by + simp only [inner_apply, map_add, add_apply] + smul_left := ฮป r u v => by + simp only [inner_apply, map_smul, smul_apply, conj_trivial] + rfl + definite := fun v (h_inner_zero : g.inner x v v = 0) => by + by_contra h_v_ne_zero + have h_pos : g.inner x v v > 0 := g.pos_def x v h_v_ne_zero + linarith [h_inner_zero, h_pos] + +/-! ### Inner product space structure. -/ + +/-- Normed additive commutative group structure on the tangent space at a point `x`, +derived from the Riemannian metric `g`. -/ +noncomputable def TangentSpace.metricNormedAddCommGroup + (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani inst_cmvb) + (x : M_โ„) : + NormedAddCommGroup (TangentSpace I_โ„ x) := + @InnerProductSpace.Core.toNormedAddCommGroup โ„ (TangentSpace I_โ„ x) _ _ _ (tangentInnerCore g x) + +/-- The pre-inner product space core for the tangent space at a point, +derived from the Riemannian metric. -/ +noncomputable def tangentPreInnerCore + (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani inst_cmvb) + (x : M_โ„) : + PreInnerProductSpace.Core โ„ (TangentSpace I_โ„ x) where + inner := ฮป v w => g.inner x v w + conj_symm := ฮป v w => by + simp only [inner_apply, conj_trivial] + exact g.toPseudoRiemannianMetric.symm' x w v + nonneg_re := ฮป v => by + simp only [inner_apply, RCLike.re_to_real] + by_cases hv : v = 0 + ยท simp [hv, inner_apply, map_zero, zero_apply] + ยท exact le_of_lt (g.pos_def x v hv) + add_left := ฮป u v w => by + simp only [inner_apply, map_add, add_apply] + smul_left := ฮป r u v => by + simp only [inner_apply, map_smul, smul_apply, conj_trivial] + rfl + +/-- Each tangent space carries a seminormed add comm group structure derived from +the Riemannian metric -/ +noncomputable def TangentSpace.metricSeminormedAddCommGroup + (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani inst_cmvb) + (x : M_โ„) : + SeminormedAddCommGroup (TangentSpace I_โ„ x) := + (TangentSpace.metricNormedAddCommGroup g x).toSeminormedAddCommGroup From 422e7bd7204eafe54c12bf0462e390a00904df74 Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Tue, 29 Apr 2025 01:43:16 +0200 Subject: [PATCH 10/32] Update Defs.lean --- .../Metric/PseudoRiemannian/Defs.lean | 51 ++++++++++++------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean index 9ecbb1b6c..22d87d9f9 100644 --- a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean @@ -73,11 +73,13 @@ lemma Pi.basisFun_apply_same {๐•œ ฮน : Type*} [Field ๐•œ] [Fintype ฮน] [Decida simp only [Pi.basisFun_apply, Pi.single_eq_same] /-- The i-th standard basis vector has 0 in all positions j โ‰  i. -/ -lemma Pi.basisFun_apply_ne {๐•œ ฮน : Type*} [Field ๐•œ] [Fintype ฮน] [DecidableEq ฮน] (i j : ฮน) (h : j โ‰  i) : +lemma Pi.basisFun_apply_ne {๐•œ ฮน : Type*} [Field ๐•œ] [Fintype ฮน] [DecidableEq ฮน] (i j : ฮน) + (h : j โ‰  i) : (Pi.basisFun ๐•œ ฮน) i j = 0 := by simp only [Pi.basisFun_apply, Pi.single_eq_of_ne h] -/-- For a standard basis vector in a weighted sum of squares, only one term in the sum is nonzero. -/ +/-- For a standard basis vector in a weighted sum of squares, only one term in the sum + is nonzero. -/ lemma QuadraticMap.weightedSumSquares_basis_vector {E : Type*} [AddCommGroup E] [Module โ„ E] {weights : Fin (finrank โ„ E) โ†’ โ„} {i : Fin (finrank โ„ E)} (v : Fin (finrank โ„ E) โ†’ โ„) @@ -143,7 +145,8 @@ theorem rankNeg_eq_zero {E : Type*} [AddCommGroup E] unfold QuadraticForm.negDim have h_exists := equivalent_signType_weighted_sum_squared q let w := Classical.choose h_exists - have h_equiv : QuadraticMap.Equivalent q (QuadraticMap.weightedSumSquares โ„ fun i => (w i : โ„)) := + have h_equiv : QuadraticMap.Equivalent q + (QuadraticMap.weightedSumSquares โ„ fun i => (w i : โ„)) := Classical.choose_spec h_exists have h_no_neg : โˆ€ i, w i โ‰  SignType.neg := QuadraticForm.posDef_no_neg_weights hq h_equiv @@ -242,7 +245,8 @@ instance TangentSpace.finiteDimensional (x : M) : FiniteDimensional โ„ (Tangent /-- Convert the metric's continuous linear map representation `val x` to the algebraic `LinearMap.BilinForm`. -/ -def toBilinForm (g : PseudoRiemannianMetric E H M n I) (x : M) : LinearMap.BilinForm โ„ (TangentSpace I x) where +def toBilinForm (g : PseudoRiemannianMetric E H M n I) (x : M) : + LinearMap.BilinForm โ„ (TangentSpace I x) where toFun := ฮป v => { toFun := ฮป w => g.val x v w, map_add' := ฮป wโ‚ wโ‚‚ => by simp only [ContinuousLinearMap.map_add, ContinuousLinearMap.add_apply], @@ -257,7 +261,8 @@ def toBilinForm (g : PseudoRiemannianMetric E H M n I) (x : M) : LinearMap.Bilin RingHom.id_apply, LinearMap.smul_apply] /-- Convert a pseudo-Riemannian metric at a point `x` to a quadratic form `v โ†ฆ gโ‚“(v, v)`. -/ -def toQuadraticForm (g : PseudoRiemannianMetric E H M n I) (x : M) : QuadraticForm โ„ (TangentSpace I x) := +def toQuadraticForm (g : PseudoRiemannianMetric E H M n I) (x : M) : + QuadraticForm โ„ (TangentSpace I x) := PseudoRiemannianMetricValToQuadraticForm g.val g.symm x -- Coercion from PseudoRiemannianMetric to its function representation. @@ -265,22 +270,27 @@ instance coeFunInst : CoeFun (PseudoRiemannianMetric E H M n I) (fun _ => โˆ€ x : M, TangentSpace I x โ†’L[โ„] (TangentSpace I x โ†’L[โ„] โ„)) where coe g := g.val -@[simp] lemma toBilinForm_apply (g : PseudoRiemannianMetric E H M n I) (x : M) (v w : TangentSpace I x) : +@[simp] lemma toBilinForm_apply (g : PseudoRiemannianMetric E H M n I) (x : M) + (v w : TangentSpace I x) : toBilinForm g x v w = g.val x v w := rfl -@[simp] lemma toQuadraticForm_apply (g : PseudoRiemannianMetric E H M n I) (x : M) (v : TangentSpace I x) : +@[simp] lemma toQuadraticForm_apply (g : PseudoRiemannianMetric E H M n I) (x : M) + (v : TangentSpace I x) : toQuadraticForm g x v = g.val x v v := rfl -@[simp] lemma toBilinForm_isSymm (g : PseudoRiemannianMetric E H M n I) (x : M) : (toBilinForm g x).IsSymm := by +@[simp] lemma toBilinForm_isSymm (g : PseudoRiemannianMetric E H M n I) (x : M) : + (toBilinForm g x).IsSymm := by intro v w; simp only [toBilinForm_apply]; exact g.symm x v w -@[simp] lemma toBilinForm_nondegenerate (g : PseudoRiemannianMetric E H M n I) (x : M) : (toBilinForm g x).Nondegenerate := by +@[simp] lemma toBilinForm_nondegenerate (g : PseudoRiemannianMetric E H M n I) (x : M) : + (toBilinForm g x).Nondegenerate := by intro v hv; simp_rw [toBilinForm_apply] at hv; exact g.nondegenerate x v hv lemma symm' (x : M) (v w : TangentSpace I x) : (g.val x v) w = (g.val x w) v := g.symm x v w -lemma nondegenerate' (x : M) (v : TangentSpace I x) (h : โˆ€ w : TangentSpace I x, (g.val x v) w = 0) : +lemma nondegenerate' (x : M) (v : TangentSpace I x) + (h : โˆ€ w : TangentSpace I x, (g.val x v) w = 0) : v = 0 := g.nondegenerate x v h @@ -295,7 +305,8 @@ lemma negDim_isLocallyConstant' : IsLocallyConstant (fun x => (toQuadraticForm g /-- The "musical" isomorphism (index lowering) from the tangent space to its dual, induced by a pseudo-Riemannian metric. -/ -def flat (g : PseudoRiemannianMetric E H M n I) (x : M) : TangentSpace I x โ†’โ‚—[โ„] (TangentSpace I x โ†’L[โ„] โ„) := +def flat (g : PseudoRiemannianMetric E H M n I) (x : M) : + TangentSpace I x โ†’โ‚—[โ„] (TangentSpace I x โ†’L[โ„] โ„) := { toFun := ฮป v => g.val x v, map_add' := ฮป v w => by simp only [ContinuousLinearMap.map_add], map_smul' := ฮป a v => by simp only [ContinuousLinearMap.map_smul]; rfl } @@ -304,7 +315,8 @@ def flat (g : PseudoRiemannianMetric E H M n I) (x : M) : TangentSpace I x โ†’ (flat g x v) w = g.val x v w := by rfl /-- The musical isomorphism as a continuous linear map. -/ -def flatL (g : PseudoRiemannianMetric E H M n I) (x : M) : TangentSpace I x โ†’L[โ„] (TangentSpace I x โ†’L[โ„] โ„) := +def flatL (g : PseudoRiemannianMetric E H M n I) (x : M) : + TangentSpace I x โ†’L[โ„] (TangentSpace I x โ†’L[โ„] โ„) := { toFun := ฮป v => g.val x v, map_add' := ฮป v w => by simp only [ContinuousLinearMap.map_add], map_smul' := ฮป a v => by simp only [ContinuousLinearMap.map_smul]; rfl, @@ -313,15 +325,17 @@ def flatL (g : PseudoRiemannianMetric E H M n I) (x : M) : TangentSpace I x โ†’L @[simp] lemma flatL_apply (g : PseudoRiemannianMetric E H M n I) (x : M) (v w : TangentSpace I x) : (flatL g x v) w = g.val x v w := rfl -@[simp] lemma flat_inj (g : PseudoRiemannianMetric E H M n I) (x : M) : Function.Injective (flat g x) := by +@[simp] lemma flat_inj (g : PseudoRiemannianMetric E H M n I) (x : M) : + Function.Injective (flat g x) := by rw [โ† LinearMap.ker_eq_bot]; apply LinearMap.ker_eq_bot'.mpr intro v hv; apply g.nondegenerate' x v; intro w; exact DFunLike.congr_fun hv w -@[simp] lemma flatL_inj (g : PseudoRiemannianMetric E H M n I) (x : M) : Function.Injective (flatL g x) := - flat_inj g x -- Injective on LinearMap implies injective on ContLinearMap +@[simp] lemma flatL_inj (g : PseudoRiemannianMetric E H M n I) (x : M) : + Function.Injective (flatL g x) := + flat_inj g x -/-- In a finite-dimensional normed space, the continuous dual is linearly equivalent to the algebraic dual. - This is because in finite dimensions, every linear functional is continuous. -/ +/-- In a finite-dimensional normed space, the continuous dual is linearly equivalent + to the algebraic dual. -/ def ContinuousLinearMap.equivModuleDual (๐•œ E : Type*) [NontriviallyNormedField ๐•œ] [CompleteSpace ๐•œ] [NormedAddCommGroup E] [NormedSpace ๐•œ E] [FiniteDimensional ๐•œ E] : (E โ†’L[๐•œ] ๐•œ) โ‰ƒโ‚—[๐•œ] Module.Dual ๐•œ E where @@ -462,7 +476,8 @@ noncomputable def sharp /-- The metric evaluated at `v` and `sharp ฯ‰`. -/ lemma apply_vec_sharp - (g : PseudoRiemannianMetric E H M n I) (x : M) (v : TangentSpace I x) (ฯ‰ : TangentSpace I x โ†’L[โ„] โ„) : + (g : PseudoRiemannianMetric E H M n I) (x : M) (v : TangentSpace I x) + (ฯ‰ : TangentSpace I x โ†’L[โ„] โ„) : g.val x v (g.sharpL x ฯ‰) = ฯ‰ v := by rw [g.symm' x v (g.sharpL x ฯ‰)] rw [โ† flatL_apply g x (g.sharpL x ฯ‰)] From caf4d53e75b3fac17a7c2799e6575029188e2ee9 Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Tue, 29 Apr 2025 01:48:27 +0200 Subject: [PATCH 11/32] fixes --- .../Geometry/Metric/Riemannian/Defs.lean | 2 - .../Geometry/Metric/Riemannian/DefsOrig.lean | 40 ++++++++++++++++++- 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean index 38f930912..30bdd2405 100644 --- a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean @@ -1,7 +1,5 @@ import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Defs import Mathlib.LinearAlgebra.QuadraticForm.Dual -import Mathlib.Analysis.InnerProductSpace.Basic - section RiemannianMetric open Bundle Set Finset Function Filter Module Topology ContinuousLinearMap diff --git a/PhysLean/Mathematics/Geometry/Metric/Riemannian/DefsOrig.lean b/PhysLean/Mathematics/Geometry/Metric/Riemannian/DefsOrig.lean index 21b8b5e86..410c850cd 100644 --- a/PhysLean/Mathematics/Geometry/Metric/Riemannian/DefsOrig.lean +++ b/PhysLean/Mathematics/Geometry/Metric/Riemannian/DefsOrig.lean @@ -63,10 +63,8 @@ structure RiemannianMetric /-- `gโ‚“(v, v) > 0` for all nonzero `v`. -/ pos_def' : โˆ€ x v, v โ‰  0 โ†’ val x v v > 0 - namespace RiemannianMetric --- Propagate instance assumptions variable {I_โ„ : ModelWithCorners โ„ E_โ„ H_โ„} {n : WithTop โ„•โˆž} variable [inst_top : TopologicalSpace (TangentBundle I_โ„ M_โ„)] variable [inst_fib : FiberBundle E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _)] @@ -233,3 +231,41 @@ noncomputable def TangentSpace.metricSeminormedAddCommGroup (x : M_โ„) : SeminormedAddCommGroup (TangentSpace I_โ„ x) := (TangentSpace.metricNormedAddCommGroup g x).toSeminormedAddCommGroup +/- +noncomputable def TangentSpace.metricInnerProductSpace + (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani inst_cmvb) + (x : M_โ„) : + InnerProductSpace โ„ (TangentSpace I_โ„ x) := by + + -- Ensure the underlying group structure is known + letI : AddCommGroup (TangentSpace I_โ„ x) := TangentSpace.addCommGroup x + letI : TopologicalSpace (TangentSpace I_โ„ x) := inferInstance + letI : TopologicalAddGroup (TangentSpace I_โ„ x) := inferInstance + letI : UniformSpace (TangentSpace I_โ„ x) := inferInstance + letI : UniformAddGroup (TangentSpace I_โ„ x) := โŸจโŸฉ + + -- Provide the specific SeminormedAddCommGroup instance + letI : SeminormedAddCommGroup (TangentSpace I_โ„ x) := + TangentSpace.metricSeminormedAddCommGroup g x + + -- Provide the NormedAddCommGroup instance + letI : NormedAddCommGroup (TangentSpace I_โ„ x) := + TangentSpace.metricNormedAddCommGroup g x + + -- Build the InnerProductSpace using the custom inner core + let core := tangentInnerCore g x + letI : NormedSpace โ„ (TangentSpace I_โ„ x) := + @InnerProductSpace.Core.toNormedSpace โ„ (TangentSpace I_โ„ x) _ _ _ core + exact InnerProductSpace.ofCore core + + +-- Check the norm_sq_eq_inner property holds for the constructed structure +lemma TangentSpace.metric_norm_sq_eq_inner + (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani inst_cmvb) + (x : M_โ„) (v : TangentSpace I_โ„ x) : + letI := TangentSpace.metricNormedAddCommGroup g x + โ€–vโ€– ^ 2 = g.inner x v v := by + letI := TangentSpace.metricInnerProductSpace g x + exact InnerProductSpace.norm_sq_eq_inner v +-/ +end RiemannianMetric From b158d58f60694318df0661e9bac1347fde5ef0e7 Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Tue, 29 Apr 2025 02:29:22 +0200 Subject: [PATCH 12/32] Delete DefsOrig.lean --- .../Geometry/Metric/Riemannian/DefsOrig.lean | 271 ------------------ 1 file changed, 271 deletions(-) delete mode 100644 PhysLean/Mathematics/Geometry/Metric/Riemannian/DefsOrig.lean diff --git a/PhysLean/Mathematics/Geometry/Metric/Riemannian/DefsOrig.lean b/PhysLean/Mathematics/Geometry/Metric/Riemannian/DefsOrig.lean deleted file mode 100644 index 410c850cd..000000000 --- a/PhysLean/Mathematics/Geometry/Metric/Riemannian/DefsOrig.lean +++ /dev/null @@ -1,271 +0,0 @@ -/- -Copyright (c) 2025 Matteo Cipollina. All rights reserved. -Released under Apache 2.0 license as described in the file LICENSE. -Authors: Matteo Cipollina --/ - -import Mathlib.LinearAlgebra.QuadraticForm.Dual -import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Defs - -/-! -# Riemannian Metrics on Manifolds - -/-! -This file introduces `RiemannianMetric`, a smooth positiveโ€definite specialization of -`PseudoRiemannianMetric` over โ„. It requires that each bilinear form `gโ‚“` satisfy -`gโ‚“(v,v) > 0` for nonzero tangent vectors `v`, and uses this to define the canonical -inner product, norm, and distance on each tangent space. (TODO: assemble these -data into an `InnerProductSpace โ„ (TangentSpace I_โ„ x)` instance). --/ - -## Main Definitions - -* `RiemannianMetric I n M`: A structure representing a `C^n` Riemannian metric on a manifold `M` - modelled on `(E_โ„, H_โ„)` with model `I_โ„`. This specializes `PseudoRiemannianMetric` to the - case where the base field is `โ„` and requires the bilinear form `gโ‚“` at each point `x` to be - positive-definite. -* `RiemannianMetric.inner g x`: The inner product (bilinear form `gโ‚“`) on the tangent space `Tโ‚“M`. -* `RiemannianMetric.sharp g x`: The musical isomorphism (index raising) from the cotangent space - `T*โ‚“M` to the tangent space `Tโ‚“M`, which is an isomorphism in the Riemannian case due to - positive definiteness. -* `RiemannianMetric.toQuadraticForm g x`: Expresses the metric at point `x` as a quadratic form. - -## Implementation Notes - -* Extends `PseudoRiemannianMetric` by fixing the base field to `โ„` and adding the `pos_def'` - field, ensuring `gโ‚“(v, v) > 0` for non-zero `v`. -* The positive definiteness allows defining an `InnerProductSpace โ„ (Tโ‚“M)` instance on each - tangent space `Tโ‚“M`. --/ -universe u v w - -open PseudoRiemannianMetric Bundle ContinuousLinearMap - -noncomputable section - -variable {E_โ„ : Type v} [NormedAddCommGroup E_โ„] [NormedSpace โ„ E_โ„] [FiniteDimensional โ„ E_โ„] -variable {H_โ„ : Type w} [TopologicalSpace H_โ„] -variable {M_โ„ : Type w} [TopologicalSpace M_โ„] [ChartedSpace H_โ„ M_โ„] [ChartedSpace H_โ„ E_โ„] - -/-- A Riemannian metric of smoothness class `n` on a manifold `M` over `โ„`. - This extends a pseudo-Riemannian metric with the positive definiteness condition. -/ -@[ext] -structure RiemannianMetric - (I_โ„ : ModelWithCorners โ„ E_โ„ H_โ„) - (n : WithTop โ„•โˆž) - [inst_top : TopologicalSpace (TangentBundle I_โ„ M_โ„)] - [inst_fib : FiberBundle E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _)] - [inst_vec : VectorBundle โ„ E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _)] - [inst_mani : IsManifold I_โ„ (n + 1) M_โ„] - [inst_cmvb : ContMDiffVectorBundle n E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _) I_โ„] - extends @PseudoRiemannianMetric โ„ Real.instRCLike E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib - inst_vec inst_mani inst_cmvb where - /-- `gโ‚“(v, v) > 0` for all nonzero `v`. -/ - pos_def' : โˆ€ x v, v โ‰  0 โ†’ val x v v > 0 - -namespace RiemannianMetric - -variable {I_โ„ : ModelWithCorners โ„ E_โ„ H_โ„} {n : WithTop โ„•โˆž} -variable [inst_top : TopologicalSpace (TangentBundle I_โ„ M_โ„)] -variable [inst_fib : FiberBundle E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _)] -variable [inst_vec : VectorBundle โ„ E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _)] -variable [inst_mani : IsManifold I_โ„ (n + 1) M_โ„] -variable [inst_cmvb : ContMDiffVectorBundle n E_โ„ (TangentSpace I_โ„ : M_โ„ โ†’ Type _) I_โ„] - -/-- Coercion from RiemannianMetric to its underlying PseudoRiemannianMetric. -/ -instance : Coe (@RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani - inst_cmvb) - (@PseudoRiemannianMetric โ„ Real.instRCLike E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top - inst_fib inst_vec inst_mani inst_cmvb) where - coe g := g.toPseudoRiemannianMetric - -omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in -@[simp] lemma pos_def (g : RiemannianMetric I_โ„ n) (x : M_โ„) (v : TangentSpace I_โ„ x) (hv : v โ‰  0) : - (g.toPseudoRiemannianMetric.val x v) v > 0 := g.pos_def' x v hv - -/-- The inverse of the musical isomorphism (index raising), which is an isomorphism - in the Riemannian case. This is well-defined because the metric is positive definite. -/ -def sharp - (g : (@RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani - inst_cmvb)) (x : M_โ„) : - Module.Dual โ„ (TangentSpace I_โ„ x) โ‰ƒโ‚—[โ„] TangentSpace I_โ„ x := - let bilin := g.toPseudoRiemannianMetric.toBilinForm x - have h_nondeg : bilin.Nondegenerate := - g.toPseudoRiemannianMetric.toBilinForm_nondegenerate x - LinearEquiv.symm (bilin.toDual h_nondeg) - -/-- Express a Riemannian metric at a point as a quadratic form. -/ -abbrev toQuadraticForm - (g : (@RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani - inst_cmvb)) - (x : M_โ„) : - QuadraticForm โ„ (TangentSpace I_โ„ x) := - g.toPseudoRiemannianMetric.toQuadraticForm x - -omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in -/-- The quadratic form associated with a Riemannian metric is positive definite. -/ -lemma toQuadraticForm_posDef (g : RiemannianMetric I_โ„ n) (x : M_โ„) : - (g.toQuadraticForm x).PosDef := - ฮป v hv => g.pos_def x v hv - -omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in -/-- The application of a Riemannian metric's quadratic form to a vector. -/ -lemma toQuadraticForm_apply (g : RiemannianMetric I_โ„ n) (x : M_โ„) - (v : TangentSpace I_โ„ x) : - g.toQuadraticForm x v = g.val x v v := by - simp only [toQuadraticForm, PseudoRiemannianMetric.toQuadraticForm_apply] - -omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in -/-- A positive definite quadratic form is nondegenerate. -/ -lemma posDef_to_nondegenerate [Invertible (2 : โ„)] - (g : RiemannianMetric I_โ„ n) (x : M_โ„) : - (QuadraticMap.associated (R := โ„) (N := โ„) (g.toQuadraticForm x)).Nondegenerate := by - let Q := g.toQuadraticForm x - let B := QuadraticMap.associated (R := โ„) (N := โ„) Q - constructor - ยท intro v h_all_zero_w - specialize h_all_zero_w v - have h_assoc_self : B v v = Q v := - QuadraticMap.associated_eq_self_apply โ„ Q v - rw [h_assoc_self] at h_all_zero_w - by_cases h_v_zero : v = 0 - ยท exact h_v_zero - ยท have h_quad_pos : Q v > 0 := g.pos_def x v h_v_zero - linarith [h_all_zero_w, h_quad_pos] - ยท intro w h_all_zero_v - specialize h_all_zero_v w - have h_assoc_self : B w w = Q w := - QuadraticMap.associated_eq_self_apply โ„ Q w - rw [h_assoc_self] at h_all_zero_v - by_cases h_w_zero : w = 0 - ยท exact h_w_zero - ยท have h_quad_pos : Q w > 0 := g.pos_def x w h_w_zero - linarith [h_all_zero_v, h_quad_pos] - -/-- The isometry between `(Q.prod <| -Q)` and `QuadraticForm.dualProd`, - where `Q` is the quadratic form associated with the Riemannian metric at `x`. -/ -abbrev toDualProdIso [Invertible (2 : โ„)] (g : RiemannianMetric I_โ„ n) (x : M_โ„) : - ((g.toQuadraticForm x).prod <| -(g.toQuadraticForm x)) โ†’qแตข - (QuadraticForm.dualProd โ„ (TangentSpace I_โ„ x)) := - QuadraticForm.toDualProd (g.toQuadraticForm x) - -/-- The inner product on the tangent space at point `x` induced by the Riemannian metric `g`. -/ -def inner - (g : (@RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani - inst_cmvb)) (x : M_โ„) (v w : TangentSpace I_โ„ x) : โ„ := - g.toPseudoRiemannianMetric.val x v w - -omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in -@[simp] lemma inner_apply (g : RiemannianMetric I_โ„ n) (x : M_โ„) (v w : TangentSpace I_โ„ x) : - inner g x v w = g.val x v w := rfl - -variable (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n _ _ _ _ _) (x : M_โ„) - -omit [FiniteDimensional โ„ E_โ„] [ChartedSpace H_โ„ E_โ„] in -/-- Pointwise symmetry of the inner product. -/ -lemma inner_symm (v w : TangentSpace I_โ„ x) : - g.inner x v w = g.inner x w v := by - simp only [inner_apply] - exact g.toPseudoRiemannianMetric.symm' x v w - -/-- The inner product space core for the tangent space at a point, derived from the -Riemannian metric. -/ -noncomputable def tangentInnerCore - (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani inst_cmvb) - (x : M_โ„) : - InnerProductSpace.Core โ„ (TangentSpace I_โ„ x) where - inner := ฮป v w => g.inner x v w - conj_symm := ฮป v w => by - simp only [inner_apply, conj_trivial] - exact g.toPseudoRiemannianMetric.symm' x w v - nonneg_re := ฮป v => by - simp only [inner_apply, RCLike.re_to_real] - by_cases hv : v = 0 - ยท simp [hv, inner_apply, map_zero, zero_apply] - ยท exact le_of_lt (g.pos_def x v hv) - add_left := ฮป u v w => by - simp only [inner_apply, map_add, add_apply] - smul_left := ฮป r u v => by - simp only [inner_apply, map_smul, smul_apply, conj_trivial] - rfl - definite := fun v (h_inner_zero : g.inner x v v = 0) => by - by_contra h_v_ne_zero - have h_pos : g.inner x v v > 0 := g.pos_def x v h_v_ne_zero - linarith [h_inner_zero, h_pos] - -/-! ### Inner product space structure. -/ - -/-- Normed additive commutative group structure on the tangent space at a point `x`, -derived from the Riemannian metric `g`. -/ -noncomputable def TangentSpace.metricNormedAddCommGroup - (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani inst_cmvb) - (x : M_โ„) : - NormedAddCommGroup (TangentSpace I_โ„ x) := - @InnerProductSpace.Core.toNormedAddCommGroup โ„ (TangentSpace I_โ„ x) _ _ _ (tangentInnerCore g x) - -/-- The pre-inner product space core for the tangent space at a point, -derived from the Riemannian metric. -/ -noncomputable def tangentPreInnerCore - (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani inst_cmvb) - (x : M_โ„) : - PreInnerProductSpace.Core โ„ (TangentSpace I_โ„ x) where - inner := ฮป v w => g.inner x v w - conj_symm := ฮป v w => by - simp only [inner_apply, conj_trivial] - exact g.toPseudoRiemannianMetric.symm' x w v - nonneg_re := ฮป v => by - simp only [inner_apply, RCLike.re_to_real] - by_cases hv : v = 0 - ยท simp [hv, inner_apply, map_zero, zero_apply] - ยท exact le_of_lt (g.pos_def x v hv) - add_left := ฮป u v w => by - simp only [inner_apply, map_add, add_apply] - smul_left := ฮป r u v => by - simp only [inner_apply, map_smul, smul_apply, conj_trivial] - rfl - -/-- Each tangent space carries a seminormed add comm group structure derived from -the Riemannian metric -/ -noncomputable def TangentSpace.metricSeminormedAddCommGroup - (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani inst_cmvb) - (x : M_โ„) : - SeminormedAddCommGroup (TangentSpace I_โ„ x) := - (TangentSpace.metricNormedAddCommGroup g x).toSeminormedAddCommGroup -/- -noncomputable def TangentSpace.metricInnerProductSpace - (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani inst_cmvb) - (x : M_โ„) : - InnerProductSpace โ„ (TangentSpace I_โ„ x) := by - - -- Ensure the underlying group structure is known - letI : AddCommGroup (TangentSpace I_โ„ x) := TangentSpace.addCommGroup x - letI : TopologicalSpace (TangentSpace I_โ„ x) := inferInstance - letI : TopologicalAddGroup (TangentSpace I_โ„ x) := inferInstance - letI : UniformSpace (TangentSpace I_โ„ x) := inferInstance - letI : UniformAddGroup (TangentSpace I_โ„ x) := โŸจโŸฉ - - -- Provide the specific SeminormedAddCommGroup instance - letI : SeminormedAddCommGroup (TangentSpace I_โ„ x) := - TangentSpace.metricSeminormedAddCommGroup g x - - -- Provide the NormedAddCommGroup instance - letI : NormedAddCommGroup (TangentSpace I_โ„ x) := - TangentSpace.metricNormedAddCommGroup g x - - -- Build the InnerProductSpace using the custom inner core - let core := tangentInnerCore g x - letI : NormedSpace โ„ (TangentSpace I_โ„ x) := - @InnerProductSpace.Core.toNormedSpace โ„ (TangentSpace I_โ„ x) _ _ _ core - exact InnerProductSpace.ofCore core - - --- Check the norm_sq_eq_inner property holds for the constructed structure -lemma TangentSpace.metric_norm_sq_eq_inner - (g : @RiemannianMetric E_โ„ _ _ H_โ„ _ M_โ„ _ _ I_โ„ n inst_top inst_fib inst_vec inst_mani inst_cmvb) - (x : M_โ„) (v : TangentSpace I_โ„ x) : - letI := TangentSpace.metricNormedAddCommGroup g x - โ€–vโ€– ^ 2 = g.inner x v v := by - letI := TangentSpace.metricInnerProductSpace g x - exact InnerProductSpace.norm_sq_eq_inner v --/ -end RiemannianMetric From 456c233641f2a096f252383650afe6e494789a96 Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Tue, 29 Apr 2025 02:41:51 +0200 Subject: [PATCH 13/32] fix --- .../Metric/PseudoRiemannian/Defs.lean | 46 +++++++++---------- .../Geometry/Metric/Riemannian/Defs.lean | 7 +++ 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean index 22d87d9f9..dfab1dea6 100644 --- a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean @@ -58,14 +58,12 @@ variable {K : Type*} [Field K] [LinearOrder K] of a maximal negative definite subspace. -/ noncomputable def negDim {E : Type*} [AddCommGroup E] [Module โ„ E] [FiniteDimensional โ„ E] - (q : QuadraticForm โ„ E) : โ„• := - by - classical - let P : (Fin (finrank โ„ E) โ†’ SignType) โ†’ Prop := fun w => - QuadraticMap.Equivalent q (QuadraticMap.weightedSumSquares โ„ fun i => (w i : โ„)) - let h_exists : โˆƒ w, P w := QuadraticForm.equivalent_signType_weighted_sum_squared q - let w := Classical.choose h_exists - exact Finset.card (Finset.filter (fun i => w i = SignType.neg) Finset.univ) + (q : QuadraticForm โ„ E) : โ„• := by classical + let P : (Fin (finrank โ„ E) โ†’ SignType) โ†’ Prop := fun w => + QuadraticMap.Equivalent q (QuadraticMap.weightedSumSquares โ„ fun i => (w i : โ„)) + let h_exists : โˆƒ w, P w := QuadraticForm.equivalent_signType_weighted_sum_squared q + let w := Classical.choose h_exists + exact Finset.card (Finset.filter (fun i => w i = SignType.neg) Finset.univ) /-- The i-th standard basis vector has a 1 in the i-th position. -/ lemma Pi.basisFun_apply_same {๐•œ ฮน : Type*} [Field ๐•œ] [Fintype ฮน] [DecidableEq ฮน] (i : ฮน) : @@ -290,12 +288,12 @@ lemma symm' (x : M) (v w : TangentSpace I x) : (g.val x v) w = (g.val x w) v := g.symm x v w lemma nondegenerate' (x : M) (v : TangentSpace I x) - (h : โˆ€ w : TangentSpace I x, (g.val x v) w = 0) : - v = 0 := + (h : โˆ€ w : TangentSpace I x, (g.val x v) w = 0) : + v = 0 := g.nondegenerate x v h lemma smooth' (xโ‚€ : M) (v w : E) : - ContDiffWithinAt โ„ n (fun y => g.val ((extChartAt I xโ‚€).symm y) + ContDiffWithinAt โ„ n (fun y => g.val ((extChartAt I xโ‚€).symm y) (mfderiv I I ((extChartAt I xโ‚€).symm) y v) (mfderiv I I ((extChartAt I xโ‚€).symm) y w)) ((extChartAt I xโ‚€).target) ((extChartAt I xโ‚€) xโ‚€) := g.smooth_in_charts' xโ‚€ v w @@ -406,37 +404,37 @@ lemma finrank_continuousDual_eq_finrank {๐•œ E : Type*} [NontriviallyNormedFiel โŸจg.flatL_inj x, g.flatL_surj xโŸฉ) lemma coe_flatEquiv - (g : PseudoRiemannianMetric E H M n I) (x : M) : + (g : PseudoRiemannianMetric E H M n I) (x : M) : (g.flatEquiv x : TangentSpace I x โ†’โ‚—[โ„] (TangentSpace I x โ†’L[โ„] โ„)) = g.flatL x := rfl @[simp] lemma flatEquiv_apply - (g : PseudoRiemannianMetric E H M n I) (x : M) (v w : TangentSpace I x) : + (g : PseudoRiemannianMetric E H M n I) (x : M) (v w : TangentSpace I x) : (g.flatEquiv x v) w = g.val x v w := rfl /-- The "musical" isomorphism (index raising) from the dual of the tangent space to the tangent space, induced by a pseudo-Riemannian metric. This is the inverse of `flatEquiv`. -/ def sharpEquiv - (g : PseudoRiemannianMetric E H M n I) (x : M) : + (g : PseudoRiemannianMetric E H M n I) (x : M) : (TangentSpace I x โ†’L[โ„] โ„) โ‰ƒL[โ„] TangentSpace I x := (g.flatEquiv x).symm /-- The index raising map `sharp` as a continuous linear map. -/ def sharpL - (g : PseudoRiemannianMetric E H M n I) (x : M) : + (g : PseudoRiemannianMetric E H M n I) (x : M) : (TangentSpace I x โ†’L[โ„] โ„) โ†’L[โ„] TangentSpace I x := (g.sharpEquiv x).toContinuousLinearMap lemma sharpL_eq_toContinuousLinearMap - (g : PseudoRiemannianMetric E H M n I) (x : M) : + (g : PseudoRiemannianMetric E H M n I) (x : M) : g.sharpL x = (g.sharpEquiv x).toContinuousLinearMap := rfl lemma coe_sharpEquiv - (g : PseudoRiemannianMetric E H M n I) (x : M) : + (g : PseudoRiemannianMetric E H M n I) (x : M) : (g.sharpEquiv x : (TangentSpace I x โ†’L[โ„] โ„) โ†’L[โ„] TangentSpace I x) = g.sharpL x := rfl /-- The index raising map `sharp` as a linear map. -/ noncomputable def sharp - (g : PseudoRiemannianMetric E H M n I) (x : M) : + (g : PseudoRiemannianMetric E H M n I) (x : M) : (TangentSpace I x โ†’L[โ„] โ„) โ†’โ‚—[โ„] TangentSpace I x := (g.sharpEquiv x).toLinearEquiv.toLinearMap @@ -446,13 +444,13 @@ noncomputable def sharp (g.flatEquiv x).left_inv v @[simp] lemma flatL_apply_sharpL - (g : PseudoRiemannianMetric E H M n I) (x : M) (ฯ‰ : TangentSpace I x โ†’L[โ„] โ„) : + (g : PseudoRiemannianMetric E H M n I) (x : M) (ฯ‰ : TangentSpace I x โ†’L[โ„] โ„) : g.flatL x (g.sharpL x ฯ‰) = ฯ‰ := (g.flatEquiv x).right_inv ฯ‰ /-- Applying `sharp` then `flat` recovers the original covector. -/ @[simp] lemma flat_sharp_apply - (g : PseudoRiemannianMetric E H M n I) (x : M) (ฯ‰ : TangentSpace I x โ†’L[โ„] โ„) : + (g : PseudoRiemannianMetric E H M n I) (x : M) (ฯ‰ : TangentSpace I x โ†’L[โ„] โ„) : g.flat x (g.sharp x ฯ‰) = ฯ‰ := by have := flatL_apply_sharpL g x ฯ‰ simp only [sharp, sharpL, flat, flatL, coe_flatEquiv]; simp only [coe_sharpEquiv, @@ -460,7 +458,7 @@ noncomputable def sharp exact this @[simp] lemma sharp_flat_apply - (g : PseudoRiemannianMetric E H M n I) (x : M) (v : TangentSpace I x) : + (g : PseudoRiemannianMetric E H M n I) (x : M) (v : TangentSpace I x) : g.sharp x (g.flat x v) = v := by have := sharpL_apply_flatL g x v simp only [sharp, sharpL, flat, flatL]; simp only [coe_flatEquiv, coe_sharpEquiv, @@ -469,15 +467,15 @@ noncomputable def sharp /-- The metric evaluated at `sharp ฯ‰โ‚` and `sharp ฯ‰โ‚‚`. -/ @[simp] lemma apply_sharp_sharp - (g : PseudoRiemannianMetric E H M n I) (x : M) (ฯ‰โ‚ ฯ‰โ‚‚ : TangentSpace I x โ†’L[โ„] โ„) : + (g : PseudoRiemannianMetric E H M n I) (x : M) (ฯ‰โ‚ ฯ‰โ‚‚ : TangentSpace I x โ†’L[โ„] โ„) : g.val x (g.sharpL x ฯ‰โ‚) (g.sharpL x ฯ‰โ‚‚) = ฯ‰โ‚ (g.sharpL x ฯ‰โ‚‚) := by rw [โ† flatL_apply g x (g.sharpL x ฯ‰โ‚)] rw [flatL_apply_sharpL g x ฯ‰โ‚] /-- The metric evaluated at `v` and `sharp ฯ‰`. -/ lemma apply_vec_sharp - (g : PseudoRiemannianMetric E H M n I) (x : M) (v : TangentSpace I x) - (ฯ‰ : TangentSpace I x โ†’L[โ„] โ„) : + (g : PseudoRiemannianMetric E H M n I) (x : M) (v : TangentSpace I x) + (ฯ‰ : TangentSpace I x โ†’L[โ„] โ„) : g.val x v (g.sharpL x ฯ‰) = ฯ‰ v := by rw [g.symm' x v (g.sharpL x ฯ‰)] rw [โ† flatL_apply g x (g.sharpL x ฯ‰)] diff --git a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean index 30bdd2405..0dfab583f 100644 --- a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean @@ -1,5 +1,12 @@ +/- +Copyright (c) 2025 Matteo Cipollina. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Matteo Cipollina +-/ + import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Defs import Mathlib.LinearAlgebra.QuadraticForm.Dual + section RiemannianMetric open Bundle Set Finset Function Filter Module Topology ContinuousLinearMap From 8df93c2f04115ac6e45f6803fd29745d68f588c8 Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Tue, 29 Apr 2025 02:55:05 +0200 Subject: [PATCH 14/32] fix lints --- .../Metric/PseudoRiemannian/Defs.lean | 21 +++++++------------ .../Geometry/Metric/Riemannian/Defs.lean | 6 ++++++ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean index dfab1dea6..e6db5149e 100644 --- a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean @@ -67,13 +67,12 @@ noncomputable def negDim {E : Type*} [AddCommGroup E] /-- The i-th standard basis vector has a 1 in the i-th position. -/ lemma Pi.basisFun_apply_same {๐•œ ฮน : Type*} [Field ๐•œ] [Fintype ฮน] [DecidableEq ฮน] (i : ฮน) : - (Pi.basisFun ๐•œ ฮน) i i = 1 := by + (Pi.basisFun ๐•œ ฮน) i i = 1 := by simp only [Pi.basisFun_apply, Pi.single_eq_same] /-- The i-th standard basis vector has 0 in all positions j โ‰  i. -/ lemma Pi.basisFun_apply_ne {๐•œ ฮน : Type*} [Field ๐•œ] [Fintype ฮน] [DecidableEq ฮน] (i j : ฮน) - (h : j โ‰  i) : - (Pi.basisFun ๐•œ ฮน) i j = 0 := by + (h : j โ‰  i) : (Pi.basisFun ๐•œ ฮน) i j = 0 := by simp only [Pi.basisFun_apply, Pi.single_eq_of_ne h] /-- For a standard basis vector in a weighted sum of squares, only one term in the sum @@ -288,15 +287,12 @@ lemma symm' (x : M) (v w : TangentSpace I x) : (g.val x v) w = (g.val x w) v := g.symm x v w lemma nondegenerate' (x : M) (v : TangentSpace I x) - (h : โˆ€ w : TangentSpace I x, (g.val x v) w = 0) : - v = 0 := - g.nondegenerate x v h + (h : โˆ€ w : TangentSpace I x, (g.val x v) w = 0) : v = 0 := g.nondegenerate x v h lemma smooth' (xโ‚€ : M) (v w : E) : ContDiffWithinAt โ„ n (fun y => g.val ((extChartAt I xโ‚€).symm y) (mfderiv I I ((extChartAt I xโ‚€).symm) y v) (mfderiv I I ((extChartAt I xโ‚€).symm) y w)) - ((extChartAt I xโ‚€).target) ((extChartAt I xโ‚€) xโ‚€) := - g.smooth_in_charts' xโ‚€ v w + ((extChartAt I xโ‚€).target) ((extChartAt I xโ‚€) xโ‚€) := g.smooth_in_charts' xโ‚€ v w lemma negDim_isLocallyConstant' : IsLocallyConstant (fun x => (toQuadraticForm g x).negDim) := g.negDim_isLocallyConstant @@ -421,8 +417,7 @@ def sharpEquiv /-- The index raising map `sharp` as a continuous linear map. -/ def sharpL (g : PseudoRiemannianMetric E H M n I) (x : M) : - (TangentSpace I x โ†’L[โ„] โ„) โ†’L[โ„] TangentSpace I x := - (g.sharpEquiv x).toContinuousLinearMap + (TangentSpace I x โ†’L[โ„] โ„) โ†’L[โ„] TangentSpace I x := (g.sharpEquiv x).toContinuousLinearMap lemma sharpL_eq_toContinuousLinearMap (g : PseudoRiemannianMetric E H M n I) (x : M) : @@ -435,8 +430,7 @@ lemma coe_sharpEquiv /-- The index raising map `sharp` as a linear map. -/ noncomputable def sharp (g : PseudoRiemannianMetric E H M n I) (x : M) : - (TangentSpace I x โ†’L[โ„] โ„) โ†’โ‚—[โ„] TangentSpace I x := - (g.sharpEquiv x).toLinearEquiv.toLinearMap + (TangentSpace I x โ†’L[โ„] โ„) โ†’โ‚—[โ„] TangentSpace I x := (g.sharpEquiv x).toLinearEquiv.toLinearMap @[simp] lemma sharpL_apply_flatL (g : PseudoRiemannianMetric E H M n I) (x : M) (v : TangentSpace I x) : @@ -445,8 +439,7 @@ noncomputable def sharp @[simp] lemma flatL_apply_sharpL (g : PseudoRiemannianMetric E H M n I) (x : M) (ฯ‰ : TangentSpace I x โ†’L[โ„] โ„) : - g.flatL x (g.sharpL x ฯ‰) = ฯ‰ := - (g.flatEquiv x).right_inv ฯ‰ + g.flatL x (g.sharpL x ฯ‰) = ฯ‰ := (g.flatEquiv x).right_inv ฯ‰ /-- Applying `sharp` then `flat` recovers the original covector. -/ @[simp] lemma flat_sharp_apply diff --git a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean index 0dfab583f..4eda3f7ba 100644 --- a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean @@ -7,6 +7,12 @@ Authors: Matteo Cipollina import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Defs import Mathlib.LinearAlgebra.QuadraticForm.Dual +/-! +# Riemannian Metric Definitions + +This module defines the Riemannian metric, building on pseudo-Riemannian metrics. +-/ +namespace PseudoRiemannianMetric section RiemannianMetric open Bundle Set Finset Function Filter Module Topology ContinuousLinearMap From 95e8d3a739c9fb559ca6d4d692ec314dd03eea26 Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Tue, 29 Apr 2025 14:41:11 +0200 Subject: [PATCH 15/32] fix lints --- .../Metric/PseudoRiemannian/Defs.lean | 123 ++++++++++++++++++ .../Geometry/Metric/Riemannian/Defs.lean | 36 ++++- 2 files changed, 156 insertions(+), 3 deletions(-) diff --git a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean index e6db5149e..a020f5289 100644 --- a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean @@ -475,3 +475,126 @@ lemma apply_vec_sharp rw [flatL_apply_sharpL g x ฯ‰] end PseudoRiemannianMetric + +namespace PseudoRiemannianMetric + +variable {E : Type v} {H : Type w} {M : Type w} {n : WithTop โ„•โˆž} +variable [NormedAddCommGroup E] [NormedSpace โ„ E] [FiniteDimensional โ„ E] +variable [TopologicalSpace H] [TopologicalSpace M] [ChartedSpace H M] [ChartedSpace H E] +variable {I : ModelWithCorners โ„ E H} +variable [IsManifold I (n + 1) M] +variable [TopologicalSpace (TotalSpace E (TangentSpace I : M โ†’ Type _))] +variable [FiberBundle E (TangentSpace I : M โ†’ Type _)] +variable [VectorBundle โ„ E (TangentSpace I : M โ†’ Type _)] +variable [ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] +variable [inst_tangent_findim : โˆ€ (x : M), FiniteDimensional โ„ (TangentSpace I x)] + +section Cotangent + +/-- The value of the induced metric on the cotangent space at point `x`. -/ +noncomputable def cotangentMetricVal (g : PseudoRiemannianMetric E H M n I) (x : M) + (ฯ‰โ‚ ฯ‰โ‚‚ : TangentSpace I x โ†’L[โ„] โ„) : โ„ := + g.val x (g.sharpL x ฯ‰โ‚) (g.sharpL x ฯ‰โ‚‚) + +@[simp] lemma cotangentMetricVal_eq_apply_sharp (g : PseudoRiemannianMetric E H M n I) (x : M) + (ฯ‰โ‚ ฯ‰โ‚‚ : TangentSpace I x โ†’L[โ„] โ„) : + cotangentMetricVal g x ฯ‰โ‚ ฯ‰โ‚‚ = ฯ‰โ‚ (g.sharpL x ฯ‰โ‚‚) := by + rw [cotangentMetricVal, apply_sharp_sharp] + +lemma cotangentMetricVal_symm (g : PseudoRiemannianMetric E H M n I) (x : M) + (ฯ‰โ‚ ฯ‰โ‚‚ : TangentSpace I x โ†’L[โ„] โ„) : + cotangentMetricVal g x ฯ‰โ‚ ฯ‰โ‚‚ = cotangentMetricVal g x ฯ‰โ‚‚ ฯ‰โ‚ := by + unfold cotangentMetricVal + rw [g.symm' x (g.sharpL x ฯ‰โ‚) (g.sharpL x ฯ‰โ‚‚)] + +/-- The induced metric on the cotangent space at point `x` as a bilinear form. -/ +noncomputable def cotangentToBilinForm (g : PseudoRiemannianMetric E H M n I) (x : M) : + LinearMap.BilinForm โ„ (TangentSpace I x โ†’L[โ„] โ„) where + toFun ฯ‰โ‚ := { toFun := ฮป ฯ‰โ‚‚ => cotangentMetricVal g x ฯ‰โ‚ ฯ‰โ‚‚, + map_add' := ฮป ฯ‰โ‚‚ ฯ‰โ‚ƒ => by + simp only [cotangentMetricVal, + ContinuousLinearMap.map_add, + ContinuousLinearMap.add_apply], + map_smul' := ฮป c ฯ‰โ‚‚ => by + simp only [cotangentMetricVal, + map_smul, smul_eq_mul, RingHom.id_apply] } + map_add' := ฮป ฯ‰โ‚ ฯ‰โ‚‚ => by + ext ฯ‰โ‚ƒ + simp only [cotangentMetricVal, + ContinuousLinearMap.map_add, + ContinuousLinearMap.add_apply, + LinearMap.coe_mk, AddHom.coe_mk, LinearMap.add_apply] + map_smul' := ฮป c ฯ‰โ‚ => by + ext ฯ‰โ‚‚ + simp only [cotangentMetricVal, + ContinuousLinearMap.map_smul, + ContinuousLinearMap.smul_apply, + LinearMap.coe_mk, AddHom.coe_mk, + RingHom.id_apply, LinearMap.smul_apply] + +/-- The induced metric on the cotangent space at point `x` as a quadratic form. -/ +noncomputable def cotangentToQuadraticForm (g : PseudoRiemannianMetric E H M n I) (x : M) : + QuadraticForm โ„ (TangentSpace I x โ†’L[โ„] โ„) where + toFun ฯ‰ := cotangentMetricVal g x ฯ‰ ฯ‰ + toFun_smul a ฯ‰ := by + simp only [cotangentMetricVal, + ContinuousLinearMap.map_smul, + ContinuousLinearMap.smul_apply, + smul_smul, pow_two] + exists_companion' := + โŸจ LinearMap.mkโ‚‚ โ„ (fun ฯ‰โ‚ ฯ‰โ‚‚ => + cotangentMetricVal g x ฯ‰โ‚ ฯ‰โ‚‚ + cotangentMetricVal g x ฯ‰โ‚‚ ฯ‰โ‚) + (fun ฯ‰โ‚ ฯ‰โ‚‚ ฯ‰โ‚ƒ => by simp only [cotangentMetricVal, map_add, add_apply]; ring) + (fun a ฯ‰โ‚ ฯ‰โ‚‚ => by + simp only [cotangentMetricVal, map_smul, smul_apply]; + ring_nf; exact Eq.symm (smul_add ..)) + (fun ฯ‰โ‚ ฯ‰โ‚‚ ฯ‰โ‚ƒ => by + simp only [cotangentMetricVal, map_add, add_apply]; ring) + (fun a ฯ‰โ‚ ฯ‰โ‚‚ => by + simp only [cotangentMetricVal, map_smul, smul_apply]; ring_nf; + exact Eq.symm (smul_add ..)), + by + intro ฯ‰โ‚ ฯ‰โ‚‚ + simp only [LinearMap.mkโ‚‚_apply, cotangentMetricVal] + simp only [ContinuousLinearMap.map_add, ContinuousLinearMap.add_apply] + ringโŸฉ + +@[simp] lemma cotangentToBilinForm_apply (g : PseudoRiemannianMetric E H M n I) (x : M) + (ฯ‰โ‚ ฯ‰โ‚‚ : TangentSpace I x โ†’L[โ„] โ„) : + cotangentToBilinForm g x ฯ‰โ‚ ฯ‰โ‚‚ = cotangentMetricVal g x ฯ‰โ‚ ฯ‰โ‚‚ := rfl + +@[simp] lemma cotangentToQuadraticForm_apply (g : PseudoRiemannianMetric E H M n I) (x : M) + (ฯ‰ : TangentSpace I x โ†’L[โ„] โ„) : + cotangentToQuadraticForm g x ฯ‰ = cotangentMetricVal g x ฯ‰ ฯ‰ := rfl + +@[simp] lemma cotangentToBilinForm_isSymm (g : PseudoRiemannianMetric E H M n I) (x : M) : + (cotangentToBilinForm g x).IsSymm := by + intro ฯ‰โ‚ ฯ‰โ‚‚; simp only [cotangentToBilinForm_apply]; exact cotangentMetricVal_symm g x ฯ‰โ‚ ฯ‰โ‚‚ + +/-- The cotangent metric is non-degenerate: if `cotangentMetricVal g x ฯ‰ v = 0` for all `v`, + then `ฯ‰ = 0`. -/ +lemma cotangentMetricVal_nondegenerate (g : PseudoRiemannianMetric E H M n I) (x : M) + (ฯ‰ : TangentSpace I x โ†’L[โ„] โ„) (h : โˆ€ v : TangentSpace I x โ†’L[โ„] โ„, + cotangentMetricVal g x ฯ‰ v = 0) : + ฯ‰ = 0 := by + apply ContinuousLinearMap.ext + intro v + have h_forall : โˆ€ w : TangentSpace I x, ฯ‰ w = 0 := by + intro w + let ฯ‰' : TangentSpace I x โ†’L[โ„] โ„ := g.flatL x w + have this : g.sharpL x ฯ‰' = w := by + simp only [ฯ‰', sharpL_apply_flatL] + have h_apply : cotangentMetricVal g x ฯ‰ ฯ‰' = 0 := h ฯ‰' + simp only [cotangentMetricVal_eq_apply_sharp] at h_apply + rw [this] at h_apply + exact h_apply + exact h_forall v + +@[simp] lemma cotangentToBilinForm_nondegenerate (g : PseudoRiemannianMetric E H M n I) (x : M) : + (cotangentToBilinForm g x).Nondegenerate := by + intro ฯ‰ hฯ‰ + apply cotangentMetricVal_nondegenerate g x ฯ‰ + intro v + exact hฯ‰ v + +end Cotangent diff --git a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean index 4eda3f7ba..d3179c311 100644 --- a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean @@ -7,6 +7,20 @@ Authors: Matteo Cipollina import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Defs import Mathlib.LinearAlgebra.QuadraticForm.Dual +import Mathlib.Algebra.Lie.OfAssociative +import Mathlib.Analysis.InnerProductSpace.Basic +import Mathlib.Analysis.Normed.Field.Instances +import Mathlib.Analysis.RCLike.Lemmas +import Mathlib.Data.Real.StarOrdered +import Mathlib.Geometry.Manifold.MFDeriv.Defs +import Mathlib.Geometry.Manifold.VectorBundle.Basic +import Mathlib.LinearAlgebra.BilinearForm.Properties +import Mathlib.LinearAlgebra.FreeModule.PID +import Mathlib.LinearAlgebra.QuadraticForm.Real +import Mathlib.RingTheory.Henselian +import Mathlib.Topology.Algebra.Module.ModuleTopology +import Mathlib.Topology.LocallyConstant.Basic +import Mathlib.MeasureTheory.Integral.IntervalIntegral /-! # Riemannian Metric Definitions @@ -114,12 +128,12 @@ noncomputable def tangentInnerCore (g : RiemannianMetric I n M) (x : M) : nonneg_re := ฮป v => by simp only [inner_apply, RCLike.re_to_real] by_cases hv : v = 0 - ยท simp [hv, inner_apply, map_zero, zero_apply] + ยท simp [hv, inner_apply, map_zero] ยท exact le_of_lt (g.pos_def x v hv) add_left := ฮป u v w => by - simp only [inner_apply, map_add, add_apply] + simp only [inner_apply, map_add, ContinuousLinearMap.add_apply] smul_left := ฮป r u v => by - simp only [inner_apply, map_smul, smul_apply, conj_trivial] + simp only [inner_apply, map_smul, conj_trivial] rfl definite := fun v (h_inner_zero : g.inner x v v = 0) => by by_contra h_v_ne_zero @@ -186,4 +200,20 @@ example (g : RiemannianMetric I n M) (x : M) (v : TangentSpace I x) : โ„ := let normed_group := TangentSpace.metricNormedAddCommGroup g x @Norm.norm (TangentSpace I x) (@NormedAddCommGroup.toNorm (TangentSpace I x) normed_group) v +lemma norm_eq_norm_of_metricNormedAddCommGroup (g : RiemannianMetric I n M) (x : M) + (v : TangentSpace I x) : norm g x v = @Norm.norm (TangentSpace I x) + (@NormedAddCommGroup.toNorm _ (TangentSpace.metricNormedAddCommGroup g x)) v := by + unfold norm + let normed_group := TangentSpace.metricNormedAddCommGroup g x + unfold TangentSpace.metricNormedAddCommGroup + simp only [inner_apply] + rfl + +/-- Calculates the length of a curve `ฮณ` between parameters `tโ‚€` and `tโ‚` + using the Riemannian metric `g`. This is defined as the integral of the norm of + the tangent vector along the curve. -/ +def curveLength (g : RiemannianMetric I n M) (ฮณ : โ„ โ†’ M) (tโ‚€ tโ‚ : โ„) + {IDE : ModelWithCorners โ„ โ„ โ„}[ChartedSpace โ„ โ„] : โ„ := + โˆซ t in tโ‚€..tโ‚, norm g (ฮณ t) ((mfderiv IDE I ฮณ t) ((1 : โ„) : TangentSpace IDE t)) + end RiemannianMetric From 51cd77a62121c6739159eae632cf81c2fa8d920f Mon Sep 17 00:00:00 2001 From: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com> Date: Tue, 29 Apr 2025 16:02:21 +0000 Subject: [PATCH 16/32] feat: Remove unnecessary instances. --- .../Metric/PseudoRiemannian/Defs.lean | 23 +++-------------- .../Geometry/Metric/Riemannian/Defs.lean | 25 +------------------ .../HarmonicOscillator/Completeness.lean | 2 +- 3 files changed, 6 insertions(+), 44 deletions(-) diff --git a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean index a020f5289..ec3424649 100644 --- a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean @@ -3,15 +3,12 @@ Copyright (c) 2025 Matteo Cipollina. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Matteo Cipollina -/ - import Mathlib.Analysis.InnerProductSpace.Basic import Mathlib.Analysis.RCLike.Lemmas import Mathlib.Geometry.Manifold.MFDeriv.Defs -import Mathlib.Geometry.Manifold.VectorBundle.Basic import Mathlib.LinearAlgebra.BilinearForm.Properties import Mathlib.LinearAlgebra.QuadraticForm.Real import Mathlib.Topology.LocallyConstant.Basic - /-! # Pseudo-Riemannian Metrics on Smooth Manifolds @@ -52,7 +49,7 @@ open scoped Manifold Bundle LinearMap Dual namespace QuadraticForm -variable {K : Type*} [Field K] [LinearOrder K] +variable {K : Type*} [Field K] /-- The negative dimension (or index) of a quadratic form is the dimension of a maximal negative definite subspace. -/ @@ -185,17 +182,12 @@ structure PseudoRiemannianMetric (E : Type v) (H : Type w) (M : Type w) (n : WithTop โ„•โˆž) [inst_norm_grp_E : NormedAddCommGroup E] [inst_norm_sp_E : NormedSpace โ„ E] - [inst_findim_E : FiniteDimensional โ„ E] [inst_top_H : TopologicalSpace H] [inst_top_M : TopologicalSpace M] [inst_chart_M : ChartedSpace H M] [inst_chart_E : ChartedSpace H E] (I : ModelWithCorners โ„ E H) [inst_mani : IsManifold I (n + 1) M] - [inst_total_top : TopologicalSpace (TotalSpace E (TangentSpace I : M โ†’ Type _))] - [inst_fb : FiberBundle E (TangentSpace I : M โ†’ Type _)] - [inst_vb : VectorBundle โ„ E (TangentSpace I : M โ†’ Type _)] - [inst_cmvb : ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] [inst_tangent_findim : โˆ€ (x : M), FiniteDimensional โ„ (TangentSpace I x)] : Type (max u v w) where /-- The metric tensor at each point `x : M`, represented as a continuous linear map @@ -224,14 +216,10 @@ structure PseudoRiemannianMetric namespace PseudoRiemannianMetric variable {E : Type v} {H : Type w} {M : Type w} {n : WithTop โ„•โˆž} -variable [NormedAddCommGroup E] [NormedSpace โ„ E] [FiniteDimensional โ„ E] +variable [NormedAddCommGroup E] [NormedSpace โ„ E] variable [TopologicalSpace H] [TopologicalSpace M] [ChartedSpace H M] [ChartedSpace H E] variable {I : ModelWithCorners โ„ E H} variable [IsManifold I (n + 1) M] -variable [TopologicalSpace (TotalSpace E (TangentSpace I : M โ†’ Type _))] -variable [FiberBundle E (TangentSpace I : M โ†’ Type _)] -variable [VectorBundle โ„ E (TangentSpace I : M โ†’ Type _)] -variable [ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] variable [inst_tangent_findim : โˆ€ (x : M), FiniteDimensional โ„ (TangentSpace I x)] variable {g : PseudoRiemannianMetric E H M n I} @@ -479,14 +467,10 @@ end PseudoRiemannianMetric namespace PseudoRiemannianMetric variable {E : Type v} {H : Type w} {M : Type w} {n : WithTop โ„•โˆž} -variable [NormedAddCommGroup E] [NormedSpace โ„ E] [FiniteDimensional โ„ E] +variable [NormedAddCommGroup E] [NormedSpace โ„ E] variable [TopologicalSpace H] [TopologicalSpace M] [ChartedSpace H M] [ChartedSpace H E] variable {I : ModelWithCorners โ„ E H} variable [IsManifold I (n + 1) M] -variable [TopologicalSpace (TotalSpace E (TangentSpace I : M โ†’ Type _))] -variable [FiberBundle E (TangentSpace I : M โ†’ Type _)] -variable [VectorBundle โ„ E (TangentSpace I : M โ†’ Type _)] -variable [ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] variable [inst_tangent_findim : โˆ€ (x : M), FiniteDimensional โ„ (TangentSpace I x)] section Cotangent @@ -598,3 +582,4 @@ lemma cotangentMetricVal_nondegenerate (g : PseudoRiemannianMetric E H M n I) (x exact hฯ‰ v end Cotangent +#min_imports diff --git a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean index d3179c311..7ecc6a160 100644 --- a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean @@ -3,24 +3,9 @@ Copyright (c) 2025 Matteo Cipollina. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Matteo Cipollina -/ - -import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Defs -import Mathlib.LinearAlgebra.QuadraticForm.Dual - import Mathlib.Algebra.Lie.OfAssociative -import Mathlib.Analysis.InnerProductSpace.Basic -import Mathlib.Analysis.Normed.Field.Instances -import Mathlib.Analysis.RCLike.Lemmas -import Mathlib.Data.Real.StarOrdered -import Mathlib.Geometry.Manifold.MFDeriv.Defs -import Mathlib.Geometry.Manifold.VectorBundle.Basic -import Mathlib.LinearAlgebra.BilinearForm.Properties -import Mathlib.LinearAlgebra.FreeModule.PID -import Mathlib.LinearAlgebra.QuadraticForm.Real -import Mathlib.RingTheory.Henselian -import Mathlib.Topology.Algebra.Module.ModuleTopology -import Mathlib.Topology.LocallyConstant.Basic import Mathlib.MeasureTheory.Integral.IntervalIntegral +import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Defs /-! # Riemannian Metric Definitions @@ -46,10 +31,6 @@ variable {I : ModelWithCorners โ„ E H} {n : โ„•โˆž} structure RiemannianMetric (I : ModelWithCorners โ„ E H) (n : โ„•โˆž) (M : Type w) [TopologicalSpace M] [ChartedSpace H M] [IsManifold I (n + 1) M] - [inst_top : TopologicalSpace (TangentBundle I M)] - [inst_fib : FiberBundle E (TangentSpace I : M โ†’ Type _)] - [inst_vec : VectorBundle โ„ E (TangentSpace I : M โ†’ Type _)] - [inst_cmvb : ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] [inst_tangent_findim : โˆ€ (x : M), FiniteDimensional โ„ (TangentSpace I x)] : Type _ where /-- The underlying pseudo-Riemannian metric. -/ toPseudoRiemannianMetric : PseudoRiemannianMetric E H M (n) I @@ -60,10 +41,6 @@ namespace RiemannianMetric variable {I : ModelWithCorners โ„ E H} {n : โ„•โˆž} {M : Type w} variable [TopologicalSpace M] [ChartedSpace H M] [IsManifold I (n + 1) M] -variable [inst_top : TopologicalSpace (TangentBundle I M)] -variable [inst_fib : FiberBundle E (TangentSpace I : M โ†’ Type _)] -variable [inst_vec : VectorBundle โ„ E (TangentSpace I : M โ†’ Type _)] -variable [inst_cmvb : ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] variable [inst_tangent_findim : โˆ€ (x : M), FiniteDimensional โ„ (TangentSpace I x)] /-- Coercion from RiemannianMetric to its underlying PseudoRiemannianMetric. -/ diff --git a/PhysLean/QuantumMechanics/OneDimension/HarmonicOscillator/Completeness.lean b/PhysLean/QuantumMechanics/OneDimension/HarmonicOscillator/Completeness.lean index 284fe6327..cc3c777ee 100644 --- a/PhysLean/QuantumMechanics/OneDimension/HarmonicOscillator/Completeness.lean +++ b/PhysLean/QuantumMechanics/OneDimension/HarmonicOscillator/Completeness.lean @@ -130,7 +130,7 @@ lemma mul_power_integrable (f : โ„ โ†’ โ„‚) (hf : MemHS f) (r : โ„•) : cases h with | intro h => have h' : Q.ฮพ = 0 := by - simpa [one_div] using h + simp [one_div] at h exact Q.ฮพ_pos.ne' h' ยท simp only [ne_eq, Decidable.not_not] at hr From 57c311f0cbfd8d4006a46482412ef8cc5d92523f Mon Sep 17 00:00:00 2001 From: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com> Date: Tue, 29 Apr 2025 16:02:36 +0000 Subject: [PATCH 17/32] Update Defs.lean --- PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean | 1 - 1 file changed, 1 deletion(-) diff --git a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean index ec3424649..5d081cfd6 100644 --- a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean @@ -582,4 +582,3 @@ lemma cotangentMetricVal_nondegenerate (g : PseudoRiemannianMetric E H M n I) (x exact hฯ‰ v end Cotangent -#min_imports From 139111301e2280e4d1e5dcfaa8a64481b7ce4336 Mon Sep 17 00:00:00 2001 From: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com> Date: Wed, 30 Apr 2025 05:13:44 +0000 Subject: [PATCH 18/32] refactor: Fix lint I broke --- PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean index 7ecc6a160..d465bfa71 100644 --- a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean @@ -20,7 +20,7 @@ open PseudoRiemannianMetric InnerProductSpace noncomputable section -variable {E : Type v} [NormedAddCommGroup E] [NormedSpace โ„ E] [FiniteDimensional โ„ E] +variable {E : Type v} [NormedAddCommGroup E] [NormedSpace โ„ E] variable {H : Type w} [TopologicalSpace H] variable {M : Type w} [TopologicalSpace M] [ChartedSpace H M] [ChartedSpace H E] variable {I : ModelWithCorners โ„ E H} {n : โ„•โˆž} From 55654d0d9baff57237bfc16a83f10d313a99ea5c Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Wed, 30 Apr 2025 18:17:59 +0200 Subject: [PATCH 19/32] Revert "merge" --- PhysLean.lean | 1 - .../TightBindingChain/Basic.lean | 24 ---- .../StringTheory/FTheory/SU5U1/Charges.lean | 12 -- .../StringTheory/FTheory/SU5U1/Examples.lean | 26 +--- .../StringTheory/FTheory/SU5U1/Matter.lean | 66 --------- .../FTheory/SU5U1/NoExotics/FiveBar.lean | 15 +- .../FTheory/SU5U1/PhenoConstraints/Basic.lean | 135 ++++-------------- 7 files changed, 37 insertions(+), 242 deletions(-) delete mode 100644 PhysLean/CondensedMatter/TightBindingChain/Basic.lean diff --git a/PhysLean.lean b/PhysLean.lean index 1b95f4dc2..f72a1ba8e 100644 --- a/PhysLean.lean +++ b/PhysLean.lean @@ -7,7 +7,6 @@ import PhysLean.ClassicalMechanics.Space.VectorIdentities import PhysLean.ClassicalMechanics.Time.Basic import PhysLean.ClassicalMechanics.VectorFields import PhysLean.CondensedMatter.Basic -import PhysLean.CondensedMatter.TightBindingChain.Basic import PhysLean.Cosmology.Basic import PhysLean.Cosmology.FLRW.Basic import PhysLean.Electromagnetism.Basic diff --git a/PhysLean/CondensedMatter/TightBindingChain/Basic.lean b/PhysLean/CondensedMatter/TightBindingChain/Basic.lean deleted file mode 100644 index ee8670625..000000000 --- a/PhysLean/CondensedMatter/TightBindingChain/Basic.lean +++ /dev/null @@ -1,24 +0,0 @@ -/- -Copyright (c) 2025 Joseph Tooby-Smith. All rights reserved. -Released under Apache 2.0 license as described in the file LICENSE. -Authors: Joseph Tooby-Smith --/ -import PhysLean.Meta.TODO.Basic -/-! - -# The tight binding chain - -The tight binding chain corresponds to an electron in motion -in a 1d solid with the assumption the electron can sit only on the atoms of the solid. - -The solid is assumed to consist of `N` sites with a seperation of `a` between them. - -## Refs. - -- https://www.damtp.cam.ac.uk/user/tong/aqm/aqmtwo.pdf - --/ - -TODO "BBZAB" "Prove results related to the one-dimensional tight binding chain. - This is related to the following issue/feature-request: - https://github.com/HEPLean/PhysLean/issues/523 " diff --git a/PhysLean/StringTheory/FTheory/SU5U1/Charges.lean b/PhysLean/StringTheory/FTheory/SU5U1/Charges.lean index 343a9e3c2..19e684544 100644 --- a/PhysLean/StringTheory/FTheory/SU5U1/Charges.lean +++ b/PhysLean/StringTheory/FTheory/SU5U1/Charges.lean @@ -5,8 +5,6 @@ Authors: Joseph Tooby-Smith -/ import Mathlib.Data.Finset.Insert import PhysLean.Meta.TODO.Basic -import Mathlib.Data.Fintype.Defs -import Mathlib.Data.Fintype.Sets /-! # Allowed charges @@ -57,11 +55,6 @@ def allowedBarFiveCharges : CodimensionOneConfig โ†’ Finset โ„ค | nearestNeighbor => {-14, -9, -4, 1, 6, 11} | nextToNearestNeighbor => {-13, -8, -3, 2, 7, 12} -instance : (I : CodimensionOneConfig) โ†’ Fintype I.allowedBarFiveCharges - | same => inferInstance - | nearestNeighbor => inferInstance - | nextToNearestNeighbor => inferInstance - /-- The allowed `U(1)`-charges of matter in the 10d representation of `SU(5)` given a `CodimensionOneConfig`. -/ def allowedTenCharges : CodimensionOneConfig โ†’ Finset โ„ค @@ -69,11 +62,6 @@ def allowedTenCharges : CodimensionOneConfig โ†’ Finset โ„ค | nearestNeighbor => {-12, -7, -2, 3, 8, 13} | nextToNearestNeighbor => {-9, -4, 1, 6, 11} -instance : (I : CodimensionOneConfig) โ†’ Fintype I.allowedTenCharges - | same => inferInstance - | nearestNeighbor => inferInstance - | nextToNearestNeighbor => inferInstance - end CodimensionOneConfig end SU5U1 diff --git a/PhysLean/StringTheory/FTheory/SU5U1/Examples.lean b/PhysLean/StringTheory/FTheory/SU5U1/Examples.lean index 18ea0460f..393208739 100644 --- a/PhysLean/StringTheory/FTheory/SU5U1/Examples.lean +++ b/PhysLean/StringTheory/FTheory/SU5U1/Examples.lean @@ -54,10 +54,7 @@ def mkOneTenFourFiveBar (I : CodimensionOneConfig) (M : ChiralityFlux) (N : Hype (h5 : โˆ€ a โˆˆ ({(M, N, โŸจq5โ‚, hq5โ‚โŸฉ), (3 - M, - N, โŸจq5โ‚‚, hq5โ‚‚โŸฉ)} : Multiset (QuantaBarFive I)), a.M = 0 โ†’ a.N โ‰  0 := by decide) (h10 : โˆ€ a โˆˆ ({(3, 0, โŸจq10, hq10โŸฉ)} : - Multiset (QuantaTen I)), a.M = 0 โ†’ a.N โ‰  0 := by decide) - (hd5 : DistinctChargedBarFive (I := I) {(M, N, โŸจq5โ‚, hq5โ‚โŸฉ), (3 - M, - N, โŸจq5โ‚‚, hq5โ‚‚โŸฉ)} - โŸจ-qHu, hqHuโŸฉ โŸจqHd, hqHdโŸฉ := by decide) - (hd10 : DistinctChargedTen (I := I) {(3, 0, โŸจq10, hq10โŸฉ)} := by decide) : + Multiset (QuantaTen I)), a.M = 0 โ†’ a.N โ‰  0 := by decide) : MatterContent I where quantaTen := {(3, 0, โŸจq10, hq10โŸฉ)} qHu := โŸจ- qHu, hqHuโŸฉ @@ -66,16 +63,12 @@ def mkOneTenFourFiveBar (I : CodimensionOneConfig) (M : ChiralityFlux) (N : Hype (3 - M, - N, โŸจq5โ‚‚, hq5โ‚‚โŸฉ)} chirality_charge_not_both_zero_bar_five_matter := h5 chirality_charge_not_both_zero_ten := h10 - distinctly_charged_quantaBarFiveMatter := hd5 - distinctly_charged_quantaTen := hd10 /-- An example of matter content with one 10d representation and 4 5-bar representations. This corresponds to example I.1.4.a in table 1 of arXiv:1507.05961. -/ def caseI14a : MatterContent .same := mkOneTenFourFiveBar .same 1 2 (-1) 2 2 (-1) 1 --- #eval println! caseI14a.phenoCharges - /-- An example of matter content with one 10d representation and 4 5-bar representations. This corresponds to example I.1.4.b in table 1 of arXiv:1507.05961. -/ def caseI14b : MatterContent .same := @@ -123,8 +116,6 @@ def caseI24a : MatterContent .same where simp [QuantaBarFive.N] chirality_charge_not_both_zero_ten := by simp [QuantaTen.N, QuantaTen.M] - distinctly_charged_quantaBarFiveMatter := by decide - distinctly_charged_quantaTen := by decide /-- An example of matter content with two 10d representation and 4 5-bar representations. This corresponds to one of the two versions of the I.2.4.a in table 8 of arXiv:1507.05961. -/ @@ -137,8 +128,6 @@ def caseI24a' : MatterContent .same where simp [QuantaBarFive.N] chirality_charge_not_both_zero_ten := by simp [QuantaTen.N, QuantaTen.M] - distinctly_charged_quantaBarFiveMatter := by decide - distinctly_charged_quantaTen := by decide /-- An example of matter content with two 10d representation and 4 5-bar representations. This corresponds to one of the four versions of I.2.4.b in table 8 of arXiv:1507.05961. -/ @@ -151,8 +140,6 @@ def caseI24b : MatterContent .same where simp [QuantaBarFive.N] chirality_charge_not_both_zero_ten := by simp [QuantaTen.N, QuantaTen.M] - distinctly_charged_quantaBarFiveMatter := by decide - distinctly_charged_quantaTen := by decide /-- An example of matter content with two 10d representation and 4 5-bar representations. This corresponds to one of the four versions of I.2.4.b in table 8 of arXiv:1507.05961. -/ @@ -165,8 +152,6 @@ def caseI24b' : MatterContent .same where simp [QuantaBarFive.N] chirality_charge_not_both_zero_ten := by simp [QuantaTen.N, QuantaTen.M] - distinctly_charged_quantaBarFiveMatter := by decide - distinctly_charged_quantaTen := by decide /-- An example of matter content with two 10d representation and 4 5-bar representations. This corresponds to one of the four versions of I.2.4.b in table 8 of arXiv:1507.05961. -/ @@ -179,8 +164,6 @@ def caseI24b'' : MatterContent .same where simp [QuantaBarFive.N] chirality_charge_not_both_zero_ten := by simp [QuantaTen.N, QuantaTen.M] - distinctly_charged_quantaBarFiveMatter := by decide - distinctly_charged_quantaTen := by decide /-- An example of matter content with two 10d representation and 4 5-bar representations. This corresponds to one of the four versions of I.2.4.b in table 8 of arXiv:1507.05961. -/ @@ -193,8 +176,6 @@ def caseI24b''' : MatterContent .same where simp [QuantaBarFive.N] chirality_charge_not_both_zero_ten := by simp [QuantaTen.N, QuantaTen.M] - distinctly_charged_quantaBarFiveMatter := by decide - distinctly_charged_quantaTen := by decide /-! @@ -209,13 +190,12 @@ def caseI34a : MatterContent .same where quantaTen := {(1, 0, โŸจ-3, by decideโŸฉ), (1, 0, โŸจ-2, by decideโŸฉ), (1, 0, โŸจ-1, by decideโŸฉ)} qHu := โŸจ-2, by decideโŸฉ qHd := โŸจ1, by decideโŸฉ - quantaBarFiveMatter := {(0, 3, โŸจ-1, by decideโŸฉ), (3, -3, โŸจ0, by decideโŸฉ)} + quantaBarFiveMatter := { + (0, 3, โŸจ-1, by decideโŸฉ), (3, -3, โŸจ0, by decideโŸฉ)} chirality_charge_not_both_zero_bar_five_matter := by simp [QuantaBarFive.N] chirality_charge_not_both_zero_ten := by simp [QuantaTen.N, QuantaTen.M] - distinctly_charged_quantaBarFiveMatter := by decide - distinctly_charged_quantaTen := by decide /-- The finite set of all examples of MatterContent currently defined in PhysLean. -/ def allCases : Finset (ฮฃ I, MatterContent I) := diff --git a/PhysLean/StringTheory/FTheory/SU5U1/Matter.lean b/PhysLean/StringTheory/FTheory/SU5U1/Matter.lean index cd75425bd..471307565 100644 --- a/PhysLean/StringTheory/FTheory/SU5U1/Matter.lean +++ b/PhysLean/StringTheory/FTheory/SU5U1/Matter.lean @@ -7,8 +7,6 @@ import Mathlib.Algebra.BigOperators.Group.Multiset.Defs import Mathlib.Algebra.Group.Int.Defs import Mathlib.Algebra.Order.Group.Unbundled.Abs import PhysLean.StringTheory.FTheory.SU5U1.Charges -import Mathlib.Data.Finset.Card -import Mathlib.Data.Finset.Powerset /-! # Matter @@ -68,33 +66,6 @@ abbrev QuantaTen.N {I : CodimensionOneConfig} (a : QuantaTen I) : HyperChargeFlu abbrev QuantaTen.q {I : CodimensionOneConfig} (a : QuantaTen I) : I.allowedTenCharges := a.2.2 -/-- The proposition on `Multiset (QuantaBarFive I)`, - and two `I.allowedBarFiveCharges` denoted `qHu` and `qHd` which is true - if none of the (underlying) charges are equal. -/ -def DistinctChargedBarFive {I : CodimensionOneConfig} - (quantaBarFiveMatter : Multiset (QuantaBarFive I)) - (qHu : I.allowedBarFiveCharges) (qHd : I.allowedBarFiveCharges) : Prop := - (quantaBarFiveMatter.map QuantaBarFive.q).toFinset.card = - (quantaBarFiveMatter.map QuantaBarFive.q).card - โˆง qHu โˆ‰ (quantaBarFiveMatter.map QuantaBarFive.q) - โˆง qHd โˆ‰ (quantaBarFiveMatter.map QuantaBarFive.q) - โˆง qHu โ‰  qHd - -instance {I : CodimensionOneConfig} - (quantaBarFiveMatter : Multiset (QuantaBarFive I)) - (qHu : I.allowedBarFiveCharges) (qHd : I.allowedBarFiveCharges) : - Decidable (DistinctChargedBarFive quantaBarFiveMatter qHu qHd) := instDecidableAnd - -/-- The proposition on a `Multiset (QuantaTen I)` which is true if non of the underlying - charges are equal. -/ -def DistinctChargedTen {I : CodimensionOneConfig} - (quantaTen : Multiset (QuantaTen I)) : Prop := - (quantaTen.map QuantaTen.q).toFinset.card = (quantaTen.map QuantaTen.q).card - -instance {I : CodimensionOneConfig} - (quantaTen : Multiset (QuantaTen I)) : - Decidable (DistinctChargedTen quantaTen) := decEq _ _ - /-- The matter content, assumed to sit in the 5-bar or 10d representation of `SU(5)`. -/ @[ext] @@ -112,10 +83,6 @@ structure MatterContent (I : CodimensionOneConfig) where โˆ€ a โˆˆ quantaBarFiveMatter, (a.M = 0 โ†’ a.N โ‰  0) /-- There is no matter in the 10d representation with zero `Chirality` and `HyperChargeFlux`. -/ chirality_charge_not_both_zero_ten : โˆ€ a โˆˆ quantaTen, (a.M = 0 โ†’ a.N โ‰  0) - /-- All 5-bar representations carry distinct charges. -/ - distinctly_charged_quantaBarFiveMatter : DistinctChargedBarFive quantaBarFiveMatter qHu qHd - /-- All 10d representations carry distinct charges. -/ - distinctly_charged_quantaTen : DistinctChargedTen quantaTen namespace MatterContent @@ -167,39 +134,6 @@ lemma quantaBarFive_chiralityFlux_two_le_filter_zero_card : funext x exact Lean.Grind.eq_congr' rfl rfl -lemma quantaBarFiveMatter_map_q_noDup : - (๐“œ.quantaBarFiveMatter.map (QuantaBarFive.q)).Nodup := - Multiset.dedup_card_eq_card_iff_nodup.mp ๐“œ.distinctly_charged_quantaBarFiveMatter.1 - -lemma quantaBarFive_map_q_noDup : (๐“œ.quantaBarFive.map (QuantaBarFive.q)).Nodup := by - simp only [quantaBarFive, Int.reduceNeg, Multiset.map_cons, Multiset.nodup_cons, - Multiset.mem_cons, Multiset.mem_map, Prod.exists, exists_eq_right, not_or, not_exists, - ๐“œ.quantaBarFiveMatter_map_q_noDup, and_true] - have h1 := ๐“œ.distinctly_charged_quantaBarFiveMatter - simp_all only [DistinctChargedBarFive, QuantaBarFive.q, Multiset.card_map, Multiset.mem_map, - Prod.exists, exists_eq_right, not_exists, ne_eq, not_false_eq_true, implies_true, and_true] - exact fun a => h1.2.2.2 a.symm - -set_option maxRecDepth 1000 in -lemma quantaBarFive_map_q_card_le_seven : - (๐“œ.quantaBarFive.map (QuantaBarFive.q)).card โ‰ค 7 := by - rw [โ† Multiset.dedup_card_eq_card_iff_nodup.mpr ๐“œ.quantaBarFive_map_q_noDup] - have h1 : (Multiset.map QuantaBarFive.q ๐“œ.quantaBarFive).toFinset โˆˆ - Finset.powerset (Finset.univ (ฮฑ := I.allowedBarFiveCharges)) := by - rw [Finset.mem_powerset] - exact Finset.subset_univ _ - change (Multiset.map QuantaBarFive.q ๐“œ.quantaBarFive).toFinset.card โ‰ค 7 - generalize (Multiset.map QuantaBarFive.q ๐“œ.quantaBarFive).toFinset = S at * - revert S - match I with - | CodimensionOneConfig.same => decide - | CodimensionOneConfig.nearestNeighbor => decide - | CodimensionOneConfig.nextToNearestNeighbor => decide - -lemma quantaBarFive_card_le_seven : ๐“œ.quantaBarFive.card โ‰ค 7 := by - apply le_of_eq_of_le _ ๐“œ.quantaBarFive_map_q_card_le_seven - simp - /-! ## Gauge anomalies diff --git a/PhysLean/StringTheory/FTheory/SU5U1/NoExotics/FiveBar.lean b/PhysLean/StringTheory/FTheory/SU5U1/NoExotics/FiveBar.lean index bab38326f..673f622da 100644 --- a/PhysLean/StringTheory/FTheory/SU5U1/NoExotics/FiveBar.lean +++ b/PhysLean/StringTheory/FTheory/SU5U1/NoExotics/FiveBar.lean @@ -249,9 +249,7 @@ lemma quantaBarFive_zero_chiralityFlux_mem (h3L : ๐“œ.ThreeLeptonDoublets) : ยท rw [hn 5 hr] simp -/-- The number of 5-bar representations is less than or equal to eight. - Note the existences of `quantaBarFive_card_le_seven`. The proof of this weaker result - does not rely on the assumptions of no-duplicate charges. -/ +/-- The number of 5-bar representations is less than or equal to eight. -/ lemma quantaBarFive_card_le_eight (h3 : ๐“œ.ThreeChiralFamiles) (h3L : ๐“œ.ThreeLeptonDoublets) : ๐“œ.quantaBarFive.card โ‰ค 8 := by have h1 : ๐“œ.quantaBarFive.card = @@ -276,15 +274,11 @@ with zero to five chirality fluxes equal to zero. -/ lemma quantaBarFive_chiralityFlux_mem (h3 : ๐“œ.ThreeChiralFamiles) (h3L : ๐“œ.ThreeLeptonDoublets) : ๐“œ.quantaBarFive.map QuantaBarFive.M โˆˆ - ({{1, 1, 1, 0, 0, 0, 0}, {1, 1, 1, 0, 0, 0}, {1, 1, 1, 0, 0}, + ({{1, 1, 1, 0, 0, 0, 0, 0}, {1, 1, 1, 0, 0, 0, 0}, {1, 1, 1, 0, 0, 0}, {1, 1, 1, 0, 0}, {1, 2, 0, 0, 0, 0, 0}, {1, 2, 0, 0, 0, 0}, {1, 2, 0, 0, 0}, {1, 2, 0, 0}, {3, 0, 0, 0, 0, 0}, {3, 0, 0, 0, 0}, {3, 0, 0, 0}, {3, 0, 0}} : Finset (Multiset ChiralityFlux)) := by - have hcard : (๐“œ.quantaBarFive.map QuantaBarFive.M).card โ‰ค 7 := by - rw [Multiset.card_map] - exact ๐“œ.quantaBarFive_card_le_seven - rw [โ† (Multiset.filter_add_not (fun x => x = 0) - (Multiset.map QuantaBarFive.M ๐“œ.quantaBarFive))] at hcard โŠข + rw [โ† (Multiset.filter_add_not (fun x => x = 0) (Multiset.map QuantaBarFive.M ๐“œ.quantaBarFive))] have hz := quantaBarFive_zero_chiralityFlux_mem h3L have h0 := quantaBarFive_chiralityFlux_filter_non_zero_mem h3 simp only [Finset.mem_insert, Finset.mem_singleton] at hz @@ -301,9 +295,6 @@ lemma quantaBarFive_chiralityFlux_mem (h3 : ๐“œ.ThreeChiralFamiles) (h3L : ๐“œ rw [Multiset.add_comm, Multiset.singleton_add] simp only [Multiset.cons_zero, Finset.mem_insert, Finset.mem_singleton, Multiset.empty_eq_zero, true_or, or_true] - -- The case of {1, 1, 1, 0, 0, 0, 0, 0} - rw [hz, h0] at hcard - simp at hcard /-- The number of 5-bar representations (including the Higges) is greater then or equal to three. -/ lemma quantaBarFive_three_le_card (h3 : ๐“œ.ThreeChiralFamiles) (h3L : ๐“œ.ThreeLeptonDoublets) : diff --git a/PhysLean/StringTheory/FTheory/SU5U1/PhenoConstraints/Basic.lean b/PhysLean/StringTheory/FTheory/SU5U1/PhenoConstraints/Basic.lean index eda81d259..e9813d4cf 100644 --- a/PhysLean/StringTheory/FTheory/SU5U1/PhenoConstraints/Basic.lean +++ b/PhysLean/StringTheory/FTheory/SU5U1/PhenoConstraints/Basic.lean @@ -43,93 +43,12 @@ In what follows we constrain via `U(1)` charges namespace FTheory namespace SU5U1 - -variable {I : CodimensionOneConfig} - -/-- The overall charge of the term `ฮผ 5Hu 5ฬ„Hd` -/ -def chargeMuTerm (qHu qHd : I.allowedBarFiveCharges) : โ„ค := - qHu.1 + qHd.1 - -/-- The charges of the term `Wยนแตขโฑผโ‚–โ‚— 10โฑ 10สฒ 10แต 5ฬ„Mหก`. -/ -def chargeW1Term (q5 : Multiset I.allowedBarFiveCharges) (q10 : Multiset I.allowedTenCharges) : - Multiset โ„ค := - (Multiset.product q10 (Multiset.product q10 (Multiset.product q10 q5))).map - (fun x => x.1 + x.2.1 + x.2.2.1 + x.2.2.2) - -/-- The charges of the term `๐›ฝแตข 5ฬ„Mโฑ5Hu`. -/ -def chargeBetaTerm (q5bar : Multiset I.allowedBarFiveCharges) (qHu : I.allowedBarFiveCharges) : - Multiset โ„ค := q5bar.map (fun x => x.1 + (- qHu.1)) - -/-- The charges of the term `๐œ†แตขโฑผโ‚– 5ฬ„Mโฑ 5ฬ„Mสฒ 10แต`. -/ -def chargeLambdaTerm (q5bar : Multiset I.allowedBarFiveCharges) - (q10 : Multiset I.allowedTenCharges) : Multiset โ„ค := - (Multiset.product q5bar (Multiset.product q5bar q10)).map - (fun x => x.1 + x.2.1 + x.2.2.1) - -/-- The charges of the term `Kยนแตขโฑผโ‚– 10โฑ 10สฒ 5Mแต`. -/ -def chargeK1Term (q5bar : Multiset I.allowedBarFiveCharges) - (q10 : Multiset I.allowedTenCharges) : Multiset โ„ค := - (Multiset.product q10 (Multiset.product q10 q5bar)).map - (fun x => x.1 + x.2.1 + (- x.2.2.1)) - -/-- The charges of the term `Wโดแตข 5ฬ„Mโฑ 5ฬ„Hd 5Hu 5Hu`. -/ -def chargeW4Term (q5bar : Multiset I.allowedBarFiveCharges) - (qHd : I.allowedBarFiveCharges) (qHu : I.allowedBarFiveCharges) : Multiset โ„ค := - q5bar.map (fun x => x.1 + qHd.1 + (- qHu.1) + (- qHu.1)) - -/-- The charges of the term `Kยฒแตข 5ฬ„Hu 5ฬ„Hd 10โฑ` -/ -def chargeK2Term (q10 : Multiset I.allowedTenCharges) - (qHu : I.allowedBarFiveCharges) (qHd : I.allowedBarFiveCharges) : - Multiset โ„ค := - q10.map (fun x => qHu.1 + qHd.1 + x.1) - -/-- The charges of the term `Wยฒแตขโฑผโ‚– 10โฑ 10สฒ 10แต 5ฬ„Hd`. -/ -def chargeW2Term (q10 : Multiset I.allowedTenCharges) - (qHd : I.allowedBarFiveCharges) : Multiset โ„ค := - (Multiset.product q10 (Multiset.product q10 q10)).map - (fun x => x.1 + x.2.1 + x.2.2.1 + qHd.1) - -/-- The charges associated with the term `ฮปแต—แตขโฑผ 10โฑ 10สฒ 5Hu`-/ -def chargeYukawaTop (q10 : Multiset I.allowedTenCharges) - (qHu : I.allowedBarFiveCharges) : Multiset โ„ค := - ((Multiset.product q10 q10)).map (fun x => x.1 + x.2.1 + (- qHu.1)) - -/-- The charges associated with the term `ฮปแต‡แตขโฑผ 10โฑ 5ฬ„Mสฒ 5ฬ„Hd``. -/ -def chargeYukawaBottom (q5bar : Multiset I.allowedBarFiveCharges) - (q10 : Multiset I.allowedTenCharges) (qHd : I.allowedBarFiveCharges) : Multiset โ„ค := - (Multiset.product q10 q5bar).map (fun x => x.1 + x.2.1 + qHd.1) - namespace MatterContent variable {I : CodimensionOneConfig} (๐“œ : MatterContent I) -/-- A string containing the U(1)-charges associated with interaction terms. -/ -def phenoCharges : String := - s!" -Charges associated with terms: -ฮผ-term (ฮผ 5Hu 5ฬ„Hd): {chargeMuTerm ๐“œ.qHu ๐“œ.qHd} -Wยน-term (Wยนแตขโฑผโ‚–โ‚— 10โฑ 10สฒ 10แต 5ฬ„Mหก): {(chargeW1Term (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) - (๐“œ.quantaTen.map QuantaTen.q)).sort (LE.le) } -๐›ฝ-term (๐›ฝแตข 5ฬ„Mโฑ5Hu): {(chargeBetaTerm (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) - ๐“œ.qHu).sort LE.le} -๐œ†-term (๐œ†แตขโฑผโ‚– 5ฬ„Mโฑ 5ฬ„Mสฒ 10แต): {(chargeLambdaTerm (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) - (๐“œ.quantaTen.map QuantaTen.q)).sort LE.le} -Kยน-term (Kยนแตขโฑผโ‚– 10โฑ 10สฒ 5Mแต): {(chargeK1Term (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) - (๐“œ.quantaTen.map QuantaTen.q)).sort LE.le} -Wโด-term (Wโดแตข 5ฬ„Mโฑ 5ฬ„Hd 5Hu 5Hu): {(chargeW4Term (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) - ๐“œ.qHd ๐“œ.qHu).sort LE.le} -Kยฒ-term (Kยฒแตข 5ฬ„Hu 5ฬ„Hd 10โฑ): {(chargeK2Term (๐“œ.quantaTen.map QuantaTen.q) ๐“œ.qHu - ๐“œ.qHd).sort LE.le} -... -Wยฒ-term (Wยฒแตขโฑผโ‚– 10โฑ 10สฒ 10แต 5ฬ„Hd): {(chargeW2Term (๐“œ.quantaTen.map QuantaTen.q) ๐“œ.qHd).sort LE.le} -... -Top-Yukawa (ฮปแต—แตขโฑผ 10โฑ 10สฒ 5Hu): {(chargeYukawaTop (๐“œ.quantaTen.map QuantaTen.q) ๐“œ.qHu).sort LE.le} -Bottom-Yukawa (ฮปแต‡แตขโฑผ 10โฑ 5ฬ„Mสฒ 5ฬ„Hd): {(chargeYukawaBottom (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) - (๐“œ.quantaTen.map QuantaTen.q) - ๐“œ.qHd).sort LE.le} -" - /-- A proposition which is true when the `ฮผ`-term (`5Hu 5ฬ„Hd`) does not obey the additional `U(1)` symmetry in the model, and is therefore constrained. -/ -def MuTermU1Constrained : Prop := chargeMuTerm ๐“œ.qHu ๐“œ.qHd โ‰  0 +def MuTermU1Constrained : Prop := - ๐“œ.qHu.1 + ๐“œ.qHd.1 โ‰  0 instance : Decidable ๐“œ.MuTermU1Constrained := instDecidableNot @@ -146,19 +65,20 @@ instance : Decidable ๐“œ.MuTermU1Constrained := instDecidableNot -/ def RParityU1Constrained : Prop := --`๐›ฝแตข 5ฬ„Mโฑ5Hu` - 0 โˆ‰ chargeBetaTerm (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) ๐“œ.qHu + (โˆ€ fi โˆˆ ๐“œ.quantaBarFiveMatter, fi.q.1 + (- ๐“œ.qHu.1) โ‰  0) -- `๐œ†แตขโฑผโ‚– 5ฬ„Mโฑ 5ฬ„Mสฒ 10แต` - โˆง 0 โˆ‰ chargeLambdaTerm (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) - (๐“œ.quantaTen.map QuantaTen.q) + โˆง (โˆ€ fi โˆˆ ๐“œ.quantaBarFiveMatter, โˆ€ fj โˆˆ ๐“œ.quantaBarFiveMatter, โˆ€ tk โˆˆ ๐“œ.quantaTen, + fi.q.1 + fj.q.1 + tk.q.1 โ‰  0) -- `Wยฒแตขโฑผโ‚– 10โฑ 10สฒ 10แต 5ฬ„Hd` - โˆง 0 โˆ‰ chargeW2Term (๐“œ.quantaTen.map QuantaTen.q) ๐“œ.qHd + โˆง (โˆ€ ti โˆˆ ๐“œ.quantaTen, โˆ€ tj โˆˆ ๐“œ.quantaTen, โˆ€ tk โˆˆ ๐“œ.quantaTen, + ti.q.1 + tj.q.1 + tk.q.1 + ๐“œ.qHd.1 โ‰  0) -- `Wโดแตข 5ฬ„Mโฑ 5ฬ„Hd 5Hu 5Hu` - โˆง 0 โˆ‰ chargeW4Term (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) ๐“œ.qHd ๐“œ.qHu + โˆง (โˆ€ fi โˆˆ ๐“œ.quantaBarFiveMatter, fi.q.1 + ๐“œ.qHd.1 + (- ๐“œ.qHu.1) + (- ๐“œ.qHu.1) โ‰  0) -- `Kยนแตขโฑผโ‚– 10โฑ 10สฒ 5Mแต` - โˆง 0 โˆ‰ chargeK1Term (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) - (๐“œ.quantaTen.map QuantaTen.q) + โˆง (โˆ€ ti โˆˆ ๐“œ.quantaTen, โˆ€ tj โˆˆ ๐“œ.quantaTen, โˆ€ fk โˆˆ ๐“œ.quantaBarFiveMatter, + ti.q.1 + tj.q.1 + (- fk.q.1) โ‰  0) -- `Kยฒแตข 5ฬ„Hu 5ฬ„Hd 10โฑ` - โˆง 0 โˆ‰ chargeK2Term (๐“œ.quantaTen.map QuantaTen.q) ๐“œ.qHu ๐“œ.qHd + โˆง (โˆ€ ti โˆˆ ๐“œ.quantaTen, ๐“œ.qHu.1 + ๐“œ.qHd.1 + ti.q.1 โ‰  0) instance : Decidable ๐“œ.RParityU1Constrained := instDecidableAnd @@ -173,37 +93,44 @@ instance : Decidable ๐“œ.RParityU1Constrained := instDecidableAnd -/ def ProtonDecayU1Constrained : Prop := -- `Wยนแตขโฑผโ‚–โ‚— 10โฑ 10สฒ 10แต 5ฬ„Mหก` - 0 โˆ‰ chargeW1Term (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) (๐“œ.quantaTen.map QuantaTen.q) + (โˆ€ ti โˆˆ ๐“œ.quantaTen, โˆ€ tj โˆˆ ๐“œ.quantaTen, โˆ€ tk โˆˆ ๐“œ.quantaTen, โˆ€ fl โˆˆ ๐“œ.quantaBarFiveMatter, + ti.q.1 + tj.q.1 + tk.q.1 + fl.q.1 โ‰  0) -- `๐œ†แตขโฑผโ‚– 5ฬ„Mโฑ 5ฬ„Mสฒ 10แต` - โˆง 0 โˆ‰ chargeLambdaTerm (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) - (๐“œ.quantaTen.map QuantaTen.q) + โˆง (โˆ€ fi โˆˆ ๐“œ.quantaBarFiveMatter, โˆ€ fj โˆˆ ๐“œ.quantaBarFiveMatter, โˆ€ tk โˆˆ ๐“œ.quantaTen, + fi.q.1 + fj.q.1 + tk.q.1 โ‰  0) -- `Wยฒแตขโฑผโ‚– 10โฑ 10สฒ 10แต 5ฬ„Hd` - โˆง 0 โˆ‰ chargeW2Term (๐“œ.quantaTen.map QuantaTen.q) ๐“œ.qHd + โˆง (โˆ€ ti โˆˆ ๐“œ.quantaTen, โˆ€ tj โˆˆ ๐“œ.quantaTen, โˆ€ tk โˆˆ ๐“œ.quantaTen, + ti.q.1 + tj.q.1 + tk.q.1 + ๐“œ.qHd.1 โ‰  0) -- `Kยนแตขโฑผโ‚– 10โฑ 10สฒ 5Mแต` - โˆง 0 โˆ‰ chargeK1Term (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) - (๐“œ.quantaTen.map QuantaTen.q) + โˆง (โˆ€ ti โˆˆ ๐“œ.quantaTen, โˆ€ tj โˆˆ ๐“œ.quantaTen, โˆ€ fk โˆˆ ๐“œ.quantaBarFiveMatter, + ti.q.1 + tj.q.1 + (- fk.q.1) โ‰  0) instance : Decidable ๐“œ.ProtonDecayU1Constrained := instDecidableAnd /-- The condition on the matter content for there to exist at least one copy of the coupling - `ฮปแต—แตขโฑผ 10โฑ 10สฒ 5Hu` -/ -def HasATopYukawa (๐“œ : MatterContent I) : Prop := - 0 โˆˆ chargeYukawaTop (๐“œ.quantaTen.map QuantaTen.q) ๐“œ.qHu +def HasATopYukawa (๐“œ : MatterContent I) : Prop := โˆƒ ti โˆˆ ๐“œ.quantaTen, โˆƒ tj โˆˆ ๐“œ.quantaTen, + ti.q.1 + tj.q.1 + (- ๐“œ.qHu.1) = 0 instance : Decidable ๐“œ.HasATopYukawa := - Multiset.decidableMem 0 (chargeYukawaTop (Multiset.map QuantaTen.q ๐“œ.quantaTen) ๐“œ.qHu) - + haveI : DecidablePred fun (ti : QuantaTen I) => + โˆƒ tj โˆˆ ๐“œ.quantaTen, ti.q.1 + โ†‘tj.q + -โ†‘๐“œ.qHu = 0 := fun _ => + Multiset.decidableExistsMultiset + Multiset.decidableExistsMultiset /-- The condition on the matter content for there to exist at least one copy of the coupling - `ฮปแต‡แตขโฑผ 10โฑ 5ฬ„Mสฒ 5ฬ„Hd` -/ -def HasABottomYukawa (๐“œ : MatterContent I) : Prop := - 0 โˆˆ chargeYukawaBottom (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) - (๐“œ.quantaTen.map QuantaTen.q) ๐“œ.qHu +def HasABottomYukawa (๐“œ : MatterContent I) : Prop := โˆƒ ti โˆˆ ๐“œ.quantaTen, + โˆƒ fj โˆˆ ๐“œ.quantaBarFiveMatter, + ti.q.1 + fj.q.1 + ๐“œ.qHd.1 = 0 instance : Decidable ๐“œ.HasABottomYukawa := - Multiset.decidableMem _ _ + haveI : DecidablePred fun (ti : QuantaTen I) => + โˆƒ fj โˆˆ ๐“œ.quantaBarFiveMatter, ti.q.1 + fj.q.1 + ๐“œ.qHd.1 = 0 := fun _ => + Multiset.decidableExistsMultiset + Multiset.decidableExistsMultiset end MatterContent end SU5U1 From 425300643805c6b7c15ff7d84321cabe2a342f0b Mon Sep 17 00:00:00 2001 From: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com> Date: Fri, 2 May 2025 07:21:01 +0000 Subject: [PATCH 20/32] chore: Fix file overwrites --- .../HarmonicOscillator/Completeness.lean | 11 +- .../StringTheory/FTheory/SU5U1/Charges.lean | 12 ++ .../StringTheory/FTheory/SU5U1/Examples.lean | 21 ++- .../StringTheory/FTheory/SU5U1/Matter.lean | 50 +++++++ .../FTheory/SU5U1/NoExotics/FiveBar.lean | 15 ++- .../FTheory/SU5U1/PhenoConstraints/Basic.lean | 126 +++++++++++++++--- 6 files changed, 203 insertions(+), 32 deletions(-) diff --git a/PhysLean/QuantumMechanics/OneDimension/HarmonicOscillator/Completeness.lean b/PhysLean/QuantumMechanics/OneDimension/HarmonicOscillator/Completeness.lean index cc3c777ee..57c9c2dad 100644 --- a/PhysLean/QuantumMechanics/OneDimension/HarmonicOscillator/Completeness.lean +++ b/PhysLean/QuantumMechanics/OneDimension/HarmonicOscillator/Completeness.lean @@ -125,14 +125,9 @@ lemma mul_power_integrable (f : โ„ โ†’ โ„‚) (hf : MemHS f) (r : โ„•) : suffices h2 : IsUnit (โ†‘((1/Q.ฮพ)^ r : โ„‚)) by rw [IsUnit.integrable_smul_iff h2] at h1 simpa using h1 - simp only [isUnit_iff_ne_zero, ne_eq, pow_eq_zero_iff', Complex.ofReal_eq_zero] - intro h - cases h with - | intro h => - have h' : Q.ฮพ = 0 := by - simp [one_div] at h - exact Q.ฮพ_pos.ne' h' - + simp only [isUnit_iff_ne_zero, ne_eq, pow_eq_zero_iff', Complex.ofReal_eq_zero, not_and, + Decidable.not_not] + simp ยท simp only [ne_eq, Decidable.not_not] at hr subst hr simpa using Q.mul_physHermite_integrable f hf 0 diff --git a/PhysLean/StringTheory/FTheory/SU5U1/Charges.lean b/PhysLean/StringTheory/FTheory/SU5U1/Charges.lean index 19e684544..343a9e3c2 100644 --- a/PhysLean/StringTheory/FTheory/SU5U1/Charges.lean +++ b/PhysLean/StringTheory/FTheory/SU5U1/Charges.lean @@ -5,6 +5,8 @@ Authors: Joseph Tooby-Smith -/ import Mathlib.Data.Finset.Insert import PhysLean.Meta.TODO.Basic +import Mathlib.Data.Fintype.Defs +import Mathlib.Data.Fintype.Sets /-! # Allowed charges @@ -55,6 +57,11 @@ def allowedBarFiveCharges : CodimensionOneConfig โ†’ Finset โ„ค | nearestNeighbor => {-14, -9, -4, 1, 6, 11} | nextToNearestNeighbor => {-13, -8, -3, 2, 7, 12} +instance : (I : CodimensionOneConfig) โ†’ Fintype I.allowedBarFiveCharges + | same => inferInstance + | nearestNeighbor => inferInstance + | nextToNearestNeighbor => inferInstance + /-- The allowed `U(1)`-charges of matter in the 10d representation of `SU(5)` given a `CodimensionOneConfig`. -/ def allowedTenCharges : CodimensionOneConfig โ†’ Finset โ„ค @@ -62,6 +69,11 @@ def allowedTenCharges : CodimensionOneConfig โ†’ Finset โ„ค | nearestNeighbor => {-12, -7, -2, 3, 8, 13} | nextToNearestNeighbor => {-9, -4, 1, 6, 11} +instance : (I : CodimensionOneConfig) โ†’ Fintype I.allowedTenCharges + | same => inferInstance + | nearestNeighbor => inferInstance + | nextToNearestNeighbor => inferInstance + end CodimensionOneConfig end SU5U1 diff --git a/PhysLean/StringTheory/FTheory/SU5U1/Examples.lean b/PhysLean/StringTheory/FTheory/SU5U1/Examples.lean index 4659c01e0..02804e6e7 100644 --- a/PhysLean/StringTheory/FTheory/SU5U1/Examples.lean +++ b/PhysLean/StringTheory/FTheory/SU5U1/Examples.lean @@ -66,12 +66,16 @@ def mkOneTenFourFiveBar (I : CodimensionOneConfig) (M : ChiralityFlux) (N : Hype (3 - M, - N, โŸจq5โ‚‚, hq5โ‚‚โŸฉ)} chirality_charge_not_both_zero_bar_five_matter := h5 chirality_charge_not_both_zero_ten := h10 + distinctly_charged_quantaBarFiveMatter := hd5 + distinctly_charged_quantaTen := hd10 /-- An example of matter content with one 10d representation and 4 5-bar representations. This corresponds to example I.1.4.a in table 1 of arXiv:1507.05961. -/ def caseI14a : MatterContent .same := mkOneTenFourFiveBar .same 1 2 (-1) 2 2 (-1) 1 +-- #eval println! caseI14a.phenoCharges + /-- An example of matter content with one 10d representation and 4 5-bar representations. This corresponds to example I.1.4.b in table 1 of arXiv:1507.05961. -/ def caseI14b : MatterContent .same := @@ -119,6 +123,8 @@ def caseI24a : MatterContent .same where simp [QuantaBarFive.N] chirality_charge_not_both_zero_ten := by simp [QuantaTen.N, QuantaTen.M] + distinctly_charged_quantaBarFiveMatter := by decide + distinctly_charged_quantaTen := by decide /-- An example of matter content with two 10d representation and 4 5-bar representations. This corresponds to one of the two versions of the I.2.4.a in table 8 of arXiv:1507.05961. -/ @@ -131,6 +137,8 @@ def caseI24a' : MatterContent .same where simp [QuantaBarFive.N] chirality_charge_not_both_zero_ten := by simp [QuantaTen.N, QuantaTen.M] + distinctly_charged_quantaBarFiveMatter := by decide + distinctly_charged_quantaTen := by decide /-- An example of matter content with two 10d representation and 4 5-bar representations. This corresponds to one of the four versions of I.2.4.b in table 8 of arXiv:1507.05961. -/ @@ -143,6 +151,8 @@ def caseI24b : MatterContent .same where simp [QuantaBarFive.N] chirality_charge_not_both_zero_ten := by simp [QuantaTen.N, QuantaTen.M] + distinctly_charged_quantaBarFiveMatter := by decide + distinctly_charged_quantaTen := by decide /-- An example of matter content with two 10d representation and 4 5-bar representations. This corresponds to one of the four versions of I.2.4.b in table 8 of arXiv:1507.05961. -/ @@ -155,6 +165,8 @@ def caseI24b' : MatterContent .same where simp [QuantaBarFive.N] chirality_charge_not_both_zero_ten := by simp [QuantaTen.N, QuantaTen.M] + distinctly_charged_quantaBarFiveMatter := by decide + distinctly_charged_quantaTen := by decide /-- An example of matter content with two 10d representation and 4 5-bar representations. This corresponds to one of the four versions of I.2.4.b in table 8 of arXiv:1507.05961. -/ @@ -167,6 +179,8 @@ def caseI24b'' : MatterContent .same where simp [QuantaBarFive.N] chirality_charge_not_both_zero_ten := by simp [QuantaTen.N, QuantaTen.M] + distinctly_charged_quantaBarFiveMatter := by decide + distinctly_charged_quantaTen := by decide /-- An example of matter content with two 10d representation and 4 5-bar representations. This corresponds to one of the four versions of I.2.4.b in table 8 of arXiv:1507.05961. -/ @@ -179,6 +193,8 @@ def caseI24b''' : MatterContent .same where simp [QuantaBarFive.N] chirality_charge_not_both_zero_ten := by simp [QuantaTen.N, QuantaTen.M] + distinctly_charged_quantaBarFiveMatter := by decide + distinctly_charged_quantaTen := by decide /-! @@ -192,12 +208,13 @@ def caseI34a : MatterContent .same where quantaTen := {(1, 0, โŸจ-3, by decideโŸฉ), (1, 0, โŸจ-2, by decideโŸฉ), (1, 0, โŸจ-1, by decideโŸฉ)} qHu := โŸจ-2, by decideโŸฉ qHd := โŸจ1, by decideโŸฉ - quantaBarFiveMatter := { - (0, 3, โŸจ-1, by decideโŸฉ), (3, -3, โŸจ0, by decideโŸฉ)} + quantaBarFiveMatter := {(0, 3, โŸจ-1, by decideโŸฉ), (3, -3, โŸจ0, by decideโŸฉ)} chirality_charge_not_both_zero_bar_five_matter := by simp [QuantaBarFive.N] chirality_charge_not_both_zero_ten := by simp [QuantaTen.N, QuantaTen.M] + distinctly_charged_quantaBarFiveMatter := by decide + distinctly_charged_quantaTen := by decide /-- The finite set of all examples of MatterContent currently defined in PhysLean. -/ def allCases : Finset (ฮฃ I, MatterContent I) := diff --git a/PhysLean/StringTheory/FTheory/SU5U1/Matter.lean b/PhysLean/StringTheory/FTheory/SU5U1/Matter.lean index b32d95be6..be6addd63 100644 --- a/PhysLean/StringTheory/FTheory/SU5U1/Matter.lean +++ b/PhysLean/StringTheory/FTheory/SU5U1/Matter.lean @@ -7,6 +7,8 @@ import Mathlib.Algebra.BigOperators.Group.Multiset.Defs import Mathlib.Algebra.Group.Int.Defs import Mathlib.Algebra.Order.Group.Unbundled.Abs import PhysLean.StringTheory.FTheory.SU5U1.Charges +import Mathlib.Data.Finset.Card +import Mathlib.Data.Finset.Powerset /-! # Matter @@ -66,6 +68,33 @@ abbrev QuantaTen.N {I : CodimensionOneConfig} (a : QuantaTen I) : HyperChargeFlu abbrev QuantaTen.q {I : CodimensionOneConfig} (a : QuantaTen I) : I.allowedTenCharges := a.2.2 +/-- The proposition on `Multiset (QuantaBarFive I)`, + and two `I.allowedBarFiveCharges` denoted `qHu` and `qHd` which is true + if none of the (underlying) charges are equal. -/ +def DistinctChargedBarFive {I : CodimensionOneConfig} + (quantaBarFiveMatter : Multiset (QuantaBarFive I)) + (qHu : I.allowedBarFiveCharges) (qHd : I.allowedBarFiveCharges) : Prop := + (quantaBarFiveMatter.map QuantaBarFive.q).toFinset.card = + (quantaBarFiveMatter.map QuantaBarFive.q).card + โˆง qHu โˆ‰ (quantaBarFiveMatter.map QuantaBarFive.q) + โˆง qHd โˆ‰ (quantaBarFiveMatter.map QuantaBarFive.q) + โˆง qHu โ‰  qHd + +instance {I : CodimensionOneConfig} + (quantaBarFiveMatter : Multiset (QuantaBarFive I)) + (qHu : I.allowedBarFiveCharges) (qHd : I.allowedBarFiveCharges) : + Decidable (DistinctChargedBarFive quantaBarFiveMatter qHu qHd) := instDecidableAnd + +/-- The proposition on a `Multiset (QuantaTen I)` which is true if non of the underlying + charges are equal. -/ +def DistinctChargedTen {I : CodimensionOneConfig} + (quantaTen : Multiset (QuantaTen I)) : Prop := + (quantaTen.map QuantaTen.q).toFinset.card = (quantaTen.map QuantaTen.q).card + +instance {I : CodimensionOneConfig} + (quantaTen : Multiset (QuantaTen I)) : + Decidable (DistinctChargedTen quantaTen) := decEq _ _ + /-- The matter content, assumed to sit in the 5-bar or 10d representation of `SU(5)`. -/ @[ext] @@ -83,6 +112,10 @@ structure MatterContent (I : CodimensionOneConfig) where โˆ€ a โˆˆ quantaBarFiveMatter, (a.M = 0 โ†’ a.N โ‰  0) /-- There is no matter in the 10d representation with zero `Chirality` and `HyperChargeFlux`. -/ chirality_charge_not_both_zero_ten : โˆ€ a โˆˆ quantaTen, (a.M = 0 โ†’ a.N โ‰  0) + /-- All 5-bar representations carry distinct charges. -/ + distinctly_charged_quantaBarFiveMatter : DistinctChargedBarFive quantaBarFiveMatter qHu qHd + /-- All 10d representations carry distinct charges. -/ + distinctly_charged_quantaTen : DistinctChargedTen quantaTen namespace MatterContent @@ -146,6 +179,23 @@ lemma quantaBarFiveMatter_map_q_eq_toFinset : conv_lhs => rw [โ† h1] rfl +lemma quantaBarFiveMatter_map_q_mem_powerset : + (๐“œ.quantaBarFiveMatter.map (QuantaBarFive.q)).toFinset โˆˆ + Finset.powerset (Finset.univ (ฮฑ := I.allowedBarFiveCharges)) := by + rw [Finset.mem_powerset] + exact Finset.subset_univ _ + +lemma quantaBarFiveMatter_map_q_mem_powerset_filter_card {n : โ„•} + (hcard : ๐“œ.quantaBarFiveMatter.card = n) : + (๐“œ.quantaBarFiveMatter.map (QuantaBarFive.q)).toFinset โˆˆ + (Finset.univ (ฮฑ := I.allowedBarFiveCharges)).powerset.filter fun x => x.card = n := by + simp only [Finset.mem_filter, Finset.mem_powerset, Finset.subset_univ, true_and] + trans (๐“œ.quantaBarFiveMatter.map (QuantaBarFive.q)).card + ยท rw [quantaBarFiveMatter_map_q_eq_toFinset] + simp only [Multiset.toFinset_val, Multiset.toFinset_dedup] + rfl + ยท simpa using hcard + lemma quantaBarFive_map_q_noDup : (๐“œ.quantaBarFive.map (QuantaBarFive.q)).Nodup := by simp only [quantaBarFive, Int.reduceNeg, Multiset.map_cons, Multiset.nodup_cons, Multiset.mem_cons, Multiset.mem_map, Prod.exists, exists_eq_right, not_or, not_exists, diff --git a/PhysLean/StringTheory/FTheory/SU5U1/NoExotics/FiveBar.lean b/PhysLean/StringTheory/FTheory/SU5U1/NoExotics/FiveBar.lean index 673f622da..bab38326f 100644 --- a/PhysLean/StringTheory/FTheory/SU5U1/NoExotics/FiveBar.lean +++ b/PhysLean/StringTheory/FTheory/SU5U1/NoExotics/FiveBar.lean @@ -249,7 +249,9 @@ lemma quantaBarFive_zero_chiralityFlux_mem (h3L : ๐“œ.ThreeLeptonDoublets) : ยท rw [hn 5 hr] simp -/-- The number of 5-bar representations is less than or equal to eight. -/ +/-- The number of 5-bar representations is less than or equal to eight. + Note the existences of `quantaBarFive_card_le_seven`. The proof of this weaker result + does not rely on the assumptions of no-duplicate charges. -/ lemma quantaBarFive_card_le_eight (h3 : ๐“œ.ThreeChiralFamiles) (h3L : ๐“œ.ThreeLeptonDoublets) : ๐“œ.quantaBarFive.card โ‰ค 8 := by have h1 : ๐“œ.quantaBarFive.card = @@ -274,11 +276,15 @@ with zero to five chirality fluxes equal to zero. -/ lemma quantaBarFive_chiralityFlux_mem (h3 : ๐“œ.ThreeChiralFamiles) (h3L : ๐“œ.ThreeLeptonDoublets) : ๐“œ.quantaBarFive.map QuantaBarFive.M โˆˆ - ({{1, 1, 1, 0, 0, 0, 0, 0}, {1, 1, 1, 0, 0, 0, 0}, {1, 1, 1, 0, 0, 0}, {1, 1, 1, 0, 0}, + ({{1, 1, 1, 0, 0, 0, 0}, {1, 1, 1, 0, 0, 0}, {1, 1, 1, 0, 0}, {1, 2, 0, 0, 0, 0, 0}, {1, 2, 0, 0, 0, 0}, {1, 2, 0, 0, 0}, {1, 2, 0, 0}, {3, 0, 0, 0, 0, 0}, {3, 0, 0, 0, 0}, {3, 0, 0, 0}, {3, 0, 0}} : Finset (Multiset ChiralityFlux)) := by - rw [โ† (Multiset.filter_add_not (fun x => x = 0) (Multiset.map QuantaBarFive.M ๐“œ.quantaBarFive))] + have hcard : (๐“œ.quantaBarFive.map QuantaBarFive.M).card โ‰ค 7 := by + rw [Multiset.card_map] + exact ๐“œ.quantaBarFive_card_le_seven + rw [โ† (Multiset.filter_add_not (fun x => x = 0) + (Multiset.map QuantaBarFive.M ๐“œ.quantaBarFive))] at hcard โŠข have hz := quantaBarFive_zero_chiralityFlux_mem h3L have h0 := quantaBarFive_chiralityFlux_filter_non_zero_mem h3 simp only [Finset.mem_insert, Finset.mem_singleton] at hz @@ -295,6 +301,9 @@ lemma quantaBarFive_chiralityFlux_mem (h3 : ๐“œ.ThreeChiralFamiles) (h3L : ๐“œ rw [Multiset.add_comm, Multiset.singleton_add] simp only [Multiset.cons_zero, Finset.mem_insert, Finset.mem_singleton, Multiset.empty_eq_zero, true_or, or_true] + -- The case of {1, 1, 1, 0, 0, 0, 0, 0} + rw [hz, h0] at hcard + simp at hcard /-- The number of 5-bar representations (including the Higges) is greater then or equal to three. -/ lemma quantaBarFive_three_le_card (h3 : ๐“œ.ThreeChiralFamiles) (h3L : ๐“œ.ThreeLeptonDoublets) : diff --git a/PhysLean/StringTheory/FTheory/SU5U1/PhenoConstraints/Basic.lean b/PhysLean/StringTheory/FTheory/SU5U1/PhenoConstraints/Basic.lean index 7fc0181e5..547332ee0 100644 --- a/PhysLean/StringTheory/FTheory/SU5U1/PhenoConstraints/Basic.lean +++ b/PhysLean/StringTheory/FTheory/SU5U1/PhenoConstraints/Basic.lean @@ -74,6 +74,14 @@ lemma chargeW1Term_single_q10 (q5 : Multiset I.allowedBarFiveCharges) exact Multiset.singleton_subset.mpr ha exact fun a => h (h1 a) +lemma chargeW1Term_subset_q10 (q5 : Multiset I.allowedBarFiveCharges) + (q10 : Multiset I.allowedTenCharges) (h : 0 โˆ‰ chargeW1Term q5 q10) + (S : Multiset I.allowedTenCharges) (hS : S โІ q10) : + 0 โˆ‰ chargeW1Term q5 S := by + have h1 : chargeW1Term q5 S โІ chargeW1Term q5 q10 := by + apply chargeW1Term_subset_of_subset_ten + exact hS + exact fun a => h (h1 a) /-- The charges of the term `๐›ฝแตข 5ฬ„Mโฑ5Hu`. -/ def chargeBetaTerm (q5bar : Multiset I.allowedBarFiveCharges) (qHu : I.allowedBarFiveCharges) : Multiset โ„ค := q5bar.map (fun x => x.1 + (- qHu.1)) @@ -104,6 +112,15 @@ lemma chargeLambdaTerm_single_q10 (q5 : Multiset I.allowedBarFiveCharges) exact Multiset.singleton_subset.mpr ha exact fun a => h (h1 a) +lemma chargeLambdaTerm_subset_q10 (q5 : Multiset I.allowedBarFiveCharges) + (q10 : Multiset I.allowedTenCharges) (h : 0 โˆ‰ chargeLambdaTerm q5 q10) + (S : Multiset I.allowedTenCharges) (hS : S โІ q10) : + 0 โˆ‰ chargeLambdaTerm q5 S := by + have h1 : chargeLambdaTerm q5 S โІ chargeLambdaTerm q5 q10 := by + apply chargeLambdaTerm_subset_of_subset_ten + exact hS + exact fun a => h (h1 a) + /-- The charges of the term `Kยนแตขโฑผโ‚– 10โฑ 10สฒ 5Mแต`. -/ def chargeK1Term (q5bar : Multiset I.allowedBarFiveCharges) (q10 : Multiset I.allowedTenCharges) : Multiset โ„ค := @@ -130,6 +147,15 @@ lemma chargeK1Term_single_q10 (q5 : Multiset I.allowedBarFiveCharges) exact Multiset.singleton_subset.mpr ha exact fun a => h (h1 a) +lemma chargeK1Term_subset_q10 (q5 : Multiset I.allowedBarFiveCharges) + (q10 : Multiset I.allowedTenCharges) (h : 0 โˆ‰ chargeK1Term q5 q10) + (S : Multiset I.allowedTenCharges) (hS : S โІ q10) : + 0 โˆ‰ chargeK1Term q5 S := by + have h1 : chargeK1Term q5 S โІ chargeK1Term q5 q10 := by + apply chargeK1Term_subset_of_subset_ten + exact hS + exact fun a => h (h1 a) + /-- The charges of the term `Wโดแตข 5ฬ„Mโฑ 5ฬ„Hd 5Hu 5Hu`. -/ def chargeW4Term (q5bar : Multiset I.allowedBarFiveCharges) (qHd : I.allowedBarFiveCharges) (qHu : I.allowedBarFiveCharges) : Multiset โ„ค := @@ -189,7 +215,7 @@ Bottom-Yukawa (ฮปแต‡แตขโฑผ 10โฑ 5ฬ„Mสฒ 5ฬ„Hd) : {(chargeYukawaBottom /-- A proposition which is true when the `ฮผ`-term (`5Hu 5ฬ„Hd`) does not obey the additional `U(1)` symmetry in the model, and is therefore constrained. -/ -def MuTermU1Constrained : Prop := - ๐“œ.qHu.1 + ๐“œ.qHd.1 โ‰  0 +def MuTermU1Constrained : Prop := chargeMuTerm ๐“œ.qHu ๐“œ.qHd โ‰  0 instance : Decidable ๐“œ.MuTermU1Constrained := instDecidableNot @@ -206,20 +232,19 @@ instance : Decidable ๐“œ.MuTermU1Constrained := instDecidableNot -/ def RParityU1Constrained : Prop := --`๐›ฝแตข 5ฬ„Mโฑ5Hu` - (โˆ€ fi โˆˆ ๐“œ.quantaBarFiveMatter, fi.q.1 + (- ๐“œ.qHu.1) โ‰  0) + 0 โˆ‰ chargeBetaTerm (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) ๐“œ.qHu -- `๐œ†แตขโฑผโ‚– 5ฬ„Mโฑ 5ฬ„Mสฒ 10แต` - โˆง (โˆ€ fi โˆˆ ๐“œ.quantaBarFiveMatter, โˆ€ fj โˆˆ ๐“œ.quantaBarFiveMatter, โˆ€ tk โˆˆ ๐“œ.quantaTen, - fi.q.1 + fj.q.1 + tk.q.1 โ‰  0) + โˆง 0 โˆ‰ chargeLambdaTerm (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) + (๐“œ.quantaTen.map QuantaTen.q) -- `Wยฒแตขโฑผโ‚– 10โฑ 10สฒ 10แต 5ฬ„Hd` - โˆง (โˆ€ ti โˆˆ ๐“œ.quantaTen, โˆ€ tj โˆˆ ๐“œ.quantaTen, โˆ€ tk โˆˆ ๐“œ.quantaTen, - ti.q.1 + tj.q.1 + tk.q.1 + ๐“œ.qHd.1 โ‰  0) + โˆง 0 โˆ‰ chargeW2Term (๐“œ.quantaTen.map QuantaTen.q) ๐“œ.qHd -- `Wโดแตข 5ฬ„Mโฑ 5ฬ„Hd 5Hu 5Hu` โˆง 0 โˆ‰ chargeW4Term (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) ๐“œ.qHd ๐“œ.qHu -- `Kยนแตขโฑผโ‚– 10โฑ 10สฒ 5Mแต` โˆง 0 โˆ‰ chargeK1Term (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) (๐“œ.quantaTen.map QuantaTen.q) -- `Kยฒแตข 5ฬ„Hu 5ฬ„Hd 10โฑ` - โˆง (โˆ€ ti โˆˆ ๐“œ.quantaTen, ๐“œ.qHu.1 + ๐“œ.qHd.1 + ti.q.1 โ‰  0) + โˆง 0 โˆ‰ chargeK2Term (๐“œ.quantaTen.map QuantaTen.q) ๐“œ.qHu ๐“œ.qHd instance : Decidable ๐“œ.RParityU1Constrained := instDecidableAnd @@ -234,11 +259,10 @@ instance : Decidable ๐“œ.RParityU1Constrained := instDecidableAnd -/ def ProtonDecayU1Constrained : Prop := -- `Wยนแตขโฑผโ‚–โ‚— 10โฑ 10สฒ 10แต 5ฬ„Mหก` - (โˆ€ ti โˆˆ ๐“œ.quantaTen, โˆ€ tj โˆˆ ๐“œ.quantaTen, โˆ€ tk โˆˆ ๐“œ.quantaTen, โˆ€ fl โˆˆ ๐“œ.quantaBarFiveMatter, - ti.q.1 + tj.q.1 + tk.q.1 + fl.q.1 โ‰  0) + 0 โˆ‰ chargeW1Term (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) (๐“œ.quantaTen.map QuantaTen.q) -- `๐œ†แตขโฑผโ‚– 5ฬ„Mโฑ 5ฬ„Mสฒ 10แต` - โˆง (โˆ€ fi โˆˆ ๐“œ.quantaBarFiveMatter, โˆ€ fj โˆˆ ๐“œ.quantaBarFiveMatter, โˆ€ tk โˆˆ ๐“œ.quantaTen, - fi.q.1 + fj.q.1 + tk.q.1 โ‰  0) + โˆง 0 โˆ‰ chargeLambdaTerm (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) + (๐“œ.quantaTen.map QuantaTen.q) -- `Wยฒแตขโฑผโ‚– 10โฑ 10สฒ 10แต 5ฬ„Hd` โˆง 0 โˆ‰ chargeW2Term (๐“œ.quantaTen.map QuantaTen.q) ๐“œ.qHd -- `Kยนแตขโฑผโ‚– 10โฑ 10สฒ 5Mแต` @@ -250,7 +274,6 @@ instance : Decidable ๐“œ.ProtonDecayU1Constrained := instDecidableAnd /-- The condition on the matter content for there to exist at least one copy of the coupling - `ฮปแต—แตขโฑผ 10โฑ 10สฒ 5Hu` -/ - def HasATopYukawa (๐“œ : MatterContent I) : Prop := 0 โˆˆ chargeYukawaTop (๐“œ.quantaTen.map QuantaTen.q) ๐“œ.qHu @@ -260,15 +283,80 @@ instance : Decidable ๐“œ.HasATopYukawa := /-- The condition on the matter content for there to exist at least one copy of the coupling - `ฮปแต‡แตขโฑผ 10โฑ 5ฬ„Mสฒ 5ฬ„Hd` -/ -def HasABottomYukawa (๐“œ : MatterContent I) : Prop := โˆƒ ti โˆˆ ๐“œ.quantaTen, - โˆƒ fj โˆˆ ๐“œ.quantaBarFiveMatter, - ti.q.1 + fj.q.1 + ๐“œ.qHd.1 = 0 +def HasABottomYukawa (๐“œ : MatterContent I) : Prop := + 0 โˆˆ chargeYukawaBottom (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) + (๐“œ.quantaTen.map QuantaTen.q) ๐“œ.qHu instance : Decidable ๐“œ.HasABottomYukawa := - haveI : DecidablePred fun (ti : QuantaTen I) => - โˆƒ fj โˆˆ ๐“œ.quantaBarFiveMatter, ti.q.1 + fj.q.1 + ๐“œ.qHd.1 = 0 := fun _ => - Multiset.decidableExistsMultiset - Multiset.decidableExistsMultiset + Multiset.decidableMem _ _ + +/-! + +## More sophisticated checks +-/ + +lemma lambdaTerm_K1Term_W1Term_subset_check {I : CodimensionOneConfig} {n : โ„•} (๐“œ : MatterContent I) + (hcard : ๐“œ.quantaBarFiveMatter.card = n) (h : ๐“œ.ProtonDecayU1Constrained) + (S : Multiset (I.allowedTenCharges)) + (hS : โˆ€ (F : Finset { x // x โˆˆ I.allowedBarFiveCharges }), F.card = n โ†’ + F โІ Finset.univ โ†’ F.card = n โ†’ + (0 โˆˆ chargeW1Term F.val S โˆจ 0 โˆˆ chargeLambdaTerm F.val S) โˆจ 0 โˆˆ chargeK1Term F.val S:= by + decide) : + ยฌ S โІ ๐“œ.quantaTen.map QuantaTen.q := by + intro hn + have hL1 := chargeLambdaTerm_subset_q10 (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) + (๐“œ.quantaTen.map QuantaTen.q) h.2.1 _ hn + have hW1 := chargeW1Term_subset_q10 (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) + (๐“œ.quantaTen.map QuantaTen.q) h.1 _ hn + have hK1 := chargeK1Term_subset_q10 (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) + (๐“œ.quantaTen.map QuantaTen.q) h.2.2.2 _ hn + apply not_or_intro (not_or_intro hW1 hL1) hK1 + have h5 : ((๐“œ.quantaBarFiveMatter).map QuantaBarFive.q).card = n := by + rw [Multiset.card_map] + exact hcard + rw [๐“œ.quantaBarFiveMatter_map_q_eq_toFinset] at h5 โŠข + generalize (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q).toFinset = F at h5 โŠข + have hW1T : F โˆˆ (Finset.powerset (Finset.univ)).filter (fun x => x.card = n) := by + rw [Finset.mem_filter] + rw [Finset.mem_powerset] + simp_all only [Finset.card_val, and_true] + exact Finset.subset_univ F + revert F + simp only [Finset.card_val, Finset.univ_eq_attach, Finset.mem_filter, Finset.mem_powerset, + Int.reduceNeg, and_imp] + exact hS + +lemma lambdaTerm_K1Term_W1Term_singleton_check {I : CodimensionOneConfig} {n : โ„•} + (๐“œ : MatterContent I) + (hcard : ๐“œ.quantaBarFiveMatter.card = n) (h : ๐“œ.ProtonDecayU1Constrained) + (a : (I.allowedTenCharges)) + (ha : โˆ€ (F : Finset { x // x โˆˆ I.allowedBarFiveCharges }), F.card = n โ†’ + F โІ Finset.univ โ†’ F.card = n โ†’ + (0 โˆˆ chargeW1Term F.val {a} โˆจ 0 โˆˆ chargeLambdaTerm F.val {a}) โˆจ + 0 โˆˆ chargeK1Term F.val {a} := by decide) : + a โˆ‰ ๐“œ.quantaTen.map QuantaTen.q := by + intro hn + have hL1 := chargeLambdaTerm_single_q10 (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) + (๐“œ.quantaTen.map QuantaTen.q) h.2.1 _ hn + have hW1 := chargeW1Term_single_q10 (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) + (๐“œ.quantaTen.map QuantaTen.q) h.1 _ hn + have hK1 := chargeK1Term_single_q10 (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q) + (๐“œ.quantaTen.map QuantaTen.q) h.2.2.2 _ hn + apply not_or_intro (not_or_intro hW1 hL1) hK1 + have h5 : ((๐“œ.quantaBarFiveMatter).map QuantaBarFive.q).card = n := by + rw [Multiset.card_map] + exact hcard + rw [๐“œ.quantaBarFiveMatter_map_q_eq_toFinset] at h5 โŠข + generalize (๐“œ.quantaBarFiveMatter.map QuantaBarFive.q).toFinset = F at h5 โŠข + have hW1T : F โˆˆ (Finset.powerset (Finset.univ)).filter (fun x => x.card = n) := by + rw [Finset.mem_filter] + rw [Finset.mem_powerset] + simp_all only [Finset.card_val, and_true] + exact Finset.subset_univ F + revert F + simp only [Finset.card_val, Finset.univ_eq_attach, Finset.mem_filter, Finset.mem_powerset, + Int.reduceNeg, and_imp] + exact ha end MatterContent end SU5U1 From 1870115ea4bc235b013808bcf90dc056667a6942 Mon Sep 17 00:00:00 2001 From: jstoobysmith <72603918+jstoobysmith@users.noreply.github.com> Date: Fri, 2 May 2025 07:22:42 +0000 Subject: [PATCH 21/32] chore: Fix file deletion --- .../TightBindingChain/Basic.lean | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 PhysLean/CondensedMatter/TightBindingChain/Basic.lean diff --git a/PhysLean/CondensedMatter/TightBindingChain/Basic.lean b/PhysLean/CondensedMatter/TightBindingChain/Basic.lean new file mode 100644 index 000000000..ee8670625 --- /dev/null +++ b/PhysLean/CondensedMatter/TightBindingChain/Basic.lean @@ -0,0 +1,24 @@ +/- +Copyright (c) 2025 Joseph Tooby-Smith. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Joseph Tooby-Smith +-/ +import PhysLean.Meta.TODO.Basic +/-! + +# The tight binding chain + +The tight binding chain corresponds to an electron in motion +in a 1d solid with the assumption the electron can sit only on the atoms of the solid. + +The solid is assumed to consist of `N` sites with a seperation of `a` between them. + +## Refs. + +- https://www.damtp.cam.ac.uk/user/tong/aqm/aqmtwo.pdf + +-/ + +TODO "BBZAB" "Prove results related to the one-dimensional tight binding chain. + This is related to the following issue/feature-request: + https://github.com/HEPLean/PhysLean/issues/523 " From a67a6ab56d5eb4d5cfcb0c159b2e04f8424b0d67 Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Sat, 3 May 2025 12:04:44 +0200 Subject: [PATCH 22/32] update Pseudo-Riemannian fixed last review suggestions --- .../Metric/PseudoRiemannian/Defs.lean | 141 +++++++----------- .../Geometry/Metric/Riemannian/Defs.lean | 41 ++--- 2 files changed, 69 insertions(+), 113 deletions(-) diff --git a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean index a020f5289..d72f6cb6b 100644 --- a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean @@ -3,15 +3,12 @@ Copyright (c) 2025 Matteo Cipollina. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Matteo Cipollina -/ - import Mathlib.Analysis.InnerProductSpace.Basic import Mathlib.Analysis.RCLike.Lemmas import Mathlib.Geometry.Manifold.MFDeriv.Defs -import Mathlib.Geometry.Manifold.VectorBundle.Basic import Mathlib.LinearAlgebra.BilinearForm.Properties import Mathlib.LinearAlgebra.QuadraticForm.Real import Mathlib.Topology.LocallyConstant.Basic - /-! # Pseudo-Riemannian Metrics on Smooth Manifolds @@ -52,7 +49,7 @@ open scoped Manifold Bundle LinearMap Dual namespace QuadraticForm -variable {K : Type*} [Field K] [LinearOrder K] +variable {K : Type*} [Field K] /-- The negative dimension (or index) of a quadratic form is the dimension of a maximal negative definite subspace. -/ @@ -153,7 +150,7 @@ theorem rankNeg_eq_zero {E : Type*} [AddCommGroup E] end QuadraticForm /-- Helper function to convert the metric tensor at `x` to a quadratic form. -/ -private def PseudoRiemannianMetricValToQuadraticForm +private def pseudoRiemannianMetricValToQuadraticForm {E : Type v} [NormedAddCommGroup E] [NormedSpace โ„ E] {H : Type w} [TopologicalSpace H] {M : Type w} [TopologicalSpace M] [ChartedSpace H M] @@ -185,17 +182,12 @@ structure PseudoRiemannianMetric (E : Type v) (H : Type w) (M : Type w) (n : WithTop โ„•โˆž) [inst_norm_grp_E : NormedAddCommGroup E] [inst_norm_sp_E : NormedSpace โ„ E] - [inst_findim_E : FiniteDimensional โ„ E] [inst_top_H : TopologicalSpace H] [inst_top_M : TopologicalSpace M] [inst_chart_M : ChartedSpace H M] [inst_chart_E : ChartedSpace H E] (I : ModelWithCorners โ„ E H) [inst_mani : IsManifold I (n + 1) M] - [inst_total_top : TopologicalSpace (TotalSpace E (TangentSpace I : M โ†’ Type _))] - [inst_fb : FiberBundle E (TangentSpace I : M โ†’ Type _)] - [inst_vb : VectorBundle โ„ E (TangentSpace I : M โ†’ Type _)] - [inst_cmvb : ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] [inst_tangent_findim : โˆ€ (x : M), FiniteDimensional โ„ (TangentSpace I x)] : Type (max u v w) where /-- The metric tensor at each point `x : M`, represented as a continuous linear map @@ -219,27 +211,18 @@ structure PseudoRiemannianMetric protected negDim_isLocallyConstant : IsLocallyConstant (fun x : M => have : FiniteDimensional โ„ (TangentSpace I x) := inferInstance - (PseudoRiemannianMetricValToQuadraticForm val symm x).negDim) + (pseudoRiemannianMetricValToQuadraticForm val symm x).negDim) namespace PseudoRiemannianMetric variable {E : Type v} {H : Type w} {M : Type w} {n : WithTop โ„•โˆž} -variable [NormedAddCommGroup E] [NormedSpace โ„ E] [FiniteDimensional โ„ E] +variable [NormedAddCommGroup E] [NormedSpace โ„ E] variable [TopologicalSpace H] [TopologicalSpace M] [ChartedSpace H M] [ChartedSpace H E] variable {I : ModelWithCorners โ„ E H} variable [IsManifold I (n + 1) M] -variable [TopologicalSpace (TotalSpace E (TangentSpace I : M โ†’ Type _))] -variable [FiberBundle E (TangentSpace I : M โ†’ Type _)] -variable [VectorBundle โ„ E (TangentSpace I : M โ†’ Type _)] -variable [ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] variable [inst_tangent_findim : โˆ€ (x : M), FiniteDimensional โ„ (TangentSpace I x)] variable {g : PseudoRiemannianMetric E H M n I} -instance TangentSpace.addCommGroup (x : M) : AddCommGroup (TangentSpace I x) := by infer_instance -instance TangentSpace.module (x : M) : Module โ„ (TangentSpace I x) := by infer_instance -instance TangentSpace.finiteDimensional (x : M) : FiniteDimensional โ„ (TangentSpace I x) := by - infer_instance - /-- Convert the metric's continuous linear map representation `val x` to the algebraic `LinearMap.BilinForm`. -/ def toBilinForm (g : PseudoRiemannianMetric E H M n I) (x : M) : @@ -260,43 +243,33 @@ def toBilinForm (g : PseudoRiemannianMetric E H M n I) (x : M) : /-- Convert a pseudo-Riemannian metric at a point `x` to a quadratic form `v โ†ฆ gโ‚“(v, v)`. -/ def toQuadraticForm (g : PseudoRiemannianMetric E H M n I) (x : M) : QuadraticForm โ„ (TangentSpace I x) := - PseudoRiemannianMetricValToQuadraticForm g.val g.symm x + pseudoRiemannianMetricValToQuadraticForm g.val g.symm x -- Coercion from PseudoRiemannianMetric to its function representation. instance coeFunInst : CoeFun (PseudoRiemannianMetric E H M n I) (fun _ => โˆ€ x : M, TangentSpace I x โ†’L[โ„] (TangentSpace I x โ†’L[โ„] โ„)) where coe g := g.val -@[simp] lemma toBilinForm_apply (g : PseudoRiemannianMetric E H M n I) (x : M) +@[simp] +lemma toBilinForm_apply (g : PseudoRiemannianMetric E H M n I) (x : M) (v w : TangentSpace I x) : toBilinForm g x v w = g.val x v w := rfl -@[simp] lemma toQuadraticForm_apply (g : PseudoRiemannianMetric E H M n I) (x : M) +@[simp] +lemma toQuadraticForm_apply (g : PseudoRiemannianMetric E H M n I) (x : M) (v : TangentSpace I x) : toQuadraticForm g x v = g.val x v v := rfl -@[simp] lemma toBilinForm_isSymm (g : PseudoRiemannianMetric E H M n I) (x : M) : +@[simp] +lemma toBilinForm_isSymm (g : PseudoRiemannianMetric E H M n I) (x : M) : (toBilinForm g x).IsSymm := by intro v w; simp only [toBilinForm_apply]; exact g.symm x v w -@[simp] lemma toBilinForm_nondegenerate (g : PseudoRiemannianMetric E H M n I) (x : M) : +@[simp] +lemma toBilinForm_nondegenerate (g : PseudoRiemannianMetric E H M n I) (x : M) : (toBilinForm g x).Nondegenerate := by intro v hv; simp_rw [toBilinForm_apply] at hv; exact g.nondegenerate x v hv -lemma symm' (x : M) (v w : TangentSpace I x) : (g.val x v) w = (g.val x w) v := - g.symm x v w - -lemma nondegenerate' (x : M) (v : TangentSpace I x) - (h : โˆ€ w : TangentSpace I x, (g.val x v) w = 0) : v = 0 := g.nondegenerate x v h - -lemma smooth' (xโ‚€ : M) (v w : E) : - ContDiffWithinAt โ„ n (fun y => g.val ((extChartAt I xโ‚€).symm y) - (mfderiv I I ((extChartAt I xโ‚€).symm) y v) (mfderiv I I ((extChartAt I xโ‚€).symm) y w)) - ((extChartAt I xโ‚€).target) ((extChartAt I xโ‚€) xโ‚€) := g.smooth_in_charts' xโ‚€ v w - -lemma negDim_isLocallyConstant' : IsLocallyConstant (fun x => (toQuadraticForm g x).negDim) := - g.negDim_isLocallyConstant - /-- The "musical" isomorphism (index lowering) from the tangent space to its dual, induced by a pseudo-Riemannian metric. -/ def flat (g : PseudoRiemannianMetric E H M n I) (x : M) : @@ -305,26 +278,30 @@ def flat (g : PseudoRiemannianMetric E H M n I) (x : M) : map_add' := ฮป v w => by simp only [ContinuousLinearMap.map_add], map_smul' := ฮป a v => by simp only [ContinuousLinearMap.map_smul]; rfl } -@[simp] lemma flat_apply (g : PseudoRiemannianMetric E H M n I) (x : M) (v w : TangentSpace I x) : +@[simp] +lemma flat_apply (g : PseudoRiemannianMetric E H M n I) (x : M) (v w : TangentSpace I x) : (flat g x v) w = g.val x v w := by rfl /-- The musical isomorphism as a continuous linear map. -/ def flatL (g : PseudoRiemannianMetric E H M n I) (x : M) : - TangentSpace I x โ†’L[โ„] (TangentSpace I x โ†’L[โ„] โ„) := - { toFun := ฮป v => g.val x v, - map_add' := ฮป v w => by simp only [ContinuousLinearMap.map_add], - map_smul' := ฮป a v => by simp only [ContinuousLinearMap.map_smul]; rfl, - cont := ContinuousLinearMap.continuous (g.val x) } - -@[simp] lemma flatL_apply (g : PseudoRiemannianMetric E H M n I) (x : M) (v w : TangentSpace I x) : + TangentSpace I x โ†’L[โ„] (TangentSpace I x โ†’L[โ„] โ„) where + toFun := ฮป v => g.val x v + map_add' := ฮป v w => by simp only [ContinuousLinearMap.map_add] + map_smul' := ฮป a v => by simp only [ContinuousLinearMap.map_smul]; rfl + cont := ContinuousLinearMap.continuous (g.val x) + +@[simp] +lemma flatL_apply (g : PseudoRiemannianMetric E H M n I) (x : M) (v w : TangentSpace I x) : (flatL g x v) w = g.val x v w := rfl -@[simp] lemma flat_inj (g : PseudoRiemannianMetric E H M n I) (x : M) : +@[simp] +lemma flat_inj (g : PseudoRiemannianMetric E H M n I) (x : M) : Function.Injective (flat g x) := by rw [โ† LinearMap.ker_eq_bot]; apply LinearMap.ker_eq_bot'.mpr - intro v hv; apply g.nondegenerate' x v; intro w; exact DFunLike.congr_fun hv w + intro v hv; apply g.nondegenerate x v; intro w; exact DFunLike.congr_fun hv w -@[simp] lemma flatL_inj (g : PseudoRiemannianMetric E H M n I) (x : M) : +@[simp] +lemma flatL_inj (g : PseudoRiemannianMetric E H M n I) (x : M) : Function.Injective (flatL g x) := flat_inj g x @@ -344,12 +321,6 @@ def ContinuousLinearMap.equivModuleDual (๐•œ E : Type*) [NontriviallyNormedFiel left_inv f := by ext; rfl right_inv ฯ† := rfl -/-- Helper theorem: in finite dimensions, every linear map is continuous -/ -theorem continuous_linear_map_of_finite_dimension {๐•œ E : Type*} [NontriviallyNormedField ๐•œ] - [NormedAddCommGroup E] [NormedSpace ๐•œ E] [FiniteDimensional ๐•œ E] [CompleteSpace ๐•œ] - (f : E โ†’โ‚—[๐•œ] ๐•œ) : Continuous f := - by exact LinearMap.continuous_of_finiteDimensional f - /-- For a finite-dimensional normed space, the dimension of the continuous dual equals the dimension of the original space. -/ lemma finrank_continuousDual_eq_finrank {๐•œ E : Type*} [NontriviallyNormedField ๐•œ] @@ -361,10 +332,11 @@ lemma finrank_continuousDual_eq_finrank {๐•œ E : Type*} [NontriviallyNormedFiel exact finrank_linearMap_self ๐•œ ๐•œ E rw [LinearEquiv.finrank_eq h1, h2] -@[simp] lemma flatL_surj +@[simp] +lemma flatL_surj (g : PseudoRiemannianMetric E H M n I) (x : M) : Function.Surjective (g.flatL x) := by - haveI : FiniteDimensional โ„ (TangentSpace I x) := TangentSpace.finiteDimensional x + haveI : FiniteDimensional โ„ (TangentSpace I x) := inst_tangent_findim x have h_finrank_eq : finrank โ„ (TangentSpace I x) = finrank โ„ (TangentSpace I x โ†’L[โ„] โ„) := by have h_dual_eq : finrank โ„ (TangentSpace I x โ†’L[โ„] โ„) = finrank โ„ (Module.Dual โ„ (TangentSpace I x)) := by @@ -390,7 +362,7 @@ lemma finrank_continuousDual_eq_finrank {๐•œ E : Type*} [NontriviallyNormedFiel /-- The "musical" isomorphism (index lowering) from the tangent space to its dual, as a continuous linear equivalence. -/ -@[simp] def flatEquiv +def flatEquiv (g : PseudoRiemannianMetric E H M n I) (x : M) : TangentSpace I x โ‰ƒL[โ„] (TangentSpace I x โ†’L[โ„] โ„) := @@ -403,7 +375,8 @@ lemma coe_flatEquiv (g : PseudoRiemannianMetric E H M n I) (x : M) : (g.flatEquiv x : TangentSpace I x โ†’โ‚—[โ„] (TangentSpace I x โ†’L[โ„] โ„)) = g.flatL x := rfl -@[simp] lemma flatEquiv_apply +@[simp] +lemma flatEquiv_apply (g : PseudoRiemannianMetric E H M n I) (x : M) (v w : TangentSpace I x) : (g.flatEquiv x v) w = g.val x v w := rfl @@ -432,17 +405,20 @@ noncomputable def sharp (g : PseudoRiemannianMetric E H M n I) (x : M) : (TangentSpace I x โ†’L[โ„] โ„) โ†’โ‚—[โ„] TangentSpace I x := (g.sharpEquiv x).toLinearEquiv.toLinearMap -@[simp] lemma sharpL_apply_flatL +@[simp] +lemma sharpL_apply_flatL (g : PseudoRiemannianMetric E H M n I) (x : M) (v : TangentSpace I x) : g.sharpL x (g.flatL x v) = v := (g.flatEquiv x).left_inv v -@[simp] lemma flatL_apply_sharpL +@[simp] +lemma flatL_apply_sharpL (g : PseudoRiemannianMetric E H M n I) (x : M) (ฯ‰ : TangentSpace I x โ†’L[โ„] โ„) : g.flatL x (g.sharpL x ฯ‰) = ฯ‰ := (g.flatEquiv x).right_inv ฯ‰ /-- Applying `sharp` then `flat` recovers the original covector. -/ -@[simp] lemma flat_sharp_apply +@[simp] +lemma flat_sharp_apply (g : PseudoRiemannianMetric E H M n I) (x : M) (ฯ‰ : TangentSpace I x โ†’L[โ„] โ„) : g.flat x (g.sharp x ฯ‰) = ฯ‰ := by have := flatL_apply_sharpL g x ฯ‰ @@ -450,7 +426,8 @@ noncomputable def sharp ContinuousLinearEquiv.coe_coe, LinearEquiv.coe_coe] at this โŠข exact this -@[simp] lemma sharp_flat_apply +@[simp] +lemma sharp_flat_apply (g : PseudoRiemannianMetric E H M n I) (x : M) (v : TangentSpace I x) : g.sharp x (g.flat x v) = v := by have := sharpL_apply_flatL g x v @@ -459,7 +436,8 @@ noncomputable def sharp exact this /-- The metric evaluated at `sharp ฯ‰โ‚` and `sharp ฯ‰โ‚‚`. -/ -@[simp] lemma apply_sharp_sharp +@[simp] +lemma apply_sharp_sharp (g : PseudoRiemannianMetric E H M n I) (x : M) (ฯ‰โ‚ ฯ‰โ‚‚ : TangentSpace I x โ†’L[โ„] โ„) : g.val x (g.sharpL x ฯ‰โ‚) (g.sharpL x ฯ‰โ‚‚) = ฯ‰โ‚ (g.sharpL x ฯ‰โ‚‚) := by rw [โ† flatL_apply g x (g.sharpL x ฯ‰โ‚)] @@ -470,33 +448,26 @@ lemma apply_vec_sharp (g : PseudoRiemannianMetric E H M n I) (x : M) (v : TangentSpace I x) (ฯ‰ : TangentSpace I x โ†’L[โ„] โ„) : g.val x v (g.sharpL x ฯ‰) = ฯ‰ v := by - rw [g.symm' x v (g.sharpL x ฯ‰)] + rw [g.symm x v (g.sharpL x ฯ‰)] rw [โ† flatL_apply g x (g.sharpL x ฯ‰)] rw [flatL_apply_sharpL g x ฯ‰] -end PseudoRiemannianMetric - -namespace PseudoRiemannianMetric +section Cotangent variable {E : Type v} {H : Type w} {M : Type w} {n : WithTop โ„•โˆž} -variable [NormedAddCommGroup E] [NormedSpace โ„ E] [FiniteDimensional โ„ E] +variable [NormedAddCommGroup E] [NormedSpace โ„ E] variable [TopologicalSpace H] [TopologicalSpace M] [ChartedSpace H M] [ChartedSpace H E] variable {I : ModelWithCorners โ„ E H} variable [IsManifold I (n + 1) M] -variable [TopologicalSpace (TotalSpace E (TangentSpace I : M โ†’ Type _))] -variable [FiberBundle E (TangentSpace I : M โ†’ Type _)] -variable [VectorBundle โ„ E (TangentSpace I : M โ†’ Type _)] -variable [ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] variable [inst_tangent_findim : โˆ€ (x : M), FiniteDimensional โ„ (TangentSpace I x)] -section Cotangent - /-- The value of the induced metric on the cotangent space at point `x`. -/ noncomputable def cotangentMetricVal (g : PseudoRiemannianMetric E H M n I) (x : M) (ฯ‰โ‚ ฯ‰โ‚‚ : TangentSpace I x โ†’L[โ„] โ„) : โ„ := g.val x (g.sharpL x ฯ‰โ‚) (g.sharpL x ฯ‰โ‚‚) -@[simp] lemma cotangentMetricVal_eq_apply_sharp (g : PseudoRiemannianMetric E H M n I) (x : M) +@[simp] +lemma cotangentMetricVal_eq_apply_sharp (g : PseudoRiemannianMetric E H M n I) (x : M) (ฯ‰โ‚ ฯ‰โ‚‚ : TangentSpace I x โ†’L[โ„] โ„) : cotangentMetricVal g x ฯ‰โ‚ ฯ‰โ‚‚ = ฯ‰โ‚ (g.sharpL x ฯ‰โ‚‚) := by rw [cotangentMetricVal, apply_sharp_sharp] @@ -505,7 +476,7 @@ lemma cotangentMetricVal_symm (g : PseudoRiemannianMetric E H M n I) (x : M) (ฯ‰โ‚ ฯ‰โ‚‚ : TangentSpace I x โ†’L[โ„] โ„) : cotangentMetricVal g x ฯ‰โ‚ ฯ‰โ‚‚ = cotangentMetricVal g x ฯ‰โ‚‚ ฯ‰โ‚ := by unfold cotangentMetricVal - rw [g.symm' x (g.sharpL x ฯ‰โ‚) (g.sharpL x ฯ‰โ‚‚)] + rw [g.symm x (g.sharpL x ฯ‰โ‚) (g.sharpL x ฯ‰โ‚‚)] /-- The induced metric on the cotangent space at point `x` as a bilinear form. -/ noncomputable def cotangentToBilinForm (g : PseudoRiemannianMetric E H M n I) (x : M) : @@ -559,15 +530,18 @@ noncomputable def cotangentToQuadraticForm (g : PseudoRiemannianMetric E H M n I simp only [ContinuousLinearMap.map_add, ContinuousLinearMap.add_apply] ringโŸฉ -@[simp] lemma cotangentToBilinForm_apply (g : PseudoRiemannianMetric E H M n I) (x : M) +@[simp] +lemma cotangentToBilinForm_apply (g : PseudoRiemannianMetric E H M n I) (x : M) (ฯ‰โ‚ ฯ‰โ‚‚ : TangentSpace I x โ†’L[โ„] โ„) : cotangentToBilinForm g x ฯ‰โ‚ ฯ‰โ‚‚ = cotangentMetricVal g x ฯ‰โ‚ ฯ‰โ‚‚ := rfl -@[simp] lemma cotangentToQuadraticForm_apply (g : PseudoRiemannianMetric E H M n I) (x : M) +@[simp] +lemma cotangentToQuadraticForm_apply (g : PseudoRiemannianMetric E H M n I) (x : M) (ฯ‰ : TangentSpace I x โ†’L[โ„] โ„) : cotangentToQuadraticForm g x ฯ‰ = cotangentMetricVal g x ฯ‰ ฯ‰ := rfl -@[simp] lemma cotangentToBilinForm_isSymm (g : PseudoRiemannianMetric E H M n I) (x : M) : +@[simp] +lemma cotangentToBilinForm_isSymm (g : PseudoRiemannianMetric E H M n I) (x : M) : (cotangentToBilinForm g x).IsSymm := by intro ฯ‰โ‚ ฯ‰โ‚‚; simp only [cotangentToBilinForm_apply]; exact cotangentMetricVal_symm g x ฯ‰โ‚ ฯ‰โ‚‚ @@ -590,7 +564,8 @@ lemma cotangentMetricVal_nondegenerate (g : PseudoRiemannianMetric E H M n I) (x exact h_apply exact h_forall v -@[simp] lemma cotangentToBilinForm_nondegenerate (g : PseudoRiemannianMetric E H M n I) (x : M) : +@[simp] +lemma cotangentToBilinForm_nondegenerate (g : PseudoRiemannianMetric E H M n I) (x : M) : (cotangentToBilinForm g x).Nondegenerate := by intro ฯ‰ hฯ‰ apply cotangentMetricVal_nondegenerate g x ฯ‰ diff --git a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean index d3179c311..9c25ed298 100644 --- a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean @@ -3,24 +3,9 @@ Copyright (c) 2025 Matteo Cipollina. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Matteo Cipollina -/ - -import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Defs -import Mathlib.LinearAlgebra.QuadraticForm.Dual - import Mathlib.Algebra.Lie.OfAssociative -import Mathlib.Analysis.InnerProductSpace.Basic -import Mathlib.Analysis.Normed.Field.Instances -import Mathlib.Analysis.RCLike.Lemmas -import Mathlib.Data.Real.StarOrdered -import Mathlib.Geometry.Manifold.MFDeriv.Defs -import Mathlib.Geometry.Manifold.VectorBundle.Basic -import Mathlib.LinearAlgebra.BilinearForm.Properties -import Mathlib.LinearAlgebra.FreeModule.PID -import Mathlib.LinearAlgebra.QuadraticForm.Real -import Mathlib.RingTheory.Henselian -import Mathlib.Topology.Algebra.Module.ModuleTopology -import Mathlib.Topology.LocallyConstant.Basic import Mathlib.MeasureTheory.Integral.IntervalIntegral +import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Defs /-! # Riemannian Metric Definitions @@ -35,7 +20,7 @@ open PseudoRiemannianMetric InnerProductSpace noncomputable section -variable {E : Type v} [NormedAddCommGroup E] [NormedSpace โ„ E] [FiniteDimensional โ„ E] +variable {E : Type v} [NormedAddCommGroup E] [NormedSpace โ„ E] variable {H : Type w} [TopologicalSpace H] variable {M : Type w} [TopologicalSpace M] [ChartedSpace H M] [ChartedSpace H E] variable {I : ModelWithCorners โ„ E H} {n : โ„•โˆž} @@ -46,10 +31,6 @@ variable {I : ModelWithCorners โ„ E H} {n : โ„•โˆž} structure RiemannianMetric (I : ModelWithCorners โ„ E H) (n : โ„•โˆž) (M : Type w) [TopologicalSpace M] [ChartedSpace H M] [IsManifold I (n + 1) M] - [inst_top : TopologicalSpace (TangentBundle I M)] - [inst_fib : FiberBundle E (TangentSpace I : M โ†’ Type _)] - [inst_vec : VectorBundle โ„ E (TangentSpace I : M โ†’ Type _)] - [inst_cmvb : ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] [inst_tangent_findim : โˆ€ (x : M), FiniteDimensional โ„ (TangentSpace I x)] : Type _ where /-- The underlying pseudo-Riemannian metric. -/ toPseudoRiemannianMetric : PseudoRiemannianMetric E H M (n) I @@ -60,17 +41,14 @@ namespace RiemannianMetric variable {I : ModelWithCorners โ„ E H} {n : โ„•โˆž} {M : Type w} variable [TopologicalSpace M] [ChartedSpace H M] [IsManifold I (n + 1) M] -variable [inst_top : TopologicalSpace (TangentBundle I M)] -variable [inst_fib : FiberBundle E (TangentSpace I : M โ†’ Type _)] -variable [inst_vec : VectorBundle โ„ E (TangentSpace I : M โ†’ Type _)] -variable [inst_cmvb : ContMDiffVectorBundle n E (TangentSpace I : M โ†’ Type _) I] variable [inst_tangent_findim : โˆ€ (x : M), FiniteDimensional โ„ (TangentSpace I x)] /-- Coercion from RiemannianMetric to its underlying PseudoRiemannianMetric. -/ instance : Coe (RiemannianMetric I n M) (PseudoRiemannianMetric E H M (n) I) where coe g := g.toPseudoRiemannianMetric -@[simp] lemma pos_def (g : RiemannianMetric I n M) (x : M) (v : TangentSpace I x) +@[simp] +lemma pos_def (g : RiemannianMetric I n M) (x : M) (v : TangentSpace I x) (hv : v โ‰  0) : (g.toPseudoRiemannianMetric.val x v) v > 0 := g.pos_def' x v hv @@ -87,17 +65,19 @@ abbrev toQuadraticForm (g : RiemannianMetric I n M) (x : M) : g.toPseudoRiemannianMetric.toQuadraticForm x /-- The quadratic form associated with a Riemannian metric is positive definite. -/ -@[simp] lemma toQuadraticForm_posDef (g : RiemannianMetric I n M) (x : M) : +@[simp] +lemma toQuadraticForm_posDef (g : RiemannianMetric I n M) (x : M) : (g.toQuadraticForm x).PosDef := ฮป v hv => g.pos_def x v hv /-- The application of a Riemannian metric's quadratic form to a vector. -/ -@[simp] lemma toQuadraticForm_apply (g : RiemannianMetric I n M) (x : M) +@[simp] +lemma toQuadraticForm_apply (g : RiemannianMetric I n M) (x : M) (v : TangentSpace I x) : g.toQuadraticForm x v = g.toPseudoRiemannianMetric.val x v v := by simp only [toQuadraticForm, PseudoRiemannianMetric.toQuadraticForm_apply] -theorem riemannian_metric_negDim_zero (g : RiemannianMetric I n M) (x : M) : +lemma riemannian_metric_negDim_zero (g : RiemannianMetric I n M) (x : M) : (g.toQuadraticForm x).negDim = 0 := by apply QuadraticForm.rankNeg_eq_zero exact g.toQuadraticForm_posDef x @@ -106,7 +86,8 @@ theorem riemannian_metric_negDim_zero (g : RiemannianMetric I n M) (x : M) : def inner (g : RiemannianMetric I n M) (x : M) (v w : TangentSpace I x) : โ„ := g.toPseudoRiemannianMetric.val x v w -@[simp] lemma inner_apply (g : RiemannianMetric I n M) (x : M) (v w : TangentSpace I x) : +@[simp] +lemma inner_apply (g : RiemannianMetric I n M) (x : M) (v w : TangentSpace I x) : inner g x v w = g.toPseudoRiemannianMetric.val x v w := rfl variable (g : RiemannianMetric I n M) (x : M) From e10d58469bff4058507df2edd38055d8404bd6ae Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Sat, 3 May 2025 12:05:22 +0200 Subject: [PATCH 23/32] Update Defs.lean --- PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean index 9c25ed298..4f0c2266e 100644 --- a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean @@ -96,7 +96,7 @@ variable (g : RiemannianMetric I n M) (x : M) lemma inner_symm (v w : TangentSpace I x) : g.inner x v w = g.inner x w v := by simp only [inner_apply] - exact g.toPseudoRiemannianMetric.symm' x v w + exact g.toPseudoRiemannianMetric.symm x v w /-- The inner product space core for the tangent space at a point, derived from the Riemannian metric. -/ From a86be209efc7a2f93f8f01b44f9a5bbaadf19cfd Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Sat, 3 May 2025 14:11:18 +0200 Subject: [PATCH 24/32] Update Defs.lean --- .../Metric/PseudoRiemannian/Defs.lean | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean index d72f6cb6b..f2aa56d16 100644 --- a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean @@ -62,16 +62,6 @@ noncomputable def negDim {E : Type*} [AddCommGroup E] let w := Classical.choose h_exists exact Finset.card (Finset.filter (fun i => w i = SignType.neg) Finset.univ) -/-- The i-th standard basis vector has a 1 in the i-th position. -/ -lemma Pi.basisFun_apply_same {๐•œ ฮน : Type*} [Field ๐•œ] [Fintype ฮน] [DecidableEq ฮน] (i : ฮน) : - (Pi.basisFun ๐•œ ฮน) i i = 1 := by - simp only [Pi.basisFun_apply, Pi.single_eq_same] - -/-- The i-th standard basis vector has 0 in all positions j โ‰  i. -/ -lemma Pi.basisFun_apply_ne {๐•œ ฮน : Type*} [Field ๐•œ] [Fintype ฮน] [DecidableEq ฮน] (i j : ฮน) - (h : j โ‰  i) : (Pi.basisFun ๐•œ ฮน) i j = 0 := by - simp only [Pi.basisFun_apply, Pi.single_eq_of_ne h] - /-- For a standard basis vector in a weighted sum of squares, only one term in the sum is nonzero. -/ lemma QuadraticMap.weightedSumSquares_basis_vector {E : Type*} [AddCommGroup E] @@ -192,23 +182,23 @@ structure PseudoRiemannianMetric Type (max u v w) where /-- The metric tensor at each point `x : M`, represented as a continuous linear map `Tโ‚“M โ†’L[โ„] (Tโ‚“M โ†’L[โ„] โ„)`. Applying it twice, `(val x v) w`, yields `gโ‚“(v, w)`. -/ - protected val : โˆ€ (x : M), TangentSpace I x โ†’L[โ„] (TangentSpace I x โ†’L[โ„] โ„) + val : โˆ€ (x : M), TangentSpace I x โ†’L[โ„] (TangentSpace I x โ†’L[โ„] โ„) /-- The metric is symmetric: `gโ‚“(v, w) = gโ‚“(w, v)`. -/ - protected symm : โˆ€ (x : M) (v w : TangentSpace I x), (val x v) w = (val x w) v + symm : โˆ€ (x : M) (v w : TangentSpace I x), (val x v) w = (val x w) v /-- The metric is non-degenerate: if `gโ‚“(v, w) = 0` for all `w`, then `v = 0`. -/ - protected nondegenerate : โˆ€ (x : M) (v : TangentSpace I x), (โˆ€ w : TangentSpace I x, + nondegenerate : โˆ€ (x : M) (v : TangentSpace I x), (โˆ€ w : TangentSpace I x, (val x v) w = 0) โ†’ v = 0 /-- The metric varies smoothly: Expressed in local coordinates via any chart `e`, the function `y โ†ฆ g_{e.symm y}(mfderiv I I e.symm y v, mfderiv I I e.symm y w)` is `C^n` smooth on the chart's target `e.target` for any constant vectors `v, w` in the model space `E`. -/ - protected smooth_in_charts' : โˆ€ (xโ‚€ : M) (v w : E), + smooth_in_charts' : โˆ€ (xโ‚€ : M) (v w : E), let e := extChartAt I xโ‚€ ContDiffWithinAt โ„ n (fun y => val (e.symm y) (mfderiv I I e.symm y v) (mfderiv I I e.symm y w)) (e.target) (e xโ‚€) /-- The negative dimension (`QuadraticForm.negDim`) of the metric's quadratic form is locally constant. On a connected manifold, this implies it is constant globally. -/ - protected negDim_isLocallyConstant : + negDim_isLocallyConstant : IsLocallyConstant (fun x : M => have : FiniteDimensional โ„ (TangentSpace I x) := inferInstance (pseudoRiemannianMetricValToQuadraticForm val symm x).negDim) From 3e03d643851f7189b428b9cab46f9fc402318c54 Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Sat, 3 May 2025 15:33:10 +0200 Subject: [PATCH 25/32] fix lints --- PhysLean.lean | 1 + .../Geometry/Metric/PseudoRiemannian/Defs.lean | 6 +++--- PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean | 8 +++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/PhysLean.lean b/PhysLean.lean index f362cfbf6..985001cdf 100644 --- a/PhysLean.lean +++ b/PhysLean.lean @@ -7,6 +7,7 @@ import PhysLean.ClassicalMechanics.Space.VectorIdentities import PhysLean.ClassicalMechanics.Time.Basic import PhysLean.ClassicalMechanics.VectorFields import PhysLean.CondensedMatter.Basic +import PhysLean.CondensedMatter.TightBindingChain.Basic import PhysLean.Cosmology.Basic import PhysLean.Cosmology.FLRW.Basic import PhysLean.Electromagnetism.Basic diff --git a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean index f2aa56d16..ddf5ec1cb 100644 --- a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean @@ -270,7 +270,7 @@ def flat (g : PseudoRiemannianMetric E H M n I) (x : M) : @[simp] lemma flat_apply (g : PseudoRiemannianMetric E H M n I) (x : M) (v w : TangentSpace I x) : - (flat g x v) w = g.val x v w := by rfl + (flat g x v) w = g.val x v w := by rfl /-- The musical isomorphism as a continuous linear map. -/ def flatL (g : PseudoRiemannianMetric E H M n I) (x : M) : @@ -282,7 +282,7 @@ def flatL (g : PseudoRiemannianMetric E H M n I) (x : M) : @[simp] lemma flatL_apply (g : PseudoRiemannianMetric E H M n I) (x : M) (v w : TangentSpace I x) : - (flatL g x v) w = g.val x v w := rfl + (flatL g x v) w = g.val x v w := rfl @[simp] lemma flat_inj (g : PseudoRiemannianMetric E H M n I) (x : M) : @@ -397,7 +397,7 @@ noncomputable def sharp @[simp] lemma sharpL_apply_flatL - (g : PseudoRiemannianMetric E H M n I) (x : M) (v : TangentSpace I x) : + (g : PseudoRiemannianMetric E H M n I) (x : M) (v : TangentSpace I x) : g.sharpL x (g.flatL x v) = v := (g.flatEquiv x).left_inv v diff --git a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean index 4f0c2266e..18e0abeec 100644 --- a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean @@ -3,9 +3,11 @@ Copyright (c) 2025 Matteo Cipollina. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Matteo Cipollina -/ + import Mathlib.Algebra.Lie.OfAssociative import Mathlib.MeasureTheory.Integral.IntervalIntegral import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Defs + /-! # Riemannian Metric Definitions @@ -79,8 +81,8 @@ lemma toQuadraticForm_apply (g : RiemannianMetric I n M) (x : M) lemma riemannian_metric_negDim_zero (g : RiemannianMetric I n M) (x : M) : (g.toQuadraticForm x).negDim = 0 := by - apply QuadraticForm.rankNeg_eq_zero - exact g.toQuadraticForm_posDef x + apply QuadraticForm.rankNeg_eq_zero + exact g.toQuadraticForm_posDef x /-- The inner product on the tangent space at point `x` induced by the Riemannian metric `g`. -/ def inner (g : RiemannianMetric I n M) (x : M) (v w : TangentSpace I x) : โ„ := @@ -88,7 +90,7 @@ def inner (g : RiemannianMetric I n M) (x : M) (v w : TangentSpace I x) : โ„ := @[simp] lemma inner_apply (g : RiemannianMetric I n M) (x : M) (v w : TangentSpace I x) : - inner g x v w = g.toPseudoRiemannianMetric.val x v w := rfl + inner g x v w = g.toPseudoRiemannianMetric.val x v w := rfl variable (g : RiemannianMetric I n M) (x : M) From 21f522bea68644a7c500ffb3aeb9104792d9de7d Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Fri, 9 May 2025 19:22:31 +0200 Subject: [PATCH 26/32] Added Chart + modules --- PhysLean.lean | 8 + PhysLean/Mathematics/Analysis/ContDiff.lean | 230 ++++++++++++++++++ .../Manifold/Chart/BilinearSmoothness.lean | 135 ++++++++++ .../Chart/CoordinateTransformations.lean | 160 ++++++++++++ .../Geometry/Manifold/Chart/Smoothness.lean | 135 ++++++++++ .../Geometry/Manifold/Chart/Utilities.lean | 59 +++++ .../Geometry/Manifold/PartialHomeomorph.lean | 209 ++++++++++++++++ .../Metric/PseudoRiemannian/Chart.lean | 142 +++++++++++ .../Metric/PseudoRiemannian/Defs.lean | 8 +- .../LinearAlgebra/BilinearForm.lean | 185 ++++++++++++++ 10 files changed, 1268 insertions(+), 3 deletions(-) create mode 100644 PhysLean/Mathematics/Analysis/ContDiff.lean create mode 100644 PhysLean/Mathematics/Geometry/Manifold/Chart/BilinearSmoothness.lean create mode 100644 PhysLean/Mathematics/Geometry/Manifold/Chart/CoordinateTransformations.lean create mode 100644 PhysLean/Mathematics/Geometry/Manifold/Chart/Smoothness.lean create mode 100644 PhysLean/Mathematics/Geometry/Manifold/Chart/Utilities.lean create mode 100644 PhysLean/Mathematics/Geometry/Manifold/PartialHomeomorph.lean create mode 100644 PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Chart.lean create mode 100644 PhysLean/Mathematics/LinearAlgebra/BilinearForm.lean diff --git a/PhysLean.lean b/PhysLean.lean index 985001cdf..1c4010a65 100644 --- a/PhysLean.lean +++ b/PhysLean.lean @@ -16,10 +16,18 @@ import PhysLean.Electromagnetism.FieldStrength.Derivative import PhysLean.Electromagnetism.Homogeneous import PhysLean.Electromagnetism.LorentzAction import PhysLean.Electromagnetism.MaxwellEquations +import PhysLean.Mathematics.Analysis.ContDiff import PhysLean.Mathematics.FDerivCurry import PhysLean.Mathematics.Fin import PhysLean.Mathematics.Fin.Involutions +import PhysLean.Mathematics.LinearAlgebra.BilinearForm +import PhysLean.Mathematics.Geometry.Manifold.PartialHomeomorph +import PhysLean.Mathematics.Geometry.Manifold.Chart.Utilities +import PhysLean.Mathematics.Geometry.Manifold.Chart.BilinearSmoothness +import PhysLean.Mathematics.Geometry.Manifold.Chart.Smoothness +import PhysLean.Mathematics.Geometry.Manifold.Chart.CoordinateTransformations import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Defs +import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Chart import PhysLean.Mathematics.Geometry.Metric.Riemannian.Defs import PhysLean.Mathematics.LinearMaps import PhysLean.Mathematics.List diff --git a/PhysLean/Mathematics/Analysis/ContDiff.lean b/PhysLean/Mathematics/Analysis/ContDiff.lean new file mode 100644 index 000000000..f4438c13f --- /dev/null +++ b/PhysLean/Mathematics/Analysis/ContDiff.lean @@ -0,0 +1,230 @@ +/- +Copyright (c) 2025 Matteo Cipollina. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Matteo Cipollina +-/ + +import Mathlib.Analysis.Calculus.ContDiff.Operations +import Mathlib.LinearAlgebra.Dual.Lemmas +import Mathlib.LinearAlgebra.FreeModule.PID +import Mathlib.RingTheory.Henselian +import PhysLean.Mathematics.LinearAlgebra.BilinearForm + +/-! +# Smoothness (ContDiff) Utilities + +This file provides utility lemmas and constructions for working with smooth +functions (`ContDiff`) and continuity in the context of normed and finite-dimensional +vector spaces over a nontrivially normed field. + +-/ + +namespace ContDiff + +variable {๐•œ X V : Type*} [NontriviallyNormedField ๐•œ] +variable [NormedAddCommGroup X] [NormedSpace ๐•œ X] +variable [NormedAddCommGroup V] [NormedSpace ๐•œ V] +variable {f : X โ†’ V} {s : Set X} {xโ‚€ : X} {n : WithTop โ„•โˆž} + +-- First direction: if f is C^n, then ฯ† โˆ˜ f is C^n for any continuous linear functional ฯ† +lemma comp_continuous_linear_apply_right + (hf : ContDiffWithinAt ๐•œ n f s xโ‚€) (ฯ† : V โ†’L[๐•œ] ๐•œ) : + ContDiffWithinAt ๐•œ n (ฯ† โˆ˜ f) s xโ‚€ := + ContDiffWithinAt.comp xโ‚€ ฯ†.contDiff.contDiffWithinAt hf (Set.mapsTo_univ _ _) + +-- Second direction: in finite dimensions, if all projections are C^n, then f is C^n +lemma of_forall_coord [FiniteDimensional ๐•œ V] [CompleteSpace ๐•œ] + (h : โˆ€ ฯ† : V โ†’L[๐•œ] ๐•œ, ContDiffWithinAt ๐•œ n (ฯ† โˆ˜ f) s xโ‚€) : + ContDiffWithinAt ๐•œ n f s xโ‚€ := by + let b := Module.finBasis ๐•œ V + let equiv := b.equivFunL + suffices ContDiffWithinAt ๐•œ n (equiv โˆ˜ f) s xโ‚€ by + have hequiv_symm_smooth : ContDiff ๐•œ โŠค equiv.symm := ContinuousLinearEquiv.contDiff equiv.symm + have hequiv_symm_smooth_n : ContDiff ๐•œ n equiv.symm := + ContDiff.of_le hequiv_symm_smooth (le_top : n โ‰ค โŠค) + have h_eq : f = equiv.symm โˆ˜ (equiv โˆ˜ f) := by + ext x; simp only [Function.comp_apply, ContinuousLinearEquiv.symm_apply_apply]; + rw [h_eq] + apply ContDiffWithinAt.comp xโ‚€ hequiv_symm_smooth_n.contDiffWithinAt this (Set.mapsTo_univ _ _) + apply contDiffWithinAt_pi.mpr + intro i + let coord_i : V โ†’L[๐•œ] ๐•œ := LinearMap.toContinuousLinearMap (b.coord i) + exact h coord_i + +-- Full bidirectional lemma +lemma iff_forall_coord [FiniteDimensional ๐•œ V] [CompleteSpace ๐•œ] : + ContDiffWithinAt ๐•œ n f s xโ‚€ โ†” + โˆ€ ฯ† : V โ†’L[๐•œ] ๐•œ, ContDiffWithinAt ๐•œ n (ฯ† โˆ˜ f) s xโ‚€ := by + constructor + ยท exact comp_continuous_linear_apply_right + ยท exact of_forall_coord + +end ContDiff + +section ContinuityBounds + +variable {๐•œ E F FHom : Type*} [NormedField ๐•œ] + +@[simp] +lemma AddMonoidHomClass.coe_fn_to_addMonoidHom + [FunLike FHom E F] [AddZeroClass E] [AddZeroClass F] + [AddMonoidHomClass FHom E F] (ฯ† : FHom) : + โ‡‘(AddMonoidHomClass.toAddMonoidHom ฯ†) = โ‡‘ฯ† := by + rfl + +variable [NormedAddCommGroup E] [NormedSpace ๐•œ E] +variable [NormedAddCommGroup F] [NormedSpace ๐•œ F] + +/-- A bounded additive map is continuous at zero. -/ +lemma AddMonoidHom.continuousAt_zero_of_bound + (ฯ† : AddMonoidHom E F) {C : โ„} (h : โˆ€ x, โ€–ฯ† xโ€– โ‰ค C * โ€–xโ€–) : + ContinuousAt ฯ† 0 := by + rw [Metric.continuousAt_iff] + intro ฮต ฮตpos + simp only [map_zero ฯ†, dist_zero_right] + by_cases hE : Subsingleton E + ยท use 1 + refine โŸจzero_lt_one, fun y _hy_norm_lt_one => ?_โŸฉ + rw [@Subsingleton.elim E hE y 0, map_zero ฯ†, norm_zero] + exact ฮตpos + ยท have C_nonneg : 0 โ‰ค C := by + obtain โŸจx_ne, y_ne, h_x_ne_yโŸฉ : โˆƒ x y : E, x โ‰  y := by + contrapose! hE; exact { allEq := hE } + let z := x_ne - y_ne + have hz_ne_zero : z โ‰  0 := sub_ne_zero_of_ne h_x_ne_y + have hz_norm_pos : 0 < โ€–zโ€– := norm_pos_iff.mpr hz_ne_zero + by_contra hC_is_neg + push_neg at hC_is_neg + have h_phi_z_bound := h z + have H1 : 0 โ‰ค C * โ€–zโ€– := le_trans (norm_nonneg (ฯ† z)) h_phi_z_bound + have H2 : C * โ€–zโ€– < 0 := mul_neg_of_neg_of_pos hC_is_neg hz_norm_pos + linarith [H1, H2] + by_cases hC_eq_zero : C = 0 + ยท have phi_is_zero : ฯ† = 0 := by + ext x_val + have h_phi_x_val_bound := h x_val + rw [hC_eq_zero, zero_mul] at h_phi_x_val_bound + exact norm_le_zero_iff.mp h_phi_x_val_bound + use 1 + refine โŸจzero_lt_one, fun y _hy_norm_lt_one => ?_โŸฉ + rw [phi_is_zero, AddMonoidHom.zero_apply, norm_zero] + exact ฮตpos + ยท have C_pos : 0 < C := lt_of_le_of_ne C_nonneg fun a => hC_eq_zero (_root_.id (Eq.symm a)) + use ฮต / C + refine โŸจdiv_pos ฮตpos C_pos, fun y hy_norm_lt_delta => ?_โŸฉ + calc + โ€–ฯ† yโ€– โ‰ค C * โ€–yโ€– := h y + _ < C * (ฮต / C) := mul_lt_mul_of_pos_left hy_norm_lt_delta C_pos + _ = ฮต := by rw [mul_div_cancelโ‚€ ฮต hC_eq_zero] + +omit [NormedSpace ๐•œ F] in +/-- A semi-linear map that is linearly bounded by the norm of its input is continuous. -/ +lemma SemilinearMapClass.continuous_of_bound {๐•œโ‚‚ : Type*} [NormedField ๐•œโ‚‚] [NormedSpace ๐•œโ‚‚ F] + [FunLike FHom E F] {ฯƒ : ๐•œ โ†’+* ๐•œโ‚‚} [SemilinearMapClass FHom ฯƒ E F] + {ฯ† : FHom} {C : โ„} (h : โˆ€ x, โ€–ฯ† xโ€– โ‰ค C * โ€–xโ€–) : Continuous ฯ† := by + haveI : AddMonoidHomClass FHom E F := inferInstance + let ฯ†_add_hom : AddMonoidHom E F := AddMonoidHomClass.toAddMonoidHom ฯ† + exact continuous_of_continuousAt_zero ฯ†_add_hom + (AddMonoidHom.continuousAt_zero_of_bound ฯ†_add_hom h) + +/-- A function that is linearly bounded by the norm of its input is continuous. -/ +lemma AddMonoidHomClass.continuous_of_bound' [FunLike FHom E F] [AddMonoidHomClass FHom E F] + {ฯ† : FHom} {C : โ„} (h : โˆ€ x, โ€–ฯ† xโ€– โ‰ค C * โ€–xโ€–) : Continuous ฯ† := by + let ฯ†_add_hom : AddMonoidHom E F := AddMonoidHomClass.toAddMonoidHom ฯ† + exact continuous_of_continuousAt_zero ฯ†_add_hom + (AddMonoidHom.continuousAt_zero_of_bound ฯ†_add_hom h) + +end ContinuityBounds + +namespace ContinuousLinearMap + +variable {Xโ‚ Eโ‚ Fโ‚ Gโ‚ Eโ‚' Fโ‚' : Type*} [NontriviallyNormedField ๐•œโ‚] + [NormedAddCommGroup Xโ‚] [NormedSpace ๐•œโ‚ Xโ‚] + [NormedAddCommGroup Eโ‚] [NormedSpace ๐•œโ‚ Eโ‚] + [NormedAddCommGroup Fโ‚] [NormedSpace ๐•œโ‚ Fโ‚] + [NormedAddCommGroup Gโ‚] [NormedSpace ๐•œโ‚ Gโ‚] + [NormedAddCommGroup Eโ‚'] [NormedSpace ๐•œโ‚ Eโ‚'] + [NormedAddCommGroup Fโ‚'] [NormedSpace ๐•œโ‚ Fโ‚'] + {nโ‚ : WithTop โ„•โˆž} + +/-- The `ContinuousLinearMap.bilinearComp` operation is smooth. + Given smooth functions `f : Xโ‚ โ†’ (Eโ‚ โ†’L[๐•œโ‚] Fโ‚ โ†’L[๐•œโ‚] Gโ‚)`, `g : Xโ‚ โ†’ (Eโ‚' โ†’L[๐•œโ‚] Eโ‚)`, + and `h : Xโ‚ โ†’ (Fโ‚' โ†’L[๐•œโ‚] Fโ‚)`, the composition `x โ†ฆ (f x).bilinearComp (g x) (h x)` + is smooth. -/ +lemma contDiff_bilinearComp + {f : Xโ‚ โ†’ Eโ‚ โ†’L[๐•œโ‚] Fโ‚ โ†’L[๐•œโ‚] Gโ‚} {g : Xโ‚ โ†’ Eโ‚' โ†’L[๐•œโ‚] Eโ‚} {h : Xโ‚ โ†’ Fโ‚' โ†’L[๐•œโ‚] Fโ‚} + (hf : ContDiff ๐•œโ‚ nโ‚ f) (hg : ContDiff ๐•œโ‚ nโ‚ g) (hh : ContDiff ๐•œโ‚ nโ‚ h) : + ContDiff ๐•œโ‚ nโ‚ fun x => (f x).bilinearComp (g x) (h x) := by + have h1 : ContDiff ๐•œโ‚ nโ‚ (fun x โ†ฆ (f x).comp (g x)) := ContDiff.clm_comp hf hg + let L_flip1 := ContinuousLinearMap.flipโ‚—แตข ๐•œโ‚ Eโ‚' Fโ‚ Gโ‚ + have eq_flip : โˆ€ x, L_flip1 ((f x).comp (g x)) = ((f x).comp (g x)).flip := by + intro x + rfl + have h2 : ContDiff ๐•œโ‚ nโ‚ (fun x => ((f x).comp (g x)).flip) := by + have hLโ‚ : ContDiff ๐•œโ‚ nโ‚ L_flip1 := + (ContinuousLinearMap.contDiff (๐•œ := ๐•œโ‚) (E := Eโ‚' โ†’L[๐•œโ‚] Fโ‚ โ†’L[๐•œโ‚] Gโ‚) + (F := Fโ‚ โ†’L[๐•œโ‚] Eโ‚' โ†’L[๐•œโ‚] Gโ‚) L_flip1).of_le le_top + have h2' : ContDiff ๐•œโ‚ nโ‚ (fun x => L_flip1 ((f x).comp (g x))) := + ContDiff.comp hLโ‚ h1 + exact (funext eq_flip).symm โ–ธ h2' + have h3 : ContDiff ๐•œโ‚ nโ‚ (fun x => (((f x).comp (g x)).flip).comp (h x)) := + ContDiff.clm_comp h2 hh + let L_flip2 := ContinuousLinearMap.flipโ‚—แตข ๐•œโ‚ Fโ‚' Eโ‚' Gโ‚ + have eq_flip2 : โˆ€ x, L_flip2 ((((f x).comp (g x)).flip).comp (h x)) = + ((((f x).comp (g x)).flip).comp (h x)).flip := by + intro x + rfl + have h4 : ContDiff ๐•œโ‚ nโ‚ (fun x => ((((f x).comp (g x)).flip).comp (h x)).flip) := by + have hLโ‚‚ : ContDiff ๐•œโ‚ nโ‚ L_flip2 := + (ContinuousLinearMap.contDiff (๐•œ := ๐•œโ‚) (E := Fโ‚' โ†’L[๐•œโ‚] Eโ‚' โ†’L[๐•œโ‚] Gโ‚) + (F := Eโ‚' โ†’L[๐•œโ‚] Fโ‚' โ†’L[๐•œโ‚] Gโ‚) L_flip2).of_le le_top + have h4' := ContDiff.comp hLโ‚‚ h3 + exact (funext eq_flip2).symm โ–ธ h4' + exact h4 + +variable {Xโ‚ Eโ‚ Fโ‚ Gโ‚ Eโ‚' Fโ‚' : Type*} [NontriviallyNormedField ๐•œโ‚] + [NormedAddCommGroup Xโ‚] [NormedSpace ๐•œโ‚ Xโ‚] + [NormedAddCommGroup Eโ‚] [NormedSpace ๐•œโ‚ Eโ‚] [FiniteDimensional ๐•œโ‚ Eโ‚] + [NormedAddCommGroup Fโ‚] [NormedSpace ๐•œโ‚ Fโ‚] [FiniteDimensional ๐•œโ‚ Fโ‚] + [NormedAddCommGroup Gโ‚] [NormedSpace ๐•œโ‚ Gโ‚] [FiniteDimensional ๐•œโ‚ Gโ‚] + [NormedAddCommGroup Eโ‚'] [NormedSpace ๐•œโ‚ Eโ‚'] [FiniteDimensional ๐•œโ‚ Eโ‚'] + [NormedAddCommGroup Fโ‚'] [NormedSpace ๐•œโ‚ Fโ‚'] [FiniteDimensional ๐•œโ‚ Fโ‚'] + {nโ‚ : WithTop โ„•โˆž} + +/-- The "flip" operation on continuous bilinear maps is smooth. -/ +lemma flip_contDiff {Fโ‚ Fโ‚‚ R : Type*} + [NormedAddCommGroup Fโ‚] [NormedSpace โ„ Fโ‚] + [NormedAddCommGroup Fโ‚‚] [NormedSpace โ„ Fโ‚‚] + [NormedAddCommGroup R] [NormedSpace โ„ R] : + ContDiff โ„ โŠค (fun f : Fโ‚ โ†’L[โ„] Fโ‚‚ โ†’L[โ„] R => ContinuousLinearMap.flip f) := by + let flip_clm := + (ContinuousLinearMap.flipโ‚—แตข โ„ Fโ‚ Fโ‚‚ R).toContinuousLinearEquiv.toContinuousLinearMap + exact + @ContinuousLinearMap.contDiff โ„ _ + (Fโ‚ โ†’L[โ„] Fโ‚‚ โ†’L[โ„] R) _ _ (Fโ‚‚ โ†’L[โ„] Fโ‚ โ†’L[โ„] R) _ _ _ flip_clm + +/-- Composition of a bilinear map with a linear map in the first argument is smooth. -/ +lemma comp_first_contDiff {Fโ‚ Fโ‚‚ Fโ‚ƒ R : Type*} + [NormedAddCommGroup Fโ‚] [NormedSpace โ„ Fโ‚] + [NormedAddCommGroup Fโ‚‚] [NormedSpace โ„ Fโ‚‚] + [NormedAddCommGroup Fโ‚ƒ] [NormedSpace โ„ Fโ‚ƒ] + [NormedAddCommGroup R] [NormedSpace โ„ R] : + ContDiff โ„ โŠค (fun p : (Fโ‚‚ โ†’L[โ„] Fโ‚ƒ โ†’L[โ„] R) ร— (Fโ‚ โ†’L[โ„] Fโ‚‚) => + ContinuousLinearMap.comp p.1 p.2) := by + exact ContDiff.clm_comp contDiff_fst contDiff_snd + +variable {Eโ‚_โ‚‚ : Type*} {Eโ‚‚_โ‚‚ : Type*} {Rโ‚‚ : Type*} +variable [NormedAddCommGroup Eโ‚_โ‚‚] [NormedSpace โ„ Eโ‚_โ‚‚] +variable [NormedAddCommGroup Eโ‚‚_โ‚‚] [NormedSpace โ„ Eโ‚‚_โ‚‚] +variable [NormedAddCommGroup Rโ‚‚] [NormedSpace โ„ Rโ‚‚] + +/-- The pullback of a bilinear map by a linear map is smooth with respect to both arguments. -/ +theorem contDiff_pullbackBilinear_op : + ContDiff โ„ โŠค (fun p : (Eโ‚‚_โ‚‚ โ†’L[โ„] Eโ‚‚_โ‚‚ โ†’L[โ„] Rโ‚‚) ร— (Eโ‚_โ‚‚ โ†’L[โ„] Eโ‚‚_โ‚‚) => + BilinearForm.pullback p.1 p.2) := by + apply contDiff_bilinearComp + ยท exact (contDiff_fst (E := (Eโ‚‚_โ‚‚ โ†’L[โ„] Eโ‚‚_โ‚‚ โ†’L[โ„] Rโ‚‚)) (F := (Eโ‚_โ‚‚ โ†’L[โ„] Eโ‚‚_โ‚‚))).of_le le_top + ยท exact (contDiff_snd (E := (Eโ‚‚_โ‚‚ โ†’L[โ„] Eโ‚‚_โ‚‚ โ†’L[โ„] Rโ‚‚)) (F := (Eโ‚_โ‚‚ โ†’L[โ„] Eโ‚‚_โ‚‚))).of_le le_top + ยท exact (contDiff_snd (E := (Eโ‚‚_โ‚‚ โ†’L[โ„] Eโ‚‚_โ‚‚ โ†’L[โ„] Rโ‚‚)) (F := (Eโ‚_โ‚‚ โ†’L[โ„] Eโ‚‚_โ‚‚))).of_le le_top + +end ContinuousLinearMap diff --git a/PhysLean/Mathematics/Geometry/Manifold/Chart/BilinearSmoothness.lean b/PhysLean/Mathematics/Geometry/Manifold/Chart/BilinearSmoothness.lean new file mode 100644 index 000000000..8d928ce16 --- /dev/null +++ b/PhysLean/Mathematics/Geometry/Manifold/Chart/BilinearSmoothness.lean @@ -0,0 +1,135 @@ +/- +Copyright (c) 2025 Matteo Cipollina. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Matteo Cipollina +-/ + +import Mathlib.Algebra.Lie.OfAssociative +import Mathlib.Analysis.RCLike.Lemmas +import Mathlib.Geometry.Manifold.IsManifold.Basic +import PhysLean.Mathematics.Analysis.ContDiff + +/-! +# Smoothness of Bilinear Forms in Chart Coordinates + +This file contains lemmas about the smoothness of bilinear forms in chart coordinates. +-/ +noncomputable section +open BilinearForm +open Filter + +variable {E : Type v} {M : Type v} {n : WithTop โ„•โˆž} +variable [NormedAddCommGroup E] [NormedSpace โ„ E] +variable [TopologicalSpace M] [ChartedSpace E M] [T2Space M] +variable {I : ModelWithCorners โ„ E E} [ModelWithCorners.Boundaryless I] +variable [inst_mani_smooth : IsManifold I (n + 1) M] -- For C^{n+1} manifold for C^n metric +variable [inst_tangent_findim : โˆ€ (x : M), FiniteDimensional โ„ (TangentSpace I x)] + +noncomputable instance (x : M) : NormedAddCommGroup (TangentSpace I x) := + show NormedAddCommGroup E from inferInstance + +noncomputable instance (x : M) : NormedSpace โ„ (TangentSpace I x) := + show NormedSpace โ„ E from inferInstance +namespace Manifold.ChartSmoothness + +open BilinearForm ContDiff ContinuousLinearMap + +variable {X : Type*} [NormedAddCommGroup X] [NormedSpace โ„ X] +variable {f_bilin : X โ†’ E โ†’L[โ„] E โ†’L[โ„] โ„} {s_set : Set X} {xโ‚€_pt : X} +-- n is from the outer scope (smoothness of the metric) + +lemma contDiffWithinAt_eval_bilinear_apply (hf : ContDiffWithinAt โ„ n f_bilin s_set xโ‚€_pt) + (v w : E) : + ContDiffWithinAt โ„ n (fun x => f_bilin x v w) s_set xโ‚€_pt := by + let eval_vw : (E โ†’L[โ„] E โ†’L[โ„] โ„) โ†’L[โ„] โ„ := BilinearForm.eval_vectors_continuousLinear v w + exact (eval_vw.contDiff.of_le le_top).contDiffWithinAt.comp xโ‚€_pt hf (Set.mapsTo_univ _ _) + +variable[FiniteDimensional โ„ E] + +lemma contDiffWithinAt_bilinear_apply_iff_forall_coord : + (โˆ€ v w, ContDiffWithinAt โ„ n (fun x => f_bilin x v w) s_set xโ‚€_pt) โ†’ + ContDiffWithinAt โ„ n f_bilin s_set xโ‚€_pt := by + intro h_comp + rw [ContDiff.iff_forall_coord (V := E โ†’L[โ„] E โ†’L[โ„] โ„) (๐•œ := โ„)] + intro ฯ† + let b := Module.finBasis โ„ E + obtain โŸจe_forms, h_e_forms_defโŸฉ := BilinearForm.elementary_bilinear_forms_def b + have h_f_decomp : โˆ€ (x : X), f_bilin x = + โˆ‘ i โˆˆ Finset.univ, โˆ‘ j โˆˆ Finset.univ, ((f_bilin x) (b i) (b j)) โ€ข e_forms i j := by + intro x + obtain โŸจe, h_e_prop, h_decompโŸฉ := BilinearForm.decomposition b (f_bilin x) + have e_eq_e_forms : e = e_forms := by + ext i j v w + rw [h_e_prop i j v w, h_e_forms_def i j v w] + rw [e_eq_e_forms] at h_decomp + exact h_decomp + have h_phi_f : โˆ€ x, ฯ† (f_bilin x) = + โˆ‘ i โˆˆ Finset.univ, โˆ‘ j โˆˆ Finset.univ, ((f_bilin x) (b i) (b j)) * ฯ† (e_forms i j) := by + intro x + rw [h_f_decomp x] + have h_expand : ฯ† (โˆ‘ i โˆˆ Finset.univ, + โˆ‘ j โˆˆ Finset.univ, ((f_bilin x) (b i) (b j)) โ€ข e_forms i j) = + โˆ‘ i โˆˆ Finset.univ, ฯ† (โˆ‘ j โˆˆ Finset.univ, ((f_bilin x) (b i) (b j)) โ€ข e_forms i j) := + ContinuousLinearMap.map_finset_sum ฯ† Finset.univ (fun i => โˆ‘ j โˆˆ Finset.univ, + ((f_bilin x) (b i) (b j)) โ€ข e_forms i j) + rw [h_expand] + apply Finset.sum_congr rfl + intro i _ + have h_expand_inner : ฯ† (โˆ‘ j โˆˆ Finset.univ, ((f_bilin x) (b i) (b j)) โ€ข e_forms i j) = + โˆ‘ j โˆˆ Finset.univ, ฯ† (((f_bilin x) (b i) (b j)) โ€ข e_forms i j) := + ContinuousLinearMap.map_finset_sum ฯ† Finset.univ (fun j => + ((f_bilin x) (b i) (b j)) โ€ข e_forms i j) + rw [h_expand_inner] + apply Finset.sum_congr rfl + intro j _ + rw [ContinuousLinearMap.map_smul] + rw [smul_eq_mul] + rw [โ† h_f_decomp] + have h_goal : ContDiffWithinAt โ„ n (fun x => ฯ† (f_bilin x)) s_set xโ‚€_pt := by + simp only [h_phi_f] + apply ContDiffWithinAt.sum + intro i _ + apply ContDiffWithinAt.sum + intro j _ + have h_term_smooth : ContDiffWithinAt โ„ n (fun x => f_bilin x (b i) (b j)) s_set xโ‚€_pt := + h_comp (b i) (b j) + have h_const : ContDiffWithinAt โ„ n (fun x => ฯ† (e_forms i j)) s_set xโ‚€_pt := + contDiffWithinAt_const + exact ContDiffWithinAt.mul h_term_smooth h_const + exact h_goal + +/-- +A bilinear form `f_bilin : X โ†’ E โ†’ E โ†’ F` is continuously differentiable of order `n_level` +at a point `xโ‚€_pt` within a set `s_set` if and only if for all vectors `v w : E`, the function +`x โ†ฆ f_bilin x v w` is continuously differentiable of order `n_level` at `xโ‚€_pt` within `s_set`. + +This provides an equivalence between the continuous differentiability of a bilinear map +and the continuous differentiability of all its partial evaluations. +-/ +theorem contDiffWithinAt_bilinear_iff {n_level : WithTop โ„•โˆž} : + (โˆ€ (v w : E), ContDiffWithinAt โ„ n_level (fun x => f_bilin x v w) s_set xโ‚€_pt) โ†” + (ContDiffWithinAt โ„ n_level f_bilin s_set xโ‚€_pt) := by + constructor + ยท intro h; exact contDiffWithinAt_bilinear_apply_iff_forall_coord h + ยท intro h; exact contDiffWithinAt_eval_bilinear_apply h + +/-- +A bilinear form `f_bilin : X โ†’ E โ†’ E โ†’ F` is continuously differentiable of order `n_level` +on a set `s` if and only if for all vectors `v w : E`, the function `x โ†ฆ f_bilin x v w` +is continuously differentiable of order `n_level` on `s`. + +This extends `contDiffWithinAt_bilinear_iff` from a single point to an entire set. +-/ +theorem contDiffOn_bilinear_iff {n_level : WithTop โ„•โˆž} (s : Set X) : + (โˆ€ (v w : E), ContDiffOn โ„ n_level (fun x => f_bilin x v w) s) โ†” + (ContDiffOn โ„ n_level f_bilin s) := by + simp only [ContDiffOn, contDiffWithinAt_bilinear_iff (n_level := n_level)] + constructor + ยท intro h x hx + apply contDiffWithinAt_bilinear_apply_iff_forall_coord + intro v w + exact h v w x hx + ยท intro h v w x hx + exact contDiffWithinAt_eval_bilinear_apply (h x hx) v w + +end Manifold.ChartSmoothness diff --git a/PhysLean/Mathematics/Geometry/Manifold/Chart/CoordinateTransformations.lean b/PhysLean/Mathematics/Geometry/Manifold/Chart/CoordinateTransformations.lean new file mode 100644 index 000000000..1aadd2ae5 --- /dev/null +++ b/PhysLean/Mathematics/Geometry/Manifold/Chart/CoordinateTransformations.lean @@ -0,0 +1,160 @@ +/- +Copyright (c) 2025 Matteo Cipollina. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Matteo Cipollina +-/ + +import PhysLean.Mathematics.Geometry.Manifold.Chart.Smoothness +import PhysLean.Mathematics.Geometry.Manifold.Chart.Utilities +import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Defs + +/-! +# Coordinate Transformations and Transition Maps + +This file contains lemmas about coordinate transformations and transition maps between charts. +-/ + +namespace Manifold.Chart +open ContDiff ContinuousLinearMap +open PartialHomeomorph +open Filter Manifold + +variable {E : Type v} {M : Type v} {n : WithTop โ„•โˆž} +variable [NormedAddCommGroup E] +variable [TopologicalSpace M] + +/-- The domain where the chart transition map `ฯ† = e' โˆ˜ e.symm` is well-defined forms +a neighborhood of `y`. -/ +lemma chartMetric_transition_domain_in_nhds (e e' : PartialHomeomorph M E) (y : E) + (hy_target : y โˆˆ e.target) (hz_source' : e.symm y โˆˆ e'.source) : + let _ := e' โˆ˜ e.symm + y โˆˆ e.target โˆฉ e.symm โปยน' e'.source := by + intro ฯ† + simp only [Set.mem_inter_iff, Set.mem_preimage] + exact โŸจhy_target, hz_source'โŸฉ + +/-- When applying the transition map `ฯ† = e' โˆ˜ e.symm` to a point `z` in the domain, +the result is in `e'.target`. -/ +lemma chartMetric_transition_map_target (e e' : PartialHomeomorph M E) {z : E} + (hz_source' : e.symm z โˆˆ e'.source) : + let ฯ† := e' โˆ˜ e.symm + ฯ† z โˆˆ e'.target := by + intro ฯ† + exact e'.mapsTo hz_source' + +variable [NormedSpace โ„ E] +variable [ChartedSpace E M] +variable {I : ModelWithCorners โ„ E E} +variable [inst_mani_smooth : IsManifold I (n + 1) M] -- For C^{n+1} manifold for C^n metric +variable [inst_tangent_findim : โˆ€ (x : M), FiniteDimensional โ„ (TangentSpace I x)] +variable {X : Type*} [NormedAddCommGroup X] [NormedSpace โ„ X] +variable {f_bilin : X โ†’ E โ†’L[โ„] E โ†’L[โ„] โ„} {s_set : Set X} {xโ‚€_pt : X} + +/-- Core derivative chain rule for manifold derivatives that combines correctly with the metric. -/ +theorem manifold_derivative_chain_rule (g : PseudoRiemannianMetric E E M n I) + (e e' : PartialHomeomorph M E) {z : E} + (hz_target : z โˆˆ e.target) (hz_source' : e.symm z โˆˆ e'.source) + (he : e โˆˆ (contDiffGroupoid n I).maximalAtlas M) + (he' : e' โˆˆ (contDiffGroupoid n I).maximalAtlas M) + (hn1 : 1 โ‰ค n) : + let ฯ† := e' โˆ˜ e.symm + let ฯˆ := e.symm.trans e' + let x_z := e.symm z + โˆ€ v w : E, + g.val x_z (mfderiv I I e.symm z v) (mfderiv I I e.symm z w) = + g.val x_z (mfderiv I I e'.symm (ฯ† z) ((mfderiv I I ฯˆ z) v)) + (mfderiv I I e'.symm (ฯ† z) ((mfderiv I I ฯˆ z) w)) := by + intro ฯ† ฯˆ x_z v w + have hmani : IsManifold I n M := by + letI := inst_mani_smooth + have h_le : n โ‰ค n + 1 := by simp [self_le_add_right] + exact IsManifold.of_le h_le + have h_chain_rule_v : mfderiv I I e'.symm (ฯ† z) ((mfderiv I I ฯˆ z) v) = + mfderiv I I e.symm z v := by + let x := e.symm z + have h_z_eq : z = e x := Eq.symm (PartialHomeomorph.right_inv e hz_target) + have hx_e : x โˆˆ e.source := e.map_target hz_target + have h_fun_eq : e.symm =แถ [nhds z] e'.symm โˆ˜ ฯ† := by + have h_z_eq_ex : z = e x := by + exact h_z_eq + have h_lemma : e.symm =แถ [nhds (e x)] e'.symm โˆ˜ โ†‘(e.symm.trans e') := + chart_inverse_composition e e' x hx_e hz_source' + have h_ฯ†_eq : ฯ† = โ†‘(e.symm.trans e') := by + ext y + simp [ฯ†, trans_apply, Function.comp_apply] + rw [โ† h_z_eq_ex, โ† h_ฯ†_eq] at h_lemma + exact h_lemma + have h_deriv_eq : mfderiv I I e.symm z = mfderiv I I (e'.symm โˆ˜ ฯ†) z := + Filter.EventuallyEq.mfderiv_eq h_fun_eq + have h_chain : mfderiv I I (e'.symm โˆ˜ ฯ†) z v = + mfderiv I I e'.symm (ฯ† z) (mfderiv I I ฯ† z v) := by + have h_comp : mfderiv I I (e'.symm โˆ˜ ฯ†) z = + (mfderiv I I e'.symm (ฯ† z)).comp (mfderiv I I ฯ† z) := by + have hฯ†z_target : ฯ† z โˆˆ e'.target := + chartMetric_phi_maps_to_target e e' hz_source' + have hฯ†_diff : MDifferentiableAt I I ฯ† z := by + have h_ฯ†_eq_ฯˆ : ฯ† = ฯˆ := rfl + rw [h_ฯ†_eq_ฯˆ] + let x := e.symm z + have hx_e := e.map_target hz_target + have h_smooth := chart_transition_smooth e e' x hx_e hz_source' n he he' + simpa [h_z_eq] using h_smooth.mdifferentiableAt hn1 + have he'_symm_diff : MDifferentiableAt I I e'.symm (ฯ† z) := by + have hmani : IsManifold I n M := by + letI := inst_mani_smooth + have h : n โ‰ค n + 1 := by + simp only [self_le_add_right, ฯ†] + exact IsManifold.of_le h + have hn1 : 1 โ‰ค n := by exact hn1 + have h_symm_smooth : ContMDiffOn I I n e'.symm e'.target := + contMDiffOn_symm_of_mem_maximalAtlas he' + exact + (h_symm_smooth.contMDiffAt (e'.open_target.mem_nhds hฯ†z_target)).mdifferentiableAt hn1 + exact mfderiv_comp_of_eq he'_symm_diff hฯ†_diff rfl + have h_apply : mfderiv I I (e'.symm โˆ˜ ฯ†) z v = + (mfderiv I I e'.symm (ฯ† z)).comp (mfderiv I I ฯ† z) v := by + rw [h_comp] + exact rfl + rw [h_apply] + rfl + have h_ฯ†_eq_ฯˆ : ฯ† = ฯˆ := rfl + rw [โ† h_deriv_eq, h_ฯ†_eq_ฯˆ] at h_chain + exact h_chain.symm + have h_chain_rule_w : mfderiv I I e'.symm (ฯ† z) ((mfderiv I I ฯˆ z) w) = + mfderiv I I e.symm z w := by + let x := e.symm z + have h_z_eq : z = e x := Eq.symm (PartialHomeomorph.right_inv e hz_target) + have hx_e : x โˆˆ e.source := e.map_target hz_target + have h_fun_eq : e.symm =แถ [nhds z] e'.symm โˆ˜ ฯ† := by + have h_z_eq_ex : z = e x := h_z_eq + have h_lemma := chart_inverse_composition e e' x hx_e hz_source' + have h_ฯ†_eq : ฯ† = (e.symm.trans e') := rfl + simpa [h_z_eq_ex, h_ฯ†_eq] using h_lemma + have h_deriv_eq : mfderiv I I e.symm z = mfderiv I I (e'.symm โˆ˜ ฯ†) z := + Filter.EventuallyEq.mfderiv_eq h_fun_eq + let h_comp := mfderiv_chart_transition_helper e e' x hx_e hz_source' hn1 hmani he he' + have h_comp_w : mfderiv I I (e'.symm โˆ˜ ฯ†) z w = + (mfderiv I I e'.symm (ฯ† z)).comp (mfderiv I I ฯ† z) w := by + have h_comp_map : mfderiv I I (e'.symm โˆ˜ ฯ†) z = + (mfderiv I I e'.symm (ฯ† z)).comp (mfderiv I I ฯ† z) := by + have hฯ†z_target : ฯ† z โˆˆ e'.target := + chartMetric_phi_maps_to_target e e' hz_source' + have hฯ†_diff : MDifferentiableAt I I ฯ† z := by + have h_ฯ†_eq_ฯˆ : ฯ† = ฯˆ := rfl + rw [h_ฯ†_eq_ฯˆ] + have h_smooth := chart_transition_smooth e e' x hx_e hz_source' n he he' + simpa [h_z_eq] using h_smooth.mdifferentiableAt hn1 + have he'_symm_diff : MDifferentiableAt I I e'.symm (ฯ† z) := by + have h_symm_smooth : ContMDiffOn I I n e'.symm e'.target := + contMDiffOn_symm_of_mem_maximalAtlas he' + exact + (h_symm_smooth.contMDiffAt (e'.open_target.mem_nhds hฯ†z_target)).mdifferentiableAt hn1 + exact mfderiv_comp_of_eq he'_symm_diff hฯ†_diff rfl + rw [h_comp_map] + rfl + have h_ฯ†_eq_ฯˆ : ฯ† = ฯˆ := rfl + rw [โ† h_deriv_eq, h_ฯ†_eq_ฯˆ] at h_comp_w + exact h_comp_w.symm + rw [h_chain_rule_v, h_chain_rule_w] + +end Manifold.Chart diff --git a/PhysLean/Mathematics/Geometry/Manifold/Chart/Smoothness.lean b/PhysLean/Mathematics/Geometry/Manifold/Chart/Smoothness.lean new file mode 100644 index 000000000..e0d5f960c --- /dev/null +++ b/PhysLean/Mathematics/Geometry/Manifold/Chart/Smoothness.lean @@ -0,0 +1,135 @@ +/- +Copyright (c) 2025 Matteo Cipollina. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Matteo Cipollina +-/ + +import Mathlib.Geometry.Manifold.MFDeriv.Basic +import PhysLean.Mathematics.Geometry.Manifold.PartialHomeomorph + +/-! +# Smoothness of Charts and Transition Maps + +This file contains lemmas about the smoothness and differentiability of charts and transition maps. +-/ + +namespace Manifold.Chart + +variable {E : Type v} {M : Type v} {n : WithTop โ„•โˆž} +variable [NormedAddCommGroup E] +variable [TopologicalSpace M] + +open PartialHomeomorph ContinuousLinearMap PartialEquiv + +/-- Coordinate transformation identity: e' x = ฯ†(e x) where ฯ† is the transition map. -/ +lemma chart_coordinate_transform (e e' : PartialHomeomorph M E) (x : M) + (hx_e : x โˆˆ e.source) : + let ฯ† := e.symm.trans e'; + let y := e x; + e' x = ฯ† y := (apply_transition_map_eq_chart_apply e e' x hx_e).symm + +/-- Chart inverse composition identity: e.symm = e'.symm โˆ˜ ฯ† in a neighborhood of e x, + where ฯ† is the transition map. -/ +lemma chart_inverse_composition (e e' : PartialHomeomorph M E) (x : M) + (hx_e : x โˆˆ e.source) (hx_e' : x โˆˆ e'.source) : + let ฯ† := e.symm.trans e'; + let y := e x; + e.symm =แถ [nhds y] e'.symm โˆ˜ ฯ† := by + intro ฯ† y + have hy_dom_ฯ† : y โˆˆ ฯ†.source := + transition_map_source_contains_image_point e e' x hx_e hx_e' + filter_upwards [ฯ†.open_source.mem_nhds hy_dom_ฯ†] with z hz + exact apply_symm_eq_apply_symm_comp_transition e e' z hz + +variable [NormedSpace โ„ E] +variable [ChartedSpace E M] +variable {I : ModelWithCorners โ„ E E} + +open PartialHomeomorph ContinuousLinearMap PartialEquiv + +/-- Transition maps between charts in the maximal atlas are smooth. -/ +lemma chart_transition_smooth (e e' : PartialHomeomorph M E) (x : M) + (hx_e : x โˆˆ e.source) (hx_e' : x โˆˆ e'.source) + (n : WithTop โ„•โˆž) + (he : e โˆˆ (contDiffGroupoid n I).maximalAtlas M) + (he' : e' โˆˆ (contDiffGroupoid n I).maximalAtlas M) : + let ฯ† := e.symm.trans e'; + let y := e x; + ContMDiffAt I I n ฯ† y := by + intro ฯ† y + have hy_dom_ฯ† : y โˆˆ ฯ†.source := + transition_map_source_contains_image_point e e' x hx_e hx_e' + have h_ฯ†_groupoid : ฯ† โˆˆ contDiffGroupoid n I := + (contDiffGroupoid n I).compatible_of_mem_maximalAtlas he he' + have h_ฯ†_smooth : ContMDiffOn I I n ฯ† ฯ†.source := + contMDiffOn_of_mem_contDiffGroupoid h_ฯ†_groupoid + exact ContMDiffOn.contMDiffAt h_ฯ†_smooth (ฯ†.open_source.mem_nhds hy_dom_ฯ†) + +variable {E : Type v} {M : Type v} {n : WithTop โ„•โˆž} +variable [NormedAddCommGroup E] [NormedSpace โ„ E] --[FiniteDimensional โ„ E] +variable [TopologicalSpace M] [ChartedSpace E M] --[T2Space M] +variable {I : ModelWithCorners โ„ E E} --[ModelWithCorners.Boundaryless I] + +/-- Charts in the maximal atlas are differentiable on their source. -/ +lemma chart_differentiable_on_source + (e : PartialHomeomorph M E) (hmani : IsManifold I n M) + (he : e โˆˆ (contDiffGroupoid n I).maximalAtlas M) + (hn1 : 1 โ‰ค n) : + MDifferentiableOn I I e e.source := by + intro x hx + have h_smooth : ContMDiffAt I I n e x := + (contMDiffOn_of_mem_maximalAtlas he).contMDiffAt (e.open_source.mem_nhds hx) + exact (h_smooth.mdifferentiableWithinAt hn1).mono (by exact fun โฆƒaโฆ„ a => trivial) + +lemma chart_symm_differentiable_on_target + (e : PartialHomeomorph M E) (hmani : IsManifold I n M) + (he : e โˆˆ (contDiffGroupoid n I).maximalAtlas M) + (hn1 : 1 โ‰ค n) : + MDifferentiableOn I I e.symm e.target := by + intro y hy + have h_smooth : ContMDiffAt I I n e.symm y := + (contMDiffOn_symm_of_mem_maximalAtlas he).contMDiffAt (e.open_target.mem_nhds hy) + let h_md := h_smooth.mdifferentiableWithinAt hn1 + exact h_md.mono (Set.subset_univ _) + +/-- The manifold derivative of a chart transition map can be computed from charts. -/ +lemma mfderiv_chart_transition_helper (e e' : PartialHomeomorph M E) (x : M) + (hx_e : x โˆˆ e.source) (hx_e' : x โˆˆ e'.source) + (hn1 : 1 โ‰ค n) (hmani : IsManifold I n M) + (he : e โˆˆ (contDiffGroupoid n I).maximalAtlas M) + (he' : e' โˆˆ (contDiffGroupoid n I).maximalAtlas M) : + let ฯ† := e.symm.trans e'; + let y := e x; + mfderiv I I (e'.symm โˆ˜ ฯ†) y = (mfderiv I I e'.symm (ฯ† y)).comp (mfderiv I I ฯ† y) := by + intro ฯ† y + have h_ฯ†_y_eq : ฯ† y = e' x := (chart_coordinate_transform e e' x hx_e).symm + have hฯ†_diff : ContMDiffAt I I n ฯ† y := + chart_transition_smooth e e' x hx_e hx_e' n he he' + have hฯ†_mdiff : MDifferentiableAt I I ฯ† y := hฯ†_diff.mdifferentiableAt hn1 + have he'_symm_diff : MDifferentiableAt I I e'.symm (e' x) := + ((chart_symm_differentiable_on_target e' hmani he' hn1) (e' x) + (e'.mapsTo hx_e')).mdifferentiableAt + (e'.open_target.mem_nhds (e'.mapsTo hx_e')) + exact mfderiv_comp_of_eq he'_symm_diff hฯ†_mdiff h_ฯ†_y_eq + +/-- Chain rule for composition of chart inverses with transition maps. -/ +theorem mfderiv_chart_transition (e e' : PartialHomeomorph M E) (x : M) + (hx_e : x โˆˆ e.source) (hx_e' : x โˆˆ e'.source) + (hn1 : 1 โ‰ค n) (hmani : IsManifold I n M) + (he : e โˆˆ (contDiffGroupoid n I).maximalAtlas M) + (he' : e' โˆˆ (contDiffGroupoid n I).maximalAtlas M) : + let ฯ† := e.symm.trans e'; + let y := e x; + mfderiv I I e.symm y = (mfderiv I I e'.symm (e' x)).comp (mfderiv I I ฯ† y) := by + intro ฯ† y + have h_fun_eq : e.symm =แถ [nhds y] e'.symm โˆ˜ ฯ† := + chart_inverse_composition e e' x hx_e hx_e' + have h_ฯ†_y_eq : ฯ† y = e' x := + (chart_coordinate_transform e e' x hx_e).symm + have h_deriv_eq : mfderiv I I e.symm y = mfderiv I I (e'.symm โˆ˜ ฯ†) y := + Filter.EventuallyEq.mfderiv_eq h_fun_eq + rw [h_deriv_eq] + have h_comp := mfderiv_chart_transition_helper e e' x hx_e hx_e' hn1 hmani he he' + rw [h_comp, h_ฯ†_y_eq] + +end Manifold.Chart diff --git a/PhysLean/Mathematics/Geometry/Manifold/Chart/Utilities.lean b/PhysLean/Mathematics/Geometry/Manifold/Chart/Utilities.lean new file mode 100644 index 000000000..fc1600faa --- /dev/null +++ b/PhysLean/Mathematics/Geometry/Manifold/Chart/Utilities.lean @@ -0,0 +1,59 @@ +/- +Copyright (c) 2025 Matteo Cipollina. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Matteo Cipollina +-/ + +import Mathlib.Analysis.Normed.Group.Basic +import Mathlib.Topology.PartialHomeomorph +/-! +# Utilities for Charts and Transition Maps + +This file contains general utility lemmas for charts and transition maps. +-/ + +namespace Manifold.Chart +variable {E : Type v} {M : Type v} {n : WithTop โ„•โˆž} +variable [NormedAddCommGroup E] +variable [TopologicalSpace M] + +/-- The domain where the chart transition is well-defined forms a neighborhood of y. -/ +lemma chartMetric_domain_in_nhds (e e' : PartialHomeomorph M E) (y : E) + (hy : y โˆˆ e.target) (hx_source' : e.symm y โˆˆ e'.source) : + let s := e.target โˆฉ e.symm โปยน' e'.source + s โˆˆ nhds y := by + intro s + apply Filter.inter_mem + ยท exact e.open_target.mem_nhds hy + ยท exact (e.continuousAt_symm hy).preimage_mem_nhds (e'.open_source.mem_nhds hx_source') + +/-- When applying ฯ† = e' โˆ˜ e.symm to a point z in the domain s, the result is in e'.target -/ +lemma chartMetric_phi_in_target (e e' : PartialHomeomorph M E) {z : E} + (hz_source' : e.symm z โˆˆ e'.source) : + let ฯ† := e'.toPartialEquiv โˆ˜ e.symm + ฯ† z โˆˆ e'.target := by + intro ฯ† + unfold ฯ† + exact e'.mapsTo hz_source' + +/-- When applying ฯ† = e' โˆ˜ e.symm to a point z, the result is in e'.target -/ +lemma chartMetric_phi_maps_to_target (e e' : PartialHomeomorph M E) {z : E} + (hz_source' : e.symm z โˆˆ e'.source) : + let ฯ† := e' โˆ˜ e.symm + ฯ† z โˆˆ e'.target := by + intro ฯ† + unfold ฯ† + exact e'.mapsTo hz_source' + +/-- The composition of chart maps preserves points: e'.symm (e' (e.symm z)) = e.symm z -/ +lemma chart_map_composition_identity (e e' : PartialHomeomorph M E) {z : E} + (hz_source' : e.symm z โˆˆ e'.source) : + let ฯ† := e' โˆ˜ e.symm + let x_z := e.symm z + e'.symm (ฯ† z) = x_z := by + intro ฯ† x_z + unfold ฯ† + simp only [Function.comp_apply, PartialHomeomorph.coe_coe] + rw [e'.left_inv hz_source'] + +end Manifold.Chart diff --git a/PhysLean/Mathematics/Geometry/Manifold/PartialHomeomorph.lean b/PhysLean/Mathematics/Geometry/Manifold/PartialHomeomorph.lean new file mode 100644 index 000000000..413363084 --- /dev/null +++ b/PhysLean/Mathematics/Geometry/Manifold/PartialHomeomorph.lean @@ -0,0 +1,209 @@ +/- +Copyright (c) 2025 Matteo Cipollina. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Matteo Cipollina +-/ + +import Mathlib.Geometry.Manifold.ContMDiff.Atlas +import Mathlib.Geometry.Manifold.ContMDiff.NormedSpace + +/-! +# PartialHomeomorph Utilities for Manifolds + +This file contains lemmas for `PartialHomeomorph` specifically relevant to manifolds. +-/ + +namespace PartialHomeomorph + +open Set ModelWithCorners PartialEquiv + +variable {๐•œ : Type*} [NontriviallyNormedField ๐•œ] +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ๐•œ E] +variable {H : Type*} [NormedAddCommGroup H] [NormedSpace ๐•œ H] [TopologicalSpace H] +variable {M : Type*} [TopologicalSpace M] [ChartedSpace H M] +variable {I : ModelWithCorners ๐•œ E H} {n : WithTop โ„•โˆž} + +/-- The toPartialEquiv of the symm of a partial homeomorphism equals the symm of its +toPartialEquiv. -/ +@[simp, mfld_simps] +theorem toPartialEquiv_symm {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] + (e : PartialHomeomorph X Y) : + e.symm.toPartialEquiv = e.toPartialEquiv.symm := + rfl + +/-- The function component of the symm of a partial homeomorphism equals its invFun. -/ +theorem coe_symm_eq_invFun {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] + (e : PartialHomeomorph X Y) : โ‡‘e.symm = e.invFun := + rfl + +omit [NormedAddCommGroup H] [NormedSpace ๐•œ H] in +/-- If a partial homeomorphism belongs to the `contDiffGroupoid n I`, then the forward map is +`C^n` on its source. This extracts the smoothness property directly from groupoid membership. -/ +theorem contMDiffOn_of_mem_groupoid {e : PartialHomeomorph H H} + (he : e โˆˆ contDiffGroupoid n I) : ContMDiffOn I I n e e.source := + contMDiffOn_of_mem_contDiffGroupoid he + +omit [NormedAddCommGroup H] [NormedSpace ๐•œ H] in +/-- The coordinate change map `ฯ† = e' โˆ˜ e.symm` between two charts `e` and `e'` is `C^n` smooth + at a point `y = e x` if `x` is in the intersection of the sources of `e` and `e'`. -/ +lemma contMDiffAt_coord_change + {e e' : PartialHomeomorph M H} {x : M} + (hx_e_source : x โˆˆ e.source) (hx_e'_source : x โˆˆ e'.source) + (he : e โˆˆ (contDiffGroupoid n I).maximalAtlas M) + (he' : e' โˆˆ (contDiffGroupoid n I).maximalAtlas M) : + ContMDiffAt I I n (e' โˆ˜ e.symm) (e x) := by + let y := e x + have hy_target : y โˆˆ e.target := e.mapsTo hx_e_source + let transition_domain := e.target โˆฉ e.symm โปยน' e'.source + have hy_domain : y โˆˆ transition_domain := โŸจhy_target, by + rw [@Set.mem_preimage]; + rw [e.left_inv hx_e_source]; + exact hx_e'_sourceโŸฉ + have open_domain : IsOpen transition_domain := e.isOpen_inter_preimage_symm e'.open_source + have h_compatible := StructureGroupoid.compatible_of_mem_maximalAtlas he he' + have h_transition_smooth : ContMDiffOn I I n (e' โˆ˜ e.symm) transition_domain := + contMDiffOn_of_mem_groupoid h_compatible + exact h_transition_smooth.contMDiffAt (open_domain.mem_nhds hy_domain) + +omit [NormedAddCommGroup H] [NormedSpace ๐•œ H] in +/-- The coordinate change map between atlas charts is smooth in the manifold sense. -/ +lemma contMDiffAt_atlas_coord_change [IsManifold I n M] + {e e' : PartialHomeomorph M H} + (he : e โˆˆ atlas H M) (he' : e' โˆˆ atlas H M) {x : M} + (hx_e_source : x โˆˆ e.source) (hx_e'_source : x โˆˆ e'.source) : + ContMDiffAt I I n (e' โˆ˜ e.symm) (e x) := by + let transition_domain := e.target โˆฉ e.symm โปยน' e'.source + have open_domain : IsOpen transition_domain := e.isOpen_inter_preimage_symm e'.open_source + have hy_target : e x โˆˆ e.target := e.mapsTo hx_e_source + have hy_domain : e x โˆˆ transition_domain := โŸจhy_target, by + show e.symm (e x) โˆˆ e'.source + rw [e.left_inv hx_e_source] + exact hx_e'_sourceโŸฉ + have h_compatible : e.symm.trans e' โˆˆ contDiffGroupoid n I := HasGroupoid.compatible he he' + have h_transition_smooth : ContMDiffOn I I n (e' โˆ˜ e.symm) transition_domain := + contMDiffOn_of_mem_groupoid h_compatible + exact h_transition_smooth.contMDiffAt (open_domain.mem_nhds hy_domain) + +/-- The coordinate change map `ฯ† = e' โˆ˜ e.symm` between two charts `e` and `e'` taken from the + atlas is `C^n` smooth at a point `y = e x` if `x` is in the intersection of their sources. -/ +lemma contDiffAt_atlas_coord_change + {๐•œ : Type*} [NontriviallyNormedField ๐•œ] [NormedSpace ๐•œ E] + {n : WithTop โ„•โˆž} [ChartedSpace E M] + [IsManifold (modelWithCornersSelf ๐•œ E) n M] + {e e' : PartialHomeomorph M E} + (he : e โˆˆ atlas E M) (he' : e' โˆˆ atlas E M) {x : M} + (hx_e_source : x โˆˆ e.source) (hx_e'_source : x โˆˆ e'.source) : + let y := e x + ContDiffAt ๐•œ n (e' โˆ˜ e.symm) y := by + intro y + have hy_target : y โˆˆ e.target := e.mapsTo hx_e_source + let transition_domain := e.target โˆฉ e.symm โปยน' e'.source + have hy_domain : y โˆˆ transition_domain := by + refine โŸจhy_target, ?_โŸฉ + simp only [Set.mem_preimage] + rw [e.left_inv hx_e_source] + exact hx_e'_source + have h_compatible : e.symm.trans e' โˆˆ contDiffGroupoid n (modelWithCornersSelf ๐•œ E) := + HasGroupoid.compatible he he' + have h_transition_mfd_smooth : ContMDiffOn (modelWithCornersSelf ๐•œ E) + (modelWithCornersSelf ๐•œ E) n (e' โˆ˜ e.symm) transition_domain := + contMDiffOn_of_mem_contDiffGroupoid h_compatible + have h_transition_smooth : ContDiffOn ๐•œ n (e' โˆ˜ e.symm) transition_domain := + (contMDiffOn_iff_contDiffOn).mp h_transition_mfd_smooth + have open_domain : IsOpen transition_domain := + ContinuousOn.isOpen_inter_preimage e.continuousOn_invFun e.open_target e'.open_source + exact h_transition_smooth.contDiffAt (IsOpen.mem_nhds open_domain hy_domain) + +lemma extChartAt_eq_extend_chartAt {E' : Type*} [NormedAddCommGroup E'] [NormedSpace ๐•œ E'] + (I' : ModelWithCorners ๐•œ E' E') (x_m : M) [ChartedSpace E' M] : + extChartAt I' x_m = (chartAt E' x_m).extend I' := + rfl + +variable {F : Type*} [NormedAddCommGroup F] [NormedSpace ๐•œ F] +variable [K_bl : I.Boundaryless] -- Changed K to I + +omit [NormedSpace ๐•œ E] in +/-- Domain of the transition map `e.symm.trans e'` contains `e x`. -/ +lemma transition_map_source_contains_image_point {E_chart : Type*} [TopologicalSpace E_chart] + (e e' : PartialHomeomorph M E_chart) (x : M) + (hx_e_source : x โˆˆ e.source) (hx_e'_source : x โˆˆ e'.source) : + (e x) โˆˆ (e.symm.toPartialEquiv.trans e'.toPartialEquiv).source := by + rw [@PartialEquiv.trans_source''] + simp only [symm_toPartialEquiv, PartialEquiv.symm_symm, toFun_eq_coe, PartialEquiv.symm_target, + Set.mem_image, Set.mem_inter_iff] + rw [โ† @symm_image_target_eq_source] + rw [@symm_image_target_eq_source] + apply Exists.intro + ยท apply And.intro + on_goal 2 => {rfl + } + ยท simp_all only [and_self] + +variable {f_map : H โ†’ H} {y_pt : H} -- Renamed f, y to avoid clash + +omit [NormedAddCommGroup H] [NormedSpace ๐•œ H] K_bl in +lemma contDiffAt_chart_expression_of_contMDiffAt [I.Boundaryless] + (h_contMDiff : ContMDiffAt I I n f_map y_pt) : + ContDiffAt ๐•œ n (I โˆ˜ f_map โˆ˜ I.symm) (I y_pt) := by + rw [@contMDiffAt_iff] at h_contMDiff + obtain โŸจ_, h_diffโŸฉ := h_contMDiff + have h_fun_eq : (extChartAt I (f_map y_pt)) โˆ˜ f_map โˆ˜ (extChartAt I y_pt).symm = + I โˆ˜ f_map โˆ˜ I.symm := by + simp only [extChartAt, extend, refl_partialEquiv, PartialEquiv.refl_source, + singletonChartedSpace_chartAt_eq, PartialEquiv.refl_trans, toPartialEquiv_coe, + toPartialEquiv_coe_symm] + have h_point_eq : (extChartAt I y_pt) y_pt = I y_pt := by + simp only [extChartAt, extend, refl_partialEquiv, PartialEquiv.refl_source, + singletonChartedSpace_chartAt_eq, PartialEquiv.refl_trans, toPartialEquiv_coe] + have h_diff' : ContDiffWithinAt ๐•œ n (I โˆ˜ f_map โˆ˜ I.symm) (Set.range I) (I y_pt) := by + rw [โ† h_fun_eq, โ† h_point_eq] + exact h_diff + apply ContDiffWithinAt.contDiffAt h_diff' + have : I y_pt โˆˆ interior (Set.range I) := by + have h_range : Set.range I = Set.univ := I.range_eq_univ + simp [h_range, interior_univ] + exact mem_interior_iff_mem_nhds.mp this + +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace โ„ E] +variable {I : ModelWithCorners โ„ E E} [I.Boundaryless] +variable {n : WithTop โ„•โˆž} + +lemma contDiff_of_boundaryless_model_on_self : + ContDiff โ„ n (modelWithCornersSelf โ„ E).toFun := by + let I := modelWithCornersSelf โ„ E + have h_mem_groupoid : PartialHomeomorph.refl E โˆˆ contDiffGroupoid n I := + StructureGroupoid.id_mem (contDiffGroupoid n I) + have h_contMDiffOn : ContMDiffOn I I n (PartialHomeomorph.refl E) Set.univ := + contMDiffOn_of_mem_contDiffGroupoid h_mem_groupoid + rw [contMDiffOn_iff_contDiffOn] at h_contMDiffOn + simpa [contDiffOn_univ] using h_contMDiffOn + +lemma contDiff_symm_of_boundaryless_model_on_self : + ContDiff โ„ n (modelWithCornersSelf โ„ E).symm.toFun := by + let I := modelWithCornersSelf โ„ E + have h_mem_groupoid : PartialHomeomorph.refl E โˆˆ contDiffGroupoid n I := + StructureGroupoid.id_mem (contDiffGroupoid n I) + have h_mdf := contMDiffOn_of_mem_contDiffGroupoid h_mem_groupoid + exact contDiffOn_univ.1 (contMDiffOn_iff_contDiffOn.1 h_mdf) + +omit [NormedSpace โ„ E] in +/-- Functional equality e.symm = e'.symm โˆ˜ ฯ†-/ +lemma apply_symm_eq_apply_symm_comp_transition (e e' : PartialHomeomorph M E) : + let ฯ†_pe := e.symm.toPartialEquiv.trans e'.toPartialEquiv; + โˆ€ z โˆˆ ฯ†_pe.source, e.symm z = (e'.symm โˆ˜ โ‡‘ฯ†_pe) z := by + intro ฯ†_pe z hz_in_ฯ†_source + rw [PartialEquiv.trans_source, Set.mem_inter_iff, Set.mem_preimage] at hz_in_ฯ†_source + rcases hz_in_ฯ†_source with โŸจ_, hz_esymm_z_in_eprime_sourceโŸฉ + simp only [Function.comp_apply, PartialEquiv.trans_apply, + PartialHomeomorph.coe_coe] + exact Eq.symm (e'.left_inv' hz_esymm_z_in_eprime_source) + +omit [NormedSpace โ„ E] in +/-- Image of y under ฯ†-/ +lemma apply_transition_map_eq_chart_apply (e e' : PartialHomeomorph M E) (x : M) + (hx_e_source : x โˆˆ e.source) : + (e.symm.toPartialEquiv.trans e'.toPartialEquiv) (e x) = e' x := by + simp only [PartialEquiv.trans_apply, PartialHomeomorph.coe_coe, + e.left_inv hx_e_source] + +end PartialHomeomorph diff --git a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Chart.lean b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Chart.lean new file mode 100644 index 000000000..66c1c43bb --- /dev/null +++ b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Chart.lean @@ -0,0 +1,142 @@ +/- +Copyright (c) 2025 Matteo Cipollina. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Matteo Cipollina +-/ + +import Mathlib.Algebra.Lie.OfAssociative +import PhysLean.Mathematics.Geometry.Manifold.Chart.Smoothness +import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Defs +import PhysLean.Mathematics.LinearAlgebra.BilinearForm + +/-! +# Pseudo-Riemannian Metric in Chart Coordinates + +This file defines `chartMetric`, which expresses a pseudo-Riemannian metric in local chart +coordinates, and proves its transformation properties under coordinate changes. +-/ + +namespace PseudoRiemannianMetric + +noncomputable section +open BilinearForm PartialHomeomorph ContinuousLinearMap PartialEquiv ContDiff Manifold.Chart + +open Filter + +variable {E : Type v} {M : Type v} {n : WithTop โ„•โˆž} +variable [NormedAddCommGroup E] [NormedSpace โ„ E] --[FiniteDimensional โ„ E] +variable [TopologicalSpace M] [ChartedSpace E M] --[T2Space M] +variable {I : ModelWithCorners โ„ E E} --[ModelWithCorners.Boundaryless I] +variable [inst_mani_smooth : IsManifold I (n + 1) M] -- For C^{n+1} manifold for C^n metric +variable [inst_tangent_findim : โˆ€ (x : M), FiniteDimensional โ„ (TangentSpace I x)] + +noncomputable instance (x : M) : NormedAddCommGroup (TangentSpace I x) := + show NormedAddCommGroup E from inferInstance + +noncomputable instance (x : M) : NormedSpace โ„ (TangentSpace I x) := + show NormedSpace โ„ E from inferInstance + +/-- Given a pseudo-Riemannian metric `g` and a partial homeomorphism `e`, computes the metric +in the chart coordinates. At a point `y` in the target of `e`, the result is the pullback of +the metric at `e.symm y` by the derivative of `e.symm` at `y`. -/ +def chartMetric (g : PseudoRiemannianMetric E E M n I) (e : PartialHomeomorph M E) (y : E) : + E โ†’L[โ„] E โ†’L[โ„] โ„ := + letI := Classical.propDecidable + dite (y โˆˆ e.target) + (fun _ : y โˆˆ e.target => + let x := e.symm y + letI : FiniteDimensional โ„ (TangentSpace I x) := inferInstance + let Df : E โ†’L[โ„] TangentSpace I x := mfderiv I I e.symm y + BilinearForm.pullback (g.val x) Df) + (fun _ => (0 : E โ†’L[โ„] E โ†’L[โ„] โ„)) + +@[simp] +lemma chartMetric_apply_of_mem (g : PseudoRiemannianMetric E E M n I) (e : PartialHomeomorph M E) + {y : E} (hy : y โˆˆ e.target) (v w : E) : + chartMetric g e y v w = g.val (e.symm y) (mfderiv I I e.symm y v) (mfderiv I I e.symm y w) := by + letI := Classical.propDecidable + rw [chartMetric, dite_eq_ite, if_pos hy] + simp only [BilinearForm.pullback, ContinuousLinearMap.bilinearComp_apply] + exact rfl + +lemma chartMetric_apply_of_not_mem + (g : PseudoRiemannianMetric E E M n I) + (e : PartialHomeomorph M E) + {y : E} (hy : y โˆ‰ e.target) (v w : E) : + chartMetric g e y v w = 0 := by + simp only [chartMetric, hy, โ†“reduceDIte, ContinuousLinearMap.zero_apply] + +/-- The value of a metric in chart coordinates at corresponding points. -/ +lemma chartMetric_at_corresponding_points (g : PseudoRiemannianMetric E E M n I) + (e e' : PartialHomeomorph M E) (x : M) + (hx_e : x โˆˆ e.source) (hx_e' : x โˆˆ e'.source) + (hmani : IsManifold I n M) + (hn1 : 1 โ‰ค n) + (he : e โˆˆ (contDiffGroupoid n I).maximalAtlas M) + (he' : e' โˆˆ (contDiffGroupoid n I).maximalAtlas M) + (v w : E) : + let y := e x + let y' := e' x + g.val x (mfderiv I I e.symm y v) (mfderiv I I e.symm y w) = + g.val x (mfderiv I I e'.symm y' (mfderiv I I (e.symm.trans e') y v)) + (mfderiv I I e'.symm y' (mfderiv I I (e.symm.trans e') y w)) := by + intro y y' + have h_chain := mfderiv_chart_transition e e' x hx_e hx_e' + hn1 hmani he he' + rw [h_chain] + congr + +/-- The relationship between chart metrics under coordinate change. -/ +lemma chartMetric_bilinear_pullback (g : PseudoRiemannianMetric E E M n I) + (e e' : PartialHomeomorph M E) (x : M) + (hx_e : x โˆˆ e.source) (hx_e' : x โˆˆ e'.source) + (hmani : IsManifold I n M) + (hn1 : 1 โ‰ค n) + (he : e โˆˆ (contDiffGroupoid n I).maximalAtlas M) + (he' : e' โˆˆ (contDiffGroupoid n I).maximalAtlas M) + (v w : E) : + let y := e x + let y' := e' x + let ฯ† := e.symm.trans e' + chartMetric g e y v w = + (BilinearForm.pullback (chartMetric g e' y') (mfderiv I I ฯ† y)) v w := by + intro y y' ฯ† + have hy_target : y โˆˆ e.target := e.mapsTo hx_e + have hy'_target : y' โˆˆ e'.target := e'.mapsTo hx_e' + have h_x_e : e.symm y = x := e.left_inv hx_e + have h_x_e' : e'.symm y' = x := e'.left_inv hx_e' + simp only [chartMetric_apply_of_mem g e hy_target, + chartMetric_apply_of_mem g e' hy'_target, + BilinearForm.pullback, ContinuousLinearMap.bilinearComp_apply] + rw [h_x_e] + rw [h_x_e'] + have h_phi_def : ฯ† = e.symm.trans e' := rfl + rw [h_phi_def] + exact chartMetric_at_corresponding_points g e e' x hx_e hx_e' hmani hn1 he he' v w + +/-- +The metric tensor transformation law under chart changes. + +This theorem states that the representation of a pseudo-Riemannian metric in different charts +are related by the pullback of the coordinate transformation between these charts. +Specifically, if `e` and `e'` are two charts containing a point `x_pt`, then the metric +expressed in chart `e` equals the pullback of the metric expressed in chart `e'` +by the differential of the transition map from `e` to `e'`. +-/ +theorem chartMetric_coord_change (g : PseudoRiemannianMetric E E M n I) + (e e' : PartialHomeomorph M E) + (x_pt : M) + (hx_e_source : x_pt โˆˆ e.source) (hx_e'_source : x_pt โˆˆ e'.source) + (hn1 : 1 โ‰ค n) + (hmani_chart : IsManifold I n M) + (he_atlas : e โˆˆ (contDiffGroupoid n I).maximalAtlas M) + (he'_atlas : e' โˆˆ (contDiffGroupoid n I).maximalAtlas M) : + chartMetric g e (e x_pt) = + BilinearForm.pullback (chartMetric g e' (e' x_pt)) + (mfderiv I I (e.symm.trans e') (e x_pt)) := by + let ฯ† := e.symm.trans e' + let y := e x_pt + let y' := e' x_pt + ext v w + exact chartMetric_bilinear_pullback g e e' x_pt hx_e_source hx_e'_source + hmani_chart hn1 he_atlas he'_atlas v w diff --git a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean index ddf5ec1cb..f5661003f 100644 --- a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Defs.lean @@ -3,12 +3,14 @@ Copyright (c) 2025 Matteo Cipollina. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Matteo Cipollina -/ + import Mathlib.Analysis.InnerProductSpace.Basic import Mathlib.Analysis.RCLike.Lemmas import Mathlib.Geometry.Manifold.MFDeriv.Defs import Mathlib.LinearAlgebra.BilinearForm.Properties import Mathlib.LinearAlgebra.QuadraticForm.Real import Mathlib.Topology.LocallyConstant.Basic + /-! # Pseudo-Riemannian Metrics on Smooth Manifolds @@ -164,9 +166,9 @@ private def pseudoRiemannianMetricValToQuadraticForm ringโŸฉ /-- A pseudo-Riemannian metric of smoothness class `C^n` on a manifold `M` modelled on `(E, H)` - with model `I`. This structure defines a smoothly varying, non-degenerate, symmetric, - continuous bilinear form `gโ‚“` of constant negative dimension on the tangent space `Tโ‚“M` - at each point `x`. Requires `M` to be `C^{n+1}` smooth.-/ +with model `I`. This structure defines a smoothly varying, non-degenerate, symmetric, +continuous bilinear form `gโ‚“` of constant negative dimension on the tangent space `Tโ‚“M` +at each point `x`. Requires `M` to be `C^{n+1}` smooth.-/ @[ext] structure PseudoRiemannianMetric (E : Type v) (H : Type w) (M : Type w) (n : WithTop โ„•โˆž) diff --git a/PhysLean/Mathematics/LinearAlgebra/BilinearForm.lean b/PhysLean/Mathematics/LinearAlgebra/BilinearForm.lean new file mode 100644 index 000000000..1ed42aeaa --- /dev/null +++ b/PhysLean/Mathematics/LinearAlgebra/BilinearForm.lean @@ -0,0 +1,185 @@ +/- +Copyright (c) 2025 Matteo Cipollina. All rights reserved. +Released under Apache 2.0 license as described in the file LICENSE. +Authors: Matteo Cipollina +-/ + +import Mathlib.Analysis.InnerProductSpace.Basic +import Mathlib.Analysis.Normed.Module.FiniteDimension +import Mathlib.Analysis.Normed.Operator.BoundedLinearMaps +import Mathlib.Topology.Algebra.Module.ModuleTopology +import Mathlib.Topology.Metrizable.CompletelyMetrizable + +/-! +# Bilinear Form Utilities + +This file contains general lemmas and definitions related to bilinear forms, +particularly in the context of finite-dimensional normed spaces. +-/ + +namespace BilinearForm + +noncomputable section + +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace โ„ E] + +/-- Given a bilinear map `B` and a linear map `A`, constructs the pullback of `B` by `A`, +which is the bilinear map `(v, w) โ†ฆ B (A v) (A w)`. -/ +abbrev pullback {Fโ‚ Fโ‚‚ R : Type*} [NormedAddCommGroup Fโ‚] [NormedSpace โ„ Fโ‚] + [NormedAddCommGroup Fโ‚‚] [NormedSpace โ„ Fโ‚‚] [NormedAddCommGroup R] [NormedSpace โ„ R] + (B : Fโ‚‚ โ†’L[โ„] Fโ‚‚ โ†’L[โ„] R) (A : Fโ‚ โ†’L[โ„] Fโ‚‚) : Fโ‚ โ†’L[โ„] Fโ‚ โ†’L[โ„] R := + ContinuousLinearMap.bilinearComp B A A + +/-- For a finite-dimensional space E with basis b, constructs elementary bilinear forms e_ij + such that e_ij(v, w) = (b.coord i)(v) * (b.coord j)(w). -/ +lemma elementary_bilinear_forms_def [FiniteDimensional โ„ E] + (b : Basis (Fin (Module.finrank โ„ E)) โ„ E) : + โˆƒ (e : (Fin (Module.finrank โ„ E)) โ†’ (Fin (Module.finrank โ„ E)) โ†’ (E โ†’L[โ„] E โ†’L[โ„] โ„)), + โˆ€ (i j : Fin (Module.finrank โ„ E)) (v w : E), + e i j v w = (b.coord i) v * (b.coord j) w := by + let n := Module.finrank โ„ E + let idx := Fin n + let b_dual (i : idx) := b.coord i + let e (i j : idx) : E โ†’L[โ„] E โ†’L[โ„] โ„ := + let fi : E โ†’L[โ„] โ„ := LinearMap.toContinuousLinearMap (b_dual i) + let fj : E โ†’L[โ„] โ„ := LinearMap.toContinuousLinearMap (b_dual j) + let mul_map : โ„ โ†’L[โ„] โ„ โ†’L[โ„] โ„ := ContinuousLinearMap.mul โ„ โ„ + ContinuousLinearMap.bilinearComp mul_map fi fj + have h_prop : โˆ€ (i j : idx) (v w : E), e i j v w = (b.coord i) v * (b.coord j) w := by + intro i j v w + simp only [Basis.coord_apply] + rfl + exact โŸจe, h_propโŸฉ + +/-- Every vector in a finite-dimensional space can be written as a sum + of basis vectors with coordinates given by the dual basis. -/ +lemma vector_basis_expansion + (b : Basis (Fin (Module.finrank โ„ E)) โ„ E) (v : E) : + v = โˆ‘ i โˆˆ Finset.univ, (b.coord i) v โ€ข b i := by + rw [โ† b.sum_repr v] + congr + ext i + simp only [b.coord_apply, Finsupp.single_apply] + rw [@Basis.repr_sum_self] + +lemma sum_smul_left (L : E โ†’L[โ„] E โ†’L[โ„] โ„) {ฮน : Type*} + (s : Finset ฮน) (c : ฮน โ†’ โ„) (v : ฮน โ†’ E) (w : E) : + L (โˆ‘ i โˆˆ s, c i โ€ข v i) w = โˆ‘ i โˆˆ s, c i โ€ข L (v i) w := by + simp_rw [map_sum, ContinuousLinearMap.map_smul] + exact ContinuousLinearMap.sum_apply s (fun d => c d โ€ข L (v d)) w + +lemma sum_mul_left (L : E โ†’L[โ„] E โ†’L[โ„] โ„) {ฮน : Type*} + (s : Finset ฮน) (c : ฮน โ†’ โ„) (v : ฮน โ†’ E) (w : E) : + L (โˆ‘ i โˆˆ s, c i โ€ข v i) w = โˆ‘ i โˆˆ s, c i * L (v i) w := by + rw [sum_smul_left L s c v w] + simp_rw [smul_eq_mul] + +lemma sum_smul_right (L : E โ†’L[โ„] E โ†’L[โ„] โ„) (v : E) {ฮน : Type*} + (t : Finset ฮน) (d : ฮน โ†’ โ„) (w : ฮน โ†’ E) : + L v (โˆ‘ j โˆˆ t, d j โ€ข w j) = โˆ‘ j โˆˆ t, d j โ€ข L v (w j) := by + simp_rw [map_sum, ContinuousLinearMap.map_smul] + +lemma sum_mul_right (L : E โ†’L[โ„] E โ†’L[โ„] โ„) (v : E) {ฮน : Type*} + (t : Finset ฮน) (d : ฮน โ†’ โ„) (w : ฮน โ†’ E) : + L v (โˆ‘ j โˆˆ t, d j โ€ข w j) = โˆ‘ j โˆˆ t, d j * L v (w j) := by + rw [sum_smul_right L v t d w] + simp_rw [smul_eq_mul] + +lemma sum_smul_left_right (L : E โ†’L[โ„] E โ†’L[โ„] โ„) {ฮนโ‚ ฮนโ‚‚ : Type*} + (s : Finset ฮนโ‚) (t : Finset ฮนโ‚‚) + (c : ฮนโ‚ โ†’ โ„) (v : ฮนโ‚ โ†’ E) (d : ฮนโ‚‚ โ†’ โ„) (w : ฮนโ‚‚ โ†’ E) : + L (โˆ‘ i โˆˆ s, c i โ€ข v i) (โˆ‘ j โˆˆ t, d j โ€ข w j) = + โˆ‘ i โˆˆ s, โˆ‘ j โˆˆ t, c i โ€ข d j โ€ข L (v i) (w j) := by + simp_rw [sum_smul_left, sum_smul_right, Finset.smul_sum] + +lemma sum_mul_left_right (L : E โ†’L[โ„] E โ†’L[โ„] โ„) {ฮนโ‚ ฮนโ‚‚ : Type*} + (s : Finset ฮนโ‚) (t : Finset ฮนโ‚‚) + (c : ฮนโ‚ โ†’ โ„) (v : ฮนโ‚ โ†’ E) (d : ฮนโ‚‚ โ†’ โ„) (w : ฮนโ‚‚ โ†’ E) : + L (โˆ‘ i โˆˆ s, c i โ€ข v i) (โˆ‘ j โˆˆ t, d j โ€ข w j) = + โˆ‘ i โˆˆ s, โˆ‘ j โˆˆ t, c i * d j * L (v i) (w j) := by + rw [sum_smul_left_right L s t c v d w] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + simp_rw [smul_eq_mul, mul_assoc] + +lemma on_basis_expansions + (b : Basis (Fin (Module.finrank โ„ E)) โ„ E) + (L : E โ†’L[โ„] E โ†’L[โ„] โ„) (v w : E) : + L v w = โˆ‘ i โˆˆ Finset.univ, โˆ‘ j โˆˆ Finset.univ, + (b.coord i v) * (b.coord j w) * L (b i) (b j) := by + rw [vector_basis_expansion b v, vector_basis_expansion b w] + rw [sum_mul_left_right L Finset.univ Finset.univ + (fun i => b.coord i v) b (fun j => b.coord j w) b] + simp only [โ†vector_basis_expansion b v, โ†vector_basis_expansion b w] + +/-- The sum of elementary bilinear forms weighted by coefficients, + when applied to vectors, equals a weighted sum of the products of + coordinate functions. -/ +lemma elementary_bilinear_forms_sum_apply + (b : Basis (Fin (Module.finrank โ„ E)) โ„ E) + (e : (Fin (Module.finrank โ„ E)) โ†’ (Fin (Module.finrank โ„ E)) โ†’ (E โ†’L[โ„] E โ†’L[โ„] โ„)) + (h_e : โˆ€ i j v w, e i j v w = (b.coord i) v * (b.coord j) w) + (c : (Fin (Module.finrank โ„ E)) โ†’ (Fin (Module.finrank โ„ E)) โ†’ โ„) + (v w : E) : + ((โˆ‘ i โˆˆ Finset.univ, โˆ‘ j โˆˆ Finset.univ, c i j โ€ข e i j) v) w = + โˆ‘ i โˆˆ Finset.univ, โˆ‘ j โˆˆ Finset.univ, c i j * ((b.coord i) v * (b.coord j) w) := by + simp only [ContinuousLinearMap.sum_apply, ContinuousLinearMap.smul_apply] + apply Finset.sum_congr rfl + intro i _ + apply Finset.sum_congr rfl + intro j _ + congr + exact h_e i j v w + +/-- A simple algebraic identity for rearranging terms in double sums with multiple scalars. -/ +lemma Finset.rearrange_double_sum_coefficients {ฮฑ ฮฒ R : Type*} [CommSemiring R] + {s : Finset ฮฑ} {t : Finset ฮฒ} {f : ฮฑ โ†’ ฮฒ โ†’ R} {g : ฮฑ โ†’ ฮฒ โ†’ R} {h : ฮฑ โ†’ ฮฒ โ†’ R} : + (โˆ‘ i โˆˆ s, โˆ‘ j โˆˆ t, f i j * g i j * h i j) = + (โˆ‘ i โˆˆ s, โˆ‘ j โˆˆ t, h i j * (f i j * g i j)) := by + apply Finset.sum_congr rfl; intro i _ + apply Finset.sum_congr rfl; intro j _ + ring + +/-- Any bilinear form can be decomposed as a sum of elementary bilinear forms + weighted by the form's values on basis elements. -/ +theorem decomposition [FiniteDimensional โ„ E] (b : Basis (Fin (Module.finrank โ„ E)) โ„ E) : + โˆ€ (L : E โ†’L[โ„] E โ†’L[โ„] โ„), + โˆƒ (e : (Fin (Module.finrank โ„ E)) โ†’ (Fin (Module.finrank โ„ E)) โ†’ (E โ†’L[โ„] E โ†’L[โ„] โ„)), + (โˆ€ i j v w, e i j v w = (b.coord i) v * (b.coord j) w) โˆง + L = โˆ‘ i โˆˆ Finset.univ, โˆ‘ j โˆˆ Finset.univ, L (b i) (b j) โ€ข e i j := by + intro L + obtain โŸจe, h_eโŸฉ := elementary_bilinear_forms_def b + have h_decomp : L = โˆ‘ i โˆˆ Finset.univ, โˆ‘ j โˆˆ Finset.univ, L (b i) (b j) โ€ข e i j := by + ext v w + have expansion := on_basis_expansions b L v w + have right_side := elementary_bilinear_forms_sum_apply b e h_e (ฮป i j => L (b i) (b j)) v w + rw [expansion, Finset.rearrange_double_sum_coefficients] + exact right_side.symm + exact โŸจe, โŸจh_e, h_decompโŸฉโŸฉ + +/-- Given two vectors `v` and `w`, `eval_vectors_continuousLinear v w` is the continuous linear map +that evaluates a bilinear form `B` at `(v, w)`. -/ +def eval_vectors_continuousLinear (v w : E) : + (E โ†’L[โ„] E โ†’L[โ„] โ„) โ†’L[โ„] โ„ := + { toFun := fun B => B v w, + map_add' := fun f g => by simp [ContinuousLinearMap.add_apply], + map_smul' := fun c f => by simp [ContinuousLinearMap.smul_apply] } + +namespace ContinuousLinearMap + +lemma map_sum_clm {R S M Mโ‚‚ : Type*} + [Semiring R] [Semiring S] [AddCommMonoid M] [AddCommMonoid Mโ‚‚] + {ฯƒ : R โ†’+* S} [Module R M] [Module S Mโ‚‚] (f : M โ†’โ‚›โ‚—[ฯƒ] Mโ‚‚) {ฮน : Type*} (t : Finset ฮน) + (g : ฮน โ†’ M) : f (โˆ‘ i โˆˆ t, g i) = โˆ‘ i โˆˆ t, f (g i) := + _root_.map_sum f g t + +lemma map_finset_sum {๐•œ : Type*} [NontriviallyNormedField ๐•œ] + {E F : Type*} [NormedAddCommGroup E] [NormedSpace ๐•œ E] + [NormedAddCommGroup F] [NormedSpace ๐•œ F] + (f : E โ†’L[๐•œ] F) {ฮน : Type*} (s : Finset ฮน) (g : ฮน โ†’ E) : + f (โˆ‘ i โˆˆ s, g i) = โˆ‘ i โˆˆ s, f (g i) := + _root_.map_sum f g s + +end ContinuousLinearMap From a7059af449639460fe16dea16fb496aabbbad69e Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Fri, 9 May 2025 19:29:11 +0200 Subject: [PATCH 27/32] fix lints --- .../Geometry/Manifold/Chart/BilinearSmoothness.lean | 4 ++-- PhysLean/Mathematics/LinearAlgebra/BilinearForm.lean | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PhysLean/Mathematics/Geometry/Manifold/Chart/BilinearSmoothness.lean b/PhysLean/Mathematics/Geometry/Manifold/Chart/BilinearSmoothness.lean index 8d928ce16..a5fd7fda9 100644 --- a/PhysLean/Mathematics/Geometry/Manifold/Chart/BilinearSmoothness.lean +++ b/PhysLean/Mathematics/Geometry/Manifold/Chart/BilinearSmoothness.lean @@ -47,8 +47,8 @@ lemma contDiffWithinAt_eval_bilinear_apply (hf : ContDiffWithinAt โ„ n f_bilin variable[FiniteDimensional โ„ E] lemma contDiffWithinAt_bilinear_apply_iff_forall_coord : - (โˆ€ v w, ContDiffWithinAt โ„ n (fun x => f_bilin x v w) s_set xโ‚€_pt) โ†’ - ContDiffWithinAt โ„ n f_bilin s_set xโ‚€_pt := by + (โˆ€ v w, ContDiffWithinAt โ„ n (fun x => f_bilin x v w) s_set xโ‚€_pt) โ†’ + ContDiffWithinAt โ„ n f_bilin s_set xโ‚€_pt := by intro h_comp rw [ContDiff.iff_forall_coord (V := E โ†’L[โ„] E โ†’L[โ„] โ„) (๐•œ := โ„)] intro ฯ† diff --git a/PhysLean/Mathematics/LinearAlgebra/BilinearForm.lean b/PhysLean/Mathematics/LinearAlgebra/BilinearForm.lean index 1ed42aeaa..60442e788 100644 --- a/PhysLean/Mathematics/LinearAlgebra/BilinearForm.lean +++ b/PhysLean/Mathematics/LinearAlgebra/BilinearForm.lean @@ -111,7 +111,7 @@ lemma on_basis_expansions (b.coord i v) * (b.coord j w) * L (b i) (b j) := by rw [vector_basis_expansion b v, vector_basis_expansion b w] rw [sum_mul_left_right L Finset.univ Finset.univ - (fun i => b.coord i v) b (fun j => b.coord j w) b] + (fun i => b.coord i v) b (fun j => b.coord j w) b] simp only [โ†vector_basis_expansion b v, โ†vector_basis_expansion b w] /-- The sum of elementary bilinear forms weighted by coefficients, From b7d97b9fa5e472a986a31e7a5376f6842ec1c01d Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Mon, 12 May 2025 14:07:23 +0200 Subject: [PATCH 28/32] Update Defs.lean --- PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean index 18e0abeec..ec4fbf467 100644 --- a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean @@ -5,7 +5,9 @@ Authors: Matteo Cipollina -/ import Mathlib.Algebra.Lie.OfAssociative -import Mathlib.MeasureTheory.Integral.IntervalIntegral +import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic +import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus +import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Defs /-! @@ -105,10 +107,10 @@ Riemannian metric. -/ noncomputable def tangentInnerCore (g : RiemannianMetric I n M) (x : M) : InnerProductSpace.Core โ„ (TangentSpace I x) where inner := ฮป v w => g.inner x v w - conj_symm := ฮป v w => by + conj_inner_symm := ฮป v w => by simp only [inner_apply, conj_trivial] exact g.toPseudoRiemannianMetric.symm x w v - nonneg_re := ฮป v => by + re_inner_nonneg := ฮป v => by simp only [inner_apply, RCLike.re_to_real] by_cases hv : v = 0 ยท simp [hv, inner_apply, map_zero] From 13dea2ecee932552145f04caeac8525fc261341f Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Mon, 12 May 2025 14:16:36 +0200 Subject: [PATCH 29/32] Update BilinearForm.lean --- PhysLean/Mathematics/LinearAlgebra/BilinearForm.lean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PhysLean/Mathematics/LinearAlgebra/BilinearForm.lean b/PhysLean/Mathematics/LinearAlgebra/BilinearForm.lean index 60442e788..029a7db87 100644 --- a/PhysLean/Mathematics/LinearAlgebra/BilinearForm.lean +++ b/PhysLean/Mathematics/LinearAlgebra/BilinearForm.lean @@ -112,7 +112,7 @@ lemma on_basis_expansions rw [vector_basis_expansion b v, vector_basis_expansion b w] rw [sum_mul_left_right L Finset.univ Finset.univ (fun i => b.coord i v) b (fun j => b.coord j w) b] - simp only [โ†vector_basis_expansion b v, โ†vector_basis_expansion b w] + simp only [โ† vector_basis_expansion b v, โ†vector_basis_expansion b w] /-- The sum of elementary bilinear forms weighted by coefficients, when applied to vectors, equals a weighted sum of the products of From 63a4eba75f32ff6a5b0c33d3463458f9e9f845fb Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Mon, 12 May 2025 14:23:03 +0200 Subject: [PATCH 30/32] Update BilinearForm.lean --- PhysLean/Mathematics/LinearAlgebra/BilinearForm.lean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PhysLean/Mathematics/LinearAlgebra/BilinearForm.lean b/PhysLean/Mathematics/LinearAlgebra/BilinearForm.lean index 029a7db87..06e7bc63b 100644 --- a/PhysLean/Mathematics/LinearAlgebra/BilinearForm.lean +++ b/PhysLean/Mathematics/LinearAlgebra/BilinearForm.lean @@ -112,7 +112,7 @@ lemma on_basis_expansions rw [vector_basis_expansion b v, vector_basis_expansion b w] rw [sum_mul_left_right L Finset.univ Finset.univ (fun i => b.coord i v) b (fun j => b.coord j w) b] - simp only [โ† vector_basis_expansion b v, โ†vector_basis_expansion b w] + simp only [โ† vector_basis_expansion b v, โ† vector_basis_expansion b w] /-- The sum of elementary bilinear forms weighted by coefficients, when applied to vectors, equals a weighted sum of the products of From fe9d0fe648183aae86619529d6ed23a75a03859e Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Mon, 12 May 2025 14:57:25 +0200 Subject: [PATCH 31/32] Update Chart.lean --- .../Metric/PseudoRiemannian/Chart.lean | 55 ++++++++++++------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Chart.lean b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Chart.lean index 66c1c43bb..32e6ac0a1 100644 --- a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Chart.lean +++ b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Chart.lean @@ -12,8 +12,12 @@ import PhysLean.Mathematics.LinearAlgebra.BilinearForm /-! # Pseudo-Riemannian Metric in Chart Coordinates -This file defines `chartMetric`, which expresses a pseudo-Riemannian metric in local chart -coordinates, and proves its transformation properties under coordinate changes. +This file defines `chartMetric`, which expresses a pseudo-Riemannian metric `g` +on a manifold `M` in local chart coordinates `e`. It establishes the +tensor transformation law for `chartMetric` under a change of chart, +`chartMetric_coord_change`. Auxiliary lemmas concern the smoothness of +bilinear forms when viewed as maps into function spaces, and properties +of chart transitions necessary for proving the main transformation result. -/ namespace PseudoRiemannianMetric @@ -24,10 +28,10 @@ open BilinearForm PartialHomeomorph ContinuousLinearMap PartialEquiv ContDiff Ma open Filter variable {E : Type v} {M : Type v} {n : WithTop โ„•โˆž} -variable [NormedAddCommGroup E] [NormedSpace โ„ E] --[FiniteDimensional โ„ E] -variable [TopologicalSpace M] [ChartedSpace E M] --[T2Space M] -variable {I : ModelWithCorners โ„ E E} --[ModelWithCorners.Boundaryless I] -variable [inst_mani_smooth : IsManifold I (n + 1) M] -- For C^{n+1} manifold for C^n metric +variable [NormedAddCommGroup E] [NormedSpace โ„ E] +variable [TopologicalSpace M] [ChartedSpace E M] +variable {I : ModelWithCorners โ„ E E} +variable [inst_mani_smooth : IsManifold I (n + 1) M] variable [inst_tangent_findim : โˆ€ (x : M), FiniteDimensional โ„ (TangentSpace I x)] noncomputable instance (x : M) : NormedAddCommGroup (TangentSpace I x) := @@ -36,9 +40,16 @@ noncomputable instance (x : M) : NormedAddCommGroup (TangentSpace I x) := noncomputable instance (x : M) : NormedSpace โ„ (TangentSpace I x) := show NormedSpace โ„ E from inferInstance -/-- Given a pseudo-Riemannian metric `g` and a partial homeomorphism `e`, computes the metric -in the chart coordinates. At a point `y` in the target of `e`, the result is the pullback of -the metric at `e.symm y` by the derivative of `e.symm` at `y`. -/ +/-- Given a pseudo-Riemannian metric `g` on a manifold `M` and a chart `e : PartialHomeomorph M E`, +`chartMetric g e y` computes the metric tensor in the local coordinates provided by `e`. +Let `x := e.symm y` be the point on `M` corresponding to chart coordinates `y : E`. +Let `Df_y := mfderiv I I e.symm y : E โ†’L[โ„] TangentSpace I x` be the differential of `e.symm` at +`y`. Then `chartMetric g e y` is the bilinear form on `E` defined as the pullback of `g.val x` by +`Df_y`. That is, for `v, w : E`, `(chartMetric g e y) v w = g.val x (Df_y v) (Df_y w)`. +If `(b_i)` is a basis for `E`, then the values `(chartMetric g e y) (b_i) (b_j)` are the +components `g_{ij}(y)` of the metric `g` at `x` with respect to the basis for `T_xM` +induced by `(b_i)` via `Df_y`. +If `y โˆ‰ e.target`, the result is defined as the zero bilinear form. -/ def chartMetric (g : PseudoRiemannianMetric E E M n I) (e : PartialHomeomorph M E) (y : E) : E โ†’L[โ„] E โ†’L[โ„] โ„ := letI := Classical.propDecidable @@ -50,6 +61,8 @@ def chartMetric (g : PseudoRiemannianMetric E E M n I) (e : PartialHomeomorph M BilinearForm.pullback (g.val x) Df) (fun _ => (0 : E โ†’L[โ„] E โ†’L[โ„] โ„)) +/-- Evaluation of `chartMetric` at `y โˆˆ e.target`. +For `v, w : E`, `chartMetric g e y v w = g_x(D(eโปยน)_y v, D(eโปยน)_y w)`, where `x = eโปยนy`. -/ @[simp] lemma chartMetric_apply_of_mem (g : PseudoRiemannianMetric E E M n I) (e : PartialHomeomorph M E) {y : E} (hy : y โˆˆ e.target) (v w : E) : @@ -59,6 +72,7 @@ lemma chartMetric_apply_of_mem (g : PseudoRiemannianMetric E E M n I) (e : Parti simp only [BilinearForm.pullback, ContinuousLinearMap.bilinearComp_apply] exact rfl +/-- If `y โˆ‰ e.target`, `chartMetric g e y` is the zero bilinear form. -/ lemma chartMetric_apply_of_not_mem (g : PseudoRiemannianMetric E E M n I) (e : PartialHomeomorph M E) @@ -66,7 +80,10 @@ lemma chartMetric_apply_of_not_mem chartMetric g e y v w = 0 := by simp only [chartMetric, hy, โ†“reduceDIte, ContinuousLinearMap.zero_apply] -/-- The value of a metric in chart coordinates at corresponding points. -/ +/-- The metric `g_x(D(eโปยน)_y v, D(eโปยน)_y w)` can be expressed using a second chart `e'` +via the chain rule for `D(eโปยน) = D(e'โปยน) โˆ˜ D(ฯ†)`. +`x` is a point on the manifold, `y = ex`, `y' = e'x`. +`ฯ† = e' โˆ˜ eโปยน` is the transition map. `1 โ‰ค n`. -/ lemma chartMetric_at_corresponding_points (g : PseudoRiemannianMetric E E M n I) (e e' : PartialHomeomorph M E) (x : M) (hx_e : x โˆˆ e.source) (hx_e' : x โˆˆ e'.source) @@ -86,7 +103,9 @@ lemma chartMetric_at_corresponding_points (g : PseudoRiemannianMetric E E M n I) rw [h_chain] congr -/-- The relationship between chart metrics under coordinate change. -/ +/-- Transformation law for the metric components under chart change. + `g_e(y)(v,w) = g_{e'}(y')(D(ฯ†)_y v, D(ฯ†)_y w)`, where `y = ex`, `y' = e'x`, `ฯ† = e' โˆ˜ eโปยน`. + Assumes `e, e'` are in a `C^n` maximal atlas (`1 โ‰ค n`). -/ lemma chartMetric_bilinear_pullback (g : PseudoRiemannianMetric E E M n I) (e e' : PartialHomeomorph M E) (x : M) (hx_e : x โˆˆ e.source) (hx_e' : x โˆˆ e'.source) @@ -114,15 +133,11 @@ lemma chartMetric_bilinear_pullback (g : PseudoRiemannianMetric E E M n I) rw [h_phi_def] exact chartMetric_at_corresponding_points g e e' x hx_e hx_e' hmani hn1 he he' v w -/-- -The metric tensor transformation law under chart changes. - -This theorem states that the representation of a pseudo-Riemannian metric in different charts -are related by the pullback of the coordinate transformation between these charts. -Specifically, if `e` and `e'` are two charts containing a point `x_pt`, then the metric -expressed in chart `e` equals the pullback of the metric expressed in chart `e'` -by the differential of the transition map from `e` to `e'`. --/ +/-- Transformation law for `chartMetric`: `(g_e)_y = ((e'โˆ˜eโปยน)^* (g_{e'})_{e'y})_y`. +Given a metric `g`, and two charts `e, e'`, the representation of `g` in chart `e` at `y = ex` +is the pullback by the transition map `ฯ† = e' โˆ˜ eโปยน` (evaluated at `y`) +of the representation of `g` in chart `e'` (evaluated at `y' = e'x = ฯ†y`). +Assumes charts are `C^n` compatible, `1 โ‰ค n`. -/ theorem chartMetric_coord_change (g : PseudoRiemannianMetric E E M n I) (e e' : PartialHomeomorph M E) (x_pt : M) From 486cedf0f93c47e3f0a323b82c0f5ce465f2ab8b Mon Sep 17 00:00:00 2001 From: Matteo Cipollina Date: Mon, 12 May 2025 15:59:24 +0200 Subject: [PATCH 32/32] fix lint --- PhysLean.lean | 2 +- .../Mathematics/Geometry/Metric/PseudoRiemannian/Chart.lean | 2 +- PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PhysLean.lean b/PhysLean.lean index 5346f18f0..621f78fac 100644 --- a/PhysLean.lean +++ b/PhysLean.lean @@ -18,11 +18,11 @@ import PhysLean.Electromagnetism.Homogeneous import PhysLean.Electromagnetism.LorentzAction import PhysLean.Electromagnetism.MaxwellEquations import PhysLean.Electromagnetism.Wave +import PhysLean.Mathematics.LinearAlgebra.BilinearForm import PhysLean.Mathematics.Analysis.ContDiff import PhysLean.Mathematics.FDerivCurry import PhysLean.Mathematics.Fin import PhysLean.Mathematics.Fin.Involutions -import PhysLean.Mathematics.LinearAlgebra.BilinearForm import PhysLean.Mathematics.Geometry.Manifold.PartialHomeomorph import PhysLean.Mathematics.Geometry.Manifold.Chart.Utilities import PhysLean.Mathematics.Geometry.Manifold.Chart.BilinearSmoothness diff --git a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Chart.lean b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Chart.lean index 32e6ac0a1..3bd811af9 100644 --- a/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Chart.lean +++ b/PhysLean/Mathematics/Geometry/Metric/PseudoRiemannian/Chart.lean @@ -5,9 +5,9 @@ Authors: Matteo Cipollina -/ import Mathlib.Algebra.Lie.OfAssociative +import PhysLean.Mathematics.LinearAlgebra.BilinearForm import PhysLean.Mathematics.Geometry.Manifold.Chart.Smoothness import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Defs -import PhysLean.Mathematics.LinearAlgebra.BilinearForm /-! # Pseudo-Riemannian Metric in Chart Coordinates diff --git a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean index ec4fbf467..2974fb6af 100644 --- a/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean +++ b/PhysLean/Mathematics/Geometry/Metric/Riemannian/Defs.lean @@ -8,7 +8,7 @@ import Mathlib.Algebra.Lie.OfAssociative import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus import Mathlib.MeasureTheory.Integral.IntervalIntegral.IntegrationByParts -import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Defs +import PhysLean.Mathematics.Geometry.Metric.PseudoRiemannian.Chart /-! # Riemannian Metric Definitions