Skip to content

Commit 2c53994

Browse files
committed
refactor(OnePoint/ProjectiveLine): use Pi instead of Prod (#37696)
At the moment `OnePoint.equivProjectivization` identifies the one-point compactification of `K` with the projective space on `K x K`. This is slightly inconvenient since most of mathlib's linear algebra prefers `Fin n → K`. This PR uses the Pi type instead of the product. This is preparatory to adding more material about fixed points of Moebius transformations, etc, in future PR's.
1 parent 4b13551 commit 2c53994

File tree

1 file changed

+46
-26
lines changed

1 file changed

+46
-26
lines changed

Mathlib/Topology/Compactification/OnePoint/ProjectiveLine.lean

Lines changed: 46 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ public import Mathlib.Topology.Compactification.OnePoint.Basic
1515
# One-point compactification and projectivization
1616
1717
We construct a set-theoretic equivalence between
18-
`OnePoint K` and the projectivization `ℙ K (K × K)` for an arbitrary division ring `K`.
18+
`OnePoint K` and the projectivization `ℙ K (Fin 2 → K)` for an arbitrary division ring `K`.
1919
2020
TODO: Add the extension of this equivalence to a homeomorphism in the case `K = ℝ`,
2121
where `OnePoint ℝ` gets the topology of one-point compactification.
2222
2323
2424
## Main definitions and results
2525
26-
* `OnePoint.equivProjectivization` : the equivalence `OnePoint K ≃ ℙ K (K × K)`.
26+
* `OnePoint.equivProjectivization` : the equivalence `OnePoint K ≃ ℙ K (Fin 2 → K)`.
2727
2828
## Tags
2929
@@ -40,21 +40,37 @@ section MatrixProdAction
4040

4141
variable {R n : Type*} [Semiring R] [Fintype n] [DecidableEq n]
4242

43+
@[simp] lemma Matrix.mulVec_fin_two (m : Matrix (Fin 2) (Fin 2) R) (v : Fin 2 → R) :
44+
m *ᵥ v = ![m 0 0 * v 0 + m 0 1 * v 1, m 1 0 * v 0 + m 1 1 * v 1] := by
45+
ext i
46+
fin_cases i <;>
47+
simp [mulVec_eq_sum]
48+
49+
@[simp] lemma Matrix.GeneralLinearGroup.fin_two_smul {R : Type*} [CommRing R]
50+
(g : GL (Fin 2) R) (v : Fin 2 → R) :
51+
g • v = ![g 0 0 * v 0 + g 0 1 * v 1, g 1 0 * v 0 + g 1 1 * v 1] := by
52+
simp [Units.smul_def]
53+
54+
@[deprecated "use Fin 2 → R instead" (since := "2026-04-19")]
4355
instance : Module (Matrix (Fin 2) (Fin 2) R) (R × R) :=
4456
(LinearEquiv.finTwoArrow R R).symm.toAddEquiv.module _
4557

58+
@[deprecated "use Fin 2 → R instead" (since := "2026-04-19")]
4659
instance {S} [DistribSMul S R] [SMulCommClass R S R] :
4760
SMulCommClass (Matrix (Fin 2) (Fin 2) R) S (R × R) :=
4861
(LinearEquiv.finTwoArrow R R).symm.smulCommClass _ _
4962

50-
@[simp] lemma Matrix.fin_two_smul_prod (g : Matrix (Fin 2) (Fin 2) R) (v : R × R) :
63+
@[deprecated "use Fin 2 → R instead" (since := "2026-04-19")]
64+
lemma Matrix.fin_two_smul_prod (g : Matrix (Fin 2) (Fin 2) R) (v : R × R) :
5165
g • v = (g 0 0 * v.1 + g 0 1 * v.2, g 1 0 * v.1 + g 1 1 * v.2) := by
5266
simp [Equiv.smul_def, smul_eq_mulVec, Matrix.mulVec_eq_sum]
5367

54-
@[simp] lemma Matrix.GeneralLinearGroup.fin_two_smul_prod {R : Type*} [CommRing R]
68+
set_option linter.deprecated false in
69+
@[deprecated Matrix.GeneralLinearGroup.fin_two_smul (since := "2026-04-19")]
70+
lemma Matrix.GeneralLinearGroup.fin_two_smul_prod {R : Type*} [CommRing R]
5571
(g : GL (Fin 2) R) (v : R × R) :
5672
g • v = (g 0 0 * v.1 + g 0 1 * v.2, g 1 0 * v.1 + g 1 1 * v.2) := by
57-
simp [Units.smul_def]
73+
simp [Units.smul_def, Matrix.fin_two_smul_prod]
5874

5975
end MatrixProdAction
6076

@@ -65,40 +81,39 @@ section DivisionRing
6581
variable (K : Type*) [DivisionRing K] [DecidableEq K]
6682

6783
/-- The one-point compactification of a division ring `K` is equivalent to
68-
the projectivization `ℙ K (K × K)`. -/
69-
def equivProjectivization :
70-
OnePoint K ≃ ℙ K (K × K) where
71-
toFun p := p.elim (mk K (1, 0) (by simp)) (fun t ↦ mk K (t, 1) (by simp))
84+
the projectivization `ℙ K (Fin 2 → K)`. -/
85+
def equivProjectivization : OnePoint K ≃ ℙ K (Fin 2 → K) where
86+
toFun p := p.elim (mk K ![1, 0] (by simp)) (fun t ↦ mk K ![t, 1] (by simp))
7287
invFun p := by
7388
refine Projectivization.lift
74-
(fun u : {v : K × K // v ≠ 0} ↦ if u.1.2 = 0 thenelse ((u.1.2)⁻¹ * u.1.1)) ?_ p
75-
rintro ⟨-, hv⟩ ⟨⟨x, y⟩, hw⟩ t rfl
89+
(fun u : {v : Fin 2K // v ≠ 0} ↦ if u.1 1 = 0 thenelse ((u.1 1)⁻¹ * u.1 0)) ?_ p
90+
rintro ⟨-, hv⟩ ⟨w, hw⟩ t rfl
7691
have ht : t ≠ 0 := by rintro rfl; simp at hv
77-
by_cases h₀ : y = 0 <;> simp [h₀, ht, mul_assoc]
92+
by_cases h₀ : w 1 = 0 <;> simp [h₀, ht, mul_assoc]
7893
left_inv p := by cases p <;> simp
7994
right_inv p := by
80-
induction p using ind with | h p hp =>
81-
obtain ⟨x, y⟩ := p
82-
by_cases h₀ : y = 0 <;> simp only [mk_eq_mk_iff', h₀, Projectivization.lift_mk, if_true,
83-
if_false, OnePoint.elim_infty, OnePoint.elim_some, Prod.smul_mk, Prod.mk.injEq, smul_eq_mul,
84-
mul_zero, and_true]
85-
· use x⁻¹
86-
simp_all
87-
· exact ⟨y⁻¹, rfl, inv_mul_cancel₀ h₀⟩
95+
induction p using ind with | h w hw =>
96+
by_cases h₀ : w 1 = 0 <;> simp only [mk_eq_mk_iff', h₀, Projectivization.lift_mk, if_true,
97+
if_false, OnePoint.elim_infty, OnePoint.elim_some]
98+
· have : w 00 := fun h ↦ hw <| funext <| by simp_all
99+
use (w 0)⁻¹
100+
ext i
101+
fin_cases i <;> simp_all
102+
· exact ⟨(w 1)⁻¹, funext <| by simp [inv_mul_cancel₀ h₀]
88103

89104
@[simp]
90105
lemma equivProjectivization_apply_infinity :
91-
equivProjectivization K ∞ = mk K 1, 0 (by simp) :=
106+
equivProjectivization K ∞ = mk K ![1, 0] (by simp) :=
92107
rfl
93108

94109
@[simp]
95110
lemma equivProjectivization_apply_coe (t : K) :
96-
equivProjectivization K t = mk K t, 1 (by simp) :=
111+
equivProjectivization K t = mk K ![t, 1] (by simp) :=
97112
rfl
98113

99114
@[simp]
100-
lemma equivProjectivization_symm_apply_mk (x y : K) (h : (x, y)0) :
101-
(equivProjectivization K).symm (mk K ⟨x, y⟩ h) = if y = 0 thenelse y⁻¹ * x := by
115+
lemma equivProjectivization_symm_apply_mk (v : Fin 2K) (h : v0) :
116+
(equivProjectivization K).symm (mk K v h) = if v 1 = 0 thenelse (v 1)⁻¹ * v 0 := by
102117
simp [equivProjectivization]
103118

104119
end DivisionRing
@@ -112,9 +127,14 @@ with the `ℙ¹(K)` (which is given explicitly by Möbius transformations). -/
112127
instance instGLAction : MulAction (GL (Fin 2) K) (OnePoint K) :=
113128
(equivProjectivization K).mulAction (GL (Fin 2) K)
114129

130+
lemma equivProjectivization_smul {g : GL (Fin 2) K} (x : OnePoint K) :
131+
equivProjectivization K (g • x) = g • equivProjectivization K x := by
132+
rw [Equiv.smul_def, Equiv.apply_symm_apply]
133+
115134
lemma smul_infty_def {g : GL (Fin 2) K} :
116-
g • ∞ = (equivProjectivization K).symm (.mk K (g 0 0, g 1 0) (fun h ↦ by
117-
simpa [det_fin_two, Prod.mk_eq_zero.mp h] using g.det_ne_zero)) := by
135+
g • ∞ = (equivProjectivization K).symm (.mk K ![g 0 0, g 1 0] (fun h ↦ by
136+
simpa [det_fin_two, show g 0 0 = 0 from congr_fun h 0, show g 1 0 = 0 from congr_fun h 1]
137+
using g.det_ne_zero)) := by
118138
simp [Equiv.smul_def, mulVec_eq_sum, Units.smul_def]
119139

120140
lemma smul_infty_eq_ite (g : GL (Fin 2) K) :

0 commit comments

Comments
 (0)