cfahlgren1/math / lean /OAI /Geometry /Manifold /ProjectiveSphere.lean
cfahlgren1's picture
download
raw
13.4 kB
import Mathlib
namespace OAI
noncomputable section
open scoped Manifold ContDiff BigOperators ENNReal
open Bundle
namespace EinsteinFour
abbrev FourSpace := EuclideanSpace ℝ (Fin 4)
abbrev I4 := π“˜(ℝ, FourSpace)
def coordinateVector (i : Fin 4) : FourSpace := EuclideanSpace.single i 1
abbrev RoundSphere4 := {x : EuclideanSpace ℝ (Fin 5) // β€–xβ€– = 1}
abbrev ComplexProjective2 := Projectivization β„‚ (EuclideanSpace β„‚ (Fin 3))
abbrev RealProjective4 := Projectivization ℝ (EuclideanSpace ℝ (Fin 5))
def roundDistance (p q : RoundSphere4) : ℝ :=
Real.arccos (inner ℝ p.val q.val)
def fubiniStudyDistance (p q : ComplexProjective2) : ℝ :=
Real.arccos (β€–inner β„‚ p.rep q.repβ€– / (β€–p.repβ€– * β€–q.repβ€–))
def realProjectiveDistance (p q : RealProjective4) : ℝ :=
Real.arccos (β€–inner ℝ p.rep q.repβ€– / (β€–p.repβ€– * β€–q.repβ€–))
section Metric
variable (M : Type*) [TopologicalSpace M] [ChartedSpace FourSpace M]
[IsManifold I4 ∞ M]
abbrev SmoothMetric :=
ContMDiffRiemannianMetric I4 ∞ FourSpace (TangentSpace I4 : M β†’ Type _)
variable {M}
def metricInChart (g : SmoothMetric M) (c : M) (z : FourSpace) :
Matrix (Fin 4) (Fin 4) ℝ :=
let e := chartAt FourSpace c
let d := mfderiv I4 I4 e.symm z
fun i j => g.inner (e.symm z) (d (coordinateVector i)) (d (coordinateVector j))
def partialDeriv (f : FourSpace β†’ ℝ) (i : Fin 4) (z : FourSpace) : ℝ :=
fderiv ℝ f z (coordinateVector i)
def christoffel (g : SmoothMetric M) (c : M) (z : FourSpace)
(k i j : Fin 4) : ℝ :=
(1 / 2 : ℝ) * βˆ‘ l : Fin 4, (metricInChart g c z)⁻¹ k l *
(partialDeriv (fun w => metricInChart g c w j l) i z +
partialDeriv (fun w => metricInChart g c w i l) j z -
partialDeriv (fun w => metricInChart g c w i j) l z)
def curvatureComponent (g : SmoothMetric M) (c : M) (z : FourSpace)
(l i j k : Fin 4) : ℝ :=
partialDeriv (fun w => christoffel g c w l j k) i z -
partialDeriv (fun w => christoffel g c w l i k) j z +
βˆ‘ p : Fin 4,
(christoffel g c z l i p * christoffel g c z p j k -
christoffel g c z l j p * christoffel g c z p i k)
def ricciInChart (g : SmoothMetric M) (c : M) (z : FourSpace)
(i j : Fin 4) : ℝ :=
βˆ‘ k : Fin 4, curvatureComponent g c z k k i j
def sectionalNumerator (g : SmoothMetric M) (c : M) (z : FourSpace)
(u v : FourSpace) : ℝ :=
βˆ‘ l : Fin 4, βˆ‘ m : Fin 4, βˆ‘ i : Fin 4, βˆ‘ j : Fin 4, βˆ‘ k : Fin 4,
metricInChart g c z l m * curvatureComponent g c z l i j k *
u i * v j * v k * u m
def IsEinstein (g : SmoothMetric M) : Prop :=
βˆƒ lam : ℝ, βˆ€ (c : M) (i j : Fin 4),
ricciInChart g c (chartAt FourSpace c c) i j =
lam * metricInChart g c (chartAt FourSpace c c) i j
def HasPositiveSectionalCurvature (g : SmoothMetric M) : Prop :=
βˆ€ (c : M) (u v : FourSpace), LinearIndependent ℝ ![u, v] β†’
0 < sectionalNumerator g c (chartAt FourSpace c c) u v
def scaledEDistance (g : SmoothMetric M) (a : ℝ) (x y : M) : ℝβ‰₯0∞ :=
letI : RiemannianBundle (TangentSpace I4 : M β†’ Type _) := ⟨g.toRiemannianMetric⟩
ENNReal.ofReal (Real.sqrt a) * Manifold.riemannianEDist I4 x y
def ScaledIsometricTo {N : Type*} (g : SmoothMetric M) (a : ℝ)
(modelDistance : N β†’ N β†’ ℝ) : Prop :=
βˆƒ f : M ≃ N, βˆ€ x y : M,
ENNReal.ofReal (modelDistance (f x) (f y)) = scaledEDistance g a x y
end Metric
section SphereInvolution
variable {E : Type*} [NormedAddCommGroup E]
abbrev UnitSphere (E : Type*) [NormedAddCommGroup E] := {x : E // β€–xβ€– = 1}
def antipode (x : UnitSphere E) : UnitSphere E :=
⟨-x.val, by simpa using x.property⟩
@[simp] theorem antipode_val (x : UnitSphere E) : (antipode x).val = -x.val := rfl
@[simp] theorem antipode_antipode (x : UnitSphere E) : antipode (antipode x) = x := by
apply Subtype.ext
simp
theorem unitSphere_ne_zero (x : UnitSphere E) : x.val β‰  0 := by
intro h
have hx := x.property
simp [h] at hx
variable [InnerProductSpace ℝ E]
theorem antipode_ne_self (x : UnitSphere E) : antipode x β‰  x := by
intro h
have h' : -x.val = x.val := congrArg Subtype.val h
have hz : x.val = 0 := by
have hh : (2 : ℝ) β€’ x.val = 0 := by
calc
(2 : ℝ) β€’ x.val = x.val + x.val := by module
_ = -x.val + x.val := by rw [h']
_ = 0 := neg_add_cancel x.val
exact (smul_eq_zero.mp hh).resolve_left (by norm_num)
exact unitSphere_ne_zero x hz
theorem sphere_involution_antipodal
(Ο„ : UnitSphere E β†’ UnitSphere E)
(hΟ„ : Function.Involutive Ο„)
(hinner : βˆ€ x y, inner ℝ (Ο„ x).val (Ο„ y).val = inner ℝ x.val y.val)
(hfree : βˆ€ x, Ο„ x β‰  x) :
βˆ€ x, Ο„ x = antipode x := by
intro x
apply Subtype.ext
change (Ο„ x).val = -x.val
by_contra hneg
have hv : x.val + (Ο„ x).val β‰  0 := by
intro hz
exact hneg (eq_neg_of_add_eq_zero_right hz)
let r : ℝ := β€–x.val + (Ο„ x).valβ€–
have hr : 0 < r := norm_pos_iff.mpr hv
let z : UnitSphere E :=
⟨r⁻¹ β€’ (x.val + (Ο„ x).val), by
rw [norm_smul, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr hr)]
exact inv_mul_cancelβ‚€ (ne_of_gt hr)⟩
have hzx := hinner z x
have hzΟ„x := hinner z (Ο„ x)
rw [hΟ„ x] at hzΟ„x
have hzinner : inner ℝ (Ο„ z).val z.val = inner ℝ z.val z.val := by
change inner ℝ (Ο„ z).val (r⁻¹ β€’ (x.val + (Ο„ x).val)) =
inner ℝ z.val (r⁻¹ β€’ (x.val + (Ο„ x).val))
simp only [inner_smul_right, inner_add_right]
rw [hzx, hzΟ„x, add_comm]
have hzfixed : Ο„ z = z := by
apply Subtype.ext
apply sub_eq_zero.mp
apply (inner_self_eq_zero (π•œ := ℝ)).mp
have hzinner' : inner ℝ z.val (Ο„ z).val = inner ℝ z.val z.val :=
(real_inner_comm (Ο„ z).val z.val).trans hzinner
simp only [inner_sub_left, inner_sub_right, hinner z z, hzinner, hzinner',
sub_self]
exact hfree z hzfixed
end SphereInvolution
theorem round_distance_preserving_inner
(Ο„ : RoundSphere4 β†’ RoundSphere4)
(h : βˆ€ x y, roundDistance (Ο„ x) (Ο„ y) = roundDistance x y) :
βˆ€ x y, inner ℝ (Ο„ x).val (Ο„ y).val = inner ℝ x.val y.val := by
have bounds (x y : RoundSphere4) :
-(1 : ℝ) ≀ inner ℝ x.val y.val ∧ inner ℝ x.val y.val ≀ 1 := by
apply abs_le.mp
simpa [x.property, y.property] using abs_real_inner_le_norm x.val y.val
intro x y
have heq := congrArg Real.cos (h x y)
dsimp only [roundDistance] at heq
rw [Real.cos_arccos (bounds (Ο„ x) (Ο„ y)).1 (bounds (Ο„ x) (Ο„ y)).2,
Real.cos_arccos (bounds x y).1 (bounds x y).2] at heq
exact heq
theorem free_round_involution_eq_antipode
(Ο„ : RoundSphere4 β†’ RoundSphere4)
(hΟ„ : Function.Involutive Ο„)
(hDistance : βˆ€ x y, roundDistance (Ο„ x) (Ο„ y) = roundDistance x y)
(hfree : βˆ€ x, Ο„ x β‰  x) : Ο„ = antipode := by
funext x
exact sphere_involution_antipodal Ο„ hΟ„
(round_distance_preserving_inner Ο„ hDistance) hfree x
section ProjectiveDistance
variable {π•œ E : Type*} [RCLike π•œ] [NormedAddCommGroup E] [InnerProductSpace π•œ E]
theorem normalized_inner_smul (x y : E) (a b : π•œ) (ha : a β‰  0) (hb : b β‰  0) :
β€–inner π•œ (a β€’ x) (b β€’ y)β€– / (β€–a β€’ xβ€– * β€–b β€’ yβ€–) =
β€–inner π•œ x yβ€– / (β€–xβ€– * β€–yβ€–) := by
simp only [inner_smul_left, inner_smul_right, norm_mul, RCLike.norm_conj, norm_smul]
calc
β€–bβ€– * (β€–aβ€– * β€–inner π•œ x yβ€–) / (β€–aβ€– * β€–xβ€– * (β€–bβ€– * β€–yβ€–)) =
(β€–aβ€– * β€–bβ€–) * β€–inner π•œ x yβ€– / ((β€–aβ€– * β€–bβ€–) * (β€–xβ€– * β€–yβ€–)) := by
congr 1 <;> ring
_ = _ := mul_div_mul_left _ _ (mul_ne_zero (norm_ne_zero_iff.mpr ha)
(norm_ne_zero_iff.mpr hb))
theorem normalized_inner_mk_rep (x y : E) (hx : x β‰  0) (hy : y β‰  0) :
β€–inner π•œ (Projectivization.mk π•œ x hx).rep (Projectivization.mk π•œ y hy).repβ€– /
(β€–(Projectivization.mk π•œ x hx).repβ€– * β€–(Projectivization.mk π•œ y hy).repβ€–) =
β€–inner π•œ x yβ€– / (β€–xβ€– * β€–yβ€–) := by
obtain ⟨a, ha⟩ := Projectivization.exists_smul_eq_mk_rep π•œ x hx
obtain ⟨b, hb⟩ := Projectivization.exists_smul_eq_mk_rep π•œ y hy
rw [← ha, ← hb]
exact normalized_inner_smul x y (a : π•œ) (b : π•œ) a.ne_zero b.ne_zero
end ProjectiveDistance
theorem fubiniStudyDistance_mk (x y : EuclideanSpace β„‚ (Fin 3))
(hx : x β‰  0) (hy : y β‰  0) :
fubiniStudyDistance (Projectivization.mk β„‚ x hx) (Projectivization.mk β„‚ y hy) =
Real.arccos (β€–inner β„‚ x yβ€– / (β€–xβ€– * β€–yβ€–)) := by
rw [fubiniStudyDistance, normalized_inner_mk_rep]
theorem realProjectiveDistance_mk (x y : EuclideanSpace ℝ (Fin 5))
(hx : x β‰  0) (hy : y β‰  0) :
realProjectiveDistance (Projectivization.mk ℝ x hx) (Projectivization.mk ℝ y hy) =
Real.arccos (β€–inner ℝ x yβ€– / (β€–xβ€– * β€–yβ€–)) := by
rw [realProjectiveDistance, normalized_inner_mk_rep]
section AntipodalQuotient
variable {E : Type*} [NormedAddCommGroup E] [InnerProductSpace ℝ E]
def sphereToProjective (x : UnitSphere E) : Projectivization ℝ E :=
Projectivization.mk ℝ x.val (unitSphere_ne_zero x)
theorem sphereToProjective_surjective :
Function.Surjective (sphereToProjective : UnitSphere E β†’ Projectivization ℝ E) := by
intro p
have hp : 0 < β€–p.repβ€– := norm_pos_iff.mpr p.rep_nonzero
let x : UnitSphere E := βŸ¨β€–p.rep‖⁻¹ β€’ p.rep, by
rw [norm_smul, Real.norm_eq_abs, abs_of_pos (inv_pos.mpr hp)]
exact inv_mul_cancelβ‚€ (ne_of_gt hp)⟩
refine ⟨x, ?_⟩
change Projectivization.mk ℝ x.val (unitSphere_ne_zero x) = p
conv_rhs => rw [← p.mk_rep]
refine (Projectivization.mk_eq_mk_iff' ℝ _ _ _ _).mpr βŸ¨β€–p.rep‖⁻¹, rfl⟩
theorem sphereToProjective_eq_iff (x y : UnitSphere E) :
sphereToProjective x = sphereToProjective y ↔ x = y ∨ x = antipode y := by
rw [sphereToProjective, sphereToProjective, Projectivization.mk_eq_mk_iff']
constructor
· rintro ⟨a, ha⟩
have habs := congrArg norm ha
simp only [norm_smul, Real.norm_eq_abs, x.property, y.property, mul_one] at habs
have ha' : a = 1 ∨ a = -1 := by
rcases le_total 0 a with h | h
Β· left
rwa [abs_of_nonneg h] at habs
Β· right
rw [abs_of_nonpos h] at habs
linarith
rcases ha' with ha' | ha'
Β· left
apply Subtype.ext
simpa [ha'] using ha.symm
Β· right
apply Subtype.ext
simpa [ha'] using ha.symm
Β· rintro (h | h)
· exact ⟨1, by simpa using (congrArg Subtype.val h).symm⟩
· exact ⟨-1, by simpa using (congrArg Subtype.val h).symm⟩
def antipodalSetoid (E : Type*) [NormedAddCommGroup E] [InnerProductSpace ℝ E] :
Setoid (UnitSphere E) where
r x y := x = y ∨ x = antipode y
iseqv := {
refl := fun _ => Or.inl rfl
symm := fun h => sphereToProjective_eq_iff _ _ |>.mp
((sphereToProjective_eq_iff _ _).mpr h).symm
trans := fun h₁ hβ‚‚ => (sphereToProjective_eq_iff _ _).mp
(((sphereToProjective_eq_iff _ _).mpr h₁).trans
((sphereToProjective_eq_iff _ _).mpr hβ‚‚)) }
def antipodalQuotientEquiv : Quotient (antipodalSetoid E) ≃ Projectivization ℝ E :=
Equiv.ofBijective
(Quotient.lift sphereToProjective fun x y h => (sphereToProjective_eq_iff x y).mpr h)
(by
constructor
Β· intro x y h
induction x using Quotient.inductionOn with | h x =>
induction y using Quotient.inductionOn with | h y =>
exact Quotient.sound ((sphereToProjective_eq_iff x y).mp h)
Β· intro p
obtain ⟨x, hx⟩ := sphereToProjective_surjective (E := E) p
exact ⟨Quotient.mk _ x, hx⟩)
@[simp] theorem antipodalQuotientEquiv_mk (x : UnitSphere E) :
antipodalQuotientEquiv (Quotient.mk (antipodalSetoid E) x) = sphereToProjective x := rfl
end AntipodalQuotient
theorem realProjectiveDistance_sphere (x y : RoundSphere4) :
realProjectiveDistance (sphereToProjective x) (sphereToProjective y) =
Real.arccos |inner ℝ x.val y.val| := by
rw [sphereToProjective, sphereToProjective, realProjectiveDistance_mk,
x.property, y.property, mul_one, div_one, Real.norm_eq_abs]
theorem realProjectiveDistance_eq_min (x y : RoundSphere4) :
realProjectiveDistance (sphereToProjective x) (sphereToProjective y) =
min (roundDistance x y) (roundDistance x (antipode y)) := by
rw [realProjectiveDistance_sphere]
simp only [roundDistance, antipode_val, inner_neg_right]
by_cases h : 0 ≀ inner ℝ x.val y.val
Β· rw [abs_of_nonneg h, min_eq_left]
exact Real.antitone_arccos (by linarith)
Β· rw [abs_of_neg (lt_of_not_ge h), min_eq_right]
exact Real.antitone_arccos (by linarith)
theorem free_round_involution_projective_fibers_and_distance
(Ο„ : RoundSphere4 β†’ RoundSphere4)
(hΟ„ : Function.Involutive Ο„)
(hDistance : βˆ€ x y, roundDistance (Ο„ x) (Ο„ y) = roundDistance x y)
(hfree : βˆ€ x, Ο„ x β‰  x) :
(βˆ€ x y, sphereToProjective x = sphereToProjective y ↔ x = y ∨ x = Ο„ y) ∧
(βˆ€ x y, realProjectiveDistance (sphereToProjective x) (sphereToProjective y) =
min (roundDistance x y) (roundDistance x (Ο„ y))) := by
rw [free_round_involution_eq_antipode Ο„ hΟ„ hDistance hfree]
exact ⟨sphereToProjective_eq_iff, realProjectiveDistance_eq_min⟩
end EinsteinFour
end
end OAI

Xet Storage Details

Size:
13.4 kB
Β·
Xet hash:
1d7907449c0b03697a5645dc555136a71045242a661eaab1f4e562619fddcc79

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.