import OAI.AlgebraicGeometry.CycleClass.Geometric.Point import Mathlib.Topology.Instances.Discrete import Mathlib.LinearAlgebra.DFinsupp /-! # Zero Sphere -/ namespace OAI.AlgebraicGeometry.CycleClass.Geometric.ZeroSphere.Cycles noncomputable section /-!+# Integral singular homology of the zero-sphere The two-point discrete space has genuine singular homology `ℤ²` in degree zero and zero in positive degrees. The augmentation is the sum of the two coordinates, so its kernel is freely generated by the difference of the point classes. This is a base case for sphere calculations, not a general fundamental-class construction. -/ open _root_.CategoryTheory _root_.CategoryTheory.Limits _root_.AlgebraicTopology open scoped Simplicial /-- Every path in a discrete space has equal endpoints. -/ theorem path_endpoints_eq_of_discrete {X : Type*} [TopologicalSpace X] [DiscreteTopology X] {x y : X} (p : Path x y) : x = y := by have h := (inferInstance : PreconnectedSpace unitInterval).constant p.continuous (x := 0) (y := 1) simpa using h /-- Path components of a discrete space are its individual points. -/ def discreteZerothHomotopyEquiv (X : Type*) [TopologicalSpace X] [DiscreteTopology X] : ZerothHomotopy X ≃ X where toFun := ZerothHomotopy.lift id (by intro x y p exact path_endpoints_eq_of_discrete p) invFun := ZerothHomotopy.mk left_inv z := by induction z; rfl right_inv _ := rfl @[simp] theorem discreteZerothHomotopyEquiv_mk (X : Type*) [TopologicalSpace X] [DiscreteTopology X] (x : X) : discreteZerothHomotopyEquiv X (ZerothHomotopy.mk x) = x := rfl /-- The zero-sphere as an actual two-point discrete topological space. -/ abbrev zeroSphere : TopCat.{0} := @TopCat.of (Fin 2) ⊥ instance zeroSphere_discreteTopology : DiscreteTopology zeroSphere := ⟨rfl⟩ /-- The two singular path components of the zero-sphere, labelled by its points. -/ def zeroSphereComponentEquiv : (TopCat.toSSet.obj zeroSphere).π₀ ≃ Fin 2 := TopCat.zerothHomotopyEquiv.symm.trans (discreteZerothHomotopyEquiv zeroSphere) @[simp] theorem zeroSphereComponentEquiv_mk (i : Fin 2) : zeroSphereComponentEquiv (SSet.π₀.mk ((TopCat.toSSetObj₀Equiv (X := zeroSphere)).symm i)) = i := by change discreteZerothHomotopyEquiv zeroSphere (TopCat.zerothHomotopyEquiv.symm (SSet.π₀.mk ((TopCat.toSSetObj₀Equiv (X := zeroSphere)).symm i))) = i rw [TopCat.zerothHomotopyEquiv_symm_mk] simp /-- The concrete realization of a two-fold coproduct of integer modules. -/ def twoIntegerCoproductIso : (∐ fun _ : Fin 2 ↦ ModuleCat.of ℤ ℤ) ≅ ModuleCat.of ℤ (Fin 2 → ℤ) := ModuleCat.coprodIsoDirectSum (fun _ : Fin 2 ↦ ModuleCat.of ℤ ℤ) ≪≫ (DirectSum.linearEquivFunOnFintype ℤ (Fin 2) (fun _ ↦ ℤ)).toModuleIso /-- Sum of the two integer coordinates. -/ def twoIntegerSum : ModuleCat.of ℤ (Fin 2 → ℤ) ⟶ ModuleCat.of ℤ ℤ := ModuleCat.ofHom ((LinearMap.proj (0 : Fin 2) : (Fin 2 → ℤ) →ₗ[ℤ] ℤ) + LinearMap.proj 1) @[simp] theorem twoIntegerSum_apply (v : Fin 2 → ℤ) : twoIntegerSum v = v 0 + v 1 := rfl @[simp] theorem twoIntegerCoproductIso_ι_apply (i : Fin 2) (n : ℤ) : twoIntegerCoproductIso.hom (Sigma.ι (fun _ : Fin 2 ↦ ModuleCat.of ℤ ℤ) i n) = Pi.single i n := by have h := ModuleCat.ι_coprodIsoDirectSum_hom (fun _ : Fin 2 ↦ ModuleCat.of ℤ ℤ) i have hv := congrArg (fun f ↦ f n) h change (DirectSum.linearEquivFunOnFintype ℤ (Fin 2) (fun _ ↦ ℤ)) ((ModuleCat.coprodIsoDirectSum (fun _ : Fin 2 ↦ ModuleCat.of ℤ ℤ)).hom (Sigma.ι (fun _ : Fin 2 ↦ ModuleCat.of ℤ ℤ) i n)) = _ rw [show (ModuleCat.coprodIsoDirectSum (fun _ : Fin 2 ↦ ModuleCat.of ℤ ℤ)).hom (Sigma.ι (fun _ : Fin 2 ↦ ModuleCat.of ℤ ℤ) i n) = DirectSum.lof ℤ (Fin 2) (fun _ ↦ ℤ) i n from hv] exact DirectSum.linearEquivFunOnFintype_lof ℤ (ι := Fin 2) (M := fun _ ↦ ℤ) i n theorem twoIntegerCoproductIso_sum : twoIntegerCoproductIso.hom ≫ twoIntegerSum = Sigma.desc (fun _ : Fin 2 ↦ 𝟙 (ModuleCat.of ℤ ℤ)) := by apply Sigma.hom_ext intro i simp only [Sigma.ι_comp_desc] apply ModuleCat.hom_ext apply LinearMap.ext intro n change twoIntegerSum (twoIntegerCoproductIso.hom (Sigma.ι (fun _ : Fin 2 ↦ ModuleCat.of ℤ ℤ) i n)) = n rw [twoIntegerCoproductIso_ι_apply, twoIntegerSum_apply] fin_cases i <;> simp /-- The actual integral singular homology group of the zero-sphere in degree zero. -/ abbrev zeroSphereH0 : ModuleCat.{0} ℤ := (LocalHomology.Cycles.integralSingularChains zeroSphere).homology 0 /-- Relabelling the singular components by the two actual points. -/ def zeroSphereComponentCoproductIso : (∐ fun _ : (TopCat.toSSet.obj zeroSphere).π₀ ↦ ModuleCat.of ℤ ℤ) ≅ (∐ fun _ : Fin 2 ↦ ModuleCat.of ℤ ℤ) := (sigmaConst.obj (ModuleCat.of ℤ ℤ)).mapIso zeroSphereComponentEquiv.toIso theorem zeroSphereComponentCoproductIso_sum : zeroSphereComponentCoproductIso.hom ≫ Sigma.desc (fun _ : Fin 2 ↦ 𝟙 (ModuleCat.of ℤ ℤ)) = Sigma.desc (fun _ : (TopCat.toSSet.obj zeroSphere).π₀ ↦ 𝟙 (ModuleCat.of ℤ ℤ)) := by apply Sigma.hom_ext intro c simp [zeroSphereComponentCoproductIso, sigmaConst] /-- The canonical component description gives the two integer coordinates of H₀. -/ def zeroSphereH0Iso : zeroSphereH0 ≅ ModuleCat.of ℤ (Fin 2 → ℤ) := by let e := (TopCat.toSSet.obj zeroSphere).homology₀Iso (ModuleCat.of ℤ ℤ) exact e ≪≫ zeroSphereComponentCoproductIso ≪≫ twoIntegerCoproductIso /-- The canonical integer-coordinate linear equivalence for genuine H₀. -/ def zeroSphereCoordinates : zeroSphereH0 ≃ₗ[ℤ] (Fin 2 → ℤ) := zeroSphereH0Iso.toLinearEquiv /-- The ordinary singular-homology augmentation, with no change of definition. -/ def zeroSphereAugmentation : zeroSphereH0 ⟶ ModuleCat.of ℤ ℤ := by let f := zeroSphere.singularHomology₀ε (C := ModuleCat.{0} ℤ) (ModuleCat.of ℤ ℤ) exact f set_option backward.isDefEq.respectTransparency false in theorem zeroSphereH0Iso_augmentation : zeroSphereH0Iso.hom ≫ twoIntegerSum = zeroSphereAugmentation := by dsimp only [zeroSphereH0Iso, Iso.trans_hom] rw [Category.assoc, Category.assoc, twoIntegerCoproductIso_sum, zeroSphereComponentCoproductIso_sum] rfl theorem zeroSphereAugmentation_coordinates (x : zeroSphereH0) : zeroSphereAugmentation x = zeroSphereCoordinates x 0 + zeroSphereCoordinates x 1 := by have h := congrArg (fun f ↦ f x) zeroSphereH0Iso_augmentation exact h.symm /-- The homology class of either point, in the canonical component description. -/ def zeroSpherePointClass (i : Fin 2) : zeroSphereH0 := zeroSphereCoordinates.symm (Pi.single i 1) @[simp] theorem zeroSpherePointClass_coordinates (i : Fin 2) : zeroSphereCoordinates (zeroSpherePointClass i) = Pi.single i 1 := zeroSphereCoordinates.apply_symm_apply _ /-- The oriented difference of the two point classes. -/ def zeroSphereDifferenceClass : zeroSphereH0 := zeroSpherePointClass 0 - zeroSpherePointClass 1 @[simp] theorem zeroSphereDifferenceClass_coordinates : zeroSphereCoordinates zeroSphereDifferenceClass = Pi.single 0 1 - Pi.single 1 1 := by simp [zeroSphereDifferenceClass] theorem zeroSphereCoordinates_zsmul (n : ℤ) (x : zeroSphereH0) : zeroSphereCoordinates (n • x) = n • zeroSphereCoordinates x := map_zsmul zeroSphereCoordinates.toLinearMap _ _ @[simp] theorem zeroSphereDifferenceClass_augmentation : zeroSphereAugmentation zeroSphereDifferenceClass = 0 := by rw [zeroSphereAugmentation_coordinates, zeroSphereDifferenceClass_coordinates] simp /-- The kernel of the actual augmentation is freely generated by the difference of the two point classes. -/ theorem zeroSphereAugmentation_kernel_generator (x : zeroSphereH0) (hx : zeroSphereAugmentation x = 0) : ∃! n : ℤ, n • zeroSphereDifferenceClass = x := by have hsum : zeroSphereCoordinates x 0 + zeroSphereCoordinates x 1 = 0 := by rwa [zeroSphereAugmentation_coordinates] at hx refine ⟨zeroSphereCoordinates x 0, ?_, ?_⟩ · apply zeroSphereCoordinates.injective rw [zeroSphereCoordinates_zsmul, zeroSphereDifferenceClass_coordinates] ext i fin_cases i · simp · simp omega · intro n hn have h := congrArg (fun y ↦ zeroSphereCoordinates y 0) hn rw [zeroSphereCoordinates_zsmul, zeroSphereDifferenceClass_coordinates] at h simpa using h /-- The difference class is nonzero, so this generator has infinite order. -/ theorem zeroSphereDifferenceClass_ne_zero : zeroSphereDifferenceClass ≠ 0 := by intro h have h0 := congrArg (fun x ↦ zeroSphereCoordinates x 0) h simp at h0 /-- All positive-degree integral singular homology of the zero-sphere vanishes. -/ theorem zeroSphere_higherHomology_isZero (n : ℕ) (hn : n ≠ 0) : IsZero ((LocalHomology.Cycles.integralSingularChains zeroSphere).homology n) := isZero_singularHomologyFunctor_of_totallyDisconnectedSpace (ModuleCat.{0} ℤ) n (ModuleCat.of ℤ ℤ) zeroSphere hn /-- The unit sphere in the real one-dimensional normed space. -/ abbrev realZeroSphere : TopCat.{0} := TopCat.of (Metric.sphere (0 : ℝ) 1) /-- The two labelled points map to `-1` and `1` on the real unit sphere. -/ def zeroSphereToReal (i : zeroSphere) : realZeroSphere := if i = 0 then ⟨-1, by norm_num [Metric.mem_sphere, Real.dist_eq]⟩ else ⟨1, by norm_num [Metric.mem_sphere, Real.dist_eq]⟩ theorem zeroSphereToReal_bijective : Function.Bijective zeroSphereToReal := by constructor · intro i j hij have hreal := congrArg (fun x : realZeroSphere ↦ (x : ℝ)) hij fin_cases i <;> fin_cases j all_goals first | rfl | norm_num [zeroSphereToReal] at hreal · intro x have hx : |(x : ℝ)| = 1 := by simpa only [Metric.mem_sphere, Real.dist_eq, sub_zero] using x.property rcases le_or_gt (0 : ℝ) (x : ℝ) with hp | hn · refine ⟨1, ?_⟩ apply Subtype.ext have h : (x : ℝ) = 1 := by rwa [abs_of_nonneg hp] at hx simpa [zeroSphereToReal] using h.symm · refine ⟨0, ?_⟩ apply Subtype.ext have h : (x : ℝ) = -1 := by rw [abs_of_neg hn] at hx linarith simpa [zeroSphereToReal] using h.symm /-- The explicit identification of the two-point model with the real unit sphere. -/ def zeroSphereRealHomeomorph : zeroSphere ≃ₜ realZeroSphere := Continuous.homeoOfEquivCompactToT2 (f := Equiv.ofBijective zeroSphereToReal zeroSphereToReal_bijective) continuous_of_discreteTopology /-- Transport of genuine singular homology along the explicit sphere homeomorphism. -/ def realZeroSphereHomologyIso (n : ℕ) : (LocalHomology.Cycles.integralSingularChains realZeroSphere).homology n ≅ (LocalHomology.Cycles.integralSingularChains zeroSphere).homology n := (HomologicalComplex.homologyFunctor (ModuleCat.{0} ℤ) (ComplexShape.down ℕ) n).mapIso (LocalHomology.Cycles.integralSingularChainFunctor.mapIso (TopCat.isoOfHomeo zeroSphereRealHomeomorph.symm)) /-- H₀ of the actual real unit zero-sphere is the direct sum of two copies of ℤ. -/ def realZeroSphereH0Iso : (LocalHomology.Cycles.integralSingularChains realZeroSphere).homology 0 ≅ ModuleCat.of ℤ (Fin 2 → ℤ) := realZeroSphereHomologyIso 0 ≪≫ zeroSphereH0Iso theorem realZeroSphere_higherHomology_isZero (n : ℕ) (hn : n ≠ 0) : IsZero ((LocalHomology.Cycles.integralSingularChains realZeroSphere).homology n) := (zeroSphere_higherHomology_isZero n hn).of_iso (realZeroSphereHomologyIso n) end end OAI.AlgebraicGeometry.CycleClass.Geometric.ZeroSphere.Cycles