Lean library · module TopologyByExample.Spaces.RealProjectivePlane

The real projective plane

Source file

The real projective plane ℝP² is the space of lines through the origin of ℝ³: Mathlib's projectivization ℙ ℝ (EuclideanSpace ℝ (Fin 3)), the quotient of the nonzero vectors by the relation v ~ a • v (a ≠ 0), with the quotient topology.

The embedding into matrices

The work is Hausdorffness. The map sending the line through v to the matrix v vᵀ / ‖v‖² of orthogonal projection onto it is well defined, continuous and injective (TopologyByExample.RealProjectivePlane.injective_proj). Since ℝP² is compact (a continuous image of the sphere), this map is a closed embedding into the metrizable space of 3 × 3 real matrices, so ℝP² is Hausdorff and metrizable.

Main statements

This file was written by Claude (Anthropic's AI model) working under the direction of David R. MacIver, who reviews it and is responsible for it.

Imports

definition RealProjectivePlane

TopologyByExample.RealProjectivePlane

The real projective plane: the lines through the origin of Euclidean ℝ³, with the quotient topology of the nonzero vectors.

abbrev RealProjectivePlane : Type
:= ℙ ℝ (EuclideanSpace ℝ (Fin 3))

On this site: Space: Real projective plane

local notation "E" => EuclideanSpace ℝ (Fin 3)
local notation "S²" => sphere (0 : EuclideanSpace ℝ (Fin 3)) 1

The projection matrix of a line

definition projMatrix

TopologyByExample.RealProjectivePlane.projMatrix

The matrix v vᵀ / ‖v‖² of orthogonal projection onto the line through v, as a function of two indices.

noncomputable def projMatrix (v : E) : Fin 3 → Fin 3 → ℝ
:= fun i j ↦ v i * v j / ‖v‖ ^ 2

theorem continuous_projMatrix

TopologyByExample.RealProjectivePlane.continuous_projMatrix

The projection matrix is continuous away from 0.

theorem continuous_projMatrix : Continuous fun v : {v : E // v ≠ 0} ↦ projMatrix v.val
Proof
:= by
  refine continuous_pi fun i ↦ continuous_pi fun j ↦ ?_
  refine Continuous.div (by fun_prop) (by fun_prop) fun v ↦ ?_
  exact pow_ne_zero _ (norm_ne_zero_iff.2 v.property)

theorem projMatrix_smul

TopologyByExample.RealProjectivePlane.projMatrix_smul

The projection matrix of a nonzero multiple of v is that of v.

theorem projMatrix_smul (v : E) {a : ℝ} (ha : a ≠ 0) : projMatrix (a • v) = projMatrix v
Proof
:= by
  ext i j
  have h : ‖a • v‖ ^ 2 = a ^ 2 * ‖v‖ ^ 2 := by rw [norm_smul, mul_pow, Real.norm_eq_abs, sq_abs]
  by_cases hv : ‖v‖ = 0
  · simp [projMatrix, h, hv]
  · simp only [projMatrix, h, PiLp.smul_apply, smul_eq_mul]
    field_simp

theorem exists_smul_eq_of_projMatrix_eq

TopologyByExample.RealProjectivePlane.exists_smul_eq_of_projMatrix_eq

Nonzero vectors with the same projection matrix span the same line.

theorem exists_smul_eq_of_projMatrix_eq {v w : E} (hv : v ≠ 0) (hw : w ≠ 0)
    (h : projMatrix v = projMatrix w) : ∃ a : ℝ, a • w = v
Proof
:= by
  have hnv : ‖v‖ ^ 2 ≠ 0 := pow_ne_zero _ (norm_ne_zero_iff.2 hv)
  have hnw : ‖w‖ ^ 2 ≠ 0 := pow_ne_zero _ (norm_ne_zero_iff.2 hw)
  have hij (i j : Fin 3) : v i * v j * ‖w‖ ^ 2 = w i * w j * ‖v‖ ^ 2 := by
    have := congrFun (congrFun h i) j
    simp only [projMatrix] at this
    field_simp at this
    linarith
  obtain ⟨i, hi⟩ : ∃ i, v i ≠ 0 := by
    by_contra! H
    exact hv (PiLp.ext H)
  have hwi : w i ≠ 0 := by
    intro hwi
    have := hij i i
    rw [hwi] at this
    simp only [mul_zero, zero_mul] at this
    exact hi (by simpa [hnw] using this)
  refine ⟨v i / w i, PiLp.ext fun j ↦ ?_⟩
  simp only [PiLp.smul_apply, smul_eq_mul]
  have hne : v i * ‖w‖ ^ 2 ≠ 0 := mul_ne_zero hi hnw
  rw [div_mul_eq_mul_div, div_eq_iff hwi]
  refine mul_right_cancel₀ hne ?_
  linear_combination w j * hij i i - w i * hij i j

definition proj

TopologyByExample.RealProjectivePlane.proj

The projection matrix of a line: ℝP² to 3 × 3 real matrices.

noncomputable def proj (p : RealProjectivePlane) : Fin 3 → Fin 3 → ℝ
:= projMatrix p.rep

theorem proj_mk

TopologyByExample.RealProjectivePlane.proj_mk

The projection matrix of the line through v is v vᵀ / ‖v‖².

theorem proj_mk (v : E) (hv : v ≠ 0) : proj (Projectivization.mk ℝ v hv) = projMatrix v
Proof
:= by
  obtain ⟨a, ha⟩ := Projectivization.exists_smul_eq_mk_rep ℝ v hv
  rw [proj, ← ha, Units.smul_def, projMatrix_smul _ a.ne_zero]

theorem continuous_proj

TopologyByExample.RealProjectivePlane.continuous_proj

The projection matrix map is continuous.

theorem continuous_proj : Continuous proj
Proof
:= by
  refine Projectivization.continuous_iff.2 ?_
  convert continuous_projMatrix using 1
  ext v : 1
  exact proj_mk v.val v.property

theorem injective_proj

TopologyByExample.RealProjectivePlane.injective_proj

The projection matrix map is injective: a line is determined by its projection matrix.

theorem injective_proj : Function.Injective proj
Proof
:= by
  intro p q h
  induction p using Projectivization.ind with | h v hv =>
  induction q using Projectivization.ind with | h w hw =>
  rw [proj_mk, proj_mk] at h
  exact (Projectivization.mk_eq_mk_iff' ℝ v w hv hw).2 (exists_smul_eq_of_projMatrix_eq hv hw h)

The map from the sphere

theorem sphere_ne_zero

TopologyByExample.RealProjectivePlane.sphere_ne_zero

A point of the sphere is a nonzero vector.

theorem sphere_ne_zero (x : S²) : (x : E) ≠ 0
Proof
:=
  ne_zero_of_mem_unit_sphere x

definition ofSphere

TopologyByExample.RealProjectivePlane.ofSphere

The map sending a point of the sphere to the line through it.

noncomputable def ofSphere (x : S²) : RealProjectivePlane
:=
  Projectivization.mk ℝ (x : E) (sphere_ne_zero x)

theorem continuous_ofSphere

TopologyByExample.RealProjectivePlane.continuous_ofSphere

The map from the sphere is continuous.

theorem continuous_ofSphere : Continuous ofSphere
Proof
:=
  Projectivization.continuous_mk continuous_subtypeVal sphere_ne_zero

theorem surjective_ofSphere

TopologyByExample.RealProjectivePlane.surjective_ofSphere

Every line through the origin meets the sphere.

theorem surjective_ofSphere : Function.Surjective ofSphere
Proof
:= by
  intro p
  induction p using Projectivization.ind with | h v hv =>
  have hn : ‖v‖ ≠ 0 := norm_ne_zero_iff.2 hv
  refine ⟨⟨‖v‖⁻¹ • v, ?_⟩, ?_⟩
  · rw [mem_sphere_zero_iff_norm, norm_smul, norm_inv, norm_norm, inv_mul_cancel₀ hn]
  · exact (Projectivization.mk_eq_mk_iff' ℝ _ v _ hv).2 ⟨‖v‖⁻¹, rfl⟩

theorem ofSphere_eq_iff

TopologyByExample.RealProjectivePlane.ofSphere_eq_iff

Two points of the sphere span the same line if and only if they are equal or antipodal.

theorem ofSphere_eq_iff (x y : S²) : ofSphere x = ofSphere y ↔ x = y ∨ (x : E) = -(y : E)
Proof
:= by
  refine ⟨fun h ↦ ?_, ?_⟩
  · obtain ⟨a, ha⟩ := (Projectivization.mk_eq_mk_iff' ℝ _ _ _ _).1 h
    have hnorm : ‖(x : E)‖ = |a| * ‖(y : E)‖ := by rw [← ha, norm_smul, Real.norm_eq_abs]
    rw [norm_eq_of_mem_sphere, norm_eq_of_mem_sphere, mul_one] at hnorm
    rcases abs_eq (zero_le_one' ℝ) |>.1 hnorm.symm with rfl | rfl
    · exact Or.inl (Subtype.ext (by simpa using ha.symm))
    · exact Or.inr (by simpa using ha.symm)
  · rintro (rfl | h)
    · rfl
    · exact (Projectivization.mk_eq_mk_iff' ℝ _ _ _ _).2 ⟨-1, by simp [h]⟩

The values

theorem compactSpace

TopologyByExample.RealProjectivePlane.compactSpace

The real projective plane is compact: it is a continuous image of the sphere.

theorem compactSpace : CompactSpace RealProjectivePlane
Proof
:=
  surjective_ofSphere.compactSpace continuous_ofSphere

On this site: The real projective plane is compact

theorem t2Space

TopologyByExample.RealProjectivePlane.t2Space

The real projective plane is Hausdorff: the projection matrix map is a continuous injection into a Hausdorff space.

theorem t2Space : T2Space RealProjectivePlane
Proof
:=
  .of_injective_continuous injective_proj continuous_proj

theorem isClosedEmbedding_proj

TopologyByExample.RealProjectivePlane.isClosedEmbedding_proj

The projection matrix map is a closed embedding.

theorem isClosedEmbedding_proj : IsClosedEmbedding proj
Proof
:=
  haveI := compactSpace
  continuous_proj.isClosedEmbedding injective_proj

theorem metrizableSpace

TopologyByExample.RealProjectivePlane.metrizableSpace

The real projective plane is metrizable: it embeds in the space of 3 × 3 real matrices.

theorem metrizableSpace : MetrizableSpace RealProjectivePlane
Proof
:=
  isClosedEmbedding_proj.isEmbedding.metrizableSpace

On this site: The real projective plane is metrizable

theorem pathPreconnectedSpace

TopologyByExample.RealProjectivePlane.pathPreconnectedSpace

Any two points of the real projective plane are joined by a path: it is a continuous image of the path connected sphere.

theorem pathPreconnectedSpace : PathPreconnectedSpace RealProjectivePlane
Proof
:= by
  refine ⟨fun p q ↦ ?_⟩
  obtain ⟨x, rfl⟩ := surjective_ofSphere p
  obtain ⟨y, rfl⟩ := surjective_ofSphere q
  exact (Sphere.pathPreconnectedSpace.joined x y).map continuous_ofSphere

On this site: The real projective plane is path connected

instance

The nonzero vectors of ℝ³ form a locally path connected space, as an open subset.

instance : LocallyPathConnectedSpace {v : E // v ≠ 0}
Proof
:=
  (isOpen_ne (x := (0 : E))).locallyPathConnectedSpace

theorem locallyPathConnectedSpace

TopologyByExample.RealProjectivePlane.locallyPathConnectedSpace

The real projective plane is locally path connected, as a quotient of the locally path connected space of nonzero vectors.

theorem locallyPathConnectedSpace : LocallyPathConnectedSpace RealProjectivePlane
Proof
:=
  inferInstanceAs <| LocallyPathConnectedSpace <|
    Quotient (projectivizationSetoid ℝ E)

definition line

TopologyByExample.RealProjectivePlane.line

The vector (1, t, 0).

noncomputable def line (t : ℝ) : E
:= !₂[1, t, 0]

theorem line_ne_zero

TopologyByExample.RealProjectivePlane.line_ne_zero

The vector (1, t, 0) is nonzero.

theorem line_ne_zero (t : ℝ) : line t ≠ 0
Proof
:= fun h ↦ by
  simpa [line] using congrArg (fun v : E ↦ v 0) h

theorem injective_mk_line

TopologyByExample.RealProjectivePlane.injective_mk_line

The lines through (1, t, 0), t ∈ ℝ, are distinct.

theorem injective_mk_line :
    Function.Injective fun t ↦ Projectivization.mk ℝ (line t) (line_ne_zero t)
Proof
:= by
  intro s t h
  obtain ⟨a, ha⟩ := (Projectivization.mk_eq_mk_iff' ℝ _ _ _ _).1 h
  have h0 := congrArg (fun v : E ↦ v 0) ha
  have h1 := congrArg (fun v : E ↦ v 1) ha
  have h0' : a = 1 := by simpa [line] using h0
  subst h0'
  simpa [line] using h1.symm

theorem infinite

TopologyByExample.RealProjectivePlane.infinite

The real projective plane is infinite.

theorem infinite : Infinite RealProjectivePlane
Proof
:= Infinite.of_injective _ injective_mk_line

theorem not_finite

TopologyByExample.RealProjectivePlane.not_finite

The real projective plane is not finite.

theorem not_finite : ¬Finite RealProjectivePlane
Proof
:= @Infinite.not_finite _ infinite

On this site: The real projective plane is not finite

theorem nonempty

TopologyByExample.RealProjectivePlane.nonempty

The real projective plane is nonempty.

theorem nonempty : Nonempty RealProjectivePlane
Proof
:=
  haveI := infinite
  inferInstance

theorem nontrivial

TopologyByExample.RealProjectivePlane.nontrivial

The real projective plane has at least two points.

theorem nontrivial : Nontrivial RealProjectivePlane
Proof
:=
  haveI := infinite
  inferInstance

The quotient of the sphere

theorem exists_isQuotientMap_sphere

TopologyByExample.RealProjectivePlane.exists_isQuotientMap_sphere

The real projective plane is the quotient of the sphere by the antipodal identification: there is a quotient map from the sphere onto it that identifies exactly the antipodal pairs.

theorem exists_isQuotientMap_sphere : ∃ q : S² → RealProjectivePlane,
    IsQuotientMap q ∧ ∀ x y : S², q x = q y ↔ x = y ∨ (x : E) = -(y : E)
Proof
:= by
  have := t2Space
  exact ⟨ofSphere, (continuous_ofSphere.isClosedMap).isQuotientMap continuous_ofSphere
    surjective_ofSphere, ofSphere_eq_iff⟩

On this site: Real projective plane: The quotient of the sphere by antipodal points